@layerfi/components 0.1.114-alpha → 0.1.114-alpha.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.
@@ -110,7 +110,7 @@ const LinkedAccountsContext = react.createContext({
110
110
  setAccountsToAddOpeningBalanceInModal: () => {
111
111
  }
112
112
  });
113
- const version = "0.1.114-alpha";
113
+ const version = "0.1.114-alpha.1";
114
114
  const pkg = {
115
115
  version
116
116
  };
@@ -6209,7 +6209,7 @@ const ProfitAndLossReportSchema = effect.Schema.Struct({
6209
6209
  expenses: LineItemSchema,
6210
6210
  taxes: LineItemSchema,
6211
6211
  customLineItems: effect.pipe(
6212
- effect.Schema.propertySignature(effect.Schema.NullOr(LineItemSchema)),
6212
+ effect.Schema.propertySignature(effect.Schema.NullishOr(effect.Schema.Array(LineItemSchema))),
6213
6213
  effect.Schema.fromKey("custom_line_items")
6214
6214
  ),
6215
6215
  otherOutflows: effect.pipe(
@@ -7332,6 +7332,10 @@ const getBankTransactionMatchAsSuggestedMatch = (bankTransaction) => {
7332
7332
  }
7333
7333
  return void 0;
7334
7334
  };
7335
+ const getBankTransactionFirstSuggestedMatch = (bankTransaction) => {
7336
+ var _a, _b;
7337
+ return (_b = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) != null ? _b : (_a = bankTransaction == null ? void 0 : bankTransaction.suggested_matches) == null ? void 0 : _a[0];
7338
+ };
7335
7339
  const IconButton = (_y) => {
7336
7340
  var _z = _y, {
7337
7341
  className,
@@ -10141,7 +10145,6 @@ const Popover = react.forwardRef(
10141
10145
  const DATE_FORMAT$1 = "LLL d, yyyy";
10142
10146
  const DATE_FORMAT_SHORT = "M/d/yyyy";
10143
10147
  const DATE_FORMAT_WITH_TIME_READABLE = "LLLL do, yyyy 'at' h:mm a";
10144
- const MONTH_DAY_FORMAT = "LLL d";
10145
10148
  const TIME_FORMAT = "p";
10146
10149
  const BREAKPOINTS = {
10147
10150
  TABLET: 760,
@@ -13182,7 +13185,7 @@ const MatchBadge = ({
13182
13185
  }
13183
13186
  return;
13184
13187
  };
13185
- const MatchForm$1 = ({
13188
+ const MatchForm = ({
13186
13189
  classNamePrefix,
13187
13190
  bankTransaction,
13188
13191
  selectedMatchId,
@@ -14077,14 +14080,12 @@ const MoneySpan = react.forwardRef(
14077
14080
  var _xb = _wb, { amount, bold, size, displayPlusSign, className } = _xb, restProps = __objRest(_xb, ["amount", "bold", "size", "displayPlusSign", "className"]);
14078
14081
  const dataProperties = toDataProperties({
14079
14082
  bold,
14080
- positive: amount >= 0,
14081
- negative: amount < 0,
14082
- size
14083
+ "positive": amount >= 0,
14084
+ "negative": amount < 0,
14085
+ size,
14086
+ "display-plus-sign": displayPlusSign
14083
14087
  });
14084
- return /* @__PURE__ */ jsxRuntime.jsxs("span", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(CLASS_NAME$8, className), ref, children: [
14085
- displayPlusSign && "+",
14086
- centsToDollars(Math.abs(amount))
14087
- ] }));
14088
+ return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(CLASS_NAME$8, className), ref, children: centsToDollars(Math.abs(amount)) }));
14088
14089
  }
14089
14090
  );
14090
14091
  MoneySpan.displayName = "MoneySpan";
@@ -14690,7 +14691,6 @@ const ExpandedBankTransactionRow = react.forwardRef(
14690
14691
  showDescriptions,
14691
14692
  showReceiptUploads
14692
14693
  }, ref) => {
14693
- var _a, _b;
14694
14694
  const {
14695
14695
  categorize: categorizeBankTransaction2,
14696
14696
  match: matchBankTransaction2
@@ -14708,7 +14708,7 @@ const ExpandedBankTransactionRow = react.forwardRef(
14708
14708
  /* categorize */
14709
14709
  );
14710
14710
  const [selectedMatch, setSelectedMatch] = react.useState(
14711
- (_b = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) != null ? _b : (_a = bankTransaction == null ? void 0 : bankTransaction.suggested_matches) == null ? void 0 : _a[0]
14711
+ getBankTransactionFirstSuggestedMatch(bankTransaction)
14712
14712
  );
14713
14713
  const [matchFormError, setMatchFormError] = react.useState();
14714
14714
  const bodyRef = react.useRef(null);
@@ -14771,12 +14771,12 @@ const ExpandedBankTransactionRow = react.forwardRef(
14771
14771
  }
14772
14772
  };
14773
14773
  const save = () => __async(null, null, function* () {
14774
- var _a2;
14774
+ var _a;
14775
14775
  if (purpose === "match") {
14776
14776
  if (!selectedMatch) {
14777
14777
  setMatchFormError("Select an option to match the transaction");
14778
14778
  return;
14779
- } else if (selectedMatch && selectedMatch.id !== ((_a2 = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) == null ? void 0 : _a2.id)) {
14779
+ } else if (selectedMatch && selectedMatch.id !== ((_a = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) == null ? void 0 : _a.id)) {
14780
14780
  yield onMatchSubmit(selectedMatch.id);
14781
14781
  return;
14782
14782
  }
@@ -14796,8 +14796,8 @@ const ExpandedBankTransactionRow = react.forwardRef(
14796
14796
  save
14797
14797
  }));
14798
14798
  const onMatchSubmit = (matchId) => __async(null, null, function* () {
14799
- var _a2;
14800
- const foundMatch = (_a2 = bankTransaction.suggested_matches) == null ? void 0 : _a2.find(
14799
+ var _a;
14800
+ const foundMatch = (_a = bankTransaction.suggested_matches) == null ? void 0 : _a.find(
14801
14801
  (x) => x.id === matchId
14802
14802
  );
14803
14803
  if (!foundMatch) {
@@ -14853,7 +14853,7 @@ const ExpandedBankTransactionRow = react.forwardRef(
14853
14853
  purpose === "match" ? `${className}__content-panel--active` : ""
14854
14854
  ),
14855
14855
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${className}__content-panel-container`, children: /* @__PURE__ */ jsxRuntime.jsx(
14856
- MatchForm$1,
14856
+ MatchForm,
14857
14857
  {
14858
14858
  classNamePrefix: className,
14859
14859
  bankTransaction,
@@ -15447,10 +15447,14 @@ const BankTransactionRow = ({
15447
15447
  __spreadProps(__spreadValues(__spreadValues({
15448
15448
  className: `Layer__table-cell Layer__table-cell__amount-col Layer__bank-transactions__amount-col Layer__table-cell--amount ${className}__table-cell--amount-${isCredit(bankTransaction) ? "credit" : "debit"}`
15449
15449
  }, openRow), showReceiptDataProperties), {
15450
- children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "Layer__table-cell-content", children: [
15451
- isCredit(bankTransaction) ? "+$" : " $",
15452
- centsToDollars(bankTransaction.amount)
15453
- ] })
15450
+ children: /* @__PURE__ */ jsxRuntime.jsx(
15451
+ MoneySpan,
15452
+ {
15453
+ amount: bankTransaction.amount,
15454
+ displayPlusSign: isCredit(bankTransaction),
15455
+ className: "Layer__table-cell-content"
15456
+ }
15457
+ )
15454
15458
  })
15455
15459
  ),
15456
15460
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -15621,6 +15625,39 @@ const normalizeFromBankTransaction = (bankTransaction) => {
15621
15625
  label: (_e = (_d = bankTransaction.category) == null ? void 0 : _d.display_name) != null ? _e : ""
15622
15626
  };
15623
15627
  };
15628
+ const DATE_FORMAT = "LLL d";
15629
+ const BankTransactionsAmountDate = ({ amount, date: date2, slotProps }) => {
15630
+ return /* @__PURE__ */ jsxRuntime.jsxs(
15631
+ VStack,
15632
+ {
15633
+ align: "end",
15634
+ gap: "3xs",
15635
+ pb: "sm",
15636
+ children: [
15637
+ /* @__PURE__ */ jsxRuntime.jsx(HStack, { children: /* @__PURE__ */ jsxRuntime.jsx(
15638
+ MoneySpan,
15639
+ __spreadValues({
15640
+ amount
15641
+ }, slotProps == null ? void 0 : slotProps.MoneySpan)
15642
+ ) }),
15643
+ /* @__PURE__ */ jsxRuntime.jsx(
15644
+ DateTime,
15645
+ {
15646
+ value: date2,
15647
+ dateFormat: DATE_FORMAT,
15648
+ onlyDate: true,
15649
+ slotProps: {
15650
+ Date: __spreadValues({
15651
+ variant: "subtle",
15652
+ size: "sm"
15653
+ }, slotProps == null ? void 0 : slotProps.DateTime)
15654
+ }
15655
+ }
15656
+ )
15657
+ ]
15658
+ }
15659
+ );
15660
+ };
15624
15661
  const BankTransactionsListItem = ({
15625
15662
  index: index2,
15626
15663
  dateFormat,
@@ -15729,11 +15766,14 @@ const BankTransactionsListItem = ({
15729
15766
  /* @__PURE__ */ jsxRuntime.jsx(Span, { withTooltip: true, children: (_b = bankTransaction.counterparty_name) != null ? _b : bankTransaction.description })
15730
15767
  ] }),
15731
15768
  /* @__PURE__ */ jsxRuntime.jsx(
15732
- MoneySpan,
15769
+ BankTransactionsAmountDate,
15733
15770
  {
15734
- className: `Layer__bank-transaction-list-item__amount-${isCredit(bankTransaction) ? "credit" : "debit"}`,
15735
15771
  amount: bankTransaction.amount,
15736
- displayPlusSign: isCredit(bankTransaction)
15772
+ date: bankTransaction.date,
15773
+ slotProps: {
15774
+ MoneySpan: { size: "md", displayPlusSign: isCredit(bankTransaction) },
15775
+ DateTime: { size: "sm" }
15776
+ }
15737
15777
  }
15738
15778
  )
15739
15779
  ] }),
@@ -15766,8 +15806,7 @@ const BankTransactionsListItem = ({
15766
15806
  },
15767
15807
  isLoading: bankTransaction.processing
15768
15808
  }
15769
- ) : null,
15770
- categorized ? /* @__PURE__ */ jsxRuntime.jsx(
15809
+ ) : categorized ? /* @__PURE__ */ jsxRuntime.jsx(
15771
15810
  BankTransactionsCategorizedSelectedValue,
15772
15811
  {
15773
15812
  bankTransaction
@@ -15912,53 +15951,76 @@ const BankTransactionsList = ({
15912
15951
  ) })
15913
15952
  ] });
15914
15953
  };
15915
- const CloseIcon = (_Cb) => {
15916
- var _Db = _Cb, { size = 12 } = _Db, props = __objRest(_Db, ["size"]);
15917
- return /* @__PURE__ */ jsxRuntime.jsxs(
15918
- "svg",
15919
- __spreadProps(__spreadValues({
15920
- viewBox: "0 0 12 12",
15921
- fill: "none",
15922
- xmlns: "http://www.w3.org/2000/svg"
15923
- }, props), {
15924
- width: size,
15925
- height: size,
15926
- children: [
15927
- /* @__PURE__ */ jsxRuntime.jsx(
15928
- "path",
15929
- {
15930
- d: "M8.75 3.25L3.25 8.75",
15931
- stroke: "currentColor",
15932
- strokeLinecap: "round",
15933
- strokeLinejoin: "round"
15934
- }
15935
- ),
15936
- /* @__PURE__ */ jsxRuntime.jsx(
15937
- "path",
15938
- {
15939
- d: "M3.25 3.25L8.75 8.75",
15940
- stroke: "currentColor",
15941
- strokeLinecap: "round",
15942
- strokeLinejoin: "round"
15943
- }
15944
- )
15945
- ]
15946
- })
15947
- );
15954
+ const useTransactionToOpen = () => {
15955
+ const [transactionIdToOpen, setTransactionIdToOpen] = react.useState(void 0);
15956
+ const clearTransactionIdToOpen = react.useCallback(() => setTransactionIdToOpen(void 0), []);
15957
+ return {
15958
+ transactionIdToOpen,
15959
+ setTransactionIdToOpen,
15960
+ clearTransactionIdToOpen
15961
+ };
15948
15962
  };
15949
- const CloseButton = (_Eb) => {
15950
- var _Fb = _Eb, {
15951
- className,
15952
- textOnly = false
15953
- } = _Fb, props = __objRest(_Fb, [
15954
- "className",
15955
- "textOnly"
15956
- ]);
15957
- const baseClassName2 = classNames("Layer__btn", "Layer__back-btn", className);
15958
- return /* @__PURE__ */ jsxRuntime.jsx("button", __spreadProps(__spreadValues({}, props), { className: baseClassName2, children: textOnly ? "Back" : /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { size: 16 }) }));
15963
+ const TransactionToOpenContext = react.createContext({
15964
+ transactionIdToOpen: void 0,
15965
+ setTransactionIdToOpen: () => void 0,
15966
+ clearTransactionIdToOpen: () => void 0
15967
+ });
15968
+ const BankTransactionsMobileListItemCheckbox = ({
15969
+ bulkActionsEnabled,
15970
+ bankTransaction,
15971
+ checkboxContainerRef
15972
+ }) => {
15973
+ const internalRef = react.useRef(null);
15974
+ const ref = checkboxContainerRef || internalRef;
15975
+ const bookkeepingStatus = useEffectiveBookkeepingStatus();
15976
+ const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
15977
+ const { select, deselect } = useBulkSelectionActions();
15978
+ const isSelected = useIdIsSelected();
15979
+ const isTransactionSelected = isSelected(bankTransaction.id);
15980
+ if (!categorizationEnabled || !bulkActionsEnabled) {
15981
+ return null;
15982
+ }
15983
+ return /* @__PURE__ */ jsxRuntime.jsx(VStack, { align: "start", pis: "md", pie: "2xs", ref, children: /* @__PURE__ */ jsxRuntime.jsx(
15984
+ Checkbox,
15985
+ {
15986
+ size: "md",
15987
+ isSelected: isTransactionSelected,
15988
+ onChange: (selected) => {
15989
+ if (selected) {
15990
+ select(bankTransaction.id);
15991
+ } else {
15992
+ deselect(bankTransaction.id);
15993
+ }
15994
+ }
15995
+ }
15996
+ ) });
15997
+ };
15998
+ const BankTransactionsMobileListItemCategory = ({
15999
+ bankTransaction
16000
+ }) => {
16001
+ const categorized = isCategorized(bankTransaction);
16002
+ const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
16003
+ if (categorized) {
16004
+ return /* @__PURE__ */ jsxRuntime.jsx(
16005
+ BankTransactionsCategorizedSelectedValue,
16006
+ {
16007
+ bankTransaction,
16008
+ className: "Layer__bankTransactionsMobileListItemCategory",
16009
+ slotProps: { Label: { size: "sm" } }
16010
+ }
16011
+ );
16012
+ }
16013
+ return selectedCategory ? /* @__PURE__ */ jsxRuntime.jsx(
16014
+ BankTransactionsUncategorizedSelectedValue,
16015
+ {
16016
+ selectedValue: selectedCategory != null ? selectedCategory : null,
16017
+ className: "Layer__bankTransactionsMobileListItemCategory",
16018
+ slotProps: { Label: { size: "sm" } }
16019
+ }
16020
+ ) : /* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, className: "Layer__bankTransactionsMobileListItemCategory", size: "sm", children: "No category selected" });
15959
16021
  };
15960
- const Paperclip = (_Gb) => {
15961
- var _Hb = _Gb, { size = 20 } = _Hb, props = __objRest(_Hb, ["size"]);
16022
+ const Paperclip = (_Cb) => {
16023
+ var _Db = _Cb, { size = 20 } = _Db, props = __objRest(_Db, ["size"]);
15962
16024
  return /* @__PURE__ */ jsxRuntime.jsx(
15963
16025
  "svg",
15964
16026
  __spreadProps(__spreadValues({
@@ -16053,8 +16115,8 @@ const flattenCategories = (categories) => {
16053
16115
  return leafCategories.map((cat) => new CategoryAsOption(cat));
16054
16116
  });
16055
16117
  };
16056
- const X = (_Ib) => {
16057
- var _Jb = _Ib, { size = 18 } = _Jb, props = __objRest(_Jb, ["size"]);
16118
+ const X = (_Eb) => {
16119
+ var _Fb = _Eb, { size = 18 } = _Fb, props = __objRest(_Fb, ["size"]);
16058
16120
  return /* @__PURE__ */ jsxRuntime.jsxs(
16059
16121
  "svg",
16060
16122
  __spreadProps(__spreadValues({
@@ -16088,11 +16150,11 @@ const X = (_Ib) => {
16088
16150
  );
16089
16151
  };
16090
16152
  const CLASS_NAME$7 = "Layer__MinimalSearchField";
16091
- function MinimalSearchField(_Kb) {
16092
- var _Lb = _Kb, {
16153
+ function MinimalSearchField(_Gb) {
16154
+ var _Hb = _Gb, {
16093
16155
  placeholder,
16094
16156
  isDisabled
16095
- } = _Lb, restProps = __objRest(_Lb, [
16157
+ } = _Hb, restProps = __objRest(_Hb, [
16096
16158
  "placeholder",
16097
16159
  "isDisabled"
16098
16160
  ]);
@@ -16108,8 +16170,8 @@ function MinimalSearchField(_Kb) {
16108
16170
  ] }));
16109
16171
  }
16110
16172
  const CLASS_NAME$6 = "Layer__SearchField";
16111
- function SearchField(_Mb) {
16112
- var _Nb = _Mb, { slot = "search", className, label, isDisabled } = _Nb, restProps = __objRest(_Nb, ["slot", "className", "label", "isDisabled"]);
16173
+ function SearchField(_Ib) {
16174
+ var _Jb = _Ib, { slot = "search", className, label, isDisabled } = _Jb, restProps = __objRest(_Jb, ["slot", "className", "label", "isDisabled"]);
16113
16175
  const combinedClassName = classNames(CLASS_NAME$6, className);
16114
16176
  return /* @__PURE__ */ jsxRuntime.jsxs(InputGroup, { slot, className: combinedClassName, children: [
16115
16177
  /* @__PURE__ */ jsxRuntime.jsx(VStack, { slot: "icon", align: "center", justify: "center", className: "Layer__SearchField__Icon", "data-disabled": isDisabled || void 0, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { size: 14 }) }),
@@ -16126,7 +16188,7 @@ function SearchField(_Mb) {
16126
16188
  const isGroup = (item) => {
16127
16189
  return "categories" in item;
16128
16190
  };
16129
- const BusinessCategories = ({
16191
+ const BankTransactionsMobileListBusinessCategories = ({
16130
16192
  select,
16131
16193
  selectedId,
16132
16194
  showTooltips
@@ -16201,7 +16263,7 @@ const CategorySelectDrawer = ({
16201
16263
  onOpenChange
16202
16264
  }) => {
16203
16265
  return /* @__PURE__ */ jsxRuntime.jsx(Drawer, { isOpen, onOpenChange, variant: "mobile-drawer", isDismissable: true, children: ({ close: close2 }) => /* @__PURE__ */ jsxRuntime.jsx(
16204
- BusinessCategories,
16266
+ BankTransactionsMobileListBusinessCategories,
16205
16267
  {
16206
16268
  select: (option) => {
16207
16269
  onSelect(option);
@@ -16212,7 +16274,7 @@ const CategorySelectDrawer = ({
16212
16274
  }
16213
16275
  ) });
16214
16276
  };
16215
- const BusinessForm$1 = ({
16277
+ const BankTransactionsMobileListBusinessForm = ({
16216
16278
  bankTransaction,
16217
16279
  showCategorization,
16218
16280
  showDescriptions,
@@ -16388,7 +16450,7 @@ const isAlreadyAssigned = (bankTransaction) => {
16388
16450
  )
16389
16451
  );
16390
16452
  };
16391
- const PersonalForm = ({
16453
+ const BankTransactionsMobileListPersonalForm = ({
16392
16454
  bankTransaction,
16393
16455
  showReceiptUploads,
16394
16456
  showDescriptions,
@@ -16464,92 +16526,89 @@ const PersonalForm = ({
16464
16526
  fullWidth: true,
16465
16527
  disabled: alreadyAssigned || isLoading || bankTransaction.processing,
16466
16528
  onClick: save,
16467
- children: isLoading || bankTransaction.processing ? "Saving..." : alreadyAssigned ? "Saved as Personal" : "Categorize as Personal"
16529
+ children: isLoading || bankTransaction.processing ? "Confirming..." : alreadyAssigned ? "Confirmed" : "Confirm"
16468
16530
  }
16469
16531
  ) : null
16470
16532
  ] }),
16471
16533
  bankTransaction.error && showRetry ? /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." }) : null
16472
16534
  ] });
16473
16535
  };
16536
+ const MatchFormMobileItem = ({ match, bankTransaction, inAppLink }) => {
16537
+ return /* @__PURE__ */ jsxRuntime.jsx(
16538
+ reactAriaComponents.GridListItem,
16539
+ {
16540
+ id: match.id,
16541
+ textValue: match.details.description,
16542
+ children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", pis: "md", children: [
16543
+ /* @__PURE__ */ jsxRuntime.jsx(
16544
+ Checkbox,
16545
+ {
16546
+ slot: "selection",
16547
+ variant: "round"
16548
+ }
16549
+ ),
16550
+ /* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, pbs: "sm", size: "sm", children: match.details.description }),
16551
+ /* @__PURE__ */ jsxRuntime.jsx(
16552
+ BankTransactionsAmountDate,
16553
+ {
16554
+ amount: match.details.amount,
16555
+ date: match.details.date,
16556
+ slotProps: {
16557
+ MoneySpan: { size: "sm", displayPlusSign: isCredit(bankTransaction) },
16558
+ DateTime: { size: "xs" }
16559
+ }
16560
+ }
16561
+ ),
16562
+ /* @__PURE__ */ jsxRuntime.jsx(HStack, { children: inAppLink })
16563
+ ] })
16564
+ },
16565
+ match.id
16566
+ );
16567
+ };
16474
16568
  const MatchFormMobile = ({
16475
- classNamePrefix,
16476
16569
  bankTransaction,
16477
16570
  selectedMatchId,
16478
16571
  setSelectedMatch,
16479
16572
  matchFormError,
16480
16573
  readOnly
16481
16574
  }) => {
16482
- var _a;
16483
16575
  const { renderInAppLink } = useInAppLinkContext();
16484
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${classNamePrefix}__match-list`, children: [
16485
- (_a = bankTransaction.suggested_matches) == null ? void 0 : _a.map((match, idx) => {
16486
- const matchDetails = match.details ? decodeMatchDetails(match.details) : void 0;
16487
- const inAppLink = renderInAppLink && matchDetails ? renderInAppLink(convertMatchDetailsToLinkingMetadata(matchDetails)) : null;
16488
- return /* @__PURE__ */ jsxRuntime.jsxs(
16489
- "div",
16490
- {
16491
- className: classNames(
16492
- `${classNamePrefix}__match-item`,
16493
- match.id === selectedMatchId ? `${classNamePrefix}__match-item--selected` : ""
16494
- ),
16495
- onClick: () => {
16496
- if (readOnly) {
16497
- return;
16498
- }
16499
- setSelectedMatch(match);
16500
- },
16501
- children: [
16502
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${classNamePrefix}__match-item__col-details`, children: [
16503
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${classNamePrefix}__match-item__heading`, children: [
16504
- /* @__PURE__ */ jsxRuntime.jsx(
16505
- Text,
16506
- {
16507
- className: `${classNamePrefix}__match-item__name`,
16508
- as: "span",
16509
- children: match.details.description
16510
- }
16511
- ),
16512
- /* @__PURE__ */ jsxRuntime.jsxs(
16513
- Text,
16514
- {
16515
- className: `${classNamePrefix}__match-item__amount`,
16516
- as: "span",
16517
- children: [
16518
- "$",
16519
- centsToDollars(match.details.amount)
16520
- ]
16521
- }
16522
- )
16523
- ] }),
16524
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${classNamePrefix}__match-item__details`, children: [
16525
- /* @__PURE__ */ jsxRuntime.jsx(HStack, { children: inAppLink }),
16526
- /* @__PURE__ */ jsxRuntime.jsx(
16527
- Text,
16528
- {
16529
- className: `${classNamePrefix}__match-item__date`,
16530
- size: TextSize.sm,
16531
- as: "span",
16532
- children: dateFns.format(dateFns.parseISO(match.details.date), MONTH_DAY_FORMAT)
16533
- }
16534
- )
16535
- ] })
16536
- ] }),
16537
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${classNamePrefix}__match-item__col-status`, children: selectedMatchId && selectedMatchId === match.id ? /* @__PURE__ */ jsxRuntime.jsx(
16538
- Check,
16539
- {
16540
- size: 16,
16541
- className: `${classNamePrefix}__match-item__selected-icon`
16542
- }
16543
- ) : null })
16544
- ]
16545
- },
16546
- idx
16547
- );
16548
- }),
16549
- matchFormError && /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: matchFormError })
16550
- ] });
16576
+ const suggestedMatches = bankTransaction.suggested_matches;
16577
+ return /* @__PURE__ */ jsxRuntime.jsxs(
16578
+ reactAriaComponents.GridList,
16579
+ {
16580
+ "aria-label": "Select a match",
16581
+ selectionMode: "single",
16582
+ selectedKeys: selectedMatchId ? /* @__PURE__ */ new Set([selectedMatchId]) : /* @__PURE__ */ new Set(),
16583
+ onSelectionChange: (keys2) => {
16584
+ if (readOnly) return;
16585
+ const selectedKey = [...keys2][0];
16586
+ const selectedMatch = suggestedMatches == null ? void 0 : suggestedMatches.find((m) => m.id === selectedKey);
16587
+ if (selectedMatch) {
16588
+ setSelectedMatch(selectedMatch);
16589
+ }
16590
+ },
16591
+ className: "Layer__MatchFormMobile",
16592
+ children: [
16593
+ suggestedMatches == null ? void 0 : suggestedMatches.map((match) => {
16594
+ const matchDetails = match.details ? decodeMatchDetails(match.details) : void 0;
16595
+ const inAppLink = renderInAppLink && matchDetails ? renderInAppLink(convertMatchDetailsToLinkingMetadata(matchDetails)) : null;
16596
+ return /* @__PURE__ */ jsxRuntime.jsx(
16597
+ MatchFormMobileItem,
16598
+ {
16599
+ match,
16600
+ bankTransaction,
16601
+ inAppLink
16602
+ },
16603
+ match.id
16604
+ );
16605
+ }),
16606
+ matchFormError && /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: matchFormError })
16607
+ ]
16608
+ }
16609
+ );
16551
16610
  };
16552
- const MatchForm = ({
16611
+ const BankTransactionsMobileListMatchForm = ({
16553
16612
  bankTransaction,
16554
16613
  showReceiptUploads,
16555
16614
  showDescriptions,
@@ -16559,7 +16618,7 @@ const MatchForm = ({
16559
16618
  const receiptsRef = react.useRef(null);
16560
16619
  const { match: matchBankTransaction2, isLoading } = useBankTransactionsContext();
16561
16620
  const [selectedMatch, setSelectedMatch] = react.useState(
16562
- getBankTransactionMatchAsSuggestedMatch(bankTransaction)
16621
+ getBankTransactionFirstSuggestedMatch(bankTransaction)
16563
16622
  );
16564
16623
  const [formError, setFormError] = react.useState();
16565
16624
  const showRetry = Boolean(bankTransaction.error);
@@ -16585,12 +16644,11 @@ const MatchForm = ({
16585
16644
  }
16586
16645
  return;
16587
16646
  });
16588
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
16589
- /* @__PURE__ */ jsxRuntime.jsx(Text, { weight: TextWeight.bold, size: TextSize.sm, children: "Find match" }),
16647
+ return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { pi: "md", children: [
16648
+ /* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", weight: "bold", children: "Find Match" }),
16590
16649
  /* @__PURE__ */ jsxRuntime.jsx(
16591
16650
  MatchFormMobile,
16592
16651
  {
16593
- classNamePrefix: "Layer__bank-transaction-mobile-list-item",
16594
16652
  readOnly: !showCategorization,
16595
16653
  bankTransaction,
16596
16654
  selectedMatchId: selectedMatch == null ? void 0 : selectedMatch.id,
@@ -16697,7 +16755,7 @@ const CategorySelectDrawerWithTrigger = ({
16697
16755
  )
16698
16756
  ] });
16699
16757
  };
16700
- const SplitForm = ({
16758
+ const BankTransactionsMobileListSplitForm = ({
16701
16759
  bankTransaction,
16702
16760
  showTooltips,
16703
16761
  showCategorization,
@@ -16843,14 +16901,14 @@ const SplitForm = ({
16843
16901
  fullWidth: true,
16844
16902
  onClick: () => void save(),
16845
16903
  disabled: isLoading || bankTransaction.processing,
16846
- children: isLoading || bankTransaction.processing ? "Saving..." : "Save"
16904
+ children: isLoading || bankTransaction.processing ? "Confirming..." : "Confirm"
16847
16905
  }
16848
16906
  )
16849
16907
  ] }),
16850
16908
  bankTransaction.error && showRetry ? /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." }) : null
16851
16909
  ] });
16852
16910
  };
16853
- const SplitAndMatchForm = ({
16911
+ const BankTransactionsMobileListSplitAndMatchForm = ({
16854
16912
  bankTransaction,
16855
16913
  showTooltips,
16856
16914
  showReceiptUploads,
@@ -16864,7 +16922,7 @@ const SplitAndMatchForm = ({
16864
16922
  );
16865
16923
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__bank-transaction-mobile-list-item__split-and-match-form", children: [
16866
16924
  formType === "categorize" && /* @__PURE__ */ jsxRuntime.jsx(
16867
- SplitForm,
16925
+ BankTransactionsMobileListSplitForm,
16868
16926
  {
16869
16927
  bankTransaction,
16870
16928
  showTooltips,
@@ -16874,7 +16932,7 @@ const SplitAndMatchForm = ({
16874
16932
  }
16875
16933
  ),
16876
16934
  formType === "match" && /* @__PURE__ */ jsxRuntime.jsx(
16877
- MatchForm,
16935
+ BankTransactionsMobileListMatchForm,
16878
16936
  {
16879
16937
  bankTransaction,
16880
16938
  showReceiptUploads,
@@ -16892,7 +16950,7 @@ const SplitAndMatchForm = ({
16892
16950
  ), children: "or find match" }) }) : null
16893
16951
  ] });
16894
16952
  };
16895
- const BankTransactionMobileForms = ({
16953
+ const BankTransactionsMobileForms = ({
16896
16954
  purpose,
16897
16955
  bankTransaction,
16898
16956
  showTooltips,
@@ -16905,7 +16963,7 @@ const BankTransactionMobileForms = ({
16905
16963
  switch (purpose) {
16906
16964
  case Purpose.business:
16907
16965
  return /* @__PURE__ */ jsxRuntime.jsx(
16908
- BusinessForm$1,
16966
+ BankTransactionsMobileListBusinessForm,
16909
16967
  {
16910
16968
  bankTransaction,
16911
16969
  showCategorization,
@@ -16916,7 +16974,7 @@ const BankTransactionMobileForms = ({
16916
16974
  );
16917
16975
  case Purpose.personal:
16918
16976
  return /* @__PURE__ */ jsxRuntime.jsx(
16919
- PersonalForm,
16977
+ BankTransactionsMobileListPersonalForm,
16920
16978
  {
16921
16979
  bankTransaction,
16922
16980
  showReceiptUploads,
@@ -16926,7 +16984,7 @@ const BankTransactionMobileForms = ({
16926
16984
  );
16927
16985
  case Purpose.more:
16928
16986
  return /* @__PURE__ */ jsxRuntime.jsx(
16929
- SplitAndMatchForm,
16987
+ BankTransactionsMobileListSplitAndMatchForm,
16930
16988
  {
16931
16989
  bankTransaction,
16932
16990
  showCategorization,
@@ -16941,73 +16999,67 @@ const BankTransactionMobileForms = ({
16941
16999
  };
16942
17000
  return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsProvider, { bankTransaction, isActive: isOpen, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__bank-transaction-mobile-list-item__form-container", children: getContent() }) });
16943
17001
  };
16944
- const useTransactionToOpen = () => {
16945
- const [transactionIdToOpen, setTransactionIdToOpen] = react.useState(void 0);
16946
- const clearTransactionIdToOpen = react.useCallback(() => setTransactionIdToOpen(void 0), []);
16947
- return {
16948
- transactionIdToOpen,
16949
- setTransactionIdToOpen,
16950
- clearTransactionIdToOpen
16951
- };
16952
- };
16953
- const TransactionToOpenContext = react.createContext({
16954
- transactionIdToOpen: void 0,
16955
- setTransactionIdToOpen: () => void 0,
16956
- clearTransactionIdToOpen: () => void 0
16957
- });
16958
- const BankTransactionsMobileListItemCheckbox = ({
16959
- bulkActionsEnabled,
17002
+ const PURPOSE_TOGGLE_OPTIONS = [
17003
+ {
17004
+ value: "business",
17005
+ label: "Business",
17006
+ style: { minWidth: 84 }
17007
+ },
17008
+ {
17009
+ value: "personal",
17010
+ label: "Personal",
17011
+ style: { minWidth: 84 }
17012
+ },
17013
+ {
17014
+ value: "more",
17015
+ label: "More",
17016
+ style: { minWidth: 84 }
17017
+ }
17018
+ ];
17019
+ const BankTransactionsMobileListItemExpandedRow = ({
16960
17020
  bankTransaction,
16961
- checkboxContainerRef
17021
+ showCategorization,
17022
+ showDescriptions,
17023
+ showReceiptUploads,
17024
+ showTooltips
16962
17025
  }) => {
16963
- const internalRef = react.useRef(null);
16964
- const ref = checkboxContainerRef || internalRef;
16965
- const bookkeepingStatus = useEffectiveBookkeepingStatus();
16966
- const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
16967
- const { select, deselect } = useBulkSelectionActions();
16968
- const isSelected = useIdIsSelected();
16969
- const isTransactionSelected = isSelected(bankTransaction.id);
16970
- if (!categorizationEnabled || !bulkActionsEnabled) {
16971
- return null;
16972
- }
16973
- return /* @__PURE__ */ jsxRuntime.jsx(VStack, { align: "start", pis: "md", pie: "2xs", ref, children: /* @__PURE__ */ jsxRuntime.jsx(
16974
- Checkbox,
16975
- {
16976
- size: "md",
16977
- isSelected: isTransactionSelected,
16978
- onChange: (selected) => {
16979
- if (selected) {
16980
- select(bankTransaction.id);
16981
- } else {
16982
- deselect(bankTransaction.id);
16983
- }
17026
+ const [purpose, setPurpose] = react.useState(getInitialPurpose(bankTransaction));
17027
+ const onChangePurpose = (event) => setPurpose(event.target.value);
17028
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__bank-transaction-mobile-list-item__expanded-row", children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { pb: "md", justify: "space-between", align: "center", children: [
17029
+ showCategorization ? /* @__PURE__ */ jsxRuntime.jsx(HStack, { align: "center", justify: "space-between", children: /* @__PURE__ */ jsxRuntime.jsx(
17030
+ Toggle,
17031
+ {
17032
+ name: `purpose-${bankTransaction.id}`,
17033
+ size: ToggleSize.medium,
17034
+ options: PURPOSE_TOGGLE_OPTIONS,
17035
+ selected: purpose,
17036
+ onChange: onChangePurpose
16984
17037
  }
16985
- }
16986
- ) });
16987
- };
16988
- const BankTransactionsMobileListItemCategory = ({
16989
- bankTransaction
16990
- }) => {
16991
- const categorized = isCategorized(bankTransaction);
16992
- const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
16993
- if (categorized) {
16994
- return /* @__PURE__ */ jsxRuntime.jsx(
16995
- BankTransactionsCategorizedSelectedValue,
17038
+ ) }) : null,
17039
+ /* @__PURE__ */ jsxRuntime.jsx(
17040
+ BankTransactionsMobileForms,
16996
17041
  {
17042
+ purpose,
16997
17043
  bankTransaction,
16998
- className: "Layer__bankTransactionsMobileListItemCategory",
16999
- slotProps: { Label: { size: "sm" } }
17044
+ showCategorization,
17045
+ showDescriptions,
17046
+ showReceiptUploads,
17047
+ showTooltips
17000
17048
  }
17001
- );
17002
- }
17003
- return selectedCategory ? /* @__PURE__ */ jsxRuntime.jsx(
17004
- BankTransactionsUncategorizedSelectedValue,
17005
- {
17006
- selectedValue: selectedCategory != null ? selectedCategory : null,
17007
- className: "Layer__bankTransactionsMobileListItemCategory",
17008
- slotProps: { Label: { size: "sm" } }
17049
+ )
17050
+ ] }) });
17051
+ };
17052
+ const getInitialPurpose = (bankTransaction) => {
17053
+ if (bankTransaction.category) {
17054
+ if (bankTransaction.category.type === "Exclusion") {
17055
+ return Purpose.personal;
17009
17056
  }
17010
- ) : /* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, className: "Layer__bankTransactionsMobileListItemCategory", size: "sm", children: "No category selected" });
17057
+ if (bankTransaction.categorization_status === CategorizationStatus.SPLIT) {
17058
+ return Purpose.more;
17059
+ }
17060
+ return Purpose.business;
17061
+ }
17062
+ return hasMatch(bankTransaction) ? Purpose.more : Purpose.business;
17011
17063
  };
17012
17064
  var Purpose = /* @__PURE__ */ ((Purpose2) => {
17013
17065
  Purpose2["business"] = "business";
@@ -17015,7 +17067,6 @@ var Purpose = /* @__PURE__ */ ((Purpose2) => {
17015
17067
  Purpose2["more"] = "more";
17016
17068
  return Purpose2;
17017
17069
  })(Purpose || {});
17018
- const DATE_FORMAT = "LLL d";
17019
17070
  const getAssignedValue = (bankTransaction, renderInAppLink) => {
17020
17071
  var _a, _b, _c, _d;
17021
17072
  if (bankTransaction.categorization_status === CategorizationStatus.SPLIT) {
@@ -17051,21 +17102,8 @@ const BankTransactionsMobileListItem = ({
17051
17102
  } = react.useContext(TransactionToOpenContext);
17052
17103
  const { shouldHideAfterCategorize } = useBankTransactionsContext();
17053
17104
  const categorized = isCategorized(bankTransaction);
17054
- const formRowRef = useElementSize(
17055
- (_a2, _b2, { height: height2 }) => setHeight(height2)
17056
- );
17057
- const headingRowRef = useElementSize((_a2, _b2, { height: height2 }) => {
17058
- setHeadingHeight(height2);
17059
- });
17060
17105
  const itemRef = react.useRef(null);
17061
- const [removeAnim, setRemoveAnim] = react.useState(false);
17062
- const [purpose, setPurpose] = react.useState(
17063
- bankTransaction.category ? bankTransaction.category.type === "Exclusion" ? "personal" : bankTransaction.categorization_status === CategorizationStatus.SPLIT ? "more" : "business" : hasMatch(bankTransaction) ? "more" : "business"
17064
- /* business */
17065
- );
17066
17106
  const [open, setOpen] = react.useState(isFirstItem);
17067
- const [height, setHeight] = react.useState(0);
17068
- const [headingHeight, setHeadingHeight] = react.useState(63);
17069
17107
  const openNext = () => {
17070
17108
  if (editable && itemRef.current && itemRef.current.nextSibling) {
17071
17109
  const txId = itemRef.current.nextSibling.getAttribute(
@@ -17095,10 +17133,12 @@ const BankTransactionsMobileListItem = ({
17095
17133
  }
17096
17134
  }, [bankTransaction.id, clearTransactionIdToOpen, transactionIdToOpen]);
17097
17135
  react.useEffect(() => {
17098
- if (!removeAnim && bankTransaction.recently_categorized) {
17136
+ if (bankTransaction.recently_categorized) {
17099
17137
  if (editable && shouldHideAfterCategorize()) {
17100
- setRemoveAnim(true);
17101
- openNext();
17138
+ setTimeout(() => {
17139
+ removeTransaction(bankTransaction);
17140
+ openNext();
17141
+ }, 300);
17102
17142
  } else {
17103
17143
  close2();
17104
17144
  }
@@ -17109,14 +17149,10 @@ const BankTransactionsMobileListItem = ({
17109
17149
  bankTransaction.match
17110
17150
  ]);
17111
17151
  const toggleOpen = () => {
17112
- if (open) {
17113
- setHeight(0);
17114
- }
17115
17152
  setOpen(!open);
17116
17153
  };
17117
17154
  const close2 = () => {
17118
17155
  setOpen(false);
17119
- setHeight(0);
17120
17156
  };
17121
17157
  const checkboxContainerRef = react.useRef(null);
17122
17158
  const handleRowClick = (event) => {
@@ -17141,7 +17177,6 @@ const BankTransactionsMobileListItem = ({
17141
17177
  }, 300);
17142
17178
  }
17143
17179
  }, [bankTransaction.recently_categorized]);
17144
- const onChangePurpose = (event) => setPurpose(event.target.value);
17145
17180
  const bookkeepingStatus = useEffectiveBookkeepingStatus();
17146
17181
  const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
17147
17182
  const { select, deselect } = useBulkSelectionActions();
@@ -17153,169 +17188,95 @@ const BankTransactionsMobileListItem = ({
17153
17188
  const openClassName = open ? `${className}--expanded` : "";
17154
17189
  const rowClassName = classNames(
17155
17190
  className,
17156
- removeAnim ? "Layer__bank-transaction-row--removing" : "",
17157
17191
  open ? openClassName : "",
17158
17192
  isVisible ? "show" : ""
17159
17193
  );
17160
- return /* @__PURE__ */ jsxRuntime.jsxs("li", { ref: itemRef, className: rowClassName, "data-item": bankTransaction.id, children: [
17161
- /* @__PURE__ */ jsxRuntime.jsx(
17194
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { ref: itemRef, className: rowClassName, "data-item": bankTransaction.id, children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { children: [
17195
+ /* @__PURE__ */ jsxRuntime.jsxs(
17162
17196
  "div",
17163
17197
  {
17164
17198
  onClick: handleRowClick,
17165
17199
  role: "button",
17166
- style: {
17167
- height: headingHeight
17168
- },
17169
- children: /* @__PURE__ */ jsxRuntime.jsxs(
17170
- VStack,
17171
- {
17172
- ref: headingRowRef,
17173
- children: [
17174
- /* @__PURE__ */ jsxRuntime.jsxs(
17175
- HStack,
17176
- {
17177
- gap: "md",
17178
- justify: "space-between",
17179
- align: "center",
17180
- pie: "md",
17181
- children: [
17182
- /* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "center", children: [
17183
- /* @__PURE__ */ jsxRuntime.jsx(
17184
- BankTransactionsMobileListItemCheckbox,
17185
- {
17186
- bulkActionsEnabled,
17187
- bankTransaction,
17188
- checkboxContainerRef
17189
- }
17190
- ),
17191
- /* @__PURE__ */ jsxRuntime.jsxs(
17192
- VStack,
17193
- {
17194
- align: "start",
17195
- gap: "3xs",
17196
- className: "Layer__bankTransactionsMobileListItem__headingContentLeft",
17197
- pi: "md",
17198
- pb: "sm",
17199
- children: [
17200
- /* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, children: (_b = bankTransaction.counterparty_name) != null ? _b : bankTransaction.description }),
17201
- /* @__PURE__ */ jsxRuntime.jsx(Span, { className: "Layer__bankTransactionsMobileListItem__categorizedValue", children: categorized && bankTransaction.categorization_status ? getAssignedValue(bankTransaction, renderInAppLink) : null }),
17202
- /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "2xs", align: "center", children: [
17203
- /* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", ellipsis: true, children: fullAccountName }),
17204
- hasReceipts(bankTransaction) ? /* @__PURE__ */ jsxRuntime.jsx(File, { size: 12 }) : null
17205
- ] }),
17206
- !categorizationEnabled && !categorized ? /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsProcessingInfo, {}) : null
17207
- ]
17208
- }
17209
- )
17210
- ] }),
17211
- /* @__PURE__ */ jsxRuntime.jsxs(
17212
- VStack,
17213
- {
17214
- align: "end",
17215
- gap: "3xs",
17216
- pb: "sm",
17217
- children: [
17218
- /* @__PURE__ */ jsxRuntime.jsxs(HStack, { children: [
17219
- /* @__PURE__ */ jsxRuntime.jsx(Span, { size: "md", children: isCredit(bankTransaction) ? "+" : "" }),
17220
- /* @__PURE__ */ jsxRuntime.jsx(
17221
- MoneySpan,
17222
- {
17223
- amount: bankTransaction.amount
17224
- }
17225
- )
17226
- ] }),
17227
- /* @__PURE__ */ jsxRuntime.jsx(
17228
- DateTime,
17229
- {
17230
- value: bankTransaction.date,
17231
- dateFormat: DATE_FORMAT,
17232
- onlyDate: true,
17233
- slotProps: {
17234
- Date: { size: "sm", variant: "subtle" }
17235
- }
17236
- }
17237
- )
17238
- ]
17239
- }
17240
- )
17241
- ]
17242
- }
17243
- ),
17244
- /* @__PURE__ */ jsxRuntime.jsx(
17245
- BankTransactionsMobileListItemCategory,
17246
- {
17247
- bankTransaction
17248
- }
17249
- )
17250
- ]
17251
- }
17252
- )
17253
- }
17254
- ),
17255
- /* @__PURE__ */ jsxRuntime.jsx(
17256
- "div",
17257
- {
17258
- className: `${className}__expanded-row`,
17259
- style: { height: !open || removeAnim ? 0 : height },
17260
- children: open && /* @__PURE__ */ jsxRuntime.jsxs(
17261
- "div",
17262
- {
17263
- className: `${className}__expanded-row__content`,
17264
- ref: formRowRef,
17265
- children: [
17266
- categorizationEnabled ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${className}__toggle-row`, children: [
17200
+ children: [
17201
+ /* @__PURE__ */ jsxRuntime.jsxs(
17202
+ HStack,
17203
+ {
17204
+ gap: "md",
17205
+ justify: "space-between",
17206
+ align: "center",
17207
+ pie: "md",
17208
+ children: [
17209
+ /* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "center", children: [
17210
+ /* @__PURE__ */ jsxRuntime.jsx(
17211
+ BankTransactionsMobileListItemCheckbox,
17212
+ {
17213
+ bulkActionsEnabled,
17214
+ bankTransaction,
17215
+ checkboxContainerRef
17216
+ }
17217
+ ),
17218
+ /* @__PURE__ */ jsxRuntime.jsxs(
17219
+ VStack,
17220
+ {
17221
+ align: "start",
17222
+ gap: "3xs",
17223
+ className: "Layer__bankTransactionsMobileListItem__headingContentLeft",
17224
+ pi: "md",
17225
+ pb: "sm",
17226
+ children: [
17227
+ /* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, children: (_b = bankTransaction.counterparty_name) != null ? _b : bankTransaction.description }),
17228
+ /* @__PURE__ */ jsxRuntime.jsx(Span, { className: "Layer__bankTransactionsMobileListItem__categorizedValue", children: categorized && bankTransaction.categorization_status ? getAssignedValue(bankTransaction, renderInAppLink) : null }),
17229
+ /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "2xs", align: "center", children: [
17230
+ /* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", ellipsis: true, children: fullAccountName }),
17231
+ hasReceipts(bankTransaction) ? /* @__PURE__ */ jsxRuntime.jsx(File, { size: 12 }) : null
17232
+ ] }),
17233
+ !categorizationEnabled && !categorized ? /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsProcessingInfo, {}) : null
17234
+ ]
17235
+ }
17236
+ )
17237
+ ] }),
17267
17238
  /* @__PURE__ */ jsxRuntime.jsx(
17268
- Toggle,
17239
+ BankTransactionsAmountDate,
17269
17240
  {
17270
- name: `purpose-${bankTransaction.id}`,
17271
- size: ToggleSize.xsmall,
17272
- options: [
17273
- {
17274
- value: "business",
17275
- label: "Business",
17276
- style: { minWidth: 84 }
17277
- },
17278
- {
17279
- value: "personal",
17280
- label: "Personal",
17281
- style: { minWidth: 84 }
17282
- },
17283
- {
17284
- value: "more",
17285
- label: "More",
17286
- style: { minWidth: 84 }
17241
+ amount: bankTransaction.amount,
17242
+ date: bankTransaction.date,
17243
+ slotProps: {
17244
+ MoneySpan: {
17245
+ size: "md",
17246
+ displayPlusSign: isCredit(bankTransaction)
17287
17247
  }
17288
- ],
17289
- selected: purpose,
17290
- onChange: onChangePurpose
17248
+ }
17291
17249
  }
17292
- ),
17293
- /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClick: () => close2() })
17294
- ] }) : null,
17295
- /* @__PURE__ */ jsxRuntime.jsx(
17296
- BankTransactionMobileForms,
17297
- {
17298
- isOpen: open,
17299
- purpose,
17300
- bankTransaction,
17301
- showCategorization: categorizationEnabled,
17302
- showDescriptions,
17303
- showReceiptUploads,
17304
- showTooltips
17305
- }
17306
- )
17307
- ]
17308
- }
17309
- )
17250
+ )
17251
+ ]
17252
+ }
17253
+ ),
17254
+ !open && /* @__PURE__ */ jsxRuntime.jsx(
17255
+ BankTransactionsMobileListItemCategory,
17256
+ {
17257
+ bankTransaction
17258
+ }
17259
+ )
17260
+ ]
17261
+ }
17262
+ ),
17263
+ open && /* @__PURE__ */ jsxRuntime.jsx(
17264
+ BankTransactionsMobileListItemExpandedRow,
17265
+ {
17266
+ bankTransaction,
17267
+ showCategorization: categorizationEnabled,
17268
+ showDescriptions,
17269
+ showReceiptUploads,
17270
+ showTooltips
17310
17271
  }
17311
17272
  )
17312
- ] });
17273
+ ] }) });
17313
17274
  };
17314
17275
  const SWITCH_CLASS_NAME = "Layer__Switch";
17315
- const Switch = react.forwardRef((_Ob, ref) => {
17316
- var _Pb = _Ob, {
17276
+ const Switch = react.forwardRef((_Kb, ref) => {
17277
+ var _Lb = _Kb, {
17317
17278
  children
17318
- } = _Pb, props = __objRest(_Pb, [
17279
+ } = _Lb, props = __objRest(_Lb, [
17319
17280
  "children"
17320
17281
  ]);
17321
17282
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -17691,8 +17652,8 @@ const usePaginationRange = ({
17691
17652
  }, [totalCount, pageSize, siblingCount, currentPage]);
17692
17653
  return paginationRange;
17693
17654
  };
17694
- const PaginationButton = (_Qb) => {
17695
- var _Rb = _Qb, { children, isSelected } = _Rb, buttonProps = __objRest(_Rb, ["children", "isSelected"]);
17655
+ const PaginationButton = (_Mb) => {
17656
+ var _Nb = _Mb, { children, isSelected } = _Nb, buttonProps = __objRest(_Nb, ["children", "isSelected"]);
17696
17657
  return /* @__PURE__ */ jsxRuntime.jsx(
17697
17658
  Button,
17698
17659
  __spreadProps(__spreadValues({
@@ -18239,8 +18200,8 @@ function BaseFormTextField({
18239
18200
  }
18240
18201
  const INPUT_CLASS_NAME = "Layer__UI__Input";
18241
18202
  const Input = react.forwardRef(
18242
- function Input2(_Sb, ref) {
18243
- var _Tb = _Sb, { inset, placement } = _Tb, restProps = __objRest(_Tb, ["inset", "placement"]);
18203
+ function Input2(_Ob, ref) {
18204
+ var _Pb = _Ob, { inset, placement } = _Pb, restProps = __objRest(_Pb, ["inset", "placement"]);
18244
18205
  const dataProperties = toDataProperties({ inset, placement });
18245
18206
  return /* @__PURE__ */ jsxRuntime.jsx(
18246
18207
  reactAriaComponents.Input,
@@ -18336,15 +18297,15 @@ const withForceUpdate = (value) => {
18336
18297
  writable: false
18337
18298
  });
18338
18299
  };
18339
- function FormBigDecimalField(_Ub) {
18340
- var _Vb = _Ub, {
18300
+ function FormBigDecimalField(_Qb) {
18301
+ var _Rb = _Qb, {
18341
18302
  mode = "decimal",
18342
18303
  allowNegative = false,
18343
18304
  maxValue = mode === "percent" ? BIG_DECIMAL_ONE : DEFAULT_MAX_VALUE,
18344
18305
  minDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MIN_DECIMAL_PLACES,
18345
18306
  maxDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MAX_DECIMAL_PLACES,
18346
18307
  slots
18347
- } = _Vb, restProps = __objRest(_Vb, [
18308
+ } = _Rb, restProps = __objRest(_Rb, [
18348
18309
  "mode",
18349
18310
  "allowNegative",
18350
18311
  "maxValue",
@@ -18509,8 +18470,8 @@ function FormDateField({
18509
18470
  }
18510
18471
  const TEXTAREA_CLASS_NAME = "Layer__UI__TextArea";
18511
18472
  const TextArea = react.forwardRef(
18512
- function TextArea2(_Wb, ref) {
18513
- var _Xb = _Wb, { resize = "none" } = _Xb, restProps = __objRest(_Xb, ["resize"]);
18473
+ function TextArea2(_Sb, ref) {
18474
+ var _Tb = _Sb, { resize = "none" } = _Tb, restProps = __objRest(_Tb, ["resize"]);
18514
18475
  const dataProperties = toDataProperties({ resize });
18515
18476
  return /* @__PURE__ */ jsxRuntime.jsx(
18516
18477
  reactAriaComponents.TextArea,
@@ -18792,6 +18753,40 @@ const CustomAccountForm = ({ initialAccountName, onCancel, onSuccess }) => {
18792
18753
  }
18793
18754
  );
18794
18755
  };
18756
+ const CloseIcon = (_Ub) => {
18757
+ var _Vb = _Ub, { size = 12 } = _Vb, props = __objRest(_Vb, ["size"]);
18758
+ return /* @__PURE__ */ jsxRuntime.jsxs(
18759
+ "svg",
18760
+ __spreadProps(__spreadValues({
18761
+ viewBox: "0 0 12 12",
18762
+ fill: "none",
18763
+ xmlns: "http://www.w3.org/2000/svg"
18764
+ }, props), {
18765
+ width: size,
18766
+ height: size,
18767
+ children: [
18768
+ /* @__PURE__ */ jsxRuntime.jsx(
18769
+ "path",
18770
+ {
18771
+ d: "M8.75 3.25L3.25 8.75",
18772
+ stroke: "currentColor",
18773
+ strokeLinecap: "round",
18774
+ strokeLinejoin: "round"
18775
+ }
18776
+ ),
18777
+ /* @__PURE__ */ jsxRuntime.jsx(
18778
+ "path",
18779
+ {
18780
+ d: "M3.25 3.25L8.75 8.75",
18781
+ stroke: "currentColor",
18782
+ strokeLinecap: "round",
18783
+ strokeLinejoin: "round"
18784
+ }
18785
+ )
18786
+ ]
18787
+ })
18788
+ );
18789
+ };
18795
18790
  const VALID_EXTENSIONS = [".csv"];
18796
18791
  const VALID_FILE_TYPES = ["text/csv", "text/plain", "application/vnd.ms-excel"];
18797
18792
  const MAX_FILE_SIZE = 2 * 1024 * 1024;
@@ -20581,8 +20576,8 @@ const BankTransactionsHeader = ({
20581
20576
  }
20582
20577
  );
20583
20578
  };
20584
- const Inbox = (_Yb) => {
20585
- var _Zb = _Yb, { size = 18 } = _Zb, props = __objRest(_Zb, ["size"]);
20579
+ const Inbox = (_Wb) => {
20580
+ var _Xb = _Wb, { size = 18 } = _Xb, props = __objRest(_Xb, ["size"]);
20586
20581
  return /* @__PURE__ */ jsxRuntime.jsxs(
20587
20582
  "svg",
20588
20583
  __spreadProps(__spreadValues({
@@ -21129,8 +21124,8 @@ function RuleUpdatesPromptStep({ ruleSuggestion, close: close2 }) {
21129
21124
  const CSS_PREFIX$1 = "Layer__UI__Table";
21130
21125
  const getClassName = (component, additionalClassNames, withHidden) => classNames(`${CSS_PREFIX$1}-${component}`, withHidden && `${CSS_PREFIX$1}-${component}--hidden`, additionalClassNames);
21131
21126
  const Table$1 = react.forwardRef(
21132
- (__b, ref) => {
21133
- var _$b = __b, { children, className } = _$b, restProps = __objRest(_$b, ["children", "className"]);
21127
+ (_Yb, ref) => {
21128
+ var _Zb = _Yb, { children, className } = _Zb, restProps = __objRest(_Zb, ["children", "className"]);
21134
21129
  return /* @__PURE__ */ jsxRuntime.jsx(
21135
21130
  reactAriaComponents.Table,
21136
21131
  __spreadProps(__spreadValues({
@@ -21143,8 +21138,8 @@ const Table$1 = react.forwardRef(
21143
21138
  }
21144
21139
  );
21145
21140
  Table$1.displayName = "Table";
21146
- const TableHeaderInner = (_ac, ref) => {
21147
- var _bc = _ac, { children, className, hideHeader } = _bc, restProps = __objRest(_bc, ["children", "className", "hideHeader"]);
21141
+ const TableHeaderInner = (__b, ref) => {
21142
+ var _$b = __b, { children, className, hideHeader } = _$b, restProps = __objRest(_$b, ["children", "className", "hideHeader"]);
21148
21143
  return /* @__PURE__ */ jsxRuntime.jsx(
21149
21144
  reactAriaComponents.TableHeader,
21150
21145
  __spreadProps(__spreadValues({
@@ -21157,8 +21152,8 @@ const TableHeaderInner = (_ac, ref) => {
21157
21152
  };
21158
21153
  const TableHeader = react.forwardRef(TableHeaderInner);
21159
21154
  TableHeader.displayName = "TableHeader";
21160
- const TableBodyInner = (_cc, ref) => {
21161
- var _dc = _cc, { children, className } = _dc, restProps = __objRest(_dc, ["children", "className"]);
21155
+ const TableBodyInner = (_ac, ref) => {
21156
+ var _bc = _ac, { children, className } = _bc, restProps = __objRest(_bc, ["children", "className"]);
21162
21157
  return /* @__PURE__ */ jsxRuntime.jsx(
21163
21158
  reactAriaComponents.TableBody,
21164
21159
  __spreadProps(__spreadValues({
@@ -21171,8 +21166,8 @@ const TableBodyInner = (_cc, ref) => {
21171
21166
  };
21172
21167
  const TableBody$1 = react.forwardRef(TableBodyInner);
21173
21168
  TableBody$1.displayName = "TableBody";
21174
- const RowInner = (_ec, ref) => {
21175
- var _fc = _ec, { children, className, depth = 0 } = _fc, restProps = __objRest(_fc, ["children", "className", "depth"]);
21169
+ const RowInner = (_cc, ref) => {
21170
+ var _dc = _cc, { children, className, depth = 0 } = _dc, restProps = __objRest(_dc, ["children", "className", "depth"]);
21176
21171
  const dataProperties = toDataProperties({ depth });
21177
21172
  return /* @__PURE__ */ jsxRuntime.jsx(
21178
21173
  reactAriaComponents.Row,
@@ -21187,8 +21182,8 @@ const RowInner = (_ec, ref) => {
21187
21182
  const Row = react.forwardRef(RowInner);
21188
21183
  Row.displayName = "Row";
21189
21184
  const Column = react.forwardRef(
21190
- (_gc, ref) => {
21191
- var _hc = _gc, { children, className, textAlign = "left" } = _hc, restProps = __objRest(_hc, ["children", "className", "textAlign"]);
21185
+ (_ec, ref) => {
21186
+ var _fc = _ec, { children, className, textAlign = "left" } = _fc, restProps = __objRest(_fc, ["children", "className", "textAlign"]);
21192
21187
  const dataProperties = toDataProperties({ "text-align": textAlign });
21193
21188
  return /* @__PURE__ */ jsxRuntime.jsx(
21194
21189
  reactAriaComponents.Column,
@@ -21203,8 +21198,8 @@ const Column = react.forwardRef(
21203
21198
  );
21204
21199
  Column.displayName = "Column";
21205
21200
  const Cell = react.forwardRef(
21206
- (_ic, ref) => {
21207
- var _jc = _ic, { children, className } = _jc, restProps = __objRest(_jc, ["children", "className"]);
21201
+ (_gc, ref) => {
21202
+ var _hc = _gc, { children, className } = _hc, restProps = __objRest(_hc, ["children", "className"]);
21208
21203
  return /* @__PURE__ */ jsxRuntime.jsx(
21209
21204
  reactAriaComponents.Cell,
21210
21205
  __spreadProps(__spreadValues({
@@ -21497,8 +21492,8 @@ const SuggestedCategorizationRuleUpdatesDrawer = ({
21497
21492
  /* @__PURE__ */ jsxRuntime.jsx(SuggestedCategorizationRuleUpdates, { ruleSuggestion, close: close2 })
21498
21493
  ] }) });
21499
21494
  };
21500
- const BackArrow = (_kc) => {
21501
- var _lc = _kc, { size = 18 } = _lc, props = __objRest(_lc, ["size"]);
21495
+ const BackArrow = (_ic) => {
21496
+ var _jc = _ic, { size = 18 } = _jc, props = __objRest(_jc, ["size"]);
21502
21497
  return /* @__PURE__ */ jsxRuntime.jsx(
21503
21498
  "svg",
21504
21499
  __spreadProps(__spreadValues({
@@ -21869,8 +21864,8 @@ const CategorizationRulesDrawer = () => {
21869
21864
  ) });
21870
21865
  };
21871
21866
  const COMPONENT_NAME$a = "bank-transactions";
21872
- const BankTransactions = (_mc) => {
21873
- var _nc = _mc, {
21867
+ const BankTransactions = (_kc) => {
21868
+ var _lc = _kc, {
21874
21869
  onError,
21875
21870
  showTags = false,
21876
21871
  showCustomerVendor = false,
@@ -21878,7 +21873,7 @@ const BankTransactions = (_mc) => {
21878
21873
  applyGlobalDateRange = false,
21879
21874
  mode,
21880
21875
  renderInAppLink
21881
- } = _nc, props = __objRest(_nc, [
21876
+ } = _lc, props = __objRest(_lc, [
21882
21877
  "onError",
21883
21878
  "showTags",
21884
21879
  "showCustomerVendor",
@@ -22165,8 +22160,8 @@ const BankTransactionsTableView = ({
22165
22160
  }
22166
22161
  );
22167
22162
  };
22168
- const QuickbooksIcon = (_oc) => {
22169
- var _pc = _oc, { size = 24 } = _pc, props = __objRest(_pc, ["size"]);
22163
+ const QuickbooksIcon = (_mc) => {
22164
+ var _nc = _mc, { size = 24 } = _nc, props = __objRest(_nc, ["size"]);
22170
22165
  return /* @__PURE__ */ jsxRuntime.jsxs(
22171
22166
  "svg",
22172
22167
  __spreadProps(__spreadValues({
@@ -22447,8 +22442,8 @@ function QuickbooksContextProvider({ children }) {
22447
22442
  const quickbooksContextData = useQuickbooks();
22448
22443
  return /* @__PURE__ */ jsxRuntime.jsx(QuickbooksContext.Provider, { value: quickbooksContextData, children });
22449
22444
  }
22450
- const Cog = (_qc) => {
22451
- var _rc = _qc, { size = 12 } = _rc, props = __objRest(_rc, ["size"]);
22445
+ const Cog = (_oc) => {
22446
+ var _pc = _oc, { size = 12 } = _pc, props = __objRest(_pc, ["size"]);
22452
22447
  const id = react.useId();
22453
22448
  return /* @__PURE__ */ jsxRuntime.jsxs(
22454
22449
  "svg",
@@ -22568,12 +22563,12 @@ const collectRevenueItems = (data) => {
22568
22563
  }
22569
22564
  return revenueItems;
22570
22565
  };
22571
- const humanizeTitle = (sidebarView) => {
22566
+ const humanizeTitle = (sidebarView, overrides) => {
22572
22567
  switch (sidebarView) {
22573
22568
  case "expenses":
22574
- return "Expenses";
22569
+ return (overrides == null ? void 0 : overrides.expenseChartHeader) || "Expenses";
22575
22570
  case "revenue":
22576
- return "Revenue";
22571
+ return (overrides == null ? void 0 : overrides.revenueChartHeader) || "Revenue";
22577
22572
  default:
22578
22573
  return "Profit & Loss";
22579
22574
  }
@@ -23085,8 +23080,8 @@ const useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
23085
23080
  refetch
23086
23081
  };
23087
23082
  };
23088
- const BarChart2 = (_sc) => {
23089
- var _tc = _sc, { size = 12 } = _tc, props = __objRest(_tc, ["size"]);
23083
+ const BarChart2 = (_qc) => {
23084
+ var _rc = _qc, { size = 12 } = _rc, props = __objRest(_rc, ["size"]);
23090
23085
  return /* @__PURE__ */ jsxRuntime.jsxs(
23091
23086
  "svg",
23092
23087
  __spreadProps(__spreadValues({
@@ -23878,11 +23873,11 @@ const ProfitAndLossChart = ({
23878
23873
  isSyncing && !hasNonZeroData ? /* @__PURE__ */ jsxRuntime.jsx(ChartStateCard, {}) : null
23879
23874
  ] });
23880
23875
  };
23881
- const BackButton = (_uc) => {
23882
- var _vc = _uc, {
23876
+ const BackButton = (_sc) => {
23877
+ var _tc = _sc, {
23883
23878
  className,
23884
23879
  textOnly = false
23885
- } = _vc, props = __objRest(_vc, [
23880
+ } = _tc, props = __objRest(_tc, [
23886
23881
  "className",
23887
23882
  "textOnly"
23888
23883
  ]);
@@ -23907,8 +23902,8 @@ const TASKS_CHARTS_COLORS = {
23907
23902
  done: "#3B9C63",
23908
23903
  pending: "#DFA000"
23909
23904
  };
23910
- const SortArrows = (_wc) => {
23911
- var _xc = _wc, { size = 13 } = _xc, props = __objRest(_xc, ["size"]);
23905
+ const SortArrows = (_uc) => {
23906
+ var _vc = _uc, { size = 13 } = _vc, props = __objRest(_vc, ["size"]);
23912
23907
  return /* @__PURE__ */ jsxRuntime.jsxs(
23913
23908
  "svg",
23914
23909
  __spreadProps(__spreadValues({
@@ -24679,6 +24674,17 @@ const Header = react.forwardRef(
24679
24674
  }
24680
24675
  );
24681
24676
  Header.displayName = "Header";
24677
+ const CloseButton = (_wc) => {
24678
+ var _xc = _wc, {
24679
+ className,
24680
+ textOnly = false
24681
+ } = _xc, props = __objRest(_xc, [
24682
+ "className",
24683
+ "textOnly"
24684
+ ]);
24685
+ const baseClassName2 = classNames("Layer__btn", "Layer__back-btn", className);
24686
+ return /* @__PURE__ */ jsxRuntime.jsx("button", __spreadProps(__spreadValues({}, props), { className: baseClassName2, children: textOnly ? "Back" : /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { size: 16 }) }));
24687
+ };
24682
24688
  const LedgerAccountsContext = react.createContext({
24683
24689
  data: void 0,
24684
24690
  entryData: void 0,
@@ -25469,7 +25475,7 @@ const ProfitAndLossDetailedCharts = ({
25469
25475
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__profit-and-loss-detailed-charts", children: [
25470
25476
  /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "Layer__profit-and-loss-detailed-charts__header", children: [
25471
25477
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__profit-and-loss-detailed-charts__head", children: [
25472
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.lg, weight: TextWeight.bold, className: "title", children: humanizeTitle(theScope) }),
25478
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.lg, weight: TextWeight.bold, className: "title", children: humanizeTitle(theScope, stringOverrides == null ? void 0 : stringOverrides.detailedChartStringOverrides) }),
25473
25479
  /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.sm, className: "date", children: dateFns.format(dateRange.startDate, "LLLL, y") }),
25474
25480
  showDatePicker && /* @__PURE__ */ jsxRuntime.jsx(GlobalMonthPicker, {})
25475
25481
  ] }),
@@ -25486,7 +25492,7 @@ const ProfitAndLossDetailedCharts = ({
25486
25492
  /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "Layer__profit-and-loss-detailed-charts__header--tablet", children: [
25487
25493
  !hideClose && /* @__PURE__ */ jsxRuntime.jsx(BackButton, { onClick: () => setSidebarScope(void 0) }),
25488
25494
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__profit-and-loss-detailed-charts__head", children: [
25489
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.lg, weight: TextWeight.bold, className: "title", children: humanizeTitle(theScope) }),
25495
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.lg, weight: TextWeight.bold, className: "title", children: humanizeTitle(theScope, stringOverrides == null ? void 0 : stringOverrides.detailedChartStringOverrides) }),
25490
25496
  /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.sm, className: "date", children: dateFns.format(dateRange.startDate, "LLLL, y") })
25491
25497
  ] })
25492
25498
  ] }),
@@ -26236,8 +26242,8 @@ const getComparisonValue = (name, depth, cellData) => {
26236
26242
  } else {
26237
26243
  return (cellData == null ? void 0 : cellData.value) !== void 0 ? cellData.value : "";
26238
26244
  }
26239
- } else if (typeof cellData === "object" && cellData !== null && "lineItems" in cellData) {
26240
- for (const item of cellData.lineItems || []) {
26245
+ } else if (typeof cellData === "object" && cellData !== null && "line_items" in cellData) {
26246
+ for (const item of cellData.line_items || []) {
26241
26247
  const result = getComparisonLineItemValue(item, name, depth);
26242
26248
  if (result !== "") {
26243
26249
  return result;
@@ -26248,11 +26254,11 @@ const getComparisonValue = (name, depth, cellData) => {
26248
26254
  };
26249
26255
  const getComparisonLineItemValue = (lineItem, name, depth) => {
26250
26256
  if (depth === 1) {
26251
- if (lineItem.displayName === name) {
26257
+ if (lineItem.display_name === name) {
26252
26258
  return lineItem.value !== void 0 ? lineItem.value : "";
26253
26259
  }
26254
- } else if (lineItem.lineItems && lineItem.lineItems.length > 0) {
26255
- for (const childLineItem of lineItem.lineItems) {
26260
+ } else if (lineItem.line_items && lineItem.line_items.length > 0) {
26261
+ for (const childLineItem of lineItem.line_items) {
26256
26262
  const result = getComparisonLineItemValue(childLineItem, name, depth - 1);
26257
26263
  if (result !== "") {
26258
26264
  return result;
@@ -26262,25 +26268,24 @@ const getComparisonLineItemValue = (lineItem, name, depth) => {
26262
26268
  return "";
26263
26269
  };
26264
26270
  const mergeComparisonLineItemsAtDepth = (lineItems) => {
26271
+ var _a, _b, _c;
26265
26272
  const map = /* @__PURE__ */ new Map();
26266
- const mergeItems = (items) => {
26267
- items.forEach((item) => {
26268
- if (!map.has(item.displayName)) {
26269
- map.set(item.displayName, __spreadProps(__spreadValues({}, item), { lineItems: [] }));
26270
- }
26271
- const existingItem = map.get(item.displayName);
26272
- if (item.lineItems) {
26273
- existingItem.lineItems = mergeComparisonLineItemsAtDepth([
26274
- ...existingItem.lineItems || [],
26275
- ...item.lineItems
26276
- ]);
26277
- }
26278
- if (item.value !== void 0) {
26279
- map.set(item.displayName, __spreadProps(__spreadValues({}, existingItem), { value: item.value }));
26280
- }
26281
- });
26282
- };
26283
- mergeItems(lineItems);
26273
+ for (const item of lineItems) {
26274
+ const key = item.display_name;
26275
+ const existing = (_b = map.get(key)) != null ? _b : __spreadProps(__spreadValues({}, item), { line_items: (_a = item.line_items) != null ? _a : [] });
26276
+ let next = existing;
26277
+ if (item.line_items && item.line_items.length > 0) {
26278
+ const mergedChildren = mergeComparisonLineItemsAtDepth([
26279
+ ...(_c = existing.line_items) != null ? _c : [],
26280
+ ...item.line_items
26281
+ ]);
26282
+ next = __spreadProps(__spreadValues({}, next), { line_items: mergedChildren });
26283
+ }
26284
+ if (item.value !== void 0) {
26285
+ next = __spreadProps(__spreadValues({}, next), { value: item.value });
26286
+ }
26287
+ map.set(key, next);
26288
+ }
26284
26289
  return Array.from(map.values());
26285
26290
  };
26286
26291
  const ProfitAndLossCompareTable = ({
@@ -26338,7 +26343,7 @@ const ProfitAndLossCompareTable = ({
26338
26343
  )[0];
26339
26344
  lineItem = "display_name" in mergedLineItems ? mergedLineItems : void 0;
26340
26345
  }
26341
- const expandable = (lineItem == null ? void 0 : lineItem.lineItems) && lineItem.lineItems.length > 0 ? true : false;
26346
+ const expandable = (lineItem == null ? void 0 : lineItem.line_items) && lineItem.line_items.length > 0 ? true : false;
26342
26347
  const expanded = expandable ? isOpen(rowKey) : true;
26343
26348
  return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
26344
26349
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -26351,20 +26356,20 @@ const ProfitAndLossCompareTable = ({
26351
26356
  variant: expandable ? "expandable" : "default",
26352
26357
  handleExpand: () => setIsOpen(rowKey),
26353
26358
  children: [
26354
- /* @__PURE__ */ jsxRuntime.jsx(TableCell, { primary: true, withExpandIcon: expandable, children: lineItem ? lineItem.displayName : rowDisplayName }),
26359
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { primary: true, withExpandIcon: expandable, children: lineItem ? lineItem.display_name : rowDisplayName }),
26355
26360
  rowData.map((cell, i) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { isCurrency: true, children: getComparisonValue(
26356
- lineItem ? lineItem.displayName : rowDisplayName,
26361
+ lineItem ? lineItem.display_name : rowDisplayName,
26357
26362
  depth,
26358
26363
  cell
26359
26364
  ) }, "compare-value" + i))
26360
26365
  ]
26361
26366
  }
26362
26367
  ),
26363
- expanded && (lineItem == null ? void 0 : lineItem.lineItems) ? lineItem.lineItems.map(
26368
+ expanded && (lineItem == null ? void 0 : lineItem.line_items) ? lineItem.line_items.map(
26364
26369
  (child) => renderRow(
26365
- child.displayName,
26370
+ child.display_name,
26366
26371
  depth + 1,
26367
- child.displayName,
26372
+ child.display_name,
26368
26373
  child,
26369
26374
  rowData
26370
26375
  )
@@ -26602,13 +26607,15 @@ const ProfitAndLossTableComponent = ({
26602
26607
  rowKey: "other_outflows",
26603
26608
  rowIndex: 8
26604
26609
  }),
26605
- data.customLineItems && renderLineItem({
26606
- lineItem: data.customLineItems,
26607
- depth: 0,
26608
- rowKey: "other_activity",
26609
- rowIndex: 9,
26610
- showValue: false
26611
- })
26610
+ data.customLineItems && data.customLineItems.map(
26611
+ (customLineItem, index2) => renderLineItem({
26612
+ lineItem: customLineItem,
26613
+ depth: 0,
26614
+ rowKey: `custom_line_item_${index2}`,
26615
+ rowIndex: 9 + index2,
26616
+ showValue: false
26617
+ })
26618
+ )
26612
26619
  ] }) });
26613
26620
  };
26614
26621
  const ProfitAndLossTableWithProvider = (props) => {
@@ -36207,7 +36214,8 @@ const BookkeepingOverview = ({
36207
36214
  {
36208
36215
  text: ((_e = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _e.header) || "Profit & Loss",
36209
36216
  withDatePicker: true,
36210
- withStatus: true
36217
+ withStatus: true,
36218
+ dateSelectionMode: "month"
36211
36219
  }
36212
36220
  ),
36213
36221
  /* @__PURE__ */ jsxRuntime.jsx(BookkeepingProfitAndLossSummariesContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -36321,7 +36329,7 @@ const AccountingOverview = ({
36321
36329
  children: /* @__PURE__ */ jsxRuntime.jsxs(
36322
36330
  View,
36323
36331
  {
36324
- title,
36332
+ title: (stringOverrides == null ? void 0 : stringOverrides.title) || title,
36325
36333
  showHeader: showTitle,
36326
36334
  header: /* @__PURE__ */ jsxRuntime.jsx(Header, { children: /* @__PURE__ */ jsxRuntime.jsx(HeaderRow, { children: /* @__PURE__ */ jsxRuntime.jsx(HeaderCol, { children: /* @__PURE__ */ jsxRuntime.jsx(GlobalMonthPicker, {}) }) }) }),
36327
36335
  children: [