@mj-biz-apps/orders-ng 5.1.0 → 5.2.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 +38080 -0
- package/dist/lib/checkout-widget/checkout-draft-line.d.ts +25 -0
- package/dist/lib/checkout-widget/checkout-draft-line.d.ts.map +1 -0
- package/dist/lib/checkout-widget/checkout-draft-line.js +46 -0
- package/dist/lib/checkout-widget/checkout-draft-line.js.map +1 -0
- package/dist/lib/checkout-widget/checkout-public-host.component.d.ts +80 -0
- package/dist/lib/checkout-widget/checkout-public-host.component.d.ts.map +1 -0
- package/dist/lib/checkout-widget/checkout-public-host.component.js +360 -0
- package/dist/lib/checkout-widget/checkout-public-host.component.js.map +1 -0
- package/dist/lib/checkout-widget/checkout-widget.component.d.ts +143 -0
- package/dist/lib/checkout-widget/checkout-widget.component.d.ts.map +1 -0
- package/dist/lib/checkout-widget/checkout-widget.component.js +873 -0
- package/dist/lib/checkout-widget/checkout-widget.component.js.map +1 -0
- package/dist/lib/custom/OrderHeader/order-header-form.component.d.ts +1 -0
- package/dist/lib/custom/OrderHeader/order-header-form.component.d.ts.map +1 -1
- package/dist/lib/custom/OrderHeader/order-header-form.component.js +10 -6
- package/dist/lib/custom/OrderHeader/order-header-form.component.js.map +1 -1
- package/dist/lib/custom/OrderHeader/order-lines-editor.component.d.ts +2 -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 +37 -11
- package/dist/lib/custom/OrderHeader/order-lines-editor.component.js.map +1 -1
- package/dist/lib/form-panels/party-order-stats.js +2 -2
- package/dist/lib/form-panels/party-order-stats.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSession/mjbizappsorderscheckoutsession.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSession/mjbizappsorderscheckoutsession.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSession/mjbizappsorderscheckoutsession.form.component.js +103 -0
- package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSession/mjbizappsorderscheckoutsession.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidget/mjbizappsorderscheckoutwidget.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidget/mjbizappsorderscheckoutwidget.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidget/mjbizappsorderscheckoutwidget.form.component.js +136 -0
- package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidget/mjbizappsorderscheckoutwidget.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidgetDistribution/mjbizappsorderscheckoutwidgetdistribution.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidgetDistribution/mjbizappsorderscheckoutwidgetdistribution.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidgetDistribution/mjbizappsorderscheckoutwidgetdistribution.form.component.js +106 -0
- package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidgetDistribution/mjbizappsorderscheckoutwidgetdistribution.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/mjBizAppsOrdersEventOrderLine/mjbizappsorderseventorderline.form.component.js +9 -9
- package/dist/lib/generated/Entities/mjBizAppsOrdersEventOrderLine/mjbizappsorderseventorderline.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersEventProduct/mjbizappsorderseventproduct.form.component.js +12 -12
- package/dist/lib/generated/Entities/mjBizAppsOrdersEventProduct/mjbizappsorderseventproduct.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCompanyPolicy/mjbizappsordersordercompanypolicy.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCompanyPolicy/mjbizappsordersordercompanypolicy.form.component.js +16 -10
- package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCompanyPolicy/mjbizappsordersordercompanypolicy.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.js +78 -52
- package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLine/mjbizappsordersorderline.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLine/mjbizappsordersorderline.form.component.js +88 -82
- package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLine/mjbizappsordersorderline.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentHeader/mjbizappsorderspaymentheader.form.component.js +3 -3
- package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentHeader/mjbizappsorderspaymentheader.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentIntent/mjbizappsorderspaymentintent.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentIntent/mjbizappsorderspaymentintent.form.component.js +23 -5
- package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentIntent/mjbizappsorderspaymentintent.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersProduct/mjbizappsordersproduct.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersProduct/mjbizappsordersproduct.form.component.js +75 -69
- package/dist/lib/generated/Entities/mjBizAppsOrdersProduct/mjbizappsordersproduct.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersProductCategory/mjbizappsordersproductcategory.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersProductCategory/mjbizappsordersproductcategory.form.component.js +37 -31
- package/dist/lib/generated/Entities/mjBizAppsOrdersProductCategory/mjbizappsordersproductcategory.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersProductType/mjbizappsordersproducttype.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsOrdersProductType/mjbizappsordersproducttype.form.component.js +24 -16
- package/dist/lib/generated/Entities/mjBizAppsOrdersProductType/mjbizappsordersproducttype.form.component.js.map +1 -1
- package/dist/lib/generated/generated-forms.module.d.ts +54 -51
- package/dist/lib/generated/generated-forms.module.d.ts.map +1 -1
- package/dist/lib/generated/generated-forms.module.js +27 -18
- package/dist/lib/generated/generated-forms.module.js.map +1 -1
- package/dist/lib/pages/catalog/pricing.page.d.ts +3 -24
- package/dist/lib/pages/catalog/pricing.page.d.ts.map +1 -1
- package/dist/lib/pages/catalog/pricing.page.js +158 -214
- package/dist/lib/pages/catalog/pricing.page.js.map +1 -1
- package/dist/lib/pages/catalog/products.page.d.ts +6 -29
- package/dist/lib/pages/catalog/products.page.d.ts.map +1 -1
- package/dist/lib/pages/catalog/products.page.js +255 -315
- package/dist/lib/pages/catalog/products.page.js.map +1 -1
- package/dist/lib/pages/orders/fulfillment.page.d.ts +14 -97
- package/dist/lib/pages/orders/fulfillment.page.d.ts.map +1 -1
- package/dist/lib/pages/orders/fulfillment.page.js +93 -258
- package/dist/lib/pages/orders/fulfillment.page.js.map +1 -1
- package/dist/lib/pages/orders/order-document.page.js +1 -1
- package/dist/lib/pages/orders/order-document.page.js.map +1 -1
- package/dist/lib/pages/orders/orders-dashboard.page.d.ts +29 -58
- package/dist/lib/pages/orders/orders-dashboard.page.d.ts.map +1 -1
- package/dist/lib/pages/orders/orders-dashboard.page.js +602 -352
- package/dist/lib/pages/orders/orders-dashboard.page.js.map +1 -1
- package/dist/lib/pages/orders/orders-list.page.d.ts +8 -58
- package/dist/lib/pages/orders/orders-list.page.d.ts.map +1 -1
- package/dist/lib/pages/orders/orders-list.page.js +52 -237
- package/dist/lib/pages/orders/orders-list.page.js.map +1 -1
- package/dist/lib/pages/payments/account-credit.page.d.ts +7 -17
- package/dist/lib/pages/payments/account-credit.page.d.ts.map +1 -1
- package/dist/lib/pages/payments/account-credit.page.js +99 -85
- package/dist/lib/pages/payments/account-credit.page.js.map +1 -1
- package/dist/lib/pages/payments/payments-dashboard.page.d.ts +4 -15
- package/dist/lib/pages/payments/payments-dashboard.page.d.ts.map +1 -1
- package/dist/lib/pages/payments/payments-dashboard.page.js +76 -111
- package/dist/lib/pages/payments/payments-dashboard.page.js.map +1 -1
- package/dist/lib/pages/payments/payments-list.page.d.ts +7 -41
- package/dist/lib/pages/payments/payments-list.page.d.ts.map +1 -1
- package/dist/lib/pages/payments/payments-list.page.js +51 -130
- package/dist/lib/pages/payments/payments-list.page.js.map +1 -1
- package/dist/lib/pages/receivables/customer-ar.page.d.ts +6 -8
- package/dist/lib/pages/receivables/customer-ar.page.d.ts.map +1 -1
- package/dist/lib/pages/receivables/customer-ar.page.js +112 -100
- package/dist/lib/pages/receivables/customer-ar.page.js.map +1 -1
- package/dist/lib/pages/receivables/overdue.page.d.ts +6 -3
- package/dist/lib/pages/receivables/overdue.page.d.ts.map +1 -1
- package/dist/lib/pages/receivables/overdue.page.js +61 -65
- package/dist/lib/pages/receivables/overdue.page.js.map +1 -1
- package/dist/lib/pages/receivables/subscriptions.page.d.ts +5 -9
- package/dist/lib/pages/receivables/subscriptions.page.d.ts.map +1 -1
- package/dist/lib/pages/receivables/subscriptions.page.js +139 -153
- package/dist/lib/pages/receivables/subscriptions.page.js.map +1 -1
- package/dist/lib/panels/order-stages.d.ts +12 -16
- package/dist/lib/panels/order-stages.d.ts.map +1 -1
- package/dist/lib/panels/order-stages.js +6 -42
- package/dist/lib/panels/order-stages.js.map +1 -1
- package/dist/lib/panels/party-orders-overview.component.d.ts +3 -1
- package/dist/lib/panels/party-orders-overview.component.d.ts.map +1 -1
- package/dist/lib/panels/party-orders-overview.component.js +18 -6
- package/dist/lib/panels/party-orders-overview.component.js.map +1 -1
- package/dist/lib/panels/status-stepper.component.d.ts +1 -1
- package/dist/lib/panels/status-stepper.component.d.ts.map +1 -1
- package/dist/lib/services/pricing-scheduler.service.d.ts +3 -4
- package/dist/lib/services/pricing-scheduler.service.d.ts.map +1 -1
- package/dist/lib/services/pricing-scheduler.service.js +3 -4
- package/dist/lib/services/pricing-scheduler.service.js.map +1 -1
- package/dist/public-api.d.ts +3 -2
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +3 -2
- package/dist/public-api.js.map +1 -1
- package/package.json +28 -16
- package/dist/lib/pages/orders/order-editor.page.d.ts +0 -547
- package/dist/lib/pages/orders/order-editor.page.d.ts.map +0 -1
- package/dist/lib/pages/orders/order-editor.page.js +0 -2269
- package/dist/lib/pages/orders/order-editor.page.js.map +0 -1
- package/dist/lib/pages/orders/order-workspace.page.d.ts +0 -120
- package/dist/lib/pages/orders/order-workspace.page.d.ts.map +0 -1
- package/dist/lib/pages/orders/order-workspace.page.js +0 -443
- package/dist/lib/pages/orders/order-workspace.page.js.map +0 -1
|
@@ -0,0 +1,873 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Generic Adaptive Checkout Widget Component
|
|
3
|
+
*
|
|
4
|
+
* Provides a responsive, embeddable checkout surface for single-item, multi-unit
|
|
5
|
+
* extended products, zero-dollar registrations, and custom domain extensions
|
|
6
|
+
* with dynamic metadata-driven field generation, customUI JSON configuration,
|
|
7
|
+
* CSS theming, and custom JS lifecycle hooks.
|
|
8
|
+
*
|
|
9
|
+
* @module @mj-biz-apps/orders-angular/checkout-widget
|
|
10
|
+
*/
|
|
11
|
+
import { Component, Input, Output, EventEmitter, signal, computed, ChangeDetectionStrategy } from '@angular/core';
|
|
12
|
+
import { CommonModule } from '@angular/common';
|
|
13
|
+
import { FormsModule } from '@angular/forms';
|
|
14
|
+
import * as i0 from "@angular/core";
|
|
15
|
+
import * as i1 from "@angular/forms";
|
|
16
|
+
const _forTrack0 = ($index, $item) => $item.name;
|
|
17
|
+
const _forTrack1 = ($index, $item) => $item.value;
|
|
18
|
+
function MJCheckoutWidgetComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
19
|
+
i0.ɵɵelementStart(0, "p", 3);
|
|
20
|
+
i0.ɵɵtext(1);
|
|
21
|
+
i0.ɵɵelementEnd();
|
|
22
|
+
} if (rf & 2) {
|
|
23
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
24
|
+
i0.ɵɵadvance();
|
|
25
|
+
i0.ɵɵtextInterpolate(ctx_r0.config == null ? null : ctx_r0.config.description);
|
|
26
|
+
} }
|
|
27
|
+
function MJCheckoutWidgetComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
28
|
+
i0.ɵɵelementStart(0, "div", 4)(1, "span", 18);
|
|
29
|
+
i0.ɵɵtext(2, "\u26A0\uFE0F");
|
|
30
|
+
i0.ɵɵelementEnd();
|
|
31
|
+
i0.ɵɵelementStart(3, "span");
|
|
32
|
+
i0.ɵɵtext(4);
|
|
33
|
+
i0.ɵɵelementEnd()();
|
|
34
|
+
} if (rf & 2) {
|
|
35
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
36
|
+
i0.ɵɵadvance(4);
|
|
37
|
+
i0.ɵɵtextInterpolate(ctx_r0.displayErrorMessage());
|
|
38
|
+
} }
|
|
39
|
+
function MJCheckoutWidgetComponent_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
40
|
+
i0.ɵɵelementStart(0, "span", 9);
|
|
41
|
+
i0.ɵɵtext(1, "FREE");
|
|
42
|
+
i0.ɵɵelementEnd();
|
|
43
|
+
} }
|
|
44
|
+
function MJCheckoutWidgetComponent_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
45
|
+
i0.ɵɵelementStart(0, "span", 11);
|
|
46
|
+
i0.ɵɵtext(1, "$0.00");
|
|
47
|
+
i0.ɵɵelementEnd();
|
|
48
|
+
} }
|
|
49
|
+
function MJCheckoutWidgetComponent_Conditional_14_Template(rf, ctx) { if (rf & 1) {
|
|
50
|
+
i0.ɵɵelementStart(0, "span", 12);
|
|
51
|
+
i0.ɵɵtext(1);
|
|
52
|
+
i0.ɵɵelementEnd();
|
|
53
|
+
} if (rf & 2) {
|
|
54
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
55
|
+
i0.ɵɵadvance();
|
|
56
|
+
i0.ɵɵtextInterpolate2("", ctx_r0.currencySymbol(), "", ((ctx_r0.config == null ? null : ctx_r0.config.unitPrice) || 0).toFixed(2));
|
|
57
|
+
} }
|
|
58
|
+
function MJCheckoutWidgetComponent_Conditional_15_Template(rf, ctx) { if (rf & 1) {
|
|
59
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
60
|
+
i0.ɵɵelementStart(0, "div", 13)(1, "label", 19);
|
|
61
|
+
i0.ɵɵtext(2, "Quantity");
|
|
62
|
+
i0.ɵɵelementEnd();
|
|
63
|
+
i0.ɵɵelementStart(3, "div", 20)(4, "button", 21);
|
|
64
|
+
i0.ɵɵlistener("click", function MJCheckoutWidgetComponent_Conditional_15_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onQuantityChange(ctx_r0.quantity() - 1)); });
|
|
65
|
+
i0.ɵɵtext(5, "-");
|
|
66
|
+
i0.ɵɵelementEnd();
|
|
67
|
+
i0.ɵɵelementStart(6, "input", 22);
|
|
68
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_15_Template_input_ngModelChange_6_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onQuantityChange($event)); });
|
|
69
|
+
i0.ɵɵelementEnd();
|
|
70
|
+
i0.ɵɵelementStart(7, "button", 21);
|
|
71
|
+
i0.ɵɵlistener("click", function MJCheckoutWidgetComponent_Conditional_15_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onQuantityChange(ctx_r0.quantity() + 1)); });
|
|
72
|
+
i0.ɵɵtext(8, "+");
|
|
73
|
+
i0.ɵɵelementEnd()()();
|
|
74
|
+
} if (rf & 2) {
|
|
75
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
76
|
+
i0.ɵɵadvance(4);
|
|
77
|
+
i0.ɵɵproperty("disabled", ctx_r0.quantity() <= 1);
|
|
78
|
+
i0.ɵɵadvance(2);
|
|
79
|
+
i0.ɵɵproperty("ngModel", ctx_r0.quantity())("max", (ctx_r0.config == null ? null : ctx_r0.config.maxQuantity) || 50);
|
|
80
|
+
i0.ɵɵadvance();
|
|
81
|
+
i0.ɵɵproperty("disabled", ctx_r0.quantity() >= ((ctx_r0.config == null ? null : ctx_r0.config.maxQuantity) || 50));
|
|
82
|
+
} }
|
|
83
|
+
function MJCheckoutWidgetComponent_Conditional_17_For_4_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
84
|
+
i0.ɵɵelementStart(0, "span", 28);
|
|
85
|
+
i0.ɵɵtext(1, "*");
|
|
86
|
+
i0.ɵɵelementEnd();
|
|
87
|
+
} }
|
|
88
|
+
function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_4_Template(rf, ctx) { if (rf & 1) {
|
|
89
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
90
|
+
i0.ɵɵelementStart(0, "textarea", 35);
|
|
91
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_4_Template_textarea_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r3); const field_r4 = i0.ɵɵnextContext().$implicit; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.updateUnitField(0, field_r4.name, $event)); });
|
|
92
|
+
i0.ɵɵtext(1, " ");
|
|
93
|
+
i0.ɵɵelementEnd();
|
|
94
|
+
} if (rf & 2) {
|
|
95
|
+
let tmp_12_0;
|
|
96
|
+
const field_r4 = i0.ɵɵnextContext().$implicit;
|
|
97
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
98
|
+
i0.ɵɵproperty("ngModel", (tmp_12_0 = ctx_r0.units()[0]) == null ? null : tmp_12_0[field_r4.name])("placeholder", field_r4.placeholder || "")("required", field_r4.required || false);
|
|
99
|
+
} }
|
|
100
|
+
function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_5_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
101
|
+
i0.ɵɵelementStart(0, "option", 37);
|
|
102
|
+
i0.ɵɵtext(1);
|
|
103
|
+
i0.ɵɵelementEnd();
|
|
104
|
+
} if (rf & 2) {
|
|
105
|
+
const opt_r6 = ctx.$implicit;
|
|
106
|
+
i0.ɵɵproperty("ngValue", opt_r6.value);
|
|
107
|
+
i0.ɵɵadvance();
|
|
108
|
+
i0.ɵɵtextInterpolate(opt_r6.label);
|
|
109
|
+
} }
|
|
110
|
+
function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_5_Template(rf, ctx) { if (rf & 1) {
|
|
111
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
112
|
+
i0.ɵɵelementStart(0, "select", 36);
|
|
113
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_5_Template_select_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r5); const field_r4 = i0.ɵɵnextContext().$implicit; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.updateUnitField(0, field_r4.name, $event)); });
|
|
114
|
+
i0.ɵɵelementStart(1, "option", 37);
|
|
115
|
+
i0.ɵɵtext(2);
|
|
116
|
+
i0.ɵɵelementEnd();
|
|
117
|
+
i0.ɵɵrepeaterCreate(3, MJCheckoutWidgetComponent_Conditional_17_For_4_Case_5_For_4_Template, 2, 2, "option", 37, _forTrack1);
|
|
118
|
+
i0.ɵɵelementEnd();
|
|
119
|
+
} if (rf & 2) {
|
|
120
|
+
let tmp_12_0;
|
|
121
|
+
const field_r4 = i0.ɵɵnextContext().$implicit;
|
|
122
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
123
|
+
i0.ɵɵproperty("ngModel", (tmp_12_0 = ctx_r0.units()[0]) == null ? null : tmp_12_0[field_r4.name])("required", field_r4.required || false);
|
|
124
|
+
i0.ɵɵadvance();
|
|
125
|
+
i0.ɵɵproperty("ngValue", "");
|
|
126
|
+
i0.ɵɵadvance();
|
|
127
|
+
i0.ɵɵtextInterpolate1("Select ", field_r4.label);
|
|
128
|
+
i0.ɵɵadvance();
|
|
129
|
+
i0.ɵɵrepeater(field_r4.options);
|
|
130
|
+
} }
|
|
131
|
+
function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_6_Template(rf, ctx) { if (rf & 1) {
|
|
132
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
133
|
+
i0.ɵɵelementStart(0, "label", 31)(1, "input", 38);
|
|
134
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_6_Template_input_ngModelChange_1_listener($event) { i0.ɵɵrestoreView(_r7); const field_r4 = i0.ɵɵnextContext().$implicit; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.updateUnitField(0, field_r4.name, $event)); });
|
|
135
|
+
i0.ɵɵelementEnd();
|
|
136
|
+
i0.ɵɵelementStart(2, "span");
|
|
137
|
+
i0.ɵɵtext(3);
|
|
138
|
+
i0.ɵɵelementEnd()();
|
|
139
|
+
} if (rf & 2) {
|
|
140
|
+
let tmp_12_0;
|
|
141
|
+
const field_r4 = i0.ɵɵnextContext().$implicit;
|
|
142
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
143
|
+
i0.ɵɵadvance();
|
|
144
|
+
i0.ɵɵproperty("ngModel", (tmp_12_0 = ctx_r0.units()[0]) == null ? null : tmp_12_0[field_r4.name]);
|
|
145
|
+
i0.ɵɵadvance(2);
|
|
146
|
+
i0.ɵɵtextInterpolate(field_r4.label);
|
|
147
|
+
} }
|
|
148
|
+
function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_7_Template(rf, ctx) { if (rf & 1) {
|
|
149
|
+
const _r8 = i0.ɵɵgetCurrentView();
|
|
150
|
+
i0.ɵɵelementStart(0, "input", 39);
|
|
151
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_7_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r8); const field_r4 = i0.ɵɵnextContext().$implicit; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.updateUnitField(0, field_r4.name, $event)); });
|
|
152
|
+
i0.ɵɵelementEnd();
|
|
153
|
+
} if (rf & 2) {
|
|
154
|
+
let tmp_12_0;
|
|
155
|
+
const field_r4 = i0.ɵɵnextContext().$implicit;
|
|
156
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
157
|
+
i0.ɵɵproperty("ngModel", (tmp_12_0 = ctx_r0.units()[0]) == null ? null : tmp_12_0[field_r4.name])("placeholder", field_r4.placeholder || "")("required", field_r4.required || false);
|
|
158
|
+
} }
|
|
159
|
+
function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_8_Template(rf, ctx) { if (rf & 1) {
|
|
160
|
+
const _r9 = i0.ɵɵgetCurrentView();
|
|
161
|
+
i0.ɵɵelementStart(0, "input", 40);
|
|
162
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_8_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r9); const field_r4 = i0.ɵɵnextContext().$implicit; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.updateUnitField(0, field_r4.name, $event)); });
|
|
163
|
+
i0.ɵɵelementEnd();
|
|
164
|
+
} if (rf & 2) {
|
|
165
|
+
let tmp_12_0;
|
|
166
|
+
const field_r4 = i0.ɵɵnextContext().$implicit;
|
|
167
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
168
|
+
i0.ɵɵproperty("ngModel", (tmp_12_0 = ctx_r0.units()[0]) == null ? null : tmp_12_0[field_r4.name])("required", field_r4.required || false);
|
|
169
|
+
} }
|
|
170
|
+
function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_9_Template(rf, ctx) { if (rf & 1) {
|
|
171
|
+
const _r10 = i0.ɵɵgetCurrentView();
|
|
172
|
+
i0.ɵɵelementStart(0, "input", 41);
|
|
173
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_17_For_4_Case_9_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r10); const field_r4 = i0.ɵɵnextContext().$implicit; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.updateUnitField(0, field_r4.name, $event)); });
|
|
174
|
+
i0.ɵɵelementEnd();
|
|
175
|
+
} if (rf & 2) {
|
|
176
|
+
let tmp_13_0;
|
|
177
|
+
const field_r4 = i0.ɵɵnextContext().$implicit;
|
|
178
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
179
|
+
i0.ɵɵproperty("type", field_r4.name.toLowerCase().includes("email") ? "email" : "text")("ngModel", (tmp_13_0 = ctx_r0.units()[0]) == null ? null : tmp_13_0[field_r4.name])("placeholder", field_r4.placeholder || "")("required", field_r4.required || false);
|
|
180
|
+
} }
|
|
181
|
+
function MJCheckoutWidgetComponent_Conditional_17_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
182
|
+
i0.ɵɵelementStart(0, "div", 26)(1, "label", 27);
|
|
183
|
+
i0.ɵɵtext(2);
|
|
184
|
+
i0.ɵɵconditionalCreate(3, MJCheckoutWidgetComponent_Conditional_17_For_4_Conditional_3_Template, 2, 0, "span", 28);
|
|
185
|
+
i0.ɵɵelementEnd();
|
|
186
|
+
i0.ɵɵconditionalCreate(4, MJCheckoutWidgetComponent_Conditional_17_For_4_Case_4_Template, 2, 3, "textarea", 29)(5, MJCheckoutWidgetComponent_Conditional_17_For_4_Case_5_Template, 5, 4, "select", 30)(6, MJCheckoutWidgetComponent_Conditional_17_For_4_Case_6_Template, 4, 2, "label", 31)(7, MJCheckoutWidgetComponent_Conditional_17_For_4_Case_7_Template, 1, 3, "input", 32)(8, MJCheckoutWidgetComponent_Conditional_17_For_4_Case_8_Template, 1, 2, "input", 33)(9, MJCheckoutWidgetComponent_Conditional_17_For_4_Case_9_Template, 1, 4, "input", 34);
|
|
187
|
+
i0.ɵɵelementEnd();
|
|
188
|
+
} if (rf & 2) {
|
|
189
|
+
let tmp_14_0;
|
|
190
|
+
const field_r4 = ctx.$implicit;
|
|
191
|
+
i0.ɵɵclassProp("full-width", field_r4.type === "textarea" || field_r4.name === "email" || field_r4.name === "Email");
|
|
192
|
+
i0.ɵɵadvance(2);
|
|
193
|
+
i0.ɵɵtextInterpolate1(" ", field_r4.label, " ");
|
|
194
|
+
i0.ɵɵadvance();
|
|
195
|
+
i0.ɵɵconditional(field_r4.required ? 3 : -1);
|
|
196
|
+
i0.ɵɵadvance();
|
|
197
|
+
i0.ɵɵconditional((tmp_14_0 = field_r4.type) === "textarea" ? 4 : tmp_14_0 === "select" ? 5 : tmp_14_0 === "boolean" ? 6 : tmp_14_0 === "number" ? 7 : tmp_14_0 === "date" ? 8 : 9);
|
|
198
|
+
} }
|
|
199
|
+
function MJCheckoutWidgetComponent_Conditional_17_Template(rf, ctx) { if (rf & 1) {
|
|
200
|
+
i0.ɵɵelementStart(0, "h3", 23);
|
|
201
|
+
i0.ɵɵtext(1, "Details");
|
|
202
|
+
i0.ɵɵelementEnd();
|
|
203
|
+
i0.ɵɵelementStart(2, "div", 24);
|
|
204
|
+
i0.ɵɵrepeaterCreate(3, MJCheckoutWidgetComponent_Conditional_17_For_4_Template, 10, 5, "div", 25, _forTrack0);
|
|
205
|
+
i0.ɵɵelementEnd();
|
|
206
|
+
} if (rf & 2) {
|
|
207
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
208
|
+
i0.ɵɵadvance(3);
|
|
209
|
+
i0.ɵɵrepeater(ctx_r0.activeFieldDefs());
|
|
210
|
+
} }
|
|
211
|
+
function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
212
|
+
i0.ɵɵelementStart(0, "span", 28);
|
|
213
|
+
i0.ɵɵtext(1, "*");
|
|
214
|
+
i0.ɵɵelementEnd();
|
|
215
|
+
} }
|
|
216
|
+
function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_4_Template(rf, ctx) { if (rf & 1) {
|
|
217
|
+
const _r12 = i0.ɵɵgetCurrentView();
|
|
218
|
+
i0.ɵɵelementStart(0, "textarea", 35);
|
|
219
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_4_Template_textarea_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r12 = i0.ɵɵnextContext(); const field_r14 = ctx_r12.$implicit; const $index_r15 = ctx_r12.$index; const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.updateUnitField($index_r15, field_r14.name, $event)); });
|
|
220
|
+
i0.ɵɵtext(1, " ");
|
|
221
|
+
i0.ɵɵelementEnd();
|
|
222
|
+
} if (rf & 2) {
|
|
223
|
+
const field_r14 = i0.ɵɵnextContext().$implicit;
|
|
224
|
+
const unit_r16 = i0.ɵɵnextContext().$implicit;
|
|
225
|
+
i0.ɵɵproperty("ngModel", unit_r16[field_r14.name])("placeholder", field_r14.placeholder || "")("required", field_r14.required || false);
|
|
226
|
+
} }
|
|
227
|
+
function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_5_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
228
|
+
i0.ɵɵelementStart(0, "option", 37);
|
|
229
|
+
i0.ɵɵtext(1);
|
|
230
|
+
i0.ɵɵelementEnd();
|
|
231
|
+
} if (rf & 2) {
|
|
232
|
+
const opt_r18 = ctx.$implicit;
|
|
233
|
+
i0.ɵɵproperty("ngValue", opt_r18.value);
|
|
234
|
+
i0.ɵɵadvance();
|
|
235
|
+
i0.ɵɵtextInterpolate(opt_r18.label);
|
|
236
|
+
} }
|
|
237
|
+
function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_5_Template(rf, ctx) { if (rf & 1) {
|
|
238
|
+
const _r17 = i0.ɵɵgetCurrentView();
|
|
239
|
+
i0.ɵɵelementStart(0, "select", 36);
|
|
240
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_5_Template_select_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r17); const ctx_r12 = i0.ɵɵnextContext(); const field_r14 = ctx_r12.$implicit; const $index_r15 = ctx_r12.$index; const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.updateUnitField($index_r15, field_r14.name, $event)); });
|
|
241
|
+
i0.ɵɵelementStart(1, "option", 37);
|
|
242
|
+
i0.ɵɵtext(2);
|
|
243
|
+
i0.ɵɵelementEnd();
|
|
244
|
+
i0.ɵɵrepeaterCreate(3, MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_5_For_4_Template, 2, 2, "option", 37, _forTrack1);
|
|
245
|
+
i0.ɵɵelementEnd();
|
|
246
|
+
} if (rf & 2) {
|
|
247
|
+
const field_r14 = i0.ɵɵnextContext().$implicit;
|
|
248
|
+
const unit_r16 = i0.ɵɵnextContext().$implicit;
|
|
249
|
+
i0.ɵɵproperty("ngModel", unit_r16[field_r14.name])("required", field_r14.required || false);
|
|
250
|
+
i0.ɵɵadvance();
|
|
251
|
+
i0.ɵɵproperty("ngValue", "");
|
|
252
|
+
i0.ɵɵadvance();
|
|
253
|
+
i0.ɵɵtextInterpolate1("Select ", field_r14.label);
|
|
254
|
+
i0.ɵɵadvance();
|
|
255
|
+
i0.ɵɵrepeater(field_r14.options);
|
|
256
|
+
} }
|
|
257
|
+
function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_6_Template(rf, ctx) { if (rf & 1) {
|
|
258
|
+
const _r19 = i0.ɵɵgetCurrentView();
|
|
259
|
+
i0.ɵɵelementStart(0, "label", 31)(1, "input", 38);
|
|
260
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_6_Template_input_ngModelChange_1_listener($event) { i0.ɵɵrestoreView(_r19); const ctx_r12 = i0.ɵɵnextContext(); const field_r14 = ctx_r12.$implicit; const $index_r15 = ctx_r12.$index; const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.updateUnitField($index_r15, field_r14.name, $event)); });
|
|
261
|
+
i0.ɵɵelementEnd();
|
|
262
|
+
i0.ɵɵelementStart(2, "span");
|
|
263
|
+
i0.ɵɵtext(3);
|
|
264
|
+
i0.ɵɵelementEnd()();
|
|
265
|
+
} if (rf & 2) {
|
|
266
|
+
const field_r14 = i0.ɵɵnextContext().$implicit;
|
|
267
|
+
const unit_r16 = i0.ɵɵnextContext().$implicit;
|
|
268
|
+
i0.ɵɵadvance();
|
|
269
|
+
i0.ɵɵproperty("ngModel", unit_r16[field_r14.name]);
|
|
270
|
+
i0.ɵɵadvance(2);
|
|
271
|
+
i0.ɵɵtextInterpolate(field_r14.label);
|
|
272
|
+
} }
|
|
273
|
+
function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_7_Template(rf, ctx) { if (rf & 1) {
|
|
274
|
+
const _r20 = i0.ɵɵgetCurrentView();
|
|
275
|
+
i0.ɵɵelementStart(0, "input", 39);
|
|
276
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_7_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r12 = i0.ɵɵnextContext(); const field_r14 = ctx_r12.$implicit; const $index_r15 = ctx_r12.$index; const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.updateUnitField($index_r15, field_r14.name, $event)); });
|
|
277
|
+
i0.ɵɵelementEnd();
|
|
278
|
+
} if (rf & 2) {
|
|
279
|
+
const field_r14 = i0.ɵɵnextContext().$implicit;
|
|
280
|
+
const unit_r16 = i0.ɵɵnextContext().$implicit;
|
|
281
|
+
i0.ɵɵproperty("ngModel", unit_r16[field_r14.name])("placeholder", field_r14.placeholder || "")("required", field_r14.required || false);
|
|
282
|
+
} }
|
|
283
|
+
function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_8_Template(rf, ctx) { if (rf & 1) {
|
|
284
|
+
const _r21 = i0.ɵɵgetCurrentView();
|
|
285
|
+
i0.ɵɵelementStart(0, "input", 40);
|
|
286
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_8_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r21); const ctx_r12 = i0.ɵɵnextContext(); const field_r14 = ctx_r12.$implicit; const $index_r15 = ctx_r12.$index; const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.updateUnitField($index_r15, field_r14.name, $event)); });
|
|
287
|
+
i0.ɵɵelementEnd();
|
|
288
|
+
} if (rf & 2) {
|
|
289
|
+
const field_r14 = i0.ɵɵnextContext().$implicit;
|
|
290
|
+
const unit_r16 = i0.ɵɵnextContext().$implicit;
|
|
291
|
+
i0.ɵɵproperty("ngModel", unit_r16[field_r14.name])("required", field_r14.required || false);
|
|
292
|
+
} }
|
|
293
|
+
function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_9_Template(rf, ctx) { if (rf & 1) {
|
|
294
|
+
const _r22 = i0.ɵɵgetCurrentView();
|
|
295
|
+
i0.ɵɵelementStart(0, "input", 41);
|
|
296
|
+
i0.ɵɵlistener("ngModelChange", function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_9_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r12 = i0.ɵɵnextContext(); const field_r14 = ctx_r12.$implicit; const $index_r15 = ctx_r12.$index; const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.updateUnitField($index_r15, field_r14.name, $event)); });
|
|
297
|
+
i0.ɵɵelementEnd();
|
|
298
|
+
} if (rf & 2) {
|
|
299
|
+
const field_r14 = i0.ɵɵnextContext().$implicit;
|
|
300
|
+
const unit_r16 = i0.ɵɵnextContext().$implicit;
|
|
301
|
+
i0.ɵɵproperty("type", field_r14.name.toLowerCase().includes("email") ? "email" : "text")("ngModel", unit_r16[field_r14.name])("placeholder", field_r14.placeholder || "")("required", field_r14.required || false);
|
|
302
|
+
} }
|
|
303
|
+
function MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Template(rf, ctx) { if (rf & 1) {
|
|
304
|
+
i0.ɵɵelementStart(0, "div", 26)(1, "label", 27);
|
|
305
|
+
i0.ɵɵtext(2);
|
|
306
|
+
i0.ɵɵconditionalCreate(3, MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Conditional_3_Template, 2, 0, "span", 28);
|
|
307
|
+
i0.ɵɵelementEnd();
|
|
308
|
+
i0.ɵɵconditionalCreate(4, MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_4_Template, 2, 3, "textarea", 29)(5, MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_5_Template, 5, 4, "select", 30)(6, MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_6_Template, 4, 2, "label", 31)(7, MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_7_Template, 1, 3, "input", 32)(8, MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_8_Template, 1, 2, "input", 33)(9, MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Case_9_Template, 1, 4, "input", 34);
|
|
309
|
+
i0.ɵɵelementEnd();
|
|
310
|
+
} if (rf & 2) {
|
|
311
|
+
let tmp_24_0;
|
|
312
|
+
const field_r14 = ctx.$implicit;
|
|
313
|
+
i0.ɵɵclassProp("full-width", field_r14.type === "textarea" || field_r14.name === "email" || field_r14.name === "Email");
|
|
314
|
+
i0.ɵɵadvance(2);
|
|
315
|
+
i0.ɵɵtextInterpolate1(" ", field_r14.label, " ");
|
|
316
|
+
i0.ɵɵadvance();
|
|
317
|
+
i0.ɵɵconditional(field_r14.required ? 3 : -1);
|
|
318
|
+
i0.ɵɵadvance();
|
|
319
|
+
i0.ɵɵconditional((tmp_24_0 = field_r14.type) === "textarea" ? 4 : tmp_24_0 === "select" ? 5 : tmp_24_0 === "boolean" ? 6 : tmp_24_0 === "number" ? 7 : tmp_24_0 === "date" ? 8 : 9);
|
|
320
|
+
} }
|
|
321
|
+
function MJCheckoutWidgetComponent_Conditional_18_For_7_Template(rf, ctx) { if (rf & 1) {
|
|
322
|
+
i0.ɵɵelementStart(0, "div", 45)(1, "div", 46);
|
|
323
|
+
i0.ɵɵtext(2);
|
|
324
|
+
i0.ɵɵelementEnd();
|
|
325
|
+
i0.ɵɵelementStart(3, "div", 24);
|
|
326
|
+
i0.ɵɵrepeaterCreate(4, MJCheckoutWidgetComponent_Conditional_18_For_7_For_5_Template, 10, 5, "div", 25, _forTrack0);
|
|
327
|
+
i0.ɵɵelementEnd()();
|
|
328
|
+
} if (rf & 2) {
|
|
329
|
+
const $index_r23 = ctx.$index;
|
|
330
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
331
|
+
i0.ɵɵadvance(2);
|
|
332
|
+
i0.ɵɵtextInterpolate1("Item ", $index_r23 + 1);
|
|
333
|
+
i0.ɵɵadvance(2);
|
|
334
|
+
i0.ɵɵrepeater(ctx_r0.activeFieldDefs());
|
|
335
|
+
} }
|
|
336
|
+
function MJCheckoutWidgetComponent_Conditional_18_Template(rf, ctx) { if (rf & 1) {
|
|
337
|
+
const _r11 = i0.ɵɵgetCurrentView();
|
|
338
|
+
i0.ɵɵelementStart(0, "div", 42)(1, "h3", 23);
|
|
339
|
+
i0.ɵɵtext(2);
|
|
340
|
+
i0.ɵɵelementEnd();
|
|
341
|
+
i0.ɵɵelementStart(3, "button", 43);
|
|
342
|
+
i0.ɵɵlistener("click", function MJCheckoutWidgetComponent_Conditional_18_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r11); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.copyPrimaryToAll()); });
|
|
343
|
+
i0.ɵɵtext(4, "Copy Primary Info to All");
|
|
344
|
+
i0.ɵɵelementEnd()();
|
|
345
|
+
i0.ɵɵelementStart(5, "div", 44);
|
|
346
|
+
i0.ɵɵrepeaterCreate(6, MJCheckoutWidgetComponent_Conditional_18_For_7_Template, 6, 1, "div", 45, i0.ɵɵrepeaterTrackByIndex);
|
|
347
|
+
i0.ɵɵelementEnd();
|
|
348
|
+
} if (rf & 2) {
|
|
349
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
350
|
+
i0.ɵɵadvance(2);
|
|
351
|
+
i0.ɵɵtextInterpolate1("Item Details (", ctx_r0.quantity(), ")");
|
|
352
|
+
i0.ɵɵadvance(4);
|
|
353
|
+
i0.ɵɵrepeater(ctx_r0.units());
|
|
354
|
+
} }
|
|
355
|
+
function MJCheckoutWidgetComponent_Conditional_19_Template(rf, ctx) { if (rf & 1) {
|
|
356
|
+
i0.ɵɵelementStart(0, "section", 47)(1, "h3", 23);
|
|
357
|
+
i0.ɵɵtext(2, "Payment");
|
|
358
|
+
i0.ɵɵelementEnd();
|
|
359
|
+
i0.ɵɵelementStart(3, "div", 48);
|
|
360
|
+
i0.ɵɵelement(4, "div", 49);
|
|
361
|
+
i0.ɵɵelementStart(5, "div", 50)(6, "span", 51);
|
|
362
|
+
i0.ɵɵtext(7, "\uD83D\uDD12");
|
|
363
|
+
i0.ɵɵelementEnd();
|
|
364
|
+
i0.ɵɵelementStart(8, "span");
|
|
365
|
+
i0.ɵɵtext(9, "Secured by Stripe \u2022 PCI-DSS Level 1 Certified \u2022 End-to-end Encrypted");
|
|
366
|
+
i0.ɵɵelementEnd()()()();
|
|
367
|
+
i0.ɵɵelementStart(10, "div", 52)(11, "span", 53);
|
|
368
|
+
i0.ɵɵtext(12, "Total Due");
|
|
369
|
+
i0.ɵɵelementEnd();
|
|
370
|
+
i0.ɵɵelementStart(13, "span", 54);
|
|
371
|
+
i0.ɵɵtext(14);
|
|
372
|
+
i0.ɵɵelementEnd()();
|
|
373
|
+
} if (rf & 2) {
|
|
374
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
375
|
+
i0.ɵɵadvance(14);
|
|
376
|
+
i0.ɵɵtextInterpolate2("", ctx_r0.currencySymbol(), "", ctx_r0.totalGross().toFixed(2));
|
|
377
|
+
} }
|
|
378
|
+
function MJCheckoutWidgetComponent_Conditional_22_Template(rf, ctx) { if (rf & 1) {
|
|
379
|
+
i0.ɵɵelement(0, "span", 55);
|
|
380
|
+
i0.ɵɵelementStart(1, "span");
|
|
381
|
+
i0.ɵɵtext(2, "Processing...");
|
|
382
|
+
i0.ɵɵelementEnd();
|
|
383
|
+
} }
|
|
384
|
+
function MJCheckoutWidgetComponent_Conditional_23_Template(rf, ctx) { if (rf & 1) {
|
|
385
|
+
i0.ɵɵelementStart(0, "span");
|
|
386
|
+
i0.ɵɵtext(1, "Complete Free Registration");
|
|
387
|
+
i0.ɵɵelementEnd();
|
|
388
|
+
} }
|
|
389
|
+
function MJCheckoutWidgetComponent_Conditional_24_Template(rf, ctx) { if (rf & 1) {
|
|
390
|
+
i0.ɵɵelementStart(0, "span");
|
|
391
|
+
i0.ɵɵtext(1);
|
|
392
|
+
i0.ɵɵelementEnd();
|
|
393
|
+
} if (rf & 2) {
|
|
394
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
395
|
+
i0.ɵɵadvance();
|
|
396
|
+
i0.ɵɵtextInterpolate2("Pay ", ctx_r0.currencySymbol(), "", ctx_r0.totalGross().toFixed(2));
|
|
397
|
+
} }
|
|
398
|
+
export class MJCheckoutWidgetComponent {
|
|
399
|
+
el;
|
|
400
|
+
renderer;
|
|
401
|
+
widgetInstanceId = 'mj-cw-' + (typeof crypto !== 'undefined' && crypto.randomUUID ? crypto.randomUUID().slice(0, 8) : Math.random().toString(36).slice(2, 9));
|
|
402
|
+
_fallbackSessionKey = typeof crypto !== 'undefined' && crypto.randomUUID ? crypto.randomUUID() : 'ck_sess_' + Math.random().toString(36).substring(2, 15);
|
|
403
|
+
_config = signal(null, ...(ngDevMode ? [{ debugName: "_config" }] : []));
|
|
404
|
+
_lastMountedJS = null;
|
|
405
|
+
_customStyleEl = null;
|
|
406
|
+
constructor(el, renderer) {
|
|
407
|
+
this.el = el;
|
|
408
|
+
this.renderer = renderer;
|
|
409
|
+
}
|
|
410
|
+
set config(val) {
|
|
411
|
+
this._config.set(val);
|
|
412
|
+
this.syncUnits();
|
|
413
|
+
}
|
|
414
|
+
get config() {
|
|
415
|
+
return this._config();
|
|
416
|
+
}
|
|
417
|
+
distributionSlug = '';
|
|
418
|
+
sessionKey = '';
|
|
419
|
+
isProcessing = false;
|
|
420
|
+
_errorMessage = signal(null, ...(ngDevMode ? [{ debugName: "_errorMessage" }] : []));
|
|
421
|
+
set errorMessage(val) {
|
|
422
|
+
this._errorMessage.set(val);
|
|
423
|
+
}
|
|
424
|
+
get errorMessage() {
|
|
425
|
+
return this._errorMessage();
|
|
426
|
+
}
|
|
427
|
+
isPaymentReady = false;
|
|
428
|
+
stripePaymentMethodId = null;
|
|
429
|
+
submitted = new EventEmitter();
|
|
430
|
+
cancelled = new EventEmitter();
|
|
431
|
+
// Internal error message for client-side validation failures
|
|
432
|
+
internalErrorMessage = signal(null, ...(ngDevMode ? [{ debugName: "internalErrorMessage" }] : []));
|
|
433
|
+
displayErrorMessage = computed(() => this._errorMessage() || this.internalErrorMessage(), ...(ngDevMode ? [{ debugName: "displayErrorMessage" }] : []));
|
|
434
|
+
// Form state signals
|
|
435
|
+
email = signal('', ...(ngDevMode ? [{ debugName: "email" }] : []));
|
|
436
|
+
firstName = signal('', ...(ngDevMode ? [{ debugName: "firstName" }] : []));
|
|
437
|
+
lastName = signal('', ...(ngDevMode ? [{ debugName: "lastName" }] : []));
|
|
438
|
+
company = signal('', ...(ngDevMode ? [{ debugName: "company" }] : []));
|
|
439
|
+
title = signal('', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
440
|
+
quantity = signal(1, ...(ngDevMode ? [{ debugName: "quantity" }] : []));
|
|
441
|
+
// Generic units array holding field maps for each unit
|
|
442
|
+
units = signal([], ...(ngDevMode ? [{ debugName: "units" }] : []));
|
|
443
|
+
// Backward-compatibility signal for legacy attendees
|
|
444
|
+
attendees = computed(() => {
|
|
445
|
+
return this.units().map(u => ({
|
|
446
|
+
firstName: String(u['firstName'] || u['FirstName'] || ''),
|
|
447
|
+
lastName: String(u['lastName'] || u['LastName'] || ''),
|
|
448
|
+
email: String(u['email'] || u['Email'] || ''),
|
|
449
|
+
company: u['company'] ? String(u['company']) : (u['Company'] ? String(u['Company']) : undefined),
|
|
450
|
+
title: u['title'] ? String(u['title']) : (u['Title'] ? String(u['Title']) : undefined),
|
|
451
|
+
...u
|
|
452
|
+
}));
|
|
453
|
+
}, ...(ngDevMode ? [{ debugName: "attendees" }] : []));
|
|
454
|
+
// Unified customUI computed values
|
|
455
|
+
activeCSS = computed(() => {
|
|
456
|
+
const cfg = this._config();
|
|
457
|
+
return cfg?.customUI?.css || cfg?.customCSS || '';
|
|
458
|
+
}, ...(ngDevMode ? [{ debugName: "activeCSS" }] : []));
|
|
459
|
+
activeJS = computed(() => {
|
|
460
|
+
const cfg = this._config();
|
|
461
|
+
return cfg?.customUI?.js || cfg?.customJS || '';
|
|
462
|
+
}, ...(ngDevMode ? [{ debugName: "activeJS" }] : []));
|
|
463
|
+
activeTheme = computed(() => {
|
|
464
|
+
const cfg = this._config();
|
|
465
|
+
return cfg?.customUI?.theme || cfg?.theme || null;
|
|
466
|
+
}, ...(ngDevMode ? [{ debugName: "activeTheme" }] : []));
|
|
467
|
+
activeComponentOverrideKey = computed(() => {
|
|
468
|
+
const cfg = this._config();
|
|
469
|
+
return cfg?.customUI?.componentOverrideKey || null;
|
|
470
|
+
}, ...(ngDevMode ? [{ debugName: "activeComponentOverrideKey" }] : []));
|
|
471
|
+
// Active field definitions
|
|
472
|
+
activeFieldDefs = computed(() => {
|
|
473
|
+
const customFields = this._config()?.extensionFields;
|
|
474
|
+
if (customFields && Array.isArray(customFields) && customFields.length > 0) {
|
|
475
|
+
return customFields;
|
|
476
|
+
}
|
|
477
|
+
// Default standard attendee fields
|
|
478
|
+
return [
|
|
479
|
+
{ name: 'firstName', label: 'First Name', type: 'text', required: true, placeholder: 'Jane' },
|
|
480
|
+
{ name: 'lastName', label: 'Last Name', type: 'text', required: true, placeholder: 'Doe' },
|
|
481
|
+
{ name: 'email', label: 'Email Address', type: 'text', required: true, placeholder: 'jane.doe@example.com' },
|
|
482
|
+
{ name: 'company', label: 'Company / Organization', type: 'text', required: false, placeholder: 'Acme Corp' },
|
|
483
|
+
{ name: 'title', label: 'Job Title', type: 'text', required: false, placeholder: 'Director' }
|
|
484
|
+
];
|
|
485
|
+
}, ...(ngDevMode ? [{ debugName: "activeFieldDefs" }] : []));
|
|
486
|
+
// Computed properties
|
|
487
|
+
isFree = computed(() => (this._config()?.unitPrice ?? 0) <= 0, ...(ngDevMode ? [{ debugName: "isFree" }] : []));
|
|
488
|
+
isPerUnit = computed(() => {
|
|
489
|
+
const cfg = this._config();
|
|
490
|
+
return cfg?.unitMode === 'perUnit' || Boolean(cfg?.isEvent);
|
|
491
|
+
}, ...(ngDevMode ? [{ debugName: "isPerUnit" }] : []));
|
|
492
|
+
isSingleUnit = computed(() => !this.isPerUnit() || this.quantity() === 1, ...(ngDevMode ? [{ debugName: "isSingleUnit" }] : []));
|
|
493
|
+
isMultiUnit = computed(() => this.isPerUnit() && this.quantity() > 1, ...(ngDevMode ? [{ debugName: "isMultiUnit" }] : []));
|
|
494
|
+
subtotal = computed(() => {
|
|
495
|
+
const price = this._config()?.unitPrice ?? 0;
|
|
496
|
+
return price * this.quantity();
|
|
497
|
+
}, ...(ngDevMode ? [{ debugName: "subtotal" }] : []));
|
|
498
|
+
totalGross = computed(() => this.subtotal(), ...(ngDevMode ? [{ debugName: "totalGross" }] : []));
|
|
499
|
+
currencySymbol = computed(() => {
|
|
500
|
+
const c = this._config()?.currency?.toUpperCase() ?? 'USD';
|
|
501
|
+
switch (c) {
|
|
502
|
+
case 'EUR': return '€';
|
|
503
|
+
case 'GBP': return '£';
|
|
504
|
+
default: return '$';
|
|
505
|
+
}
|
|
506
|
+
}, ...(ngDevMode ? [{ debugName: "currencySymbol" }] : []));
|
|
507
|
+
ngOnInit() {
|
|
508
|
+
this.syncUnits();
|
|
509
|
+
this.applyCustomCSS(this.activeCSS());
|
|
510
|
+
if (this.activeJS() && this.activeJS() !== this._lastMountedJS) {
|
|
511
|
+
this.mountCustomJS(this.activeJS());
|
|
512
|
+
}
|
|
513
|
+
this.executeLifecycleHook('onInit', {
|
|
514
|
+
config: this.config,
|
|
515
|
+
distributionSlug: this.distributionSlug
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
ngOnChanges(changes) {
|
|
519
|
+
if (changes['config']) {
|
|
520
|
+
this.syncUnits();
|
|
521
|
+
this.applyCustomCSS(this.activeCSS());
|
|
522
|
+
if (this.activeJS() && this.activeJS() !== this._lastMountedJS) {
|
|
523
|
+
this.mountCustomJS(this.activeJS());
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
ngOnDestroy() {
|
|
528
|
+
this.executeLifecycleHook('onDestroy', { component: this });
|
|
529
|
+
if (this._customStyleEl && this._customStyleEl.parentNode) {
|
|
530
|
+
this._customStyleEl.parentNode.removeChild(this._customStyleEl);
|
|
531
|
+
this._customStyleEl = null;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
applyCustomCSS(cssContent) {
|
|
535
|
+
if (typeof document === 'undefined')
|
|
536
|
+
return;
|
|
537
|
+
if (!cssContent) {
|
|
538
|
+
if (this._customStyleEl && this._customStyleEl.parentNode) {
|
|
539
|
+
this._customStyleEl.parentNode.removeChild(this._customStyleEl);
|
|
540
|
+
this._customStyleEl = null;
|
|
541
|
+
}
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
const styleId = `mj-checkout-custom-css-${this.widgetInstanceId}`;
|
|
545
|
+
const nonce = this.readCspNonce();
|
|
546
|
+
if (!this._customStyleEl) {
|
|
547
|
+
if (this.renderer && this.el) {
|
|
548
|
+
this._customStyleEl = this.renderer.createElement('style');
|
|
549
|
+
this.renderer.setAttribute(this._customStyleEl, 'type', 'text/css');
|
|
550
|
+
this.renderer.setAttribute(this._customStyleEl, 'id', styleId);
|
|
551
|
+
if (nonce) {
|
|
552
|
+
this.renderer.setAttribute(this._customStyleEl, 'nonce', nonce);
|
|
553
|
+
}
|
|
554
|
+
this.renderer.appendChild(this.el.nativeElement, this._customStyleEl);
|
|
555
|
+
}
|
|
556
|
+
else {
|
|
557
|
+
this._customStyleEl = document.createElement('style');
|
|
558
|
+
this._customStyleEl.type = 'text/css';
|
|
559
|
+
this._customStyleEl.id = styleId;
|
|
560
|
+
if (nonce) {
|
|
561
|
+
this._customStyleEl.setAttribute('nonce', nonce);
|
|
562
|
+
}
|
|
563
|
+
document.head.appendChild(this._customStyleEl);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
if (this._customStyleEl) {
|
|
567
|
+
this._customStyleEl.textContent = cssContent;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
readCspNonce() {
|
|
571
|
+
if (typeof document === 'undefined') {
|
|
572
|
+
return '';
|
|
573
|
+
}
|
|
574
|
+
const host = this.el?.nativeElement?.closest?.('mj-orders-checkout');
|
|
575
|
+
const fromHost = host?.getAttribute('csp-nonce');
|
|
576
|
+
if (fromHost) {
|
|
577
|
+
return fromHost;
|
|
578
|
+
}
|
|
579
|
+
const tagged = document.querySelector('script[nonce], style[nonce]');
|
|
580
|
+
return tagged?.nonce || tagged?.getAttribute('nonce') || '';
|
|
581
|
+
}
|
|
582
|
+
mountCustomJS(scriptContent) {
|
|
583
|
+
if (!scriptContent || typeof window === 'undefined')
|
|
584
|
+
return;
|
|
585
|
+
this._lastMountedJS = scriptContent;
|
|
586
|
+
try {
|
|
587
|
+
const runner = new Function('widgetContext', scriptContent);
|
|
588
|
+
runner({ component: this, config: this.config });
|
|
589
|
+
}
|
|
590
|
+
catch (err) {
|
|
591
|
+
console.warn('[MJCheckoutWidget] CustomJS evaluation notice:', err);
|
|
592
|
+
this.internalErrorMessage.set('Notice: Custom widget scripts could not be evaluated under current security policy.');
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
executeLifecycleHook(hookName, payload) {
|
|
596
|
+
if (typeof window === 'undefined')
|
|
597
|
+
return undefined;
|
|
598
|
+
try {
|
|
599
|
+
if (window.MJCheckoutHooks && typeof window.MJCheckoutHooks[hookName] === 'function') {
|
|
600
|
+
return window.MJCheckoutHooks[hookName](payload, { component: this, config: this.config });
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
catch (err) {
|
|
604
|
+
console.warn(`[MJCheckoutWidget] Hook error in ${hookName}:`, err);
|
|
605
|
+
if (hookName === 'onValidate') {
|
|
606
|
+
// Fail closed on validation errors
|
|
607
|
+
return 'Validation hook encountered an internal error.';
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
return undefined;
|
|
611
|
+
}
|
|
612
|
+
onQuantityChange(newQty) {
|
|
613
|
+
const clamped = Math.max(1, Math.min(newQty, this.config?.maxQuantity ?? 50));
|
|
614
|
+
this.quantity.set(clamped);
|
|
615
|
+
this.syncUnits();
|
|
616
|
+
this.executeLifecycleHook('onQuantityChange', { quantity: clamped });
|
|
617
|
+
}
|
|
618
|
+
syncUnits() {
|
|
619
|
+
const currentQty = this.quantity();
|
|
620
|
+
const currentUnits = this.units();
|
|
621
|
+
const updated = [];
|
|
622
|
+
const fields = this.activeFieldDefs();
|
|
623
|
+
for (let i = 0; i < currentQty; i++) {
|
|
624
|
+
if (i === 0) {
|
|
625
|
+
const primary = currentUnits[0] || {};
|
|
626
|
+
const unit0 = { ...primary };
|
|
627
|
+
for (const field of fields) {
|
|
628
|
+
if (unit0[field.name] === undefined) {
|
|
629
|
+
unit0[field.name] = field.defaultValue ?? '';
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
if (this.firstName())
|
|
633
|
+
unit0['firstName'] = this.firstName();
|
|
634
|
+
if (this.lastName())
|
|
635
|
+
unit0['lastName'] = this.lastName();
|
|
636
|
+
if (this.email())
|
|
637
|
+
unit0['email'] = this.email();
|
|
638
|
+
if (this.company())
|
|
639
|
+
unit0['company'] = this.company();
|
|
640
|
+
if (this.title())
|
|
641
|
+
unit0['title'] = this.title();
|
|
642
|
+
updated.push(unit0);
|
|
643
|
+
}
|
|
644
|
+
else if (currentUnits[i]) {
|
|
645
|
+
updated.push({ ...currentUnits[i] });
|
|
646
|
+
}
|
|
647
|
+
else {
|
|
648
|
+
const initial = {};
|
|
649
|
+
for (const field of fields) {
|
|
650
|
+
initial[field.name] = field.defaultValue ?? '';
|
|
651
|
+
}
|
|
652
|
+
if (this.company()) {
|
|
653
|
+
initial['company'] = this.company();
|
|
654
|
+
}
|
|
655
|
+
updated.push(initial);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
this.units.set(updated);
|
|
659
|
+
}
|
|
660
|
+
updateUnitField(index, fieldName, value) {
|
|
661
|
+
const list = [...this.units()];
|
|
662
|
+
if (list[index]) {
|
|
663
|
+
list[index] = { ...list[index], [fieldName]: value };
|
|
664
|
+
if (index === 0) {
|
|
665
|
+
if (fieldName === 'firstName')
|
|
666
|
+
this.firstName.set(String(value ?? ''));
|
|
667
|
+
if (fieldName === 'lastName')
|
|
668
|
+
this.lastName.set(String(value ?? ''));
|
|
669
|
+
if (fieldName === 'email')
|
|
670
|
+
this.email.set(String(value ?? ''));
|
|
671
|
+
if (fieldName === 'company')
|
|
672
|
+
this.company.set(String(value ?? ''));
|
|
673
|
+
if (fieldName === 'title')
|
|
674
|
+
this.title.set(String(value ?? ''));
|
|
675
|
+
}
|
|
676
|
+
this.units.set(list);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
updateAttendee(index, field, value) {
|
|
680
|
+
this.updateUnitField(index, field, value);
|
|
681
|
+
}
|
|
682
|
+
copyPrimaryToAll() {
|
|
683
|
+
const primary = this.units()[0];
|
|
684
|
+
if (!primary)
|
|
685
|
+
return;
|
|
686
|
+
const list = this.units().map((unit, i) => {
|
|
687
|
+
if (i === 0)
|
|
688
|
+
return unit;
|
|
689
|
+
const copied = { ...unit };
|
|
690
|
+
for (const [key, val] of Object.entries(primary)) {
|
|
691
|
+
if (key !== 'firstName' && key !== 'lastName' && key !== 'email' && key !== 'FirstName' && key !== 'LastName' && key !== 'Email') {
|
|
692
|
+
copied[key] = val;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
return copied;
|
|
696
|
+
});
|
|
697
|
+
this.units.set(list);
|
|
698
|
+
}
|
|
699
|
+
isFormValid() {
|
|
700
|
+
const currentUnits = this.units();
|
|
701
|
+
const fields = this.activeFieldDefs();
|
|
702
|
+
if (!currentUnits || currentUnits.length === 0) {
|
|
703
|
+
const em = this.email().trim();
|
|
704
|
+
const fn = this.firstName().trim();
|
|
705
|
+
const ln = this.lastName().trim();
|
|
706
|
+
if (!em || !em.includes('@') || !fn || !ln)
|
|
707
|
+
return false;
|
|
708
|
+
if (!this.isFree() && !this.isPaymentReady)
|
|
709
|
+
return false;
|
|
710
|
+
return true;
|
|
711
|
+
}
|
|
712
|
+
const unitsToValidate = this.isPerUnit() ? currentUnits : currentUnits.slice(0, 1);
|
|
713
|
+
for (let i = 0; i < unitsToValidate.length; i++) {
|
|
714
|
+
const unit = unitsToValidate[i];
|
|
715
|
+
for (const field of fields) {
|
|
716
|
+
let val = unit[field.name];
|
|
717
|
+
if (i === 0) {
|
|
718
|
+
if (field.name === 'firstName' && this.firstName())
|
|
719
|
+
val = this.firstName();
|
|
720
|
+
if (field.name === 'lastName' && this.lastName())
|
|
721
|
+
val = this.lastName();
|
|
722
|
+
if (field.name === 'email' && this.email())
|
|
723
|
+
val = this.email();
|
|
724
|
+
if (field.name === 'company' && this.company())
|
|
725
|
+
val = this.company();
|
|
726
|
+
if (field.name === 'title' && this.title())
|
|
727
|
+
val = this.title();
|
|
728
|
+
}
|
|
729
|
+
if (field.required) {
|
|
730
|
+
if (val === undefined || val === null || String(val).trim() === '') {
|
|
731
|
+
return false;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
if (field.name.toLowerCase().includes('email')) {
|
|
735
|
+
const emVal = String(val || '').trim();
|
|
736
|
+
if (field.required && (!emVal || !emVal.includes('@'))) {
|
|
737
|
+
return false;
|
|
738
|
+
}
|
|
739
|
+
if (emVal && !emVal.includes('@')) {
|
|
740
|
+
return false;
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
if (!this.isFree() && !this.isPaymentReady) {
|
|
746
|
+
return false;
|
|
747
|
+
}
|
|
748
|
+
return true;
|
|
749
|
+
}
|
|
750
|
+
handleSubmit() {
|
|
751
|
+
if (!this.isFormValid() || this.isProcessing)
|
|
752
|
+
return;
|
|
753
|
+
this.internalErrorMessage.set(null);
|
|
754
|
+
const currentUnits = this.units();
|
|
755
|
+
const isPerUnit = this.isPerUnit();
|
|
756
|
+
const finalSessionKey = this.sessionKey || this._fallbackSessionKey;
|
|
757
|
+
const submission = {
|
|
758
|
+
email: String(currentUnits[0]?.['email'] || this.email()).trim().toLowerCase(),
|
|
759
|
+
quantity: this.quantity(),
|
|
760
|
+
attendees: isPerUnit ? this.attendees() : [],
|
|
761
|
+
extensionData: {
|
|
762
|
+
entityName: this.config?.extensionEntityName,
|
|
763
|
+
fields: currentUnits[0] || {},
|
|
764
|
+
units: isPerUnit ? currentUnits : undefined
|
|
765
|
+
},
|
|
766
|
+
totalGross: this.totalGross(),
|
|
767
|
+
stripePaymentMethodId: this.isFree() ? undefined : (this.stripePaymentMethodId ?? undefined),
|
|
768
|
+
sessionKey: finalSessionKey
|
|
769
|
+
};
|
|
770
|
+
// Execute custom validation hook if present (fails closed)
|
|
771
|
+
try {
|
|
772
|
+
const customValidationResult = this.executeLifecycleHook('onValidate', submission);
|
|
773
|
+
if (customValidationResult === false || typeof customValidationResult === 'string') {
|
|
774
|
+
this.internalErrorMessage.set(typeof customValidationResult === 'string' ? customValidationResult : 'Submission validation rejected.');
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
catch (hookErr) {
|
|
779
|
+
this.internalErrorMessage.set('Validation failed: ' + (hookErr instanceof Error ? hookErr.message : String(hookErr)));
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
// Execute pre-submit enrichment hook
|
|
783
|
+
this.executeLifecycleHook('onBeforeSubmit', submission);
|
|
784
|
+
this.submitted.emit(submission);
|
|
785
|
+
}
|
|
786
|
+
static ɵfac = function MJCheckoutWidgetComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MJCheckoutWidgetComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2)); };
|
|
787
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MJCheckoutWidgetComponent, selectors: [["mj-checkout-widget"]], inputs: { config: "config", distributionSlug: "distributionSlug", sessionKey: "sessionKey", isProcessing: "isProcessing", errorMessage: "errorMessage", isPaymentReady: "isPaymentReady", stripePaymentMethodId: "stripePaymentMethodId" }, outputs: { submitted: "submitted", cancelled: "cancelled" }, features: [i0.ɵɵNgOnChangesFeature], decls: 27, vars: 24, consts: [[1, "mj-checkout-widget-container"], [1, "mj-widget-header"], [1, "mj-widget-title"], [1, "mj-widget-description"], ["role", "alert", 1, "mj-widget-error-banner"], [1, "mj-widget-summary-card"], [1, "mj-summary-row"], [1, "mj-summary-item-info"], [1, "mj-product-name"], [1, "mj-badge-free"], [1, "mj-summary-price"], [1, "mj-price-free"], [1, "mj-price-amount"], [1, "mj-quantity-selector-row"], [1, "mj-widget-form-section"], [1, "mj-widget-actions"], ["type", "button", 1, "mj-btn-submit", 3, "click", "disabled"], ["type", "button", 1, "mj-btn-cancel", 3, "click", "disabled"], [1, "mj-error-icon"], ["for", "quantityInput", 1, "mj-label"], [1, "mj-qty-controls"], ["type", "button", 1, "mj-qty-btn", 3, "click", "disabled"], ["id", "quantityInput", "type", "number", "min", "1", 1, "mj-qty-input", 3, "ngModelChange", "ngModel", "max"], [1, "mj-section-title"], [1, "mj-form-grid"], [1, "mj-form-group", 3, "full-width"], [1, "mj-form-group"], [1, "mj-label"], [1, "mj-required"], [1, "mj-input", "mj-textarea", 3, "ngModel", "placeholder", "required"], [1, "mj-select", 3, "ngModel", "required"], [1, "mj-checkbox-label"], ["type", "number", 1, "mj-input", 3, "ngModel", "placeholder", "required"], ["type", "date", 1, "mj-input", 3, "ngModel", "required"], [1, "mj-input", 3, "type", "ngModel", "placeholder", "required"], [1, "mj-input", "mj-textarea", 3, "ngModelChange", "ngModel", "placeholder", "required"], [1, "mj-select", 3, "ngModelChange", "ngModel", "required"], [3, "ngValue"], ["type", "checkbox", 3, "ngModelChange", "ngModel"], ["type", "number", 1, "mj-input", 3, "ngModelChange", "ngModel", "placeholder", "required"], ["type", "date", 1, "mj-input", 3, "ngModelChange", "ngModel", "required"], [1, "mj-input", 3, "ngModelChange", "type", "ngModel", "placeholder", "required"], [1, "mj-multi-attendee-header"], ["type", "button", 1, "mj-btn-link", 3, "click"], [1, "mj-attendee-matrix"], [1, "mj-attendee-card"], [1, "mj-attendee-card-title"], [1, "mj-widget-payment-section"], [1, "mj-stripe-container"], ["id", "stripe-card-element", 1, "mj-stripe-mount-point"], [1, "mj-stripe-badge"], [1, "mj-stripe-lock-icon"], [1, "mj-checkout-total-row"], [1, "mj-total-label"], [1, "mj-total-amount"], [1, "mj-spinner"]], template: function MJCheckoutWidgetComponent_Template(rf, ctx) { if (rf & 1) {
|
|
788
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "header", 1)(2, "h2", 2);
|
|
789
|
+
i0.ɵɵtext(3);
|
|
790
|
+
i0.ɵɵelementEnd();
|
|
791
|
+
i0.ɵɵconditionalCreate(4, MJCheckoutWidgetComponent_Conditional_4_Template, 2, 1, "p", 3);
|
|
792
|
+
i0.ɵɵelementEnd();
|
|
793
|
+
i0.ɵɵconditionalCreate(5, MJCheckoutWidgetComponent_Conditional_5_Template, 5, 1, "div", 4);
|
|
794
|
+
i0.ɵɵelementStart(6, "div", 5)(7, "div", 6)(8, "div", 7)(9, "span", 8);
|
|
795
|
+
i0.ɵɵtext(10);
|
|
796
|
+
i0.ɵɵelementEnd();
|
|
797
|
+
i0.ɵɵconditionalCreate(11, MJCheckoutWidgetComponent_Conditional_11_Template, 2, 0, "span", 9);
|
|
798
|
+
i0.ɵɵelementEnd();
|
|
799
|
+
i0.ɵɵelementStart(12, "div", 10);
|
|
800
|
+
i0.ɵɵconditionalCreate(13, MJCheckoutWidgetComponent_Conditional_13_Template, 2, 0, "span", 11)(14, MJCheckoutWidgetComponent_Conditional_14_Template, 2, 2, "span", 12);
|
|
801
|
+
i0.ɵɵelementEnd()();
|
|
802
|
+
i0.ɵɵconditionalCreate(15, MJCheckoutWidgetComponent_Conditional_15_Template, 9, 4, "div", 13);
|
|
803
|
+
i0.ɵɵelementEnd();
|
|
804
|
+
i0.ɵɵelementStart(16, "section", 14);
|
|
805
|
+
i0.ɵɵconditionalCreate(17, MJCheckoutWidgetComponent_Conditional_17_Template, 5, 0)(18, MJCheckoutWidgetComponent_Conditional_18_Template, 8, 1);
|
|
806
|
+
i0.ɵɵelementEnd();
|
|
807
|
+
i0.ɵɵconditionalCreate(19, MJCheckoutWidgetComponent_Conditional_19_Template, 15, 2);
|
|
808
|
+
i0.ɵɵelementStart(20, "div", 15)(21, "button", 16);
|
|
809
|
+
i0.ɵɵlistener("click", function MJCheckoutWidgetComponent_Template_button_click_21_listener() { return ctx.handleSubmit(); });
|
|
810
|
+
i0.ɵɵconditionalCreate(22, MJCheckoutWidgetComponent_Conditional_22_Template, 3, 0)(23, MJCheckoutWidgetComponent_Conditional_23_Template, 2, 0, "span")(24, MJCheckoutWidgetComponent_Conditional_24_Template, 2, 2, "span");
|
|
811
|
+
i0.ɵɵelementEnd();
|
|
812
|
+
i0.ɵɵelementStart(25, "button", 17);
|
|
813
|
+
i0.ɵɵlistener("click", function MJCheckoutWidgetComponent_Template_button_click_25_listener() { return ctx.cancelled.emit(); });
|
|
814
|
+
i0.ɵɵtext(26, " Cancel ");
|
|
815
|
+
i0.ɵɵelementEnd()()();
|
|
816
|
+
} if (rf & 2) {
|
|
817
|
+
let tmp_0_0;
|
|
818
|
+
let tmp_1_0;
|
|
819
|
+
let tmp_2_0;
|
|
820
|
+
let tmp_3_0;
|
|
821
|
+
let tmp_4_0;
|
|
822
|
+
let tmp_5_0;
|
|
823
|
+
i0.ɵɵstyleProp("--mj-primary-color", ((tmp_0_0 = ctx.activeTheme()) == null ? null : tmp_0_0.primaryColor) || "#2563eb")("--mj-accent-color", ((tmp_1_0 = ctx.activeTheme()) == null ? null : tmp_1_0.accentColor) || "#3b82f6")("--mj-border-radius", ((tmp_2_0 = ctx.activeTheme()) == null ? null : tmp_2_0.borderRadius) || "8px")("--mj-bg-color", ((tmp_3_0 = ctx.activeTheme()) == null ? null : tmp_3_0.backgroundColor) || "#ffffff")("--mj-text-color", ((tmp_4_0 = ctx.activeTheme()) == null ? null : tmp_4_0.textColor) || "#0f172a")("--mj-font-family", ((tmp_5_0 = ctx.activeTheme()) == null ? null : tmp_5_0.fontFamily) || "inherit");
|
|
824
|
+
i0.ɵɵadvance(3);
|
|
825
|
+
i0.ɵɵtextInterpolate((ctx.config == null ? null : ctx.config.title) || "Checkout");
|
|
826
|
+
i0.ɵɵadvance();
|
|
827
|
+
i0.ɵɵconditional((ctx.config == null ? null : ctx.config.description) ? 4 : -1);
|
|
828
|
+
i0.ɵɵadvance();
|
|
829
|
+
i0.ɵɵconditional(ctx.displayErrorMessage() ? 5 : -1);
|
|
830
|
+
i0.ɵɵadvance(5);
|
|
831
|
+
i0.ɵɵtextInterpolate((ctx.config == null ? null : ctx.config.productName) || "Order Item");
|
|
832
|
+
i0.ɵɵadvance();
|
|
833
|
+
i0.ɵɵconditional(ctx.isFree() ? 11 : -1);
|
|
834
|
+
i0.ɵɵadvance(2);
|
|
835
|
+
i0.ɵɵconditional(ctx.isFree() ? 13 : 14);
|
|
836
|
+
i0.ɵɵadvance(2);
|
|
837
|
+
i0.ɵɵconditional((ctx.config == null ? null : ctx.config.allowQuantity) ? 15 : -1);
|
|
838
|
+
i0.ɵɵadvance(2);
|
|
839
|
+
i0.ɵɵconditional(ctx.isSingleUnit() ? 17 : 18);
|
|
840
|
+
i0.ɵɵadvance(2);
|
|
841
|
+
i0.ɵɵconditional(!ctx.isFree() ? 19 : -1);
|
|
842
|
+
i0.ɵɵadvance(2);
|
|
843
|
+
i0.ɵɵproperty("disabled", !ctx.isFormValid() || ctx.isProcessing);
|
|
844
|
+
i0.ɵɵadvance();
|
|
845
|
+
i0.ɵɵconditional(ctx.isProcessing ? 22 : ctx.isFree() ? 23 : 24);
|
|
846
|
+
i0.ɵɵadvance(3);
|
|
847
|
+
i0.ɵɵproperty("disabled", ctx.isProcessing);
|
|
848
|
+
} }, dependencies: [CommonModule, FormsModule, i1.NgSelectOption, i1.ɵNgSelectMultipleOption, i1.DefaultValueAccessor, i1.NumberValueAccessor, i1.CheckboxControlValueAccessor, i1.SelectControlValueAccessor, i1.NgControlStatus, i1.RequiredValidator, i1.MinValidator, i1.MaxValidator, i1.NgModel], styles: ["[_nghost-%COMP%] {\n display: block;\n font-family: var(--mj-font-family, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);\n color: var(--mj-text-color, #1e293b);\n}\n\n.mj-checkout-widget-container[_ngcontent-%COMP%] {\n max-width: 560px;\n margin: 0 auto;\n background: var(--mj-bg-color, #ffffff);\n border: 1px solid #e2e8f0;\n border-radius: var(--mj-border-radius, 8px);\n padding: 24px;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);\n}\n\n.mj-widget-header[_ngcontent-%COMP%] {\n margin-bottom: 20px;\n}\n\n.mj-widget-title[_ngcontent-%COMP%] {\n margin: 0 0 6px 0;\n font-size: 1.35rem;\n font-weight: 700;\n color: var(--mj-text-color, #0f172a);\n}\n\n.mj-widget-description[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 0.9rem;\n color: #64748b;\n line-height: 1.4;\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 margin-bottom: 18px;\n font-size: 0.875rem;\n}\n\n.mj-error-icon[_ngcontent-%COMP%] {\n font-size: 1rem;\n}\n\n.mj-widget-summary-card[_ngcontent-%COMP%] {\n background: #f8fafc;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 14px 16px;\n margin-bottom: 20px;\n}\n\n.mj-summary-row[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.mj-summary-price[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n}\n\n.mj-widget-form-section[_ngcontent-%COMP%] {\n margin-bottom: 20px;\n}\n\n.mj-summary-item-info[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.mj-product-name[_ngcontent-%COMP%] {\n font-weight: 600;\n font-size: 1rem;\n color: #1e293b;\n}\n\n.mj-badge-free[_ngcontent-%COMP%] {\n background: #dcfce7;\n color: #166534;\n font-size: 0.75rem;\n font-weight: 700;\n padding: 2px 6px;\n border-radius: 4px;\n}\n\n.mj-price-free[_ngcontent-%COMP%] {\n font-weight: 700;\n color: #166534;\n font-size: 1.1rem;\n}\n\n.mj-price-amount[_ngcontent-%COMP%] {\n font-weight: 700;\n color: #0f172a;\n font-size: 1.1rem;\n}\n\n.mj-quantity-selector-row[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 12px;\n padding-top: 12px;\n border-top: 1px dashed #cbd5e1;\n}\n\n.mj-qty-controls[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n.mj-qty-btn[_ngcontent-%COMP%] {\n width: 28px;\n height: 28px;\n background: #ffffff;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n cursor: pointer;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.mj-qty-btn[_ngcontent-%COMP%]:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.mj-qty-input[_ngcontent-%COMP%] {\n width: 44px;\n height: 28px;\n text-align: center;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n font-weight: 600;\n}\n\n.mj-section-title[_ngcontent-%COMP%] {\n font-size: 1rem;\n font-weight: 600;\n margin: 0 0 12px 0;\n color: #334155;\n}\n\n.mj-form-grid[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 12px;\n margin-bottom: 18px;\n}\n\n.mj-form-group[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.mj-form-group.full-width[_ngcontent-%COMP%] {\n grid-column: 1 / -1;\n}\n\n.mj-label[_ngcontent-%COMP%] {\n font-size: 0.8rem;\n font-weight: 500;\n color: #475569;\n}\n\n.mj-required[_ngcontent-%COMP%] {\n color: #ef4444;\n}\n\n.mj-input[_ngcontent-%COMP%], .mj-select[_ngcontent-%COMP%] {\n padding: 8px 12px;\n font-size: 0.9rem;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n background: #ffffff;\n color: #1e293b;\n outline: none;\n transition: border-color 0.15s ease;\n width: 100%;\n box-sizing: border-box;\n}\n\n.mj-textarea[_ngcontent-%COMP%] {\n min-height: 70px;\n resize: vertical;\n font-family: inherit;\n}\n\n.mj-select[_ngcontent-%COMP%] {\n min-height: 38px;\n}\n\n.mj-checkbox-label[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n font-size: 0.9rem;\n color: #334155;\n margin-top: 4px;\n}\n\n.mj-input[_ngcontent-%COMP%]:focus, .mj-select[_ngcontent-%COMP%]:focus {\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-multi-attendee-header[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 12px;\n}\n\n.mj-btn-link[_ngcontent-%COMP%] {\n background: none;\n border: none;\n color: var(--mj-primary-color, #2563eb);\n font-size: 0.8rem;\n cursor: pointer;\n text-decoration: underline;\n padding: 0;\n}\n\n.mj-attendee-matrix[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 14px;\n margin-bottom: 20px;\n}\n\n.mj-attendee-card[_ngcontent-%COMP%] {\n background: #f8fafc;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 12px 14px;\n}\n\n.mj-attendee-card-title[_ngcontent-%COMP%] {\n font-size: 0.85rem;\n font-weight: 600;\n color: #475569;\n margin-bottom: 10px;\n}\n\n\n\n.mj-widget-payment-section[_ngcontent-%COMP%] {\n margin-top: 16px;\n padding-top: 16px;\n border-top: 1px solid #e2e8f0;\n}\n\n.mj-stripe-container[_ngcontent-%COMP%] {\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 14px;\n margin-bottom: 16px;\n}\n\n.mj-stripe-mount-point[_ngcontent-%COMP%] {\n min-height: 40px;\n}\n\n.mj-stripe-badge[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-top: 10px;\n font-size: 0.75rem;\n color: #64748b;\n}\n\n.mj-stripe-lock-icon[_ngcontent-%COMP%] {\n font-size: 0.85rem;\n}\n\n.mj-checkout-total-row[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px 0;\n border-top: 1px solid #e2e8f0;\n margin-top: 10px;\n margin-bottom: 18px;\n}\n\n.mj-total-label[_ngcontent-%COMP%] {\n font-weight: 700;\n font-size: 1.05rem;\n color: #0f172a;\n}\n\n.mj-total-amount[_ngcontent-%COMP%] {\n font-weight: 800;\n font-size: 1.25rem;\n color: var(--mj-primary-color, #2563eb);\n}\n\n.mj-widget-actions[_ngcontent-%COMP%] {\n margin-top: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.mj-btn-submit[_ngcontent-%COMP%] {\n width: 100%;\n padding: 12px;\n background: var(--mj-primary-color, #2563eb);\n color: #ffffff;\n font-size: 1rem;\n font-weight: 600;\n border: none;\n border-radius: var(--mj-border-radius, 8px);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n transition: opacity 0.15s ease;\n}\n\n.mj-btn-submit[_ngcontent-%COMP%]:hover:not(:disabled) {\n opacity: 0.92;\n}\n\n.mj-btn-submit[_ngcontent-%COMP%]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.mj-btn-cancel[_ngcontent-%COMP%] {\n width: 100%;\n padding: 8px 12px;\n background: transparent;\n color: #64748b;\n font-size: 0.875rem;\n font-weight: 500;\n border: none;\n cursor: pointer;\n text-align: center;\n}\n\n.mj-btn-cancel[_ngcontent-%COMP%]:hover:not(:disabled) {\n color: #334155;\n text-decoration: underline;\n}\n\n.mj-spinner[_ngcontent-%COMP%] {\n width: 16px;\n height: 16px;\n border: 2px solid #ffffff;\n border-top-color: transparent;\n border-radius: 50%;\n animation: _ngcontent-%COMP%_mj-spin 0.8s linear infinite;\n}\n\n@keyframes _ngcontent-%COMP%_mj-spin {\n to { transform: rotate(360deg); }\n}"], changeDetection: 0 });
|
|
849
|
+
}
|
|
850
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJCheckoutWidgetComponent, [{
|
|
851
|
+
type: Component,
|
|
852
|
+
args: [{ selector: 'mj-checkout-widget', standalone: true, imports: [CommonModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mj-checkout-widget-container\"\n [style.--mj-primary-color]=\"activeTheme()?.primaryColor || '#2563eb'\"\n [style.--mj-accent-color]=\"activeTheme()?.accentColor || '#3b82f6'\"\n [style.--mj-border-radius]=\"activeTheme()?.borderRadius || '8px'\"\n [style.--mj-bg-color]=\"activeTheme()?.backgroundColor || '#ffffff'\"\n [style.--mj-text-color]=\"activeTheme()?.textColor || '#0f172a'\"\n [style.--mj-font-family]=\"activeTheme()?.fontFamily || 'inherit'\">\n\n <!-- Widget Header -->\n <header class=\"mj-widget-header\">\n <h2 class=\"mj-widget-title\">{{ config?.title || 'Checkout' }}</h2>\n @if (config?.description) {\n <p class=\"mj-widget-description\">{{ config?.description }}</p>\n }\n </header>\n\n <!-- Error Banner -->\n @if (displayErrorMessage()) {\n <div class=\"mj-widget-error-banner\" role=\"alert\">\n <span class=\"mj-error-icon\">\u26A0\uFE0F</span>\n <span>{{ displayErrorMessage() }}</span>\n </div>\n }\n\n <!-- Order Item & Pricing Summary -->\n <div class=\"mj-widget-summary-card\">\n <div class=\"mj-summary-row\">\n <div class=\"mj-summary-item-info\">\n <span class=\"mj-product-name\">{{ config?.productName || 'Order Item' }}</span>\n @if (isFree()) {\n <span class=\"mj-badge-free\">FREE</span>\n }\n </div>\n <div class=\"mj-summary-price\">\n @if (isFree()) {\n <span class=\"mj-price-free\">$0.00</span>\n } @else {\n <span class=\"mj-price-amount\">{{ currencySymbol() }}{{ (config?.unitPrice || 0).toFixed(2) }}</span>\n }\n </div>\n </div>\n\n @if (config?.allowQuantity) {\n <div class=\"mj-quantity-selector-row\">\n <label for=\"quantityInput\" class=\"mj-label\">Quantity</label>\n <div class=\"mj-qty-controls\">\n <button type=\"button\" class=\"mj-qty-btn\" (click)=\"onQuantityChange(quantity() - 1)\" [disabled]=\"quantity() <= 1\">-</button>\n <input id=\"quantityInput\" type=\"number\" class=\"mj-qty-input\" [ngModel]=\"quantity()\" (ngModelChange)=\"onQuantityChange($event)\" min=\"1\" [max]=\"config?.maxQuantity || 50\" />\n <button type=\"button\" class=\"mj-qty-btn\" (click)=\"onQuantityChange(quantity() + 1)\" [disabled]=\"quantity() >= (config?.maxQuantity || 50)\">+</button>\n </div>\n </div>\n }\n </div>\n\n <!-- Registration / Contact / Product Extension Form Section -->\n <section class=\"mj-widget-form-section\">\n @if (isSingleUnit()) {\n <!-- Single Unit / Primary Form -->\n <h3 class=\"mj-section-title\">Details</h3>\n <div class=\"mj-form-grid\">\n @for (field of activeFieldDefs(); track field.name) {\n <div class=\"mj-form-group\" [class.full-width]=\"field.type === 'textarea' || field.name === 'email' || field.name === 'Email'\">\n <label class=\"mj-label\">\n {{ field.label }}\n @if (field.required) {\n <span class=\"mj-required\">*</span>\n }\n </label>\n\n @switch (field.type) {\n @case ('textarea') {\n <textarea\n class=\"mj-input mj-textarea\"\n [ngModel]=\"units()[0]?.[field.name]\"\n (ngModelChange)=\"updateUnitField(0, field.name, $event)\"\n [placeholder]=\"field.placeholder || ''\"\n [required]=\"field.required || false\">\n </textarea>\n }\n @case ('select') {\n <select\n class=\"mj-select\"\n [ngModel]=\"units()[0]?.[field.name]\"\n (ngModelChange)=\"updateUnitField(0, field.name, $event)\"\n [required]=\"field.required || false\">\n <option [ngValue]=\"''\">Select {{ field.label }}</option>\n @for (opt of field.options; track opt.value) {\n <option [ngValue]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n @case ('boolean') {\n <label class=\"mj-checkbox-label\">\n <input\n type=\"checkbox\"\n [ngModel]=\"units()[0]?.[field.name]\"\n (ngModelChange)=\"updateUnitField(0, field.name, $event)\" />\n <span>{{ field.label }}</span>\n </label>\n }\n @case ('number') {\n <input\n type=\"number\"\n class=\"mj-input\"\n [ngModel]=\"units()[0]?.[field.name]\"\n (ngModelChange)=\"updateUnitField(0, field.name, $event)\"\n [placeholder]=\"field.placeholder || ''\"\n [required]=\"field.required || false\" />\n }\n @case ('date') {\n <input\n type=\"date\"\n class=\"mj-input\"\n [ngModel]=\"units()[0]?.[field.name]\"\n (ngModelChange)=\"updateUnitField(0, field.name, $event)\"\n [required]=\"field.required || false\" />\n }\n @default {\n <input\n [type]=\"field.name.toLowerCase().includes('email') ? 'email' : 'text'\"\n class=\"mj-input\"\n [ngModel]=\"units()[0]?.[field.name]\"\n (ngModelChange)=\"updateUnitField(0, field.name, $event)\"\n [placeholder]=\"field.placeholder || ''\"\n [required]=\"field.required || false\" />\n }\n }\n </div>\n }\n </div>\n } @else {\n <!-- Multi-Unit Matrix (Repeating Fieldsets for Quantity > 1) -->\n <div class=\"mj-multi-attendee-header\">\n <h3 class=\"mj-section-title\">Item Details ({{ quantity() }})</h3>\n <button type=\"button\" class=\"mj-btn-link\" (click)=\"copyPrimaryToAll()\">Copy Primary Info to All</button>\n </div>\n\n <div class=\"mj-attendee-matrix\">\n @for (unit of units(); track $index) {\n <div class=\"mj-attendee-card\">\n <div class=\"mj-attendee-card-title\">Item {{ $index + 1 }}</div>\n <div class=\"mj-form-grid\">\n @for (field of activeFieldDefs(); track field.name) {\n <div class=\"mj-form-group\" [class.full-width]=\"field.type === 'textarea' || field.name === 'email' || field.name === 'Email'\">\n <label class=\"mj-label\">\n {{ field.label }}\n @if (field.required) {\n <span class=\"mj-required\">*</span>\n }\n </label>\n\n @switch (field.type) {\n @case ('textarea') {\n <textarea\n class=\"mj-input mj-textarea\"\n [ngModel]=\"unit[field.name]\"\n (ngModelChange)=\"updateUnitField($index, field.name, $event)\"\n [placeholder]=\"field.placeholder || ''\"\n [required]=\"field.required || false\">\n </textarea>\n }\n @case ('select') {\n <select\n class=\"mj-select\"\n [ngModel]=\"unit[field.name]\"\n (ngModelChange)=\"updateUnitField($index, field.name, $event)\"\n [required]=\"field.required || false\">\n <option [ngValue]=\"''\">Select {{ field.label }}</option>\n @for (opt of field.options; track opt.value) {\n <option [ngValue]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n @case ('boolean') {\n <label class=\"mj-checkbox-label\">\n <input\n type=\"checkbox\"\n [ngModel]=\"unit[field.name]\"\n (ngModelChange)=\"updateUnitField($index, field.name, $event)\" />\n <span>{{ field.label }}</span>\n </label>\n }\n @case ('number') {\n <input\n type=\"number\"\n class=\"mj-input\"\n [ngModel]=\"unit[field.name]\"\n (ngModelChange)=\"updateUnitField($index, field.name, $event)\"\n [placeholder]=\"field.placeholder || ''\"\n [required]=\"field.required || false\" />\n }\n @case ('date') {\n <input\n type=\"date\"\n class=\"mj-input\"\n [ngModel]=\"unit[field.name]\"\n (ngModelChange)=\"updateUnitField($index, field.name, $event)\"\n [required]=\"field.required || false\" />\n }\n @default {\n <input\n [type]=\"field.name.toLowerCase().includes('email') ? 'email' : 'text'\"\n class=\"mj-input\"\n [ngModel]=\"unit[field.name]\"\n (ngModelChange)=\"updateUnitField($index, field.name, $event)\"\n [placeholder]=\"field.placeholder || ''\"\n [required]=\"field.required || false\" />\n }\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n </section>\n\n <!-- Stripe Embedded Payment Section -->\n @if (!isFree()) {\n <section class=\"mj-widget-payment-section\">\n <h3 class=\"mj-section-title\">Payment</h3>\n <div class=\"mj-stripe-container\">\n <div id=\"stripe-card-element\" class=\"mj-stripe-mount-point\">\n <!-- Stripe.js mounts secure hosted Elements iframe here -->\n </div>\n <div class=\"mj-stripe-badge\">\n <span class=\"mj-stripe-lock-icon\">\uD83D\uDD12</span>\n <span>Secured by Stripe \u2022 PCI-DSS Level 1 Certified \u2022 End-to-end Encrypted</span>\n </div>\n </div>\n </section>\n\n <!-- Final Total Line -->\n <div class=\"mj-checkout-total-row\">\n <span class=\"mj-total-label\">Total Due</span>\n <span class=\"mj-total-amount\">{{ currencySymbol() }}{{ totalGross().toFixed(2) }}</span>\n </div>\n }\n\n <!-- Actions -->\n <div class=\"mj-widget-actions\">\n <button type=\"button\" class=\"mj-btn-submit\" [disabled]=\"!isFormValid() || isProcessing\" (click)=\"handleSubmit()\">\n @if (isProcessing) {\n <span class=\"mj-spinner\"></span>\n <span>Processing...</span>\n } @else if (isFree()) {\n <span>Complete Free Registration</span>\n } @else {\n <span>Pay {{ currencySymbol() }}{{ totalGross().toFixed(2) }}</span>\n }\n </button>\n\n <button type=\"button\" class=\"mj-btn-cancel\" [disabled]=\"isProcessing\" (click)=\"cancelled.emit()\">\n Cancel\n </button>\n </div>\n</div>\n", styles: [":host {\n display: block;\n font-family: var(--mj-font-family, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);\n color: var(--mj-text-color, #1e293b);\n}\n\n.mj-checkout-widget-container {\n max-width: 560px;\n margin: 0 auto;\n background: var(--mj-bg-color, #ffffff);\n border: 1px solid #e2e8f0;\n border-radius: var(--mj-border-radius, 8px);\n padding: 24px;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);\n}\n\n.mj-widget-header {\n margin-bottom: 20px;\n}\n\n.mj-widget-title {\n margin: 0 0 6px 0;\n font-size: 1.35rem;\n font-weight: 700;\n color: var(--mj-text-color, #0f172a);\n}\n\n.mj-widget-description {\n margin: 0;\n font-size: 0.9rem;\n color: #64748b;\n line-height: 1.4;\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 margin-bottom: 18px;\n font-size: 0.875rem;\n}\n\n.mj-error-icon {\n font-size: 1rem;\n}\n\n.mj-widget-summary-card {\n background: #f8fafc;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 14px 16px;\n margin-bottom: 20px;\n}\n\n.mj-summary-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.mj-summary-price {\n display: flex;\n align-items: center;\n}\n\n.mj-widget-form-section {\n margin-bottom: 20px;\n}\n\n.mj-summary-item-info {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.mj-product-name {\n font-weight: 600;\n font-size: 1rem;\n color: #1e293b;\n}\n\n.mj-badge-free {\n background: #dcfce7;\n color: #166534;\n font-size: 0.75rem;\n font-weight: 700;\n padding: 2px 6px;\n border-radius: 4px;\n}\n\n.mj-price-free {\n font-weight: 700;\n color: #166534;\n font-size: 1.1rem;\n}\n\n.mj-price-amount {\n font-weight: 700;\n color: #0f172a;\n font-size: 1.1rem;\n}\n\n.mj-quantity-selector-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 12px;\n padding-top: 12px;\n border-top: 1px dashed #cbd5e1;\n}\n\n.mj-qty-controls {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n.mj-qty-btn {\n width: 28px;\n height: 28px;\n background: #ffffff;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n cursor: pointer;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.mj-qty-btn:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.mj-qty-input {\n width: 44px;\n height: 28px;\n text-align: center;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n font-weight: 600;\n}\n\n.mj-section-title {\n font-size: 1rem;\n font-weight: 600;\n margin: 0 0 12px 0;\n color: #334155;\n}\n\n.mj-form-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 12px;\n margin-bottom: 18px;\n}\n\n.mj-form-group {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.mj-form-group.full-width {\n grid-column: 1 / -1;\n}\n\n.mj-label {\n font-size: 0.8rem;\n font-weight: 500;\n color: #475569;\n}\n\n.mj-required {\n color: #ef4444;\n}\n\n.mj-input, .mj-select {\n padding: 8px 12px;\n font-size: 0.9rem;\n border: 1px solid #cbd5e1;\n border-radius: 4px;\n background: #ffffff;\n color: #1e293b;\n outline: none;\n transition: border-color 0.15s ease;\n width: 100%;\n box-sizing: border-box;\n}\n\n.mj-textarea {\n min-height: 70px;\n resize: vertical;\n font-family: inherit;\n}\n\n.mj-select {\n min-height: 38px;\n}\n\n.mj-checkbox-label {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n font-size: 0.9rem;\n color: #334155;\n margin-top: 4px;\n}\n\n.mj-input:focus, .mj-select:focus {\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-multi-attendee-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 12px;\n}\n\n.mj-btn-link {\n background: none;\n border: none;\n color: var(--mj-primary-color, #2563eb);\n font-size: 0.8rem;\n cursor: pointer;\n text-decoration: underline;\n padding: 0;\n}\n\n.mj-attendee-matrix {\n display: flex;\n flex-direction: column;\n gap: 14px;\n margin-bottom: 20px;\n}\n\n.mj-attendee-card {\n background: #f8fafc;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 12px 14px;\n}\n\n.mj-attendee-card-title {\n font-size: 0.85rem;\n font-weight: 600;\n color: #475569;\n margin-bottom: 10px;\n}\n\n/* Stripe Payment Container */\n.mj-widget-payment-section {\n margin-top: 16px;\n padding-top: 16px;\n border-top: 1px solid #e2e8f0;\n}\n\n.mj-stripe-container {\n background: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n padding: 14px;\n margin-bottom: 16px;\n}\n\n.mj-stripe-mount-point {\n min-height: 40px;\n}\n\n.mj-stripe-badge {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-top: 10px;\n font-size: 0.75rem;\n color: #64748b;\n}\n\n.mj-stripe-lock-icon {\n font-size: 0.85rem;\n}\n\n.mj-checkout-total-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px 0;\n border-top: 1px solid #e2e8f0;\n margin-top: 10px;\n margin-bottom: 18px;\n}\n\n.mj-total-label {\n font-weight: 700;\n font-size: 1.05rem;\n color: #0f172a;\n}\n\n.mj-total-amount {\n font-weight: 800;\n font-size: 1.25rem;\n color: var(--mj-primary-color, #2563eb);\n}\n\n.mj-widget-actions {\n margin-top: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.mj-btn-submit {\n width: 100%;\n padding: 12px;\n background: var(--mj-primary-color, #2563eb);\n color: #ffffff;\n font-size: 1rem;\n font-weight: 600;\n border: none;\n border-radius: var(--mj-border-radius, 8px);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n transition: opacity 0.15s ease;\n}\n\n.mj-btn-submit:hover:not(:disabled) {\n opacity: 0.92;\n}\n\n.mj-btn-submit:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.mj-btn-cancel {\n width: 100%;\n padding: 8px 12px;\n background: transparent;\n color: #64748b;\n font-size: 0.875rem;\n font-weight: 500;\n border: none;\n cursor: pointer;\n text-align: center;\n}\n\n.mj-btn-cancel:hover:not(:disabled) {\n color: #334155;\n text-decoration: underline;\n}\n\n.mj-spinner {\n width: 16px;\n height: 16px;\n border: 2px solid #ffffff;\n border-top-color: transparent;\n border-radius: 50%;\n animation: mj-spin 0.8s linear infinite;\n}\n\n@keyframes mj-spin {\n to { transform: rotate(360deg); }\n}\n"] }]
|
|
853
|
+
}], () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], { config: [{
|
|
854
|
+
type: Input
|
|
855
|
+
}], distributionSlug: [{
|
|
856
|
+
type: Input
|
|
857
|
+
}], sessionKey: [{
|
|
858
|
+
type: Input
|
|
859
|
+
}], isProcessing: [{
|
|
860
|
+
type: Input
|
|
861
|
+
}], errorMessage: [{
|
|
862
|
+
type: Input
|
|
863
|
+
}], isPaymentReady: [{
|
|
864
|
+
type: Input
|
|
865
|
+
}], stripePaymentMethodId: [{
|
|
866
|
+
type: Input
|
|
867
|
+
}], submitted: [{
|
|
868
|
+
type: Output
|
|
869
|
+
}], cancelled: [{
|
|
870
|
+
type: Output
|
|
871
|
+
}] }); })();
|
|
872
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJCheckoutWidgetComponent, { className: "MJCheckoutWidgetComponent", filePath: "lib/checkout-widget/checkout-widget.component.ts", lineNumber: 116 }); })();
|
|
873
|
+
//# sourceMappingURL=checkout-widget.component.js.map
|