@layerfi/components 0.1.97 → 0.1.98-alpha

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.97";
5573
+ var version = "0.1.98-alpha";
5574
5574
 
5575
5575
  // src/models/APIError.ts
5576
5576
  var APIError = class _APIError extends Error {
@@ -5643,7 +5643,7 @@ var postWithFormData = (url, formData, baseUrl, accessToken) => {
5643
5643
  body: formData
5644
5644
  }).then((res) => handleResponse(res)).catch((error) => handleException(error));
5645
5645
  };
5646
- var handleResponse = (res) => __async(void 0, null, function* () {
5646
+ var handleResponse = (res) => __async(null, null, function* () {
5647
5647
  var _a;
5648
5648
  if (!res.ok) {
5649
5649
  const errors = yield tryToReadErrorsFromResponse(res);
@@ -5684,7 +5684,7 @@ var handleException = (error) => {
5684
5684
  });
5685
5685
  throw apiError;
5686
5686
  };
5687
- var tryToReadErrorsFromResponse = (res) => __async(void 0, null, function* () {
5687
+ var tryToReadErrorsFromResponse = (res) => __async(null, null, function* () {
5688
5688
  var _a;
5689
5689
  try {
5690
5690
  const data = yield res == null ? void 0 : res.json();
@@ -5875,6 +5875,9 @@ var createAccount = post(
5875
5875
  var updateAccount = put(
5876
5876
  ({ businessId, accountId }) => `/v1/businesses/${businessId}/ledger/accounts/${accountId}`
5877
5877
  );
5878
+ var createChildAccount = post(
5879
+ ({ businessId, accountId }) => `/v1/businesses/${businessId}/ledger/accounts/${accountId}/create-child-account`
5880
+ );
5878
5881
  var getLedgerAccountsLines = get(
5879
5882
  ({ businessId, accountId, includeReversals }) => `/v1/businesses/${businessId}/ledger/accounts/${accountId}/lines${includeReversals === "true" ? "?include_reversals=true" : ""}`
5880
5883
  );
@@ -6009,6 +6012,7 @@ var Layer = {
6009
6012
  matchBankTransaction,
6010
6013
  createAccount,
6011
6014
  updateAccount,
6015
+ createChildAccount,
6012
6016
  getBalanceSheet,
6013
6017
  getBalanceSheetCSV,
6014
6018
  getBalanceSheetExcel,
@@ -6167,7 +6171,6 @@ import { createContext as createContext2, useContext as useContext2 } from "reac
6167
6171
  var LayerContext = createContext2({
6168
6172
  businessId: "",
6169
6173
  business: void 0,
6170
- categories: [],
6171
6174
  theme: void 0,
6172
6175
  colors: {},
6173
6176
  setTheme: () => void 0,
@@ -7036,7 +7039,7 @@ var useLinkedAccounts = () => {
7036
7039
  setLoadingStatus("complete");
7037
7040
  }
7038
7041
  }, [isLoading]);
7039
- const fetchPlaidLinkToken = () => __async(void 0, null, function* () {
7042
+ const fetchPlaidLinkToken = () => __async(null, null, function* () {
7040
7043
  if (auth == null ? void 0 : auth.access_token) {
7041
7044
  const linkToken2 = (yield Layer.getPlaidLinkToken(apiUrl, auth.access_token, {
7042
7045
  params: { businessId }
@@ -7045,7 +7048,7 @@ var useLinkedAccounts = () => {
7045
7048
  setLinkToken(linkToken2);
7046
7049
  }
7047
7050
  });
7048
- const fetchPlaidUpdateModeLinkToken = (plaidItemPlaidId) => __async(void 0, null, function* () {
7051
+ const fetchPlaidUpdateModeLinkToken = (plaidItemPlaidId) => __async(null, null, function* () {
7049
7052
  if (auth == null ? void 0 : auth.access_token) {
7050
7053
  const linkToken2 = (yield Layer.getPlaidUpdateModeLinkToken(apiUrl, auth.access_token, {
7051
7054
  params: { businessId },
@@ -7055,7 +7058,7 @@ var useLinkedAccounts = () => {
7055
7058
  setLinkToken(linkToken2);
7056
7059
  }
7057
7060
  });
7058
- const exchangePlaidPublicToken2 = (publicToken, metadata) => __async(void 0, null, function* () {
7061
+ const exchangePlaidPublicToken2 = (publicToken, metadata) => __async(null, null, function* () {
7059
7062
  preloadAccountConfirmation();
7060
7063
  try {
7061
7064
  yield Layer.exchangePlaidPublicToken(apiUrl, auth == null ? void 0 : auth.access_token, {
@@ -7071,7 +7074,7 @@ var useLinkedAccounts = () => {
7071
7074
  token: linkToken,
7072
7075
  // If in update mode, we don't need to exchange the public token for an access token.
7073
7076
  // The existing access token will automatically become valid again
7074
- onSuccess: (publicToken, metadata) => __async(void 0, null, function* () {
7077
+ onSuccess: (publicToken, metadata) => __async(null, null, function* () {
7075
7078
  if (linkMode == "add") {
7076
7079
  exchangePlaidPublicToken2(publicToken, metadata);
7077
7080
  } else {
@@ -7103,7 +7106,7 @@ var useLinkedAccounts = () => {
7103
7106
  );
7104
7107
  }
7105
7108
  };
7106
- const repairConnection = (source, connectionExternalId) => __async(void 0, null, function* () {
7109
+ const repairConnection = (source, connectionExternalId) => __async(null, null, function* () {
7107
7110
  if (source === "PLAID") {
7108
7111
  yield fetchPlaidUpdateModeLinkToken(connectionExternalId);
7109
7112
  } else {
@@ -7112,7 +7115,7 @@ var useLinkedAccounts = () => {
7112
7115
  );
7113
7116
  }
7114
7117
  });
7115
- const removeConnection = (source, connectionExternalId) => __async(void 0, null, function* () {
7118
+ const removeConnection = (source, connectionExternalId) => __async(null, null, function* () {
7116
7119
  if (source === "PLAID") {
7117
7120
  yield unlinkPlaidItem2(connectionExternalId);
7118
7121
  yield refetchAccounts();
@@ -7122,7 +7125,7 @@ var useLinkedAccounts = () => {
7122
7125
  );
7123
7126
  }
7124
7127
  });
7125
- const unlinkAccount2 = (source, accountId) => __async(void 0, null, function* () {
7128
+ const unlinkAccount2 = (source, accountId) => __async(null, null, function* () {
7126
7129
  DEBUG && console.debug("unlinking account");
7127
7130
  if (source === "PLAID") {
7128
7131
  yield Layer.unlinkAccount(apiUrl, auth == null ? void 0 : auth.access_token, {
@@ -7136,7 +7139,7 @@ var useLinkedAccounts = () => {
7136
7139
  );
7137
7140
  }
7138
7141
  });
7139
- const confirmAccount2 = (source, accountId) => __async(void 0, null, function* () {
7142
+ const confirmAccount2 = (source, accountId) => __async(null, null, function* () {
7140
7143
  DEBUG && console.debug("confirming account");
7141
7144
  if (source === "PLAID") {
7142
7145
  yield Layer.confirmAccount(apiUrl, auth == null ? void 0 : auth.access_token, {
@@ -7153,7 +7156,7 @@ var useLinkedAccounts = () => {
7153
7156
  );
7154
7157
  }
7155
7158
  });
7156
- const excludeAccount2 = (source, accountId) => __async(void 0, null, function* () {
7159
+ const excludeAccount2 = (source, accountId) => __async(null, null, function* () {
7157
7160
  DEBUG && console.debug("excluding account");
7158
7161
  if (source === "PLAID") {
7159
7162
  yield Layer.excludeAccount(apiUrl, auth == null ? void 0 : auth.access_token, {
@@ -7173,7 +7176,7 @@ var useLinkedAccounts = () => {
7173
7176
  );
7174
7177
  }
7175
7178
  });
7176
- const breakConnection = (source, connectionExternalId) => __async(void 0, null, function* () {
7179
+ const breakConnection = (source, connectionExternalId) => __async(null, null, function* () {
7177
7180
  DEBUG && console.debug("Breaking sandbox plaid item connection");
7178
7181
  if (source === "PLAID") {
7179
7182
  yield Layer.breakPlaidItemConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
@@ -7190,23 +7193,23 @@ var useLinkedAccounts = () => {
7190
7193
  );
7191
7194
  }
7192
7195
  });
7193
- const refetchAccounts = () => __async(void 0, null, function* () {
7196
+ const refetchAccounts = () => __async(null, null, function* () {
7194
7197
  DEBUG && console.debug("refetching accounts...");
7195
7198
  yield mutate();
7196
7199
  });
7197
- const syncAccounts = () => __async(void 0, null, function* () {
7200
+ const syncAccounts = () => __async(null, null, function* () {
7198
7201
  DEBUG && console.debug("resyncing accounts...");
7199
7202
  yield Layer.syncConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
7200
7203
  params: { businessId }
7201
7204
  });
7202
7205
  });
7203
- const updateConnectionStatus2 = () => __async(void 0, null, function* () {
7206
+ const updateConnectionStatus2 = () => __async(null, null, function* () {
7204
7207
  DEBUG && console.debug("updating connection status...");
7205
7208
  yield Layer.updateConnectionStatus(apiUrl, auth == null ? void 0 : auth.access_token, {
7206
7209
  params: { businessId }
7207
7210
  });
7208
7211
  });
7209
- const unlinkPlaidItem2 = (plaidItemPlaidId) => __async(void 0, null, function* () {
7212
+ const unlinkPlaidItem2 = (plaidItemPlaidId) => __async(null, null, function* () {
7210
7213
  DEBUG && console.debug("unlinking plaid item");
7211
7214
  yield Layer.unlinkPlaidItem(apiUrl, auth == null ? void 0 : auth.access_token, {
7212
7215
  params: { businessId, plaidItemPlaidId }
@@ -7779,7 +7782,6 @@ import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
7779
7782
  var reducer = (state, action) => {
7780
7783
  switch (action.type) {
7781
7784
  case "LayerContext.setBusiness" /* setBusiness */:
7782
- case "LayerContext.setCategories" /* setCategories */:
7783
7785
  case "LayerContext.setTheme" /* setTheme */:
7784
7786
  case "LayerContext.setOnboardingStep" /* setOnboardingStep */:
7785
7787
  case "LayerContext.setColors" /* setColors */:
@@ -7817,7 +7819,6 @@ var BusinessProvider = ({
7817
7819
  const [state, dispatch] = useReducer(reducer, {
7818
7820
  businessId,
7819
7821
  business: void 0,
7820
- categories: [],
7821
7822
  theme,
7822
7823
  colors,
7823
7824
  onboardingStep: void 0,
@@ -7834,33 +7835,6 @@ var BusinessProvider = ({
7834
7835
  } = useDataSync();
7835
7836
  const { apiUrl } = useEnvironment();
7836
7837
  const { data: auth } = useAuth();
7837
- const { data: categoriesData } = useSWR3(
7838
- businessId && (auth == null ? void 0 : auth.access_token) && `categories-${businessId}`,
7839
- Layer.getCategories(apiUrl, auth == null ? void 0 : auth.access_token, {
7840
- params: { businessId }
7841
- }),
7842
- __spreadProps(__spreadValues({}, DEFAULT_SWR_CONFIG), {
7843
- provider: () => /* @__PURE__ */ new Map(),
7844
- onSuccess: (response) => {
7845
- var _a, _b;
7846
- if ((_b = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.categories) == null ? void 0 : _b.length) {
7847
- dispatch({
7848
- type: "LayerContext.setCategories" /* setCategories */,
7849
- payload: { categories: response.data.categories || [] }
7850
- });
7851
- }
7852
- }
7853
- })
7854
- );
7855
- useEffect4(() => {
7856
- var _a, _b;
7857
- if ((_b = (_a = categoriesData == null ? void 0 : categoriesData.data) == null ? void 0 : _a.categories) == null ? void 0 : _b.length) {
7858
- dispatch({
7859
- type: "LayerContext.setCategories" /* setCategories */,
7860
- payload: { categories: categoriesData.data.categories || [] }
7861
- });
7862
- }
7863
- }, [categoriesData]);
7864
7838
  const { data: businessData } = useSWR3(
7865
7839
  businessId && (auth == null ? void 0 : auth.access_token) && `business-${businessId}`,
7866
7840
  Layer.getBusiness(apiUrl, auth == null ? void 0 : auth.access_token, {
@@ -10990,7 +10964,6 @@ function LinkedAccountPill({ label, items }) {
10990
10964
  {
10991
10965
  status: "error",
10992
10966
  onPress: () => setIsOpen(true),
10993
- onHoverStart: () => setIsOpen(true),
10994
10967
  children: [
10995
10968
  /* @__PURE__ */ jsx64(AlertCircle_default, { size: 14 }),
10996
10969
  label
@@ -11053,13 +11026,13 @@ var LinkedAccountItemThumb = ({
11053
11026
  config: [
11054
11027
  {
11055
11028
  name: "Mark as a duplicate account",
11056
- action: () => __async(void 0, null, function* () {
11029
+ action: () => __async(null, null, function* () {
11057
11030
  yield excludeAccount2(account.external_account_source, account.id);
11058
11031
  })
11059
11032
  },
11060
11033
  {
11061
11034
  name: "Mark as not a duplicate account",
11062
- action: () => __async(void 0, null, function* () {
11035
+ action: () => __async(null, null, function* () {
11063
11036
  yield confirmAccount2(account.external_account_source, account.id);
11064
11037
  })
11065
11038
  }
@@ -11071,7 +11044,7 @@ var LinkedAccountItemThumb = ({
11071
11044
  config: [
11072
11045
  {
11073
11046
  name: "Repair connection",
11074
- action: () => __async(void 0, null, function* () {
11047
+ action: () => __async(null, null, function* () {
11075
11048
  if (account.connection_external_id) {
11076
11049
  yield repairConnection(
11077
11050
  account.external_account_source,
@@ -11086,7 +11059,7 @@ var LinkedAccountItemThumb = ({
11086
11059
  const additionalConfigs = [
11087
11060
  {
11088
11061
  name: "Unlink account",
11089
- action: () => __async(void 0, null, function* () {
11062
+ action: () => __async(null, null, function* () {
11090
11063
  if (confirm("Please confirm you wish to remove this financial account")) {
11091
11064
  yield unlinkAccount2(account.external_account_source, account.id);
11092
11065
  }
@@ -11096,7 +11069,7 @@ var LinkedAccountItemThumb = ({
11096
11069
  if (showUnlinkItem) {
11097
11070
  additionalConfigs.push({
11098
11071
  name: `Unlink all accounts under this ${(_a = account.institution) == null ? void 0 : _a.name} connection`,
11099
- action: () => __async(void 0, null, function* () {
11072
+ action: () => __async(null, null, function* () {
11100
11073
  var _a2;
11101
11074
  if (account.connection_external_id && confirm(
11102
11075
  `Please confirm you wish to remove all accounts belonging to ${((_a2 = account.institution) == null ? void 0 : _a2.name) || "this institution"}`
@@ -11120,7 +11093,7 @@ var LinkedAccountItemThumb = ({
11120
11093
  if (environment === "staging" && !account.connection_needs_repair_as_of && account.external_account_source === "PLAID" && showBreakConnection) {
11121
11094
  additionalConfigs.push({
11122
11095
  name: "Break connection (test utility)",
11123
- action: () => __async(void 0, null, function* () {
11096
+ action: () => __async(null, null, function* () {
11124
11097
  if (account.connection_external_id) {
11125
11098
  yield breakConnection(
11126
11099
  account.external_account_source,
@@ -11308,35 +11281,34 @@ function ModalContextBar({ onClose }) {
11308
11281
  Button2,
11309
11282
  {
11310
11283
  icon: true,
11284
+ size: "sm",
11311
11285
  variant: "ghost",
11312
11286
  slot: "close",
11313
11287
  onPress: onClose,
11314
11288
  "aria-label": "Close Modal",
11315
- children: /* @__PURE__ */ jsx70(X, {})
11289
+ children: /* @__PURE__ */ jsx70(X, { size: 24 })
11316
11290
  }
11317
11291
  ) });
11318
11292
  }
11319
- var ModalHeading = forwardRef10(
11320
- (props, ref) => /* @__PURE__ */ jsx70(
11293
+ var ModalHeading = forwardRef10(function ModalHeading2(props, ref) {
11294
+ return /* @__PURE__ */ jsx70(
11321
11295
  Heading2,
11322
11296
  __spreadProps(__spreadValues({}, props), {
11323
11297
  slot: "title",
11324
11298
  level: 2,
11325
11299
  ref
11326
11300
  })
11327
- )
11328
- );
11329
- ModalHeading.displayName = "ModalHeading";
11330
- var ModalDescription = forwardRef10(
11331
- (props, ref) => /* @__PURE__ */ jsx70(
11301
+ );
11302
+ });
11303
+ var ModalDescription = forwardRef10(function ModalDescription2(props, ref) {
11304
+ return /* @__PURE__ */ jsx70(
11332
11305
  P,
11333
11306
  __spreadProps(__spreadValues({}, props), {
11334
11307
  slot: "description",
11335
11308
  ref
11336
11309
  })
11337
- )
11338
- );
11339
- ModalDescription.displayName = "ModalDescription";
11310
+ );
11311
+ });
11340
11312
  var MODAL_CONTENT_CLASS_NAME = "Layer__ModalContent";
11341
11313
  function ModalContent({ children }) {
11342
11314
  return /* @__PURE__ */ jsx70("div", { className: MODAL_CONTENT_CLASS_NAME, children });
@@ -11578,8 +11550,9 @@ function useLinkedAccountsConfirmationModal() {
11578
11550
  visibility,
11579
11551
  actions: { dismiss: dismissAccountConfirmation, reset: resetAccountConfirmation }
11580
11552
  } = useAccountConfirmationStore();
11581
- const preloadIsOpen = visibility === "PRELOADED";
11582
- const mainIsOpen = accountsNeedingConfirmation.length > 0;
11553
+ const isDismissed = visibility === "DISMISSED";
11554
+ const preloadIsOpen = !isDismissed && visibility === "PRELOADED";
11555
+ const mainIsOpen = !isDismissed && accountsNeedingConfirmation.length > 0;
11583
11556
  const baseInfo = {
11584
11557
  accounts: accountsNeedingConfirmation,
11585
11558
  onDismiss: dismissAccountConfirmation,
@@ -11620,16 +11593,13 @@ function LinkedAccountsConfirmationModalContent({ onClose }) {
11620
11593
  ));
11621
11594
  const { trigger, isMutating, error } = useConfirmAndExcludeMultiple({ onSuccess: refetchAccounts });
11622
11595
  const hasError = Boolean(error);
11623
- const handleFinish = () => __async(this, null, function* () {
11596
+ const handleFinish = () => __async(null, null, function* () {
11624
11597
  const success = yield trigger(formState);
11625
11598
  if (success) {
11626
11599
  onFinish();
11627
11600
  onClose();
11628
11601
  }
11629
11602
  });
11630
- const handleDismiss = () => {
11631
- onClose();
11632
- };
11633
11603
  const { descriptionLabel, buttonLabel } = getFormComponentLabels(formState);
11634
11604
  return /* @__PURE__ */ jsxs39(Fragment9, { children: [
11635
11605
  /* @__PURE__ */ jsx76(ModalContextBar, { onClose }),
@@ -12905,7 +12875,7 @@ function LinkedAccountsOpeningBalanceModalContent({
12905
12875
  };
12906
12876
  }),
12907
12877
  {
12908
- onSuccess: (responses) => __async(this, null, function* () {
12878
+ onSuccess: (responses) => __async(null, null, function* () {
12909
12879
  const newResults = __spreadValues({}, results);
12910
12880
  responses.forEach((r) => {
12911
12881
  newResults[r.accountId] = r;
@@ -13587,6 +13557,46 @@ var getAssignedValue = (bankTransaction) => {
13587
13557
  return;
13588
13558
  };
13589
13559
 
13560
+ // src/hooks/categories/useCategories.ts
13561
+ import useSWR4 from "swr";
13562
+ var CATEGORIES_TAG_KEY = "#categories";
13563
+ function buildKey4({
13564
+ access_token: accessToken,
13565
+ apiUrl,
13566
+ businessId,
13567
+ mode
13568
+ }) {
13569
+ if (accessToken && apiUrl) {
13570
+ return {
13571
+ accessToken,
13572
+ apiUrl,
13573
+ businessId,
13574
+ mode,
13575
+ tags: [CATEGORIES_TAG_KEY]
13576
+ };
13577
+ }
13578
+ }
13579
+ function useCategories({ mode } = {}) {
13580
+ const { data: auth } = useAuth();
13581
+ const { businessId } = useLayerContext();
13582
+ return useSWR4(
13583
+ () => buildKey4(__spreadProps(__spreadValues({}, auth), {
13584
+ businessId,
13585
+ mode
13586
+ })),
13587
+ ({ accessToken, apiUrl, businessId: businessId2, mode: mode2 }) => getCategories(
13588
+ apiUrl,
13589
+ accessToken,
13590
+ {
13591
+ params: {
13592
+ businessId: businessId2,
13593
+ mode: mode2
13594
+ }
13595
+ }
13596
+ )().then(({ data }) => data.categories)
13597
+ );
13598
+ }
13599
+
13590
13600
  // src/components/BankTransactionMobileList/BusinessCategories.tsx
13591
13601
  import { jsx as jsx100, jsxs as jsxs59 } from "react/jsx-runtime";
13592
13602
  var BusinessCategories = ({
@@ -13594,9 +13604,9 @@ var BusinessCategories = ({
13594
13604
  selectedId,
13595
13605
  showTooltips
13596
13606
  }) => {
13597
- const { categories } = useLayerContext();
13607
+ const { data: categories } = useCategories();
13598
13608
  const categoryOptions = flattenCategories(
13599
- categories.filter((category) => category.type != "ExclusionNested")
13609
+ (categories != null ? categories : []).filter((category) => category.type != "ExclusionNested")
13600
13610
  );
13601
13611
  const [optionsToShow, setOptionsToShow] = useState19(categoryOptions);
13602
13612
  const [selectedGroup, setSelectedGroup] = useState19();
@@ -13846,7 +13856,7 @@ var CategorySelect = ({
13846
13856
  asDrawer = false
13847
13857
  }) => {
13848
13858
  var _a;
13849
- const { categories } = useLayerContext();
13859
+ const { data: categories } = useCategories();
13850
13860
  const matchOptions = !excludeMatches && (bankTransaction == null ? void 0 : bankTransaction.suggested_matches) ? [
13851
13861
  {
13852
13862
  label: "Match",
@@ -13873,7 +13883,7 @@ var CategorySelect = ({
13873
13883
  )
13874
13884
  }
13875
13885
  ] : [];
13876
- const categoryOptions = flattenCategories2(categories);
13886
+ const categoryOptions = flattenCategories2(categories != null ? categories : []);
13877
13887
  const options = [
13878
13888
  ...matchOptions,
13879
13889
  ...suggestedOptions,
@@ -14101,7 +14111,7 @@ var useReceipts = ({
14101
14111
  void fetchDocuments();
14102
14112
  }
14103
14113
  }, [isActive]);
14104
- const fetchDocuments = () => __async(void 0, null, function* () {
14114
+ const fetchDocuments = () => __async(null, null, function* () {
14105
14115
  const listBankTransactionDocuments2 = Layer.listBankTransactionDocuments(
14106
14116
  apiUrl,
14107
14117
  auth == null ? void 0 : auth.access_token,
@@ -14123,7 +14133,7 @@ var useReceipts = ({
14123
14133
  }));
14124
14134
  setReceiptUrls(retrievedDocs);
14125
14135
  });
14126
- const uploadReceipt = (file) => __async(void 0, null, function* () {
14136
+ const uploadReceipt = (file) => __async(null, null, function* () {
14127
14137
  var _a;
14128
14138
  const id = (/* @__PURE__ */ new Date()).valueOf().toString();
14129
14139
  const receipts = [
@@ -14168,7 +14178,7 @@ var useReceipts = ({
14168
14178
  setReceiptUrls(newReceiptUrls);
14169
14179
  }
14170
14180
  });
14171
- const archiveDocument = (document2) => __async(void 0, null, function* () {
14181
+ const archiveDocument = (document2) => __async(null, null, function* () {
14172
14182
  if (!document2.id) return;
14173
14183
  try {
14174
14184
  if (document2.error) {
@@ -14443,7 +14453,7 @@ var BankTransactionReceipts = forwardRef11(
14443
14453
  BankTransactionReceipts.displayName = "BankTransactionReceipts";
14444
14454
 
14445
14455
  // src/hooks/bookkeeping/useBookkeepingStatus.ts
14446
- import useSWR4 from "swr";
14456
+ import useSWR5 from "swr";
14447
14457
 
14448
14458
  // src/providers/LegacyModeProvider/LegacyModeProvider.tsx
14449
14459
  import { createContext as createContext11, useContext as useContext18, useMemo as useMemo11 } from "react";
@@ -14480,7 +14490,7 @@ var getBookkeepingStatus = get(({ businessId }) => {
14480
14490
  });
14481
14491
  var BOOKKEEPING_TAG_KEY = "#bookkeeping";
14482
14492
  var BOOKKEEPING_STATUS_TAG_KEY = "#bookkeeping-status";
14483
- function buildKey4({
14493
+ function buildKey5({
14484
14494
  access_token: accessToken,
14485
14495
  apiUrl,
14486
14496
  businessId
@@ -14497,8 +14507,8 @@ function buildKey4({
14497
14507
  function useBookkeepingStatus() {
14498
14508
  const { data: auth } = useAuth();
14499
14509
  const { businessId } = useLayerContext();
14500
- return useSWR4(
14501
- () => buildKey4(__spreadProps(__spreadValues({}, auth), {
14510
+ return useSWR5(
14511
+ () => buildKey5(__spreadProps(__spreadValues({}, auth), {
14502
14512
  businessId
14503
14513
  })),
14504
14514
  ({ accessToken, apiUrl, businessId: businessId2 }) => getBookkeepingStatus(
@@ -15069,9 +15079,9 @@ var Textarea = (_a) => {
15069
15079
  import { useForm } from "@tanstack/react-form";
15070
15080
 
15071
15081
  // src/hooks/useBankTransactions/useBankTransactionsMetadata.ts
15072
- import useSWR5 from "swr";
15082
+ import useSWR6 from "swr";
15073
15083
  var GET_BANK_TRANSACTION_METADATA_TAG_KEY = "#bank-transaction-metadata";
15074
- function buildKey5({
15084
+ function buildKey6({
15075
15085
  access_token: accessToken,
15076
15086
  apiUrl,
15077
15087
  businessId,
@@ -15090,8 +15100,8 @@ function buildKey5({
15090
15100
  function useBankTransactionMetadata({ bankTransactionId }) {
15091
15101
  const { data: auth } = useAuth();
15092
15102
  const { businessId } = useLayerContext();
15093
- return useSWR5(
15094
- () => buildKey5(__spreadProps(__spreadValues({}, auth), {
15103
+ return useSWR6(
15104
+ () => buildKey6(__spreadProps(__spreadValues({}, auth), {
15095
15105
  businessId,
15096
15106
  bankTransactionId
15097
15107
  })),
@@ -15118,7 +15128,7 @@ function withSWRKeyTags(key, predicate) {
15118
15128
  import { useSWRConfig } from "swr";
15119
15129
  import { useCallback as useCallback3 } from "react";
15120
15130
  var UPDATE_BANK_TRANSACTION_METADATA_TAG_KEY = "#update-bank-transaction-metadata";
15121
- function buildKey6({
15131
+ function buildKey7({
15122
15132
  access_token: accessToken,
15123
15133
  apiUrl,
15124
15134
  businessId,
@@ -15139,7 +15149,7 @@ function useUpdateBankTransactionMetadata({ bankTransactionId, onSuccess }) {
15139
15149
  const { businessId } = useLayerContext();
15140
15150
  const { mutate } = useSWRConfig();
15141
15151
  const mutationResponse = useSWRMutation3(
15142
- () => buildKey6({
15152
+ () => buildKey7({
15143
15153
  access_token: auth == null ? void 0 : auth.access_token,
15144
15154
  apiUrl: auth == null ? void 0 : auth.apiUrl,
15145
15155
  businessId,
@@ -15166,7 +15176,7 @@ function useUpdateBankTransactionMetadata({ bankTransactionId, onSuccess }) {
15166
15176
  );
15167
15177
  const { trigger: originalTrigger } = mutationResponse;
15168
15178
  const stableProxiedTrigger = useCallback3(
15169
- (...triggerParameters) => __async(this, null, function* () {
15179
+ (...triggerParameters) => __async(null, null, function* () {
15170
15180
  const result = yield originalTrigger(...triggerParameters);
15171
15181
  if (result) {
15172
15182
  yield mutate((key) => withSWRKeyTags(
@@ -15196,7 +15206,7 @@ var useBankTransactionMemo = ({ bankTransactionId }) => {
15196
15206
  defaultValues: {
15197
15207
  memo: bankTransactionMetadata == null ? void 0 : bankTransactionMetadata.memo
15198
15208
  },
15199
- onSubmit: (_0) => __async(void 0, [_0], function* ({ value }) {
15209
+ onSubmit: (_0) => __async(null, [_0], function* ({ value }) {
15200
15210
  var _a;
15201
15211
  if (value.memo !== void 0 && form.state.isDirty) {
15202
15212
  yield updateBankTransactionMetadata2({ memo: (_a = value.memo) != null ? _a : "" });
@@ -15383,7 +15393,7 @@ var ExpandedBankTransactionRow = forwardRef12(
15383
15393
  updateRowState(__spreadValues({}, rowState));
15384
15394
  setSplitFormError(void 0);
15385
15395
  };
15386
- const save = () => __async(void 0, null, function* () {
15396
+ const save = () => __async(null, null, function* () {
15387
15397
  if (purpose === "match" /* match */) {
15388
15398
  if (!selectedMatchId) {
15389
15399
  setMatchFormError("Select an option to match the transaction");
@@ -15423,7 +15433,7 @@ var ExpandedBankTransactionRow = forwardRef12(
15423
15433
  useImperativeHandle2(ref, () => ({
15424
15434
  save
15425
15435
  }));
15426
- const onMatchSubmit = (matchId) => __async(void 0, null, function* () {
15436
+ const onMatchSubmit = (matchId) => __async(null, null, function* () {
15427
15437
  var _a2;
15428
15438
  const foundMatch = (_a2 = bankTransaction.suggested_matches) == null ? void 0 : _a2.find(
15429
15439
  (x) => x.id === matchId
@@ -15936,7 +15946,7 @@ var BankTransactionRow = ({
15936
15946
  }, 300);
15937
15947
  }
15938
15948
  }, [bankTransaction.recently_categorized]);
15939
- const save = () => __async(void 0, null, function* () {
15949
+ const save = () => __async(null, null, function* () {
15940
15950
  var _a2;
15941
15951
  if (open2 && (expandedRowRef == null ? void 0 : expandedRowRef.current)) {
15942
15952
  (_a2 = expandedRowRef == null ? void 0 : expandedRowRef.current) == null ? void 0 : _a2.save();
@@ -16751,7 +16761,7 @@ var MatchForm2 = ({
16751
16761
  setShowRetry(false);
16752
16762
  }
16753
16763
  }, [bankTransaction.error]);
16754
- const onMatchSubmit = (matchId) => __async(void 0, null, function* () {
16764
+ const onMatchSubmit = (matchId) => __async(null, null, function* () {
16755
16765
  var _a2;
16756
16766
  const foundMatch = (_a2 = bankTransaction.suggested_matches) == null ? void 0 : _a2.find(
16757
16767
  (x) => x.id === matchId
@@ -16761,7 +16771,7 @@ var MatchForm2 = ({
16761
16771
  }
16762
16772
  yield matchBankTransaction2(bankTransaction.id, foundMatch.id, true);
16763
16773
  });
16764
- const save = () => __async(void 0, null, function* () {
16774
+ const save = () => __async(null, null, function* () {
16765
16775
  if (!showCategorization) {
16766
16776
  return;
16767
16777
  }
@@ -16951,7 +16961,7 @@ var SplitForm = ({
16951
16961
  });
16952
16962
  return valid;
16953
16963
  };
16954
- const save = () => __async(void 0, null, function* () {
16964
+ const save = () => __async(null, null, function* () {
16955
16965
  if (!validateSplit2(rowState)) {
16956
16966
  if (rowState.splits.length > 1) {
16957
16967
  setFormError(
@@ -17943,7 +17953,7 @@ function TransactionsActions({ children }) {
17943
17953
 
17944
17954
  // src/hooks/useBankTransactions/useBankTransactionsDownload.ts
17945
17955
  import useSWRMutation4 from "swr/mutation";
17946
- function buildKey7({
17956
+ function buildKey8({
17947
17957
  access_token: accessToken,
17948
17958
  apiUrl,
17949
17959
  businessId
@@ -17961,7 +17971,7 @@ function useBankTransactionsDownload() {
17961
17971
  const { data } = useAuth();
17962
17972
  const { businessId } = useLayerContext();
17963
17973
  return useSWRMutation4(
17964
- () => buildKey7(__spreadProps(__spreadValues({}, data), {
17974
+ () => buildKey8(__spreadProps(__spreadValues({}, data), {
17965
17975
  businessId
17966
17976
  })),
17967
17977
  ({
@@ -18026,7 +18036,7 @@ var CLASS_NAME9 = "Layer__InvisibleDownload";
18026
18036
  var InvisibleDownload = forwardRef13((_props, ref) => {
18027
18037
  const internalRef = useRef18(null);
18028
18038
  useImperativeHandle3(ref, () => ({
18029
- trigger: (_0) => __async(void 0, [_0], function* ({ url }) {
18039
+ trigger: (_0) => __async(null, [_0], function* ({ url }) {
18030
18040
  var _a;
18031
18041
  (_a = internalRef.current) == null ? void 0 : _a.setAttribute("href", url);
18032
18042
  return runDelayedSync(() => {
@@ -18544,7 +18554,7 @@ var useQuickbooks = () => {
18544
18554
  void fetchQuickbooksConnectionStatus();
18545
18555
  }
18546
18556
  }, [auth == null ? void 0 : auth.access_token]);
18547
- const fetchQuickbooksConnectionStatus = () => __async(void 0, null, function* () {
18557
+ const fetchQuickbooksConnectionStatus = () => __async(null, null, function* () {
18548
18558
  const isConnected = (yield Layer.statusOfQuickbooksConnection(apiUrl, auth == null ? void 0 : auth.access_token, {
18549
18559
  params: { businessId }
18550
18560
  })()).data.is_connected;
@@ -18556,13 +18566,13 @@ var useQuickbooks = () => {
18556
18566
  params: { businessId }
18557
18567
  }).finally(() => setIsSyncingFromQuickbooks(false));
18558
18568
  };
18559
- const fetchIsSyncingFromQuickbooks = () => __async(void 0, null, function* () {
18569
+ const fetchIsSyncingFromQuickbooks = () => __async(null, null, function* () {
18560
18570
  const isSyncing = (yield Layer.statusOfSyncFromQuickbooks(apiUrl, auth == null ? void 0 : auth.access_token, {
18561
18571
  params: { businessId }
18562
18572
  })()).data.is_syncing;
18563
18573
  setIsSyncingFromQuickbooks(isSyncing);
18564
18574
  });
18565
- const linkQuickbooks = () => __async(void 0, null, function* () {
18575
+ const linkQuickbooks = () => __async(null, null, function* () {
18566
18576
  const res = yield Layer.initQuickbooksOAuth(apiUrl, auth == null ? void 0 : auth.access_token, {
18567
18577
  params: { businessId }
18568
18578
  });
@@ -18603,7 +18613,7 @@ var Quickbooks = () => {
18603
18613
  quickbooksIsLinked === false && /* @__PURE__ */ jsx153(
18604
18614
  "button",
18605
18615
  {
18606
- onClick: () => __async(void 0, null, function* () {
18616
+ onClick: () => __async(null, null, function* () {
18607
18617
  const authorizationUrl = yield linkQuickbooks();
18608
18618
  window.location.href = authorizationUrl;
18609
18619
  }),
@@ -18701,7 +18711,7 @@ var applyShare = (items, total) => {
18701
18711
  // src/hooks/useProfitAndLoss/useProfitAndLossLTM.tsx
18702
18712
  import { useEffect as useEffect25, useMemo as useMemo20, useState as useState37 } from "react";
18703
18713
  import { startOfMonth as startOfMonth7, sub } from "date-fns";
18704
- import useSWR6 from "swr";
18714
+ import useSWR7 from "swr";
18705
18715
  var buildDates = ({ currentDate }) => {
18706
18716
  return {
18707
18717
  startYear: startOfMonth7(currentDate).getFullYear() - 1,
@@ -18742,7 +18752,7 @@ var useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
18742
18752
  isValidating,
18743
18753
  error,
18744
18754
  mutate
18745
- } = useSWR6(
18755
+ } = useSWR7(
18746
18756
  queryKey,
18747
18757
  Layer.getProfitAndLossSummaries(apiUrl, auth == null ? void 0 : auth.access_token, {
18748
18758
  params: {
@@ -18855,7 +18865,7 @@ var useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
18855
18865
  // src/hooks/useProfitAndLoss/useProfitAndLossQuery.tsx
18856
18866
  import { useEffect as useEffect26 } from "react";
18857
18867
  import { startOfMonth as startOfMonth8, endOfMonth as endOfMonth7 } from "date-fns";
18858
- import useSWR7 from "swr";
18868
+ import useSWR8 from "swr";
18859
18869
  var useProfitAndLossQuery = ({
18860
18870
  startDate,
18861
18871
  endDate,
@@ -18878,7 +18888,7 @@ var useProfitAndLossQuery = ({
18878
18888
  isValidating,
18879
18889
  error: rawError,
18880
18890
  mutate
18881
- } = useSWR7(
18891
+ } = useSWR8(
18882
18892
  queryKey,
18883
18893
  Layer.getProfitAndLoss(apiUrl, auth == null ? void 0 : auth.access_token, {
18884
18894
  businessId,
@@ -19205,14 +19215,14 @@ function preparePeriodsBody(dateRange, comparePeriods, rangeDisplayMode) {
19205
19215
  }
19206
19216
 
19207
19217
  // src/hooks/useProfitAndLossComparison/useProfitAndLossComparison.tsx
19208
- import useSWR8 from "swr";
19218
+ import useSWR9 from "swr";
19209
19219
  var COMPARE_MODES_SUPPORTING_MULTI_PERIOD = ["monthPicker", "yearPicker"];
19210
19220
  var isNotOnlyNoneTag = (compareOptions) => {
19211
19221
  return Boolean(
19212
19222
  compareOptions == null ? void 0 : compareOptions.some((option) => option.tagFilterConfig.tagFilters !== "None")
19213
19223
  );
19214
19224
  };
19215
- function buildKey8({
19225
+ function buildKey9({
19216
19226
  access_token: accessToken,
19217
19227
  apiUrl,
19218
19228
  businessId,
@@ -19262,16 +19272,16 @@ function useProfitAndLossComparison({
19262
19272
  const { data: auth } = useAuth();
19263
19273
  const periods = preparePeriodsBody(dateRange, effectiveComparePeriods, rangeDisplayMode);
19264
19274
  const tagFilters = prepareFiltersBody(selectedCompareOptions);
19265
- const queryKey = buildKey8(__spreadProps(__spreadValues({}, auth), {
19275
+ const queryKey = buildKey9(__spreadProps(__spreadValues({}, auth), {
19266
19276
  businessId,
19267
19277
  periods,
19268
19278
  tagFilters,
19269
19279
  reportingBasis,
19270
19280
  compareModeActive
19271
19281
  }));
19272
- const { data, isLoading, isValidating } = useSWR8(
19282
+ const { data, isLoading, isValidating } = useSWR9(
19273
19283
  queryKey,
19274
- () => __async(this, null, function* () {
19284
+ () => __async(null, null, function* () {
19275
19285
  const response = yield Layer.compareProfitAndLoss(apiUrl, auth == null ? void 0 : auth.access_token, {
19276
19286
  params: {
19277
19287
  businessId
@@ -21226,7 +21236,7 @@ var ProfitAndLossDownloadButton = ({
21226
21236
  const { data: auth } = useAuth();
21227
21237
  const [requestFailed, setRequestFailed] = useState43(false);
21228
21238
  const [isDownloading, setIsDownloading] = useState43(false);
21229
- const handleClick = () => __async(void 0, null, function* () {
21239
+ const handleClick = () => __async(null, null, function* () {
21230
21240
  var _a;
21231
21241
  setIsDownloading(true);
21232
21242
  const getProfitAndLossExcel2 = Layer.getProfitAndLossExcel(
@@ -21289,7 +21299,7 @@ var SyncingBadge = () => {
21289
21299
  import { useMemo as useMemo27 } from "react";
21290
21300
 
21291
21301
  // src/hooks/bookkeeping/periods/useBookkeepingPeriods.ts
21292
- import useSWR9 from "swr";
21302
+ import useSWR10 from "swr";
21293
21303
 
21294
21304
  // src/utils/bookkeeping/bookkeepingStatusFilters.ts
21295
21305
  function isActiveBookkeepingStatus(status) {
@@ -21347,7 +21357,7 @@ var getBookkeepingPeriods = get(({ businessId }) => {
21347
21357
  return `/v1/businesses/${businessId}/bookkeeping/periods`;
21348
21358
  });
21349
21359
  var BOOKKEEPING_PERIODS_TAG_KEY = "#bookkeeping-periods";
21350
- function buildKey9({
21360
+ function buildKey10({
21351
21361
  access_token: accessToken,
21352
21362
  apiUrl,
21353
21363
  businessId,
@@ -21367,8 +21377,8 @@ function useBookkeepingPeriods() {
21367
21377
  const { businessId } = useLayerContext();
21368
21378
  const { data, isLoading: isLoadingBookkeepingStatus } = useBookkeepingStatus();
21369
21379
  const isActiveOrPaused = data ? isActiveOrPausedBookkeepingStatus(data.status) : false;
21370
- const swrResponse = useSWR9(
21371
- () => buildKey9(__spreadProps(__spreadValues({}, auth), {
21380
+ const swrResponse = useSWR10(
21381
+ () => buildKey10(__spreadProps(__spreadValues({}, auth), {
21372
21382
  businessId,
21373
21383
  isActiveOrPaused
21374
21384
  })),
@@ -22814,9 +22824,9 @@ ProfitAndLoss.Report = ProfitAndLossReport;
22814
22824
  ProfitAndLoss.DownloadButton = ProfitAndLossDownloadButton;
22815
22825
 
22816
22826
  // src/hooks/balanceSheet/useBalanceSheet.ts
22817
- import useSWR10 from "swr";
22827
+ import useSWR11 from "swr";
22818
22828
  import { endOfDay as endOfDay3 } from "date-fns";
22819
- function buildKey10({
22829
+ function buildKey11({
22820
22830
  access_token: accessToken,
22821
22831
  apiUrl,
22822
22832
  businessId,
@@ -22838,8 +22848,8 @@ function useBalanceSheet({
22838
22848
  const { data: auth } = useAuth();
22839
22849
  const { apiUrl } = useEnvironment();
22840
22850
  const { businessId } = useLayerContext();
22841
- return useSWR10(
22842
- () => buildKey10(__spreadProps(__spreadValues({}, auth), {
22851
+ return useSWR11(
22852
+ () => buildKey11(__spreadProps(__spreadValues({}, auth), {
22843
22853
  apiUrl,
22844
22854
  businessId,
22845
22855
  effectiveDate
@@ -23032,7 +23042,7 @@ var BALANCE_SHEET_ROWS = [
23032
23042
 
23033
23043
  // src/components/BalanceSheet/download/useBalanceSheetDownload.ts
23034
23044
  import useSWRMutation5 from "swr/mutation";
23035
- function buildKey11({
23045
+ function buildKey12({
23036
23046
  access_token: accessToken,
23037
23047
  apiUrl,
23038
23048
  businessId,
@@ -23055,7 +23065,7 @@ function useBalanceSheetDownload({
23055
23065
  const { data: auth } = useAuth();
23056
23066
  const { businessId } = useLayerContext();
23057
23067
  return useSWRMutation5(
23058
- () => buildKey11(__spreadProps(__spreadValues({}, auth), {
23068
+ () => buildKey12(__spreadProps(__spreadValues({}, auth), {
23059
23069
  businessId,
23060
23070
  effectiveDate
23061
23071
  })),
@@ -23316,7 +23326,7 @@ var STATEMENT_OF_CASH_FLOW_ROWS = [
23316
23326
 
23317
23327
  // src/components/StatementOfCashFlow/download/useCashflowStatementDownload.ts
23318
23328
  import useSWRMutation6 from "swr/mutation";
23319
- function buildKey12({
23329
+ function buildKey13({
23320
23330
  access_token: accessToken,
23321
23331
  apiUrl,
23322
23332
  businessId,
@@ -23342,7 +23352,7 @@ function useCashflowStatementDownload({
23342
23352
  const { data: auth } = useAuth();
23343
23353
  const { businessId } = useLayerContext();
23344
23354
  return useSWRMutation6(
23345
- () => buildKey12(__spreadProps(__spreadValues({}, auth), {
23355
+ () => buildKey13(__spreadProps(__spreadValues({}, auth), {
23346
23356
  businessId,
23347
23357
  startDate,
23348
23358
  endDate
@@ -23449,9 +23459,9 @@ function StatementOfCashFlowDatePicker({
23449
23459
  }
23450
23460
 
23451
23461
  // src/hooks/useStatementOfCashFlow/useStatementOfCashFlow.tsx
23452
- import useSWR11 from "swr";
23462
+ import useSWR12 from "swr";
23453
23463
  import { endOfMonth as endOfMonth10, startOfMonth as startOfMonth13 } from "date-fns";
23454
- function buildKey13({
23464
+ function buildKey14({
23455
23465
  access_token: accessToken,
23456
23466
  apiUrl,
23457
23467
  businessId,
@@ -23476,8 +23486,8 @@ function useStatementOfCashFlow({
23476
23486
  const { data: auth } = useAuth();
23477
23487
  const { apiUrl } = useEnvironment();
23478
23488
  const { businessId } = useLayerContext();
23479
- return useSWR11(
23480
- buildKey13(__spreadProps(__spreadValues({}, auth), {
23489
+ return useSWR12(
23490
+ buildKey14(__spreadProps(__spreadValues({}, auth), {
23481
23491
  apiUrl,
23482
23492
  businessId,
23483
23493
  startDate,
@@ -23810,7 +23820,7 @@ var LEDGER_ACCOUNT_SUBTYPES_FOR_TYPE = {
23810
23820
 
23811
23821
  // src/hooks/useChartOfAccounts/useChartOfAccounts.tsx
23812
23822
  import { endOfMonth as endOfMonth12, formatISO as formatISO3, startOfMonth as startOfMonth15 } from "date-fns";
23813
- import useSWR12 from "swr";
23823
+ import useSWR13 from "swr";
23814
23824
  var validate = (formData) => {
23815
23825
  const errors = [];
23816
23826
  const nameError = validateName(formData);
@@ -23915,7 +23925,7 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
23915
23925
  initialEndDate != null ? initialEndDate : endOfMonth12(Date.now())
23916
23926
  );
23917
23927
  const queryKey = businessId && (auth == null ? void 0 : auth.access_token) && `chart-of-accounts-${businessId}-${startDate == null ? void 0 : startDate.valueOf()}-${endDate == null ? void 0 : endDate.valueOf()}`;
23918
- const { data, isLoading, isValidating, error, mutate } = useSWR12(
23928
+ const { data, isLoading, isValidating, error, mutate } = useSWR13(
23919
23929
  queryKey,
23920
23930
  Layer.getLedgerAccountBalances(apiUrl, auth == null ? void 0 : auth.access_token, {
23921
23931
  params: {
@@ -23925,7 +23935,7 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
23925
23935
  }
23926
23936
  })
23927
23937
  );
23928
- const create = (newAccount) => __async(void 0, null, function* () {
23938
+ const create = (newAccount) => __async(null, null, function* () {
23929
23939
  setSendingForm(true);
23930
23940
  setApiError(void 0);
23931
23941
  try {
@@ -23942,7 +23952,7 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
23942
23952
  touch("CHART_OF_ACCOUNTS" /* CHART_OF_ACCOUNTS */);
23943
23953
  }
23944
23954
  });
23945
- const update = (accountData, accountId) => __async(void 0, null, function* () {
23955
+ const update = (accountData, accountId) => __async(null, null, function* () {
23946
23956
  setSendingForm(true);
23947
23957
  setApiError(void 0);
23948
23958
  const newAccountData = __spreadValues({}, accountData);
@@ -24123,9 +24133,14 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
24123
24133
  };
24124
24134
  };
24125
24135
 
24136
+ // src/hooks/useChartOfAccounts/useCreateChildAccount.tsx
24137
+ import useSWRMutation7 from "swr/mutation";
24138
+ import { useSWRConfig as useSWRConfig2 } from "swr";
24139
+ import { useCallback as useCallback8 } from "react";
24140
+
24126
24141
  // src/hooks/useLedgerAccounts/useLedgerAccounts.tsx
24127
24142
  import { useEffect as useEffect36, useState as useState49 } from "react";
24128
- import useSWR13 from "swr";
24143
+ import useSWR14 from "swr";
24129
24144
  var useLedgerAccounts = (showReversalEntries = false) => {
24130
24145
  const { businessId, read, syncTimestamps, hasBeenTouched } = useLayerContext();
24131
24146
  const { apiUrl } = useEnvironment();
@@ -24133,7 +24148,7 @@ var useLedgerAccounts = (showReversalEntries = false) => {
24133
24148
  const [accountId, setAccountId] = useState49();
24134
24149
  const [selectedEntryId, setSelectedEntryId] = useState49();
24135
24150
  const queryKey = businessId && accountId && (auth == null ? void 0 : auth.access_token) && `ledger-accounts-lines-${businessId}-${accountId}`;
24136
- const { data, isLoading, isValidating, error, mutate } = useSWR13(
24151
+ const { data, isLoading, isValidating, error, mutate } = useSWR14(
24137
24152
  queryKey,
24138
24153
  Layer.getLedgerAccountsLines(apiUrl, auth == null ? void 0 : auth.access_token, {
24139
24154
  params: {
@@ -24149,7 +24164,7 @@ var useLedgerAccounts = (showReversalEntries = false) => {
24149
24164
  isLoading: isLoadingEntry,
24150
24165
  isValidating: isValdiatingEntry,
24151
24166
  error: errorEntry
24152
- } = useSWR13(
24167
+ } = useSWR14(
24153
24168
  businessId && selectedEntryId && (auth == null ? void 0 : auth.access_token) && `ledger-accounts-entry-${businessId}-${selectedEntryId}}`,
24154
24169
  Layer.getLedgerAccountsEntry(apiUrl, auth == null ? void 0 : auth.access_token, {
24155
24170
  params: { businessId, entryId: selectedEntryId }
@@ -24666,8 +24681,8 @@ var ChartOfAccountsTableContent = ({
24666
24681
  };
24667
24682
 
24668
24683
  // src/components/ChartOfAccounts/download/useAccountBalancesDownload.ts
24669
- import useSWRMutation7 from "swr/mutation";
24670
- function buildKey14({
24684
+ import useSWRMutation8 from "swr/mutation";
24685
+ function buildKey15({
24671
24686
  access_token: accessToken,
24672
24687
  apiUrl,
24673
24688
  businessId,
@@ -24692,8 +24707,8 @@ function useAccountBalancesDownload({
24692
24707
  }) {
24693
24708
  const { data: auth } = useAuth();
24694
24709
  const { businessId } = useLayerContext();
24695
- return useSWRMutation7(
24696
- () => buildKey14(__spreadProps(__spreadValues({}, auth), {
24710
+ return useSWRMutation8(
24711
+ () => buildKey15(__spreadProps(__spreadValues({}, auth), {
24697
24712
  businessId,
24698
24713
  startCutoff,
24699
24714
  endCutoff
@@ -25664,7 +25679,7 @@ var JournalContext = createContext18({
25664
25679
 
25665
25680
  // src/hooks/useJournal/useJournal.tsx
25666
25681
  import { useEffect as useEffect40, useState as useState54 } from "react";
25667
- import useSWR14 from "swr";
25682
+ import useSWR15 from "swr";
25668
25683
  var useJournal = () => {
25669
25684
  const {
25670
25685
  businessId,
@@ -25681,7 +25696,7 @@ var useJournal = () => {
25681
25696
  const [sendingForm, setSendingForm] = useState54(false);
25682
25697
  const [apiError, setApiError] = useState54(void 0);
25683
25698
  const queryKey = businessId && (auth == null ? void 0 : auth.access_token) && `journal-lines-${businessId}`;
25684
- const { data, isLoading, isValidating, error, mutate } = useSWR14(
25699
+ const { data, isLoading, isValidating, error, mutate } = useSWR15(
25685
25700
  queryKey,
25686
25701
  Layer.getJournal(apiUrl, auth == null ? void 0 : auth.access_token, {
25687
25702
  params: { businessId }
@@ -25691,7 +25706,7 @@ var useJournal = () => {
25691
25706
  const closeSelectedEntry = () => {
25692
25707
  setSelectedEntryId(void 0);
25693
25708
  };
25694
- const create = (newJournalEntry) => __async(void 0, null, function* () {
25709
+ const create = (newJournalEntry) => __async(null, null, function* () {
25695
25710
  setSendingForm(true);
25696
25711
  setApiError(void 0);
25697
25712
  try {
@@ -25890,7 +25905,7 @@ var useJournal = () => {
25890
25905
  })
25891
25906
  }));
25892
25907
  };
25893
- const reverseEntry = (entryId) => __async(void 0, null, function* () {
25908
+ const reverseEntry = (entryId) => __async(null, null, function* () {
25894
25909
  return Layer.reverseJournalEntry(apiUrl, auth == null ? void 0 : auth.access_token, {
25895
25910
  params: { businessId, entryId }
25896
25911
  });
@@ -25968,7 +25983,7 @@ var JournalEntryDetails = () => {
25968
25983
  },
25969
25984
  [entry == null ? void 0 : entry.line_items]
25970
25985
  );
25971
- const onReverseEntry = () => __async(void 0, null, function* () {
25986
+ const onReverseEntry = () => __async(null, null, function* () {
25972
25987
  if (!entry) {
25973
25988
  return;
25974
25989
  }
@@ -26141,45 +26156,6 @@ import { useContext as useContext41 } from "react";
26141
26156
 
26142
26157
  // src/components/JournalForm/JournalFormEntryLines.tsx
26143
26158
  import { useContext as useContext40, useMemo as useMemo36 } from "react";
26144
-
26145
- // src/hooks/categories/useAllCategories.ts
26146
- import useSWR15 from "swr";
26147
- function buildKey15({
26148
- access_token: accessToken,
26149
- apiUrl,
26150
- businessId
26151
- }) {
26152
- if (accessToken && apiUrl) {
26153
- return {
26154
- accessToken,
26155
- apiUrl,
26156
- businessId,
26157
- mode: "ALL",
26158
- tags: ["#categories"]
26159
- };
26160
- }
26161
- }
26162
- function useAllCategories() {
26163
- const { data: auth } = useAuth();
26164
- const { businessId } = useLayerContext();
26165
- return useSWR15(
26166
- () => buildKey15(__spreadProps(__spreadValues({}, auth), {
26167
- businessId
26168
- })),
26169
- ({ accessToken, apiUrl, businessId: businessId2, mode }) => getCategories(
26170
- apiUrl,
26171
- accessToken,
26172
- {
26173
- params: {
26174
- businessId: businessId2,
26175
- mode
26176
- }
26177
- }
26178
- )().then(({ data }) => data.categories)
26179
- );
26180
- }
26181
-
26182
- // src/components/JournalForm/JournalFormEntryLines.tsx
26183
26159
  import { Fragment as Fragment33, jsx as jsx222, jsxs as jsxs139 } from "react/jsx-runtime";
26184
26160
  function recursiveFlattenCategories(accounts) {
26185
26161
  const flattenedResult = accounts.flatMap((a) => {
@@ -26199,10 +26175,10 @@ var JournalFormEntryLines = ({
26199
26175
  sendingForm,
26200
26176
  config
26201
26177
  }) => {
26202
- const { data } = useAllCategories();
26178
+ const { data: categories } = useCategories({ mode: "ALL" });
26203
26179
  const { form } = useContext40(JournalContext);
26204
26180
  const { flattenedCategories, parentOptions } = useMemo36(() => {
26205
- const flattenedCategories2 = recursiveFlattenCategories(data != null ? data : []);
26181
+ const flattenedCategories2 = recursiveFlattenCategories(categories != null ? categories : []);
26206
26182
  const parentOptions2 = [...flattenedCategories2].sort((a, b) => a.display_name.localeCompare(b.display_name)).map((account) => {
26207
26183
  switch (account.type) {
26208
26184
  case "AccountNested":
@@ -26228,7 +26204,7 @@ var JournalFormEntryLines = ({
26228
26204
  }
26229
26205
  });
26230
26206
  return { flattenedCategories: flattenedCategories2, parentOptions: parentOptions2 };
26231
- }, [data]);
26207
+ }, [categories]);
26232
26208
  const handleChangeParent = ({
26233
26209
  lineItemIndex,
26234
26210
  value
@@ -26688,7 +26664,7 @@ var JournalTableContent = ({
26688
26664
  };
26689
26665
 
26690
26666
  // src/components/Journal/download/useJournalEntriesDownload.ts
26691
- import useSWRMutation8 from "swr/mutation";
26667
+ import useSWRMutation9 from "swr/mutation";
26692
26668
  function buildKey16({
26693
26669
  access_token: accessToken,
26694
26670
  apiUrl,
@@ -26714,7 +26690,7 @@ function useJournalEntriesDownload({
26714
26690
  }) {
26715
26691
  const { data: auth } = useAuth();
26716
26692
  const { businessId } = useLayerContext();
26717
- return useSWRMutation8(
26693
+ return useSWRMutation9(
26718
26694
  () => buildKey16(__spreadProps(__spreadValues({}, auth), {
26719
26695
  businessId,
26720
26696
  startCutoff,
@@ -26761,7 +26737,7 @@ function JournalEntriesDownloadButton({
26761
26737
  {
26762
26738
  iconOnly,
26763
26739
  onClick: () => {
26764
- trigger();
26740
+ void trigger();
26765
26741
  },
26766
26742
  isDownloading: isMutating,
26767
26743
  requestFailed: Boolean(error),
@@ -27013,8 +26989,8 @@ function getIconForTask(task) {
27013
26989
  }
27014
26990
 
27015
26991
  // src/hooks/bookkeeping/periods/tasks/useSubmitResponseForTask.ts
27016
- import { useSWRConfig as useSWRConfig2 } from "swr";
27017
- import useSWRMutation9 from "swr/mutation";
26992
+ import { useSWRConfig as useSWRConfig3 } from "swr";
26993
+ import useSWRMutation10 from "swr/mutation";
27018
26994
 
27019
26995
  // src/api/layer/tasks.ts
27020
26996
  var submitUserResponseForTask = post(
@@ -27047,7 +27023,7 @@ function completeTaskWithUpload(baseUrl, accessToken, {
27047
27023
  }
27048
27024
 
27049
27025
  // src/hooks/bookkeeping/periods/tasks/useSubmitResponseForTask.ts
27050
- import { useCallback as useCallback8 } from "react";
27026
+ import { useCallback as useCallback9 } from "react";
27051
27027
  function buildKey17({
27052
27028
  access_token: accessToken,
27053
27029
  apiUrl,
@@ -27065,8 +27041,8 @@ function buildKey17({
27065
27041
  function useSubmitUserResponseForTask() {
27066
27042
  const { data: auth } = useAuth();
27067
27043
  const { businessId } = useLayerContext();
27068
- const { mutate } = useSWRConfig2();
27069
- const mutationResponse = useSWRMutation9(
27044
+ const { mutate } = useSWRConfig3();
27045
+ const mutationResponse = useSWRMutation10(
27070
27046
  () => buildKey17(__spreadProps(__spreadValues({}, auth), {
27071
27047
  businessId
27072
27048
  })),
@@ -27090,8 +27066,8 @@ function useSubmitUserResponseForTask() {
27090
27066
  }
27091
27067
  );
27092
27068
  const { trigger: originalTrigger } = mutationResponse;
27093
- const stableProxiedTrigger = useCallback8(
27094
- (...triggerParameters) => __async(this, null, function* () {
27069
+ const stableProxiedTrigger = useCallback9(
27070
+ (...triggerParameters) => __async(null, null, function* () {
27095
27071
  const result = yield originalTrigger(...triggerParameters);
27096
27072
  if (result) {
27097
27073
  void mutate((key) => withSWRKeyTags(
@@ -27114,9 +27090,9 @@ function useSubmitUserResponseForTask() {
27114
27090
  }
27115
27091
 
27116
27092
  // src/hooks/bookkeeping/periods/tasks/useUploadDocumentsForTask.ts
27117
- import { useSWRConfig as useSWRConfig3 } from "swr";
27118
- import useSWRMutation10 from "swr/mutation";
27119
- import { useCallback as useCallback9 } from "react";
27093
+ import { useSWRConfig as useSWRConfig4 } from "swr";
27094
+ import useSWRMutation11 from "swr/mutation";
27095
+ import { useCallback as useCallback10 } from "react";
27120
27096
  function buildKey18({
27121
27097
  access_token: accessToken,
27122
27098
  apiUrl,
@@ -27134,8 +27110,8 @@ function buildKey18({
27134
27110
  function useUploadDocumentsForTask() {
27135
27111
  const { data: auth } = useAuth();
27136
27112
  const { businessId } = useLayerContext();
27137
- const { mutate } = useSWRConfig3();
27138
- const mutationResponse = useSWRMutation10(
27113
+ const { mutate } = useSWRConfig4();
27114
+ const mutationResponse = useSWRMutation11(
27139
27115
  () => buildKey18(__spreadProps(__spreadValues({}, auth), {
27140
27116
  businessId
27141
27117
  })),
@@ -27155,8 +27131,8 @@ function useUploadDocumentsForTask() {
27155
27131
  }
27156
27132
  );
27157
27133
  const { trigger: originalTrigger } = mutationResponse;
27158
- const stableProxiedTrigger = useCallback9(
27159
- (...triggerParameters) => __async(this, null, function* () {
27134
+ const stableProxiedTrigger = useCallback10(
27135
+ (...triggerParameters) => __async(null, null, function* () {
27160
27136
  const result = yield originalTrigger(...triggerParameters);
27161
27137
  if (result) {
27162
27138
  void mutate((key) => withSWRKeyTags(
@@ -27179,9 +27155,9 @@ function useUploadDocumentsForTask() {
27179
27155
  }
27180
27156
 
27181
27157
  // src/hooks/bookkeeping/periods/tasks/useDeleteUploadsOnTask.ts
27182
- import { useSWRConfig as useSWRConfig4 } from "swr";
27183
- import useSWRMutation11 from "swr/mutation";
27184
- import { useCallback as useCallback10 } from "react";
27158
+ import { useSWRConfig as useSWRConfig5 } from "swr";
27159
+ import useSWRMutation12 from "swr/mutation";
27160
+ import { useCallback as useCallback11 } from "react";
27185
27161
  function buildKey19({
27186
27162
  access_token: accessToken,
27187
27163
  apiUrl,
@@ -27199,8 +27175,8 @@ function buildKey19({
27199
27175
  function useDeleteUploadsOnTask() {
27200
27176
  const { data: auth } = useAuth();
27201
27177
  const { businessId } = useLayerContext();
27202
- const { mutate } = useSWRConfig4();
27203
- const mutationResponse = useSWRMutation11(
27178
+ const { mutate } = useSWRConfig5();
27179
+ const mutationResponse = useSWRMutation12(
27204
27180
  () => buildKey19(__spreadProps(__spreadValues({}, auth), {
27205
27181
  businessId
27206
27182
  })),
@@ -27217,8 +27193,8 @@ function useDeleteUploadsOnTask() {
27217
27193
  }
27218
27194
  );
27219
27195
  const { trigger: originalTrigger } = mutationResponse;
27220
- const stableProxiedTrigger = useCallback10(
27221
- (...triggerParameters) => __async(this, null, function* () {
27196
+ const stableProxiedTrigger = useCallback11(
27197
+ (...triggerParameters) => __async(null, null, function* () {
27222
27198
  const result = yield originalTrigger(...triggerParameters);
27223
27199
  if (result) {
27224
27200
  void mutate((key) => withSWRKeyTags(
@@ -27241,9 +27217,9 @@ function useDeleteUploadsOnTask() {
27241
27217
  }
27242
27218
 
27243
27219
  // src/hooks/bookkeeping/periods/tasks/useUpdateTaskUploadDescription.ts
27244
- import { useSWRConfig as useSWRConfig5 } from "swr";
27245
- import useSWRMutation12 from "swr/mutation";
27246
- import { useCallback as useCallback11 } from "react";
27220
+ import { useSWRConfig as useSWRConfig6 } from "swr";
27221
+ import useSWRMutation13 from "swr/mutation";
27222
+ import { useCallback as useCallback12 } from "react";
27247
27223
  function buildKey20({
27248
27224
  access_token: accessToken,
27249
27225
  apiUrl,
@@ -27261,8 +27237,8 @@ function buildKey20({
27261
27237
  function useUpdateTaskUploadDescription() {
27262
27238
  const { data: auth } = useAuth();
27263
27239
  const { businessId } = useLayerContext();
27264
- const { mutate } = useSWRConfig5();
27265
- const mutationResponse = useSWRMutation12(
27240
+ const { mutate } = useSWRConfig6();
27241
+ const mutationResponse = useSWRMutation13(
27266
27242
  () => buildKey20(__spreadProps(__spreadValues({}, auth), {
27267
27243
  businessId
27268
27244
  })),
@@ -27283,8 +27259,8 @@ function useUpdateTaskUploadDescription() {
27283
27259
  }
27284
27260
  );
27285
27261
  const { trigger: originalTrigger } = mutationResponse;
27286
- const stableProxiedTrigger = useCallback11(
27287
- (...triggerParameters) => __async(this, null, function* () {
27262
+ const stableProxiedTrigger = useCallback12(
27263
+ (...triggerParameters) => __async(null, null, function* () {
27288
27264
  const result = yield originalTrigger(...triggerParameters);
27289
27265
  if (result) {
27290
27266
  void mutate((key) => withSWRKeyTags(
@@ -27336,7 +27312,7 @@ var TasksListItem = ({
27336
27312
  useEffect42(() => {
27337
27313
  setIsOpen(defaultOpen);
27338
27314
  }, [defaultOpen]);
27339
- const submit = () => __async(void 0, null, function* () {
27315
+ const submit = () => __async(null, null, function* () {
27340
27316
  if (!selectedFiles) {
27341
27317
  return;
27342
27318
  }
@@ -27552,7 +27528,7 @@ var TasksListMobile = ({
27552
27528
  };
27553
27529
 
27554
27530
  // src/hooks/array/usePaginatedList.ts
27555
- import { useCallback as useCallback12, useMemo as useMemo39, useState as useState59 } from "react";
27531
+ import { useCallback as useCallback13, useMemo as useMemo39, useState as useState59 } from "react";
27556
27532
  function usePaginatedList(list, pageSize) {
27557
27533
  const [internalPageIndex, setInternalPageIndex] = useState59(0);
27558
27534
  const pageCount = Math.max(0, Math.ceil(list.length / pageSize));
@@ -27563,16 +27539,16 @@ function usePaginatedList(list, pageSize) {
27563
27539
  (effectivePageIndex + 1) * pageSize
27564
27540
  );
27565
27541
  }, [list, effectivePageIndex, pageSize]);
27566
- const next = useCallback12(() => {
27542
+ const next = useCallback13(() => {
27567
27543
  setInternalPageIndex(Math.min(effectivePageIndex + 1, pageCount - 1));
27568
27544
  }, [effectivePageIndex, pageCount]);
27569
- const set2 = useCallback12((pageIndex) => {
27545
+ const set2 = useCallback13((pageIndex) => {
27570
27546
  setInternalPageIndex(Math.max(0, Math.min(pageIndex, pageCount - 1)));
27571
27547
  }, [pageCount]);
27572
- const previous = useCallback12(() => {
27548
+ const previous = useCallback13(() => {
27573
27549
  setInternalPageIndex(Math.max(effectivePageIndex - 1, 0));
27574
27550
  }, [effectivePageIndex]);
27575
- const reset = useCallback12(() => {
27551
+ const reset = useCallback13(() => {
27576
27552
  setInternalPageIndex(0);
27577
27553
  }, []);
27578
27554
  return {
@@ -28388,7 +28364,7 @@ import { useForm as useForm2 } from "@tanstack/react-form";
28388
28364
  import {
28389
28365
  Children,
28390
28366
  createContext as createContext19,
28391
- useCallback as useCallback13,
28367
+ useCallback as useCallback14,
28392
28368
  useContext as useContext45,
28393
28369
  useMemo as useMemo44,
28394
28370
  useState as useState61
@@ -28400,13 +28376,13 @@ function useWizardStep({
28400
28376
  }) {
28401
28377
  const stepCount = steps.length;
28402
28378
  const [activeStepIndex, setActiveStepIndex] = useState61(0);
28403
- const next = useCallback13(() => __async(this, null, function* () {
28379
+ const next = useCallback14(() => __async(null, null, function* () {
28404
28380
  setActiveStepIndex((stepIndex) => Math.min(stepIndex + 1, stepCount - 1));
28405
28381
  if (activeStepIndex === stepCount - 1 && onComplete) {
28406
28382
  yield onComplete == null ? void 0 : onComplete();
28407
28383
  }
28408
28384
  }), [stepCount, activeStepIndex, onComplete]);
28409
- const previous = useCallback13(() => setActiveStepIndex((stepIndex) => Math.max(stepIndex - 1, 0)), []);
28385
+ const previous = useCallback14(() => setActiveStepIndex((stepIndex) => Math.max(stepIndex - 1, 0)), []);
28410
28386
  const effectiveStepIndex = Math.min(activeStepIndex, stepCount - 1);
28411
28387
  const currentStep = steps.at(effectiveStepIndex);
28412
28388
  return { currentStep, next, previous };
@@ -28485,7 +28461,7 @@ function LinkAccountsConfirmationStep() {
28485
28461
  defaultValues: {
28486
28462
  accounts: effectiveLinkedAccounts.map((account) => ({ account, isSelected: true }))
28487
28463
  },
28488
- onSubmit: (_0) => __async(this, [_0], function* ({ value }) {
28464
+ onSubmit: (_0) => __async(null, [_0], function* ({ value }) {
28489
28465
  const formattedArg = Object.fromEntries(
28490
28466
  value.accounts.map(({ account, isSelected }) => [account.id, isSelected])
28491
28467
  );
@@ -29057,9 +29033,9 @@ function useBusinessPersonnel() {
29057
29033
  }
29058
29034
 
29059
29035
  // src/hooks/businessPersonnel/useCreateBusinessPersonnel.ts
29060
- import useSWRMutation13 from "swr/mutation";
29061
- import { useSWRConfig as useSWRConfig6 } from "swr";
29062
- import { useCallback as useCallback14 } from "react";
29036
+ import useSWRMutation14 from "swr/mutation";
29037
+ import { useSWRConfig as useSWRConfig7 } from "swr";
29038
+ import { useCallback as useCallback15 } from "react";
29063
29039
  var createBusinessPersonnel = post(({ businessId }) => `/v1/businesses/${businessId}/personnel`);
29064
29040
  function buildKey23({
29065
29041
  access_token: accessToken,
@@ -29078,8 +29054,8 @@ function buildKey23({
29078
29054
  function useCreateBusinessPersonnel() {
29079
29055
  const { data } = useAuth();
29080
29056
  const { businessId } = useLayerContext();
29081
- const { mutate } = useSWRConfig6();
29082
- const mutationResponse = useSWRMutation13(
29057
+ const { mutate } = useSWRConfig7();
29058
+ const mutationResponse = useSWRMutation14(
29083
29059
  () => buildKey23(__spreadProps(__spreadValues({}, data), {
29084
29060
  businessId
29085
29061
  })),
@@ -29097,8 +29073,8 @@ function useCreateBusinessPersonnel() {
29097
29073
  }
29098
29074
  );
29099
29075
  const { trigger: originalTrigger } = mutationResponse;
29100
- const stableProxiedTrigger = useCallback14(
29101
- (...triggerParameters) => __async(this, null, function* () {
29076
+ const stableProxiedTrigger = useCallback15(
29077
+ (...triggerParameters) => __async(null, null, function* () {
29102
29078
  const result = yield originalTrigger(...triggerParameters);
29103
29079
  if (result) {
29104
29080
  yield mutate((key) => withSWRKeyTags(
@@ -29121,8 +29097,8 @@ function useCreateBusinessPersonnel() {
29121
29097
  }
29122
29098
 
29123
29099
  // src/hooks/businessPersonnel/useUpdateBusinessPersonnel.ts
29124
- import useSWRMutation14 from "swr/mutation";
29125
- import { useSWRConfig as useSWRConfig7 } from "swr";
29100
+ import useSWRMutation15 from "swr/mutation";
29101
+ import { useSWRConfig as useSWRConfig8 } from "swr";
29126
29102
 
29127
29103
  // src/api/layer/businessPersonnel/updateBusinessPersonnel.ts
29128
29104
  var updateBusinessPersonnel = post(({ businessId, businessPersonnelId }) => {
@@ -29130,7 +29106,7 @@ var updateBusinessPersonnel = post(({ businessId, businessPersonnelId }) => {
29130
29106
  });
29131
29107
 
29132
29108
  // src/hooks/businessPersonnel/useUpdateBusinessPersonnel.ts
29133
- import { useCallback as useCallback15 } from "react";
29109
+ import { useCallback as useCallback16 } from "react";
29134
29110
  function buildKey24({
29135
29111
  access_token: accessToken,
29136
29112
  apiUrl,
@@ -29150,8 +29126,8 @@ function buildKey24({
29150
29126
  function useUpdateBusinessPersonnel({ businessPersonnelId }) {
29151
29127
  const { data } = useAuth();
29152
29128
  const { businessId } = useLayerContext();
29153
- const { mutate } = useSWRConfig7();
29154
- const mutationResponse = useSWRMutation14(
29129
+ const { mutate } = useSWRConfig8();
29130
+ const mutationResponse = useSWRMutation15(
29155
29131
  () => buildKey24(__spreadProps(__spreadValues({}, data), {
29156
29132
  businessId,
29157
29133
  businessPersonnelId
@@ -29173,8 +29149,8 @@ function useUpdateBusinessPersonnel({ businessPersonnelId }) {
29173
29149
  }
29174
29150
  );
29175
29151
  const { trigger: originalTrigger } = mutationResponse;
29176
- const stableProxiedTrigger = useCallback15(
29177
- (...triggerParameters) => __async(this, null, function* () {
29152
+ const stableProxiedTrigger = useCallback16(
29153
+ (...triggerParameters) => __async(null, null, function* () {
29178
29154
  const result = yield originalTrigger(...triggerParameters);
29179
29155
  if (result) {
29180
29156
  yield mutate((key) => withSWRKeyTags(
@@ -29197,9 +29173,9 @@ function useUpdateBusinessPersonnel({ businessPersonnelId }) {
29197
29173
  }
29198
29174
 
29199
29175
  // src/hooks/business/useUpdateBusiness.ts
29200
- import useSWRMutation15 from "swr/mutation";
29201
- import { useSWRConfig as useSWRConfig8 } from "swr";
29202
- import { useCallback as useCallback16 } from "react";
29176
+ import useSWRMutation16 from "swr/mutation";
29177
+ import { useSWRConfig as useSWRConfig9 } from "swr";
29178
+ import { useCallback as useCallback17 } from "react";
29203
29179
  var BUSINESS_TAG_KEY = "business";
29204
29180
  function buildKey25({
29205
29181
  access_token: accessToken,
@@ -29218,8 +29194,8 @@ function buildKey25({
29218
29194
  function useUpdateBusiness() {
29219
29195
  const { data } = useAuth();
29220
29196
  const { businessId } = useLayerContext();
29221
- const { mutate } = useSWRConfig8();
29222
- const mutationResponse = useSWRMutation15(
29197
+ const { mutate } = useSWRConfig9();
29198
+ const mutationResponse = useSWRMutation16(
29223
29199
  () => buildKey25(__spreadProps(__spreadValues({}, data), {
29224
29200
  businessId
29225
29201
  })),
@@ -29237,8 +29213,8 @@ function useUpdateBusiness() {
29237
29213
  }
29238
29214
  );
29239
29215
  const { trigger: originalTrigger } = mutationResponse;
29240
- const stableProxiedTrigger = useCallback16(
29241
- (...triggerParameters) => __async(this, null, function* () {
29216
+ const stableProxiedTrigger = useCallback17(
29217
+ (...triggerParameters) => __async(null, null, function* () {
29242
29218
  const result = yield originalTrigger(...triggerParameters);
29243
29219
  if (result) {
29244
29220
  yield mutate((key) => withSWRKeyTags(
@@ -29289,7 +29265,7 @@ var useBusinessForm = ({ onSuccess }) => {
29289
29265
  us_state: (_i = business == null ? void 0 : business.us_state) != null ? _i : void 0,
29290
29266
  tin: business == null ? void 0 : business.tin
29291
29267
  },
29292
- onSubmit: (_0) => __async(void 0, [_0], function* ({ value }) {
29268
+ onSubmit: (_0) => __async(null, [_0], function* ({ value }) {
29293
29269
  var _a2;
29294
29270
  try {
29295
29271
  setSubmitError(void 0);