@tesouro/embedded-components-react 0.5.211 → 0.5.212

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 (33) hide show
  1. package/dist/index.d.ts +16 -0
  2. package/dist/index.js +1 -1
  3. package/dist/lib/ReceivablesWidget.d.ts +16 -0
  4. package/dist/lib/ReceivablesWidget.js +1 -1
  5. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +113 -109
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +416 -132
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +113 -211
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +154 -37
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +193 -135
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +32 -37
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +150 -58
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +35 -89
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +58 -116
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +96 -47
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +103 -347
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +364 -64
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +66 -106
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +105 -275
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +288 -0
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +76 -61
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +48 -422
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +5 -5
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +38 -62
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +61 -391
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +457 -89
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +91 -234
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +234 -78
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +80 -331
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +344 -0
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +10 -0
  32. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  33. package/package.json +1 -1
@@ -2,284 +2,114 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Calendar as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { EmbeddedToaster as t } from "../../../shared/ui/dist/lib/EmbeddedToaster.js";
7
- import "../../../shared/ui/dist/index.js";
8
- import { useAnalyticsTrack as n } from "../../../shared/feature/dist/lib/analytics/hooks.js";
9
- import { WidgetProvider as r } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
5
+ import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
10
6
  import "../../../shared/feature/dist/index.js";
11
- import { CounterpartFormSheet as i } from "../../../shared/counterpart-management/ui/dist/index9.js";
12
- import { CounterpartSelector as a } from "../../../shared/counterpart-management/feature/dist/lib/CounterpartSelector.js";
13
- import "../../../shared/counterpart-management/feature/dist/index.js";
14
- import { ReceivablesWidgetAnalyticsEvent as o, WIDGET_NAME as s } from "./index2.js";
15
- import { PAGE_SIZE_OPTIONS as c } from "./index4.js";
16
- import { ReceivableActionDialog as l } from "../../ui/dist/index4.js";
17
- import { ReceivableBankAccountSection as u } from "../../ui/dist/index5.js";
18
- import { ReceivableBillingSection as d } from "../../ui/dist/index10.js";
19
- import { ReceivableDetailsSheet as f } from "../../ui/dist/index21.js";
20
- import { ReceivableFormSheet as p } from "../../ui/dist/index23.js";
21
- import { ReceivablePaymentDialog as m } from "../../ui/dist/index24.js";
22
- import { ReceivableRemindersSection as h } from "../../ui/dist/index25.js";
23
- import { ReceivableSendDialog as g } from "../../ui/dist/index26.js";
24
- import { ReceivablesScreen as _ } from "../../ui/dist/index27.js";
25
- import "../../ui/dist/index.js";
26
- import { ReceivableAttachmentsSection as v } from "./index5.js";
27
- import { MeasureUnitsManagerContainer as y } from "../../../shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js";
28
- import { ProductSelector as b } 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 "./index11.js";
9
+ import { RECEIVABLE_MESSAGE_LABELS_EN as o } from "./index12.js";
10
+ import { useReceivableActions as s } from "./index14.js";
11
+ import { useReceivableDetails as c } from "./index15.js";
12
+ import { hasSelectedText as l } from "../../../shared/product-catalog/feature/dist/lib/helpers.js";
29
13
  import "../../../shared/product-catalog/feature/dist/index.js";
30
- import { useReceivablesWidget as x } from "./index22.js";
31
- import { useEffect as S, useId as C, useState as w } from "react";
32
- import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
14
+ import { useReceivableForm as u } from "./index21.js";
15
+ import { useReceivablesTable as d } from "./index22.js";
16
+ import { useCallback as f, useEffect as p, useMemo as m, useState as h } from "react";
33
17
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js
34
- function O({ counterpartFormLabels: r, counterpartMessageLabels: s, defaultTab: O, detailsLabels: k, embeddedBankName: A, enabledTabs: j, formLabels: M, measureUnitDeleteLabels: N, measureUnitsLabels: P, messageLabels: F, onReceivableCreated: I, onReceivableOpened: L, onTemplateSettingsClick: R, pageSizeOptions: z = c, paymentLabels: B, productMessageLabels: V, screenLabels: H, sendLabels: U, actionLabels: W }) {
35
- let G = n();
36
- S(() => {
37
- G(o.Mounted);
38
- }, [G]);
39
- let K = x({
40
- counterpartMessageLabels: s,
41
- defaultTab: O,
42
- embeddedBankName: A,
43
- enabledTabs: j,
44
- messageLabels: F,
45
- onReceivableCreated: I,
46
- onReceivableOpened: L
47
- }), [q, J] = w(!1), Y = C(), X = C(), Z = C();
48
- return /* @__PURE__ */ D(T, { children: [
49
- /* @__PURE__ */ E(t, {}),
50
- /* @__PURE__ */ E(_, {
51
- rows: K.table.rows,
52
- activeTab: K.activeTab,
53
- enabledTabs: K.enabledTabs,
54
- onTabChange: K.setActiveTab,
55
- isLoading: K.table.isLoading,
56
- isError: K.table.isError,
57
- sorting: K.table.sorting,
58
- onSortingChange: K.table.onSortingChange,
59
- pageSize: K.table.pageSize,
60
- onPageSizeChange: K.table.onPageSizeChange,
61
- pageSizeOptions: z,
62
- hasNextPage: K.table.hasNextPage,
63
- hasPrevPage: K.table.hasPrevPage,
64
- onNextPage: K.table.onNextPage,
65
- onPrevPage: K.table.onPrevPage,
66
- searchValue: K.table.searchValue,
67
- onSearchChange: K.table.onSearchChange,
68
- statusFilter: K.table.statusFilter,
69
- statusOptions: K.table.statusOptions,
70
- onStatusFilterChange: K.table.onStatusFilterChange,
71
- isFiltering: K.table.isFiltering,
72
- onCreateClick: K.openCreate,
73
- onTemplateSettingsClick: R,
74
- onRowClick: K.handleRowClick,
75
- onActionClick: K.handleActionClick,
76
- onRetry: K.table.onRetry,
77
- labels: H
78
- }),
79
- /* @__PURE__ */ E(p, {
80
- open: K.form.open,
81
- onOpenChange: (e) => {
82
- e || K.form.close();
83
- },
84
- mode: K.form.mode,
85
- values: K.form.sheetValues,
86
- errors: K.form.errors,
87
- currencyOptions: K.form.currencyOptions,
88
- unitOptions: K.form.lineItemUnitOptions,
89
- currencySymbol: K.form.currencySymbol,
90
- lineItemControls: K.form.lineItemControls,
91
- autoFocusLineItemId: K.form.autoFocusLineItemId,
92
- lineItemsLoading: K.form.lineItemsLoading,
93
- inProgress: K.form.isSubmitting,
94
- customerSelector: /* @__PURE__ */ E(a, {
95
- mode: "customer",
96
- value: K.form.values.customerId || void 0,
97
- onValueChange: (e) => K.form.updateValues({ customerId: e }),
98
- onCreateClick: K.form.openCounterpartCreate
99
- }),
100
- renderProductSelector: (e, t) => /* @__PURE__ */ E(b, {
101
- ...t,
102
- inputValue: e.name,
103
- selectedProductId: K.form.values.lineItems.find((t) => t.id === e.id)?.productId || void 0,
104
- currency: K.form.values.currency,
105
- maxLength: 100,
106
- onInputValueChange: (t) => K.form.updateLineItem(e.id, { name: t }),
107
- onProductSelect: (t) => K.form.selectProduct(e.id, t)
108
- }),
109
- onChange: K.form.updateValues,
110
- onLineItemChange: K.form.updateLineItem,
111
- onLineItemCommit: K.form.commitLineItem,
112
- onLineItemQuantityStep: K.form.stepLineItem,
113
- onTaxRateCommit: K.form.commitTaxRate,
114
- onManageUnits: () => J(!0),
115
- onAddLineItem: K.form.addLineItem,
116
- onRemoveLineItem: K.form.removeLineItem,
117
- showDueDateField: K.form.showDueDateField,
118
- billingSection: K.form.showBillingSection && /* @__PURE__ */ E(d, {
119
- idPrefix: Y,
120
- paymentTerms: K.form.paymentTerms.view,
121
- paymentTermsError: K.form.errors.paymentTermsId,
122
- disabled: K.form.isSubmitting,
123
- onPaymentTermsChange: K.form.paymentTerms.select,
124
- onCustomDatePickerOpenChange: K.form.paymentTerms.changeCustomDatePickerOpen,
125
- customDateCalendar: /* @__PURE__ */ E(e, {
126
- mode: "single",
127
- captionLayout: "dropdown",
128
- ...K.form.paymentTerms.calendar,
129
- onSelect: K.form.paymentTerms.selectCustomDate
130
- }),
131
- labels: M
132
- }),
133
- remindersSection: K.form.reminders.view && /* @__PURE__ */ E(h, {
134
- idPrefix: Z,
135
- view: K.form.reminders.view,
136
- onToggle: K.form.reminders.toggle,
137
- onPaymentReminderSelect: K.form.reminders.selectPaymentReminder,
138
- onOverdueReminderSelect: K.form.reminders.selectOverdueReminder,
139
- onBeforeDueInputChange: K.form.reminders.changeBeforeDueInput,
140
- onBeforeDueSave: K.form.reminders.saveBeforeDue,
141
- onOverdueTermChange: K.form.reminders.changeOverdueTerm,
142
- onOverdueAddTerm: K.form.reminders.addOverdueTerm,
143
- onOverdueClear: K.form.reminders.clearOverdueTerms,
144
- onOverdueSave: K.form.reminders.saveOverdue,
145
- labels: M
146
- }),
147
- bankAccountSection: /* @__PURE__ */ E(u, {
148
- idPrefix: X,
149
- view: K.form.bankAccount.view,
150
- disabled: K.form.isSubmitting,
151
- onAccountSelect: K.form.bankAccount.selectAccount,
152
- onAddAccountClick: K.form.bankAccount.openAddAccount,
153
- onFormChange: K.form.bankAccount.updateAccountForm,
154
- onFormSave: K.form.bankAccount.saveAccount,
155
- onFormCancel: K.form.bankAccount.cancelAddAccount,
156
- labels: M
157
- }),
158
- attachmentsSection: K.form.attachmentsView && /* @__PURE__ */ E(v, {
159
- view: K.form.attachmentsView,
160
- disabled: K.form.isSubmitting,
161
- onFilesSelect: K.form.selectAttachmentFiles,
162
- onIncludeInEmailChange: K.form.setAttachmentIncludeInEmail,
163
- onRemove: K.form.removeAttachment,
164
- labels: M
165
- }),
166
- cancelDisabled: K.form.attachmentsUploading,
167
- saveDisabled: K.form.saveDisabled,
168
- onSubmit: K.form.submit,
169
- onCancel: K.form.close,
170
- labels: M
171
- }),
172
- /* @__PURE__ */ E(f, {
173
- open: K.detailsOpen,
174
- onOpenChange: (e) => {
175
- e || K.closeDetails();
176
- },
177
- details: K.details.detailsView,
178
- isLoading: K.details.isLoading,
179
- isError: K.details.isError,
180
- onActionClick: K.handleDetailsActionClick,
181
- onClose: K.closeDetails,
182
- labels: k
183
- }),
184
- /* @__PURE__ */ E(g, {
185
- open: K.actions.sendOpen,
186
- onOpenChange: (e) => {
187
- e || K.actions.closeSend();
188
- },
189
- values: K.actions.sendValues,
190
- errors: K.actions.sendErrors,
191
- inProgress: K.actions.sendInProgress,
192
- onChange: (e) => K.actions.setSendValues((t) => ({
193
- ...t,
194
- ...e
195
- })),
196
- onSubmit: K.actions.submitSend,
197
- onCancel: K.actions.closeSend,
198
- labels: U
199
- }),
200
- /* @__PURE__ */ E(m, {
201
- open: K.actions.paymentOpen,
202
- onOpenChange: (e) => {
203
- e || K.actions.closePayment();
204
- },
205
- values: K.actions.paymentValues,
206
- errors: K.actions.paymentErrors,
207
- inProgress: K.actions.paymentInProgress,
208
- onChange: (e) => K.actions.setPaymentValues((t) => ({
209
- ...t,
210
- ...e
211
- })),
212
- onSubmit: K.actions.submitPayment,
213
- onCancel: K.actions.closePayment,
214
- labels: B
215
- }),
216
- K.actions.actionDialog && /* @__PURE__ */ E(l, {
217
- open: !!K.actions.actionTarget,
218
- onOpenChange: (e) => {
219
- e || K.actions.closeAction();
220
- },
221
- title: K.actions.actionDialog.title,
222
- description: K.actions.actionDialog.description,
223
- confirmLabel: K.actions.actionDialog.confirmLabel,
224
- destructive: K.actions.actionDialog.destructive,
225
- error: K.actions.actionError,
226
- inProgress: K.actions.actionInProgress,
227
- onConfirm: K.actions.confirmAction,
228
- onCancel: K.actions.closeAction,
229
- labels: W
230
- }),
231
- /* @__PURE__ */ E(i, {
232
- open: K.form.counterpartView === "create",
233
- onOpenChange: (e) => {
234
- e || K.form.counterpartForm.close();
235
- },
236
- mode: "create",
237
- values: K.form.counterpartForm.values,
238
- errors: K.form.counterpartForm.errors,
239
- stateOptions: K.form.stateOptions,
240
- inProgress: K.form.counterpartForm.isSubmitting,
241
- onChange: (e) => K.form.counterpartForm.setValues((t) => ({
242
- ...t,
243
- ...e
244
- })),
245
- onAddressChange: (e) => K.form.counterpartForm.setValues((t) => ({
246
- ...t,
247
- address: {
248
- ...t.address,
249
- ...e
18
+ function g({ counterpartMessageLabels: g, defaultTab: _, embeddedBankName: v, enabledTabs: y, messageLabels: b, onReceivableCreated: x, onReceivableOpened: S }) {
19
+ let C = e();
20
+ p(() => {
21
+ C(t.Mounted);
22
+ }, [C]);
23
+ let w = m(() => ({
24
+ ...o,
25
+ ...b
26
+ }), [b]), T = m(() => n(y), [y]), [E, D] = h(() => r({
27
+ defaultTab: _,
28
+ enabledTabs: T
29
+ })), [O, k] = h(), [A, j] = h(!1);
30
+ p(() => {
31
+ T.includes(E) || D(r({
32
+ defaultTab: _,
33
+ enabledTabs: T
34
+ }));
35
+ }, [
36
+ E,
37
+ _,
38
+ T
39
+ ]);
40
+ let M = f((e, t) => {
41
+ D(i(t)), k(e), j(!0), x?.(e, t);
42
+ }, [x]), N = d({
43
+ activeTab: E,
44
+ messages: w
45
+ }), P = c({
46
+ selectedReceivableId: O,
47
+ enabled: A,
48
+ messages: w
49
+ }), F = u({
50
+ messages: w,
51
+ counterpartMessageLabels: g,
52
+ embeddedBankName: v,
53
+ onCreated: M
54
+ }), I = f(() => {
55
+ let e = a(E);
56
+ F.openCreate(e === "quote" ? "quote" : "invoice");
57
+ }, [E, F.openCreate]), L = s({
58
+ selectedReceivable: P.receivable,
59
+ messages: w,
60
+ onCreated: M,
61
+ onDeleted: (e) => {
62
+ e === O && (k(void 0), j(!1));
63
+ }
64
+ }), R = f((e) => {
65
+ l() || (k(e.id), j(!0), S?.(e.id, e.type));
66
+ }, [S]);
67
+ return {
68
+ activeTab: E,
69
+ enabledTabs: T,
70
+ setActiveTab: D,
71
+ table: N,
72
+ details: P,
73
+ detailsOpen: A,
74
+ closeDetails: f(() => {
75
+ j(!1), k(void 0);
76
+ }, []),
77
+ form: F,
78
+ openCreate: I,
79
+ actions: L,
80
+ handleRowClick: R,
81
+ handleActionClick: f((e, t) => {
82
+ let n = N.getReceivableById(t.id);
83
+ if (e === "edit") {
84
+ if (n) {
85
+ F.openEdit(n);
86
+ return;
250
87
  }
251
- })),
252
- onSubmit: K.form.counterpartForm.submit,
253
- onCancel: K.form.counterpartForm.close,
254
- labels: r
255
- }),
256
- /* @__PURE__ */ E(y, {
257
- open: q,
258
- onClose: () => J(!1),
259
- managerLabels: P,
260
- deleteLabels: N,
261
- messageLabels: V
262
- })
263
- ] });
264
- }
265
- function k({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
266
- return /* @__PURE__ */ E(r, {
267
- widgetName: s,
268
- baseUrl: e,
269
- widgetToken: t,
270
- organizationId: n,
271
- configClient: i,
272
- gatewayRouting: a,
273
- linkComponent: o,
274
- implementation: c,
275
- uiFramework: l,
276
- errorFallback: u,
277
- onError: d,
278
- analytics: f,
279
- disclosuresAcceptance: p,
280
- providerLabels: m,
281
- children: /* @__PURE__ */ E(O, { ...h })
282
- });
88
+ k(t.id), j(!0);
89
+ return;
90
+ }
91
+ k(t.id), L.openAction(e, t, n ?? null);
92
+ }, [
93
+ L,
94
+ F.openEdit,
95
+ N.getReceivableById
96
+ ]),
97
+ handleDetailsActionClick: f((e, t) => {
98
+ if (e === "edit") {
99
+ P.receivable && (F.openEdit(P.receivable), j(!1));
100
+ return;
101
+ }
102
+ L.openAction(e, {
103
+ id: t.id,
104
+ title: t.title,
105
+ type: t.type
106
+ }, P.receivable ?? null);
107
+ }, [
108
+ L,
109
+ P.receivable,
110
+ F.openEdit
111
+ ])
112
+ };
283
113
  }
284
114
  //#endregion
285
- export { k as ReceivablesWidget, k as default };
115
+ export { g as useReceivablesWidget };
@@ -0,0 +1,288 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { Calendar as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { EmbeddedToaster as t } from "../../../shared/ui/dist/lib/EmbeddedToaster.js";
7
+ import "../../../shared/ui/dist/index.js";
8
+ import { useAnalyticsTrack as n } from "../../../shared/feature/dist/lib/analytics/hooks.js";
9
+ import { WidgetProvider as r } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
10
+ import "../../../shared/feature/dist/index.js";
11
+ import { CounterpartFormSheet as i } from "../../../shared/counterpart-management/ui/dist/index9.js";
12
+ import { CounterpartSelector as a } from "../../../shared/counterpart-management/feature/dist/lib/CounterpartSelector.js";
13
+ import "../../../shared/counterpart-management/feature/dist/index.js";
14
+ import { ReceivablesWidgetAnalyticsEvent as o, WIDGET_NAME as s } from "./index2.js";
15
+ import { PAGE_SIZE_OPTIONS as c } from "./index4.js";
16
+ import { ReceivableActionDialog as l } from "../../ui/dist/index4.js";
17
+ import { ReceivableBankAccountSection as u } from "../../ui/dist/index5.js";
18
+ import { ReceivableBillingSection as d } from "../../ui/dist/index10.js";
19
+ import { ReceivableDetailsSheet as f } from "../../ui/dist/index21.js";
20
+ import { ReceivableFormSheet as p } from "../../ui/dist/index24.js";
21
+ import { ReceivablePaymentDialog as m } from "../../ui/dist/index25.js";
22
+ import { ReceivableRemindersSection as h } from "../../ui/dist/index26.js";
23
+ import { ReceivableSendDialog as g } from "../../ui/dist/index27.js";
24
+ import { ReceivablesScreen as _ } from "../../ui/dist/index28.js";
25
+ import "../../ui/dist/index.js";
26
+ import { ReceivableAttachmentsSection as v } from "./index5.js";
27
+ import { MeasureUnitsManagerContainer as y } from "../../../shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js";
28
+ import { ProductSelector as b } from "../../../shared/product-catalog/feature/dist/lib/ProductSelector.js";
29
+ import "../../../shared/product-catalog/feature/dist/index.js";
30
+ import { useReceivablesWidget as x } from "./index23.js";
31
+ import { useEffect as S, useId as C, useState as w } from "react";
32
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
33
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js
34
+ function O({ counterpartFormLabels: r, counterpartMessageLabels: s, defaultTab: O, detailsLabels: k, embeddedBankName: A, enabledTabs: j, formLabels: M, measureUnitDeleteLabels: N, measureUnitsLabels: P, messageLabels: F, onReceivableCreated: I, onReceivableOpened: L, onTemplateSettingsClick: R, pageSizeOptions: z = c, paymentLabels: B, productMessageLabels: V, screenLabels: H, sendLabels: U, actionLabels: W }) {
35
+ let G = n();
36
+ S(() => {
37
+ G(o.Mounted);
38
+ }, [G]);
39
+ let K = x({
40
+ counterpartMessageLabels: s,
41
+ defaultTab: O,
42
+ embeddedBankName: A,
43
+ enabledTabs: j,
44
+ messageLabels: F,
45
+ onReceivableCreated: I,
46
+ onReceivableOpened: L
47
+ }), [q, J] = w(!1), Y = C(), X = C(), Z = C();
48
+ return /* @__PURE__ */ D(T, { children: [
49
+ /* @__PURE__ */ E(t, {}),
50
+ /* @__PURE__ */ E(_, {
51
+ rows: K.table.rows,
52
+ activeTab: K.activeTab,
53
+ enabledTabs: K.enabledTabs,
54
+ onTabChange: K.setActiveTab,
55
+ isLoading: K.table.isLoading,
56
+ isError: K.table.isError,
57
+ sorting: K.table.sorting,
58
+ onSortingChange: K.table.onSortingChange,
59
+ pageSize: K.table.pageSize,
60
+ onPageSizeChange: K.table.onPageSizeChange,
61
+ pageSizeOptions: z,
62
+ hasNextPage: K.table.hasNextPage,
63
+ hasPrevPage: K.table.hasPrevPage,
64
+ onNextPage: K.table.onNextPage,
65
+ onPrevPage: K.table.onPrevPage,
66
+ searchValue: K.table.searchValue,
67
+ onSearchChange: K.table.onSearchChange,
68
+ statusFilter: K.table.statusFilter,
69
+ statusOptions: K.table.statusOptions,
70
+ onStatusFilterChange: K.table.onStatusFilterChange,
71
+ isFiltering: K.table.isFiltering,
72
+ onCreateClick: K.openCreate,
73
+ onTemplateSettingsClick: R,
74
+ onRowClick: K.handleRowClick,
75
+ onActionClick: K.handleActionClick,
76
+ onRetry: K.table.onRetry,
77
+ labels: H
78
+ }),
79
+ /* @__PURE__ */ E(p, {
80
+ open: K.form.open,
81
+ onOpenChange: (e) => {
82
+ e || K.form.close();
83
+ },
84
+ mode: K.form.mode,
85
+ values: K.form.sheetValues,
86
+ errors: K.form.errors,
87
+ currencyOptions: K.form.currencyOptions,
88
+ unitOptions: K.form.lineItemUnitOptions,
89
+ currencySymbol: K.form.currencySymbol,
90
+ lineItemControls: K.form.lineItemControls,
91
+ autoFocusLineItemId: K.form.autoFocusLineItemId,
92
+ lineItemsLoading: K.form.lineItemsLoading,
93
+ inProgress: K.form.isSubmitting,
94
+ customerSelector: /* @__PURE__ */ E(a, {
95
+ mode: "customer",
96
+ value: K.form.values.customerId || void 0,
97
+ onValueChange: (e) => K.form.updateValues({ customerId: e }),
98
+ onCreateClick: K.form.openCounterpartCreate
99
+ }),
100
+ renderProductSelector: (e, t) => /* @__PURE__ */ E(b, {
101
+ ...t,
102
+ inputValue: e.name,
103
+ selectedProductId: K.form.values.lineItems.find((t) => t.id === e.id)?.productId || void 0,
104
+ currency: K.form.values.currency,
105
+ maxLength: 100,
106
+ onInputValueChange: (t) => K.form.updateLineItem(e.id, { name: t }),
107
+ onProductSelect: (t) => K.form.selectProduct(e.id, t)
108
+ }),
109
+ onChange: K.form.updateValues,
110
+ onLineItemChange: K.form.updateLineItem,
111
+ onLineItemCommit: K.form.commitLineItem,
112
+ onLineItemQuantityStep: K.form.stepLineItem,
113
+ onTaxRateCommit: K.form.commitTaxRate,
114
+ onDiscountFocus: K.form.focusDiscount,
115
+ onDiscountCommit: K.form.commitDiscount,
116
+ totals: K.form.totalsView,
117
+ onManageUnits: () => J(!0),
118
+ onAddLineItem: K.form.addLineItem,
119
+ onRemoveLineItem: K.form.removeLineItem,
120
+ showDueDateField: K.form.showDueDateField,
121
+ billingSection: K.form.showBillingSection && /* @__PURE__ */ E(d, {
122
+ idPrefix: Y,
123
+ paymentTerms: K.form.paymentTerms.view,
124
+ paymentTermsError: K.form.errors.paymentTermsId,
125
+ disabled: K.form.isSubmitting,
126
+ onPaymentTermsChange: K.form.paymentTerms.select,
127
+ onCustomDatePickerOpenChange: K.form.paymentTerms.changeCustomDatePickerOpen,
128
+ customDateCalendar: /* @__PURE__ */ E(e, {
129
+ mode: "single",
130
+ captionLayout: "dropdown",
131
+ ...K.form.paymentTerms.calendar,
132
+ onSelect: K.form.paymentTerms.selectCustomDate
133
+ }),
134
+ labels: M
135
+ }),
136
+ remindersSection: K.form.reminders.view && /* @__PURE__ */ E(h, {
137
+ idPrefix: Z,
138
+ view: K.form.reminders.view,
139
+ onToggle: K.form.reminders.toggle,
140
+ onPaymentReminderSelect: K.form.reminders.selectPaymentReminder,
141
+ onOverdueReminderSelect: K.form.reminders.selectOverdueReminder,
142
+ onBeforeDueInputChange: K.form.reminders.changeBeforeDueInput,
143
+ onBeforeDueSave: K.form.reminders.saveBeforeDue,
144
+ onOverdueTermChange: K.form.reminders.changeOverdueTerm,
145
+ onOverdueAddTerm: K.form.reminders.addOverdueTerm,
146
+ onOverdueClear: K.form.reminders.clearOverdueTerms,
147
+ onOverdueSave: K.form.reminders.saveOverdue,
148
+ labels: M
149
+ }),
150
+ bankAccountSection: /* @__PURE__ */ E(u, {
151
+ idPrefix: X,
152
+ view: K.form.bankAccount.view,
153
+ disabled: K.form.isSubmitting,
154
+ onAccountSelect: K.form.bankAccount.selectAccount,
155
+ onAddAccountClick: K.form.bankAccount.openAddAccount,
156
+ onFormChange: K.form.bankAccount.updateAccountForm,
157
+ onFormSave: K.form.bankAccount.saveAccount,
158
+ onFormCancel: K.form.bankAccount.cancelAddAccount,
159
+ labels: M
160
+ }),
161
+ attachmentsSection: K.form.attachmentsView && /* @__PURE__ */ E(v, {
162
+ view: K.form.attachmentsView,
163
+ disabled: K.form.isSubmitting,
164
+ onFilesSelect: K.form.selectAttachmentFiles,
165
+ onIncludeInEmailChange: K.form.setAttachmentIncludeInEmail,
166
+ onRemove: K.form.removeAttachment,
167
+ labels: M
168
+ }),
169
+ cancelDisabled: K.form.attachmentsUploading,
170
+ saveDisabled: K.form.saveDisabled,
171
+ onSubmit: K.form.submit,
172
+ onCancel: K.form.close,
173
+ labels: M
174
+ }),
175
+ /* @__PURE__ */ E(f, {
176
+ open: K.detailsOpen,
177
+ onOpenChange: (e) => {
178
+ e || K.closeDetails();
179
+ },
180
+ details: K.details.detailsView,
181
+ isLoading: K.details.isLoading,
182
+ isError: K.details.isError,
183
+ onActionClick: K.handleDetailsActionClick,
184
+ onClose: K.closeDetails,
185
+ labels: k
186
+ }),
187
+ /* @__PURE__ */ E(g, {
188
+ open: K.actions.sendOpen,
189
+ onOpenChange: (e) => {
190
+ e || K.actions.closeSend();
191
+ },
192
+ values: K.actions.sendValues,
193
+ errors: K.actions.sendErrors,
194
+ inProgress: K.actions.sendInProgress,
195
+ onChange: (e) => K.actions.setSendValues((t) => ({
196
+ ...t,
197
+ ...e
198
+ })),
199
+ onSubmit: K.actions.submitSend,
200
+ onCancel: K.actions.closeSend,
201
+ labels: U
202
+ }),
203
+ /* @__PURE__ */ E(m, {
204
+ open: K.actions.paymentOpen,
205
+ onOpenChange: (e) => {
206
+ e || K.actions.closePayment();
207
+ },
208
+ values: K.actions.paymentValues,
209
+ errors: K.actions.paymentErrors,
210
+ inProgress: K.actions.paymentInProgress,
211
+ onChange: (e) => K.actions.setPaymentValues((t) => ({
212
+ ...t,
213
+ ...e
214
+ })),
215
+ onSubmit: K.actions.submitPayment,
216
+ onCancel: K.actions.closePayment,
217
+ labels: B
218
+ }),
219
+ K.actions.actionDialog && /* @__PURE__ */ E(l, {
220
+ open: !!K.actions.actionTarget,
221
+ onOpenChange: (e) => {
222
+ e || K.actions.closeAction();
223
+ },
224
+ title: K.actions.actionDialog.title,
225
+ description: K.actions.actionDialog.description,
226
+ confirmLabel: K.actions.actionDialog.confirmLabel,
227
+ destructive: K.actions.actionDialog.destructive,
228
+ error: K.actions.actionError,
229
+ inProgress: K.actions.actionInProgress,
230
+ onConfirm: K.actions.confirmAction,
231
+ onCancel: K.actions.closeAction,
232
+ labels: W
233
+ }),
234
+ /* @__PURE__ */ E(i, {
235
+ open: K.form.counterpartView === "create",
236
+ onOpenChange: (e) => {
237
+ e || K.form.counterpartForm.close();
238
+ },
239
+ mode: "create",
240
+ values: K.form.counterpartForm.values,
241
+ errors: K.form.counterpartForm.errors,
242
+ stateOptions: K.form.stateOptions,
243
+ inProgress: K.form.counterpartForm.isSubmitting,
244
+ onChange: (e) => K.form.counterpartForm.setValues((t) => ({
245
+ ...t,
246
+ ...e
247
+ })),
248
+ onAddressChange: (e) => K.form.counterpartForm.setValues((t) => ({
249
+ ...t,
250
+ address: {
251
+ ...t.address,
252
+ ...e
253
+ }
254
+ })),
255
+ onSubmit: K.form.counterpartForm.submit,
256
+ onCancel: K.form.counterpartForm.close,
257
+ labels: r
258
+ }),
259
+ /* @__PURE__ */ E(y, {
260
+ open: q,
261
+ onClose: () => J(!1),
262
+ managerLabels: P,
263
+ deleteLabels: N,
264
+ messageLabels: V
265
+ })
266
+ ] });
267
+ }
268
+ function k({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
269
+ return /* @__PURE__ */ E(r, {
270
+ widgetName: s,
271
+ baseUrl: e,
272
+ widgetToken: t,
273
+ organizationId: n,
274
+ configClient: i,
275
+ gatewayRouting: a,
276
+ linkComponent: o,
277
+ implementation: c,
278
+ uiFramework: l,
279
+ errorFallback: u,
280
+ onError: d,
281
+ analytics: f,
282
+ disclosuresAcceptance: p,
283
+ providerLabels: m,
284
+ children: /* @__PURE__ */ E(O, { ...h })
285
+ });
286
+ }
287
+ //#endregion
288
+ export { k as ReceivablesWidget, k as default };