@wealthx/shadcn 1.2.2 → 1.3.1

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 (230) hide show
  1. package/.turbo/turbo-build.log +193 -149
  2. package/CHANGELOG.md +28 -0
  3. package/dist/{chunk-4Y6R4WEC.mjs → chunk-2A5RRQGG.mjs} +9 -22
  4. package/dist/{chunk-TS2ZX2VS.mjs → chunk-2UM72RJ7.mjs} +11 -15
  5. package/dist/{chunk-A56YQQHG.mjs → chunk-3NCUZIFP.mjs} +2 -2
  6. package/dist/chunk-3OYFOX3X.mjs +79 -0
  7. package/dist/{chunk-RP3SQYA3.mjs → chunk-3TTACBDP.mjs} +9 -4
  8. package/dist/chunk-4GAWMKMI.mjs +710 -0
  9. package/dist/{chunk-VGSESELX.mjs → chunk-5FQIKDKP.mjs} +5 -5
  10. package/dist/{chunk-K3JYD4IU.mjs → chunk-5IS7G74I.mjs} +11 -4
  11. package/dist/chunk-6AW4KJHE.mjs +235 -0
  12. package/dist/chunk-6CR5N2JW.mjs +302 -0
  13. package/dist/{chunk-XIRTEFKH.mjs → chunk-6DZEXFNB.mjs} +36 -8
  14. package/dist/chunk-6O6KD7CE.mjs +271 -0
  15. package/dist/chunk-7PV3IWCN.mjs +33 -0
  16. package/dist/{chunk-SPJ5KXW7.mjs → chunk-7S5AESZO.mjs} +5 -5
  17. package/dist/{chunk-RYCLWMZ7.mjs → chunk-ABFDMHOR.mjs} +9 -7
  18. package/dist/{chunk-SWGT756Z.mjs → chunk-AMQZRHEZ.mjs} +10 -4
  19. package/dist/{chunk-WAZD7NFU.mjs → chunk-BKNFWEH2.mjs} +6 -6
  20. package/dist/{chunk-CLIN5525.mjs → chunk-C7CQJNMR.mjs} +1 -1
  21. package/dist/{chunk-D4ILTPOG.mjs → chunk-CFMQP5QS.mjs} +5 -4
  22. package/dist/{chunk-VPBN3WOO.mjs → chunk-DGHAXJBN.mjs} +9 -7
  23. package/dist/chunk-DOEO3CDL.mjs +27 -0
  24. package/dist/{chunk-5MEWU56Z.mjs → chunk-DUJTAXMH.mjs} +11 -6
  25. package/dist/{chunk-GGM2UYGG.mjs → chunk-EBXQWIYG.mjs} +10 -4
  26. package/dist/chunk-EWRB4PAD.mjs +468 -0
  27. package/dist/{chunk-ZSHYDDRB.mjs → chunk-FAKPBKLT.mjs} +6 -2
  28. package/dist/{chunk-A6AAWBPF.mjs → chunk-GHC7LLUX.mjs} +13 -4
  29. package/dist/chunk-HBZLGDIN.mjs +507 -0
  30. package/dist/{chunk-SIZMLSRU.mjs → chunk-HISNT2MG.mjs} +8 -6
  31. package/dist/{chunk-CGH4DRNG.mjs → chunk-HVY6KCCF.mjs} +10 -7
  32. package/dist/chunk-I3RZS7V2.mjs +136 -0
  33. package/dist/chunk-IAE3F7DR.mjs +1962 -0
  34. package/dist/{chunk-UT4KJR7V.mjs → chunk-IHMFS7NZ.mjs} +35 -74
  35. package/dist/{chunk-PCPLO5HT.mjs → chunk-IOJRDS6V.mjs} +96 -14
  36. package/dist/{chunk-LHYCMLVA.mjs → chunk-JKGDCQTZ.mjs} +11 -4
  37. package/dist/{chunk-H45TKD34.mjs → chunk-JMHR3YGZ.mjs} +1 -1
  38. package/dist/{chunk-4MN6UQHG.mjs → chunk-K5A5L6T2.mjs} +17 -39
  39. package/dist/chunk-LV35NGVG.mjs +272 -0
  40. package/dist/{chunk-FZIXGLMV.mjs → chunk-M3FV7LOK.mjs} +5 -12
  41. package/dist/{chunk-FMAXJ2SI.mjs → chunk-MBON7YRJ.mjs} +1 -1
  42. package/dist/chunk-MIZQHHUO.mjs +441 -0
  43. package/dist/chunk-MLNEWRWV.mjs +449 -0
  44. package/dist/chunk-MN5NYQCL.mjs +29 -0
  45. package/dist/chunk-NL3ZO62D.mjs +31 -0
  46. package/dist/{chunk-Q76O3RIQ.mjs → chunk-NMOI6CQD.mjs} +1 -1
  47. package/dist/{chunk-P6AM5V7O.mjs → chunk-OODBHKG7.mjs} +1 -1
  48. package/dist/chunk-PBL4OQV2.mjs +283 -0
  49. package/dist/{chunk-Y4QFWRNR.mjs → chunk-PU4YZQXV.mjs} +17 -18
  50. package/dist/chunk-Q2BGOAMG.mjs +202 -0
  51. package/dist/chunk-QMY3AZJH.mjs +80 -0
  52. package/dist/{chunk-BL3DXM2X.mjs → chunk-QZ4RE6NA.mjs} +11 -4
  53. package/dist/{chunk-VACKZOMY.mjs → chunk-R3VSPKNP.mjs} +3 -3
  54. package/dist/{chunk-OPNQAVVH.mjs → chunk-RJI6GKVF.mjs} +8 -6
  55. package/dist/{chunk-WG6JGJXB.mjs → chunk-T4BJLT57.mjs} +1 -1
  56. package/dist/chunk-UMTOX62O.mjs +415 -0
  57. package/dist/{chunk-7MMXNK3C.mjs → chunk-VLARHE5V.mjs} +8 -6
  58. package/dist/{chunk-2I5S2AMY.mjs → chunk-XREGSKX3.mjs} +2 -2
  59. package/dist/{chunk-JNQORUPP.mjs → chunk-YJG55G2H.mjs} +14 -11
  60. package/dist/components/ui/add-column-modal.js +42 -14
  61. package/dist/components/ui/add-column-modal.mjs +5 -5
  62. package/dist/components/ui/add-lead-modal.js +42 -11
  63. package/dist/components/ui/add-lead-modal.mjs +3 -3
  64. package/dist/components/ui/advisor-card.js +530 -0
  65. package/dist/components/ui/advisor-card.mjs +15 -0
  66. package/dist/components/ui/ai-assistant-drawer.js +11 -10
  67. package/dist/components/ui/ai-assistant-drawer.mjs +3 -3
  68. package/dist/components/ui/alert-dialog.js +2 -2
  69. package/dist/components/ui/alert-dialog.mjs +2 -2
  70. package/dist/components/ui/appointment-action-dialogs.js +1160 -0
  71. package/dist/components/ui/appointment-action-dialogs.mjs +23 -0
  72. package/dist/components/ui/appointment-availability-settings.js +1590 -0
  73. package/dist/components/ui/appointment-availability-settings.mjs +23 -0
  74. package/dist/components/ui/appointment-book-dialog.js +1744 -0
  75. package/dist/components/ui/appointment-book-dialog.mjs +27 -0
  76. package/dist/components/ui/appointment-calendar-view.js +833 -0
  77. package/dist/components/ui/appointment-calendar-view.mjs +14 -0
  78. package/dist/components/ui/appointment-detail-sheet.js +1517 -0
  79. package/dist/components/ui/appointment-detail-sheet.mjs +24 -0
  80. package/dist/components/ui/appointment-gmail-connect.js +467 -0
  81. package/dist/components/ui/appointment-gmail-connect.mjs +14 -0
  82. package/dist/components/ui/appointment-mini-card.js +345 -0
  83. package/dist/components/ui/appointment-mini-card.mjs +11 -0
  84. package/dist/components/ui/appointment-time-slot-picker.js +311 -0
  85. package/dist/components/ui/appointment-time-slot-picker.mjs +13 -0
  86. package/dist/components/ui/appointment-upcoming-card.js +1268 -0
  87. package/dist/components/ui/appointment-upcoming-card.mjs +21 -0
  88. package/dist/components/ui/backoffice-alert-history-chart.js +11 -5
  89. package/dist/components/ui/backoffice-alert-history-chart.mjs +5 -4
  90. package/dist/components/ui/backoffice-alerts-chart.js +786 -0
  91. package/dist/components/ui/backoffice-alerts-chart.mjs +19 -0
  92. package/dist/components/ui/backoffice-connections-chart.js +817 -0
  93. package/dist/components/ui/backoffice-connections-chart.mjs +19 -0
  94. package/dist/components/ui/backoffice-contact-history-chart.js +11 -5
  95. package/dist/components/ui/backoffice-contact-history-chart.mjs +5 -4
  96. package/dist/components/ui/badge.js +6 -6
  97. package/dist/components/ui/badge.mjs +1 -1
  98. package/dist/components/ui/borrowing-capacity-line-chart.js +30 -21
  99. package/dist/components/ui/borrowing-capacity-line-chart.mjs +5 -4
  100. package/dist/components/ui/button.js +2 -2
  101. package/dist/components/ui/button.mjs +1 -1
  102. package/dist/components/ui/calendar.js +2 -2
  103. package/dist/components/ui/calendar.mjs +2 -2
  104. package/dist/components/ui/card.js +1 -1
  105. package/dist/components/ui/card.mjs +1 -1
  106. package/dist/components/ui/cash-balance-line-chart.js +31 -23
  107. package/dist/components/ui/cash-balance-line-chart.mjs +5 -4
  108. package/dist/components/ui/cashflow-bar-chart.js +12 -5
  109. package/dist/components/ui/cashflow-bar-chart.mjs +5 -4
  110. package/dist/components/ui/chip.js +97 -18
  111. package/dist/components/ui/chip.mjs +3 -2
  112. package/dist/components/ui/color-picker.js +158 -28
  113. package/dist/components/ui/color-picker.mjs +3 -1
  114. package/dist/components/ui/data-table.js +140 -119
  115. package/dist/components/ui/data-table.mjs +3 -2
  116. package/dist/components/ui/date-picker.js +48 -27
  117. package/dist/components/ui/date-picker.mjs +4 -3
  118. package/dist/components/ui/dialog.js +37 -9
  119. package/dist/components/ui/dialog.mjs +2 -2
  120. package/dist/components/ui/expense-bar-chart.js +12 -5
  121. package/dist/components/ui/expense-bar-chart.mjs +5 -4
  122. package/dist/components/ui/field.mjs +2 -2
  123. package/dist/components/ui/financial-cards.js +322 -155
  124. package/dist/components/ui/financial-cards.mjs +5 -3
  125. package/dist/components/ui/financial-drawers.js +2 -2
  126. package/dist/components/ui/financial-drawers.mjs +3 -3
  127. package/dist/components/ui/financial-sections.js +14 -10
  128. package/dist/components/ui/financial-sections.mjs +6 -5
  129. package/dist/components/ui/income-bar-chart.js +12 -5
  130. package/dist/components/ui/income-bar-chart.mjs +5 -4
  131. package/dist/components/ui/input-group.js +2 -2
  132. package/dist/components/ui/input-group.mjs +2 -2
  133. package/dist/components/ui/kanban-column.js +52 -44
  134. package/dist/components/ui/kanban-column.mjs +7 -5
  135. package/dist/components/ui/opportunity-card.js +52 -44
  136. package/dist/components/ui/opportunity-card.mjs +6 -4
  137. package/dist/components/ui/opportunity-edit-modals.js +1367 -1263
  138. package/dist/components/ui/opportunity-edit-modals.mjs +8 -8
  139. package/dist/components/ui/opportunity-summary-tab.js +2744 -2157
  140. package/dist/components/ui/opportunity-summary-tab.mjs +14 -14
  141. package/dist/components/ui/page-header.js +92 -0
  142. package/dist/components/ui/page-header.mjs +8 -0
  143. package/dist/components/ui/page-top-bar.js +88 -0
  144. package/dist/components/ui/page-top-bar.mjs +8 -0
  145. package/dist/components/ui/pagination.js +303 -19
  146. package/dist/components/ui/pagination.mjs +11 -4
  147. package/dist/components/ui/pipeline-board.js +205 -191
  148. package/dist/components/ui/pipeline-board.mjs +9 -7
  149. package/dist/components/ui/pipeline-dialogs.js +114 -65
  150. package/dist/components/ui/pipeline-dialogs.mjs +7 -6
  151. package/dist/components/ui/pipeline-primitives.js +6 -6
  152. package/dist/components/ui/pipeline-primitives.mjs +2 -2
  153. package/dist/components/ui/property-cashflow-doughnut-chart.js +14 -12
  154. package/dist/components/ui/property-cashflow-doughnut-chart.mjs +5 -4
  155. package/dist/components/ui/property-debt-equity-doughnut-chart.js +14 -12
  156. package/dist/components/ui/property-debt-equity-doughnut-chart.mjs +5 -4
  157. package/dist/components/ui/property-mobile-estimate-line-chart.js +16 -14
  158. package/dist/components/ui/property-mobile-estimate-line-chart.mjs +5 -4
  159. package/dist/components/ui/sidebar-nav.js +426 -191
  160. package/dist/components/ui/sidebar-nav.mjs +5 -1
  161. package/dist/components/ui/stage-timeline.js +6 -6
  162. package/dist/components/ui/stage-timeline.mjs +3 -3
  163. package/dist/components/ui/transactions-expense-categories-doughnut-chart.js +18 -16
  164. package/dist/components/ui/transactions-expense-categories-doughnut-chart.mjs +5 -4
  165. package/dist/components/ui/transactions-income-expense-bar-chart.js +28 -12
  166. package/dist/components/ui/transactions-income-expense-bar-chart.mjs +5 -4
  167. package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.js +18 -16
  168. package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.mjs +5 -4
  169. package/dist/index.js +12258 -8611
  170. package/dist/index.mjs +258 -190
  171. package/dist/styles.css +1 -1
  172. package/package.json +71 -1
  173. package/src/components/index.tsx +115 -9
  174. package/src/components/ui/add-column-modal.tsx +7 -7
  175. package/src/components/ui/add-lead-modal.tsx +6 -3
  176. package/src/components/ui/advisor-card.tsx +284 -0
  177. package/src/components/ui/ai-assistant-drawer.tsx +4 -3
  178. package/src/components/ui/appointment-action-dialogs.tsx +297 -0
  179. package/src/components/ui/appointment-availability-settings.tsx +645 -0
  180. package/src/components/ui/appointment-book-dialog.tsx +618 -0
  181. package/src/components/ui/appointment-calendar-view.tsx +510 -0
  182. package/src/components/ui/appointment-detail-sheet.tsx +415 -0
  183. package/src/components/ui/appointment-gmail-connect.tsx +188 -0
  184. package/src/components/ui/appointment-mini-card.tsx +104 -0
  185. package/src/components/ui/appointment-time-slot-picker.tsx +123 -0
  186. package/src/components/ui/appointment-upcoming-card.tsx +635 -0
  187. package/src/components/ui/backoffice-alert-history-chart.tsx +10 -2
  188. package/src/components/ui/backoffice-alerts-chart.tsx +312 -0
  189. package/src/components/ui/backoffice-connections-chart.tsx +339 -0
  190. package/src/components/ui/backoffice-contact-history-chart.tsx +10 -2
  191. package/src/components/ui/badge.tsx +12 -6
  192. package/src/components/ui/borrowing-capacity-line-chart.tsx +4 -11
  193. package/src/components/ui/button.tsx +2 -2
  194. package/src/components/ui/card.tsx +1 -1
  195. package/src/components/ui/cash-balance-line-chart.tsx +4 -23
  196. package/src/components/ui/cashflow-bar-chart.tsx +9 -2
  197. package/src/components/ui/chart-shared.tsx +4 -11
  198. package/src/components/ui/chip.tsx +23 -19
  199. package/src/components/ui/color-picker.tsx +4 -2
  200. package/src/components/ui/data-table.tsx +28 -74
  201. package/src/components/ui/date-picker.tsx +42 -37
  202. package/src/components/ui/dialog.tsx +72 -6
  203. package/src/components/ui/expense-bar-chart.tsx +11 -2
  204. package/src/components/ui/financial-cards.tsx +99 -10
  205. package/src/components/ui/income-bar-chart.tsx +11 -2
  206. package/src/components/ui/opportunity-card.tsx +10 -39
  207. package/src/components/ui/opportunity-edit-modals.tsx +98 -36
  208. package/src/components/ui/opportunity-summary-tab.tsx +548 -232
  209. package/src/components/ui/page-header.tsx +57 -0
  210. package/src/components/ui/page-top-bar.tsx +48 -0
  211. package/src/components/ui/pagination.tsx +171 -22
  212. package/src/components/ui/pipeline-board.tsx +12 -5
  213. package/src/components/ui/property-cashflow-doughnut-chart.tsx +3 -1
  214. package/src/components/ui/property-debt-equity-doughnut-chart.tsx +3 -1
  215. package/src/components/ui/property-mobile-estimate-line-chart.tsx +3 -1
  216. package/src/components/ui/sidebar-nav.tsx +213 -157
  217. package/src/components/ui/transactions-expense-categories-doughnut-chart.tsx +3 -1
  218. package/src/components/ui/transactions-income-expense-bar-chart.tsx +12 -9
  219. package/src/components/ui/transactions-liabilities-breakdown-doughnut-chart.tsx +3 -1
  220. package/src/lib/format-currency.ts +44 -0
  221. package/src/lib/format-date.ts +50 -0
  222. package/src/lib/opportunity-constants.ts +12 -0
  223. package/src/styles/globals.css +17 -15
  224. package/src/styles/styles-css.ts +1 -1
  225. package/tsup.config.ts +14 -0
  226. package/dist/chunk-S4QRUQNW.mjs +0 -475
  227. package/dist/chunk-URGMJAE3.mjs +0 -1885
  228. package/dist/chunk-WNGWBVLV.mjs +0 -148
  229. package/dist/chunk-ZRSDX6OW.mjs +0 -385
  230. package/dist/{chunk-LLVQKSU3.mjs → chunk-GD4BJDJR.mjs} +3 -3
@@ -0,0 +1,710 @@
1
+ import {
2
+ EditAboutApplicantModal,
3
+ EditAssetsModal,
4
+ EditDebtsModal,
5
+ EditExpensesModal,
6
+ EditIncomeModal,
7
+ EditLoanScenarioModal,
8
+ PROPERTY_ASSET_TYPES
9
+ } from "./chunk-IAE3F7DR.mjs";
10
+ import {
11
+ AboutCard,
12
+ DebtCard,
13
+ ExpensesCard,
14
+ IncomeCard,
15
+ PropertyCard
16
+ } from "./chunk-IOJRDS6V.mjs";
17
+ import {
18
+ FinancialDetailField,
19
+ FinancialLineItem,
20
+ FinancialSectionLabel,
21
+ FinancialSubtotalBlock,
22
+ FinancialSubtotalFrame
23
+ } from "./chunk-OGOYQ7BG.mjs";
24
+ import {
25
+ formatCurrency
26
+ } from "./chunk-MN5NYQCL.mjs";
27
+ import {
28
+ Tabs,
29
+ TabsContent,
30
+ TabsList,
31
+ TabsTrigger
32
+ } from "./chunk-JHJHG4GO.mjs";
33
+ import {
34
+ Button
35
+ } from "./chunk-XREGSKX3.mjs";
36
+ import {
37
+ cn
38
+ } from "./chunk-VLQZANBF.mjs";
39
+ import {
40
+ __spreadProps,
41
+ __spreadValues
42
+ } from "./chunk-FWCSY2DS.mjs";
43
+
44
+ // src/components/ui/opportunity-summary-tab.tsx
45
+ import { useState } from "react";
46
+ import { ChevronDown, ChevronUp, Mail, Pencil, Phone } from "lucide-react";
47
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
48
+ function toMonthly(amount, freq) {
49
+ return freq === "Monthly" ? amount : amount * 52 / 12;
50
+ }
51
+ function assetToPropertyCard(item) {
52
+ return {
53
+ address: item.address || item.assetType,
54
+ type: item.usedAs,
55
+ estimated: formatCurrency(item.value),
56
+ isLinkedToBank: false
57
+ };
58
+ }
59
+ function debtToCard(debt) {
60
+ return {
61
+ lenderName: debt.lender || debt.debtType,
62
+ currentLoanAmount: formatCurrency(debt.amountOwing),
63
+ interestRate: debt.interestRate ? `${debt.interestRate}% p.a.` : void 0,
64
+ originalLoanAmount: debt.originalLoanAmount ? formatCurrency(debt.originalLoanAmount) : void 0,
65
+ monthlyRepayments: debt.repaymentAmount ? `${formatCurrency(debt.repaymentAmount)} / ${debt.repaymentFrequency}` : void 0
66
+ };
67
+ }
68
+ function lvrColorClass(pct) {
69
+ if (pct <= 0) return "text-muted-foreground";
70
+ if (pct < 80) return "text-emerald-600";
71
+ if (pct < 90) return "text-amber-600";
72
+ return "text-destructive";
73
+ }
74
+ function serviceabilityInfo(surplus) {
75
+ if (surplus > 1500)
76
+ return {
77
+ label: "Likely Serviceable",
78
+ badgeClass: "bg-emerald-50 text-emerald-700 border border-emerald-200"
79
+ };
80
+ if (surplus > 0)
81
+ return {
82
+ label: "Borderline",
83
+ badgeClass: "bg-amber-50 text-amber-700 border border-amber-200"
84
+ };
85
+ return {
86
+ label: "At Risk",
87
+ badgeClass: "bg-red-50 text-destructive border border-red-200"
88
+ };
89
+ }
90
+ function SectionEditButton({
91
+ onClick,
92
+ title = "Edit"
93
+ }) {
94
+ return /* @__PURE__ */ jsx(
95
+ Button,
96
+ {
97
+ type: "button",
98
+ variant: "ghost",
99
+ size: "icon",
100
+ className: "size-6 shrink-0 text-muted-foreground hover:text-foreground",
101
+ onClick: (e) => {
102
+ e.stopPropagation();
103
+ onClick();
104
+ },
105
+ "aria-label": title,
106
+ title,
107
+ children: /* @__PURE__ */ jsx(Pencil, { className: "size-3.5" })
108
+ }
109
+ );
110
+ }
111
+ function HeroBand({
112
+ mainAbout,
113
+ coAbout,
114
+ isJoint,
115
+ loanAmount,
116
+ propertyEstimate,
117
+ cashEquity,
118
+ netSurplus
119
+ }) {
120
+ const lvrPct = propertyEstimate > 0 ? loanAmount / propertyEstimate * 100 : 0;
121
+ const svc = serviceabilityInfo(netSurplus);
122
+ const mainName = [mainAbout.firstName, mainAbout.lastName].filter(Boolean).join(" ") || "Main Applicant";
123
+ const coName = coAbout ? [coAbout.firstName, coAbout.lastName].filter(Boolean).join(" ") : "";
124
+ const surplusAbs = Math.abs(Math.round(netSurplus));
125
+ const surplusDisplay = `${netSurplus >= 0 ? "+" : "-"}${formatCurrency(surplusAbs)}`;
126
+ return /* @__PURE__ */ jsxs("div", { className: "mb-4 border border-border bg-muted/40", children: [
127
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4 px-4 py-3", children: [
128
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
129
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: mainName }),
130
+ isJoint && coName && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
131
+ "+ ",
132
+ coName,
133
+ " \xB7 Joint Application"
134
+ ] })
135
+ ] }),
136
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
137
+ mainAbout.phone && /* @__PURE__ */ jsx(
138
+ "a",
139
+ {
140
+ href: `tel:${mainAbout.phone}`,
141
+ className: "inline-flex size-7 items-center justify-center text-muted-foreground hover:text-foreground",
142
+ title: `Call: ${mainAbout.phone}`,
143
+ children: /* @__PURE__ */ jsx(Phone, { className: "size-3.5" })
144
+ }
145
+ ),
146
+ mainAbout.email && /* @__PURE__ */ jsx(
147
+ "a",
148
+ {
149
+ href: `mailto:${mainAbout.email}`,
150
+ className: "inline-flex size-7 items-center justify-center text-muted-foreground hover:text-foreground",
151
+ title: `Email: ${mainAbout.email}`,
152
+ children: /* @__PURE__ */ jsx(Mail, { className: "size-3.5" })
153
+ }
154
+ )
155
+ ] })
156
+ ] }),
157
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-4 divide-x divide-border border-t border-border", children: [
158
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-4 py-2.5", children: [
159
+ /* @__PURE__ */ jsx("span", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: "Loan Amount" }),
160
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: formatCurrency(loanAmount) })
161
+ ] }),
162
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-4 py-2.5", children: [
163
+ /* @__PURE__ */ jsx("span", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: "Property" }),
164
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: propertyEstimate > 0 ? formatCurrency(propertyEstimate) : "\u2014" })
165
+ ] }),
166
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-4 py-2.5", children: [
167
+ /* @__PURE__ */ jsx("span", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: "LVR" }),
168
+ /* @__PURE__ */ jsx("span", { className: cn("text-sm font-semibold", lvrColorClass(lvrPct)), children: lvrPct > 0 ? `${lvrPct.toFixed(1)}%` : "\u2014" })
169
+ ] }),
170
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-4 py-2.5", children: [
171
+ /* @__PURE__ */ jsx("span", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: "Cash / Deposit" }),
172
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: formatCurrency(cashEquity) })
173
+ ] })
174
+ ] }),
175
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-t border-border px-4 py-2.5", children: [
176
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
177
+ /* @__PURE__ */ jsx("span", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: "Net Surplus / Month" }),
178
+ /* @__PURE__ */ jsx(
179
+ "span",
180
+ {
181
+ className: cn(
182
+ "text-sm font-semibold",
183
+ netSurplus >= 0 ? "text-emerald-600" : "text-destructive"
184
+ ),
185
+ children: surplusDisplay
186
+ }
187
+ )
188
+ ] }),
189
+ /* @__PURE__ */ jsx("div", { className: cn("px-2.5 py-1 text-xs font-medium", svc.badgeClass), children: svc.label })
190
+ ] })
191
+ ] });
192
+ }
193
+ function ApplicantCardTab({
194
+ about,
195
+ income,
196
+ expenses,
197
+ onEditAbout,
198
+ onEditIncome,
199
+ onEditExpenses
200
+ }) {
201
+ const totalMonthlyIncome = formatCurrency(
202
+ income.items.reduce(
203
+ (sum, i) => sum + toMonthly(i.incomeAmount, i.frequency),
204
+ 0
205
+ )
206
+ );
207
+ const totalMonthlyExpenses = formatCurrency(
208
+ expenses.items.reduce(
209
+ (sum, e) => sum + toMonthly(e.amount, e.frequency),
210
+ 0
211
+ )
212
+ );
213
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 py-4", children: [
214
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
215
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
216
+ /* @__PURE__ */ jsx(FinancialSectionLabel, { children: "About" }),
217
+ /* @__PURE__ */ jsx(SectionEditButton, { onClick: onEditAbout, title: "Edit About" })
218
+ ] }),
219
+ /* @__PURE__ */ jsx(
220
+ AboutCard,
221
+ {
222
+ title: about.title,
223
+ firstName: about.firstName,
224
+ lastName: about.lastName,
225
+ phone: about.phone,
226
+ email: about.email,
227
+ dob: about.dob,
228
+ gender: about.gender,
229
+ maritalStatus: about.maritalStatus,
230
+ numDependants: about.numDependants,
231
+ citizenStatus: about.citizenStatus,
232
+ residentialAddress: about.residentialAddress,
233
+ residentialStatus: about.residentialStatus,
234
+ timeAtAddressYears: about.timeAtAddressYears,
235
+ timeAtAddressMonths: about.timeAtAddressMonths,
236
+ driversLicence: about.driversLicence,
237
+ passport: about.passport,
238
+ propertyInTrust: about.propertyInTrust,
239
+ companyOwnership: about.companyOwnership
240
+ }
241
+ )
242
+ ] }),
243
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
244
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
245
+ /* @__PURE__ */ jsx(FinancialSectionLabel, { children: "Income" }),
246
+ /* @__PURE__ */ jsx(SectionEditButton, { onClick: onEditIncome, title: "Edit Income" })
247
+ ] }),
248
+ /* @__PURE__ */ jsx(
249
+ IncomeCard,
250
+ {
251
+ items: income.items.map((i) => ({
252
+ incomeType: i.incomeType,
253
+ jobTitle: i.jobTitle,
254
+ companyName: i.companyName,
255
+ companyAddress: i.companyAddress,
256
+ startDate: i.startDate,
257
+ stillInPosition: i.stillInPosition,
258
+ endDate: i.endDate,
259
+ companyType: i.companyType,
260
+ amountLabel: `${formatCurrency(i.incomeAmount)} / ${i.frequency}`
261
+ })),
262
+ totalMonthly: totalMonthlyIncome
263
+ }
264
+ )
265
+ ] }),
266
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
267
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
268
+ /* @__PURE__ */ jsx(FinancialSectionLabel, { children: "Expenses" }),
269
+ /* @__PURE__ */ jsx(SectionEditButton, { onClick: onEditExpenses, title: "Edit Expenses" })
270
+ ] }),
271
+ /* @__PURE__ */ jsx(
272
+ ExpensesCard,
273
+ {
274
+ items: expenses.items.map((e) => ({
275
+ expenseType: e.expenseType,
276
+ amountLabel: `${formatCurrency(e.amount)} / ${e.frequency}`
277
+ })),
278
+ totalMonthly: totalMonthlyExpenses
279
+ }
280
+ )
281
+ ] })
282
+ ] });
283
+ }
284
+ function OpportunitySummaryTab({
285
+ isJoint = false,
286
+ loanScenario,
287
+ onLoanScenarioChange,
288
+ assets,
289
+ onAssetsChange,
290
+ debts,
291
+ onDebtsChange,
292
+ mainAbout,
293
+ onMainAboutChange,
294
+ mainIncome,
295
+ onMainIncomeChange,
296
+ mainExpenses,
297
+ onMainExpensesChange,
298
+ coAbout,
299
+ onCoAboutChange,
300
+ coIncome,
301
+ onCoIncomeChange,
302
+ coExpenses,
303
+ onCoExpensesChange
304
+ }) {
305
+ var _a, _b;
306
+ const [portalEl, setPortalEl] = useState(null);
307
+ const [summarySubTab, setSummarySubTab] = useState(
308
+ "joint"
309
+ );
310
+ const [loanScenarioExpanded, setLoanScenarioExpanded] = useState(true);
311
+ const [editLoanOpen, setEditLoanOpen] = useState(false);
312
+ const [editAssetsOpen, setEditAssetsOpen] = useState(false);
313
+ const [editDebtsOpen, setEditDebtsOpen] = useState(false);
314
+ const [editMainAboutOpen, setEditMainAboutOpen] = useState(false);
315
+ const [editCoAboutOpen, setEditCoAboutOpen] = useState(false);
316
+ const [editMainIncomeOpen, setEditMainIncomeOpen] = useState(false);
317
+ const [editCoIncomeOpen, setEditCoIncomeOpen] = useState(false);
318
+ const [editMainExpensesOpen, setEditMainExpensesOpen] = useState(false);
319
+ const [editCoExpensesOpen, setEditCoExpensesOpen] = useState(false);
320
+ const totalAssetsAmount = assets.reduce((sum, a) => sum + a.value, 0);
321
+ const totalDebtsAmount = debts.reduce((sum, d) => sum + d.amountOwing, 0);
322
+ const totalAssets = formatCurrency(totalAssetsAmount);
323
+ const totalDebts = formatCurrency(totalDebtsAmount);
324
+ const allIncomeItems = [...mainIncome.items, ...(_a = coIncome == null ? void 0 : coIncome.items) != null ? _a : []];
325
+ const allExpenseItems = [...mainExpenses.items, ...(_b = coExpenses == null ? void 0 : coExpenses.items) != null ? _b : []];
326
+ const combinedMonthlyIncome = allIncomeItems.reduce(
327
+ (sum, i) => sum + toMonthly(i.incomeAmount, i.frequency),
328
+ 0
329
+ );
330
+ const combinedMonthlyExpenses = allExpenseItems.reduce(
331
+ (sum, e) => sum + toMonthly(e.amount, e.frequency),
332
+ 0
333
+ );
334
+ const netSurplus = combinedMonthlyIncome - combinedMonthlyExpenses;
335
+ const mainName = [mainAbout.firstName, mainAbout.lastName].filter(Boolean).join(" ");
336
+ const coName = coAbout ? [coAbout.firstName, coAbout.lastName].filter(Boolean).join(" ") : "Co-Applicant";
337
+ const propertyCards = assets.filter((a) => PROPERTY_ASSET_TYPES.has(a.assetType)).map(assetToPropertyCard);
338
+ const anyModalOpen = editLoanOpen || editAssetsOpen || editDebtsOpen || editMainAboutOpen || editCoAboutOpen || editMainIncomeOpen || editCoIncomeOpen || editMainExpensesOpen || editCoExpensesOpen;
339
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
340
+ /* @__PURE__ */ jsx(
341
+ HeroBand,
342
+ {
343
+ mainAbout,
344
+ coAbout,
345
+ isJoint,
346
+ loanAmount: loanScenario.loanAmount,
347
+ propertyEstimate: loanScenario.propertyEstimate,
348
+ cashEquity: loanScenario.cashEquity,
349
+ netSurplus
350
+ }
351
+ ),
352
+ /* @__PURE__ */ jsxs("div", { className: "mb-4 border border-border", children: [
353
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2.5", children: [
354
+ /* @__PURE__ */ jsxs(
355
+ Button,
356
+ {
357
+ type: "button",
358
+ variant: "ghost",
359
+ className: "h-auto flex-1 justify-start gap-2 px-0 text-left",
360
+ onClick: () => setLoanScenarioExpanded((v) => !v),
361
+ "aria-expanded": loanScenarioExpanded,
362
+ children: [
363
+ /* @__PURE__ */ jsx(FinancialSectionLabel, { children: "Loan Scenario" }),
364
+ loanScenarioExpanded ? /* @__PURE__ */ jsx(ChevronUp, { className: "size-3.5 text-muted-foreground" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5 text-muted-foreground" })
365
+ ]
366
+ }
367
+ ),
368
+ /* @__PURE__ */ jsx(
369
+ SectionEditButton,
370
+ {
371
+ onClick: () => setEditLoanOpen(true),
372
+ title: "Edit Loan Scenario"
373
+ }
374
+ )
375
+ ] }),
376
+ loanScenarioExpanded && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-4 gap-x-6 gap-y-4 border-t border-border p-4", children: [
377
+ /* @__PURE__ */ jsx(FinancialDetailField, { label: "Lending Type", value: "Home Loan" }),
378
+ /* @__PURE__ */ jsx(
379
+ FinancialDetailField,
380
+ {
381
+ label: "Purpose of Loan",
382
+ value: loanScenario.loanPurpose
383
+ }
384
+ ),
385
+ /* @__PURE__ */ jsx(
386
+ FinancialDetailField,
387
+ {
388
+ label: "Loan Amount",
389
+ value: formatCurrency(loanScenario.loanAmount)
390
+ }
391
+ ),
392
+ /* @__PURE__ */ jsx(
393
+ FinancialDetailField,
394
+ {
395
+ label: "Property Estimate",
396
+ value: formatCurrency(loanScenario.propertyEstimate)
397
+ }
398
+ ),
399
+ /* @__PURE__ */ jsx(
400
+ FinancialDetailField,
401
+ {
402
+ label: "Cash / Deposit",
403
+ value: formatCurrency(loanScenario.cashEquity)
404
+ }
405
+ ),
406
+ /* @__PURE__ */ jsx(FinancialDetailField, { label: "Property Address", value: "\u2014" }),
407
+ /* @__PURE__ */ jsx(
408
+ FinancialDetailField,
409
+ {
410
+ label: "Duration",
411
+ value: `${loanScenario.loanDuration} years`
412
+ }
413
+ ),
414
+ /* @__PURE__ */ jsx(
415
+ FinancialDetailField,
416
+ {
417
+ label: "Important Features",
418
+ value: [
419
+ loanScenario.featureVariableRate && "Variable Rate",
420
+ loanScenario.featureFixedRate && "Fixed Rate",
421
+ loanScenario.featureRedrawFacility && "Redraw Facility",
422
+ loanScenario.feature100Offset && "100% Offset",
423
+ loanScenario.featureSplitLoan && "Split Loan",
424
+ loanScenario.featureInterestOnly && "Interest Only"
425
+ ].filter(Boolean).join(", ") || "\u2014"
426
+ }
427
+ ),
428
+ /* @__PURE__ */ jsx(
429
+ FinancialDetailField,
430
+ {
431
+ label: "Top Priorities",
432
+ value: loanScenario.priorities.join(", ") || "\u2014"
433
+ }
434
+ )
435
+ ] })
436
+ ] }),
437
+ /* @__PURE__ */ jsxs(
438
+ Tabs,
439
+ {
440
+ value: summarySubTab,
441
+ onValueChange: (v) => setSummarySubTab(v),
442
+ className: "pb-6",
443
+ children: [
444
+ /* @__PURE__ */ jsx("div", { className: "sticky top-0 z-10 bg-background pb-1 pt-2", children: /* @__PURE__ */ jsxs(TabsList, { className: "w-full", children: [
445
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "joint", children: "Joint" }),
446
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "main", children: mainName }),
447
+ isJoint && /* @__PURE__ */ jsx(TabsTrigger, { value: "co", children: coName })
448
+ ] }) }),
449
+ /* @__PURE__ */ jsxs(TabsContent, { value: "joint", className: "flex flex-col gap-4 pb-6 pt-4", children: [
450
+ /* @__PURE__ */ jsxs("div", { className: "border border-border", children: [
451
+ /* @__PURE__ */ jsx("div", { className: "px-4 py-2.5", children: /* @__PURE__ */ jsx(FinancialSectionLabel, { children: "Financial Overview" }) }),
452
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 divide-x divide-border border-t border-border", children: [
453
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
454
+ /* @__PURE__ */ jsx("div", { className: "px-4 pb-2 pt-3", children: /* @__PURE__ */ jsx(FinancialSectionLabel, { children: "Cashflow" }) }),
455
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col px-4 pb-4", children: [
456
+ /* @__PURE__ */ jsx(
457
+ FinancialLineItem,
458
+ {
459
+ label: "Monthly Income",
460
+ value: formatCurrency(Math.round(combinedMonthlyIncome))
461
+ }
462
+ ),
463
+ /* @__PURE__ */ jsx(
464
+ FinancialLineItem,
465
+ {
466
+ label: "Monthly Expenses",
467
+ value: formatCurrency(Math.round(combinedMonthlyExpenses)),
468
+ destructive: true
469
+ }
470
+ )
471
+ ] }),
472
+ /* @__PURE__ */ jsx(FinancialSubtotalFrame, { children: /* @__PURE__ */ jsx(
473
+ FinancialSubtotalBlock,
474
+ {
475
+ monthlyAverage: formatCurrency(
476
+ Math.abs(Math.round(netSurplus))
477
+ ),
478
+ label: netSurplus < 0 ? "Net Deficit" : "Net Surplus"
479
+ }
480
+ ) })
481
+ ] }),
482
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
483
+ /* @__PURE__ */ jsx("div", { className: "px-4 pb-2 pt-3", children: /* @__PURE__ */ jsx(FinancialSectionLabel, { children: "Balance Sheet" }) }),
484
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col px-4 pb-4", children: [
485
+ /* @__PURE__ */ jsx(FinancialLineItem, { label: "Total Assets", value: totalAssets }),
486
+ /* @__PURE__ */ jsx(
487
+ FinancialLineItem,
488
+ {
489
+ label: "Total Liabilities",
490
+ value: totalDebts,
491
+ destructive: true
492
+ }
493
+ )
494
+ ] }),
495
+ /* @__PURE__ */ jsx(FinancialSubtotalFrame, { children: /* @__PURE__ */ jsx(
496
+ FinancialSubtotalBlock,
497
+ {
498
+ monthlyAverage: formatCurrency(
499
+ Math.abs(
500
+ Math.round(totalAssetsAmount - totalDebtsAmount)
501
+ )
502
+ ),
503
+ label: totalAssetsAmount < totalDebtsAmount ? "Net Deficit" : "Net Position"
504
+ }
505
+ ) })
506
+ ] })
507
+ ] })
508
+ ] }),
509
+ /* @__PURE__ */ jsxs("div", { className: "border border-border", children: [
510
+ /* @__PURE__ */ jsx("div", { className: "px-4 py-2.5", children: /* @__PURE__ */ jsx(FinancialSectionLabel, { children: "Documents" }) }),
511
+ /* @__PURE__ */ jsx("div", { className: "p-4", children: /* @__PURE__ */ jsx("p", { className: "text-body-small text-muted-foreground", children: "No documents uploaded yet." }) })
512
+ ] }),
513
+ propertyCards.length > 0 && /* @__PURE__ */ jsxs("div", { className: "border border-border", children: [
514
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2.5", children: [
515
+ /* @__PURE__ */ jsx(FinancialSectionLabel, { children: "Property Holdings" }),
516
+ /* @__PURE__ */ jsx(
517
+ SectionEditButton,
518
+ {
519
+ onClick: () => setEditAssetsOpen(true),
520
+ title: "Edit Assets"
521
+ }
522
+ )
523
+ ] }),
524
+ /* @__PURE__ */ jsx(
525
+ "div",
526
+ {
527
+ className: cn(
528
+ "grid divide-x divide-border border-t border-border",
529
+ propertyCards.length === 1 ? "grid-cols-1" : propertyCards.length === 2 ? "grid-cols-2" : "grid-cols-3"
530
+ ),
531
+ children: propertyCards.map((card, i) => /* @__PURE__ */ jsx("div", { className: "p-4", children: /* @__PURE__ */ jsx(PropertyCard, __spreadProps(__spreadValues({}, card), { borderless: true })) }, card.address + i))
532
+ }
533
+ )
534
+ ] }),
535
+ debts.length > 0 && /* @__PURE__ */ jsxs("div", { className: "border border-border", children: [
536
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2.5", children: [
537
+ /* @__PURE__ */ jsx(FinancialSectionLabel, { children: "Mortgages & Loans" }),
538
+ /* @__PURE__ */ jsx(
539
+ SectionEditButton,
540
+ {
541
+ onClick: () => setEditDebtsOpen(true),
542
+ title: "Edit Debts"
543
+ }
544
+ )
545
+ ] }),
546
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-3 p-4", children: debts.map((debt) => /* @__PURE__ */ jsx(DebtCard, __spreadValues({}, debtToCard(debt)), debt.id)) })
547
+ ] })
548
+ ] }),
549
+ /* @__PURE__ */ jsx(TabsContent, { value: "main", children: /* @__PURE__ */ jsx(
550
+ ApplicantCardTab,
551
+ {
552
+ about: mainAbout,
553
+ income: mainIncome,
554
+ expenses: mainExpenses,
555
+ onEditAbout: () => setEditMainAboutOpen(true),
556
+ onEditIncome: () => setEditMainIncomeOpen(true),
557
+ onEditExpenses: () => setEditMainExpensesOpen(true)
558
+ }
559
+ ) }),
560
+ isJoint && coAbout && coIncome && coExpenses && /* @__PURE__ */ jsx(TabsContent, { value: "co", children: /* @__PURE__ */ jsx(
561
+ ApplicantCardTab,
562
+ {
563
+ about: coAbout,
564
+ income: coIncome,
565
+ expenses: coExpenses,
566
+ onEditAbout: () => setEditCoAboutOpen(true),
567
+ onEditIncome: () => setEditCoIncomeOpen(true),
568
+ onEditExpenses: () => setEditCoExpensesOpen(true)
569
+ }
570
+ ) })
571
+ ]
572
+ }
573
+ ),
574
+ /* @__PURE__ */ jsx(
575
+ EditLoanScenarioModal,
576
+ {
577
+ open: editLoanOpen,
578
+ onOpenChange: setEditLoanOpen,
579
+ initialData: loanScenario,
580
+ container: portalEl,
581
+ onSave: (data) => {
582
+ onLoanScenarioChange == null ? void 0 : onLoanScenarioChange(data);
583
+ setEditLoanOpen(false);
584
+ }
585
+ }
586
+ ),
587
+ /* @__PURE__ */ jsx(
588
+ EditAssetsModal,
589
+ {
590
+ open: editAssetsOpen,
591
+ onOpenChange: setEditAssetsOpen,
592
+ initialItems: assets,
593
+ container: portalEl,
594
+ onSave: (items) => {
595
+ onAssetsChange == null ? void 0 : onAssetsChange(items);
596
+ setEditAssetsOpen(false);
597
+ }
598
+ }
599
+ ),
600
+ /* @__PURE__ */ jsx(
601
+ EditDebtsModal,
602
+ {
603
+ open: editDebtsOpen,
604
+ onOpenChange: setEditDebtsOpen,
605
+ initialItems: debts,
606
+ container: portalEl,
607
+ onSave: (items) => {
608
+ onDebtsChange == null ? void 0 : onDebtsChange(items);
609
+ setEditDebtsOpen(false);
610
+ }
611
+ }
612
+ ),
613
+ /* @__PURE__ */ jsx(
614
+ EditAboutApplicantModal,
615
+ {
616
+ open: editMainAboutOpen,
617
+ onOpenChange: setEditMainAboutOpen,
618
+ applicantLabel: "Main Applicant",
619
+ initialData: mainAbout,
620
+ container: portalEl,
621
+ onSave: (data) => {
622
+ onMainAboutChange == null ? void 0 : onMainAboutChange(data);
623
+ setEditMainAboutOpen(false);
624
+ }
625
+ }
626
+ ),
627
+ coAbout && /* @__PURE__ */ jsx(
628
+ EditAboutApplicantModal,
629
+ {
630
+ open: editCoAboutOpen,
631
+ onOpenChange: setEditCoAboutOpen,
632
+ applicantLabel: "Co-Applicant",
633
+ initialData: coAbout,
634
+ container: portalEl,
635
+ onSave: (data) => {
636
+ onCoAboutChange == null ? void 0 : onCoAboutChange(data);
637
+ setEditCoAboutOpen(false);
638
+ }
639
+ }
640
+ ),
641
+ /* @__PURE__ */ jsx(
642
+ EditIncomeModal,
643
+ {
644
+ open: editMainIncomeOpen,
645
+ onOpenChange: setEditMainIncomeOpen,
646
+ applicantLabel: "Main Applicant",
647
+ initialData: mainIncome,
648
+ container: portalEl,
649
+ onSave: (data) => {
650
+ onMainIncomeChange == null ? void 0 : onMainIncomeChange(data);
651
+ setEditMainIncomeOpen(false);
652
+ }
653
+ }
654
+ ),
655
+ coIncome && /* @__PURE__ */ jsx(
656
+ EditIncomeModal,
657
+ {
658
+ open: editCoIncomeOpen,
659
+ onOpenChange: setEditCoIncomeOpen,
660
+ applicantLabel: "Co-Applicant",
661
+ initialData: coIncome,
662
+ container: portalEl,
663
+ onSave: (data) => {
664
+ onCoIncomeChange == null ? void 0 : onCoIncomeChange(data);
665
+ setEditCoIncomeOpen(false);
666
+ }
667
+ }
668
+ ),
669
+ /* @__PURE__ */ jsx(
670
+ EditExpensesModal,
671
+ {
672
+ open: editMainExpensesOpen,
673
+ onOpenChange: setEditMainExpensesOpen,
674
+ applicantLabel: "Main Applicant",
675
+ initialData: mainExpenses,
676
+ container: portalEl,
677
+ onSave: (data) => {
678
+ onMainExpensesChange == null ? void 0 : onMainExpensesChange(data);
679
+ setEditMainExpensesOpen(false);
680
+ }
681
+ }
682
+ ),
683
+ coExpenses && /* @__PURE__ */ jsx(
684
+ EditExpensesModal,
685
+ {
686
+ open: editCoExpensesOpen,
687
+ onOpenChange: setEditCoExpensesOpen,
688
+ applicantLabel: "Co-Applicant",
689
+ initialData: coExpenses,
690
+ container: portalEl,
691
+ onSave: (data) => {
692
+ onCoExpensesChange == null ? void 0 : onCoExpensesChange(data);
693
+ setEditCoExpensesOpen(false);
694
+ }
695
+ }
696
+ ),
697
+ anyModalOpen && /* @__PURE__ */ jsx(
698
+ "div",
699
+ {
700
+ className: "fixed inset-0 z-[49] bg-foreground/50",
701
+ "aria-hidden": "true"
702
+ }
703
+ ),
704
+ /* @__PURE__ */ jsx("div", { ref: setPortalEl, "data-shadcn-scope": "" })
705
+ ] });
706
+ }
707
+
708
+ export {
709
+ OpportunitySummaryTab
710
+ };