@tesouro/embedded-components-react 0.5.193 → 0.5.195

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.
Files changed (46) hide show
  1. package/README.md +1 -2
  2. package/dist/index.css +3 -3
  3. package/dist/index.d.ts +12 -3
  4. package/dist/index.js +1 -1
  5. package/dist/lib/ReceivablesWidget.d.ts +12 -3
  6. package/dist/lib/ReceivablesWidget.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +245 -65
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +66 -106
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +102 -223
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +225 -0
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +182 -371
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +401 -60
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js +62 -193
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +184 -31
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +31 -149
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +292 -161
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +11 -3
  19. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index4.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index5.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +4 -1
  22. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +36 -36
  23. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +876 -832
  24. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index.js +12 -11
  26. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js +16 -23
  27. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index11.js +7 -8
  28. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index12.js +17 -18
  29. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index13.js +36 -0
  30. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index3.js +43 -16
  31. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js +23 -13
  32. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index5.js +13 -30
  33. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index6.js +18 -23
  34. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index7.js +22 -16
  35. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index8.js +22 -15
  36. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +10 -11
  37. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +10 -9
  38. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +5 -5
  39. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/ProductSelector.js +9 -13
  40. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useMeasureUnits.js +1 -1
  41. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductForm.js +2 -2
  42. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductSelector.js +28 -41
  43. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index.js +6 -6
  44. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +7 -15
  45. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +100 -69
  46. package/package.json +1 -1
@@ -3,233 +3,112 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
- import { WidgetProvider as t } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
7
6
  import "../../../shared/feature/dist/index.js";
8
- import { CounterpartFormSheet as n } from "../../../shared/counterpart-management/ui/dist/index9.js";
9
- import { CounterpartSelector as r } from "../../../shared/counterpart-management/feature/dist/lib/CounterpartSelector.js";
10
- import "../../../shared/counterpart-management/feature/dist/index.js";
11
- import { ReceivablesWidgetAnalyticsEvent as i, WIDGET_NAME as a } from "./index2.js";
12
- import { PAGE_SIZE_OPTIONS as o } from "./index4.js";
13
- import { ProductFormSheet as s } from "../../../shared/product-catalog/ui/dist/index3.js";
14
- import { MeasureUnitsManagerContainer as c } from "../../../shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js";
15
- import { ProductSelector as l } from "../../../shared/product-catalog/feature/dist/lib/ProductSelector.js";
7
+ import { ReceivablesWidgetAnalyticsEvent as t } from "./index2.js";
8
+ import { coerceEnabledTabs as n, resolveInitialTab as r, tabForType as i, typeForTab as a } from "./index6.js";
9
+ import { RECEIVABLE_MESSAGE_LABELS_EN as o } from "./index7.js";
10
+ import { useReceivableActions as s } from "./index8.js";
11
+ import { useReceivableDetails as c } from "./index9.js";
12
+ import { hasSelectedText as l } from "../../../shared/product-catalog/feature/dist/lib/helpers.js";
16
13
  import "../../../shared/product-catalog/feature/dist/index.js";
17
- import { useReceivablesWidget as u } from "./index11.js";
18
- import { ReceivableActionDialog as d } from "../../ui/dist/index3.js";
19
- import { ReceivableDetailsSheet as f } from "../../ui/dist/index12.js";
20
- import { ReceivableFormSheet as p } from "../../ui/dist/index13.js";
21
- import { ReceivablePaymentDialog as m } from "../../ui/dist/index14.js";
22
- import { ReceivableSendDialog as h } from "../../ui/dist/index15.js";
23
- import { ReceivablesScreen as g } from "../../ui/dist/index16.js";
24
- import "../../ui/dist/index.js";
25
- import { useEffect as _, useState as v } from "react";
26
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
14
+ import { useReceivableForm as u } from "./index10.js";
15
+ import { useReceivablesTable as d } from "./index11.js";
16
+ import { useCallback as f, useEffect as p, useMemo as m, useState as h } from "react";
27
17
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js
28
- function S({ counterpartFormLabels: t, counterpartMessageLabels: a, defaultTab: S, detailsLabels: C, enabledTabs: w, formLabels: T, measureUnitDeleteLabels: E, measureUnitsLabels: D, messageLabels: O, onReceivableCreated: k, onReceivableOpened: A, onTemplateSettingsClick: j, pageSizeOptions: M = o, paymentLabels: N, productFormLabels: P, productMessageLabels: F, screenLabels: I, sendLabels: L, actionLabels: R }) {
29
- let z = e();
30
- _(() => {
31
- z(i.Mounted);
32
- }, [z]);
33
- let B = u({
34
- counterpartMessageLabels: a,
35
- defaultTab: S,
18
+ function g({ counterpartMessageLabels: g, defaultTab: _, enabledTabs: v, messageLabels: y, onReceivableCreated: b, onReceivableOpened: x }) {
19
+ let S = e();
20
+ p(() => {
21
+ S(t.Mounted);
22
+ }, [S]);
23
+ let C = m(() => ({
24
+ ...o,
25
+ ...y
26
+ }), [y]), w = m(() => n(v), [v]), [T, E] = h(() => r({
27
+ defaultTab: _,
28
+ enabledTabs: w
29
+ })), [D, O] = h(), [k, A] = h(!1);
30
+ p(() => {
31
+ w.includes(T) || E(r({
32
+ defaultTab: _,
33
+ enabledTabs: w
34
+ }));
35
+ }, [
36
+ T,
37
+ _,
38
+ w
39
+ ]);
40
+ let j = f((e, t) => {
41
+ E(i(t)), O(e), A(!0), b?.(e, t);
42
+ }, [b]), M = d({
43
+ activeTab: T,
44
+ messages: C
45
+ }), N = c({
46
+ selectedReceivableId: D,
47
+ enabled: k,
48
+ messages: C
49
+ }), P = u({
50
+ messages: C,
51
+ counterpartMessageLabels: g,
52
+ onCreated: j
53
+ }), F = f(() => {
54
+ let e = a(T);
55
+ P.openCreate(e === "quote" ? "quote" : "invoice");
56
+ }, [T, P.openCreate]), I = s({
57
+ selectedReceivable: N.receivable,
58
+ messages: C,
59
+ onCreated: j,
60
+ onDeleted: (e) => {
61
+ e === D && (O(void 0), A(!1));
62
+ }
63
+ }), L = f((e) => {
64
+ l() || (O(e.id), A(!0), x?.(e.id, e.type));
65
+ }, [x]);
66
+ return {
67
+ activeTab: T,
36
68
  enabledTabs: w,
37
- messageLabels: O,
38
- onReceivableCreated: k,
39
- onReceivableOpened: A,
40
- productMessageLabels: F
41
- }), [V, H] = v(!1);
42
- return /* @__PURE__ */ x(y, { children: [
43
- /* @__PURE__ */ b(g, {
44
- rows: B.table.rows,
45
- activeTab: B.activeTab,
46
- enabledTabs: B.enabledTabs,
47
- onTabChange: B.setActiveTab,
48
- isLoading: B.table.isLoading,
49
- isError: B.table.isError,
50
- sorting: B.table.sorting,
51
- onSortingChange: B.table.onSortingChange,
52
- pageSize: B.table.pageSize,
53
- onPageSizeChange: B.table.onPageSizeChange,
54
- pageSizeOptions: M,
55
- hasNextPage: B.table.hasNextPage,
56
- hasPrevPage: B.table.hasPrevPage,
57
- onNextPage: B.table.onNextPage,
58
- onPrevPage: B.table.onPrevPage,
59
- searchValue: B.table.searchValue,
60
- onSearchChange: B.table.onSearchChange,
61
- statusFilter: B.table.statusFilter,
62
- statusOptions: B.table.statusOptions,
63
- onStatusFilterChange: B.table.onStatusFilterChange,
64
- isFiltering: B.table.isFiltering,
65
- onCreateClick: B.openCreate,
66
- onTemplateSettingsClick: j,
67
- onRowClick: B.handleRowClick,
68
- onActionClick: B.handleActionClick,
69
- onRetry: B.table.onRetry,
70
- labels: I
71
- }),
72
- /* @__PURE__ */ b(p, {
73
- open: B.form.open,
74
- onOpenChange: (e) => {
75
- e || B.form.close();
76
- },
77
- mode: B.form.mode,
78
- values: B.form.values,
79
- errors: B.form.errors,
80
- currencyOptions: B.form.currencyOptions,
81
- paymentTermsOptions: B.form.paymentTermsOptions,
82
- inProgress: B.form.isSubmitting,
83
- customerSelector: /* @__PURE__ */ b(r, {
84
- mode: "customer",
85
- value: B.form.values.customerId || void 0,
86
- onValueChange: (e) => B.form.updateValues({ customerId: e }),
87
- onCreateClick: B.form.openCounterpartCreate
88
- }),
89
- renderProductSelector: (e) => /* @__PURE__ */ b(l, {
90
- value: e.productId || void 0,
91
- onValueChange: (t) => B.form.updateLineItem(e.id, { productId: t }),
92
- onCreateClick: B.form.openProductCreate
93
- }),
94
- onChange: B.form.updateValues,
95
- onLineItemChange: B.form.updateLineItem,
96
- onAddLineItem: B.form.addLineItem,
97
- onRemoveLineItem: B.form.removeLineItem,
98
- onSubmit: B.form.submit,
99
- onCancel: B.form.close,
100
- labels: T
101
- }),
102
- /* @__PURE__ */ b(f, {
103
- open: B.detailsOpen,
104
- onOpenChange: (e) => {
105
- e || B.closeDetails();
106
- },
107
- details: B.details.detailsView,
108
- isLoading: B.details.isLoading,
109
- isError: B.details.isError,
110
- onActionClick: B.handleDetailsActionClick,
111
- onClose: B.closeDetails,
112
- labels: C
113
- }),
114
- /* @__PURE__ */ b(h, {
115
- open: B.actions.sendOpen,
116
- onOpenChange: (e) => {
117
- e || B.actions.closeSend();
118
- },
119
- values: B.actions.sendValues,
120
- errors: B.actions.sendErrors,
121
- inProgress: B.actions.sendInProgress,
122
- onChange: (e) => B.actions.setSendValues((t) => ({
123
- ...t,
124
- ...e
125
- })),
126
- onSubmit: B.actions.submitSend,
127
- onCancel: B.actions.closeSend,
128
- labels: L
129
- }),
130
- /* @__PURE__ */ b(m, {
131
- open: B.actions.paymentOpen,
132
- onOpenChange: (e) => {
133
- e || B.actions.closePayment();
134
- },
135
- values: B.actions.paymentValues,
136
- errors: B.actions.paymentErrors,
137
- inProgress: B.actions.paymentInProgress,
138
- onChange: (e) => B.actions.setPaymentValues((t) => ({
139
- ...t,
140
- ...e
141
- })),
142
- onSubmit: B.actions.submitPayment,
143
- onCancel: B.actions.closePayment,
144
- labels: N
145
- }),
146
- B.actions.actionDialog && /* @__PURE__ */ b(d, {
147
- open: !!B.actions.actionTarget,
148
- onOpenChange: (e) => {
149
- e || B.actions.closeAction();
150
- },
151
- title: B.actions.actionDialog.title,
152
- description: B.actions.actionDialog.description,
153
- confirmLabel: B.actions.actionDialog.confirmLabel,
154
- destructive: B.actions.actionDialog.destructive,
155
- error: B.actions.actionError,
156
- inProgress: B.actions.actionInProgress,
157
- onConfirm: B.actions.confirmAction,
158
- onCancel: B.actions.closeAction,
159
- labels: R
160
- }),
161
- /* @__PURE__ */ b(s, {
162
- open: B.form.productView === "create",
163
- onOpenChange: (e) => {
164
- e || B.form.productForm.close();
165
- },
166
- mode: "create",
167
- values: B.form.productForm.values,
168
- errors: B.form.productForm.errors,
169
- unitOptions: B.form.units.unitOptions,
170
- currencyOptions: B.form.productForm.currencyOptions,
171
- inProgress: B.form.productForm.isSubmitting,
172
- onChange: (e) => B.form.productForm.setValues((t) => ({
173
- ...t,
174
- ...e
175
- })),
176
- onManageUnits: () => H(!0),
177
- onSubmit: B.form.productForm.submit,
178
- onCancel: B.form.productForm.close,
179
- labels: P
180
- }),
181
- /* @__PURE__ */ b(n, {
182
- open: B.form.counterpartView === "create",
183
- onOpenChange: (e) => {
184
- e || B.form.counterpartForm.close();
185
- },
186
- mode: "create",
187
- values: B.form.counterpartForm.values,
188
- errors: B.form.counterpartForm.errors,
189
- stateOptions: B.form.stateOptions,
190
- inProgress: B.form.counterpartForm.isSubmitting,
191
- onChange: (e) => B.form.counterpartForm.setValues((t) => ({
192
- ...t,
193
- ...e
194
- })),
195
- onAddressChange: (e) => B.form.counterpartForm.setValues((t) => ({
196
- ...t,
197
- address: {
198
- ...t.address,
199
- ...e
69
+ setActiveTab: E,
70
+ table: M,
71
+ details: N,
72
+ detailsOpen: k,
73
+ closeDetails: f(() => {
74
+ A(!1), O(void 0);
75
+ }, []),
76
+ form: P,
77
+ openCreate: F,
78
+ actions: I,
79
+ handleRowClick: L,
80
+ handleActionClick: f((e, t) => {
81
+ let n = M.getReceivableById(t.id);
82
+ if (e === "edit") {
83
+ if (n) {
84
+ P.openEdit(n);
85
+ return;
200
86
  }
201
- })),
202
- onSubmit: B.form.counterpartForm.submit,
203
- onCancel: B.form.counterpartForm.close,
204
- labels: t
205
- }),
206
- /* @__PURE__ */ b(c, {
207
- open: V,
208
- onClose: () => H(!1),
209
- managerLabels: D,
210
- deleteLabels: E,
211
- messageLabels: F
212
- })
213
- ] });
214
- }
215
- function C({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: o, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
216
- return /* @__PURE__ */ b(t, {
217
- widgetName: a,
218
- baseUrl: e,
219
- widgetToken: n,
220
- organizationId: r,
221
- configClient: i,
222
- gatewayRouting: o,
223
- linkComponent: s,
224
- implementation: c,
225
- uiFramework: l,
226
- errorFallback: u,
227
- onError: d,
228
- analytics: f,
229
- disclosuresAcceptance: p,
230
- providerLabels: m,
231
- children: /* @__PURE__ */ b(S, { ...h })
232
- });
87
+ O(t.id), A(!0);
88
+ return;
89
+ }
90
+ O(t.id), I.openAction(e, t, n ?? null);
91
+ }, [
92
+ I,
93
+ P.openEdit,
94
+ M.getReceivableById
95
+ ]),
96
+ handleDetailsActionClick: f((e, t) => {
97
+ if (e === "edit") {
98
+ N.receivable && (P.openEdit(N.receivable), A(!1));
99
+ return;
100
+ }
101
+ I.openAction(e, {
102
+ id: t.id,
103
+ title: t.title,
104
+ type: t.type
105
+ }, N.receivable ?? null);
106
+ }, [
107
+ I,
108
+ N.receivable,
109
+ P.openEdit
110
+ ])
111
+ };
233
112
  }
234
113
  //#endregion
235
- export { C as ReceivablesWidget, C as default };
114
+ export { g as useReceivablesWidget };
@@ -0,0 +1,225 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
+ import { WidgetProvider as t } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
7
+ import "../../../shared/feature/dist/index.js";
8
+ import { CounterpartFormSheet as n } from "../../../shared/counterpart-management/ui/dist/index9.js";
9
+ import { CounterpartSelector as r } from "../../../shared/counterpart-management/feature/dist/lib/CounterpartSelector.js";
10
+ import "../../../shared/counterpart-management/feature/dist/index.js";
11
+ import { ReceivablesWidgetAnalyticsEvent as i, WIDGET_NAME as a } from "./index2.js";
12
+ import { PAGE_SIZE_OPTIONS as o } from "./index4.js";
13
+ import { MeasureUnitsManagerContainer as s } from "../../../shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js";
14
+ import { ProductSelector as c } from "../../../shared/product-catalog/feature/dist/lib/ProductSelector.js";
15
+ import "../../../shared/product-catalog/feature/dist/index.js";
16
+ import { useReceivablesWidget as l } from "./index12.js";
17
+ import { ReceivableActionDialog as u } from "../../ui/dist/index3.js";
18
+ import { ReceivableDetailsSheet as d } from "../../ui/dist/index12.js";
19
+ import { ReceivableFormSheet as f } from "../../ui/dist/index13.js";
20
+ import { ReceivablePaymentDialog as p } from "../../ui/dist/index14.js";
21
+ import { ReceivableSendDialog as m } from "../../ui/dist/index15.js";
22
+ import { ReceivablesScreen as h } from "../../ui/dist/index16.js";
23
+ import "../../ui/dist/index.js";
24
+ import { useEffect as g, useState as _ } from "react";
25
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
26
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js
27
+ function x({ counterpartFormLabels: t, counterpartMessageLabels: a, defaultTab: x, detailsLabels: S, enabledTabs: C, formLabels: w, measureUnitDeleteLabels: T, measureUnitsLabels: E, messageLabels: D, onReceivableCreated: O, onReceivableOpened: k, onTemplateSettingsClick: A, pageSizeOptions: j = o, paymentLabels: M, productMessageLabels: N, screenLabels: P, sendLabels: F, actionLabels: I }) {
28
+ let L = e();
29
+ g(() => {
30
+ L(i.Mounted);
31
+ }, [L]);
32
+ let R = l({
33
+ counterpartMessageLabels: a,
34
+ defaultTab: x,
35
+ enabledTabs: C,
36
+ messageLabels: D,
37
+ onReceivableCreated: O,
38
+ onReceivableOpened: k
39
+ }), [z, B] = _(!1);
40
+ return /* @__PURE__ */ b(v, { children: [
41
+ /* @__PURE__ */ y(h, {
42
+ rows: R.table.rows,
43
+ activeTab: R.activeTab,
44
+ enabledTabs: R.enabledTabs,
45
+ onTabChange: R.setActiveTab,
46
+ isLoading: R.table.isLoading,
47
+ isError: R.table.isError,
48
+ sorting: R.table.sorting,
49
+ onSortingChange: R.table.onSortingChange,
50
+ pageSize: R.table.pageSize,
51
+ onPageSizeChange: R.table.onPageSizeChange,
52
+ pageSizeOptions: j,
53
+ hasNextPage: R.table.hasNextPage,
54
+ hasPrevPage: R.table.hasPrevPage,
55
+ onNextPage: R.table.onNextPage,
56
+ onPrevPage: R.table.onPrevPage,
57
+ searchValue: R.table.searchValue,
58
+ onSearchChange: R.table.onSearchChange,
59
+ statusFilter: R.table.statusFilter,
60
+ statusOptions: R.table.statusOptions,
61
+ onStatusFilterChange: R.table.onStatusFilterChange,
62
+ isFiltering: R.table.isFiltering,
63
+ onCreateClick: R.openCreate,
64
+ onTemplateSettingsClick: A,
65
+ onRowClick: R.handleRowClick,
66
+ onActionClick: R.handleActionClick,
67
+ onRetry: R.table.onRetry,
68
+ labels: P
69
+ }),
70
+ /* @__PURE__ */ y(f, {
71
+ open: R.form.open,
72
+ onOpenChange: (e) => {
73
+ e || R.form.close();
74
+ },
75
+ mode: R.form.mode,
76
+ values: R.form.sheetValues,
77
+ errors: R.form.errors,
78
+ currencyOptions: R.form.currencyOptions,
79
+ paymentTermsOptions: R.form.paymentTermsOptions,
80
+ unitOptions: R.form.lineItemUnitOptions,
81
+ currencySymbol: R.form.currencySymbol,
82
+ lineItemControls: R.form.lineItemControls,
83
+ autoFocusLineItemId: R.form.autoFocusLineItemId,
84
+ lineItemsLoading: R.form.lineItemsLoading,
85
+ inProgress: R.form.isSubmitting,
86
+ customerSelector: /* @__PURE__ */ y(r, {
87
+ mode: "customer",
88
+ value: R.form.values.customerId || void 0,
89
+ onValueChange: (e) => R.form.updateValues({ customerId: e }),
90
+ onCreateClick: R.form.openCounterpartCreate
91
+ }),
92
+ renderProductSelector: (e, t) => /* @__PURE__ */ y(c, {
93
+ ...t,
94
+ inputValue: e.name,
95
+ selectedProductId: R.form.values.lineItems.find((t) => t.id === e.id)?.productId || void 0,
96
+ currency: R.form.values.currency,
97
+ maxLength: 100,
98
+ onInputValueChange: (t) => R.form.updateLineItem(e.id, { name: t }),
99
+ onProductSelect: (t) => R.form.selectProduct(e.id, t)
100
+ }),
101
+ onChange: R.form.updateValues,
102
+ onLineItemChange: R.form.updateLineItem,
103
+ onLineItemCommit: R.form.commitLineItem,
104
+ onLineItemQuantityStep: R.form.stepLineItem,
105
+ onManageUnits: () => B(!0),
106
+ onAddLineItem: R.form.addLineItem,
107
+ onRemoveLineItem: R.form.removeLineItem,
108
+ onSubmit: R.form.submit,
109
+ onCancel: R.form.close,
110
+ labels: w
111
+ }),
112
+ /* @__PURE__ */ y(d, {
113
+ open: R.detailsOpen,
114
+ onOpenChange: (e) => {
115
+ e || R.closeDetails();
116
+ },
117
+ details: R.details.detailsView,
118
+ isLoading: R.details.isLoading,
119
+ isError: R.details.isError,
120
+ onActionClick: R.handleDetailsActionClick,
121
+ onClose: R.closeDetails,
122
+ labels: S
123
+ }),
124
+ /* @__PURE__ */ y(m, {
125
+ open: R.actions.sendOpen,
126
+ onOpenChange: (e) => {
127
+ e || R.actions.closeSend();
128
+ },
129
+ values: R.actions.sendValues,
130
+ errors: R.actions.sendErrors,
131
+ inProgress: R.actions.sendInProgress,
132
+ onChange: (e) => R.actions.setSendValues((t) => ({
133
+ ...t,
134
+ ...e
135
+ })),
136
+ onSubmit: R.actions.submitSend,
137
+ onCancel: R.actions.closeSend,
138
+ labels: F
139
+ }),
140
+ /* @__PURE__ */ y(p, {
141
+ open: R.actions.paymentOpen,
142
+ onOpenChange: (e) => {
143
+ e || R.actions.closePayment();
144
+ },
145
+ values: R.actions.paymentValues,
146
+ errors: R.actions.paymentErrors,
147
+ inProgress: R.actions.paymentInProgress,
148
+ onChange: (e) => R.actions.setPaymentValues((t) => ({
149
+ ...t,
150
+ ...e
151
+ })),
152
+ onSubmit: R.actions.submitPayment,
153
+ onCancel: R.actions.closePayment,
154
+ labels: M
155
+ }),
156
+ R.actions.actionDialog && /* @__PURE__ */ y(u, {
157
+ open: !!R.actions.actionTarget,
158
+ onOpenChange: (e) => {
159
+ e || R.actions.closeAction();
160
+ },
161
+ title: R.actions.actionDialog.title,
162
+ description: R.actions.actionDialog.description,
163
+ confirmLabel: R.actions.actionDialog.confirmLabel,
164
+ destructive: R.actions.actionDialog.destructive,
165
+ error: R.actions.actionError,
166
+ inProgress: R.actions.actionInProgress,
167
+ onConfirm: R.actions.confirmAction,
168
+ onCancel: R.actions.closeAction,
169
+ labels: I
170
+ }),
171
+ /* @__PURE__ */ y(n, {
172
+ open: R.form.counterpartView === "create",
173
+ onOpenChange: (e) => {
174
+ e || R.form.counterpartForm.close();
175
+ },
176
+ mode: "create",
177
+ values: R.form.counterpartForm.values,
178
+ errors: R.form.counterpartForm.errors,
179
+ stateOptions: R.form.stateOptions,
180
+ inProgress: R.form.counterpartForm.isSubmitting,
181
+ onChange: (e) => R.form.counterpartForm.setValues((t) => ({
182
+ ...t,
183
+ ...e
184
+ })),
185
+ onAddressChange: (e) => R.form.counterpartForm.setValues((t) => ({
186
+ ...t,
187
+ address: {
188
+ ...t.address,
189
+ ...e
190
+ }
191
+ })),
192
+ onSubmit: R.form.counterpartForm.submit,
193
+ onCancel: R.form.counterpartForm.close,
194
+ labels: t
195
+ }),
196
+ /* @__PURE__ */ y(s, {
197
+ open: z,
198
+ onClose: () => B(!1),
199
+ managerLabels: E,
200
+ deleteLabels: T,
201
+ messageLabels: N
202
+ })
203
+ ] });
204
+ }
205
+ function S({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: o, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
206
+ return /* @__PURE__ */ y(t, {
207
+ widgetName: a,
208
+ baseUrl: e,
209
+ widgetToken: n,
210
+ organizationId: r,
211
+ configClient: i,
212
+ gatewayRouting: o,
213
+ linkComponent: s,
214
+ implementation: c,
215
+ uiFramework: l,
216
+ errorFallback: u,
217
+ onError: d,
218
+ analytics: f,
219
+ disclosuresAcceptance: p,
220
+ providerLabels: m,
221
+ children: /* @__PURE__ */ y(x, { ...h })
222
+ });
223
+ }
224
+ //#endregion
225
+ export { S as ReceivablesWidget, S as default };