@layerfi/components 0.1.102-alpha.1 → 0.1.102-alpha.2

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 useState8 } from "react";
5570
5570
  import { useReducer, useEffect as useEffect4 } from "react";
5571
5571
 
5572
5572
  // package.json
5573
- var version = "0.1.102-alpha.1";
5573
+ var version = "0.1.102-alpha.2";
5574
5574
 
5575
5575
  // src/models/APIError.ts
5576
5576
  var APIError = class _APIError extends Error {
@@ -11540,20 +11540,34 @@ function ModalActions({ children }) {
11540
11540
  }
11541
11541
 
11542
11542
  // src/components/ui/Stack/Stack.tsx
11543
+ import { forwardRef as forwardRef11 } from "react";
11543
11544
  import classNames22 from "classnames";
11544
11545
  import { jsx as jsx71 } from "react/jsx-runtime";
11545
11546
  var CLASS_NAME2 = "Layer__Stack";
11546
- function Stack(_a) {
11547
- var _b = _a, { align, children, direction, gap, justify, pbs, pbe, pis, pie, fluid, className } = _b, restProps = __objRest(_b, ["align", "children", "direction", "gap", "justify", "pbs", "pbe", "pis", "pie", "fluid", "className"]);
11548
- const dataProperties = toDataProperties({ align, direction, gap, justify, pbs, pbe, pis, pie, fluid });
11549
- return /* @__PURE__ */ jsx71("div", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames22(CLASS_NAME2, className), children }));
11550
- }
11551
- function VStack(props) {
11552
- return /* @__PURE__ */ jsx71(Stack, __spreadProps(__spreadValues({}, props), { direction: "column" }));
11553
- }
11554
- function HStack(props) {
11555
- return /* @__PURE__ */ jsx71(Stack, __spreadProps(__spreadValues({}, props), { direction: "row" }));
11556
- }
11547
+ var Stack = forwardRef11(
11548
+ (_a, ref) => {
11549
+ var _b = _a, { align, children, direction, gap, justify, pbs, pbe, pis, pie, fluid, className } = _b, restProps = __objRest(_b, ["align", "children", "direction", "gap", "justify", "pbs", "pbe", "pis", "pie", "fluid", "className"]);
11550
+ const dataProperties = toDataProperties({ align, direction, gap, justify, pbs, pbe, pis, pie, fluid });
11551
+ return /* @__PURE__ */ jsx71(
11552
+ "div",
11553
+ __spreadProps(__spreadValues(__spreadValues({
11554
+ ref
11555
+ }, restProps), dataProperties), {
11556
+ className: classNames22(CLASS_NAME2, className),
11557
+ children
11558
+ })
11559
+ );
11560
+ }
11561
+ );
11562
+ Stack.displayName = "Stack";
11563
+ var VStack = forwardRef11((props, ref) => {
11564
+ return /* @__PURE__ */ jsx71(Stack, __spreadProps(__spreadValues({}, props), { ref, direction: "column" }));
11565
+ });
11566
+ VStack.displayName = "VStack";
11567
+ var HStack = forwardRef11((props, ref) => {
11568
+ return /* @__PURE__ */ jsx71(Stack, __spreadProps(__spreadValues({}, props), { ref, direction: "row" }));
11569
+ });
11570
+ HStack.displayName = "HStack";
11557
11571
  var Spacer = () => /* @__PURE__ */ jsx71("div", { className: "Layer__Spacer" });
11558
11572
 
11559
11573
  // src/components/utility/ConditionalList.tsx
@@ -12225,39 +12239,6 @@ var Select = ({
12225
12239
  // src/components/Input/InputWithBadge.tsx
12226
12240
  import classNames28 from "classnames";
12227
12241
  import { jsx as jsx84, jsxs as jsxs47 } from "react/jsx-runtime";
12228
- var InputWithBadge = (_a) => {
12229
- var _b = _a, {
12230
- className,
12231
- isInvalid,
12232
- errorMessage,
12233
- leftText,
12234
- badge,
12235
- variant = "default" /* DEFAULT */
12236
- } = _b, props = __objRest(_b, [
12237
- "className",
12238
- "isInvalid",
12239
- "errorMessage",
12240
- "leftText",
12241
- "badge",
12242
- "variant"
12243
- ]);
12244
- const baseClassName = classNames28(
12245
- "Layer__input",
12246
- isInvalid ? "Layer__input--error" : "",
12247
- leftText ? "Layer__input--with-left-text" : "",
12248
- className
12249
- );
12250
- return /* @__PURE__ */ jsxs47(Tooltip, { disabled: !isInvalid || !errorMessage, children: [
12251
- /* @__PURE__ */ jsxs47(TooltipTrigger, { className: "Layer__input-tooltip", children: [
12252
- /* @__PURE__ */ jsxs47("div", { className: "Layer__input-with-badge", children: [
12253
- /* @__PURE__ */ jsx84("input", __spreadProps(__spreadValues({}, props), { className: baseClassName })),
12254
- badge && /* @__PURE__ */ jsx84(Badge, { variant, children: badge })
12255
- ] }),
12256
- leftText && /* @__PURE__ */ jsx84("span", { className: "Layer__input-left-text", children: leftText })
12257
- ] }),
12258
- /* @__PURE__ */ jsx84(TooltipContent, { className: "Layer__tooltip", children: errorMessage })
12259
- ] });
12260
- };
12261
12242
 
12262
12243
  // src/components/Input/MultiSelect.tsx
12263
12244
  import { useCallback as useCallback4 } from "react";
@@ -12326,6 +12307,7 @@ var AmountInput = (_a) => {
12326
12307
  leftText,
12327
12308
  errorMessage,
12328
12309
  isInvalid,
12310
+ badge,
12329
12311
  placeholder = "$0.00"
12330
12312
  } = _b, props = __objRest(_b, [
12331
12313
  "onChange",
@@ -12333,30 +12315,38 @@ var AmountInput = (_a) => {
12333
12315
  "leftText",
12334
12316
  "errorMessage",
12335
12317
  "isInvalid",
12318
+ "badge",
12336
12319
  "placeholder"
12337
12320
  ]);
12338
12321
  const baseClassName = classNames30(
12339
12322
  "Layer__input Layer__amount-input",
12323
+ badge ? "Layer__amount-input--align-left" : "Layer__amount-input--align-right",
12340
12324
  isInvalid ? "Layer__input--error" : "",
12341
12325
  leftText ? "Layer__input--with-left-text" : "",
12342
12326
  className
12343
12327
  );
12328
+ const currencyInput = /* @__PURE__ */ jsx86(
12329
+ CurrencyInput,
12330
+ __spreadProps(__spreadValues({}, props), {
12331
+ intlConfig: {
12332
+ locale: "en-US",
12333
+ currency: "USD"
12334
+ },
12335
+ prefix: "$",
12336
+ placeholder,
12337
+ decimalScale: 2,
12338
+ decimalsLimit: 2,
12339
+ disableAbbreviations: true,
12340
+ onValueChange: onChange,
12341
+ className: baseClassName
12342
+ })
12343
+ );
12344
12344
  return /* @__PURE__ */ jsxs49(Tooltip, { disabled: !isInvalid || !errorMessage, children: [
12345
12345
  /* @__PURE__ */ jsxs49(TooltipTrigger, { className: "Layer__input-tooltip", children: [
12346
- /* @__PURE__ */ jsx86(
12347
- CurrencyInput,
12348
- __spreadProps(__spreadValues({}, props), {
12349
- intlConfig: {
12350
- locale: "en-US",
12351
- currency: "USD"
12352
- },
12353
- prefix: "$",
12354
- placeholder,
12355
- decimalsLimit: 2,
12356
- onValueChange: onChange,
12357
- className: baseClassName
12358
- })
12359
- ),
12346
+ badge ? /* @__PURE__ */ jsxs49("div", { className: "Layer__input-with-badge", children: [
12347
+ currencyInput,
12348
+ badge
12349
+ ] }) : currencyInput,
12360
12350
  leftText && /* @__PURE__ */ jsx86("span", { className: "Layer__input-left-text", children: leftText })
12361
12351
  ] }),
12362
12352
  /* @__PURE__ */ jsx86(TooltipContent, { className: "Layer__tooltip", children: errorMessage })
@@ -13036,10 +13026,14 @@ var humanizeEnum = (text) => {
13036
13026
  };
13037
13027
  var convertNumberToCurrency = (amount) => {
13038
13028
  if (typeof amount !== "number" || isNaN(amount)) return "";
13039
- const formattedValue = amount.toLocaleString("en-US");
13040
- return formattedValue.length > 0 ? `$${formattedValue}` : "";
13029
+ const formattedValue = amount.toLocaleString("en-US", {
13030
+ style: "currency",
13031
+ currency: "USD",
13032
+ minimumFractionDigits: 2,
13033
+ maximumFractionDigits: 2
13034
+ });
13035
+ return formattedValue;
13041
13036
  };
13042
- var convertCurrencyToNumber = (amount) => amount.replace("$", "").replace(",", "").replace(/[^\d.]/g, "").replace(/(?!^)-/g, "").replace(/(\..*)\./g, "$1").replace(/(\.\d{2})\d+/, "$1").replace(/^0(?!\.)/, "");
13043
13037
  var convertToCents = (amount) => {
13044
13038
  try {
13045
13039
  if (amount === void 0 || amount === null) {
@@ -13270,7 +13264,7 @@ var LinkedAccountsComponent = ({
13270
13264
  };
13271
13265
 
13272
13266
  // src/components/UploadTransactions/UploadTransactions.tsx
13273
- import { useCallback as useCallback13, useState as useState22 } from "react";
13267
+ import { useCallback as useCallback12, useState as useState22 } from "react";
13274
13268
 
13275
13269
  // src/components/Wizard/Wizard.tsx
13276
13270
  import {
@@ -13661,7 +13655,7 @@ var CustomAccountForm = ({ initialAccountName, onCancel, onSuccess }) => {
13661
13655
  submitError && /* @__PURE__ */ jsx94(ErrorText, { pb: "xs", children: submitError }),
13662
13656
  /* @__PURE__ */ jsx94(Spacer, {}),
13663
13657
  onCancel && /* @__PURE__ */ jsx94(Button, { type: "button", variant: "secondary" /* secondary */, onClick: onCancel, children: "Cancel" }),
13664
- /* @__PURE__ */ jsx94(SubmitButton, { type: "submit", processing: isSubmitting, noIcon: !isSubmitting, withRetry: true, error: submitError, children: "Submit" })
13658
+ /* @__PURE__ */ jsx94(SubmitButton, { type: "submit", processing: isSubmitting, noIcon: !isSubmitting, withRetry: true, error: submitError, children: submitError ? "Retry" : "Submit" })
13665
13659
  ] })
13666
13660
  ] })
13667
13661
  }
@@ -13983,6 +13977,7 @@ function UploadTransactionsUploadCsvStep({ selectedAccount, onSelectAccount, sel
13983
13977
  "Layer__upload-transactions__select-account-name-input",
13984
13978
  !!customAccountsError && "Layer__upload-transactions__select-account-name-input--error"
13985
13979
  );
13980
+ const hasSelectedAccount = selectedAccount && selectedAccount.value !== "new_account";
13986
13981
  return /* @__PURE__ */ jsxs58(VStack, { gap: "lg", children: [
13987
13982
  /* @__PURE__ */ jsxs58(HStack, { fluid: true, align: "center", gap: "lg", className: "Layer__upload-transactions__select-account-name-field", children: [
13988
13983
  /* @__PURE__ */ jsx99(Label, { htmlFor: "account_name", children: "Account name" }),
@@ -14007,7 +14002,7 @@ function UploadTransactionsUploadCsvStep({ selectedAccount, onSelectAccount, sel
14007
14002
  selectedAccount && selectedAccount.value === "new_account" && /* @__PURE__ */ jsx99(VStack, { className: "Layer__upload-transactions__create-account-form", children: /* @__PURE__ */ jsx99(
14008
14003
  CustomAccountForm,
14009
14004
  {
14010
- initialAccountName: (_a = selectedAccount == null ? void 0 : selectedAccount.createdAccountName) != null ? _a : "",
14005
+ initialAccountName: (_a = selectedAccount.createdAccountName) != null ? _a : "",
14011
14006
  onCancel: onCancelCreateAccount,
14012
14007
  onSuccess: onCreateAccountSuccess
14013
14008
  }
@@ -14035,8 +14030,8 @@ function UploadTransactionsUploadCsvStep({ selectedAccount, onSelectAccount, sel
14035
14030
  /* @__PURE__ */ jsx99(
14036
14031
  SubmitButton,
14037
14032
  {
14038
- tooltip: selectedFile && (!selectedAccount || selectedAccount.value === "new_account") ? "Select an account" : null,
14039
- disabled: !selectedAccount || selectedAccount.value === "new_account" || !selectedFile,
14033
+ tooltip: selectedFile && !hasSelectedAccount ? "Select an account" : null,
14034
+ disabled: !hasSelectedAccount || !selectedFile,
14040
14035
  processing: isParsingCsv,
14041
14036
  error: hasParseCsvError,
14042
14037
  onClick: onClickContinue,
@@ -14050,13 +14045,11 @@ function UploadTransactionsUploadCsvStep({ selectedAccount, onSelectAccount, sel
14050
14045
  }
14051
14046
 
14052
14047
  // src/components/UploadTransactions/UploadTransactionsValidateCsvStep.tsx
14053
- import { useCallback as useCallback12 } from "react";
14048
+ import { useCallback as useCallback11 } from "react";
14054
14049
  import { RefreshCcw as RefreshCcw2 } from "lucide-react";
14055
14050
 
14056
14051
  // src/hooks/customAccounts/useCreateCustomAccountTransactions.ts
14057
- import { useCallback as useCallback11 } from "react";
14058
14052
  import useSWRMutation7 from "swr/mutation";
14059
- import { useSWRConfig as useSWRConfig4 } from "swr";
14060
14053
  var createCustomAccountTransactions = post(({ businessId, customAccountId }) => `/v1/businesses/${businessId}/custom-accounts/${customAccountId}/transactions`);
14061
14054
  function buildKey11({
14062
14055
  access_token: accessToken,
@@ -14075,8 +14068,7 @@ function buildKey11({
14075
14068
  function useCreateCustomAccountTransactions() {
14076
14069
  const { data } = useAuth();
14077
14070
  const { businessId } = useLayerContext();
14078
- const { mutate } = useSWRConfig4();
14079
- const mutationResponse = useSWRMutation7(
14071
+ return useSWRMutation7(
14080
14072
  () => buildKey11(__spreadProps(__spreadValues({}, data), {
14081
14073
  businessId
14082
14074
  })),
@@ -14099,29 +14091,6 @@ function useCreateCustomAccountTransactions() {
14099
14091
  throwOnError: false
14100
14092
  }
14101
14093
  );
14102
- const { trigger: originalTrigger } = mutationResponse;
14103
- const stableProxiedTrigger = useCallback11(
14104
- (...triggerParameters) => __async(null, null, function* () {
14105
- const triggerResult = yield originalTrigger(...triggerParameters);
14106
- void mutate((key) => withSWRKeyTags(
14107
- key,
14108
- (tags) => tags.includes(BANK_TRANSACTIONS_TAG_KEY)
14109
- ));
14110
- return triggerResult;
14111
- }),
14112
- [
14113
- originalTrigger,
14114
- mutate
14115
- ]
14116
- );
14117
- return new Proxy(mutationResponse, {
14118
- get(target, prop) {
14119
- if (prop === "trigger") {
14120
- return stableProxiedTrigger;
14121
- }
14122
- return Reflect.get(target, prop);
14123
- }
14124
- });
14125
14094
  }
14126
14095
 
14127
14096
  // src/components/CsvUpload/ValidateCsvTable.tsx
@@ -14192,7 +14161,6 @@ function ValidateCsvTable({ data, headers, formatters: formatters2, className })
14192
14161
  getCoreRowModel: getCoreRowModel(),
14193
14162
  getSortedRowModel: getSortedRowModel()
14194
14163
  });
14195
- const tableContainerRef = useRef9(null);
14196
14164
  return /* @__PURE__ */ jsxs59("div", { className: `${className} Layer__csv-upload__validate-csv-table__container`, children: [
14197
14165
  /* @__PURE__ */ jsx100("table", { className: "Layer__table", children: /* @__PURE__ */ jsx100("thead", { className: "Layer__csv-upload__validate-csv-table__thead", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx100("tr", { className: "Layer__csv-upload__validate-csv-table__header-row", children: headerGroup.headers.map((header) => {
14198
14166
  const headerCellClassName = classNames35(
@@ -14202,19 +14170,20 @@ function ValidateCsvTable({ data, headers, formatters: formatters2, className })
14202
14170
  );
14203
14171
  return /* @__PURE__ */ jsx100("th", { className: headerCellClassName, children: flexRender(header.column.columnDef.header, header.getContext()) }, header.id);
14204
14172
  }) }, headerGroup.id)) }) }),
14205
- /* @__PURE__ */ jsx100("div", { ref: tableContainerRef, className: "Layer__csv-upload__validate-csv-table__scroll_container", children: /* @__PURE__ */ jsx100("table", { className: "Layer__table", children: /* @__PURE__ */ jsx100(ValidateCsvTableBody, { table, tableContainerRef }) }) })
14173
+ /* @__PURE__ */ jsx100(ValidateCsvTableBody, { table })
14206
14174
  ] });
14207
14175
  }
14208
- function ValidateCsvTableBody({ table, tableContainerRef }) {
14176
+ function ValidateCsvTableBody({ table }) {
14209
14177
  const { rows } = table.getRowModel();
14178
+ const containerRef = useRef9(null);
14210
14179
  const rowVirtualizer = useVirtualizer({
14211
14180
  count: rows.length,
14212
14181
  estimateSize: () => ROW_HEIGHT,
14213
- getScrollElement: () => tableContainerRef.current,
14182
+ getScrollElement: () => containerRef.current,
14214
14183
  measureElement: typeof window !== "undefined" && navigator.userAgent.indexOf("Firefox") === -1 ? (element) => element == null ? void 0 : element.getBoundingClientRect().height : void 0,
14215
14184
  overscan: 5
14216
14185
  });
14217
- return /* @__PURE__ */ jsxs59("tbody", { children: [
14186
+ return /* @__PURE__ */ jsx100("div", { ref: containerRef, className: "Layer__csv-upload__validate-csv-table__scroll_container", children: /* @__PURE__ */ jsx100("table", { className: "Layer__table", children: /* @__PURE__ */ jsxs59("tbody", { children: [
14218
14187
  /* @__PURE__ */ jsx100("tr", { style: { height: BODY_HEIGHT }, children: /* @__PURE__ */ jsx100("td", { style: { height: BODY_HEIGHT, padding: 0 }, colSpan: table.getAllColumns().length - 1 }) }),
14219
14188
  rowVirtualizer.getVirtualItems().map((virtualRow) => {
14220
14189
  const row = rows[virtualRow.index];
@@ -14228,7 +14197,7 @@ function ValidateCsvTableBody({ table, tableContainerRef }) {
14228
14197
  row.id
14229
14198
  );
14230
14199
  })
14231
- ] });
14200
+ ] }) }) });
14232
14201
  }
14233
14202
  function ValidateCsvTableRow({ row, virtualRow, rowVirtualizer }) {
14234
14203
  const tableRowClassName = classNames35(
@@ -14272,7 +14241,7 @@ function UploadTransactionsValidateCsvStep({ parseCsvResponse, selectedAccountId
14272
14241
  new_transactions_preview: transactionsPreview,
14273
14242
  new_transactions_request: transactionsRequest
14274
14243
  } = parseCsvResponse;
14275
- const onClickUploadTransactions = useCallback12(() => {
14244
+ const onClickUploadTransactions = useCallback11(() => {
14276
14245
  void uploadTransactions(__spreadProps(__spreadValues({}, transactionsRequest), {
14277
14246
  customAccountId: selectedAccountId
14278
14247
  }));
@@ -14308,7 +14277,7 @@ function UploadTransactionsValidateCsvStep({ parseCsvResponse, selectedAccountId
14308
14277
  onClick: onClickUploadTransactions,
14309
14278
  action: "upload" /* UPLOAD */,
14310
14279
  withRetry: true,
14311
- children: "Upload transactions"
14280
+ children: uploadTransactionsError ? "Retry" : "Upload transactions"
14312
14281
  }
14313
14282
  )
14314
14283
  ] })
@@ -14323,24 +14292,25 @@ function UploadTransactions({ onComplete }) {
14323
14292
  const [file, setFile] = useState22(null);
14324
14293
  const [parseCsvResponse, setParseCsvResponse] = useState22(null);
14325
14294
  const isValid2 = parseCsvResponse == null ? void 0 : parseCsvResponse.is_valid;
14326
- const onSelectAccount = useCallback13((account) => {
14295
+ const onSelectAccount = useCallback12((account) => {
14327
14296
  setSelectedAccount(account);
14328
14297
  }, []);
14329
- const onSelectFile = useCallback13((file2) => {
14298
+ const onSelectFile = useCallback12((file2) => {
14330
14299
  setFile(file2);
14331
14300
  setParseCsvResponse(null);
14332
14301
  }, []);
14333
- const goBack = useCallback13((step = 1) => setCurrentStep(currentStep - step), [currentStep]);
14334
- const goForward = useCallback13((step = 1) => setCurrentStep(currentStep + step), [currentStep]);
14335
- const onParseCsv = useCallback13((parseCsvResponse2) => {
14302
+ const onParseCsv = useCallback12((parseCsvResponse2) => {
14336
14303
  setParseCsvResponse(parseCsvResponse2);
14337
- goForward();
14338
- }, [goForward]);
14339
- const onReupload = useCallback13(() => {
14304
+ setCurrentStep(1 /* ValidateCsv */);
14305
+ }, []);
14306
+ const goRestartFlow = useCallback12(() => {
14307
+ setCurrentStep(0 /* UploadCsv */);
14308
+ }, []);
14309
+ const onReupload = useCallback12(() => {
14340
14310
  setFile(null);
14341
14311
  setParseCsvResponse(null);
14342
- goBack();
14343
- }, [goBack]);
14312
+ setCurrentStep(0 /* UploadCsv */);
14313
+ }, []);
14344
14314
  return /* @__PURE__ */ jsx102("section", { className: "Layer__component", children: /* @__PURE__ */ jsxs61(
14345
14315
  Wizard,
14346
14316
  {
@@ -14376,7 +14346,7 @@ function UploadTransactions({ onComplete }) {
14376
14346
  {
14377
14347
  selectedAccountId: selectedAccount.value,
14378
14348
  parseCsvResponse,
14379
- onGoBack: goBack,
14349
+ onGoBack: goRestartFlow,
14380
14350
  onReupload
14381
14351
  }
14382
14352
  )
@@ -15320,10 +15290,10 @@ var CategorySelect = ({
15320
15290
 
15321
15291
  // src/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow.tsx
15322
15292
  import {
15323
- forwardRef as forwardRef12,
15293
+ forwardRef as forwardRef13,
15324
15294
  useImperativeHandle as useImperativeHandle2,
15325
15295
  useState as useState28,
15326
- useCallback as useCallback15,
15296
+ useCallback as useCallback14,
15327
15297
  useEffect as useEffect14,
15328
15298
  useRef as useRef11
15329
15299
  } from "react";
@@ -15455,7 +15425,7 @@ var Trash = (_a) => {
15455
15425
  var Trash_default = Trash;
15456
15426
 
15457
15427
  // src/components/BankTransactionReceipts/BankTransactionReceipts.tsx
15458
- import { forwardRef as forwardRef11, useImperativeHandle } from "react";
15428
+ import { forwardRef as forwardRef12, useImperativeHandle } from "react";
15459
15429
 
15460
15430
  // src/contexts/ReceiptsContext/ReceiptsContext.ts
15461
15431
  import { createContext as createContext11, useContext as useContext18 } from "react";
@@ -15775,12 +15745,12 @@ var openReceiptInNewTab = (url, index) => (e) => {
15775
15745
  `);
15776
15746
  }
15777
15747
  };
15778
- var BankTransactionReceiptsWithProvider = forwardRef11((_a, ref) => {
15748
+ var BankTransactionReceiptsWithProvider = forwardRef12((_a, ref) => {
15779
15749
  var _b = _a, { bankTransaction, isActive } = _b, props = __objRest(_b, ["bankTransaction", "isActive"]);
15780
15750
  return /* @__PURE__ */ jsx118(ReceiptsProvider, { bankTransaction, isActive, children: /* @__PURE__ */ jsx118(BankTransactionReceipts, __spreadProps(__spreadValues({}, props), { ref })) });
15781
15751
  });
15782
15752
  BankTransactionReceiptsWithProvider.displayName = "BankTransactionReceiptsWithProvider";
15783
- var BankTransactionReceipts = forwardRef11(
15753
+ var BankTransactionReceipts = forwardRef12(
15784
15754
  ({
15785
15755
  classNamePrefix = "Layer",
15786
15756
  floatingActions = false,
@@ -16499,8 +16469,8 @@ function useBankTransactionMetadata({ bankTransactionId }) {
16499
16469
 
16500
16470
  // src/hooks/useBankTransactions/useUpdateBankTransactionMetadata.ts
16501
16471
  import useSWRMutation8 from "swr/mutation";
16502
- import { useSWRConfig as useSWRConfig5 } from "swr";
16503
- import { useCallback as useCallback14 } from "react";
16472
+ import { useSWRConfig as useSWRConfig4 } from "swr";
16473
+ import { useCallback as useCallback13 } from "react";
16504
16474
  var UPDATE_BANK_TRANSACTION_METADATA_TAG_KEY = "#update-bank-transaction-metadata";
16505
16475
  function buildKey15({
16506
16476
  access_token: accessToken,
@@ -16521,7 +16491,7 @@ function buildKey15({
16521
16491
  function useUpdateBankTransactionMetadata({ bankTransactionId, onSuccess }) {
16522
16492
  const { data: auth } = useAuth();
16523
16493
  const { businessId } = useLayerContext();
16524
- const { mutate } = useSWRConfig5();
16494
+ const { mutate } = useSWRConfig4();
16525
16495
  const mutationResponse = useSWRMutation8(
16526
16496
  () => buildKey15({
16527
16497
  access_token: auth == null ? void 0 : auth.access_token,
@@ -16549,7 +16519,7 @@ function useUpdateBankTransactionMetadata({ bankTransactionId, onSuccess }) {
16549
16519
  }
16550
16520
  );
16551
16521
  const { trigger: originalTrigger } = mutationResponse;
16552
- const stableProxiedTrigger = useCallback14(
16522
+ const stableProxiedTrigger = useCallback13(
16553
16523
  (...triggerParameters) => __async(null, null, function* () {
16554
16524
  const triggerResult = yield originalTrigger(...triggerParameters);
16555
16525
  void mutate((key) => withSWRKeyTags(
@@ -16644,7 +16614,7 @@ var validateSplit = (splitData) => {
16644
16614
  });
16645
16615
  return valid;
16646
16616
  };
16647
- var ExpandedBankTransactionRow = forwardRef12(
16617
+ var ExpandedBankTransactionRow = forwardRef13(
16648
16618
  ({
16649
16619
  bankTransaction,
16650
16620
  isOpen = false,
@@ -16819,11 +16789,11 @@ var ExpandedBankTransactionRow = forwardRef12(
16819
16789
  yield matchBankTransaction2(bankTransaction.id, foundMatch.id);
16820
16790
  close2();
16821
16791
  });
16822
- const getDivHeight = useCallback15(() => {
16792
+ const getDivHeight = useCallback14(() => {
16823
16793
  const { height: height2 } = bodyRef.current ? bodyRef.current.getBoundingClientRect() : { height: void 0 };
16824
16794
  return height2 || 0;
16825
16795
  }, []);
16826
- const handleTransitionEnd = useCallback15(
16796
+ const handleTransitionEnd = useCallback14(
16827
16797
  (e) => {
16828
16798
  if (e.propertyName === "height") {
16829
16799
  setHeight(isOpen ? "auto" : 0);
@@ -19361,7 +19331,7 @@ var PaginationContent = ({
19361
19331
  };
19362
19332
 
19363
19333
  // src/components/BankTransactions/BankTransactionsHeader.tsx
19364
- import { useCallback as useCallback17, useState as useState39 } from "react";
19334
+ import { useCallback as useCallback16, useState as useState39 } from "react";
19365
19335
  import classNames54 from "classnames";
19366
19336
  import { endOfMonth as endOfMonth5, startOfMonth as startOfMonth5 } from "date-fns";
19367
19337
 
@@ -19497,7 +19467,7 @@ function useBankTransactionsDownload() {
19497
19467
  }
19498
19468
 
19499
19469
  // src/components/utility/InvisibleDownload.tsx
19500
- import { forwardRef as forwardRef13, useCallback as useCallback16, useImperativeHandle as useImperativeHandle3, useRef as useRef20 } from "react";
19470
+ import { forwardRef as forwardRef14, useCallback as useCallback15, useImperativeHandle as useImperativeHandle3, useRef as useRef20 } from "react";
19501
19471
 
19502
19472
  // src/utils/delay/runDelayed.ts
19503
19473
  var DEFAULT_DELAY_MS = 50;
@@ -19511,14 +19481,14 @@ function runDelayedSync(block, delayMs = DEFAULT_DELAY_MS) {
19511
19481
  import { jsx as jsx158 } from "react/jsx-runtime";
19512
19482
  function useInvisibleDownload() {
19513
19483
  const invisibleDownloadRef = useRef20(null);
19514
- const triggerInvisibleDownload = useCallback16((options) => {
19484
+ const triggerInvisibleDownload = useCallback15((options) => {
19515
19485
  var _a;
19516
19486
  void ((_a = invisibleDownloadRef.current) == null ? void 0 : _a.trigger(options));
19517
19487
  }, []);
19518
19488
  return { invisibleDownloadRef, triggerInvisibleDownload };
19519
19489
  }
19520
19490
  var CLASS_NAME9 = "Layer__InvisibleDownload";
19521
- var InvisibleDownload = forwardRef13((_props, ref) => {
19491
+ var InvisibleDownload = forwardRef14((_props, ref) => {
19522
19492
  const internalRef = useRef20(null);
19523
19493
  useImperativeHandle3(ref, () => ({
19524
19494
  trigger: (_0) => __async(null, [_0], function* ({ url }) {
@@ -19530,7 +19500,7 @@ var InvisibleDownload = forwardRef13((_props, ref) => {
19530
19500
  });
19531
19501
  })
19532
19502
  }));
19533
- const handleContainClick = useCallback16((event) => {
19503
+ const handleContainClick = useCallback15((event) => {
19534
19504
  event.stopPropagation();
19535
19505
  }, []);
19536
19506
  return /* @__PURE__ */ jsx158("a", { download: true, className: CLASS_NAME9, ref: internalRef, onClick: handleContainClick });
@@ -19549,7 +19519,7 @@ function TransactionsSearch({ slot }) {
19549
19519
  const debouncedSetDescription = useDebounce((value) => {
19550
19520
  setFilters({ descriptionFilter: value });
19551
19521
  });
19552
- const handleSearch = useCallback17((value) => {
19522
+ const handleSearch = useCallback16((value) => {
19553
19523
  setLocalSearch(value);
19554
19524
  void debouncedSetDescription(value);
19555
19525
  }, [debouncedSetDescription]);
@@ -20020,7 +19990,7 @@ import { useContext as useContext27 } from "react";
20020
19990
  import { useContext as useContext25 } from "react";
20021
19991
 
20022
19992
  // src/components/Integrations/IntegrationsQuickbooksItemThumb/IntegrationsQuickbooksItemThumb.tsx
20023
- import { useCallback as useCallback19, useContext as useContext24, useMemo as useMemo23, useState as useState42 } from "react";
19993
+ import { useCallback as useCallback18, useContext as useContext24, useMemo as useMemo23, useState as useState42 } from "react";
20024
19994
 
20025
19995
  // src/icons/QuickbooksIcon.tsx
20026
19996
  import { jsx as jsx163, jsxs as jsxs104 } from "react/jsx-runtime";
@@ -20192,14 +20162,14 @@ var IntegrationsQuickbooksItemThumbFooter = ({ quickbooksUiState }) => {
20192
20162
  import { AlertCircle as AlertCircle2, CheckIcon } from "lucide-react";
20193
20163
 
20194
20164
  // src/components/Integrations/IntegrationsQuickbooksItemThumb/IntegrationsQuickbooksUnlinkConfirmationModal.tsx
20195
- import { useCallback as useCallback18, useContext as useContext23, useState as useState41 } from "react";
20165
+ import { useCallback as useCallback17, useContext as useContext23, useState as useState41 } from "react";
20196
20166
  import { Fragment as Fragment21, jsx as jsx168, jsxs as jsxs108 } from "react/jsx-runtime";
20197
20167
  function IntegrationsQuickbooksUnlinkConfirmationModalContent({ onClose }) {
20198
20168
  const { unlinkQuickbooks } = useContext23(QuickbooksContext);
20199
20169
  const [isProcessing, setIsProcessing] = useState41(false);
20200
20170
  const [hasFailed, setHasFailed] = useState41(false);
20201
20171
  const unlinkErrorText = "Unlink failed. Check connection and retry in few seconds.";
20202
- const onClickUnlinkQuickbooks = useCallback18(() => {
20172
+ const onClickUnlinkQuickbooks = useCallback17(() => {
20203
20173
  setIsProcessing(true);
20204
20174
  unlinkQuickbooks().then(() => {
20205
20175
  onClose();
@@ -20281,7 +20251,7 @@ var IntegrationsQuickbooksItemThumb = () => {
20281
20251
  const { quickbooksConnectionStatus, syncFromQuickbooks: syncFromQuickbooks2 } = useContext24(QuickbooksContext);
20282
20252
  const [hasSynced, setHasSynced] = useState42(false);
20283
20253
  const [isConfirmationModalOpen, setIsConfirmationModalOpen] = useState42(false);
20284
- const onSync = useCallback19(() => {
20254
+ const onSync = useCallback18(() => {
20285
20255
  setHasSynced(true);
20286
20256
  syncFromQuickbooks2();
20287
20257
  }, [syncFromQuickbooks2]);
@@ -20332,7 +20302,7 @@ var IntegrationsContent = () => {
20332
20302
  };
20333
20303
 
20334
20304
  // src/hooks/useQuickbooks/useQuickbooks.ts
20335
- import { useCallback as useCallback20, useEffect as useEffect25, useRef as useRef22, useState as useState43 } from "react";
20305
+ import { useCallback as useCallback19, useEffect as useEffect25, useRef as useRef22, useState as useState43 } from "react";
20336
20306
  import { format as format2 } from "date-fns";
20337
20307
  var useQuickbooks = () => {
20338
20308
  var _a;
@@ -20342,7 +20312,7 @@ var useQuickbooks = () => {
20342
20312
  const [quickbooksConnectionStatus, setQuickbooksConnectionStatus] = useState43(void 0);
20343
20313
  const isSyncingFromQuickbooks = (_a = quickbooksConnectionStatus == null ? void 0 : quickbooksConnectionStatus.is_syncing) != null ? _a : false;
20344
20314
  const syncStatusIntervalRef = useRef22(null);
20345
- const fetchQuickbooksConnectionStatus = useCallback20(() => __async(null, null, function* () {
20315
+ const fetchQuickbooksConnectionStatus = useCallback19(() => __async(null, null, function* () {
20346
20316
  const newQuickbooksConnectionStatus = (yield Layer.statusOfQuickbooksConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
20347
20317
  params: { businessId }
20348
20318
  })()).data;
@@ -20363,7 +20333,7 @@ var useQuickbooks = () => {
20363
20333
  void fetchQuickbooksConnectionStatus();
20364
20334
  }
20365
20335
  }, [auth == null ? void 0 : auth.access_token, fetchQuickbooksConnectionStatus]);
20366
- const handleSyncError = useCallback20(() => {
20336
+ const handleSyncError = useCallback19(() => {
20367
20337
  setQuickbooksConnectionStatus({
20368
20338
  is_connected: true,
20369
20339
  is_syncing: false,
@@ -20371,19 +20341,19 @@ var useQuickbooks = () => {
20371
20341
  last_synced_at: format2(/* @__PURE__ */ new Date(), "yyyy-MM-dd'T'HH:mm:ss")
20372
20342
  });
20373
20343
  }, []);
20374
- const syncFromQuickbooks2 = useCallback20(() => {
20344
+ const syncFromQuickbooks2 = useCallback19(() => {
20375
20345
  const newQuickbooksConnectionStatus = quickbooksConnectionStatus ? __spreadProps(__spreadValues({}, quickbooksConnectionStatus), { is_syncing: true }) : void 0;
20376
20346
  setQuickbooksConnectionStatus(newQuickbooksConnectionStatus);
20377
20347
  void Layer.syncFromQuickbooks(apiUrl, auth == null ? void 0 : auth.access_token, {
20378
20348
  params: { businessId }
20379
20349
  }).catch(handleSyncError);
20380
20350
  }, [apiUrl, auth == null ? void 0 : auth.access_token, businessId, quickbooksConnectionStatus, handleSyncError]);
20381
- const linkQuickbooks = useCallback20(() => __async(null, null, function* () {
20351
+ const linkQuickbooks = useCallback19(() => __async(null, null, function* () {
20382
20352
  return Layer.initQuickbooksOAuth(apiUrl, auth == null ? void 0 : auth.access_token, {
20383
20353
  params: { businessId }
20384
20354
  }).then((res) => res.data.redirect_url);
20385
20355
  }), [apiUrl, auth == null ? void 0 : auth.access_token, businessId]);
20386
- const unlinkQuickbooks = useCallback20(() => __async(null, null, function* () {
20356
+ const unlinkQuickbooks = useCallback19(() => __async(null, null, function* () {
20387
20357
  return Layer.unlinkQuickbooksConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
20388
20358
  params: { businessId }
20389
20359
  }).then(() => fetchQuickbooksConnectionStatus());
@@ -20404,7 +20374,7 @@ function QuickbooksContextProvider({ children }) {
20404
20374
  }
20405
20375
 
20406
20376
  // src/components/Integrations/IntegrationsConnectMenu/IntegrationsConnectMenu.tsx
20407
- import { useCallback as useCallback21, useContext as useContext26, useState as useState44 } from "react";
20377
+ import { useCallback as useCallback20, useContext as useContext26, useState as useState44 } from "react";
20408
20378
 
20409
20379
  // src/components/ui/DropdownMenu/DropdownMenu.tsx
20410
20380
  import { Menu as Menu3, MenuItem as AriaMenuItem, MenuTrigger as MenuTrigger2, Popover as Popover2, Separator as AriaSeparator, Header as Header2, Dialog as Dialog2 } from "react-aria-components";
@@ -20460,7 +20430,7 @@ var IntegrationsConnectMenu = () => {
20460
20430
  const { quickbooksConnectionStatus, linkQuickbooks } = useContext26(QuickbooksContext);
20461
20431
  const quickbooksIsConnected = quickbooksConnectionStatus == null ? void 0 : quickbooksConnectionStatus.is_connected;
20462
20432
  const [isLinkQuickbooksError, setIsLinkQuickbooksError] = useState44(false);
20463
- const initiateQuickbooksOAuth = useCallback21(() => {
20433
+ const initiateQuickbooksOAuth = useCallback20(() => {
20464
20434
  linkQuickbooks().then((res) => {
20465
20435
  window.location.href = res;
20466
20436
  }).catch(() => {
@@ -20554,7 +20524,7 @@ var PNLComparisonContext = createContext15({
20554
20524
  });
20555
20525
 
20556
20526
  // src/hooks/useProfitAndLoss/useProfitAndLoss.tsx
20557
- import { useCallback as useCallback22, useMemo as useMemo25, useState as useState46 } from "react";
20527
+ import { useCallback as useCallback21, useMemo as useMemo25, useState as useState46 } from "react";
20558
20528
 
20559
20529
  // src/utils/profitAndLossUtils.ts
20560
20530
  var doesLineItemQualifies = (item) => {
@@ -20832,7 +20802,7 @@ var useProfitAndLoss = ({
20832
20802
  const { start, end } = useGlobalDateRange();
20833
20803
  const { setRange } = useGlobalDateRangeActions();
20834
20804
  const dateRange = useMemo25(() => ({ startDate: start, endDate: end }), [start, end]);
20835
- const changeDateRange = useCallback22(
20805
+ const changeDateRange = useCallback21(
20836
20806
  ({ startDate: start2, endDate: end2 }) => setRange({ start: start2, end: end2 }),
20837
20807
  [setRange]
20838
20808
  );
@@ -23181,11 +23151,11 @@ import { useContext as useContext31 } from "react";
23181
23151
 
23182
23152
  // src/components/Header/Header.tsx
23183
23153
  import {
23184
- forwardRef as forwardRef14
23154
+ forwardRef as forwardRef15
23185
23155
  } from "react";
23186
23156
  import classNames59 from "classnames";
23187
23157
  import { jsx as jsx191 } from "react/jsx-runtime";
23188
- var Header3 = forwardRef14(
23158
+ var Header3 = forwardRef15(
23189
23159
  ({ className, children, style, sticky, asHeader, rounded }, ref) => {
23190
23160
  const baseClassName = classNames59(
23191
23161
  "Layer__header",
@@ -23281,7 +23251,7 @@ var Panel = ({
23281
23251
  };
23282
23252
 
23283
23253
  // src/components/View/View.tsx
23284
- import { forwardRef as forwardRef15 } from "react";
23254
+ import { forwardRef as forwardRef16 } from "react";
23285
23255
 
23286
23256
  // src/components/ViewHeader/ViewHeader.tsx
23287
23257
  import classNames63 from "classnames";
@@ -23296,7 +23266,7 @@ var ViewHeader = ({ title, className, children }) => {
23296
23266
  // src/components/View/View.tsx
23297
23267
  import classNames64 from "classnames";
23298
23268
  import { jsx as jsx196, jsxs as jsxs126 } from "react/jsx-runtime";
23299
- var View = forwardRef15(
23269
+ var View = forwardRef16(
23300
23270
  ({
23301
23271
  title,
23302
23272
  showHeader = true,
@@ -23520,10 +23490,10 @@ function ProfitAndLossSummariesMiniChart({
23520
23490
  }
23521
23491
 
23522
23492
  // src/components/ui/Typography/MoneyText.tsx
23523
- import { forwardRef as forwardRef16 } from "react";
23493
+ import { forwardRef as forwardRef17 } from "react";
23524
23494
  import { jsx as jsx200 } from "react/jsx-runtime";
23525
23495
  var CLASS_NAME10 = "Layer__MoneyText";
23526
- var MoneySpan = forwardRef16(
23496
+ var MoneySpan = forwardRef17(
23527
23497
  (_a, ref) => {
23528
23498
  var _b = _a, { amount, bold, size } = _b, restProps = __objRest(_b, ["amount", "bold", "size"]);
23529
23499
  const dataProperties = toDataProperties({
@@ -25862,8 +25832,8 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
25862
25832
 
25863
25833
  // src/hooks/useChartOfAccounts/useCreateChildAccount.tsx
25864
25834
  import useSWRMutation12 from "swr/mutation";
25865
- import { useSWRConfig as useSWRConfig6 } from "swr";
25866
- import { useCallback as useCallback23 } from "react";
25835
+ import { useSWRConfig as useSWRConfig5 } from "swr";
25836
+ import { useCallback as useCallback22 } from "react";
25867
25837
 
25868
25838
  // src/hooks/useLedgerAccounts/useLedgerAccounts.tsx
25869
25839
  import { useEffect as useEffect36, useState as useState56 } from "react";
@@ -28008,20 +27978,19 @@ var JournalFormEntryLines = ({
28008
27978
  className: "Layer__journal__form__input-group__line-item",
28009
27979
  children: [
28010
27980
  /* @__PURE__ */ jsx241(InputGroup, { name: direction, label: "Amount", inline: true, children: /* @__PURE__ */ jsx241(
28011
- InputWithBadge,
27981
+ AmountInput,
28012
27982
  {
28013
27983
  name: direction,
28014
- placeholder: "$0.00",
28015
- value: convertNumberToCurrency(item.amount),
27984
+ onChange: (value) => changeFormData("amount", value, idx2),
27985
+ value: item.amount,
28016
27986
  disabled: sendingForm,
28017
- badge: humanizeEnum(direction),
28018
- variant: item.direction === "CREDIT" ? "success" /* SUCCESS */ : "warning" /* WARNING */,
28019
- onChange: (e) => changeFormData(
28020
- "amount",
28021
- convertCurrencyToNumber(
28022
- e.target.value
28023
- ),
28024
- idx2
27987
+ allowNegativeValue: false,
27988
+ badge: /* @__PURE__ */ jsx241(
27989
+ Badge,
27990
+ {
27991
+ variant: item.direction === "CREDIT" ? "success" /* SUCCESS */ : "warning" /* WARNING */,
27992
+ children: humanizeEnum(direction)
27993
+ }
28025
27994
  ),
28026
27995
  isInvalid: Boolean(
28027
27996
  (_a = form == null ? void 0 : form.errors) == null ? void 0 : _a.lineItems.find(
@@ -28709,7 +28678,7 @@ function getIconForTask(task) {
28709
28678
  }
28710
28679
 
28711
28680
  // src/hooks/bookkeeping/periods/tasks/useSubmitResponseForTask.ts
28712
- import { useSWRConfig as useSWRConfig7 } from "swr";
28681
+ import { useSWRConfig as useSWRConfig6 } from "swr";
28713
28682
  import useSWRMutation15 from "swr/mutation";
28714
28683
 
28715
28684
  // src/api/layer/tasks.ts
@@ -28743,7 +28712,7 @@ function completeTaskWithUpload(baseUrl, accessToken, {
28743
28712
  }
28744
28713
 
28745
28714
  // src/hooks/bookkeeping/periods/tasks/useSubmitResponseForTask.ts
28746
- import { useCallback as useCallback24 } from "react";
28715
+ import { useCallback as useCallback23 } from "react";
28747
28716
  function buildKey25({
28748
28717
  access_token: accessToken,
28749
28718
  apiUrl,
@@ -28761,7 +28730,7 @@ function buildKey25({
28761
28730
  function useSubmitUserResponseForTask() {
28762
28731
  const { data: auth } = useAuth();
28763
28732
  const { businessId } = useLayerContext();
28764
- const { mutate } = useSWRConfig7();
28733
+ const { mutate } = useSWRConfig6();
28765
28734
  const mutationResponse = useSWRMutation15(
28766
28735
  () => buildKey25(__spreadProps(__spreadValues({}, auth), {
28767
28736
  businessId
@@ -28786,7 +28755,7 @@ function useSubmitUserResponseForTask() {
28786
28755
  }
28787
28756
  );
28788
28757
  const { trigger: originalTrigger } = mutationResponse;
28789
- const stableProxiedTrigger = useCallback24(
28758
+ const stableProxiedTrigger = useCallback23(
28790
28759
  (...triggerParameters) => __async(null, null, function* () {
28791
28760
  const triggerResult = yield originalTrigger(...triggerParameters);
28792
28761
  void mutate((key) => withSWRKeyTags(
@@ -28811,9 +28780,9 @@ function useSubmitUserResponseForTask() {
28811
28780
  }
28812
28781
 
28813
28782
  // src/hooks/bookkeeping/periods/tasks/useUploadDocumentsForTask.ts
28814
- import { useSWRConfig as useSWRConfig8 } from "swr";
28783
+ import { useSWRConfig as useSWRConfig7 } from "swr";
28815
28784
  import useSWRMutation16 from "swr/mutation";
28816
- import { useCallback as useCallback25 } from "react";
28785
+ import { useCallback as useCallback24 } from "react";
28817
28786
  function buildKey26({
28818
28787
  access_token: accessToken,
28819
28788
  apiUrl,
@@ -28831,7 +28800,7 @@ function buildKey26({
28831
28800
  function useUploadDocumentsForTask() {
28832
28801
  const { data: auth } = useAuth();
28833
28802
  const { businessId } = useLayerContext();
28834
- const { mutate } = useSWRConfig8();
28803
+ const { mutate } = useSWRConfig7();
28835
28804
  const mutationResponse = useSWRMutation16(
28836
28805
  () => buildKey26(__spreadProps(__spreadValues({}, auth), {
28837
28806
  businessId
@@ -28852,7 +28821,7 @@ function useUploadDocumentsForTask() {
28852
28821
  }
28853
28822
  );
28854
28823
  const { trigger: originalTrigger } = mutationResponse;
28855
- const stableProxiedTrigger = useCallback25(
28824
+ const stableProxiedTrigger = useCallback24(
28856
28825
  (...triggerParameters) => __async(null, null, function* () {
28857
28826
  const triggerResult = yield originalTrigger(...triggerParameters);
28858
28827
  void mutate((key) => withSWRKeyTags(
@@ -28877,9 +28846,9 @@ function useUploadDocumentsForTask() {
28877
28846
  }
28878
28847
 
28879
28848
  // src/hooks/bookkeeping/periods/tasks/useDeleteUploadsOnTask.ts
28880
- import { useSWRConfig as useSWRConfig9 } from "swr";
28849
+ import { useSWRConfig as useSWRConfig8 } from "swr";
28881
28850
  import useSWRMutation17 from "swr/mutation";
28882
- import { useCallback as useCallback26 } from "react";
28851
+ import { useCallback as useCallback25 } from "react";
28883
28852
  function buildKey27({
28884
28853
  access_token: accessToken,
28885
28854
  apiUrl,
@@ -28897,7 +28866,7 @@ function buildKey27({
28897
28866
  function useDeleteUploadsOnTask() {
28898
28867
  const { data: auth } = useAuth();
28899
28868
  const { businessId } = useLayerContext();
28900
- const { mutate } = useSWRConfig9();
28869
+ const { mutate } = useSWRConfig8();
28901
28870
  const mutationResponse = useSWRMutation17(
28902
28871
  () => buildKey27(__spreadProps(__spreadValues({}, auth), {
28903
28872
  businessId
@@ -28915,7 +28884,7 @@ function useDeleteUploadsOnTask() {
28915
28884
  }
28916
28885
  );
28917
28886
  const { trigger: originalTrigger } = mutationResponse;
28918
- const stableProxiedTrigger = useCallback26(
28887
+ const stableProxiedTrigger = useCallback25(
28919
28888
  (...triggerParameters) => __async(null, null, function* () {
28920
28889
  const triggerResult = yield originalTrigger(...triggerParameters);
28921
28890
  void mutate((key) => withSWRKeyTags(
@@ -28940,9 +28909,9 @@ function useDeleteUploadsOnTask() {
28940
28909
  }
28941
28910
 
28942
28911
  // src/hooks/bookkeeping/periods/tasks/useUpdateTaskUploadDescription.ts
28943
- import { useSWRConfig as useSWRConfig10 } from "swr";
28912
+ import { useSWRConfig as useSWRConfig9 } from "swr";
28944
28913
  import useSWRMutation18 from "swr/mutation";
28945
- import { useCallback as useCallback27 } from "react";
28914
+ import { useCallback as useCallback26 } from "react";
28946
28915
  function buildKey28({
28947
28916
  access_token: accessToken,
28948
28917
  apiUrl,
@@ -28960,7 +28929,7 @@ function buildKey28({
28960
28929
  function useUpdateTaskUploadDescription() {
28961
28930
  const { data: auth } = useAuth();
28962
28931
  const { businessId } = useLayerContext();
28963
- const { mutate } = useSWRConfig10();
28932
+ const { mutate } = useSWRConfig9();
28964
28933
  const mutationResponse = useSWRMutation18(
28965
28934
  () => buildKey28(__spreadProps(__spreadValues({}, auth), {
28966
28935
  businessId
@@ -28982,7 +28951,7 @@ function useUpdateTaskUploadDescription() {
28982
28951
  }
28983
28952
  );
28984
28953
  const { trigger: originalTrigger } = mutationResponse;
28985
- const stableProxiedTrigger = useCallback27(
28954
+ const stableProxiedTrigger = useCallback26(
28986
28955
  (...triggerParameters) => __async(null, null, function* () {
28987
28956
  const triggerResult = yield originalTrigger(...triggerParameters);
28988
28957
  void mutate((key) => withSWRKeyTags(
@@ -29252,7 +29221,7 @@ var TasksListMobile = ({
29252
29221
  };
29253
29222
 
29254
29223
  // src/hooks/array/usePaginatedList.ts
29255
- import { useCallback as useCallback28, useMemo as useMemo43, useState as useState66 } from "react";
29224
+ import { useCallback as useCallback27, useMemo as useMemo43, useState as useState66 } from "react";
29256
29225
  function usePaginatedList(list, pageSize) {
29257
29226
  const [internalPageIndex, setInternalPageIndex] = useState66(0);
29258
29227
  const pageCount = Math.max(0, Math.ceil(list.length / pageSize));
@@ -29263,16 +29232,16 @@ function usePaginatedList(list, pageSize) {
29263
29232
  (effectivePageIndex + 1) * pageSize
29264
29233
  );
29265
29234
  }, [list, effectivePageIndex, pageSize]);
29266
- const next = useCallback28(() => {
29235
+ const next = useCallback27(() => {
29267
29236
  setInternalPageIndex(Math.min(effectivePageIndex + 1, pageCount - 1));
29268
29237
  }, [effectivePageIndex, pageCount]);
29269
- const set2 = useCallback28((pageIndex) => {
29238
+ const set2 = useCallback27((pageIndex) => {
29270
29239
  setInternalPageIndex(Math.max(0, Math.min(pageIndex, pageCount - 1)));
29271
29240
  }, [pageCount]);
29272
- const previous = useCallback28(() => {
29241
+ const previous = useCallback27(() => {
29273
29242
  setInternalPageIndex(Math.max(effectivePageIndex - 1, 0));
29274
29243
  }, [effectivePageIndex]);
29275
- const reset = useCallback28(() => {
29244
+ const reset = useCallback27(() => {
29276
29245
  setInternalPageIndex(0);
29277
29246
  }, []);
29278
29247
  return {
@@ -30636,8 +30605,8 @@ function useBusinessPersonnel() {
30636
30605
 
30637
30606
  // src/hooks/businessPersonnel/useCreateBusinessPersonnel.ts
30638
30607
  import useSWRMutation19 from "swr/mutation";
30639
- import { useSWRConfig as useSWRConfig11 } from "swr";
30640
- import { useCallback as useCallback29 } from "react";
30608
+ import { useSWRConfig as useSWRConfig10 } from "swr";
30609
+ import { useCallback as useCallback28 } from "react";
30641
30610
  var createBusinessPersonnel = post(({ businessId }) => `/v1/businesses/${businessId}/personnel`);
30642
30611
  function buildKey30({
30643
30612
  access_token: accessToken,
@@ -30656,7 +30625,7 @@ function buildKey30({
30656
30625
  function useCreateBusinessPersonnel() {
30657
30626
  const { data } = useAuth();
30658
30627
  const { businessId } = useLayerContext();
30659
- const { mutate } = useSWRConfig11();
30628
+ const { mutate } = useSWRConfig10();
30660
30629
  const mutationResponse = useSWRMutation19(
30661
30630
  () => buildKey30(__spreadProps(__spreadValues({}, data), {
30662
30631
  businessId
@@ -30675,7 +30644,7 @@ function useCreateBusinessPersonnel() {
30675
30644
  }
30676
30645
  );
30677
30646
  const { trigger: originalTrigger } = mutationResponse;
30678
- const stableProxiedTrigger = useCallback29(
30647
+ const stableProxiedTrigger = useCallback28(
30679
30648
  (...triggerParameters) => __async(null, null, function* () {
30680
30649
  const triggerResult = yield originalTrigger(...triggerParameters);
30681
30650
  void mutate((key) => withSWRKeyTags(
@@ -30701,7 +30670,7 @@ function useCreateBusinessPersonnel() {
30701
30670
 
30702
30671
  // src/hooks/businessPersonnel/useUpdateBusinessPersonnel.ts
30703
30672
  import useSWRMutation20 from "swr/mutation";
30704
- import { useSWRConfig as useSWRConfig12 } from "swr";
30673
+ import { useSWRConfig as useSWRConfig11 } from "swr";
30705
30674
 
30706
30675
  // src/api/layer/businessPersonnel/updateBusinessPersonnel.ts
30707
30676
  var updateBusinessPersonnel = post(({ businessId, businessPersonnelId }) => {
@@ -30709,7 +30678,7 @@ var updateBusinessPersonnel = post(({ businessId, businessPersonnelId }) => {
30709
30678
  });
30710
30679
 
30711
30680
  // src/hooks/businessPersonnel/useUpdateBusinessPersonnel.ts
30712
- import { useCallback as useCallback30 } from "react";
30681
+ import { useCallback as useCallback29 } from "react";
30713
30682
  function buildKey31({
30714
30683
  access_token: accessToken,
30715
30684
  apiUrl,
@@ -30729,7 +30698,7 @@ function buildKey31({
30729
30698
  function useUpdateBusinessPersonnel({ businessPersonnelId }) {
30730
30699
  const { data } = useAuth();
30731
30700
  const { businessId } = useLayerContext();
30732
- const { mutate } = useSWRConfig12();
30701
+ const { mutate } = useSWRConfig11();
30733
30702
  const mutationResponse = useSWRMutation20(
30734
30703
  () => buildKey31(__spreadProps(__spreadValues({}, data), {
30735
30704
  businessId,
@@ -30752,7 +30721,7 @@ function useUpdateBusinessPersonnel({ businessPersonnelId }) {
30752
30721
  }
30753
30722
  );
30754
30723
  const { trigger: originalTrigger } = mutationResponse;
30755
- const stableProxiedTrigger = useCallback30(
30724
+ const stableProxiedTrigger = useCallback29(
30756
30725
  (...triggerParameters) => __async(null, null, function* () {
30757
30726
  const triggerResult = yield originalTrigger(...triggerParameters);
30758
30727
  void mutate((key) => withSWRKeyTags(
@@ -30778,8 +30747,8 @@ function useUpdateBusinessPersonnel({ businessPersonnelId }) {
30778
30747
 
30779
30748
  // src/hooks/business/useUpdateBusiness.ts
30780
30749
  import useSWRMutation21 from "swr/mutation";
30781
- import { useSWRConfig as useSWRConfig13 } from "swr";
30782
- import { useCallback as useCallback31 } from "react";
30750
+ import { useSWRConfig as useSWRConfig12 } from "swr";
30751
+ import { useCallback as useCallback30 } from "react";
30783
30752
  var BUSINESS_TAG_KEY = "business";
30784
30753
  function buildKey32({
30785
30754
  access_token: accessToken,
@@ -30798,7 +30767,7 @@ function buildKey32({
30798
30767
  function useUpdateBusiness() {
30799
30768
  const { data } = useAuth();
30800
30769
  const { businessId } = useLayerContext();
30801
- const { mutate } = useSWRConfig13();
30770
+ const { mutate } = useSWRConfig12();
30802
30771
  const mutationResponse = useSWRMutation21(
30803
30772
  () => buildKey32(__spreadProps(__spreadValues({}, data), {
30804
30773
  businessId
@@ -30817,7 +30786,7 @@ function useUpdateBusiness() {
30817
30786
  }
30818
30787
  );
30819
30788
  const { trigger: originalTrigger } = mutationResponse;
30820
- const stableProxiedTrigger = useCallback31(
30789
+ const stableProxiedTrigger = useCallback30(
30821
30790
  (...triggerParameters) => __async(null, null, function* () {
30822
30791
  const triggerResult = yield originalTrigger(...triggerParameters);
30823
30792
  void mutate((key) => withSWRKeyTags(