@layerfi/components 0.1.107-alpha.2 → 0.1.107

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.
@@ -5570,7 +5570,7 @@ import { useState as useState3 } from "react";
5570
5570
  import { useReducer, useEffect } from "react";
5571
5571
 
5572
5572
  // package.json
5573
- var version = "0.1.107-alpha.2";
5573
+ var version = "0.1.107";
5574
5574
 
5575
5575
  // src/models/APIError.ts
5576
5576
  var APIError = class _APIError extends Error {
@@ -6478,10 +6478,10 @@ import { jsx as jsx4 } from "react/jsx-runtime";
6478
6478
  var InAppLinkContext = createContext4({});
6479
6479
  var useInAppLinkContext = () => useContext4(InAppLinkContext);
6480
6480
  var InAppLinkProvider = ({
6481
- convertToInAppLink,
6481
+ renderInAppLink,
6482
6482
  children
6483
6483
  }) => {
6484
- return /* @__PURE__ */ jsx4(InAppLinkContext.Provider, { value: { convertToInAppLink }, children });
6484
+ return /* @__PURE__ */ jsx4(InAppLinkContext.Provider, { value: { renderInAppLink }, children });
6485
6485
  };
6486
6486
 
6487
6487
  // src/schemas/customer.ts
@@ -6616,7 +6616,7 @@ var TransactionLedgerEntrySourceSchema = Schema3.Struct({
6616
6616
  Schema3.fromKey("transaction_id")
6617
6617
  ),
6618
6618
  externalId: pipe3(
6619
- Schema3.propertySignature(Schema3.String),
6619
+ Schema3.propertySignature(Schema3.NullOr(Schema3.String)),
6620
6620
  Schema3.fromKey("external_id")
6621
6621
  ),
6622
6622
  accountName: pipe3(
@@ -6626,7 +6626,7 @@ var TransactionLedgerEntrySourceSchema = Schema3.Struct({
6626
6626
  date: Schema3.String,
6627
6627
  amount: Schema3.Number,
6628
6628
  direction: Schema3.Enums(Direction),
6629
- counterparty: Schema3.optional(Schema3.String),
6629
+ counterparty: Schema3.optional(Schema3.NullOr(Schema3.String)),
6630
6630
  description: Schema3.optional(Schema3.String),
6631
6631
  memo: Schema3.optional(Schema3.NullOr(Schema3.String)),
6632
6632
  metadata: Schema3.optional(Schema3.NullOr(Schema3.Unknown)),
@@ -6650,7 +6650,7 @@ var InvoiceLedgerEntrySourceSchema = Schema3.Struct({
6650
6650
  Schema3.fromKey("invoice_id")
6651
6651
  ),
6652
6652
  externalId: pipe3(
6653
- Schema3.propertySignature(Schema3.String),
6653
+ Schema3.propertySignature(Schema3.NullOr(Schema3.String)),
6654
6654
  Schema3.fromKey("external_id")
6655
6655
  ),
6656
6656
  invoiceNumber: pipe3(
@@ -6658,7 +6658,7 @@ var InvoiceLedgerEntrySourceSchema = Schema3.Struct({
6658
6658
  Schema3.fromKey("invoice_number")
6659
6659
  ),
6660
6660
  recipientName: pipe3(
6661
- Schema3.propertySignature(Schema3.String),
6661
+ Schema3.propertySignature(Schema3.NullOr(Schema3.String)),
6662
6662
  Schema3.fromKey("recipient_name")
6663
6663
  ),
6664
6664
  customerDescription: pipe3(
@@ -6714,7 +6714,7 @@ var InvoicePaymentLedgerEntrySourceSchema = Schema3.Struct({
6714
6714
  ),
6715
6715
  type: Schema3.Literal("Invoice_Payment_Ledger_Entry_Source"),
6716
6716
  externalId: pipe3(
6717
- Schema3.propertySignature(Schema3.String),
6717
+ Schema3.propertySignature(Schema3.NullOr(Schema3.String)),
6718
6718
  Schema3.fromKey("external_id")
6719
6719
  ),
6720
6720
  invoiceId: pipe3(
@@ -6864,7 +6864,7 @@ var PayoutLedgerEntrySourceSchema = Schema3.Struct({
6864
6864
  Schema3.fromKey("payout_id")
6865
6865
  ),
6866
6866
  externalId: pipe3(
6867
- Schema3.propertySignature(Schema3.String),
6867
+ Schema3.propertySignature(Schema3.NullOr(Schema3.String)),
6868
6868
  Schema3.fromKey("external_id")
6869
6869
  ),
6870
6870
  paidOutAmount: pipe3(
@@ -16054,7 +16054,7 @@ var flattenOptionGroups = (options3) => {
16054
16054
  return options3.flatMap(
16055
16055
  (opt) => {
16056
16056
  var _a;
16057
- return ((_a = opt.value) == null ? void 0 : _a.type) === "GROUP" && Array.isArray(opt.value.items) ? flattenOptionGroups(opt.value.items) : [opt];
16057
+ return ((_a = opt.value) == null ? void 0 : _a.type) === "GROUP" && Array.isArray(opt.value.items) ? [opt, ...flattenOptionGroups(opt.value.items)] : [opt];
16058
16058
  }
16059
16059
  );
16060
16060
  };
@@ -16168,18 +16168,21 @@ var BusinessCategories = ({
16168
16168
  const [optionsToShow, setOptionsToShow] = useState20(categoryOptions);
16169
16169
  const [selectedGroup, setSelectedGroup] = useState20();
16170
16170
  const filteredOptions = useMemo18(() => {
16171
- const sortedOptions = optionsToShow.sort((a, b) => a.label.localeCompare(b.label));
16172
- if (!query) return sortedOptions;
16173
- const lower = query.toLowerCase();
16174
- const flattenedOptions = flattenOptionGroups(sortedOptions);
16175
- return flattenedOptions.filter(
16176
- (opt) => opt.label.toLowerCase().includes(lower)
16177
- );
16171
+ let options3 = optionsToShow;
16172
+ if (query) {
16173
+ const lower = query.toLowerCase();
16174
+ const flattenedOptions = flattenOptionGroups(options3);
16175
+ options3 = flattenedOptions.filter(
16176
+ (opt) => opt.label.toLowerCase().includes(lower)
16177
+ );
16178
+ }
16179
+ return options3.sort((a, b) => a.label.localeCompare(b.label));
16178
16180
  }, [optionsToShow, query]);
16179
16181
  const onCategorySelect = (v) => {
16180
16182
  if (v.value.type === "GROUP" && v.value.items) {
16181
16183
  setOptionsToShow(v.value.items);
16182
16184
  setSelectedGroup(v.label);
16185
+ setQuery("");
16183
16186
  return;
16184
16187
  }
16185
16188
  select(v);
@@ -16187,13 +16190,14 @@ var BusinessCategories = ({
16187
16190
  const clearSelectedGroup = useCallback13(() => {
16188
16191
  setOptionsToShow(categoryOptions);
16189
16192
  setSelectedGroup(void 0);
16193
+ setQuery("");
16190
16194
  }, [categoryOptions]);
16191
16195
  return /* @__PURE__ */ jsxs63(VStack, { className: "Layer__bank-transaction-mobile-list-item__categories_list-container", pbs: "lg", gap: "md", children: [
16192
16196
  /* @__PURE__ */ jsxs63(VStack, { pis: "sm", pie: "sm", gap: "md", children: [
16193
16197
  /* @__PURE__ */ jsx103(HStack, { pis: "xs", children: selectedGroup ? /* @__PURE__ */ jsxs63(Button2, { variant: "text", onClick: clearSelectedGroup, children: [
16194
16198
  /* @__PURE__ */ jsx103(ChevronLeft2, { size: 18 }),
16195
- /* @__PURE__ */ jsx103(Span, { size: "lg", weight: "bold", align: "center", children: selectedGroup })
16196
- ] }) : /* @__PURE__ */ jsx103(Span, { size: "lg", weight: "bold", children: "Select category" }) }),
16199
+ /* @__PURE__ */ jsx103(ModalHeading, { size: "sm", weight: "bold", align: "center", children: selectedGroup })
16200
+ ] }) : /* @__PURE__ */ jsx103(ModalHeading, { size: "sm", weight: "bold", children: "Select category" }) }),
16197
16201
  /* @__PURE__ */ jsx103(SearchField, { value: query, onChange: setQuery, label: "Search categories..." })
16198
16202
  ] }),
16199
16203
  /* @__PURE__ */ jsx103(
@@ -16515,7 +16519,7 @@ var Option2 = (props) => {
16515
16519
  return null;
16516
16520
  }
16517
16521
  if (props.data.type === "match") {
16518
- const inAppLink = props.convertToInAppLink && props.data.payload.details ? props.convertToInAppLink(convertMatchDetailsToLinkingMetadata(props.data.payload.details)) : null;
16522
+ const inAppLink = props.renderInAppLink && props.data.payload.details ? props.renderInAppLink(convertMatchDetailsToLinkingMetadata(props.data.payload.details)) : null;
16519
16523
  return /* @__PURE__ */ jsxs64(
16520
16524
  components3.Option,
16521
16525
  __spreadProps(__spreadValues({}, props), {
@@ -16604,7 +16608,7 @@ var CategorySelect = ({
16604
16608
  }) => {
16605
16609
  var _a, _b, _c, _d;
16606
16610
  const { data: categories } = useCategories();
16607
- const { convertToInAppLink } = useInAppLinkContext();
16611
+ const { renderInAppLink } = useInAppLinkContext();
16608
16612
  const [isDrawerOpen, setIsDrawerOpen] = useState21(false);
16609
16613
  const onSelect = useCallback14((option) => {
16610
16614
  if (option.value.payload) {
@@ -16715,7 +16719,7 @@ var CategorySelect = ({
16715
16719
  components: {
16716
16720
  DropdownIndicator,
16717
16721
  GroupHeading,
16718
- Option: (optionProps) => /* @__PURE__ */ jsx105(Option2, __spreadProps(__spreadValues({}, optionProps), { showTooltips, convertToInAppLink }))
16722
+ Option: (optionProps) => /* @__PURE__ */ jsx105(Option2, __spreadProps(__spreadValues({}, optionProps), { showTooltips, renderInAppLink }))
16719
16723
  },
16720
16724
  isDisabled: disabled,
16721
16725
  isOptionDisabled: (option) => {
@@ -17384,7 +17388,7 @@ var MatchForm = ({
17384
17388
  }) => {
17385
17389
  const bookkeepingStatus = useEffectiveBookkeepingStatus();
17386
17390
  const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
17387
- const { convertToInAppLink } = useInAppLinkContext();
17391
+ const { renderInAppLink } = useInAppLinkContext();
17388
17392
  const {
17389
17393
  suggested_matches: suggestedMatches = [],
17390
17394
  match
@@ -17400,12 +17404,12 @@ var MatchForm = ({
17400
17404
  /* @__PURE__ */ jsx114("div", { className: `${classNamePrefix}__match-table__date`, children: "Date" }),
17401
17405
  /* @__PURE__ */ jsx114("div", { className: `${classNamePrefix}__match-table__desc`, children: "Description" }),
17402
17406
  /* @__PURE__ */ jsx114("div", { className: `${classNamePrefix}__match-table__amount`, children: "Amount" }),
17403
- convertToInAppLink && /* @__PURE__ */ jsx114("div", { className: `${classNamePrefix}__match-table__link`, children: "Link" }),
17407
+ renderInAppLink && /* @__PURE__ */ jsx114("div", { className: `${classNamePrefix}__match-table__link`, children: "Link" }),
17404
17408
  match && /* @__PURE__ */ jsx114("div", { className: `${classNamePrefix}__match-table__status` })
17405
17409
  ] }),
17406
17410
  effectiveSuggestedMatches.map((suggestedMatch) => {
17407
17411
  var _a;
17408
- const inAppLink = convertToInAppLink ? convertToInAppLink(convertMatchDetailsToLinkingMetadata(suggestedMatch.details)) : null;
17412
+ const inAppLink = renderInAppLink ? renderInAppLink(convertMatchDetailsToLinkingMetadata(suggestedMatch.details)) : null;
17409
17413
  return /* @__PURE__ */ jsxs71(
17410
17414
  "div",
17411
17415
  {
@@ -17499,10 +17503,10 @@ var MatchFormMobile = ({
17499
17503
  readOnly
17500
17504
  }) => {
17501
17505
  var _a;
17502
- const { convertToInAppLink } = useInAppLinkContext();
17506
+ const { renderInAppLink } = useInAppLinkContext();
17503
17507
  return /* @__PURE__ */ jsxs72("div", { className: `${classNamePrefix}__match-list`, children: [
17504
17508
  (_a = bankTransaction.suggested_matches) == null ? void 0 : _a.map((match, idx) => {
17505
- const inAppLink = convertToInAppLink ? convertToInAppLink(convertMatchDetailsToLinkingMetadata(match.details)) : null;
17509
+ const inAppLink = renderInAppLink ? renderInAppLink(convertMatchDetailsToLinkingMetadata(match.details)) : null;
17506
17510
  return /* @__PURE__ */ jsxs72(
17507
17511
  "div",
17508
17512
  {
@@ -21864,14 +21868,14 @@ import classNames48 from "classnames";
21864
21868
  import { parseISO as parseISO12, format as formatTime9 } from "date-fns";
21865
21869
  import { jsx as jsx148, jsxs as jsxs93 } from "react/jsx-runtime";
21866
21870
  var DATE_FORMAT2 = "LLL d";
21867
- var getAssignedValue2 = (bankTransaction, convertToInAppLink) => {
21871
+ var getAssignedValue2 = (bankTransaction, renderInAppLink) => {
21868
21872
  var _a, _b, _c, _d;
21869
21873
  if (bankTransaction.categorization_status === "SPLIT" /* SPLIT */) {
21870
21874
  return extractDescriptionForSplit(bankTransaction.category);
21871
21875
  }
21872
21876
  if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */) {
21873
- if (convertToInAppLink && ((_a = bankTransaction.match) == null ? void 0 : _a.details)) {
21874
- const inAppLink = convertToInAppLink(convertMatchDetailsToLinkingMetadata(bankTransaction.match.details));
21877
+ if (renderInAppLink && ((_a = bankTransaction.match) == null ? void 0 : _a.details)) {
21878
+ const inAppLink = renderInAppLink(convertMatchDetailsToLinkingMetadata(bankTransaction.match.details));
21875
21879
  if (inAppLink) return inAppLink;
21876
21880
  }
21877
21881
  return (_c = (_b = bankTransaction.match) == null ? void 0 : _b.details) == null ? void 0 : _c.description;
@@ -21896,7 +21900,7 @@ var BankTransactionMobileListItem = ({
21896
21900
  clearTransactionIdToOpen
21897
21901
  } = useContext20(TransactionToOpenContext);
21898
21902
  const { shouldHideAfterCategorize } = useBankTransactionsContext();
21899
- const { convertToInAppLink } = useInAppLinkContext();
21903
+ const { renderInAppLink } = useInAppLinkContext();
21900
21904
  const formRowRef = useElementSize(
21901
21905
  (_a2, _b, { height: height2 }) => setHeight(height2)
21902
21906
  );
@@ -21983,7 +21987,7 @@ var BankTransactionMobileListItem = ({
21983
21987
  /* @__PURE__ */ jsxs93("div", { className: `${className}__heading__main`, children: [
21984
21988
  /* @__PURE__ */ jsx148(Text, { as: "span", className: `${className}__heading__tx-name`, children: (_a = bankTransaction.counterparty_name) != null ? _a : bankTransaction.description }),
21985
21989
  /* @__PURE__ */ jsxs93(Text, { as: "span", className: `${className}__heading__account-name`, children: [
21986
- categorized && bankTransaction.categorization_status ? getAssignedValue2(bankTransaction, convertToInAppLink) : null,
21990
+ categorized && bankTransaction.categorization_status ? getAssignedValue2(bankTransaction, renderInAppLink) : null,
21987
21991
  /* @__PURE__ */ jsx148("span", { children: !categorized && bankTransaction.account_name }),
21988
21992
  hasReceipts(bankTransaction) ? /* @__PURE__ */ jsx148(File_default, { size: 12 }) : null
21989
21993
  ] }),
@@ -24807,7 +24811,7 @@ var BankTransactions = (_a) => {
24807
24811
  monthlyView = false,
24808
24812
  applyGlobalDateRange = false,
24809
24813
  mode,
24810
- convertToInAppLink
24814
+ renderInAppLink
24811
24815
  } = _b, props = __objRest(_b, [
24812
24816
  "onError",
24813
24817
  "showTags",
@@ -24815,13 +24819,13 @@ var BankTransactions = (_a) => {
24815
24819
  "monthlyView",
24816
24820
  "applyGlobalDateRange",
24817
24821
  "mode",
24818
- "convertToInAppLink"
24822
+ "renderInAppLink"
24819
24823
  ]);
24820
24824
  usePreloadTagDimensions({ isEnabled: showTags });
24821
24825
  usePreloadCustomers({ isEnabled: showCustomerVendor });
24822
24826
  usePreloadVendors({ isEnabled: showCustomerVendor });
24823
24827
  const contextData = useAugmentedBankTransactions({ monthlyView, applyGlobalDateRange });
24824
- return /* @__PURE__ */ jsx188(ErrorBoundary, { onError, children: /* @__PURE__ */ jsx188(BankTransactionsContext.Provider, { value: contextData, children: /* @__PURE__ */ jsx188(LegacyModeProvider, { overrideMode: mode, children: /* @__PURE__ */ jsx188(BankTransactionTagVisibilityProvider, { showTags, children: /* @__PURE__ */ jsx188(BankTransactionCustomerVendorVisibilityProvider, { showCustomerVendor, children: /* @__PURE__ */ jsx188(InAppLinkProvider, { convertToInAppLink, children: /* @__PURE__ */ jsx188(BankTransactionsContent, __spreadValues({}, props)) }) }) }) }) }) });
24828
+ return /* @__PURE__ */ jsx188(ErrorBoundary, { onError, children: /* @__PURE__ */ jsx188(BankTransactionsContext.Provider, { value: contextData, children: /* @__PURE__ */ jsx188(LegacyModeProvider, { overrideMode: mode, children: /* @__PURE__ */ jsx188(BankTransactionTagVisibilityProvider, { showTags, children: /* @__PURE__ */ jsx188(BankTransactionCustomerVendorVisibilityProvider, { showCustomerVendor, children: /* @__PURE__ */ jsx188(InAppLinkProvider, { renderInAppLink, children: /* @__PURE__ */ jsx188(BankTransactionsContent, __spreadValues({}, props)) }) }) }) }) }) });
24825
24829
  };
24826
24830
  var BankTransactionsContent = ({
24827
24831
  asWidget = false,
@@ -28766,7 +28770,7 @@ var LedgerAccountEntryDetails = ({
28766
28770
  }) => {
28767
28771
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
28768
28772
  const { entryData, isLoadingEntry, closeSelectedEntry, errorEntry } = useContext33(LedgerAccountsContext);
28769
- const { convertToInAppLink } = useInAppLinkContext();
28773
+ const { renderInAppLink } = useInAppLinkContext();
28770
28774
  const { totalDebit, totalCredit } = useMemo50(() => {
28771
28775
  var _a2;
28772
28776
  let totalDebit2 = 0;
@@ -28787,12 +28791,12 @@ var LedgerAccountEntryDetails = ({
28787
28791
  var _a2, _b2;
28788
28792
  const badgeContent = (_a2 = ledgerEntrySource == null ? void 0 : ledgerEntrySource.entityName) != null ? _a2 : entryData == null ? void 0 : entryData.entry_type;
28789
28793
  const defaultBadge = /* @__PURE__ */ jsx231(Badge, { children: badgeContent });
28790
- if (!convertToInAppLink || !ledgerEntrySource) {
28794
+ if (!renderInAppLink || !ledgerEntrySource) {
28791
28795
  return defaultBadge;
28792
28796
  }
28793
28797
  const linkingMetadata = convertLedgerEntrySourceToLinkingMetadata(ledgerEntrySource);
28794
- return (_b2 = convertToInAppLink(linkingMetadata)) != null ? _b2 : defaultBadge;
28795
- }, [convertToInAppLink, entryData == null ? void 0 : entryData.entry_type, ledgerEntrySource]);
28798
+ return (_b2 = renderInAppLink(linkingMetadata)) != null ? _b2 : defaultBadge;
28799
+ }, [renderInAppLink, entryData == null ? void 0 : entryData.entry_type, ledgerEntrySource]);
28796
28800
  return /* @__PURE__ */ jsxs141("div", { className: "Layer__ledger-account__entry-details", children: [
28797
28801
  /* @__PURE__ */ jsx231(Header5, { className: "Layer__ledger-account__entry-details__header", children: /* @__PURE__ */ jsxs141(HeaderRow, { children: [
28798
28802
  /* @__PURE__ */ jsxs141(HeaderCol, { className: "Layer__hidden-lg Layer__hidden-xl", children: [
@@ -29243,6 +29247,17 @@ var ProfitAndLossDetailReport = ({
29243
29247
  const { businessId } = useLayerContext();
29244
29248
  const { tagFilter, dateRange } = useContext34(ProfitAndLoss2.Context);
29245
29249
  const [selectedSource, setSelectedSource] = useState59(null);
29250
+ const { renderInAppLink } = useInAppLinkContext();
29251
+ const badgeOrInAppLink = useMemo52(() => {
29252
+ var _a;
29253
+ if (!selectedSource) return void 0;
29254
+ const defaultBadge = /* @__PURE__ */ jsx237(Badge, { children: selectedSource.entityName });
29255
+ if (!renderInAppLink) {
29256
+ return defaultBadge;
29257
+ }
29258
+ const linkingMetadata = convertLedgerEntrySourceToLinkingMetadata(selectedSource);
29259
+ return (_a = renderInAppLink(linkingMetadata)) != null ? _a : defaultBadge;
29260
+ }, [renderInAppLink, selectedSource]);
29246
29261
  const dynamicBreadcrumbs = useMemo52(() => {
29247
29262
  return breadcrumbPath || [{ name: lineItemName, display_name: lineItemName }];
29248
29263
  }, [breadcrumbPath, lineItemName]);
@@ -29361,7 +29376,7 @@ var ProfitAndLossDetailReport = ({
29361
29376
  {
29362
29377
  title: (stringOverrides == null ? void 0 : stringOverrides.sourceDetailsTitle) || "Transaction source",
29363
29378
  children: [
29364
- /* @__PURE__ */ jsx237(DetailsListItem, { label: "Source", children: /* @__PURE__ */ jsx237(Badge, { children: selectedSource.entityName }) }),
29379
+ /* @__PURE__ */ jsx237(DetailsListItem, { label: "Source", children: badgeOrInAppLink }),
29365
29380
  /* @__PURE__ */ jsx237(SourceDetailView, { source: selectedSource })
29366
29381
  ]
29367
29382
  }
@@ -29400,7 +29415,8 @@ var ProfitAndLossReport = ({
29400
29415
  defaultDatePickerMode,
29401
29416
  customDateRanges,
29402
29417
  csvMoneyFormat,
29403
- view
29418
+ view,
29419
+ renderInAppLink
29404
29420
  }) => {
29405
29421
  var _a;
29406
29422
  const { comparisonConfig } = useContext35(ProfitAndLoss2.ComparisonContext);
@@ -29428,7 +29444,7 @@ var ProfitAndLossReport = ({
29428
29444
  const handleCloseDetailReport = useCallback49(() => {
29429
29445
  setSelectedLineItem(null);
29430
29446
  }, []);
29431
- return /* @__PURE__ */ jsx238(
29447
+ return /* @__PURE__ */ jsx238(InAppLinkProvider, { renderInAppLink, children: /* @__PURE__ */ jsx238(
29432
29448
  View,
29433
29449
  {
29434
29450
  type: "panel",
@@ -29481,7 +29497,7 @@ var ProfitAndLossReport = ({
29481
29497
  }
29482
29498
  )
29483
29499
  }
29484
- );
29500
+ ) });
29485
29501
  };
29486
29502
 
29487
29503
  // src/components/ProfitAndLossSummaries/ProfitAndLossSummaries.tsx
@@ -33344,7 +33360,7 @@ var ChartOfAccounts2 = (props) => {
33344
33360
  const ledgerAccountsContextData = useLedgerAccounts(
33345
33361
  (_a = props.showReversalEntries) != null ? _a : false
33346
33362
  );
33347
- return /* @__PURE__ */ jsx269(ChartOfAccountsContext.Provider, { value: chartOfAccountsContextData, children: /* @__PURE__ */ jsx269(LedgerAccountsContext.Provider, { value: ledgerAccountsContextData, children: /* @__PURE__ */ jsx269(InAppLinkProvider, { convertToInAppLink: props.getInAppLink, children: /* @__PURE__ */ jsx269(ChartOfAccountsContent, __spreadValues({}, props)) }) }) });
33363
+ return /* @__PURE__ */ jsx269(ChartOfAccountsContext.Provider, { value: chartOfAccountsContextData, children: /* @__PURE__ */ jsx269(LedgerAccountsContext.Provider, { value: ledgerAccountsContextData, children: /* @__PURE__ */ jsx269(InAppLinkProvider, { renderInAppLink: props.renderInAppLink, children: /* @__PURE__ */ jsx269(ChartOfAccountsContent, __spreadValues({}, props)) }) }) });
33348
33364
  };
33349
33365
  var ChartOfAccountsContent = ({
33350
33366
  asWidget,
@@ -33810,7 +33826,7 @@ var JournalEntryDetails = () => {
33810
33826
  reverseEntry,
33811
33827
  refetch
33812
33828
  } = useContext49(JournalContext);
33813
- const { convertToInAppLink } = useInAppLinkContext();
33829
+ const { renderInAppLink } = useInAppLinkContext();
33814
33830
  const [reverseEntryProcessing, setReverseEntryProcessing] = useState69(false);
33815
33831
  const [reverseEntryError, setReverseEntryError] = useState69();
33816
33832
  const entry = useMemo67(() => {
@@ -33826,12 +33842,12 @@ var JournalEntryDetails = () => {
33826
33842
  var _a2, _b2;
33827
33843
  const badgeContent = (_a2 = ledgerEntrySource == null ? void 0 : ledgerEntrySource.entityName) != null ? _a2 : entry == null ? void 0 : entry.entry_type;
33828
33844
  const defaultBadge = /* @__PURE__ */ jsx270(Badge, { children: badgeContent });
33829
- if (!convertToInAppLink || !ledgerEntrySource) {
33845
+ if (!renderInAppLink || !ledgerEntrySource) {
33830
33846
  return defaultBadge;
33831
33847
  }
33832
33848
  const linkingMetadata = convertLedgerEntrySourceToLinkingMetadata(ledgerEntrySource);
33833
- return (_b2 = convertToInAppLink(linkingMetadata)) != null ? _b2 : defaultBadge;
33834
- }, [convertToInAppLink, entry == null ? void 0 : entry.entry_type, ledgerEntrySource]);
33849
+ return (_b2 = renderInAppLink(linkingMetadata)) != null ? _b2 : defaultBadge;
33850
+ }, [renderInAppLink, entry == null ? void 0 : entry.entry_type, ledgerEntrySource]);
33835
33851
  const sortedLineItems = useMemo67(
33836
33852
  () => {
33837
33853
  var _a2;
@@ -34750,7 +34766,7 @@ var JOURNAL_CONFIG = {
34750
34766
  var Journal = (props) => {
34751
34767
  const JournalContextData = useJournal();
34752
34768
  const AccountsContextData = useChartOfAccounts();
34753
- return /* @__PURE__ */ jsx277(ChartOfAccountsContext.Provider, { value: AccountsContextData, children: /* @__PURE__ */ jsx277(JournalContext.Provider, { value: JournalContextData, children: /* @__PURE__ */ jsx277(InAppLinkProvider, { convertToInAppLink: props.convertToInAppLink, children: /* @__PURE__ */ jsx277(JournalContent, __spreadValues({}, props)) }) }) });
34769
+ return /* @__PURE__ */ jsx277(ChartOfAccountsContext.Provider, { value: AccountsContextData, children: /* @__PURE__ */ jsx277(JournalContext.Provider, { value: JournalContextData, children: /* @__PURE__ */ jsx277(InAppLinkProvider, { renderInAppLink: props.renderInAppLink, children: /* @__PURE__ */ jsx277(JournalContent, __spreadValues({}, props)) }) }) });
34754
34770
  };
34755
34771
  var JournalContent = ({
34756
34772
  asWidget,
@@ -37943,7 +37959,7 @@ var BankTransactionsWithLinkedAccounts = ({
37943
37959
  showUploadOptions = false,
37944
37960
  mobileComponent,
37945
37961
  stringOverrides,
37946
- convertToInAppLink
37962
+ renderInAppLink
37947
37963
  }) => {
37948
37964
  return /* @__PURE__ */ jsxs200(
37949
37965
  View,
@@ -37974,7 +37990,7 @@ var BankTransactionsWithLinkedAccounts = ({
37974
37990
  mobileComponent,
37975
37991
  mode,
37976
37992
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.bankTransactions,
37977
- convertToInAppLink
37993
+ renderInAppLink
37978
37994
  }
37979
37995
  )
37980
37996
  ]
@@ -37991,7 +38007,7 @@ var GeneralLedgerView = ({
37991
38007
  showTitle = true,
37992
38008
  stringOverrides,
37993
38009
  chartOfAccountsOptions,
37994
- convertToInAppLink
38010
+ renderInAppLink
37995
38011
  }) => {
37996
38012
  const [activeTab, setActiveTab] = useState79("chartOfAccounts");
37997
38013
  return /* @__PURE__ */ jsx319(ProfitAndLoss2, { asContainer: false, children: /* @__PURE__ */ jsxs201(
@@ -38027,13 +38043,13 @@ var GeneralLedgerView = ({
38027
38043
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.chartOfAccounts,
38028
38044
  templateAccountsEditable: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.templateAccountsEditable,
38029
38045
  showReversalEntries: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.showReversalEntries,
38030
- getInAppLink: convertToInAppLink
38046
+ renderInAppLink
38031
38047
  }
38032
38048
  ) : /* @__PURE__ */ jsx319(
38033
38049
  Journal,
38034
38050
  {
38035
38051
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.journal,
38036
- convertToInAppLink
38052
+ renderInAppLink
38037
38053
  }
38038
38054
  )
38039
38055
  ]
@@ -40291,7 +40307,8 @@ var Reports = ({
40291
40307
  enabledReports = ["profitAndLoss", "balanceSheet", "statementOfCashFlow"],
40292
40308
  comparisonConfig,
40293
40309
  profitAndLossConfig,
40294
- statementOfCashFlowConfig
40310
+ statementOfCashFlowConfig,
40311
+ renderInAppLink
40295
40312
  }) => {
40296
40313
  var _a;
40297
40314
  const [activeTab, setActiveTab] = useState84(enabledReports[0]);
@@ -40327,7 +40344,8 @@ var Reports = ({
40327
40344
  stringOverrides,
40328
40345
  profitAndLossConfig,
40329
40346
  statementOfCashFlowConfig,
40330
- view
40347
+ view,
40348
+ renderInAppLink
40331
40349
  }
40332
40350
  ) }) }) })
40333
40351
  ]
@@ -40339,14 +40357,16 @@ var ReportsPanel = ({
40339
40357
  stringOverrides,
40340
40358
  profitAndLossConfig,
40341
40359
  statementOfCashFlowConfig,
40342
- view
40360
+ view,
40361
+ renderInAppLink
40343
40362
  }) => {
40344
40363
  return /* @__PURE__ */ jsxs212(Fragment56, { children: [
40345
40364
  openReport === "profitAndLoss" && /* @__PURE__ */ jsx340(
40346
40365
  ProfitAndLossReport,
40347
40366
  __spreadValues({
40348
40367
  stringOverrides,
40349
- view
40368
+ view,
40369
+ renderInAppLink
40350
40370
  }, profitAndLossConfig)
40351
40371
  ),
40352
40372
  openReport === "balanceSheet" && /* @__PURE__ */ jsx340(BalanceSheet, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.balanceSheet }),