@mj-biz-apps/orders-ng 5.41.0 → 5.42.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 +368 -246
- package/dist/lib/checkout-widget/checkout-account.d.ts +10 -0
- package/dist/lib/checkout-widget/checkout-account.d.ts.map +1 -1
- package/dist/lib/checkout-widget/checkout-account.js +12 -0
- package/dist/lib/checkout-widget/checkout-account.js.map +1 -1
- package/dist/lib/checkout-widget/checkout-events.d.ts +15 -1
- package/dist/lib/checkout-widget/checkout-events.d.ts.map +1 -1
- package/dist/lib/checkout-widget/checkout-events.js +3 -1
- package/dist/lib/checkout-widget/checkout-events.js.map +1 -1
- package/dist/lib/checkout-widget/checkout-public-host.component.d.ts +6 -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 +50 -21
- package/dist/lib/checkout-widget/checkout-public-host.component.js.map +1 -1
- package/dist/lib/checkout-widget/checkout-widget.component.d.ts +38 -2
- package/dist/lib/checkout-widget/checkout-widget.component.d.ts.map +1 -1
- package/dist/lib/checkout-widget/checkout-widget.component.js +313 -227
- package/dist/lib/checkout-widget/checkout-widget.component.js.map +1 -1
- package/dist/lib/custom/OrderHeader/order-header-form.component.d.ts.map +1 -1
- package/dist/lib/custom/OrderHeader/order-header-form.component.js +2 -1
- package/dist/lib/custom/OrderHeader/order-header-form.component.js.map +1 -1
- package/dist/lib/custom/OrderHeader/order-lines-editor.component.d.ts +14 -2
- package/dist/lib/custom/OrderHeader/order-lines-editor.component.d.ts.map +1 -1
- package/dist/lib/custom/OrderHeader/order-lines-editor.component.js +44 -6
- package/dist/lib/custom/OrderHeader/order-lines-editor.component.js.map +1 -1
- package/dist/lib/custom/OrderHeader/picker-scroll.d.ts +12 -0
- package/dist/lib/custom/OrderHeader/picker-scroll.d.ts.map +1 -0
- package/dist/lib/custom/OrderHeader/picker-scroll.js +15 -0
- package/dist/lib/custom/OrderHeader/picker-scroll.js.map +1 -0
- package/dist/lib/custom/PaymentHeader/payment-header-form.component.d.ts +11 -0
- package/dist/lib/custom/PaymentHeader/payment-header-form.component.d.ts.map +1 -1
- package/dist/lib/custom/PaymentHeader/payment-header-form.component.js +363 -297
- package/dist/lib/custom/PaymentHeader/payment-header-form.component.js.map +1 -1
- package/dist/lib/data/orders-grid-state.d.ts +2 -1
- package/dist/lib/data/orders-grid-state.d.ts.map +1 -1
- package/dist/lib/data/orders-grid-state.js +2 -1
- package/dist/lib/data/orders-grid-state.js.map +1 -1
- package/dist/lib/data/orders-queries.d.ts +17 -4
- package/dist/lib/data/orders-queries.d.ts.map +1 -1
- package/dist/lib/data/orders-queries.js +30 -6
- package/dist/lib/data/orders-queries.js.map +1 -1
- package/dist/lib/form-panels/document-overviews.panels.js +1 -1
- package/dist/lib/form-panels/document-overviews.panels.js.map +1 -1
- package/dist/lib/form-panels/external-invoices.panel.js +3 -3
- package/dist/lib/form-panels/external-invoices.panel.js.map +1 -1
- package/dist/lib/form-panels/organization-orders.panel.d.ts +8 -1
- package/dist/lib/form-panels/organization-orders.panel.d.ts.map +1 -1
- package/dist/lib/form-panels/organization-orders.panel.js +29 -5
- package/dist/lib/form-panels/organization-orders.panel.js.map +1 -1
- package/dist/lib/form-panels/person-orders.panel.d.ts +8 -1
- package/dist/lib/form-panels/person-orders.panel.d.ts.map +1 -1
- package/dist/lib/form-panels/person-orders.panel.js +29 -5
- package/dist/lib/form-panels/person-orders.panel.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.js +2 -2
- package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.js.map +1 -1
- package/dist/lib/pages/orders/order-document.page.d.ts +13 -2
- package/dist/lib/pages/orders/order-document.page.d.ts.map +1 -1
- package/dist/lib/pages/orders/order-document.page.js +37 -6
- package/dist/lib/pages/orders/order-document.page.js.map +1 -1
- package/dist/lib/pages/orders/return.page.d.ts +9 -3
- package/dist/lib/pages/orders/return.page.d.ts.map +1 -1
- package/dist/lib/pages/orders/return.page.js +106 -83
- package/dist/lib/pages/orders/return.page.js.map +1 -1
- package/dist/lib/pages/payments/payments-dashboard.page.d.ts +11 -2
- package/dist/lib/pages/payments/payments-dashboard.page.d.ts.map +1 -1
- package/dist/lib/pages/payments/payments-dashboard.page.js +14 -12
- package/dist/lib/pages/payments/payments-dashboard.page.js.map +1 -1
- package/dist/lib/pages/payments/payments-list.page.d.ts +12 -3
- package/dist/lib/pages/payments/payments-list.page.d.ts.map +1 -1
- package/dist/lib/pages/payments/payments-list.page.js +15 -13
- package/dist/lib/pages/payments/payments-list.page.js.map +1 -1
- package/dist/lib/pages/receivables/billing.page.js +11 -11
- package/dist/lib/pages/receivables/billing.page.js.map +1 -1
- package/dist/lib/pages/receivables/external-invoicing-queue.page.js +1 -1
- package/dist/lib/pages/receivables/external-invoicing-queue.page.js.map +1 -1
- package/dist/lib/pages/receivables/progress.page.js +5 -5
- package/dist/lib/pages/receivables/subscriptions.page.d.ts +14 -3
- package/dist/lib/pages/receivables/subscriptions.page.d.ts.map +1 -1
- package/dist/lib/pages/receivables/subscriptions.page.js +17 -13
- package/dist/lib/pages/receivables/subscriptions.page.js.map +1 -1
- package/dist/lib/sections/section-nav.model.js +1 -1
- package/dist/lib/sections/section-nav.model.js.map +1 -1
- package/dist/lib/sections/section-shell.component.js +2 -2
- package/dist/lib/services/pricing-scheduler.service.d.ts +15 -1
- package/dist/lib/services/pricing-scheduler.service.d.ts.map +1 -1
- package/dist/lib/services/pricing-scheduler.service.js +31 -2
- package/dist/lib/services/pricing-scheduler.service.js.map +1 -1
- package/dist/lib/styles/orders-kit.css +21 -15
- package/package.json +3 -3
|
@@ -36,4 +36,14 @@ export declare function CheckPasswordEntry(password: string, confirmation: strin
|
|
|
36
36
|
export declare function MayRedirect(account: CheckoutAccountView | null, dismissed?: boolean): boolean;
|
|
37
37
|
/** True once nothing about the account step is left to do, so a reload need not come back to it. */
|
|
38
38
|
export declare function IsAccountSettled(account: CheckoutAccountView | null): boolean;
|
|
39
|
+
/** The confirmed order and the widget's post-sale settings, as `/account` returns them (#858). */
|
|
40
|
+
export interface CheckoutConfirmationView {
|
|
41
|
+
OrderNumber: string | null;
|
|
42
|
+
RedirectUrl: string | null;
|
|
43
|
+
SuccessMessage: string | null;
|
|
44
|
+
}
|
|
45
|
+
/** Reads `/account`'s `Confirmation`; null when absent or not an object. */
|
|
46
|
+
export declare function ReadCheckoutConfirmation(raw: unknown): CheckoutConfirmationView | null;
|
|
47
|
+
/** The success screen's message: the widget's own, else one naming the order when its number is known. */
|
|
48
|
+
export declare function ConfirmationMessage(successMessage: string | null | undefined, orderNumber: string | null): string;
|
|
39
49
|
//# sourceMappingURL=checkout-account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-account.d.ts","sourceRoot":"","sources":["../../../src/lib/checkout-widget/checkout-account.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErE,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,sBAAsB,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,EAAE,mBAAkE,CAAC;AAErG,oGAAoG;AACpG,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,GAAG,IAAI,CAW5E;AAeD,8FAA8F;AAC9F,wBAAgB,gBAAgB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,IAAI,GAAG,MAAM,GAAG,IAAI,CAGnF;AAED,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAMhG;AAED,iHAAiH;AACjH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIxF;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,EAAE,SAAS,UAAQ,GAAG,OAAO,CAG3F;AAED,oGAAoG;AACpG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,GAAG,OAAO,CAE7E;AAED,kGAAkG;AAClG,MAAM,WAAW,wBAAwB;IACrC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,4EAA4E;AAC5E,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,GAAG,wBAAwB,GAAG,IAAI,CAKtF;AAED,0GAA0G;AAC1G,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAEjH"}
|
|
@@ -75,4 +75,16 @@ export function MayRedirect(account, dismissed = false) {
|
|
|
75
75
|
export function IsAccountSettled(account) {
|
|
76
76
|
return !account || (account.Outcome !== 'Failed' && !account.CanSetPassword);
|
|
77
77
|
}
|
|
78
|
+
/** Reads `/account`'s `Confirmation`; null when absent or not an object. */
|
|
79
|
+
export function ReadCheckoutConfirmation(raw) {
|
|
80
|
+
if (!raw || typeof raw !== 'object')
|
|
81
|
+
return null;
|
|
82
|
+
const c = raw;
|
|
83
|
+
const text = (value) => (typeof value === 'string' && value.trim() ? value.trim() : null);
|
|
84
|
+
return { OrderNumber: text(c['OrderNumber']), RedirectUrl: text(c['RedirectUrl']), SuccessMessage: text(c['SuccessMessage']) };
|
|
85
|
+
}
|
|
86
|
+
/** The success screen's message: the widget's own, else one naming the order when its number is known. */
|
|
87
|
+
export function ConfirmationMessage(successMessage, orderNumber) {
|
|
88
|
+
return successMessage || (orderNumber ? `Thank you. Order ${orderNumber} is confirmed.` : 'Thank you. Your order is confirmed.');
|
|
89
|
+
}
|
|
78
90
|
//# sourceMappingURL=checkout-account.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-account.js","sourceRoot":"","sources":["../../../src/lib/checkout-widget/checkout-account.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAwB,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;AAErG,oGAAoG;AACpG,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC5C,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACjD,MAAM,CAAC,GAAG,GAA8B,CAAC;IACzC,IAAI,CAAC,CAAC,SAAS,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,SAAS,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,SAAS,CAAC,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACtG,OAAO;QACH,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;QACrB,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;QACpF,cAAc,EAAE,CAAC,CAAC,gBAAgB,CAAC,KAAK,IAAI;QAC5C,oBAAoB,EAAE,CAAC,CAAC,SAAS,CAAC,K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,CAAC,GAAY;IACjD,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACjD,MAAM,CAAC,GAAG,GAA8B,CAAC;IACzC,MAAM,IAAI,GAAG,CAAC,KAAc,EAAiB,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAClH,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC;AACnI,CAAC;AAED,0GAA0G;AAC1G,MAAM,UAAU,mBAAmB,CAAC,cAAyC,EAAE,WAA0B;IACrG,OAAO,cAAc,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,oBAAoB,WAAW,gBAAgB,CAAC,CAAC,CAAC,qCAAqC,CAAC,CAAC;AACrI,CAAC"}
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* shadow root. These builders are the element's public contract, kept pure so it is testable.
|
|
7
7
|
*
|
|
8
8
|
* NO PERSONAL DATA IN ANY DETAIL. The events reach every script on the host page, so no detail
|
|
9
|
-
* carries the buyer's e-mail, name or anything they typed beyond the promotion code.
|
|
9
|
+
* carries the buyer's e-mail, name or anything they typed beyond the promotion code. The one
|
|
10
|
+
* free-text field, `checkout-error`'s `message`, is the buyer-facing text and can carry server or
|
|
11
|
+
* gateway wording; its `stage` is what a host should track.
|
|
10
12
|
*/
|
|
11
13
|
/** The element's state, as `checkout-state-change` reports it. */
|
|
12
14
|
export type CheckoutElementState = 'LOADING' | 'CHECKOUT' | 'PROCESSING' | 'PASSWORD' | 'SUCCESS' | 'ERROR';
|
|
@@ -33,7 +35,19 @@ export interface CheckoutCompleteDetail {
|
|
|
33
35
|
currency: string | null;
|
|
34
36
|
coupon: string | null;
|
|
35
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Where the checkout failed, for a host page that tracks the funnel (#860): `initialize` (the
|
|
40
|
+
* checkout could not load), `draft` (pricing the order), `payment` (starting or confirming the
|
|
41
|
+
* payment), `complete` (booking the paid order) or `card` (loading card entry).
|
|
42
|
+
*/
|
|
43
|
+
export type CheckoutErrorStage = 'initialize' | 'draft' | 'payment' | 'complete' | 'card';
|
|
36
44
|
export interface CheckoutErrorDetail {
|
|
45
|
+
/** A stable value to track and forward. */
|
|
46
|
+
stage: CheckoutErrorStage;
|
|
47
|
+
/**
|
|
48
|
+
* The text shown to the buyer. It can include text the server or the payment gateway returned,
|
|
49
|
+
* so it is for display only: do not forward it to analytics.
|
|
50
|
+
*/
|
|
37
51
|
message: string;
|
|
38
52
|
}
|
|
39
53
|
export interface CheckoutCompleteSource {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-events.d.ts","sourceRoot":"","sources":["../../../src/lib/checkout-widget/checkout-events.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"checkout-events.d.ts","sourceRoot":"","sources":["../../../src/lib/checkout-widget/checkout-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,kEAAkE;AAClE,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5G,eAAO,MAAM,2BAA2B,0BAA0B,CAAC;AACnE,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAC3D,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AACrD,yDAAyD;AACzD,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AACvD,iGAAiG;AACjG,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AACrD,mFAAmF;AACnF,eAA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
7
|
*
|
|
8
8
|
* NO PERSONAL DATA IN ANY DETAIL. The events reach every script on the host page, so no detail
|
|
9
|
-
* carries the buyer's e-mail, name or anything they typed beyond the promotion code.
|
|
9
|
+
* carries the buyer's e-mail, name or anything they typed beyond the promotion code. The one
|
|
10
|
+
* free-text field, `checkout-error`'s `message`, is the buyer-facing text and can carry server or
|
|
11
|
+
* gateway wording; its `stage` is what a host should track.
|
|
10
12
|
*/
|
|
11
13
|
export const CHECKOUT_STATE_CHANGE_EVENT = 'checkout-state-change';
|
|
12
14
|
export const CHECKOUT_COMPLETE_EVENT = 'checkout-complete';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-events.js","sourceRoot":"","sources":["../../../src/lib/checkout-widget/checkout-events.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"checkout-events.js","sourceRoot":"","sources":["../../../src/lib/checkout-widget/checkout-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,MAAM,CAAC,MAAM,2BAA2B,GAAG,uBAAuB,CAAC;AACnE,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAC3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AACrD,yDAAyD;AACzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AACvD,iGAAiG;AACjG,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AACrD,mFAAmF;AACnF,MAAM,CAAC,MAAM,4BAA4B,GAAG,gBAAgB,CAAC;AAC7D,kEAAkE;AAClE,MAAM,CAAC,MAAM,4BAA4B,GAAG,wBAAwB,CAAC;AA4CrE,MAAM,IAAI,GAAG,CAAC,KAAc,EAAiB,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAElH,MAAM,UAAU,2BAA2B,CAAC,MAA8B;IACtE,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;IACtH,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACvC,OAAO;QACH,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACrC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;QACjC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG;QAC/D,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE;QAC3D,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;KAC9B,CAAC;AACN,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,oBAAoB,CAAI,IAAY,EAAE,MAAS;IAC3D,OAAO,IAAI,WAAW,CAAI,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -85,6 +85,8 @@ export declare class CheckoutPublicHostComponent implements OnInit, AfterViewChe
|
|
|
85
85
|
isPaymentReady: boolean;
|
|
86
86
|
stripePaymentMethodId: string | null;
|
|
87
87
|
errorMessage: string | null;
|
|
88
|
+
/** Information that is not a failure, shown in the notice style (#819). */
|
|
89
|
+
noticeMessage: string | null;
|
|
88
90
|
loadError: string | null;
|
|
89
91
|
successMessage: string | null;
|
|
90
92
|
orderNumber: string | null;
|
|
@@ -126,6 +128,8 @@ export declare class CheckoutPublicHostComponent implements OnInit, AfterViewChe
|
|
|
126
128
|
accountLoading: boolean;
|
|
127
129
|
/** The buyer chose to leave a failed account step. */
|
|
128
130
|
private accountDismissed;
|
|
131
|
+
/** The widget's redirect as `/account` reported it, when a reload resumed the account step. */
|
|
132
|
+
private resumedRedirectUrl;
|
|
129
133
|
get accountMessage(): string | null;
|
|
130
134
|
get verificationNote(): string | null;
|
|
131
135
|
/** Whether the buyer's access is ready (#325); null while nothing is tracked. */
|
|
@@ -270,6 +274,8 @@ export declare class CheckoutPublicHostComponent implements OnInit, AfterViewChe
|
|
|
270
274
|
* reload that resumes a settled step should not report a second sale.
|
|
271
275
|
*/
|
|
272
276
|
private syncAccountState;
|
|
277
|
+
/** The widget's redirect: from its configuration, or from `/account` after a reload (#858). */
|
|
278
|
+
get redirectUrl(): string | null;
|
|
273
279
|
/** Follows the widget's redirect once nothing is left for the buyer to do here. */
|
|
274
280
|
private leaveIfDone;
|
|
275
281
|
/** Reports a state the host page can track; repeats of the same state are not re-sent. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-public-host.component.d.ts","sourceRoot":"","sources":["../../../src/lib/checkout-widget/checkout-public-host.component.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACH,gBAAgB,EAIhB,YAAY,EAEZ,SAAS,EACT,MAAM,EAGT,MAAM,eAAe,CAAC;AAGvB,OAAO,
|
|
1
|
+
{"version":3,"file":"checkout-public-host.component.d.ts","sourceRoot":"","sources":["../../../src/lib/checkout-widget/checkout-public-host.component.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACH,gBAAgB,EAIhB,YAAY,EAEZ,SAAS,EACT,MAAM,EAGT,MAAM,eAAe,CAAC;AAGvB,OAAO,EAUH,KAAK,mBAAmB,EAC3B,MAAM,oBAAoB,CAAC;AAe5B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mitter, Input, Output, inject, } from '@angular/core';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
11
|
import { WithOrderReference } from './checkout-redirect.js';
|
|
12
|
-
import { ACCOUNT_STEP_FAILED, AccountMessage, CheckPasswordEntry, IsAccountSettled, MayRedirect, ReadCheckoutAccount, VerificationNote, } from './checkout-account.js';
|
|
12
|
+
import { ACCOUNT_STEP_FAILED, AccountMessage, CheckPasswordEntry, ConfirmationMessage, IsAccountSettled, MayRedirect, ReadCheckoutAccount, ReadCheckoutConfirmation, VerificationNote, } from './checkout-account.js';
|
|
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';
|
|
@@ -133,7 +133,7 @@ function CheckoutPublicHostComponent_Conditional_2_Conditional_11_Conditional_2_
|
|
|
133
133
|
} if (rf & 2) {
|
|
134
134
|
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
135
135
|
i0.ɵɵadvance(3);
|
|
136
|
-
i0.ɵɵconditional(
|
|
136
|
+
i0.ɵɵconditional(ctx_r0.redirectUrl ? 3 : -1);
|
|
137
137
|
} }
|
|
138
138
|
function CheckoutPublicHostComponent_Conditional_2_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
139
139
|
i0.ɵɵelementStart(0, "p", 12);
|
|
@@ -299,10 +299,10 @@ function CheckoutPublicHostComponent_Conditional_6_For_1_Template(rf, ctx) { if
|
|
|
299
299
|
i0.ɵɵelementEnd();
|
|
300
300
|
} if (rf & 2) {
|
|
301
301
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
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);
|
|
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)("noticeMessage", ctx_r0.noticeMessage)("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);
|
|
303
303
|
} }
|
|
304
304
|
function CheckoutPublicHostComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
305
|
-
i0.ɵɵrepeaterCreate(0, CheckoutPublicHostComponent_Conditional_6_For_1_Template, 1,
|
|
305
|
+
i0.ɵɵrepeaterCreate(0, CheckoutPublicHostComponent_Conditional_6_For_1_Template, 1, 16, "mj-checkout-widget", 39, i0.ɵɵrepeaterTrackByIdentity);
|
|
306
306
|
} if (rf & 2) {
|
|
307
307
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
308
308
|
i0.ɵɵrepeater(i0.ɵɵpureFunction1(0, _c0, ctx_r0.formGeneration));
|
|
@@ -343,6 +343,8 @@ export class CheckoutPublicHostComponent {
|
|
|
343
343
|
isPaymentReady = false;
|
|
344
344
|
stripePaymentMethodId = null;
|
|
345
345
|
errorMessage = null;
|
|
346
|
+
/** Information that is not a failure, shown in the notice style (#819). */
|
|
347
|
+
noticeMessage = null;
|
|
346
348
|
loadError = null;
|
|
347
349
|
successMessage = null;
|
|
348
350
|
orderNumber = null;
|
|
@@ -386,6 +388,8 @@ export class CheckoutPublicHostComponent {
|
|
|
386
388
|
accountLoading = false;
|
|
387
389
|
/** The buyer chose to leave a failed account step. */
|
|
388
390
|
accountDismissed = false;
|
|
391
|
+
/** The widget's redirect as `/account` reported it, when a reload resumed the account step. */
|
|
392
|
+
resumedRedirectUrl = null;
|
|
389
393
|
get accountMessage() {
|
|
390
394
|
return this.account ? AccountMessage(this.account, this.passwordSet) : null;
|
|
391
395
|
}
|
|
@@ -433,13 +437,16 @@ export class CheckoutPublicHostComponent {
|
|
|
433
437
|
// A reset runs this again: a failure from the previous attempt must not outlive it.
|
|
434
438
|
this.loadError = null;
|
|
435
439
|
this.readHostAttributes();
|
|
440
|
+
// These return before the try below, so they report the error themselves (#859).
|
|
436
441
|
if (!this.slug) {
|
|
437
442
|
this.loadError = 'This checkout link is missing its reference.';
|
|
443
|
+
this.reportError('initialize', this.loadError);
|
|
438
444
|
return;
|
|
439
445
|
}
|
|
440
446
|
this.sessionKey = this.clientKey();
|
|
441
447
|
if (!this.sessionKey) {
|
|
442
448
|
this.loadError = 'Checkout requires a secure random source. Open this page over HTTPS.';
|
|
449
|
+
this.reportError('initialize', this.loadError);
|
|
443
450
|
return;
|
|
444
451
|
}
|
|
445
452
|
if (!this.renewalToken && (await this.resumeAccountStep())) {
|
|
@@ -483,7 +490,7 @@ export class CheckoutPublicHostComponent {
|
|
|
483
490
|
}
|
|
484
491
|
finally {
|
|
485
492
|
if (this.loadError)
|
|
486
|
-
this.reportError(this.loadError);
|
|
493
|
+
this.reportError('initialize', this.loadError);
|
|
487
494
|
this.cdr.detectChanges();
|
|
488
495
|
}
|
|
489
496
|
}
|
|
@@ -603,6 +610,7 @@ export class CheckoutPublicHostComponent {
|
|
|
603
610
|
}
|
|
604
611
|
this.successMessage = null;
|
|
605
612
|
this.orderNumber = null;
|
|
613
|
+
this.resumedRedirectUrl = null;
|
|
606
614
|
this.account = null;
|
|
607
615
|
this.accountDismissed = false;
|
|
608
616
|
this.password = '';
|
|
@@ -626,6 +634,7 @@ export class CheckoutPublicHostComponent {
|
|
|
626
634
|
*/
|
|
627
635
|
resetForm() {
|
|
628
636
|
this.errorMessage = null;
|
|
637
|
+
this.noticeMessage = null;
|
|
629
638
|
this.stripePaymentMethodId = null;
|
|
630
639
|
this.serverPricedTotal = null;
|
|
631
640
|
this.memberDiscount = null;
|
|
@@ -643,6 +652,8 @@ export class CheckoutPublicHostComponent {
|
|
|
643
652
|
}
|
|
644
653
|
/** A price input changed: every total the server priced for the old inputs is stale, tax included. */
|
|
645
654
|
onQuoteInvalidated() {
|
|
655
|
+
// A total announced for the old inputs no longer holds.
|
|
656
|
+
this.noticeMessage = null;
|
|
646
657
|
this.quotedTotal = null;
|
|
647
658
|
this.quotedTax = null;
|
|
648
659
|
this.serverPricedTotal = null;
|
|
@@ -738,7 +749,9 @@ export class CheckoutPublicHostComponent {
|
|
|
738
749
|
}
|
|
739
750
|
this.processing = true;
|
|
740
751
|
this.errorMessage = null;
|
|
752
|
+
this.noticeMessage = null;
|
|
741
753
|
this.setState('PROCESSING');
|
|
754
|
+
let stage = 'draft';
|
|
742
755
|
try {
|
|
743
756
|
await this.settleBackgroundQuote();
|
|
744
757
|
const draft = await this.post('/draft', this.draftBody(this.config.productId, event, event.promotionCode ? [event.promotionCode] : []));
|
|
@@ -761,10 +774,12 @@ export class CheckoutPublicHostComponent {
|
|
|
761
774
|
const notice = memberDiscountNotice(draft, this.memberNoticeShown);
|
|
762
775
|
if (notice) {
|
|
763
776
|
this.memberNoticeShown = true;
|
|
764
|
-
this.
|
|
777
|
+
this.noticeMessage = notice;
|
|
778
|
+
this.setState('CHECKOUT');
|
|
765
779
|
return;
|
|
766
780
|
}
|
|
767
781
|
if (!draft.RequiresPayment) {
|
|
782
|
+
stage = 'complete';
|
|
768
783
|
await this.finish();
|
|
769
784
|
return;
|
|
770
785
|
}
|
|
@@ -772,8 +787,10 @@ export class CheckoutPublicHostComponent {
|
|
|
772
787
|
// (tax for the location, a code typed but never applied, or a price that changed), show
|
|
773
788
|
// it and ask for a second press rather than charge a different amount than the button said.
|
|
774
789
|
if (this.quoteChanged(draft, event.totalGross)) {
|
|
790
|
+
this.setState('CHECKOUT');
|
|
775
791
|
return;
|
|
776
792
|
}
|
|
793
|
+
stage = 'payment';
|
|
777
794
|
const intent = await this.post('/payment-intent', {
|
|
778
795
|
sessionId: this.sessionId,
|
|
779
796
|
clientSessionKey: this.sessionKey,
|
|
@@ -784,6 +801,7 @@ export class CheckoutPublicHostComponent {
|
|
|
784
801
|
throw new Error(this.str(intent?.ErrorMessage, 'Could not start payment.'));
|
|
785
802
|
}
|
|
786
803
|
if (intentAlreadyCollected(intent.Status)) {
|
|
804
|
+
stage = 'complete';
|
|
787
805
|
await this.finish();
|
|
788
806
|
return;
|
|
789
807
|
}
|
|
@@ -818,11 +836,12 @@ export class CheckoutPublicHostComponent {
|
|
|
818
836
|
throw new Error(`Payment was not confirmed (Stripe status: ${result.paymentIntent?.status}).`);
|
|
819
837
|
}
|
|
820
838
|
}
|
|
839
|
+
stage = 'complete';
|
|
821
840
|
await this.finish();
|
|
822
841
|
}
|
|
823
842
|
catch (err) {
|
|
824
843
|
this.errorMessage = err instanceof Error ? err.message : 'Checkout failed.';
|
|
825
|
-
this.reportError(this.errorMessage);
|
|
844
|
+
this.reportError(stage, this.errorMessage);
|
|
826
845
|
}
|
|
827
846
|
finally {
|
|
828
847
|
this.processing = false;
|
|
@@ -841,6 +860,7 @@ export class CheckoutPublicHostComponent {
|
|
|
841
860
|
this.processing = true;
|
|
842
861
|
this.errorMessage = null;
|
|
843
862
|
this.setState('PROCESSING');
|
|
863
|
+
let stage = 'payment';
|
|
844
864
|
try {
|
|
845
865
|
const intent = await this.post('/payment-intent', {
|
|
846
866
|
sessionId: this.sessionId,
|
|
@@ -871,6 +891,7 @@ export class CheckoutPublicHostComponent {
|
|
|
871
891
|
}
|
|
872
892
|
}
|
|
873
893
|
}
|
|
894
|
+
stage = 'complete';
|
|
874
895
|
const done = await this.completeAfterPayment(() => this.post('/complete', {
|
|
875
896
|
sessionId: this.sessionId,
|
|
876
897
|
clientSessionKey: this.sessionKey,
|
|
@@ -895,7 +916,7 @@ export class CheckoutPublicHostComponent {
|
|
|
895
916
|
}
|
|
896
917
|
catch (err) {
|
|
897
918
|
this.errorMessage = err instanceof Error ? err.message : 'Payment failed.';
|
|
898
|
-
this.reportError(this.errorMessage);
|
|
919
|
+
this.reportError(stage, this.errorMessage);
|
|
899
920
|
}
|
|
900
921
|
finally {
|
|
901
922
|
this.processing = false;
|
|
@@ -921,7 +942,7 @@ export class CheckoutPublicHostComponent {
|
|
|
921
942
|
}
|
|
922
943
|
this.quotedTotal = total;
|
|
923
944
|
this.quotedTax = tax > 0 ? tax : null;
|
|
924
|
-
this.
|
|
945
|
+
this.noticeMessage = tax > 0
|
|
925
946
|
? `The total is ${total.toFixed(2)}, including ${tax.toFixed(2)} sales tax. Review it and press Pay again.`
|
|
926
947
|
: `The total is ${total.toFixed(2)}. Review it and press Pay again.`;
|
|
927
948
|
return true;
|
|
@@ -940,9 +961,7 @@ export class CheckoutPublicHostComponent {
|
|
|
940
961
|
throw new Error(this.str(done.ErrorMessage, 'Could not complete checkout.'));
|
|
941
962
|
}
|
|
942
963
|
this.orderNumber = done.OrderNumber ? String(done.OrderNumber) : null;
|
|
943
|
-
this.successMessage =
|
|
944
|
-
this.config?.successMessage ||
|
|
945
|
-
(this.orderNumber ? `Thank you. Order ${this.orderNumber} is confirmed.` : 'Thank you. Your order is confirmed.');
|
|
964
|
+
this.successMessage = ConfirmationMessage(this.config?.successMessage, this.orderNumber);
|
|
946
965
|
// Dispatched before any redirect, so a host listener sees the sale on this page.
|
|
947
966
|
this.setState('SUCCESS');
|
|
948
967
|
this.dispatch(CHECKOUT_COMPLETE_EVENT, BuildCheckoutCompleteDetail({
|
|
@@ -1056,7 +1075,12 @@ export class CheckoutPublicHostComponent {
|
|
|
1056
1075
|
return false;
|
|
1057
1076
|
}
|
|
1058
1077
|
this.sessionId = sessionId;
|
|
1059
|
-
|
|
1078
|
+
// A reload skips /initialize, so the order number and the widget's redirect come with
|
|
1079
|
+
// the account step (#858).
|
|
1080
|
+
const confirmation = ReadCheckoutConfirmation(res.Confirmation);
|
|
1081
|
+
this.orderNumber = confirmation?.OrderNumber ?? null;
|
|
1082
|
+
this.resumedRedirectUrl = confirmation?.RedirectUrl ?? null;
|
|
1083
|
+
this.successMessage = ConfirmationMessage(confirmation?.SuccessMessage, this.orderNumber);
|
|
1060
1084
|
this.account = account;
|
|
1061
1085
|
if (IsAccountSettled(account))
|
|
1062
1086
|
this.forgetCompleting();
|
|
@@ -1128,13 +1152,18 @@ export class CheckoutPublicHostComponent {
|
|
|
1128
1152
|
this.setState('SUCCESS');
|
|
1129
1153
|
}
|
|
1130
1154
|
}
|
|
1155
|
+
/** The widget's redirect: from its configuration, or from `/account` after a reload (#858). */
|
|
1156
|
+
get redirectUrl() {
|
|
1157
|
+
return this.config?.redirectUrl || this.resumedRedirectUrl;
|
|
1158
|
+
}
|
|
1131
1159
|
/** Follows the widget's redirect once nothing is left for the buyer to do here. */
|
|
1132
1160
|
leaveIfDone() {
|
|
1133
1161
|
if (this.destroyed)
|
|
1134
1162
|
return;
|
|
1135
|
-
|
|
1163
|
+
const redirectUrl = this.redirectUrl;
|
|
1164
|
+
if (redirectUrl && !this.accountLoading && !this.accessTracking && MayRedirect(this.account, this.accountDismissed)) {
|
|
1136
1165
|
// The landing page learns which order completed from `?order=` (#295).
|
|
1137
|
-
window.location.href = WithOrderReference(
|
|
1166
|
+
window.location.href = WithOrderReference(redirectUrl, this.orderNumber, window.location.href);
|
|
1138
1167
|
}
|
|
1139
1168
|
}
|
|
1140
1169
|
/** Reports a state the host page can track; repeats of the same state are not re-sent. */
|
|
@@ -1144,9 +1173,9 @@ export class CheckoutPublicHostComponent {
|
|
|
1144
1173
|
this.state = state;
|
|
1145
1174
|
this.dispatch(CHECKOUT_STATE_CHANGE_EVENT, { state });
|
|
1146
1175
|
}
|
|
1147
|
-
reportError(message) {
|
|
1176
|
+
reportError(stage, message) {
|
|
1148
1177
|
this.setState('ERROR');
|
|
1149
|
-
this.dispatch(CHECKOUT_ERROR_EVENT, { message });
|
|
1178
|
+
this.dispatch(CHECKOUT_ERROR_EVENT, { stage, message });
|
|
1150
1179
|
}
|
|
1151
1180
|
/** Dispatches on the `<mj-orders-checkout>` element; bubbling and composed, so `document` hears it too. Nothing once it is removed. */
|
|
1152
1181
|
dispatch(name, detail) {
|
|
@@ -1173,7 +1202,7 @@ export class CheckoutPublicHostComponent {
|
|
|
1173
1202
|
catch (err) {
|
|
1174
1203
|
this.cardMounted = false;
|
|
1175
1204
|
this.errorMessage = err instanceof Error ? err.message : 'Could not load card entry.';
|
|
1176
|
-
this.reportError(this.errorMessage);
|
|
1205
|
+
this.reportError('card', this.errorMessage);
|
|
1177
1206
|
}
|
|
1178
1207
|
}
|
|
1179
1208
|
loadStripe(pk) {
|
|
@@ -1364,7 +1393,7 @@ export class CheckoutPublicHostComponent {
|
|
|
1364
1393
|
return typeof value === 'string' && value ? value : fallback;
|
|
1365
1394
|
}
|
|
1366
1395
|
static ɵfac = function CheckoutPublicHostComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckoutPublicHostComponent)(); };
|
|
1367
|
-
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) {
|
|
1396
|
+
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", "noticeMessage", "appliedPromotion", "serverPricedTotal", "memberDiscount", "lockEmail", "promotionError", "quotedTotal", "quotedTax"], [3, "promotionCodeApplied", "submitted", "cancelled", "quoteInvalidated", "quoteRequested", "config", "distributionSlug", "sessionKey", "isProcessing", "isPaymentReady", "stripePaymentMethodId", "prefillEmail", "errorMessage", "noticeMessage", "appliedPromotion", "serverPricedTotal", "memberDiscount", "lockEmail", "promotionError", "quotedTotal", "quotedTax"]], template: function CheckoutPublicHostComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1368
1397
|
i0.ɵɵelementStart(0, "div", 0);
|
|
1369
1398
|
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);
|
|
1370
1399
|
i0.ɵɵelement(7, "div", 6);
|
|
@@ -1376,7 +1405,7 @@ export class CheckoutPublicHostComponent {
|
|
|
1376
1405
|
}
|
|
1377
1406
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckoutPublicHostComponent, [{
|
|
1378
1407
|
type: Component,
|
|
1379
|
-
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 /* Pay-button colour; follows the public --mj-primary-color theme hook when the embedding page sets it. */\n --mjo-co-primary: var(--mj-primary-color, #2563eb);\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(--mjo-co-primary);\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"] }]
|
|
1408
|
+
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 (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 [noticeMessage]=\"noticeMessage\"\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 /* Pay-button colour; follows the public --mj-primary-color theme hook when the embedding page sets it. */\n --mjo-co-primary: var(--mj-primary-color, #2563eb);\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(--mjo-co-primary);\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"] }]
|
|
1380
1409
|
}], null, { slug: [{
|
|
1381
1410
|
type: Input
|
|
1382
1411
|
}], apiRoot: [{
|
|
@@ -1389,5 +1418,5 @@ export class CheckoutPublicHostComponent {
|
|
|
1389
1418
|
type: Output,
|
|
1390
1419
|
args: ['checkout-already-subscribed']
|
|
1391
1420
|
}] }); })();
|
|
1392
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CheckoutPublicHostComponent, { className: "CheckoutPublicHostComponent", filePath: "lib/checkout-widget/checkout-public-host.component.ts", lineNumber:
|
|
1421
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CheckoutPublicHostComponent, { className: "CheckoutPublicHostComponent", filePath: "lib/checkout-widget/checkout-public-host.component.ts", lineNumber: 126 }); })();
|
|
1393
1422
|
//# sourceMappingURL=checkout-public-host.component.js.map
|