@mj-biz-apps/orders-ng 5.36.0 → 5.37.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/checkout-element/main.js +491 -154
- package/dist/lib/checkout-widget/checkout-complete.d.ts +53 -0
- package/dist/lib/checkout-widget/checkout-complete.d.ts.map +1 -0
- package/dist/lib/checkout-widget/checkout-complete.js +92 -0
- package/dist/lib/checkout-widget/checkout-complete.js.map +1 -0
- package/dist/lib/checkout-widget/checkout-draft-line.d.ts +7 -1
- package/dist/lib/checkout-widget/checkout-draft-line.d.ts.map +1 -1
- package/dist/lib/checkout-widget/checkout-draft-line.js +18 -0
- package/dist/lib/checkout-widget/checkout-draft-line.js.map +1 -1
- package/dist/lib/checkout-widget/checkout-public-host.component.d.ts +56 -0
- package/dist/lib/checkout-widget/checkout-public-host.component.d.ts.map +1 -1
- package/dist/lib/checkout-widget/checkout-public-host.component.js +245 -113
- package/dist/lib/checkout-widget/checkout-public-host.component.js.map +1 -1
- package/dist/lib/checkout-widget/checkout-widget.component.d.ts +35 -2
- package/dist/lib/checkout-widget/checkout-widget.component.d.ts.map +1 -1
- package/dist/lib/checkout-widget/checkout-widget.component.js +145 -45
- package/dist/lib/checkout-widget/checkout-widget.component.js.map +1 -1
- package/dist/lib/custom/OrderHeader/order-lines-editor.component.d.ts +7 -0
- package/dist/lib/custom/OrderHeader/order-lines-editor.component.d.ts.map +1 -1
- package/dist/lib/custom/OrderHeader/order-lines-editor.component.js +23 -22
- package/dist/lib/custom/OrderHeader/order-lines-editor.component.js.map +1 -1
- package/dist/lib/data/orders-queries.d.ts +3 -1
- package/dist/lib/data/orders-queries.d.ts.map +1 -1
- package/dist/lib/data/orders-queries.js.map +1 -1
- package/package.json +2 -2
|
@@ -13,8 +13,9 @@ import { ACCOUNT_STEP_FAILED, AccountMessage, CheckPasswordEntry, IsAccountSettl
|
|
|
13
13
|
import { BuildCheckoutCompleteDetail, CHECKOUT_CANCEL_EVENT, CHECKOUT_CLOSE_EVENT, CHECKOUT_RESET_REFUSED_EVENT, CHECKOUT_RESET_REQUEST_EVENT, CHECKOUT_COMPLETE_EVENT, CHECKOUT_ERROR_EVENT, CHECKOUT_STATE_CHANGE_EVENT, CheckoutElementEvent, } from './checkout-events.js';
|
|
14
14
|
import { ACCESS_POLL_INTERVAL_MS, ACCESS_POLL_TIMEOUT_MS, AccessMessage, CHECKOUT_ACCESS_STATE_EVENT, IsFinalAccessState, ReadAccessState, } from './checkout-access.js';
|
|
15
15
|
import { MJCheckoutWidgetComponent, } from './checkout-widget.component.js';
|
|
16
|
-
import { alreadySubscribedDetail, buildCheckoutDraftLine, formatStripeError, intentAlreadyCollected, memberDiscountNotice, stripeConfirmAlreadyCollected, } from './checkout-draft-line.js';
|
|
16
|
+
import { alreadySubscribedDetail, buildCheckoutDraftLine, formatStripeError, intentAlreadyCollected, memberDiscountFromDraft, memberDiscountNotice, stripeConfirmAlreadyCollected, } from './checkout-draft-line.js';
|
|
17
17
|
import { PostWithTurnstile, TurnstileError, TurnstileWidget } from './checkout-turnstile.js';
|
|
18
|
+
import { CheckoutTransportError, COMPLETE_DELAYED_MESSAGE, COMPLETE_FINISHING_MESSAGE, COMPLETE_RETRY_INTERVAL_MS, COMPLETE_RETRY_TIMEOUT_MS, CompleteWithRetry, ReadCheckoutReply, } from './checkout-complete.js';
|
|
18
19
|
import { FormatRenewalAmount, ReadRenewalPayment, RenewalPaidMessage } from './checkout-renewal.js';
|
|
19
20
|
import * as i0 from "@angular/core";
|
|
20
21
|
const _c0 = a0 => [a0];
|
|
@@ -28,7 +29,7 @@ function CheckoutPublicHostComponent_Conditional_1_Template(rf, ctx) { if (rf &
|
|
|
28
29
|
i0.ɵɵtextInterpolate(ctx_r0.loadError);
|
|
29
30
|
} }
|
|
30
31
|
function CheckoutPublicHostComponent_Conditional_2_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
31
|
-
i0.ɵɵelementStart(0, "p",
|
|
32
|
+
i0.ɵɵelementStart(0, "p", 10);
|
|
32
33
|
i0.ɵɵtext(1);
|
|
33
34
|
i0.ɵɵelementEnd();
|
|
34
35
|
} if (rf & 2) {
|
|
@@ -37,7 +38,7 @@ function CheckoutPublicHostComponent_Conditional_2_Conditional_7_Template(rf, ct
|
|
|
37
38
|
i0.ɵɵtextInterpolate1("Order ", ctx_r0.orderNumber);
|
|
38
39
|
} }
|
|
39
40
|
function CheckoutPublicHostComponent_Conditional_2_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
40
|
-
i0.ɵɵelementStart(0, "p",
|
|
41
|
+
i0.ɵɵelementStart(0, "p", 14);
|
|
41
42
|
i0.ɵɵtext(1);
|
|
42
43
|
i0.ɵɵelementEnd();
|
|
43
44
|
} if (rf & 2) {
|
|
@@ -47,12 +48,12 @@ function CheckoutPublicHostComponent_Conditional_2_Conditional_8_Template(rf, ct
|
|
|
47
48
|
i0.ɵɵtextInterpolate(ctx_r0.accessMessage);
|
|
48
49
|
} }
|
|
49
50
|
function CheckoutPublicHostComponent_Conditional_2_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
50
|
-
i0.ɵɵelementStart(0, "p",
|
|
51
|
+
i0.ɵɵelementStart(0, "p", 12);
|
|
51
52
|
i0.ɵɵtext(1, "Setting up your account\u2026");
|
|
52
53
|
i0.ɵɵelementEnd();
|
|
53
54
|
} }
|
|
54
55
|
function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
55
|
-
i0.ɵɵelementStart(0, "p",
|
|
56
|
+
i0.ɵɵelementStart(0, "p", 17);
|
|
56
57
|
i0.ɵɵtext(1);
|
|
57
58
|
i0.ɵɵelementEnd();
|
|
58
59
|
} if (rf & 2) {
|
|
@@ -61,7 +62,7 @@ function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_3_
|
|
|
61
62
|
i0.ɵɵtextInterpolate(ctx_r0.verificationNote);
|
|
62
63
|
} }
|
|
63
64
|
function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
64
|
-
i0.ɵɵelementStart(0, "p",
|
|
65
|
+
i0.ɵɵelementStart(0, "p", 22);
|
|
65
66
|
i0.ɵɵtext(1);
|
|
66
67
|
i0.ɵɵelementEnd();
|
|
67
68
|
} if (rf & 2) {
|
|
@@ -71,29 +72,29 @@ function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_10
|
|
|
71
72
|
} }
|
|
72
73
|
function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
73
74
|
const _r2 = i0.ɵɵgetCurrentView();
|
|
74
|
-
i0.ɵɵelementStart(0, "form",
|
|
75
|
+
i0.ɵɵelementStart(0, "form", 15);
|
|
75
76
|
i0.ɵɵlistener("submit", function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Template_form_submit_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); $event.preventDefault(); return i0.ɵɵresetView(ctx_r0.submitPassword()); });
|
|
76
|
-
i0.ɵɵelementStart(1, "h2",
|
|
77
|
+
i0.ɵɵelementStart(1, "h2", 16);
|
|
77
78
|
i0.ɵɵtext(2, "Set a password for your account");
|
|
78
79
|
i0.ɵɵelementEnd();
|
|
79
|
-
i0.ɵɵconditionalCreate(3, CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_3_Template, 2, 1, "p",
|
|
80
|
-
i0.ɵɵelementStart(4, "label",
|
|
80
|
+
i0.ɵɵconditionalCreate(3, CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_3_Template, 2, 1, "p", 17);
|
|
81
|
+
i0.ɵɵelementStart(4, "label", 18);
|
|
81
82
|
i0.ɵɵtext(5, "Password");
|
|
82
83
|
i0.ɵɵelementEnd();
|
|
83
|
-
i0.ɵɵelementStart(6, "input",
|
|
84
|
+
i0.ɵɵelementStart(6, "input", 19);
|
|
84
85
|
i0.ɵɵlistener("input", function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Template_input_input_6_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.password = $event.target.value); });
|
|
85
86
|
i0.ɵɵelementEnd();
|
|
86
|
-
i0.ɵɵelementStart(7, "label",
|
|
87
|
+
i0.ɵɵelementStart(7, "label", 20);
|
|
87
88
|
i0.ɵɵtext(8, "Confirm password");
|
|
88
89
|
i0.ɵɵelementEnd();
|
|
89
|
-
i0.ɵɵelementStart(9, "input",
|
|
90
|
+
i0.ɵɵelementStart(9, "input", 21);
|
|
90
91
|
i0.ɵɵlistener("input", function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Template_input_input_9_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.passwordConfirmation = $event.target.value); });
|
|
91
92
|
i0.ɵɵelementEnd();
|
|
92
|
-
i0.ɵɵconditionalCreate(10, CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_10_Template, 2, 1, "p",
|
|
93
|
-
i0.ɵɵelementStart(11, "button",
|
|
93
|
+
i0.ɵɵconditionalCreate(10, CheckoutPublicHostComponent_Conditional_2_Conditional_10_Conditional_10_Template, 2, 1, "p", 22);
|
|
94
|
+
i0.ɵɵelementStart(11, "button", 23);
|
|
94
95
|
i0.ɵɵtext(12);
|
|
95
96
|
i0.ɵɵelementEnd();
|
|
96
|
-
i0.ɵɵelementStart(13, "button",
|
|
97
|
+
i0.ɵɵelementStart(13, "button", 24);
|
|
97
98
|
i0.ɵɵlistener("click", function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Template_button_click_13_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.skipPassword()); });
|
|
98
99
|
i0.ɵɵtext(14, " Not now ");
|
|
99
100
|
i0.ɵɵelementEnd()();
|
|
@@ -116,18 +117,18 @@ function CheckoutPublicHostComponent_Conditional_2_Conditional_10_Template(rf, c
|
|
|
116
117
|
} }
|
|
117
118
|
function CheckoutPublicHostComponent_Conditional_2_Conditional_11_Conditional_2_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
118
119
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
119
|
-
i0.ɵɵelementStart(0, "button",
|
|
120
|
+
i0.ɵɵelementStart(0, "button", 28);
|
|
120
121
|
i0.ɵɵlistener("click", function CheckoutPublicHostComponent_Conditional_2_Conditional_11_Conditional_2_Conditional_3_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r0.dismissAccount()); });
|
|
121
122
|
i0.ɵɵtext(1, "Not now");
|
|
122
123
|
i0.ɵɵelementEnd();
|
|
123
124
|
} }
|
|
124
125
|
function CheckoutPublicHostComponent_Conditional_2_Conditional_11_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
125
126
|
const _r3 = i0.ɵɵgetCurrentView();
|
|
126
|
-
i0.ɵɵelementStart(0, "div",
|
|
127
|
+
i0.ɵɵelementStart(0, "div", 25)(1, "button", 26);
|
|
127
128
|
i0.ɵɵlistener("click", function CheckoutPublicHostComponent_Conditional_2_Conditional_11_Conditional_2_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.retryAccount()); });
|
|
128
129
|
i0.ɵɵtext(2, "Try again");
|
|
129
130
|
i0.ɵɵelementEnd();
|
|
130
|
-
i0.ɵɵconditionalCreate(3, CheckoutPublicHostComponent_Conditional_2_Conditional_11_Conditional_2_Conditional_3_Template, 2, 0, "button",
|
|
131
|
+
i0.ɵɵconditionalCreate(3, CheckoutPublicHostComponent_Conditional_2_Conditional_11_Conditional_2_Conditional_3_Template, 2, 0, "button", 27);
|
|
131
132
|
i0.ɵɵelementEnd();
|
|
132
133
|
} if (rf & 2) {
|
|
133
134
|
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
@@ -135,10 +136,10 @@ function CheckoutPublicHostComponent_Conditional_2_Conditional_11_Conditional_2_
|
|
|
135
136
|
i0.ɵɵconditional((ctx_r0.config == null ? null : ctx_r0.config.redirectUrl) ? 3 : -1);
|
|
136
137
|
} }
|
|
137
138
|
function CheckoutPublicHostComponent_Conditional_2_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
138
|
-
i0.ɵɵelementStart(0, "p",
|
|
139
|
+
i0.ɵɵelementStart(0, "p", 12);
|
|
139
140
|
i0.ɵɵtext(1);
|
|
140
141
|
i0.ɵɵelementEnd();
|
|
141
|
-
i0.ɵɵconditionalCreate(2, CheckoutPublicHostComponent_Conditional_2_Conditional_11_Conditional_2_Template, 4, 1, "div",
|
|
142
|
+
i0.ɵɵconditionalCreate(2, CheckoutPublicHostComponent_Conditional_2_Conditional_11_Conditional_2_Template, 4, 1, "div", 25);
|
|
142
143
|
} if (rf & 2) {
|
|
143
144
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
144
145
|
i0.ɵɵadvance();
|
|
@@ -147,18 +148,18 @@ function CheckoutPublicHostComponent_Conditional_2_Conditional_11_Template(rf, c
|
|
|
147
148
|
i0.ɵɵconditional((ctx_r0.account == null ? null : ctx_r0.account.Outcome) === "Failed" ? 2 : -1);
|
|
148
149
|
} }
|
|
149
150
|
function CheckoutPublicHostComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
150
|
-
i0.ɵɵelementStart(0, "div", 2)(1, "div",
|
|
151
|
+
i0.ɵɵelementStart(0, "div", 2)(1, "div", 7);
|
|
151
152
|
i0.ɵɵtext(2, "\u2713");
|
|
152
153
|
i0.ɵɵelementEnd();
|
|
153
|
-
i0.ɵɵelementStart(3, "h1",
|
|
154
|
+
i0.ɵɵelementStart(3, "h1", 8);
|
|
154
155
|
i0.ɵɵtext(4, "You're all set");
|
|
155
156
|
i0.ɵɵelementEnd();
|
|
156
|
-
i0.ɵɵelementStart(5, "p",
|
|
157
|
+
i0.ɵɵelementStart(5, "p", 9);
|
|
157
158
|
i0.ɵɵtext(6);
|
|
158
159
|
i0.ɵɵelementEnd();
|
|
159
|
-
i0.ɵɵconditionalCreate(7, CheckoutPublicHostComponent_Conditional_2_Conditional_7_Template, 2, 1, "p",
|
|
160
|
-
i0.ɵɵconditionalCreate(8, CheckoutPublicHostComponent_Conditional_2_Conditional_8_Template, 2, 3, "p",
|
|
161
|
-
i0.ɵɵconditionalCreate(9, CheckoutPublicHostComponent_Conditional_2_Conditional_9_Template, 2, 0, "p",
|
|
160
|
+
i0.ɵɵconditionalCreate(7, CheckoutPublicHostComponent_Conditional_2_Conditional_7_Template, 2, 1, "p", 10);
|
|
161
|
+
i0.ɵɵconditionalCreate(8, CheckoutPublicHostComponent_Conditional_2_Conditional_8_Template, 2, 3, "p", 11);
|
|
162
|
+
i0.ɵɵconditionalCreate(9, CheckoutPublicHostComponent_Conditional_2_Conditional_9_Template, 2, 0, "p", 12)(10, CheckoutPublicHostComponent_Conditional_2_Conditional_10_Template, 15, 7, "form", 13)(11, CheckoutPublicHostComponent_Conditional_2_Conditional_11_Template, 3, 2);
|
|
162
163
|
i0.ɵɵelementEnd();
|
|
163
164
|
} if (rf & 2) {
|
|
164
165
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
@@ -172,12 +173,21 @@ function CheckoutPublicHostComponent_Conditional_2_Template(rf, ctx) { if (rf &
|
|
|
172
173
|
i0.ɵɵconditional(ctx_r0.accountLoading ? 9 : (ctx_r0.account == null ? null : ctx_r0.account.CanSetPassword) ? 10 : ctx_r0.accountMessage ? 11 : -1);
|
|
173
174
|
} }
|
|
174
175
|
function CheckoutPublicHostComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
175
|
-
i0.ɵɵelementStart(0, "
|
|
176
|
+
i0.ɵɵelementStart(0, "div", 3)(1, "p", 9);
|
|
177
|
+
i0.ɵɵtext(2);
|
|
178
|
+
i0.ɵɵelementEnd()();
|
|
179
|
+
} if (rf & 2) {
|
|
180
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
181
|
+
i0.ɵɵadvance(2);
|
|
182
|
+
i0.ɵɵtextInterpolate(ctx_r0.finishingMessage);
|
|
183
|
+
} }
|
|
184
|
+
function CheckoutPublicHostComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
185
|
+
i0.ɵɵelementStart(0, "p", 4);
|
|
176
186
|
i0.ɵɵtext(1, "Loading checkout\u2026");
|
|
177
187
|
i0.ɵɵelementEnd();
|
|
178
188
|
} }
|
|
179
|
-
function
|
|
180
|
-
i0.ɵɵelementStart(0, "div",
|
|
189
|
+
function CheckoutPublicHostComponent_Conditional_5_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
190
|
+
i0.ɵɵelementStart(0, "div", 33)(1, "dt");
|
|
181
191
|
i0.ɵɵtext(2, "Renewal of");
|
|
182
192
|
i0.ɵɵelementEnd();
|
|
183
193
|
i0.ɵɵelementStart(3, "dd");
|
|
@@ -188,8 +198,8 @@ function CheckoutPublicHostComponent_Conditional_4_Conditional_6_Template(rf, ct
|
|
|
188
198
|
i0.ɵɵadvance(4);
|
|
189
199
|
i0.ɵɵtextInterpolate(ctx_r0.renewal.Description);
|
|
190
200
|
} }
|
|
191
|
-
function
|
|
192
|
-
i0.ɵɵelementStart(0, "div",
|
|
201
|
+
function CheckoutPublicHostComponent_Conditional_5_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
202
|
+
i0.ɵɵelementStart(0, "div", 33)(1, "dt");
|
|
193
203
|
i0.ɵɵtext(2, "Subscription");
|
|
194
204
|
i0.ɵɵelementEnd();
|
|
195
205
|
i0.ɵɵelementStart(3, "dd");
|
|
@@ -200,8 +210,8 @@ function CheckoutPublicHostComponent_Conditional_4_Conditional_7_Template(rf, ct
|
|
|
200
210
|
i0.ɵɵadvance(4);
|
|
201
211
|
i0.ɵɵtextInterpolate(ctx_r0.renewal.SubscriptionNumber);
|
|
202
212
|
} }
|
|
203
|
-
function
|
|
204
|
-
i0.ɵɵelementStart(0, "div",
|
|
213
|
+
function CheckoutPublicHostComponent_Conditional_5_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
214
|
+
i0.ɵɵelementStart(0, "div", 33)(1, "dt");
|
|
205
215
|
i0.ɵɵtext(2, "Due");
|
|
206
216
|
i0.ɵɵelementEnd();
|
|
207
217
|
i0.ɵɵelementStart(3, "dd");
|
|
@@ -212,13 +222,13 @@ function CheckoutPublicHostComponent_Conditional_4_Conditional_13_Template(rf, c
|
|
|
212
222
|
i0.ɵɵadvance(4);
|
|
213
223
|
i0.ɵɵtextInterpolate(ctx_r0.renewal.DueDate);
|
|
214
224
|
} }
|
|
215
|
-
function
|
|
216
|
-
i0.ɵɵelementStart(0, "label",
|
|
225
|
+
function CheckoutPublicHostComponent_Conditional_5_Conditional_19_Template(rf, ctx) { if (rf & 1) {
|
|
226
|
+
i0.ɵɵelementStart(0, "label", 37);
|
|
217
227
|
i0.ɵɵtext(1, "Card");
|
|
218
228
|
i0.ɵɵelementEnd();
|
|
219
|
-
i0.ɵɵelement(2, "div",
|
|
229
|
+
i0.ɵɵelement(2, "div", 38);
|
|
220
230
|
} }
|
|
221
|
-
function
|
|
231
|
+
function CheckoutPublicHostComponent_Conditional_5_Conditional_22_Template(rf, ctx) { if (rf & 1) {
|
|
222
232
|
i0.ɵɵelementStart(0, "div", 1);
|
|
223
233
|
i0.ɵɵtext(1);
|
|
224
234
|
i0.ɵɵelementEnd();
|
|
@@ -227,38 +237,38 @@ function CheckoutPublicHostComponent_Conditional_4_Conditional_22_Template(rf, c
|
|
|
227
237
|
i0.ɵɵadvance();
|
|
228
238
|
i0.ɵɵtextInterpolate(ctx_r0.errorMessage);
|
|
229
239
|
} }
|
|
230
|
-
function
|
|
240
|
+
function CheckoutPublicHostComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
231
241
|
const _r5 = i0.ɵɵgetCurrentView();
|
|
232
|
-
i0.ɵɵelementStart(0, "form",
|
|
233
|
-
i0.ɵɵlistener("submit", function
|
|
234
|
-
i0.ɵɵelementStart(1, "h1",
|
|
242
|
+
i0.ɵɵelementStart(0, "form", 29);
|
|
243
|
+
i0.ɵɵlistener("submit", function CheckoutPublicHostComponent_Conditional_5_Template_form_submit_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(); $event.preventDefault(); return i0.ɵɵresetView(ctx_r0.payRenewal()); });
|
|
244
|
+
i0.ɵɵelementStart(1, "h1", 30);
|
|
235
245
|
i0.ɵɵtext(2, "Renew your subscription");
|
|
236
246
|
i0.ɵɵelementEnd();
|
|
237
|
-
i0.ɵɵelementStart(3, "p",
|
|
247
|
+
i0.ɵɵelementStart(3, "p", 31);
|
|
238
248
|
i0.ɵɵtext(4, "Your saved card could not be charged. Pay with a new card to keep your subscription active.");
|
|
239
249
|
i0.ɵɵelementEnd();
|
|
240
|
-
i0.ɵɵelementStart(5, "dl",
|
|
241
|
-
i0.ɵɵconditionalCreate(6,
|
|
242
|
-
i0.ɵɵconditionalCreate(7,
|
|
243
|
-
i0.ɵɵelementStart(8, "div",
|
|
250
|
+
i0.ɵɵelementStart(5, "dl", 32);
|
|
251
|
+
i0.ɵɵconditionalCreate(6, CheckoutPublicHostComponent_Conditional_5_Conditional_6_Template, 5, 1, "div", 33);
|
|
252
|
+
i0.ɵɵconditionalCreate(7, CheckoutPublicHostComponent_Conditional_5_Conditional_7_Template, 5, 1, "div", 33);
|
|
253
|
+
i0.ɵɵelementStart(8, "div", 33)(9, "dt");
|
|
244
254
|
i0.ɵɵtext(10, "Renewal order");
|
|
245
255
|
i0.ɵɵelementEnd();
|
|
246
256
|
i0.ɵɵelementStart(11, "dd");
|
|
247
257
|
i0.ɵɵtext(12);
|
|
248
258
|
i0.ɵɵelementEnd()();
|
|
249
|
-
i0.ɵɵconditionalCreate(13,
|
|
250
|
-
i0.ɵɵelementStart(14, "div",
|
|
259
|
+
i0.ɵɵconditionalCreate(13, CheckoutPublicHostComponent_Conditional_5_Conditional_13_Template, 5, 1, "div", 33);
|
|
260
|
+
i0.ɵɵelementStart(14, "div", 34)(15, "dt");
|
|
251
261
|
i0.ɵɵtext(16, "Amount due");
|
|
252
262
|
i0.ɵɵelementEnd();
|
|
253
263
|
i0.ɵɵelementStart(17, "dd");
|
|
254
264
|
i0.ɵɵtext(18);
|
|
255
265
|
i0.ɵɵelementEnd()()();
|
|
256
|
-
i0.ɵɵconditionalCreate(19,
|
|
257
|
-
i0.ɵɵelementStart(20, "p",
|
|
266
|
+
i0.ɵɵconditionalCreate(19, CheckoutPublicHostComponent_Conditional_5_Conditional_19_Template, 3, 0);
|
|
267
|
+
i0.ɵɵelementStart(20, "p", 35);
|
|
258
268
|
i0.ɵɵtext(21, "The card you pay with will be charged for future renewals.");
|
|
259
269
|
i0.ɵɵelementEnd();
|
|
260
|
-
i0.ɵɵconditionalCreate(22,
|
|
261
|
-
i0.ɵɵelementStart(23, "button",
|
|
270
|
+
i0.ɵɵconditionalCreate(22, CheckoutPublicHostComponent_Conditional_5_Conditional_22_Template, 2, 1, "div", 1);
|
|
271
|
+
i0.ɵɵelementStart(23, "button", 36);
|
|
262
272
|
i0.ɵɵtext(24);
|
|
263
273
|
i0.ɵɵelementEnd()();
|
|
264
274
|
} if (rf & 2) {
|
|
@@ -282,17 +292,17 @@ function CheckoutPublicHostComponent_Conditional_4_Template(rf, ctx) { if (rf &
|
|
|
282
292
|
i0.ɵɵadvance();
|
|
283
293
|
i0.ɵɵtextInterpolate1(" ", ctx_r0.processing ? "Processing\u2026" : "Pay " + ctx_r0.renewalAmount, " ");
|
|
284
294
|
} }
|
|
285
|
-
function
|
|
295
|
+
function CheckoutPublicHostComponent_Conditional_6_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
286
296
|
const _r6 = i0.ɵɵgetCurrentView();
|
|
287
|
-
i0.ɵɵelementStart(0, "mj-checkout-widget",
|
|
288
|
-
i0.ɵɵlistener("promotionCodeApplied", function
|
|
297
|
+
i0.ɵɵelementStart(0, "mj-checkout-widget", 40);
|
|
298
|
+
i0.ɵɵlistener("promotionCodeApplied", function CheckoutPublicHostComponent_Conditional_6_For_1_Template_mj_checkout_widget_promotionCodeApplied_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onPromotionCodeApplied($event)); })("submitted", function CheckoutPublicHostComponent_Conditional_6_For_1_Template_mj_checkout_widget_submitted_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onSubmitted($event)); })("cancelled", function CheckoutPublicHostComponent_Conditional_6_For_1_Template_mj_checkout_widget_cancelled_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onCancelled()); })("quoteInvalidated", function CheckoutPublicHostComponent_Conditional_6_For_1_Template_mj_checkout_widget_quoteInvalidated_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onQuoteInvalidated()); })("quoteRequested", function CheckoutPublicHostComponent_Conditional_6_For_1_Template_mj_checkout_widget_quoteRequested_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onQuoteRequested($event)); });
|
|
289
299
|
i0.ɵɵelementEnd();
|
|
290
300
|
} if (rf & 2) {
|
|
291
301
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
292
|
-
i0.ɵɵproperty("config", ctx_r0.config)("distributionSlug", ctx_r0.slug)("sessionKey", ctx_r0.sessionKey)("isProcessing", ctx_r0.processing)("isPaymentReady", ctx_r0.isPaymentReady)("stripePaymentMethodId", ctx_r0.stripePaymentMethodId)("prefillEmail", ctx_r0.prefillEmail)("errorMessage", ctx_r0.errorMessage)("appliedPromotion", ctx_r0.appliedPromotion)("serverPricedTotal", ctx_r0.serverPricedTotal)("promotionError", ctx_r0.promotionError)("quotedTotal", ctx_r0.quotedTotal)("quotedTax", ctx_r0.quotedTax);
|
|
302
|
+
i0.ɵɵproperty("config", ctx_r0.config)("distributionSlug", ctx_r0.slug)("sessionKey", ctx_r0.sessionKey)("isProcessing", ctx_r0.processing)("isPaymentReady", ctx_r0.isPaymentReady)("stripePaymentMethodId", ctx_r0.stripePaymentMethodId)("prefillEmail", ctx_r0.prefillEmail)("errorMessage", ctx_r0.errorMessage)("appliedPromotion", ctx_r0.appliedPromotion)("serverPricedTotal", ctx_r0.serverPricedTotal)("memberDiscount", ctx_r0.memberDiscount)("lockEmail", ctx_r0.emailLocked)("promotionError", ctx_r0.promotionError)("quotedTotal", ctx_r0.quotedTotal)("quotedTax", ctx_r0.quotedTax);
|
|
293
303
|
} }
|
|
294
|
-
function
|
|
295
|
-
i0.ɵɵrepeaterCreate(0,
|
|
304
|
+
function CheckoutPublicHostComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
305
|
+
i0.ɵɵrepeaterCreate(0, CheckoutPublicHostComponent_Conditional_6_For_1_Template, 1, 15, "mj-checkout-widget", 39, i0.ɵɵrepeaterTrackByIdentity);
|
|
296
306
|
} if (rf & 2) {
|
|
297
307
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
298
308
|
i0.ɵɵrepeater(i0.ɵɵpureFunction1(0, _c0, ctx_r0.formGeneration));
|
|
@@ -340,6 +350,26 @@ export class CheckoutPublicHostComponent {
|
|
|
340
350
|
/** The server's total and tax for the details last drafted — shown before the buyer is charged. */
|
|
341
351
|
quotedTotal = null;
|
|
342
352
|
quotedTax = null;
|
|
353
|
+
/** The verified member's discount the server last priced, shown before Pay (#919). */
|
|
354
|
+
memberDiscount = null;
|
|
355
|
+
/** How long the form must be still before a member's price is asked for. A field so a test can shorten it. */
|
|
356
|
+
quoteDebounceMs = 400;
|
|
357
|
+
quoteTimer = null;
|
|
358
|
+
/** Bumped by every price change; a background answer for an older generation is dropped. */
|
|
359
|
+
quoteGeneration = 0;
|
|
360
|
+
/**
|
|
361
|
+
* Every background draft still in flight. Pay and Apply wait for all of them, not only the latest: an older
|
|
362
|
+
* one that lands after Pay's own draft would replace it on the session, and `/payment-intent` charges the
|
|
363
|
+
* total the session's last draft saved.
|
|
364
|
+
*/
|
|
365
|
+
backgroundQuotes = new Set();
|
|
366
|
+
/**
|
|
367
|
+
* The e-mail is locked while a member token is attached and the host supplied the address (#919):
|
|
368
|
+
* the discount is bound to it. Without a prefilled address the buyer must still be able to type one.
|
|
369
|
+
*/
|
|
370
|
+
get emailLocked() {
|
|
371
|
+
return !!this.memberToken && !!this.prefillEmail?.trim();
|
|
372
|
+
}
|
|
343
373
|
/** The post-payment account step, when the host registered one (#292). */
|
|
344
374
|
account = null;
|
|
345
375
|
password = '';
|
|
@@ -364,6 +394,14 @@ export class CheckoutPublicHostComponent {
|
|
|
364
394
|
accessPollTimeoutMs = ACCESS_POLL_TIMEOUT_MS;
|
|
365
395
|
/** True while access is being asked for; the redirect waits on it. */
|
|
366
396
|
accessTracking = false;
|
|
397
|
+
/**
|
|
398
|
+
* Shown in place of the form once the buyer has paid and `/complete` has not given a final
|
|
399
|
+
* answer (the reply was a gateway error page, or the session is still Processing).
|
|
400
|
+
*/
|
|
401
|
+
finishingMessage = null;
|
|
402
|
+
/** How often, and for how long, `/complete` is asked again. Fields so a test can shorten them. */
|
|
403
|
+
completeRetryIntervalMs = COMPLETE_RETRY_INTERVAL_MS;
|
|
404
|
+
completeRetryTimeoutMs = COMPLETE_RETRY_TIMEOUT_MS;
|
|
367
405
|
get accessMessage() {
|
|
368
406
|
return AccessMessage(this.accessState, this.config?.accessMessages);
|
|
369
407
|
}
|
|
@@ -459,6 +497,7 @@ export class CheckoutPublicHostComponent {
|
|
|
459
497
|
}
|
|
460
498
|
ngOnDestroy() {
|
|
461
499
|
this.destroyed = true;
|
|
500
|
+
this.cancelBackgroundQuote();
|
|
462
501
|
this.turnstile.Destroy();
|
|
463
502
|
this.hostEl?.nativeElement?.removeEventListener?.(CHECKOUT_RESET_REQUEST_EVENT, this.onResetRequested);
|
|
464
503
|
try {
|
|
@@ -476,20 +515,8 @@ export class CheckoutPublicHostComponent {
|
|
|
476
515
|
this.processing = true;
|
|
477
516
|
this.promotionError = null;
|
|
478
517
|
try {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
clientSessionKey: this.sessionKey,
|
|
482
|
-
email: event.email,
|
|
483
|
-
lines: [buildCheckoutDraftLine(this.config.productId, event)],
|
|
484
|
-
billingAddress: event.billingAddress,
|
|
485
|
-
answers: event.answers,
|
|
486
|
-
choices: event.choices,
|
|
487
|
-
...(this.attributionSource
|
|
488
|
-
? { attribution: { source: this.attributionSource, reference: this.attributionReference } }
|
|
489
|
-
: {}),
|
|
490
|
-
...(this.memberToken ? { memberToken: this.memberToken } : {}),
|
|
491
|
-
promotionCodes: [event.promotionCode],
|
|
492
|
-
});
|
|
518
|
+
await this.settleBackgroundQuote();
|
|
519
|
+
const draft = await this.post('/draft', this.draftBody(this.config.productId, event, [event.promotionCode]));
|
|
493
520
|
this.applyPromotionOutcome(draft, event);
|
|
494
521
|
}
|
|
495
522
|
catch {
|
|
@@ -590,6 +617,8 @@ export class CheckoutPublicHostComponent {
|
|
|
590
617
|
this.errorMessage = null;
|
|
591
618
|
this.stripePaymentMethodId = null;
|
|
592
619
|
this.serverPricedTotal = null;
|
|
620
|
+
this.memberDiscount = null;
|
|
621
|
+
this.cancelBackgroundQuote();
|
|
593
622
|
try {
|
|
594
623
|
this.card?.destroy?.();
|
|
595
624
|
}
|
|
@@ -607,6 +636,90 @@ export class CheckoutPublicHostComponent {
|
|
|
607
636
|
this.quotedTax = null;
|
|
608
637
|
this.serverPricedTotal = null;
|
|
609
638
|
this.appliedPromotion = null;
|
|
639
|
+
this.memberDiscount = null;
|
|
640
|
+
this.cancelBackgroundQuote();
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* The widget's e-mail and billing location are complete and a price input changed (#919). With a
|
|
644
|
+
* member token, the form is drafted in the background once it has been still for
|
|
645
|
+
* `quoteDebounceMs`, so a verified member sees the discount, the total and the Pay button at the
|
|
646
|
+
* member price before pressing Pay, and one press pays. Without a token nothing is sent.
|
|
647
|
+
*/
|
|
648
|
+
onQuoteRequested(event) {
|
|
649
|
+
if (!this.memberToken || this.renewalToken || !this.config?.productId) {
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
this.cancelBackgroundQuote();
|
|
653
|
+
const generation = this.quoteGeneration;
|
|
654
|
+
this.quoteTimer = setTimeout(() => {
|
|
655
|
+
this.quoteTimer = null;
|
|
656
|
+
const run = this.priceInBackground(event, generation);
|
|
657
|
+
this.backgroundQuotes.add(run);
|
|
658
|
+
void run.finally(() => this.backgroundQuotes.delete(run));
|
|
659
|
+
}, this.quoteDebounceMs);
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Drafts the form with the member token and no typed code. Never blocks the form and never
|
|
663
|
+
* reports an error: on any failure the price stays as it is, and Pay drafts it again. An answer
|
|
664
|
+
* for an older generation, or one that arrives while Pay is being processed, is dropped. A token
|
|
665
|
+
* that earned nothing changes nothing here; Pay shows its notice as before.
|
|
666
|
+
*/
|
|
667
|
+
async priceInBackground(event, generation) {
|
|
668
|
+
const productId = this.config?.productId;
|
|
669
|
+
if (!productId || this.processing || this.destroyed) {
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
let draft;
|
|
673
|
+
try {
|
|
674
|
+
draft = await this.post('/draft', this.draftBody(productId, event, []));
|
|
675
|
+
}
|
|
676
|
+
catch {
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
if (generation !== this.quoteGeneration || this.processing || this.destroyed) {
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
this.memberDiscount = memberDiscountFromDraft(draft, event.quantity);
|
|
683
|
+
if (this.memberDiscount) {
|
|
684
|
+
const tax = typeof draft.Tax === 'number' ? draft.Tax : 0;
|
|
685
|
+
this.serverPricedTotal = { total: this.memberDiscount.total, quantity: event.quantity };
|
|
686
|
+
this.quotedTotal = this.memberDiscount.total;
|
|
687
|
+
this.quotedTax = tax > 0 ? tax : null;
|
|
688
|
+
}
|
|
689
|
+
this.cdr.detectChanges();
|
|
690
|
+
}
|
|
691
|
+
/** Drops a pending background draft and makes any answer already on its way stale. */
|
|
692
|
+
cancelBackgroundQuote() {
|
|
693
|
+
if (this.quoteTimer) {
|
|
694
|
+
clearTimeout(this.quoteTimer);
|
|
695
|
+
this.quoteTimer = null;
|
|
696
|
+
}
|
|
697
|
+
this.quoteGeneration++;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Before Pay or Apply drafts: no background draft may start after it, and every one already sent is
|
|
701
|
+
* waited for, so the server's session holds the buyer's draft rather than a background one.
|
|
702
|
+
*/
|
|
703
|
+
async settleBackgroundQuote() {
|
|
704
|
+
this.cancelBackgroundQuote();
|
|
705
|
+
await Promise.all([...this.backgroundQuotes]);
|
|
706
|
+
}
|
|
707
|
+
/** The `/draft` body for a widget submission, priced with the given typed codes. */
|
|
708
|
+
draftBody(productId, event, promotionCodes) {
|
|
709
|
+
return {
|
|
710
|
+
sessionId: this.sessionId,
|
|
711
|
+
clientSessionKey: this.sessionKey,
|
|
712
|
+
email: event.email,
|
|
713
|
+
lines: [buildCheckoutDraftLine(productId, event)],
|
|
714
|
+
billingAddress: event.billingAddress,
|
|
715
|
+
answers: event.answers,
|
|
716
|
+
...(this.attributionSource
|
|
717
|
+
? { attribution: { source: this.attributionSource, reference: this.attributionReference } }
|
|
718
|
+
: {}),
|
|
719
|
+
choices: event.choices,
|
|
720
|
+
...(this.memberToken ? { memberToken: this.memberToken } : {}),
|
|
721
|
+
promotionCodes,
|
|
722
|
+
};
|
|
610
723
|
}
|
|
611
724
|
async onSubmitted(event) {
|
|
612
725
|
if (this.processing || !this.config?.productId) {
|
|
@@ -616,21 +729,8 @@ export class CheckoutPublicHostComponent {
|
|
|
616
729
|
this.errorMessage = null;
|
|
617
730
|
this.setState('PROCESSING');
|
|
618
731
|
try {
|
|
619
|
-
|
|
620
|
-
const draft = await this.post('/draft',
|
|
621
|
-
sessionId: this.sessionId,
|
|
622
|
-
clientSessionKey: this.sessionKey,
|
|
623
|
-
email: event.email,
|
|
624
|
-
lines: [line],
|
|
625
|
-
billingAddress: event.billingAddress,
|
|
626
|
-
answers: event.answers,
|
|
627
|
-
...(this.attributionSource
|
|
628
|
-
? { attribution: { source: this.attributionSource, reference: this.attributionReference } }
|
|
629
|
-
: {}),
|
|
630
|
-
choices: event.choices,
|
|
631
|
-
...(this.memberToken ? { memberToken: this.memberToken } : {}),
|
|
632
|
-
promotionCodes: event.promotionCode ? [event.promotionCode] : [],
|
|
633
|
-
});
|
|
732
|
+
await this.settleBackgroundQuote();
|
|
733
|
+
const draft = await this.post('/draft', this.draftBody(this.config.productId, event, event.promotionCode ? [event.promotionCode] : []));
|
|
634
734
|
if (!this.applyPromotionOutcome(draft, event)) {
|
|
635
735
|
// The code was refused: say why and stop before any payment, so the buyer can remove
|
|
636
736
|
// it or try another rather than pay a price they did not expect.
|
|
@@ -640,9 +740,13 @@ export class CheckoutPublicHostComponent {
|
|
|
640
740
|
this.emitIfAlreadySubscribed(draft);
|
|
641
741
|
throw new Error(this.str(draft?.ErrorMessage, 'Could not price this checkout.'));
|
|
642
742
|
}
|
|
643
|
-
// The widget cannot price a member discount itself, so it is told the server's total
|
|
644
|
-
//
|
|
743
|
+
// The widget cannot price a member discount itself, so it is told the server's total. The
|
|
744
|
+
// background draft (#919) usually did this already, so the total shown is the one charged;
|
|
745
|
+
// otherwise a second press of Pay carries that total and passes the check below.
|
|
645
746
|
this.serverPricedTotal = { total: Number(draft.TotalGross ?? 0), quantity: event.quantity };
|
|
747
|
+
if (this.memberToken) {
|
|
748
|
+
this.memberDiscount = memberDiscountFromDraft(draft, event.quantity);
|
|
749
|
+
}
|
|
646
750
|
const notice = memberDiscountNotice(draft, this.memberNoticeShown);
|
|
647
751
|
if (notice) {
|
|
648
752
|
this.memberNoticeShown = true;
|
|
@@ -756,12 +860,15 @@ export class CheckoutPublicHostComponent {
|
|
|
756
860
|
}
|
|
757
861
|
}
|
|
758
862
|
}
|
|
759
|
-
const done = await this.post('/complete', {
|
|
863
|
+
const done = await this.completeAfterPayment(() => this.post('/complete', {
|
|
760
864
|
sessionId: this.sessionId,
|
|
761
865
|
clientSessionKey: this.sessionKey,
|
|
762
|
-
});
|
|
763
|
-
if (!done
|
|
764
|
-
|
|
866
|
+
}));
|
|
867
|
+
if (!done) {
|
|
868
|
+
return;
|
|
869
|
+
}
|
|
870
|
+
if (!done.Success) {
|
|
871
|
+
throw new Error(this.str(done.ErrorMessage, 'Could not complete the payment.'));
|
|
765
872
|
}
|
|
766
873
|
this.orderNumber = this.renewal.OrderNumber;
|
|
767
874
|
this.successMessage = RenewalPaidMessage(this.renewal);
|
|
@@ -811,12 +918,15 @@ export class CheckoutPublicHostComponent {
|
|
|
811
918
|
async finish() {
|
|
812
919
|
// Remembered before completing, so a reload after payment returns to the account step.
|
|
813
920
|
this.rememberCompleting(this.sessionId);
|
|
814
|
-
const done = await this.postGated('/complete', {
|
|
921
|
+
const done = await this.completeAfterPayment(() => this.postGated('/complete', {
|
|
815
922
|
sessionId: this.sessionId,
|
|
816
923
|
clientSessionKey: this.sessionKey,
|
|
817
|
-
});
|
|
818
|
-
if (!done
|
|
819
|
-
|
|
924
|
+
}));
|
|
925
|
+
if (!done) {
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
if (!done.Success) {
|
|
929
|
+
throw new Error(this.str(done.ErrorMessage, 'Could not complete checkout.'));
|
|
820
930
|
}
|
|
821
931
|
this.orderNumber = done.OrderNumber ? String(done.OrderNumber) : null;
|
|
822
932
|
this.successMessage =
|
|
@@ -1178,16 +1288,38 @@ export class CheckoutPublicHostComponent {
|
|
|
1178
1288
|
return null;
|
|
1179
1289
|
}
|
|
1180
1290
|
}
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1291
|
+
/**
|
|
1292
|
+
* Sends `/complete` for a checkout the buyer has paid for, asking again while the server may
|
|
1293
|
+
* still be finishing. Returns the server's final answer, or null when the wait ran out; the
|
|
1294
|
+
* buyer then sees that the payment went through, never a failure.
|
|
1295
|
+
*/
|
|
1296
|
+
async completeAfterPayment(send) {
|
|
1297
|
+
const done = await CompleteWithRetry(send, {
|
|
1298
|
+
intervalMs: this.completeRetryIntervalMs,
|
|
1299
|
+
timeoutMs: this.completeRetryTimeoutMs,
|
|
1300
|
+
onWaiting: () => {
|
|
1301
|
+
this.finishingMessage = COMPLETE_FINISHING_MESSAGE;
|
|
1302
|
+
this.cdr.detectChanges();
|
|
1303
|
+
},
|
|
1187
1304
|
});
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1305
|
+
this.finishingMessage = done ? null : COMPLETE_DELAYED_MESSAGE;
|
|
1306
|
+
return done;
|
|
1307
|
+
}
|
|
1308
|
+
/** Throws {@link CheckoutTransportError}, whose message is written for the buyer, when no JSON reply arrives. */
|
|
1309
|
+
async post(path, body) {
|
|
1310
|
+
let res;
|
|
1311
|
+
try {
|
|
1312
|
+
res = await fetch(`${this.apiRoot}${path}`, {
|
|
1313
|
+
method: 'POST',
|
|
1314
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1315
|
+
credentials: 'same-origin',
|
|
1316
|
+
body: JSON.stringify(body),
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1319
|
+
catch {
|
|
1320
|
+
throw new CheckoutTransportError(null);
|
|
1321
|
+
}
|
|
1322
|
+
return ReadCheckoutReply(res);
|
|
1191
1323
|
}
|
|
1192
1324
|
/** `/initialize` and `/complete`: sends a Turnstile token when the widget requires one. */
|
|
1193
1325
|
postGated(path, body) {
|
|
@@ -1212,19 +1344,19 @@ export class CheckoutPublicHostComponent {
|
|
|
1212
1344
|
return typeof value === 'string' && value ? value : fallback;
|
|
1213
1345
|
}
|
|
1214
1346
|
static ɵfac = function CheckoutPublicHostComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckoutPublicHostComponent)(); };
|
|
1215
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CheckoutPublicHostComponent, selectors: [["mj-orders-checkout"]], inputs: { slug: "slug", apiRoot: "apiRoot", memberToken: "memberToken", renewalToken: "renewalToken" }, outputs: { alreadySubscribed: "checkout-already-subscribed" }, decls:
|
|
1347
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CheckoutPublicHostComponent, selectors: [["mj-orders-checkout"]], inputs: { slug: "slug", apiRoot: "apiRoot", memberToken: "memberToken", renewalToken: "renewalToken" }, outputs: { alreadySubscribed: "checkout-already-subscribed" }, decls: 8, vars: 1, consts: [[1, "mj-checkout-public"], ["role", "alert", 1, "mj-widget-error-banner"], ["role", "status", 1, "mj-checkout-success"], ["role", "status", "aria-live", "polite", 1, "mj-checkout-success"], ["role", "status", 1, "mj-checkout-public__status"], [1, "mj-checkout-renewal"], [1, "mj-checkout-public__turnstile"], ["aria-hidden", "true", 1, "mj-checkout-success__icon"], [1, "mj-checkout-success__title"], [1, "mj-checkout-success__msg"], [1, "mj-checkout-success__order"], ["role", "status", 1, "mj-checkout-success__access", 3, "is-failed"], ["role", "status", 1, "mj-checkout-account__msg"], [1, "mj-checkout-account"], ["role", "status", 1, "mj-checkout-success__access"], [1, "mj-checkout-account", 3, "submit"], [1, "mj-checkout-account__title"], [1, "mj-checkout-account__note"], ["for", "mj-checkout-password", 1, "mj-checkout-account__label"], ["id", "mj-checkout-password", "type", "password", "autocomplete", "new-password", 1, "mj-checkout-account__input", 3, "input", "value"], ["for", "mj-checkout-password-confirm", 1, "mj-checkout-account__label"], ["id", "mj-checkout-password-confirm", "type", "password", "autocomplete", "new-password", 1, "mj-checkout-account__input", 3, "input", "value"], ["role", "alert", 1, "mj-checkout-account__error"], ["type", "submit", 1, "mj-checkout-account__submit", 3, "disabled"], ["type", "button", 1, "mj-checkout-account__skip", 3, "click", "disabled"], [1, "mj-checkout-account", "mj-checkout-account--actions"], ["type", "button", 1, "mj-checkout-account__submit", 3, "click"], ["type", "button", 1, "mj-checkout-account__skip"], ["type", "button", 1, "mj-checkout-account__skip", 3, "click"], [1, "mj-checkout-renewal", 3, "submit"], [1, "mj-checkout-renewal__title"], [1, "mj-checkout-renewal__lead"], [1, "mj-checkout-renewal__summary"], [1, "mj-checkout-renewal__row"], [1, "mj-checkout-renewal__row", "mj-checkout-renewal__row--total"], [1, "mj-checkout-renewal__note"], ["type", "submit", 1, "mj-checkout-renewal__pay", 3, "disabled"], ["for", "stripe-card-element", 1, "mj-checkout-renewal__label"], ["id", "stripe-card-element", 1, "mj-checkout-renewal__card"], [3, "config", "distributionSlug", "sessionKey", "isProcessing", "isPaymentReady", "stripePaymentMethodId", "prefillEmail", "errorMessage", "appliedPromotion", "serverPricedTotal", "memberDiscount", "lockEmail", "promotionError", "quotedTotal", "quotedTax"], [3, "promotionCodeApplied", "submitted", "cancelled", "quoteInvalidated", "quoteRequested", "config", "distributionSlug", "sessionKey", "isProcessing", "isPaymentReady", "stripePaymentMethodId", "prefillEmail", "errorMessage", "appliedPromotion", "serverPricedTotal", "memberDiscount", "lockEmail", "promotionError", "quotedTotal", "quotedTax"]], template: function CheckoutPublicHostComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1216
1348
|
i0.ɵɵelementStart(0, "div", 0);
|
|
1217
|
-
i0.ɵɵconditionalCreate(1, CheckoutPublicHostComponent_Conditional_1_Template, 2, 1, "div", 1)(2, CheckoutPublicHostComponent_Conditional_2_Template, 12, 4, "div", 2)(3, CheckoutPublicHostComponent_Conditional_3_Template,
|
|
1218
|
-
i0.ɵɵelement(
|
|
1349
|
+
i0.ɵɵconditionalCreate(1, CheckoutPublicHostComponent_Conditional_1_Template, 2, 1, "div", 1)(2, CheckoutPublicHostComponent_Conditional_2_Template, 12, 4, "div", 2)(3, CheckoutPublicHostComponent_Conditional_3_Template, 3, 1, "div", 3)(4, CheckoutPublicHostComponent_Conditional_4_Template, 2, 0, "p", 4)(5, CheckoutPublicHostComponent_Conditional_5_Template, 25, 9, "form", 5)(6, CheckoutPublicHostComponent_Conditional_6_Template, 2, 2);
|
|
1350
|
+
i0.ɵɵelement(7, "div", 6);
|
|
1219
1351
|
i0.ɵɵelementEnd();
|
|
1220
1352
|
} if (rf & 2) {
|
|
1221
1353
|
i0.ɵɵadvance();
|
|
1222
|
-
i0.ɵɵconditional(ctx.loadError ? 1 : ctx.successMessage ? 2 : !ctx.config ?
|
|
1354
|
+
i0.ɵɵconditional(ctx.loadError ? 1 : ctx.successMessage ? 2 : ctx.finishingMessage ? 3 : !ctx.config ? 4 : ctx.renewal ? 5 : 6);
|
|
1223
1355
|
} }, dependencies: [CommonModule, MJCheckoutWidgetComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n}\n\n.mj-checkout-public[_ngcontent-%COMP%] {\n max-width: 580px;\n margin: 0 auto;\n}\n\n.mj-checkout-public__status[_ngcontent-%COMP%] {\n text-align: center;\n color: #64748b;\n font-size: 0.95rem;\n padding: 2rem 0;\n}\n\n.mj-widget-error-banner[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n background: #fef2f2;\n border: 1px solid #f87171;\n color: #991b1b;\n padding: 10px 14px;\n border-radius: 6px;\n font-size: 0.875rem;\n}\n\n.mj-checkout-success[_ngcontent-%COMP%] {\n text-align: center;\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 10px;\n padding: 2rem 1.5rem;\n box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);\n}\n\n.mj-checkout-success__icon[_ngcontent-%COMP%] {\n width: 3rem;\n height: 3rem;\n margin: 0 auto 1rem;\n border-radius: 50%;\n background: #dcfce7;\n color: #16a34a;\n font-size: 1.5rem;\n font-weight: 700;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.mj-checkout-success__title[_ngcontent-%COMP%] {\n margin: 0 0 0.5rem;\n font-size: 1.5rem;\n font-weight: 800;\n color: #0f172a;\n}\n\n.mj-checkout-success__msg[_ngcontent-%COMP%], \n.mj-checkout-success__order[_ngcontent-%COMP%] {\n margin: 0;\n color: #64748b;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-success__order[_ngcontent-%COMP%] {\n margin-top: 0.75rem;\n font-weight: 600;\n color: #334155;\n}\n\n\n\n.mj-checkout-success__access[_ngcontent-%COMP%] {\n margin: 0.75rem 0 0;\n color: #334155;\n font-size: 0.95rem;\n}\n\n.mj-checkout-success__access.is-failed[_ngcontent-%COMP%] {\n color: #991b1b;\n}\n\n\n\n.mj-checkout-account[_ngcontent-%COMP%] {\n margin: 1.5rem auto 0;\n max-width: 320px;\n text-align: left;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.mj-checkout-account__title[_ngcontent-%COMP%] {\n margin: 0 0 0.5rem;\n font-size: 1.05rem;\n font-weight: 700;\n color: #0f172a;\n text-align: center;\n}\n\n.mj-checkout-account__label[_ngcontent-%COMP%] {\n font-size: 0.85rem;\n font-weight: 600;\n color: #334155;\n}\n\n.mj-checkout-account__input[_ngcontent-%COMP%] {\n padding: 8px 10px;\n border: 1px solid #cbd5e1;\n border-radius: 6px;\n font-size: 0.95rem;\n font-family: inherit;\n}\n\n.mj-checkout-account__input[_ngcontent-%COMP%]:focus {\n outline: none;\n border-color: var(--mj-primary-color, #2563eb);\n box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);\n}\n\n.mj-checkout-account__error[_ngcontent-%COMP%] {\n margin: 4px 0 0;\n color: #991b1b;\n font-size: 0.85rem;\n}\n\n.mj-checkout-account__submit[_ngcontent-%COMP%] {\n margin-top: 10px;\n padding: 10px;\n border: 0;\n border-radius: 6px;\n background: var(--mj-primary-color, #2563eb);\n color: #ffffff;\n font-weight: 600;\n cursor: pointer;\n}\n\n.mj-checkout-account__skip[_ngcontent-%COMP%] {\n padding: 6px;\n border: 0;\n background: none;\n color: #64748b;\n font-size: 0.85rem;\n cursor: pointer;\n}\n\n.mj-checkout-account__submit[_ngcontent-%COMP%]:disabled, \n.mj-checkout-account__skip[_ngcontent-%COMP%]:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.mj-checkout-account__msg[_ngcontent-%COMP%] {\n margin: 1rem 0 0;\n color: #334155;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-account__note[_ngcontent-%COMP%] {\n margin: 0 0 0.5rem;\n color: #475569;\n font-size: 0.85rem;\n line-height: 1.45;\n text-align: center;\n}\n\n.mj-checkout-account--actions[_ngcontent-%COMP%] {\n margin-top: 0.75rem;\n}\n\n\n\n.mj-checkout-public__turnstile[_ngcontent-%COMP%] {\n display: flex;\n justify-content: center;\n margin-top: 0.75rem;\n}\n\n\n\n\n.mj-checkout-renewal[_ngcontent-%COMP%] {\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 10px;\n padding: 1.75rem 1.5rem;\n box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);\n display: flex;\n flex-direction: column;\n gap: 0.85rem;\n}\n\n.mj-checkout-renewal__title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 1.4rem;\n font-weight: 800;\n color: #0f172a;\n}\n\n.mj-checkout-renewal__lead[_ngcontent-%COMP%], \n.mj-checkout-renewal__note[_ngcontent-%COMP%] {\n margin: 0;\n color: #475569;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-renewal__note[_ngcontent-%COMP%] {\n font-size: 0.85rem;\n}\n\n.mj-checkout-renewal__summary[_ngcontent-%COMP%] {\n margin: 0.25rem 0;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n padding: 0.25rem 0.9rem;\n}\n\n.mj-checkout-renewal__row[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.55rem 0;\n border-bottom: 1px solid #f1f5f9;\n font-size: 0.92rem;\n}\n\n.mj-checkout-renewal__row[_ngcontent-%COMP%]:last-child {\n border-bottom: none;\n}\n\n.mj-checkout-renewal__row[_ngcontent-%COMP%] dt[_ngcontent-%COMP%] {\n color: #64748b;\n}\n\n.mj-checkout-renewal__row[_ngcontent-%COMP%] dd[_ngcontent-%COMP%] {\n margin: 0;\n color: #0f172a;\n text-align: right;\n}\n\n.mj-checkout-renewal__row--total[_ngcontent-%COMP%] dt[_ngcontent-%COMP%], \n.mj-checkout-renewal__row--total[_ngcontent-%COMP%] dd[_ngcontent-%COMP%] {\n font-weight: 700;\n color: #0f172a;\n}\n\n.mj-checkout-renewal__label[_ngcontent-%COMP%] {\n font-size: 0.85rem;\n font-weight: 600;\n color: #334155;\n}\n\n.mj-checkout-renewal__card[_ngcontent-%COMP%] {\n border: 1px solid #cbd5e1;\n border-radius: 6px;\n padding: 0.75rem;\n background: #ffffff;\n}\n\n.mj-checkout-renewal__pay[_ngcontent-%COMP%] {\n margin-top: 0.25rem;\n padding: 0.8rem 1rem;\n border: none;\n border-radius: 6px;\n background: var(--mj-checkout-primary, #2563eb);\n color: #ffffff;\n font-size: 1rem;\n font-weight: 700;\n cursor: pointer;\n}\n\n.mj-checkout-renewal__pay[_ngcontent-%COMP%]:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}"] });
|
|
1224
1356
|
}
|
|
1225
1357
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckoutPublicHostComponent, [{
|
|
1226
1358
|
type: Component,
|
|
1227
|
-
args: [{ selector: 'mj-orders-checkout', standalone: true, imports: [CommonModule, MJCheckoutWidgetComponent], template: "<div class=\"mj-checkout-public\">\n @if (loadError) {\n <div class=\"mj-widget-error-banner\" role=\"alert\">{{ loadError }}</div>\n } @else if (successMessage) {\n <div class=\"mj-checkout-success\" role=\"status\">\n <div class=\"mj-checkout-success__icon\" aria-hidden=\"true\">\u2713</div>\n <h1 class=\"mj-checkout-success__title\">You're all set</h1>\n <p class=\"mj-checkout-success__msg\">{{ successMessage }}</p>\n @if (orderNumber) {\n <p class=\"mj-checkout-success__order\">Order {{ orderNumber }}</p>\n }\n @if (accessMessage) {\n <p class=\"mj-checkout-success__access\" [class.is-failed]=\"accessState === 'Failed'\" role=\"status\">{{ accessMessage }}</p>\n }\n @if (accountLoading) {\n <p class=\"mj-checkout-account__msg\" role=\"status\">Setting up your account\u2026</p>\n } @else if (account?.CanSetPassword) {\n <form class=\"mj-checkout-account\" (submit)=\"$event.preventDefault(); submitPassword()\">\n <h2 class=\"mj-checkout-account__title\">Set a password for your account</h2>\n @if (verificationNote) {\n <p class=\"mj-checkout-account__note\">{{ verificationNote }}</p>\n }\n <label class=\"mj-checkout-account__label\" for=\"mj-checkout-password\">Password</label>\n <input\n id=\"mj-checkout-password\"\n class=\"mj-checkout-account__input\"\n type=\"password\"\n autocomplete=\"new-password\"\n [value]=\"password\"\n (input)=\"password = $any($event.target).value\" />\n <label class=\"mj-checkout-account__label\" for=\"mj-checkout-password-confirm\">Confirm password</label>\n <input\n id=\"mj-checkout-password-confirm\"\n class=\"mj-checkout-account__input\"\n type=\"password\"\n autocomplete=\"new-password\"\n [value]=\"passwordConfirmation\"\n (input)=\"passwordConfirmation = $any($event.target).value\" />\n @if (passwordError) {\n <p class=\"mj-checkout-account__error\" role=\"alert\">{{ passwordError }}</p>\n }\n <button class=\"mj-checkout-account__submit\" type=\"submit\" [disabled]=\"passwordBusy\">\n {{ passwordBusy ? 'Saving\u2026' : 'Set password' }}\n </button>\n <button class=\"mj-checkout-account__skip\" type=\"button\" (click)=\"skipPassword()\" [disabled]=\"passwordBusy\">\n Not now\n </button>\n </form>\n } @else if (accountMessage) {\n <p class=\"mj-checkout-account__msg\" role=\"status\">{{ accountMessage }}</p>\n @if (account?.Outcome === 'Failed') {\n <div class=\"mj-checkout-account mj-checkout-account--actions\">\n <button class=\"mj-checkout-account__submit\" type=\"button\" (click)=\"retryAccount()\">Try again</button>\n @if (config?.redirectUrl) {\n <button class=\"mj-checkout-account__skip\" type=\"button\" (click)=\"dismissAccount()\">Not now</button>\n }\n </div>\n }\n }\n </div>\n } @else if (!config) {\n <p class=\"mj-checkout-public__status\" role=\"status\">Loading checkout\u2026</p>\n } @else if (renewal) {\n <form class=\"mj-checkout-renewal\" (submit)=\"$event.preventDefault(); payRenewal()\">\n <h1 class=\"mj-checkout-renewal__title\">Renew your subscription</h1>\n <p class=\"mj-checkout-renewal__lead\">Your saved card could not be charged. Pay with a new card to keep your subscription active.</p>\n <dl class=\"mj-checkout-renewal__summary\">\n @if (renewal.Description) {\n <div class=\"mj-checkout-renewal__row\">\n <dt>Renewal of</dt>\n <dd>{{ renewal.Description }}</dd>\n </div>\n }\n @if (renewal.SubscriptionNumber) {\n <div class=\"mj-checkout-renewal__row\">\n <dt>Subscription</dt>\n <dd>{{ renewal.SubscriptionNumber }}</dd>\n </div>\n }\n <div class=\"mj-checkout-renewal__row\">\n <dt>Renewal order</dt>\n <dd>{{ renewal.OrderNumber }}</dd>\n </div>\n @if (renewal.DueDate) {\n <div class=\"mj-checkout-renewal__row\">\n <dt>Due</dt>\n <dd>{{ renewal.DueDate }}</dd>\n </div>\n }\n <div class=\"mj-checkout-renewal__row mj-checkout-renewal__row--total\">\n <dt>Amount due</dt>\n <dd>{{ renewalAmount }}</dd>\n </div>\n </dl>\n @if (config.stripePublishableKey) {\n <label class=\"mj-checkout-renewal__label\" for=\"stripe-card-element\">Card</label>\n <div id=\"stripe-card-element\" class=\"mj-checkout-renewal__card\"></div>\n }\n <p class=\"mj-checkout-renewal__note\">The card you pay with will be charged for future renewals.</p>\n @if (errorMessage) {\n <div class=\"mj-widget-error-banner\" role=\"alert\">{{ errorMessage }}</div>\n }\n <button class=\"mj-checkout-renewal__pay\" type=\"submit\" [disabled]=\"processing || !isPaymentReady\">\n {{ processing ? 'Processing\u2026' : 'Pay ' + renewalAmount }}\n </button>\n </form>\n } @else {\n @for (generation of [formGeneration]; track generation) {\n <mj-checkout-widget\n [config]=\"config\"\n [distributionSlug]=\"slug\"\n [sessionKey]=\"sessionKey\"\n [isProcessing]=\"processing\"\n [isPaymentReady]=\"isPaymentReady\"\n [stripePaymentMethodId]=\"stripePaymentMethodId\"\n [prefillEmail]=\"prefillEmail\"\n [errorMessage]=\"errorMessage\"\n [appliedPromotion]=\"appliedPromotion\"\n [serverPricedTotal]=\"serverPricedTotal\"\n [promotionError]=\"promotionError\"\n (promotionCodeApplied)=\"onPromotionCodeApplied($event)\"\n [quotedTotal]=\"quotedTotal\"\n [quotedTax]=\"quotedTax\"\n (submitted)=\"onSubmitted($event)\"\n (cancelled)=\"onCancelled()\"\n (quoteInvalidated)=\"onQuoteInvalidated()\">\n </mj-checkout-widget>\n }\n }\n <div class=\"mj-checkout-public__turnstile\"></div>\n</div>\n", styles: [":host {\n display: block;\n}\n\n.mj-checkout-public {\n max-width: 580px;\n margin: 0 auto;\n}\n\n.mj-checkout-public__status {\n text-align: center;\n color: #64748b;\n font-size: 0.95rem;\n padding: 2rem 0;\n}\n\n.mj-widget-error-banner {\n display: flex;\n align-items: center;\n gap: 8px;\n background: #fef2f2;\n border: 1px solid #f87171;\n color: #991b1b;\n padding: 10px 14px;\n border-radius: 6px;\n font-size: 0.875rem;\n}\n\n.mj-checkout-success {\n text-align: center;\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 10px;\n padding: 2rem 1.5rem;\n box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);\n}\n\n.mj-checkout-success__icon {\n width: 3rem;\n height: 3rem;\n margin: 0 auto 1rem;\n border-radius: 50%;\n background: #dcfce7;\n color: #16a34a;\n font-size: 1.5rem;\n font-weight: 700;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.mj-checkout-success__title {\n margin: 0 0 0.5rem;\n font-size: 1.5rem;\n font-weight: 800;\n color: #0f172a;\n}\n\n.mj-checkout-success__msg,\n.mj-checkout-success__order {\n margin: 0;\n color: #64748b;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-success__order {\n margin-top: 0.75rem;\n font-weight: 600;\n color: #334155;\n}\n\n/* Whether the buyer's access is ready yet (#325). */\n.mj-checkout-success__access {\n margin: 0.75rem 0 0;\n color: #334155;\n font-size: 0.95rem;\n}\n\n.mj-checkout-success__access.is-failed {\n color: #991b1b;\n}\n\n/* Post-payment account step: set a password for the account the host created (#292). */\n.mj-checkout-account {\n margin: 1.5rem auto 0;\n max-width: 320px;\n text-align: left;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.mj-checkout-account__title {\n margin: 0 0 0.5rem;\n font-size: 1.05rem;\n font-weight: 700;\n color: #0f172a;\n text-align: center;\n}\n\n.mj-checkout-account__label {\n font-size: 0.85rem;\n font-weight: 600;\n color: #334155;\n}\n\n.mj-checkout-account__input {\n padding: 8px 10px;\n border: 1px solid #cbd5e1;\n border-radius: 6px;\n font-size: 0.95rem;\n font-family: inherit;\n}\n\n.mj-checkout-account__input:focus {\n outline: none;\n border-color: var(--mj-primary-color, #2563eb);\n box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);\n}\n\n.mj-checkout-account__error {\n margin: 4px 0 0;\n color: #991b1b;\n font-size: 0.85rem;\n}\n\n.mj-checkout-account__submit {\n margin-top: 10px;\n padding: 10px;\n border: 0;\n border-radius: 6px;\n background: var(--mj-primary-color, #2563eb);\n color: #ffffff;\n font-weight: 600;\n cursor: pointer;\n}\n\n.mj-checkout-account__skip {\n padding: 6px;\n border: 0;\n background: none;\n color: #64748b;\n font-size: 0.85rem;\n cursor: pointer;\n}\n\n.mj-checkout-account__submit:disabled,\n.mj-checkout-account__skip:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.mj-checkout-account__msg {\n margin: 1rem 0 0;\n color: #334155;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-account__note {\n margin: 0 0 0.5rem;\n color: #475569;\n font-size: 0.85rem;\n line-height: 1.45;\n text-align: center;\n}\n\n.mj-checkout-account--actions {\n margin-top: 0.75rem;\n}\n\n/* Cloudflare Turnstile renders here only when it needs the buyer to interact (#592). */\n.mj-checkout-public__turnstile {\n display: flex;\n justify-content: center;\n margin-top: 0.75rem;\n}\n\n/* \u2500\u2500\u2500 Pay-renewal mode (#289) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.mj-checkout-renewal {\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 10px;\n padding: 1.75rem 1.5rem;\n box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);\n display: flex;\n flex-direction: column;\n gap: 0.85rem;\n}\n\n.mj-checkout-renewal__title {\n margin: 0;\n font-size: 1.4rem;\n font-weight: 800;\n color: #0f172a;\n}\n\n.mj-checkout-renewal__lead,\n.mj-checkout-renewal__note {\n margin: 0;\n color: #475569;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-renewal__note {\n font-size: 0.85rem;\n}\n\n.mj-checkout-renewal__summary {\n margin: 0.25rem 0;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n padding: 0.25rem 0.9rem;\n}\n\n.mj-checkout-renewal__row {\n display: flex;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.55rem 0;\n border-bottom: 1px solid #f1f5f9;\n font-size: 0.92rem;\n}\n\n.mj-checkout-renewal__row:last-child {\n border-bottom: none;\n}\n\n.mj-checkout-renewal__row dt {\n color: #64748b;\n}\n\n.mj-checkout-renewal__row dd {\n margin: 0;\n color: #0f172a;\n text-align: right;\n}\n\n.mj-checkout-renewal__row--total dt,\n.mj-checkout-renewal__row--total dd {\n font-weight: 700;\n color: #0f172a;\n}\n\n.mj-checkout-renewal__label {\n font-size: 0.85rem;\n font-weight: 600;\n color: #334155;\n}\n\n.mj-checkout-renewal__card {\n border: 1px solid #cbd5e1;\n border-radius: 6px;\n padding: 0.75rem;\n background: #ffffff;\n}\n\n.mj-checkout-renewal__pay {\n margin-top: 0.25rem;\n padding: 0.8rem 1rem;\n border: none;\n border-radius: 6px;\n background: var(--mj-checkout-primary, #2563eb);\n color: #ffffff;\n font-size: 1rem;\n font-weight: 700;\n cursor: pointer;\n}\n\n.mj-checkout-renewal__pay:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n"] }]
|
|
1359
|
+
args: [{ selector: 'mj-orders-checkout', standalone: true, imports: [CommonModule, MJCheckoutWidgetComponent], template: "<div class=\"mj-checkout-public\">\n @if (loadError) {\n <div class=\"mj-widget-error-banner\" role=\"alert\">{{ loadError }}</div>\n } @else if (successMessage) {\n <div class=\"mj-checkout-success\" role=\"status\">\n <div class=\"mj-checkout-success__icon\" aria-hidden=\"true\">\u2713</div>\n <h1 class=\"mj-checkout-success__title\">You're all set</h1>\n <p class=\"mj-checkout-success__msg\">{{ successMessage }}</p>\n @if (orderNumber) {\n <p class=\"mj-checkout-success__order\">Order {{ orderNumber }}</p>\n }\n @if (accessMessage) {\n <p class=\"mj-checkout-success__access\" [class.is-failed]=\"accessState === 'Failed'\" role=\"status\">{{ accessMessage }}</p>\n }\n @if (accountLoading) {\n <p class=\"mj-checkout-account__msg\" role=\"status\">Setting up your account\u2026</p>\n } @else if (account?.CanSetPassword) {\n <form class=\"mj-checkout-account\" (submit)=\"$event.preventDefault(); submitPassword()\">\n <h2 class=\"mj-checkout-account__title\">Set a password for your account</h2>\n @if (verificationNote) {\n <p class=\"mj-checkout-account__note\">{{ verificationNote }}</p>\n }\n <label class=\"mj-checkout-account__label\" for=\"mj-checkout-password\">Password</label>\n <input\n id=\"mj-checkout-password\"\n class=\"mj-checkout-account__input\"\n type=\"password\"\n autocomplete=\"new-password\"\n [value]=\"password\"\n (input)=\"password = $any($event.target).value\" />\n <label class=\"mj-checkout-account__label\" for=\"mj-checkout-password-confirm\">Confirm password</label>\n <input\n id=\"mj-checkout-password-confirm\"\n class=\"mj-checkout-account__input\"\n type=\"password\"\n autocomplete=\"new-password\"\n [value]=\"passwordConfirmation\"\n (input)=\"passwordConfirmation = $any($event.target).value\" />\n @if (passwordError) {\n <p class=\"mj-checkout-account__error\" role=\"alert\">{{ passwordError }}</p>\n }\n <button class=\"mj-checkout-account__submit\" type=\"submit\" [disabled]=\"passwordBusy\">\n {{ passwordBusy ? 'Saving\u2026' : 'Set password' }}\n </button>\n <button class=\"mj-checkout-account__skip\" type=\"button\" (click)=\"skipPassword()\" [disabled]=\"passwordBusy\">\n Not now\n </button>\n </form>\n } @else if (accountMessage) {\n <p class=\"mj-checkout-account__msg\" role=\"status\">{{ accountMessage }}</p>\n @if (account?.Outcome === 'Failed') {\n <div class=\"mj-checkout-account mj-checkout-account--actions\">\n <button class=\"mj-checkout-account__submit\" type=\"button\" (click)=\"retryAccount()\">Try again</button>\n @if (config?.redirectUrl) {\n <button class=\"mj-checkout-account__skip\" type=\"button\" (click)=\"dismissAccount()\">Not now</button>\n }\n </div>\n }\n }\n </div>\n } @else if (finishingMessage) {\n <div class=\"mj-checkout-success\" role=\"status\" aria-live=\"polite\">\n <p class=\"mj-checkout-success__msg\">{{ finishingMessage }}</p>\n </div>\n } @else if (!config) {\n <p class=\"mj-checkout-public__status\" role=\"status\">Loading checkout\u2026</p>\n } @else if (renewal) {\n <form class=\"mj-checkout-renewal\" (submit)=\"$event.preventDefault(); payRenewal()\">\n <h1 class=\"mj-checkout-renewal__title\">Renew your subscription</h1>\n <p class=\"mj-checkout-renewal__lead\">Your saved card could not be charged. Pay with a new card to keep your subscription active.</p>\n <dl class=\"mj-checkout-renewal__summary\">\n @if (renewal.Description) {\n <div class=\"mj-checkout-renewal__row\">\n <dt>Renewal of</dt>\n <dd>{{ renewal.Description }}</dd>\n </div>\n }\n @if (renewal.SubscriptionNumber) {\n <div class=\"mj-checkout-renewal__row\">\n <dt>Subscription</dt>\n <dd>{{ renewal.SubscriptionNumber }}</dd>\n </div>\n }\n <div class=\"mj-checkout-renewal__row\">\n <dt>Renewal order</dt>\n <dd>{{ renewal.OrderNumber }}</dd>\n </div>\n @if (renewal.DueDate) {\n <div class=\"mj-checkout-renewal__row\">\n <dt>Due</dt>\n <dd>{{ renewal.DueDate }}</dd>\n </div>\n }\n <div class=\"mj-checkout-renewal__row mj-checkout-renewal__row--total\">\n <dt>Amount due</dt>\n <dd>{{ renewalAmount }}</dd>\n </div>\n </dl>\n @if (config.stripePublishableKey) {\n <label class=\"mj-checkout-renewal__label\" for=\"stripe-card-element\">Card</label>\n <div id=\"stripe-card-element\" class=\"mj-checkout-renewal__card\"></div>\n }\n <p class=\"mj-checkout-renewal__note\">The card you pay with will be charged for future renewals.</p>\n @if (errorMessage) {\n <div class=\"mj-widget-error-banner\" role=\"alert\">{{ errorMessage }}</div>\n }\n <button class=\"mj-checkout-renewal__pay\" type=\"submit\" [disabled]=\"processing || !isPaymentReady\">\n {{ processing ? 'Processing\u2026' : 'Pay ' + renewalAmount }}\n </button>\n </form>\n } @else {\n @for (generation of [formGeneration]; track generation) {\n <mj-checkout-widget\n [config]=\"config\"\n [distributionSlug]=\"slug\"\n [sessionKey]=\"sessionKey\"\n [isProcessing]=\"processing\"\n [isPaymentReady]=\"isPaymentReady\"\n [stripePaymentMethodId]=\"stripePaymentMethodId\"\n [prefillEmail]=\"prefillEmail\"\n [errorMessage]=\"errorMessage\"\n [appliedPromotion]=\"appliedPromotion\"\n [serverPricedTotal]=\"serverPricedTotal\"\n [memberDiscount]=\"memberDiscount\"\n [lockEmail]=\"emailLocked\"\n [promotionError]=\"promotionError\"\n (promotionCodeApplied)=\"onPromotionCodeApplied($event)\"\n [quotedTotal]=\"quotedTotal\"\n [quotedTax]=\"quotedTax\"\n (submitted)=\"onSubmitted($event)\"\n (cancelled)=\"onCancelled()\"\n (quoteInvalidated)=\"onQuoteInvalidated()\"\n (quoteRequested)=\"onQuoteRequested($event)\">\n </mj-checkout-widget>\n }\n }\n <div class=\"mj-checkout-public__turnstile\"></div>\n</div>\n", styles: [":host {\n display: block;\n}\n\n.mj-checkout-public {\n max-width: 580px;\n margin: 0 auto;\n}\n\n.mj-checkout-public__status {\n text-align: center;\n color: #64748b;\n font-size: 0.95rem;\n padding: 2rem 0;\n}\n\n.mj-widget-error-banner {\n display: flex;\n align-items: center;\n gap: 8px;\n background: #fef2f2;\n border: 1px solid #f87171;\n color: #991b1b;\n padding: 10px 14px;\n border-radius: 6px;\n font-size: 0.875rem;\n}\n\n.mj-checkout-success {\n text-align: center;\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 10px;\n padding: 2rem 1.5rem;\n box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);\n}\n\n.mj-checkout-success__icon {\n width: 3rem;\n height: 3rem;\n margin: 0 auto 1rem;\n border-radius: 50%;\n background: #dcfce7;\n color: #16a34a;\n font-size: 1.5rem;\n font-weight: 700;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.mj-checkout-success__title {\n margin: 0 0 0.5rem;\n font-size: 1.5rem;\n font-weight: 800;\n color: #0f172a;\n}\n\n.mj-checkout-success__msg,\n.mj-checkout-success__order {\n margin: 0;\n color: #64748b;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-success__order {\n margin-top: 0.75rem;\n font-weight: 600;\n color: #334155;\n}\n\n/* Whether the buyer's access is ready yet (#325). */\n.mj-checkout-success__access {\n margin: 0.75rem 0 0;\n color: #334155;\n font-size: 0.95rem;\n}\n\n.mj-checkout-success__access.is-failed {\n color: #991b1b;\n}\n\n/* Post-payment account step: set a password for the account the host created (#292). */\n.mj-checkout-account {\n margin: 1.5rem auto 0;\n max-width: 320px;\n text-align: left;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.mj-checkout-account__title {\n margin: 0 0 0.5rem;\n font-size: 1.05rem;\n font-weight: 700;\n color: #0f172a;\n text-align: center;\n}\n\n.mj-checkout-account__label {\n font-size: 0.85rem;\n font-weight: 600;\n color: #334155;\n}\n\n.mj-checkout-account__input {\n padding: 8px 10px;\n border: 1px solid #cbd5e1;\n border-radius: 6px;\n font-size: 0.95rem;\n font-family: inherit;\n}\n\n.mj-checkout-account__input:focus {\n outline: none;\n border-color: var(--mj-primary-color, #2563eb);\n box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);\n}\n\n.mj-checkout-account__error {\n margin: 4px 0 0;\n color: #991b1b;\n font-size: 0.85rem;\n}\n\n.mj-checkout-account__submit {\n margin-top: 10px;\n padding: 10px;\n border: 0;\n border-radius: 6px;\n background: var(--mj-primary-color, #2563eb);\n color: #ffffff;\n font-weight: 600;\n cursor: pointer;\n}\n\n.mj-checkout-account__skip {\n padding: 6px;\n border: 0;\n background: none;\n color: #64748b;\n font-size: 0.85rem;\n cursor: pointer;\n}\n\n.mj-checkout-account__submit:disabled,\n.mj-checkout-account__skip:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.mj-checkout-account__msg {\n margin: 1rem 0 0;\n color: #334155;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-account__note {\n margin: 0 0 0.5rem;\n color: #475569;\n font-size: 0.85rem;\n line-height: 1.45;\n text-align: center;\n}\n\n.mj-checkout-account--actions {\n margin-top: 0.75rem;\n}\n\n/* Cloudflare Turnstile renders here only when it needs the buyer to interact (#592). */\n.mj-checkout-public__turnstile {\n display: flex;\n justify-content: center;\n margin-top: 0.75rem;\n}\n\n/* \u2500\u2500\u2500 Pay-renewal mode (#289) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.mj-checkout-renewal {\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 10px;\n padding: 1.75rem 1.5rem;\n box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);\n display: flex;\n flex-direction: column;\n gap: 0.85rem;\n}\n\n.mj-checkout-renewal__title {\n margin: 0;\n font-size: 1.4rem;\n font-weight: 800;\n color: #0f172a;\n}\n\n.mj-checkout-renewal__lead,\n.mj-checkout-renewal__note {\n margin: 0;\n color: #475569;\n font-size: 0.95rem;\n line-height: 1.5;\n}\n\n.mj-checkout-renewal__note {\n font-size: 0.85rem;\n}\n\n.mj-checkout-renewal__summary {\n margin: 0.25rem 0;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n padding: 0.25rem 0.9rem;\n}\n\n.mj-checkout-renewal__row {\n display: flex;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.55rem 0;\n border-bottom: 1px solid #f1f5f9;\n font-size: 0.92rem;\n}\n\n.mj-checkout-renewal__row:last-child {\n border-bottom: none;\n}\n\n.mj-checkout-renewal__row dt {\n color: #64748b;\n}\n\n.mj-checkout-renewal__row dd {\n margin: 0;\n color: #0f172a;\n text-align: right;\n}\n\n.mj-checkout-renewal__row--total dt,\n.mj-checkout-renewal__row--total dd {\n font-weight: 700;\n color: #0f172a;\n}\n\n.mj-checkout-renewal__label {\n font-size: 0.85rem;\n font-weight: 600;\n color: #334155;\n}\n\n.mj-checkout-renewal__card {\n border: 1px solid #cbd5e1;\n border-radius: 6px;\n padding: 0.75rem;\n background: #ffffff;\n}\n\n.mj-checkout-renewal__pay {\n margin-top: 0.25rem;\n padding: 0.8rem 1rem;\n border: none;\n border-radius: 6px;\n background: var(--mj-checkout-primary, #2563eb);\n color: #ffffff;\n font-size: 1rem;\n font-weight: 700;\n cursor: pointer;\n}\n\n.mj-checkout-renewal__pay:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n"] }]
|
|
1228
1360
|
}], null, { slug: [{
|
|
1229
1361
|
type: Input
|
|
1230
1362
|
}], apiRoot: [{
|
|
@@ -1237,5 +1369,5 @@ export class CheckoutPublicHostComponent {
|
|
|
1237
1369
|
type: Output,
|
|
1238
1370
|
args: ['checkout-already-subscribed']
|
|
1239
1371
|
}] }); })();
|
|
1240
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CheckoutPublicHostComponent, { className: "CheckoutPublicHostComponent", filePath: "lib/checkout-widget/checkout-public-host.component.ts", lineNumber:
|
|
1372
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CheckoutPublicHostComponent, { className: "CheckoutPublicHostComponent", filePath: "lib/checkout-widget/checkout-public-host.component.ts", lineNumber: 122 }); })();
|
|
1241
1373
|
//# sourceMappingURL=checkout-public-host.component.js.map
|