@tesouro/embedded-components-react 0.5.152 → 0.5.153

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 (62) hide show
  1. package/dist/lib/monite-sdk.d.ts +2 -44
  2. package/dist/lib/monite-sdk.js +9 -12
  3. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +10 -13
  4. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index21.js +0 -7
  5. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index22.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index353.js +1 -2
  7. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index373.js +8 -12
  8. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index379.js +1 -5
  9. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index413.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index552.js +21 -13
  11. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index553.js +72 -22
  12. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index554.js +19 -1
  13. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index555.js +20 -21
  14. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index556.js +5 -51
  15. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index557.js +10 -64
  16. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index558.js +11 -167
  17. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index559.js +133 -1
  18. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index560.js +5 -184
  19. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index561.js +8 -1
  20. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index562.js +3 -41
  21. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index563.js +221 -4
  22. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index564.js +11 -21
  23. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index565.js +33 -74
  24. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index566.js +180 -15
  25. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index567.js +201 -17
  26. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index568.js +98 -4
  27. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index569.js +63 -9
  28. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index570.js +55 -11
  29. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index571.js +89 -128
  30. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index572.js +40 -5
  31. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index573.js +75 -4
  32. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index574.js +87 -5
  33. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index575.js +12 -220
  34. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index576.js +23 -11
  35. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index577.js +17 -36
  36. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index578.js +5 -184
  37. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index579.js +20 -202
  38. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index580.js +1 -102
  39. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index581.js +60 -66
  40. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index582.js +28 -53
  41. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index583.js +2 -92
  42. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index584.js +33 -40
  43. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index585.js +14 -75
  44. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index586.js +28 -82
  45. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index587.js +28 -11
  46. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index588.js +2 -26
  47. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index589.js +97 -17
  48. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/MoniteWrapper.js +1 -1
  50. package/package.json +1 -1
  51. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index590.js +0 -5
  52. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index591.js +0 -24
  53. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index592.js +0 -1
  54. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index593.js +0 -64
  55. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index594.js +0 -32
  56. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index595.js +0 -4
  57. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index596.js +0 -36
  58. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index597.js +0 -18
  59. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index598.js +0 -33
  60. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index599.js +0 -31
  61. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index600.js +0 -2
  62. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index601.js +0 -97
@@ -5,8 +5,7 @@ var t = (t) => {
5
5
  return {
6
6
  optionalFields: t?.optionalFields ?? n?.payables?.optionalFields,
7
7
  ocrRequiredFields: t?.ocrRequiredFields ?? n?.payables?.ocrRequiredFields,
8
- ocrMismatchFields: t?.ocrMismatchFields ?? n?.payables?.ocrMismatchFields,
9
- isTagsDisabled: t?.isTagsDisabled ?? n?.payables?.isTagsDisabled
8
+ ocrMismatchFields: t?.ocrMismatchFields ?? n?.payables?.ocrMismatchFields
10
9
  };
11
10
  };
12
11
  //#endregion
@@ -21,7 +21,6 @@ var u = (e) => o(e, "yyyy-MM-dd"), d = (e, t, n, r) => {
21
21
  invoiceDate: void 0,
22
22
  dueDate: void 0,
23
23
  currency: "USD",
24
- tags: [],
25
24
  discount: null,
26
25
  lineItems: [{
27
26
  id: "",
@@ -31,7 +30,7 @@ var u = (e) => o(e, "yyyy-MM-dd"), d = (e, t, n, r) => {
31
30
  tax: 0
32
31
  }]
33
32
  };
34
- let { document_id: i, counterpart_id: a, counterpart_bank_account_id: o, issued_at: s, due_date: c, currency: u, tags: d, discount: f } = t;
33
+ let { document_id: i, counterpart_id: a, counterpart_bank_account_id: o, issued_at: s, due_date: c, currency: u, discount: d } = t;
35
34
  return {
36
35
  invoiceNumber: i ?? "",
37
36
  counterpart: a ?? "",
@@ -39,8 +38,7 @@ var u = (e) => o(e, "yyyy-MM-dd"), d = (e, t, n, r) => {
39
38
  invoiceDate: s ? l(s) : void 0,
40
39
  dueDate: c ? l(c) : void 0,
41
40
  currency: u ?? "USD",
42
- tags: d ?? [],
43
- discount: f && u ? e(f, u) : null,
41
+ discount: d && u ? e(d, u) : null,
44
42
  lineItems: (n || []).map((t) => ({
45
43
  id: t.id ?? "",
46
44
  name: t.name ?? "",
@@ -50,19 +48,18 @@ var u = (e) => o(e, "yyyy-MM-dd"), d = (e, t, n, r) => {
50
48
  ledger_account_id: t.ledger_account_id
51
49
  }))
52
50
  };
53
- }, f = ({ discount: e, invoiceNumber: t, counterpart: n, counterpartBankAccount: r, invoiceDate: i, dueDate: a, currency: o, tags: s, counterpartAddressId: c }, l, d) => ({
51
+ }, f = ({ discount: e, invoiceNumber: t, counterpart: n, counterpartBankAccount: r, invoiceDate: i, dueDate: a, currency: o, counterpartAddressId: s }, c, l) => ({
54
52
  document_id: t,
55
- discount: e && o ? l(e, o) ?? 0 : 0,
53
+ discount: e && o ? c(e, o) ?? 0 : 0,
56
54
  counterpart_id: n || void 0,
57
55
  counterpart_bank_account_id: r || void 0,
58
56
  issued_at: i instanceof Date ? u(i) : void 0,
59
57
  due_date: a instanceof Date ? u(a) : void 0,
60
58
  currency: o,
61
- tag_ids: s.map((e) => e.id),
62
- counterpart_address_id: c,
63
- subtotal: o ? l(d.subtotal, o) ?? 0 : void 0,
64
- tax_amount: o ? l(d.taxes, o) ?? 0 : void 0,
65
- total_amount: o ? l(d.total + (e ?? 0), o) ?? 0 : void 0
59
+ counterpart_address_id: s,
60
+ subtotal: o ? c(l.subtotal, o) ?? 0 : void 0,
61
+ tax_amount: o ? c(l.taxes, o) ?? 0 : void 0,
62
+ total_amount: o ? c(l.total + (e ?? 0), o) ?? 0 : void 0
66
63
  }), p = (e, t) => {
67
64
  let n = e * t;
68
65
  return parseFloat(n.toFixed(2));
@@ -112,7 +109,6 @@ var b = (e, t, n) => {
112
109
  let r = {
113
110
  invoiceNumber: !0,
114
111
  dueDate: !0,
115
- tags: !0,
116
112
  currency: !0
117
113
  };
118
114
  if (n) return !1;
@@ -9,10 +9,7 @@ var n = (e, t) => !!t?.required_fields?.includes(e), r = (n) => {
9
9
  price: t.coerce.number().min(0, n._("Item price cannot be negative")).meta({ title: n._("Price") }),
10
10
  tax: t.coerce.number().min(0, n._("Item tax cannot be negative")).max(100, n._("Item tax cannot exceed 100%")).meta({ title: n._("Tax") }),
11
11
  ledger_account_id: t.string().nullable().optional().meta({ title: n._("GL Code") })
12
- })).meta({ title: n._("Line Items") }), i = t.object({
13
- id: t.string(),
14
- name: t.string()
15
- }).loose().meta({ title: n._("Tag") });
12
+ })).meta({ title: n._("Line Items") });
16
13
  return t.object({
17
14
  invoiceNumber: t.string().min(1, n._("Invoice Number is required")).meta({ title: n._("Invoice Number") }),
18
15
  counterpart: t.string().meta({ title: n._("Vendor") }),
@@ -20,7 +17,6 @@ var n = (e, t) => !!t?.required_fields?.includes(e), r = (n) => {
20
17
  invoiceDate: t.preprocess((e) => e === null ? void 0 : e, t.date()).optional().meta({ title: n._("Invoice Date") }),
21
18
  dueDate: t.preprocess((e) => e === null ? void 0 : e, t.date()).optional().meta({ title: n._("Due Date") }),
22
19
  currency: e(n).optional().meta({ title: n._("Currency") }),
23
- tags: t.array(i).meta({ title: n._("Tags") }),
24
20
  lineItems: r,
25
21
  discount: t.union([t.coerce.number().min(0), t.null()]).optional().meta({ title: n._("Discount") })
26
22
  });
@@ -1,7 +1,7 @@
1
1
  import { Suspense as e, lazy as t, useEffect as n, useState as r } from "react";
2
2
  import { jsx as i } from "@emotion/react/jsx-runtime";
3
3
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index413.js
4
- var a = t(() => import("./index601.js")), o = ({ url: e, mimetype: t, name: n, showCloseButton: r, onClose: a }) => t === "application/pdf" ? /* @__PURE__ */ i(s, {
4
+ var a = t(() => import("./index589.js")), o = ({ url: e, mimetype: t, name: n, showCloseButton: r, onClose: a }) => t === "application/pdf" ? /* @__PURE__ */ i(s, {
5
5
  url: e,
6
6
  showCloseButton: r,
7
7
  onClose: a
@@ -1,16 +1,24 @@
1
- import { useEntityUserById as e } from "./index135.js";
2
- import "./index144.js";
3
- import { jsx as t } from "@emotion/react/jsx-runtime";
4
- import { Skeleton as n } from "@mui/material";
1
+ import { jsx as e } from "@emotion/react/jsx-runtime";
2
+ import { Box as t, useTheme as n } from "@mui/material";
5
3
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index552.js
6
- var r = ({ id: r }) => {
7
- let { data: i, isLoading: a } = e(r);
8
- return /* @__PURE__ */ t("span", { children: a ? /* @__PURE__ */ t(n, {
9
- animation: "wave",
10
- height: 10,
11
- width: "100%",
12
- sx: { minWidth: "4em" }
13
- }) : !!i && `${i?.first_name || ""} ${i?.last_name || ""}` });
4
+ var r = ({ children: r, shouldApplyFinanceStyles: i = !1 }) => {
5
+ let a = n();
6
+ return /* @__PURE__ */ e(t, {
7
+ sx: {
8
+ background: `linear-gradient(180deg, ${a.palette.primary.light} 0%, ${a.palette.background.paper} 100%)`,
9
+ display: "flex",
10
+ flexDirection: "column",
11
+ gap: 1,
12
+ px: 3,
13
+ py: i ? 3 : 2.5,
14
+ width: "100%",
15
+ minHeight: "auto",
16
+ borderRadius: "16px",
17
+ boxShadow: "0 16px 24px 0 rgba(0, 0, 0, 0.02)",
18
+ border: i ? "none" : `1px solid ${a.palette.divider}`
19
+ },
20
+ children: r
21
+ });
14
22
  };
15
23
  //#endregion
16
- export { r as UserCell };
24
+ export { r as FinanceBannerWrapper };
@@ -1,27 +1,77 @@
1
- import { useMoniteContext as e } from "./index46.js";
2
- import { MoniteScopedProviders as t } from "./index241.js";
3
- import { ConfirmationModal as n } from "./index58.js";
4
- import "./index59.js";
5
- import { jsx as r } from "@emotion/react/jsx-runtime";
6
- import { toast as i } from "react-hot-toast";
1
+ import { jsx as e, jsxs as t } from "@emotion/react/jsx-runtime";
2
+ import { Box as n, Link as r, Typography as i } from "@mui/material";
7
3
  import { useLingui as a } from "@lingui/react";
8
4
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index553.js
9
- var o = (e) => /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(s, { ...e }) }), s = ({ tag: t, onClose: o, onDelete: s, modalOpened: c }) => {
10
- let { i18n: l } = a(), u = t?.id, { api: d, queryClient: f } = e(), p = d.finops.deleteTagsId.useMutation({ path: { tag_id: u ?? "" } }, { onSuccess: () => (d.finops.getTagsId.removeQueries({ parameters: { path: { tag_id: u } } }, f), d.finops.getTags.invalidateQueries(f)) });
11
- return /* @__PURE__ */ r(n, {
12
- open: c,
13
- title: l._("Delete “{tagName}” tag?", { tagName: t.name }),
14
- message: l._("This action can’t be undone."),
15
- confirmLabel: l._("Delete"),
16
- cancelLabel: l._("Cancel"),
17
- onClose: o,
18
- onConfirm: () => {
19
- p.mutate(void 0, { onSuccess: () => {
20
- i.success(l._("Tag “{tagName}” was deleted", { tagName: t.name })), o?.(), s?.(t.id);
21
- } });
22
- },
23
- isLoading: p.isPending
5
+ var o = [
6
+ {
7
+ id: 1,
8
+ question: "Does enrolling in the program affect my credit score?",
9
+ answer: "Nope! During the onboarding process we will only conduct a soft pull on your credit report, which will not affect your personal credit score."
10
+ },
11
+ {
12
+ id: 2,
13
+ question: "Why do I need to provide my bank connection details?",
14
+ answer: "Securely connecting your business bank account allows us to review your cashflow and determine your best loan offers."
15
+ },
16
+ {
17
+ id: 3,
18
+ question: "When should I expect to receive a loan offer?",
19
+ answer: "Once you are enrolled into the program, we will be actively analyzing your financials and creating pre-approved offers that work best for your business needs. We do this to help you avoid debt trap. Loan offers are usually provided within less than 48 hours."
20
+ },
21
+ {
22
+ id: 4,
23
+ question: "How do I repay the loan?",
24
+ answer: "At the moment we support monthly loan repayment once you agree to the loan payment schedule. A fixed amount will be automatically deducted from the bank you linked during the onboarding.In the near future, you can also choose to pay back the loan as a fixed percentage of your daily sales until the loan is fully repaid."
25
+ }
26
+ ], s = () => {
27
+ let { i18n: s } = a();
28
+ return /* @__PURE__ */ t(n, {
29
+ p: 4,
30
+ children: [
31
+ /* @__PURE__ */ t(n, { children: [/* @__PURE__ */ e(i, {
32
+ variant: "h3",
33
+ children: s._("Simplified, fast funding for your growing business")
34
+ }), /* @__PURE__ */ e(i, {
35
+ variant: "subtitle2",
36
+ mt: 2,
37
+ children: s._("Get your business moving and accelerate growth with quick and easy access to funding. Multiple options available.")
38
+ })] }),
39
+ /* @__PURE__ */ t(n, {
40
+ mt: 5,
41
+ children: [/* @__PURE__ */ e(i, {
42
+ mb: 1,
43
+ variant: "h3",
44
+ children: s._("FAQ")
45
+ }), o.map((r) => /* @__PURE__ */ t(n, {
46
+ mt: 3,
47
+ children: [/* @__PURE__ */ e(i, {
48
+ variant: "subtitle2",
49
+ children: s._("{faqQuestion}", { faqQuestion: r.question })
50
+ }), /* @__PURE__ */ e(i, {
51
+ variant: "body1",
52
+ mt: 1,
53
+ children: s._("{faqAnswer}", { faqAnswer: r.answer })
54
+ })]
55
+ }, r.id))]
56
+ }),
57
+ /* @__PURE__ */ e(n, {
58
+ mt: 5,
59
+ children: /* @__PURE__ */ t(i, {
60
+ variant: "body2",
61
+ children: [
62
+ s._("All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon"),
63
+ " ",
64
+ /* @__PURE__ */ e(r, {
65
+ target: "_blank",
66
+ rel: "noopener noreferrer",
67
+ href: "https://kanmon.com",
68
+ children: s._("here.")
69
+ })
70
+ ]
71
+ })
72
+ })
73
+ ]
24
74
  });
25
75
  };
26
76
  //#endregion
27
- export { o as ConfirmDeleteModal };
77
+ export { s as FinanceFaqDetails };
@@ -1 +1,19 @@
1
- import "./index553.js";
1
+ import { Dialog as e } from "./index234.js";
2
+ import "./index235.js";
3
+ import { FinanceFaqDetails as t } from "./index553.js";
4
+ import { useState as n } from "react";
5
+ import { Fragment as r, jsx as i, jsxs as a } from "@emotion/react/jsx-runtime";
6
+ //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index554.js
7
+ var o = ({ children: o }) => {
8
+ let [s, c] = n(!1);
9
+ return /* @__PURE__ */ a(r, { children: [o({ openModal: () => {
10
+ c(!0);
11
+ } }), /* @__PURE__ */ i(e, {
12
+ open: s,
13
+ onClose: () => c(!1),
14
+ alignDialog: "right",
15
+ children: /* @__PURE__ */ i(t, {})
16
+ })] });
17
+ };
18
+ //#endregion
19
+ export { o as FinanceFaqWrapper };
@@ -1,23 +1,22 @@
1
+ import { jsx as e } from "@emotion/react/jsx-runtime";
2
+ import { Box as t, useTheme as n } from "@mui/material";
1
3
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index555.js
2
- var e = [
3
- "document_type",
4
- "department",
5
- "project",
6
- "cost_center",
7
- "vendor_type",
8
- "payment_method",
9
- "approval_status"
10
- ], t = (e) => ({
11
- document_type: e._("Document Type"),
12
- department: e._("Department"),
13
- project: e._("Project"),
14
- cost_center: e._("Cost Center"),
15
- vendor_type: e._("Vendor Type"),
16
- payment_method: e._("Payment Method"),
17
- approval_status: e._("Approval Status")
18
- });
19
- function n(e, n) {
20
- return e ? t(n)[e] : "";
21
- }
4
+ var r = ({ progress: r }) => {
5
+ let i = n();
6
+ return /* @__PURE__ */ e(t, {
7
+ sx: {
8
+ backgroundColor: i.palette.divider,
9
+ width: "100%",
10
+ height: "6px",
11
+ borderRadius: .5
12
+ },
13
+ children: /* @__PURE__ */ e(t, { sx: {
14
+ backgroundColor: i.palette.primary.main,
15
+ width: `${r}%`,
16
+ height: "6px",
17
+ borderRadius: .5
18
+ } })
19
+ });
20
+ };
22
21
  //#endregion
23
- export { n as getTagCategoryLabel, e as tagCategories };
22
+ export { r as FinanceProgressBar };
@@ -1,54 +1,8 @@
1
- import { getAPIErrorMessage as e } from "./index27.js";
2
- import { useMoniteContext as t } from "./index46.js";
3
- import { useEntitySettings as n, usePatchEntitiesIdSettings as r } from "./index142.js";
4
- import "./index144.js";
5
- import { toast as i } from "react-hot-toast";
6
- import { useLingui as a } from "@lingui/react";
1
+ import { useMoniteContext as e } from "./index46.js";
7
2
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index556.js
8
- var o = ({ setNameError: o, onTagCreated: s, onTagUpdated: c }) => {
9
- let { i18n: l } = a(), { api: u, queryClient: d } = t(), { data: f } = n(), { mutateAsync: p } = r(), m = f?.payables_ocr_auto_tagging || [], h = u.finops.postTags.useMutation({}, {
10
- onSuccess: () => u.finops.getTags.invalidateQueries(d),
11
- onError: (t) => {
12
- let n = e(l, t);
13
- n === "This tag already exists." ? o?.(n) : i.error(n);
14
- }
15
- }), g = u.finops.patchTagsId.useMutation(void 0, {
16
- onSuccess: (e) => {
17
- Promise.all([u.finops.getTags.invalidateQueries(d), u.finops.getTagsId.invalidateQueries({ parameters: { path: { tag_id: e.id } } }, d)]), c?.(e);
18
- },
19
- onError: (t) => {
20
- i.error(e(l, t));
21
- }
22
- });
23
- return {
24
- tagsWithKeywords: Object.fromEntries(m.map((e) => [e.tag_id, e.keywords])),
25
- inProgress: h.isPending || g.isPending,
26
- createTag: (e) => h.mutateAsync({ ...e }, { onSuccess: (e) => s?.(e) }),
27
- updateTag: (e, t) => g.mutateAsync({
28
- path: { tag_id: e },
29
- body: t
30
- }),
31
- updateOcrAutoTagging: (e, t = []) => {
32
- let n = m.filter((t) => t.tag_id !== e);
33
- if (n.length === m.length && !t.length) return;
34
- let r = t.length ? [...n, {
35
- tag_id: e,
36
- keywords: [...new Set(t)],
37
- enabled: !0
38
- }] : n;
39
- r.length && p({
40
- tax_mode: f.tax_mode,
41
- payment_priority: f.payment_priority,
42
- quote_signature_required: f.quote_signature_required,
43
- receivable_edit_flow: f.receivable_edit_flow,
44
- allow_purchase_order_autolinking: f.allow_purchase_order_autolinking,
45
- generate_paid_invoice_pdf: f.generate_paid_invoice_pdf,
46
- payables_ocr_auto_tagging: r,
47
- payables_skip_approval_flow: f.payables_skip_approval_flow,
48
- tax_inclusive_discount_mode: f.tax_inclusive_discount_mode
49
- });
50
- }
51
- };
3
+ var t = () => {
4
+ let { api: t } = e();
5
+ return t.finops.getFinancingOffers.useQuery();
52
6
  };
53
7
  //#endregion
54
- export { o as useTags };
8
+ export { t as useGetFinanceOffers };
@@ -1,66 +1,12 @@
1
- import { cn as e } from "./index48.js";
2
- import { Label as t } from "./index86.js";
3
- import * as n from "react";
4
- import { jsx as r } from "@emotion/react/jsx-runtime";
5
- import { Slot as i } from "@radix-ui/react-slot";
6
- import { Controller as a, FormProvider as o, useFormContext as s, useFormState as c } from "react-hook-form";
1
+ import { useMoniteContext as e } from "./index46.js";
2
+ import { toast as t } from "react-hot-toast";
3
+ import { useLingui as n } from "@lingui/react";
7
4
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index557.js
8
- var l = o, u = n.createContext({}), d = ({ ...e }) => /* @__PURE__ */ r(u.Provider, {
9
- value: { name: e.name },
10
- children: /* @__PURE__ */ r(a, { ...e })
11
- }), f = () => {
12
- let e = n.useContext(u), t = n.useContext(p), { getFieldState: r } = s(), i = c({ name: e.name }), a = r(e.name, i);
13
- if (!e) throw Error("useFormField should be used within <FormField>");
14
- let { id: o } = t;
15
- return {
16
- id: o,
17
- name: e.name,
18
- formItemId: `${o}-form-item`,
19
- formDescriptionId: `${o}-form-item-description`,
20
- formMessageId: `${o}-form-item-message`,
21
- ...a
22
- };
23
- }, p = n.createContext({});
24
- function m({ className: t, ...i }) {
25
- let a = n.useId();
26
- return /* @__PURE__ */ r(p.Provider, {
27
- value: { id: a },
28
- children: /* @__PURE__ */ r("div", {
29
- "data-slot": "form-item",
30
- className: e("ttw:grid ttw:gap-2", t),
31
- ...i
32
- })
33
- });
34
- }
35
- function h({ className: n, ...i }) {
36
- let { error: a, formItemId: o } = f();
37
- return /* @__PURE__ */ r(t, {
38
- "data-slot": "form-label",
39
- "data-error": !!a,
40
- className: e("ttw:data-[error=true]:text-destructive", n),
41
- htmlFor: o,
42
- ...i
43
- });
44
- }
45
- function g({ ...e }) {
46
- let { error: t, formItemId: n, formDescriptionId: a, formMessageId: o } = f();
47
- return /* @__PURE__ */ r(i, {
48
- "data-slot": "form-control",
49
- id: n,
50
- "aria-describedby": t ? `${a} ${o}` : `${a}`,
51
- "aria-invalid": !!t,
52
- ...e
53
- });
54
- }
55
- function _({ className: t, ...n }) {
56
- let { error: i, formMessageId: a } = f(), o = i ? String(i?.message ?? "") : n.children;
57
- return o ? /* @__PURE__ */ r("p", {
58
- "data-slot": "form-message",
59
- id: a,
60
- className: e("ttw:text-destructive ttw:text-sm", t),
61
- ...n,
62
- children: o
63
- }) : null;
64
- }
5
+ var r = () => {
6
+ let { api: r } = e(), { i18n: i } = n();
7
+ return r.finops.postFinancingTokens.useMutation({}, { onError: () => {
8
+ t.error(i._("The financing service is currently unavailable. Please reload the page or try again later."));
9
+ } });
10
+ };
65
11
  //#endregion
66
- export { l as Form, g as FormControl, d as FormField, m as FormItem, h as FormLabel, _ as FormMessage, f as useFormField };
12
+ export { r as useGetFinancingConnectToken };
@@ -1,169 +1,13 @@
1
- import { Button as e } from "./index55.js";
2
- import { Input as t } from "./index88.js";
3
- import { useRootElements as n } from "./index211.js";
4
- import "./index212.js";
5
- import { MoniteScopedProviders as r } from "./index241.js";
6
- import { Sheet as i, SheetContent as a, SheetDescription as o, SheetFooter as s, SheetHeader as c, SheetTitle as l } from "./index49.js";
7
- import { Select as u, SelectContent as d, SelectItem as f, SelectTrigger as p, SelectValue as m } from "./index107.js";
8
- import { InputTags as h } from "./index457.js";
9
- import { getTagCategoryLabel as g, tagCategories as _ } from "./index555.js";
10
- import { useTags as v } from "./index556.js";
11
- import { Form as y, FormControl as b, FormField as x, FormItem as S, FormLabel as C, FormMessage as w } from "./index557.js";
12
- import { useEffect as T, useId as E } from "react";
13
- import { z as D } from "zod";
14
- import { Fragment as O, jsx as k, jsxs as A } from "@emotion/react/jsx-runtime";
15
- import { toast as j } from "react-hot-toast";
16
- import { useLingui as M } from "@lingui/react";
17
- import { useForm as N } from "react-hook-form";
18
- import { zodResolver as P } from "@hookform/resolvers/zod";
1
+ import "./index241.js";
2
+ import { createContext as e, useContext as t } from "react";
3
+ import "@emotion/react/jsx-runtime";
4
+ import "@lingui/react";
19
5
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index558.js
20
- var F = (e) => D.object({
21
- name: D.string().min(1, e._("Required")).max(255, e._("Value must be at most '255' characters")),
22
- category: D.union([D.literal(""), D.enum(_)]),
23
- keywords: D.array(D.string().min(2, e._("Keyword should be at least 2 characters long")).max(25, e._("Keyword should be at most 25 characters long")))
24
- }), I = (e) => /* @__PURE__ */ k(r, { children: /* @__PURE__ */ k(L, { ...e }) }), L = ({ tag: r, onCreate: D, onUpdate: I, onDelete: L, onClose: R, open: z, isDeleteAllowed: B }) => {
25
- let { i18n: V } = M(), H = F(V), U = N({
26
- resolver: P(H),
27
- defaultValues: {
28
- name: "",
29
- category: "",
30
- keywords: []
31
- }
32
- }), { control: W, handleSubmit: G, reset: K, setError: q } = U;
33
- T(() => {
34
- let e = [];
35
- r?.keywords && (Array.isArray(r.keywords) ? e = r.keywords : typeof r.keywords == "string" && (e = r.keywords.split(",").map((e) => e.trim()).filter(Boolean))), K({
36
- name: r?.name || "",
37
- category: r?.category || "",
38
- keywords: e
39
- });
40
- }, [K, r]);
41
- let { createTag: J, updateTag: Y, inProgress: X, updateOcrAutoTagging: Z } = v({
42
- setNameError: (e) => {
43
- q("name", {
44
- type: "custom",
45
- message: e
46
- });
47
- },
48
- onTagCreated: (e) => {
49
- j.success(V._("New tag “{createdTagName}” created", { createdTagName: e.name })), D?.(e), R?.(), K();
50
- },
51
- onTagUpdated: (e) => {
52
- r && j.success(r.name === e.name ? V._("Tag “{tagName}” was updated”", { tagName: r.name }) : V._("Tag “{tagName}” renamed to “{updatedTagName}”", {
53
- tagName: r.name,
54
- updatedTagName: e.name
55
- })), I?.(e), R?.(), K();
56
- }
57
- }), { root: Q } = n(), $ = `Monite-Form-tag-${E()}`;
58
- return /* @__PURE__ */ k(O, { children: /* @__PURE__ */ k(i, {
59
- open: z,
60
- onOpenChange: R,
61
- children: /* @__PURE__ */ A(a, {
62
- container: Q,
63
- className: "Monite-Payables ttw:w-[600px]",
64
- children: [
65
- /* @__PURE__ */ A(c, { children: [/* @__PURE__ */ k(l, { children: r ? V._("Edit tag ”{tagName}”", { tagName: r.name }) : V._("Create new tag") }), /* @__PURE__ */ k(o, {
66
- className: "ttw:sr-only",
67
- children: r ? V._("Edit tag ”{tagName}”", { tagName: r.name }) : V._("Create new tag")
68
- })] }),
69
- /* @__PURE__ */ k(y, {
70
- ...U,
71
- children: /* @__PURE__ */ k("form", {
72
- id: $,
73
- name: $,
74
- onSubmit: (e) => {
75
- e.preventDefault(), e.stopPropagation(), G(async (e) => {
76
- let { keywords: t, name: n, category: i } = e, a = {
77
- name: n,
78
- ...i ? { category: i } : {}
79
- }, o = await (r ? Y(r.id, a) : J(a));
80
- Z(o.id, t);
81
- })(e);
82
- },
83
- children: /* @__PURE__ */ A("div", {
84
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:pt-8 ttw:pb-6",
85
- children: [
86
- /* @__PURE__ */ k(x, {
87
- name: "name",
88
- control: W,
89
- render: ({ field: e }) => /* @__PURE__ */ A(S, { children: [
90
- /* @__PURE__ */ k(C, { children: V._("Name") }),
91
- /* @__PURE__ */ k(b, { children: /* @__PURE__ */ k(t, {
92
- autoFocus: !0,
93
- ...e
94
- }) }),
95
- /* @__PURE__ */ k(w, {})
96
- ] })
97
- }),
98
- /* @__PURE__ */ k(x, {
99
- name: "category",
100
- control: W,
101
- render: ({ field: e }) => /* @__PURE__ */ A(S, { children: [
102
- /* @__PURE__ */ k(C, { children: V._("Category") }),
103
- /* @__PURE__ */ A(u, {
104
- onValueChange: e.onChange,
105
- defaultValue: e.value,
106
- children: [/* @__PURE__ */ k(b, { children: /* @__PURE__ */ k(p, {
107
- className: "ttw:w-full",
108
- children: /* @__PURE__ */ k(m, { placeholder: V._("Not set") })
109
- }) }), /* @__PURE__ */ k(d, { children: _.map((e) => /* @__PURE__ */ k(f, {
110
- value: e,
111
- children: g(e, V)
112
- }, e)) })]
113
- }),
114
- /* @__PURE__ */ k(w, {})
115
- ] })
116
- }),
117
- /* @__PURE__ */ k(x, {
118
- name: "keywords",
119
- control: W,
120
- render: ({ field: e }) => /* @__PURE__ */ A(S, {
121
- className: "ttw:flex ttw:flex-col",
122
- children: [
123
- /* @__PURE__ */ k(C, { children: V._("Keywords") }),
124
- /* @__PURE__ */ k(h, {
125
- ...e,
126
- value: e.value ?? []
127
- }),
128
- /* @__PURE__ */ k(w, {})
129
- ]
130
- })
131
- })
132
- ]
133
- })
134
- })
135
- }),
136
- /* @__PURE__ */ A(s, {
137
- className: "ttw:flex ttw:flex-row ttw:justify-end ttw:gap-2",
138
- children: [
139
- r && /* @__PURE__ */ k(e, {
140
- className: "ttw:mr-auto",
141
- variant: "destructive",
142
- size: "lg",
143
- onClick: () => {
144
- L?.(r), R?.();
145
- },
146
- disabled: !B,
147
- children: V._("Delete")
148
- }),
149
- /* @__PURE__ */ k(e, {
150
- variant: "ghost",
151
- size: "lg",
152
- onClick: R,
153
- children: V._("Cancel")
154
- }),
155
- /* @__PURE__ */ k(e, {
156
- type: "submit",
157
- form: $,
158
- size: "lg",
159
- disabled: X,
160
- children: r ? V._("Save") : V._("Create")
161
- })
162
- ]
163
- })
164
- ]
165
- })
166
- }) });
167
- };
6
+ var n = e(null);
7
+ function r() {
8
+ let e = t(n);
9
+ if (!e) throw Error("Could not find KanmonContext. Make sure that you are using \"MoniteProvider\" component before calling this hook.");
10
+ return e;
11
+ }
168
12
  //#endregion
169
- export { I as TagFormModal };
13
+ export { n as KanmonContext, r as useKanmonContext };