@layerfi/components 0.1.89 → 0.1.91-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.
- package/dist/cjs/index.cjs +1567 -442
- package/dist/esm/index.mjs +1557 -433
- package/dist/index.css +324 -45
- package/dist/index.d.ts +407 -27
- package/package.json +5 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -55,10 +55,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
55
55
|
mod
|
|
56
56
|
));
|
|
57
57
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
-
var __publicField = (obj, key, value) =>
|
|
59
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
60
|
-
return value;
|
|
61
|
-
};
|
|
58
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
62
59
|
var __async = (__this, __arguments, generator) => {
|
|
63
60
|
return new Promise((resolve, reject) => {
|
|
64
61
|
var fulfilled = (value) => {
|
|
@@ -81,8 +78,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
81
78
|
};
|
|
82
79
|
|
|
83
80
|
// src/index.tsx
|
|
84
|
-
var
|
|
85
|
-
__export(
|
|
81
|
+
var index_exports = {};
|
|
82
|
+
__export(index_exports, {
|
|
86
83
|
AccountingOverview: () => AccountingOverview,
|
|
87
84
|
BalanceSheet: () => BalanceSheet,
|
|
88
85
|
BankTransactions: () => BankTransactions,
|
|
@@ -99,6 +96,7 @@ __export(src_exports, {
|
|
|
99
96
|
LinkAccounts: () => LinkAccounts,
|
|
100
97
|
LinkedAccounts: () => LinkedAccounts,
|
|
101
98
|
Onboarding: () => Onboarding,
|
|
99
|
+
PlatformOnboarding: () => PlatformOnboarding,
|
|
102
100
|
ProfitAndLoss: () => ProfitAndLoss,
|
|
103
101
|
ProfitAndLossView: () => ProfitAndLossView,
|
|
104
102
|
ProjectProfitabilityView: () => ProjectProfitabilityView,
|
|
@@ -110,7 +108,7 @@ __export(src_exports, {
|
|
|
110
108
|
useDataSync: () => useDataSync,
|
|
111
109
|
useLayerContext: () => useLayerContext
|
|
112
110
|
});
|
|
113
|
-
module.exports = __toCommonJS(
|
|
111
|
+
module.exports = __toCommonJS(index_exports);
|
|
114
112
|
|
|
115
113
|
// src/providers/LayerProvider/LayerProvider.tsx
|
|
116
114
|
var import_react16 = require("react");
|
|
@@ -119,7 +117,7 @@ var import_react16 = require("react");
|
|
|
119
117
|
var import_react14 = require("react");
|
|
120
118
|
|
|
121
119
|
// package.json
|
|
122
|
-
var version = "0.1.
|
|
120
|
+
var version = "0.1.91-alpha";
|
|
123
121
|
|
|
124
122
|
// src/models/APIError.ts
|
|
125
123
|
var APIError = class _APIError extends Error {
|
|
@@ -363,6 +361,9 @@ var createBillPayment = post(
|
|
|
363
361
|
|
|
364
362
|
// src/api/layer/business.ts
|
|
365
363
|
var getBusiness = get(({ businessId }) => `/v1/businesses/${businessId}`);
|
|
364
|
+
var updateBusiness = put(
|
|
365
|
+
({ businessId }) => `/v1/businesses/${businessId}`
|
|
366
|
+
);
|
|
366
367
|
|
|
367
368
|
// src/api/layer/categories.ts
|
|
368
369
|
var getCategories = get(({ businessId, mode }) => {
|
|
@@ -764,14 +765,14 @@ function ToastsContainer() {
|
|
|
764
765
|
// src/components/GlobalWidgets/GlobalWidgets.tsx
|
|
765
766
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
766
767
|
var DrawerWidget = () => {
|
|
767
|
-
const { content, close } = (0, import_react5.useContext)(DrawerContext);
|
|
768
|
+
const { content, close: close2 } = (0, import_react5.useContext)(DrawerContext);
|
|
768
769
|
const { isMobile, isTablet } = useSizeClass();
|
|
769
770
|
(0, import_react5.useEffect)(() => {
|
|
770
771
|
if (!isMobile && !isTablet && content) {
|
|
771
|
-
|
|
772
|
+
close2();
|
|
772
773
|
}
|
|
773
774
|
}, [isMobile]);
|
|
774
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Drawer, { isOpen: Boolean(content), onClose:
|
|
775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Drawer, { isOpen: Boolean(content), onClose: close2, children: content });
|
|
775
776
|
};
|
|
776
777
|
var GlobalWidgets = () => {
|
|
777
778
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
@@ -876,7 +877,7 @@ var import_react7 = require("react");
|
|
|
876
877
|
var useDrawer = () => {
|
|
877
878
|
const [content, setContent] = (0, import_react7.useState)(void 0);
|
|
878
879
|
const [isClosing, setIsClosing] = (0, import_react7.useState)(false);
|
|
879
|
-
const
|
|
880
|
+
const close2 = () => {
|
|
880
881
|
setIsClosing(true);
|
|
881
882
|
};
|
|
882
883
|
const finishClosing = () => {
|
|
@@ -888,7 +889,7 @@ var useDrawer = () => {
|
|
|
888
889
|
setContent,
|
|
889
890
|
finishClosing,
|
|
890
891
|
isClosing,
|
|
891
|
-
close
|
|
892
|
+
close: close2
|
|
892
893
|
};
|
|
893
894
|
};
|
|
894
895
|
|
|
@@ -910,6 +911,15 @@ function hasSuggestions(categorization) {
|
|
|
910
911
|
return categorization != null && categorization.suggestions !== void 0 && categorization.suggestions.length > 0;
|
|
911
912
|
}
|
|
912
913
|
|
|
914
|
+
// src/types/business.ts
|
|
915
|
+
var ENTITY_TYPES = [
|
|
916
|
+
{ value: "SOLE_PROP", label: "Sole Proprietorship" },
|
|
917
|
+
{ value: "C_CORP", label: "C Corporation" },
|
|
918
|
+
{ value: "LLC", label: "Limited Liability Company" },
|
|
919
|
+
{ value: "S_CORP", label: "S Corporation" },
|
|
920
|
+
{ value: "PARTNERSHIP", label: "Partnership" }
|
|
921
|
+
];
|
|
922
|
+
|
|
913
923
|
// src/config/theme.ts
|
|
914
924
|
var SHADES = {
|
|
915
925
|
50: { s: 1, l: 98 },
|
|
@@ -1108,16 +1118,11 @@ var buildColorShade = (shade, darkColorHsl) => {
|
|
|
1108
1118
|
return { hsl, rgb, hex };
|
|
1109
1119
|
};
|
|
1110
1120
|
var hueToRgb = (p, q, t) => {
|
|
1111
|
-
if (t < 0)
|
|
1112
|
-
|
|
1113
|
-
if (t
|
|
1114
|
-
|
|
1115
|
-
if (t <
|
|
1116
|
-
return p + (q - p) * 6 * t;
|
|
1117
|
-
if (t < 1 / 2)
|
|
1118
|
-
return q;
|
|
1119
|
-
if (t < 2 / 3)
|
|
1120
|
-
return p + (q - p) * (2 / 3 - t) * 6;
|
|
1121
|
+
if (t < 0) t += 1;
|
|
1122
|
+
if (t > 1) t -= 1;
|
|
1123
|
+
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
1124
|
+
if (t < 1 / 2) return q;
|
|
1125
|
+
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
|
1121
1126
|
return p;
|
|
1122
1127
|
};
|
|
1123
1128
|
var hslToRgb = (hsl) => {
|
|
@@ -2462,7 +2467,7 @@ var BusinessProvider = ({
|
|
|
2462
2467
|
setOnboardingStep,
|
|
2463
2468
|
addToast,
|
|
2464
2469
|
removeToast,
|
|
2465
|
-
onError: errorHandler.onError,
|
|
2470
|
+
onError: (payload) => errorHandler.onError(payload),
|
|
2466
2471
|
touch,
|
|
2467
2472
|
read,
|
|
2468
2473
|
syncTimestamps,
|
|
@@ -3366,8 +3371,7 @@ var TooltipContent = (0, import_react22.forwardRef)(function TooltipContent2(_a,
|
|
|
3366
3371
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3367
3372
|
const context = useTooltipContext();
|
|
3368
3373
|
const ref = (0, import_react23.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
3369
|
-
if (!context.open || context.disabled)
|
|
3370
|
-
return null;
|
|
3374
|
+
if (!context.open || context.disabled) return null;
|
|
3371
3375
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react23.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3372
3376
|
"div",
|
|
3373
3377
|
__spreadProps(__spreadValues({
|
|
@@ -3515,8 +3519,7 @@ var IconButton = (_a) => {
|
|
|
3515
3519
|
download,
|
|
3516
3520
|
className: baseClassName,
|
|
3517
3521
|
onClick: (e) => {
|
|
3518
|
-
if (props.disabled)
|
|
3519
|
-
e.preventDefault();
|
|
3522
|
+
if (props.disabled) e.preventDefault();
|
|
3520
3523
|
},
|
|
3521
3524
|
children: icon
|
|
3522
3525
|
}
|
|
@@ -3776,7 +3779,8 @@ var SubmitButton = (_a) => {
|
|
|
3776
3779
|
children,
|
|
3777
3780
|
action = "save" /* SAVE */,
|
|
3778
3781
|
noIcon,
|
|
3779
|
-
variant = "primary" /* primary
|
|
3782
|
+
variant = "primary" /* primary */,
|
|
3783
|
+
withRetry
|
|
3780
3784
|
} = _b, props = __objRest(_b, [
|
|
3781
3785
|
"active",
|
|
3782
3786
|
"className",
|
|
@@ -3786,12 +3790,24 @@ var SubmitButton = (_a) => {
|
|
|
3786
3790
|
"children",
|
|
3787
3791
|
"action",
|
|
3788
3792
|
"noIcon",
|
|
3789
|
-
"variant"
|
|
3793
|
+
"variant",
|
|
3794
|
+
"withRetry"
|
|
3790
3795
|
]);
|
|
3791
3796
|
const baseClassName = (0, import_classnames7.default)(
|
|
3792
3797
|
active ? "Layer__btn--active" : "",
|
|
3793
3798
|
className
|
|
3794
3799
|
);
|
|
3800
|
+
if (withRetry && error) {
|
|
3801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3802
|
+
RetryButton,
|
|
3803
|
+
__spreadProps(__spreadValues({}, props), {
|
|
3804
|
+
className: baseClassName,
|
|
3805
|
+
disabled: processing || disabled,
|
|
3806
|
+
error: typeof error === "string" ? error : "Something went wrong",
|
|
3807
|
+
children
|
|
3808
|
+
})
|
|
3809
|
+
);
|
|
3810
|
+
}
|
|
3795
3811
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3796
3812
|
Button,
|
|
3797
3813
|
__spreadProps(__spreadValues({}, props), {
|
|
@@ -4245,7 +4261,8 @@ var Text = (_a) => {
|
|
|
4245
4261
|
weight = "normal" /* normal */,
|
|
4246
4262
|
withTooltip,
|
|
4247
4263
|
ellipsis,
|
|
4248
|
-
status
|
|
4264
|
+
status,
|
|
4265
|
+
pb
|
|
4249
4266
|
} = _b, props = __objRest(_b, [
|
|
4250
4267
|
"as",
|
|
4251
4268
|
"className",
|
|
@@ -4254,9 +4271,10 @@ var Text = (_a) => {
|
|
|
4254
4271
|
"weight",
|
|
4255
4272
|
"withTooltip",
|
|
4256
4273
|
"ellipsis",
|
|
4257
|
-
"status"
|
|
4274
|
+
"status",
|
|
4275
|
+
"pb"
|
|
4258
4276
|
]);
|
|
4259
|
-
const dataProperties = toDataProperties({ status, ellipsis });
|
|
4277
|
+
const dataProperties = toDataProperties({ status, ellipsis, pb });
|
|
4260
4278
|
const baseClassName = (0, import_classnames15.default)(
|
|
4261
4279
|
`Layer__text Layer__text--${size} Layer__text--${weight}`,
|
|
4262
4280
|
className
|
|
@@ -4338,10 +4356,12 @@ var Heading = ({
|
|
|
4338
4356
|
as: Component2 = "h2",
|
|
4339
4357
|
className,
|
|
4340
4358
|
children,
|
|
4341
|
-
size = "primary" /* primary
|
|
4359
|
+
size = "primary" /* primary */,
|
|
4360
|
+
align = "center"
|
|
4342
4361
|
}) => {
|
|
4343
4362
|
const baseClassName = (0, import_classnames16.default)(
|
|
4344
4363
|
`Layer__heading Layer__heading--${size}`,
|
|
4364
|
+
`Layer__heading--${align}`,
|
|
4345
4365
|
className
|
|
4346
4366
|
);
|
|
4347
4367
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Component2, { className: baseClassName, children });
|
|
@@ -5466,7 +5486,7 @@ var LinkedAccountItemThumb = ({
|
|
|
5466
5486
|
};
|
|
5467
5487
|
|
|
5468
5488
|
// src/components/LinkedAccounts/LinkedAccountsContent.tsx
|
|
5469
|
-
var
|
|
5489
|
+
var import_classnames25 = __toESM(require("classnames"));
|
|
5470
5490
|
|
|
5471
5491
|
// src/components/LinkedAccounts/ConfirmationModal/LinkedAccountsConfirmationModal.tsx
|
|
5472
5492
|
var import_react38 = require("react");
|
|
@@ -5645,12 +5665,13 @@ function ModalActions({ children }) {
|
|
|
5645
5665
|
}
|
|
5646
5666
|
|
|
5647
5667
|
// src/components/ui/Stack/Stack.tsx
|
|
5668
|
+
var import_classnames23 = __toESM(require("classnames"));
|
|
5648
5669
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5649
5670
|
var CLASS_NAME2 = "Layer__Stack";
|
|
5650
5671
|
function Stack(_a) {
|
|
5651
|
-
var _b = _a, { align, children, direction, gap, justify, pbs, pbe } = _b, restProps = __objRest(_b, ["align", "children", "direction", "gap", "justify", "pbs", "pbe"]);
|
|
5672
|
+
var _b = _a, { align, children, direction, gap, justify, pbs, pbe, className } = _b, restProps = __objRest(_b, ["align", "children", "direction", "gap", "justify", "pbs", "pbe", "className"]);
|
|
5652
5673
|
const dataProperties = toDataProperties({ align, direction, gap, justify, pbs, pbe });
|
|
5653
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: CLASS_NAME2, children }));
|
|
5674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: (0, import_classnames23.default)(CLASS_NAME2, className), children }));
|
|
5654
5675
|
}
|
|
5655
5676
|
function VStack(props) {
|
|
5656
5677
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Stack, __spreadProps(__spreadValues({}, props), { direction: "column" }));
|
|
@@ -5698,7 +5719,7 @@ function withRenderProp(renderProp, callback) {
|
|
|
5698
5719
|
}
|
|
5699
5720
|
|
|
5700
5721
|
// src/components/ui/Checkbox/Checkbox.tsx
|
|
5701
|
-
var
|
|
5722
|
+
var import_classnames24 = __toESM(require("classnames"));
|
|
5702
5723
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5703
5724
|
var CLASS_NAME3 = "Layer__Checkbox";
|
|
5704
5725
|
function Checkbox(_a) {
|
|
@@ -5711,7 +5732,7 @@ function Checkbox(_a) {
|
|
|
5711
5732
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5712
5733
|
import_react_aria_components4.Checkbox,
|
|
5713
5734
|
__spreadProps(__spreadValues(__spreadValues({}, dataProperties), props), {
|
|
5714
|
-
className: (0,
|
|
5735
|
+
className: (0, import_classnames24.default)(CLASS_NAME3, className),
|
|
5715
5736
|
children: withRenderProp(children, (node) => /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_jsx_runtime71.Fragment, { children: [
|
|
5716
5737
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { slot: "checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react2.Check, { size: size === "lg" ? 16 : 12 }) }),
|
|
5717
5738
|
node
|
|
@@ -5729,7 +5750,7 @@ function BasicLinkedAccountContainer({ children, isSelected }) {
|
|
|
5729
5750
|
}
|
|
5730
5751
|
function BasicLinkedAccountLogo({ account }) {
|
|
5731
5752
|
var _a, _b, _c;
|
|
5732
|
-
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(VStack, { justify: "center", children: ((_a = account.institution) == null ? void 0 : _a.logo) ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(VStack, { justify: "center", className: "Layer__BasicLinkedAccountLogo", children: ((_a = account.institution) == null ? void 0 : _a.logo) ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5733
5754
|
"img",
|
|
5734
5755
|
{
|
|
5735
5756
|
width: 28,
|
|
@@ -5737,17 +5758,17 @@ function BasicLinkedAccountLogo({ account }) {
|
|
|
5737
5758
|
src: `data:image/png;base64,${account.institution.logo}`,
|
|
5738
5759
|
alt: ((_b = account.institution) == null ? void 0 : _b.name) ? (_c = account.institution) == null ? void 0 : _c.name : account.external_account_name
|
|
5739
5760
|
}
|
|
5740
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(InstitutionIcon_default, {
|
|
5761
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(InstitutionIcon_default, {}) });
|
|
5741
5762
|
}
|
|
5742
5763
|
function BasicLinkedAccountContent({ account }) {
|
|
5743
5764
|
var _a;
|
|
5744
5765
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(HStack, { gap: "md", children: [
|
|
5745
5766
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(BasicLinkedAccountLogo, { account }),
|
|
5746
5767
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(VStack, { children: [
|
|
5747
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Heading2, { level: 3, size: "
|
|
5768
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Heading2, { level: 3, size: "xs", pbe: "3xs", children: account.external_account_name }),
|
|
5748
5769
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(HStack, { gap: "xs", children: [
|
|
5749
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(P, { children: (_a = account.institution) == null ? void 0 : _a.name }),
|
|
5750
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(P, { variant: "subtle", children: [
|
|
5770
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(P, { size: "sm", children: (_a = account.institution) == null ? void 0 : _a.name }),
|
|
5771
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(P, { variant: "subtle", size: "sm", children: [
|
|
5751
5772
|
"\u2022\u2022\u2022",
|
|
5752
5773
|
" ",
|
|
5753
5774
|
account.mask
|
|
@@ -5919,13 +5940,8 @@ function useLinkedAccountsConfirmationModal() {
|
|
|
5919
5940
|
}, baseInfo);
|
|
5920
5941
|
}
|
|
5921
5942
|
function LinkedAccountsConfirmationModalPreloadedContent({ onClose }) {
|
|
5922
|
-
const { onDismiss } = useLinkedAccountsConfirmationModal();
|
|
5923
|
-
const handleDismiss = () => {
|
|
5924
|
-
onDismiss();
|
|
5925
|
-
onClose();
|
|
5926
|
-
};
|
|
5927
5943
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
5928
|
-
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalContextBar, { onClose
|
|
5944
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalContextBar, { onClose }),
|
|
5929
5945
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalHeading, { pbe: "md", children: "Loading Your Accounts..." }),
|
|
5930
5946
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalContent, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(VStack, { slot: "center", align: "center", gap: "md", children: [
|
|
5931
5947
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(LoadingSpinner, { size: 48 }),
|
|
@@ -5934,16 +5950,12 @@ function LinkedAccountsConfirmationModalPreloadedContent({ onClose }) {
|
|
|
5934
5950
|
] });
|
|
5935
5951
|
}
|
|
5936
5952
|
function LinkedAccountsConfirmationModalContent({ onClose }) {
|
|
5937
|
-
const { accounts,
|
|
5953
|
+
const { accounts, onFinish, refetchAccounts } = useLinkedAccountsConfirmationModal();
|
|
5938
5954
|
const [formState, setFormState] = (0, import_react38.useState)(() => Object.fromEntries(
|
|
5939
5955
|
accounts.map(({ id }) => [id, true])
|
|
5940
5956
|
));
|
|
5941
5957
|
const { trigger, isMutating, error } = useConfirmAndExcludeMultiple({ onSuccess: refetchAccounts });
|
|
5942
5958
|
const hasError = Boolean(error);
|
|
5943
|
-
const handleDismiss = () => {
|
|
5944
|
-
onDismiss();
|
|
5945
|
-
onClose();
|
|
5946
|
-
};
|
|
5947
5959
|
const handleFinish = () => __async(this, null, function* () {
|
|
5948
5960
|
const success = yield trigger(formState);
|
|
5949
5961
|
if (success) {
|
|
@@ -5951,9 +5963,12 @@ function LinkedAccountsConfirmationModalContent({ onClose }) {
|
|
|
5951
5963
|
onClose();
|
|
5952
5964
|
}
|
|
5953
5965
|
});
|
|
5966
|
+
const handleDismiss = () => {
|
|
5967
|
+
onClose();
|
|
5968
|
+
};
|
|
5954
5969
|
const { descriptionLabel, buttonLabel } = getFormComponentLabels(formState);
|
|
5955
5970
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
5956
|
-
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalContextBar, { onClose
|
|
5971
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalContextBar, { onClose }),
|
|
5957
5972
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalHeading, { pbe: "2xs", children: "Confirm Business Accounts" }),
|
|
5958
5973
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalDescription, { pbe: "md", children: descriptionLabel }),
|
|
5959
5974
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalContent, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
@@ -5981,13 +5996,26 @@ function LinkedAccountsConfirmationModalContent({ onClose }) {
|
|
|
5981
5996
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalActions, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(VStack, { gap: "md", children: hasError ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
5982
5997
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(P, { size: "sm", children: "An error occurred while confirming accounts. You will have an opportunity to try again later." }),
|
|
5983
5998
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(P, { size: "sm", children: "No data will be synced until you confirm." }),
|
|
5984
|
-
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button2, { size: "lg", onPress:
|
|
5985
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button2, { size: "lg", onPress:
|
|
5999
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button2, { size: "lg", onPress: close, children: "Close" })
|
|
6000
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button2, { size: "lg", onPress: () => {
|
|
6001
|
+
void handleFinish();
|
|
6002
|
+
}, isPending: isMutating, children: buttonLabel }) }) })
|
|
5986
6003
|
] });
|
|
5987
6004
|
}
|
|
5988
6005
|
function LinkedAccountsConfirmationModal() {
|
|
5989
|
-
const { preloadIsOpen, mainIsOpen } = useLinkedAccountsConfirmationModal();
|
|
5990
|
-
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6006
|
+
const { preloadIsOpen, mainIsOpen, onDismiss } = useLinkedAccountsConfirmationModal();
|
|
6007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6008
|
+
Modal,
|
|
6009
|
+
{
|
|
6010
|
+
isOpen: preloadIsOpen || mainIsOpen,
|
|
6011
|
+
onOpenChange: (isOpen) => {
|
|
6012
|
+
if (!isOpen) {
|
|
6013
|
+
onDismiss();
|
|
6014
|
+
}
|
|
6015
|
+
},
|
|
6016
|
+
children: ({ close: close2 }) => preloadIsOpen ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(LinkedAccountsConfirmationModalPreloadedContent, { onClose: close2 }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(LinkedAccountsConfirmationModalContent, { onClose: close2 })
|
|
6017
|
+
}
|
|
6018
|
+
);
|
|
5991
6019
|
}
|
|
5992
6020
|
|
|
5993
6021
|
// src/components/LinkedAccounts/LinkedAccountsContent.tsx
|
|
@@ -5999,7 +6027,7 @@ var LinkedAccountsContent = ({
|
|
|
5999
6027
|
showBreakConnection
|
|
6000
6028
|
}) => {
|
|
6001
6029
|
const { data, addConnection } = (0, import_react39.useContext)(LinkedAccountsContext);
|
|
6002
|
-
const linkedAccountsNewAccountClassName = (0,
|
|
6030
|
+
const linkedAccountsNewAccountClassName = (0, import_classnames25.default)(
|
|
6003
6031
|
"Layer__linked-accounts__new-account",
|
|
6004
6032
|
asWidget && "--as-widget",
|
|
6005
6033
|
showLedgerBalance && "--show-ledger-balance",
|
|
@@ -6075,7 +6103,7 @@ var isDateAllowedToBrowse = (date, business) => {
|
|
|
6075
6103
|
var import_react44 = require("react");
|
|
6076
6104
|
|
|
6077
6105
|
// src/components/Input/Input.tsx
|
|
6078
|
-
var
|
|
6106
|
+
var import_classnames26 = __toESM(require("classnames"));
|
|
6079
6107
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
6080
6108
|
var Input = (_a) => {
|
|
6081
6109
|
var _b = _a, {
|
|
@@ -6089,7 +6117,7 @@ var Input = (_a) => {
|
|
|
6089
6117
|
"errorMessage",
|
|
6090
6118
|
"leftText"
|
|
6091
6119
|
]);
|
|
6092
|
-
const baseClassName = (0,
|
|
6120
|
+
const baseClassName = (0, import_classnames26.default)(
|
|
6093
6121
|
"Layer__input",
|
|
6094
6122
|
isInvalid ? "Layer__input--error" : "",
|
|
6095
6123
|
leftText ? "Layer__input--with-left-text" : "",
|
|
@@ -6105,7 +6133,7 @@ var Input = (_a) => {
|
|
|
6105
6133
|
};
|
|
6106
6134
|
|
|
6107
6135
|
// src/components/Input/InputGroup.tsx
|
|
6108
|
-
var
|
|
6136
|
+
var import_classnames27 = __toESM(require("classnames"));
|
|
6109
6137
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
6110
6138
|
var InputGroup = ({
|
|
6111
6139
|
label,
|
|
@@ -6114,7 +6142,7 @@ var InputGroup = ({
|
|
|
6114
6142
|
inline,
|
|
6115
6143
|
children
|
|
6116
6144
|
}) => {
|
|
6117
|
-
const baseClassName = (0,
|
|
6145
|
+
const baseClassName = (0, import_classnames27.default)(
|
|
6118
6146
|
"Layer__input-group",
|
|
6119
6147
|
className,
|
|
6120
6148
|
inline && "Layer__input-group--inline"
|
|
@@ -6291,7 +6319,7 @@ var ChevronDownFill = (_a) => {
|
|
|
6291
6319
|
var ChevronDownFill_default = ChevronDownFill;
|
|
6292
6320
|
|
|
6293
6321
|
// src/components/Input/Select.tsx
|
|
6294
|
-
var
|
|
6322
|
+
var import_classnames28 = __toESM(require("classnames"));
|
|
6295
6323
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
6296
6324
|
var Select = ({
|
|
6297
6325
|
name,
|
|
@@ -6305,7 +6333,7 @@ var Select = ({
|
|
|
6305
6333
|
isInvalid,
|
|
6306
6334
|
errorMessage
|
|
6307
6335
|
}) => {
|
|
6308
|
-
const baseClassName = (0,
|
|
6336
|
+
const baseClassName = (0, import_classnames28.default)(
|
|
6309
6337
|
"Layer__select",
|
|
6310
6338
|
isInvalid ? "Layer__select--error" : "",
|
|
6311
6339
|
className
|
|
@@ -6333,7 +6361,7 @@ var Select = ({
|
|
|
6333
6361
|
};
|
|
6334
6362
|
|
|
6335
6363
|
// src/components/Input/InputWithBadge.tsx
|
|
6336
|
-
var
|
|
6364
|
+
var import_classnames29 = __toESM(require("classnames"));
|
|
6337
6365
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
6338
6366
|
var InputWithBadge = (_a) => {
|
|
6339
6367
|
var _b = _a, {
|
|
@@ -6351,7 +6379,7 @@ var InputWithBadge = (_a) => {
|
|
|
6351
6379
|
"badge",
|
|
6352
6380
|
"variant"
|
|
6353
6381
|
]);
|
|
6354
|
-
const baseClassName = (0,
|
|
6382
|
+
const baseClassName = (0, import_classnames29.default)(
|
|
6355
6383
|
"Layer__input",
|
|
6356
6384
|
isInvalid ? "Layer__input--error" : "",
|
|
6357
6385
|
leftText ? "Layer__input--with-left-text" : "",
|
|
@@ -6372,7 +6400,7 @@ var InputWithBadge = (_a) => {
|
|
|
6372
6400
|
// src/components/Input/MultiSelect.tsx
|
|
6373
6401
|
var import_react42 = require("react");
|
|
6374
6402
|
var import_react_select2 = __toESM(require("react-select"));
|
|
6375
|
-
var
|
|
6403
|
+
var import_classnames30 = __toESM(require("classnames"));
|
|
6376
6404
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
6377
6405
|
var MultiSelect = ({
|
|
6378
6406
|
name,
|
|
@@ -6388,7 +6416,7 @@ var MultiSelect = ({
|
|
|
6388
6416
|
errorMessage,
|
|
6389
6417
|
styles
|
|
6390
6418
|
}) => {
|
|
6391
|
-
const baseClassName = (0,
|
|
6419
|
+
const baseClassName = (0, import_classnames30.default)(
|
|
6392
6420
|
"Layer__select",
|
|
6393
6421
|
isInvalid ? "Layer__select--error" : "",
|
|
6394
6422
|
className
|
|
@@ -6420,7 +6448,7 @@ var MultiSelect = ({
|
|
|
6420
6448
|
};
|
|
6421
6449
|
|
|
6422
6450
|
// src/components/Input/AmountInput.tsx
|
|
6423
|
-
var
|
|
6451
|
+
var import_classnames31 = __toESM(require("classnames"));
|
|
6424
6452
|
var import_react_currency_input_field = __toESM(require("react-currency-input-field"));
|
|
6425
6453
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
6426
6454
|
var AmountInput = (_a) => {
|
|
@@ -6439,7 +6467,7 @@ var AmountInput = (_a) => {
|
|
|
6439
6467
|
"isInvalid",
|
|
6440
6468
|
"placeholder"
|
|
6441
6469
|
]);
|
|
6442
|
-
const baseClassName = (0,
|
|
6470
|
+
const baseClassName = (0, import_classnames31.default)(
|
|
6443
6471
|
"Layer__input Layer__amount-input",
|
|
6444
6472
|
isInvalid ? "Layer__input--error" : "",
|
|
6445
6473
|
leftText ? "Layer__input--with-left-text" : "",
|
|
@@ -6557,7 +6585,7 @@ var DatePickerOptions = ({
|
|
|
6557
6585
|
};
|
|
6558
6586
|
|
|
6559
6587
|
// src/components/DatePicker/DatePicker.tsx
|
|
6560
|
-
var
|
|
6588
|
+
var import_classnames32 = __toESM(require("classnames"));
|
|
6561
6589
|
var import_date_fns8 = require("date-fns");
|
|
6562
6590
|
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
6563
6591
|
var ReactDatePicker = RDP.default.default || RDP.default || RDP;
|
|
@@ -6663,21 +6691,21 @@ var DatePicker = (_a) => {
|
|
|
6663
6691
|
return [selected[0], null];
|
|
6664
6692
|
}, [selected, displayMode]);
|
|
6665
6693
|
const { isDesktop } = useSizeClass();
|
|
6666
|
-
const wrapperClassNames = (0,
|
|
6694
|
+
const wrapperClassNames = (0, import_classnames32.default)(
|
|
6667
6695
|
"Layer__datepicker__wrapper",
|
|
6668
6696
|
displayMode === "timePicker" && "Layer__datepicker__time__wrapper",
|
|
6669
6697
|
showNavigationArrows(navigateArrows, isDesktop) && "Layer__datepicker__wrapper--arrows"
|
|
6670
6698
|
);
|
|
6671
|
-
const datePickerWrapperClassNames = (0,
|
|
6699
|
+
const datePickerWrapperClassNames = (0, import_classnames32.default)(
|
|
6672
6700
|
"Layer__datepicker",
|
|
6673
6701
|
displayMode === "timePicker" && "Layer__datepicker__time",
|
|
6674
6702
|
wrapperClassName
|
|
6675
6703
|
);
|
|
6676
|
-
const calendarClassNames = (0,
|
|
6704
|
+
const calendarClassNames = (0, import_classnames32.default)(
|
|
6677
6705
|
"Layer__datepicker__calendar",
|
|
6678
6706
|
calendarClassName
|
|
6679
6707
|
);
|
|
6680
|
-
const popperClassNames = (0,
|
|
6708
|
+
const popperClassNames = (0, import_classnames32.default)(
|
|
6681
6709
|
"Layer__datepicker__popper",
|
|
6682
6710
|
displayMode === "timePicker" && "Layer__datepicker__time__popper",
|
|
6683
6711
|
popperClassName
|
|
@@ -6847,7 +6875,7 @@ var DatePicker = (_a) => {
|
|
|
6847
6875
|
Button,
|
|
6848
6876
|
{
|
|
6849
6877
|
"aria-label": "Previous Date",
|
|
6850
|
-
className: (0,
|
|
6878
|
+
className: (0, import_classnames32.default)(
|
|
6851
6879
|
"Layer__datepicker__prev-button",
|
|
6852
6880
|
isBeforeMinDate && "Layer__datepicker__button--disabled"
|
|
6853
6881
|
),
|
|
@@ -6869,7 +6897,7 @@ var DatePicker = (_a) => {
|
|
|
6869
6897
|
{
|
|
6870
6898
|
"aria-label": "Next Date",
|
|
6871
6899
|
variant: "secondary" /* secondary */,
|
|
6872
|
-
className: (0,
|
|
6900
|
+
className: (0, import_classnames32.default)(
|
|
6873
6901
|
"Layer__datepicker__next-button",
|
|
6874
6902
|
isTodayOrAfter ? "Layer__datepicker__button--disabled" : void 0
|
|
6875
6903
|
),
|
|
@@ -7129,8 +7157,7 @@ var humanizeEnum = (text) => {
|
|
|
7129
7157
|
return capitalizeFirstLetter(text.replace(/_/gi, " ").toLowerCase());
|
|
7130
7158
|
};
|
|
7131
7159
|
var convertNumberToCurrency = (amount) => {
|
|
7132
|
-
if (typeof amount !== "number" || isNaN(amount))
|
|
7133
|
-
return "";
|
|
7160
|
+
if (typeof amount !== "number" || isNaN(amount)) return "";
|
|
7134
7161
|
const formattedValue = amount.toLocaleString("en-US");
|
|
7135
7162
|
return formattedValue.length > 0 ? `$${formattedValue}` : "";
|
|
7136
7163
|
};
|
|
@@ -7269,11 +7296,11 @@ function OpeningBalanceModal({
|
|
|
7269
7296
|
setAccountsToAddOpeningBalanceInModal([]);
|
|
7270
7297
|
}
|
|
7271
7298
|
},
|
|
7272
|
-
children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
7299
|
+
children: ({ close: close2 }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
7273
7300
|
LinkedAccountsOpeningBalanceModalContent,
|
|
7274
7301
|
{
|
|
7275
7302
|
accounts: accountsToAddOpeningBalanceInModal,
|
|
7276
|
-
onClose:
|
|
7303
|
+
onClose: close2,
|
|
7277
7304
|
stringOverrides
|
|
7278
7305
|
}
|
|
7279
7306
|
)
|
|
@@ -7782,7 +7809,7 @@ var import_react50 = require("react");
|
|
|
7782
7809
|
var import_react49 = require("react");
|
|
7783
7810
|
|
|
7784
7811
|
// src/components/ActionableList/ActionableList.tsx
|
|
7785
|
-
var
|
|
7812
|
+
var import_classnames33 = __toESM(require("classnames"));
|
|
7786
7813
|
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
7787
7814
|
var ActionableList = ({
|
|
7788
7815
|
options,
|
|
@@ -7795,7 +7822,7 @@ var ActionableList = ({
|
|
|
7795
7822
|
{
|
|
7796
7823
|
role: "button",
|
|
7797
7824
|
onClick: () => onClick(x),
|
|
7798
|
-
className: (0,
|
|
7825
|
+
className: (0, import_classnames33.default)(
|
|
7799
7826
|
x.secondary && "Layer__actionable-list-item--secondary",
|
|
7800
7827
|
x.asLink && "Layer__actionable-list-item--as-link",
|
|
7801
7828
|
selectedId === x.id && "Layer__actionable-list__item--selected"
|
|
@@ -7937,7 +7964,7 @@ var BusinessCategories = ({
|
|
|
7937
7964
|
};
|
|
7938
7965
|
|
|
7939
7966
|
// src/components/CategorySelect/CategorySelectDrawer.tsx
|
|
7940
|
-
var
|
|
7967
|
+
var import_classnames34 = __toESM(require("classnames"));
|
|
7941
7968
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
7942
7969
|
var CategorySelectDrawer = ({
|
|
7943
7970
|
onSelect,
|
|
@@ -7945,16 +7972,16 @@ var CategorySelectDrawer = ({
|
|
|
7945
7972
|
showTooltips: _showTooltips
|
|
7946
7973
|
}) => {
|
|
7947
7974
|
var _a, _b;
|
|
7948
|
-
const { setContent, close } = (0, import_react50.useContext)(DrawerContext);
|
|
7975
|
+
const { setContent, close: close2 } = (0, import_react50.useContext)(DrawerContext);
|
|
7949
7976
|
const onDrawerCategorySelect = (value) => {
|
|
7950
|
-
|
|
7977
|
+
close2();
|
|
7951
7978
|
onSelect(value);
|
|
7952
7979
|
};
|
|
7953
7980
|
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
7954
7981
|
"button",
|
|
7955
7982
|
{
|
|
7956
7983
|
"aria-label": "Select category",
|
|
7957
|
-
className: (0,
|
|
7984
|
+
className: (0, import_classnames34.default)(
|
|
7958
7985
|
"Layer__category-menu__drawer-btn",
|
|
7959
7986
|
selected && "Layer__category-menu__drawer-btn--selected"
|
|
7960
7987
|
),
|
|
@@ -8003,7 +8030,7 @@ var CategorySelectDrawerContent = ({
|
|
|
8003
8030
|
};
|
|
8004
8031
|
|
|
8005
8032
|
// src/components/CategorySelect/CategorySelect.tsx
|
|
8006
|
-
var
|
|
8033
|
+
var import_classnames35 = __toESM(require("classnames"));
|
|
8007
8034
|
var import_date_fns12 = require("date-fns");
|
|
8008
8035
|
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
8009
8036
|
var mapCategoryToOption2 = (category) => {
|
|
@@ -8055,7 +8082,7 @@ var GroupHeading = (props) => {
|
|
|
8055
8082
|
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
8056
8083
|
import_react_select3.components.GroupHeading,
|
|
8057
8084
|
__spreadValues({
|
|
8058
|
-
className: (0,
|
|
8085
|
+
className: (0, import_classnames35.default)(
|
|
8059
8086
|
props.className,
|
|
8060
8087
|
props.children === "Match" || props.children === "All categories" ? "Layer__select__group-heading--main" : ""
|
|
8061
8088
|
)
|
|
@@ -8386,8 +8413,7 @@ var useReceiptsContext = () => (0, import_react51.useContext)(ReceiptsContext);
|
|
|
8386
8413
|
var import_react52 = require("react");
|
|
8387
8414
|
var import_date_fns13 = require("date-fns");
|
|
8388
8415
|
var readDate = (date) => {
|
|
8389
|
-
if (!date)
|
|
8390
|
-
return void 0;
|
|
8416
|
+
if (!date) return void 0;
|
|
8391
8417
|
return date && (0, import_date_fns13.format)((0, import_date_fns13.parseISO)(date), DATE_FORMAT);
|
|
8392
8418
|
};
|
|
8393
8419
|
var useReceipts = ({
|
|
@@ -8472,8 +8498,7 @@ var useReceipts = ({
|
|
|
8472
8498
|
}
|
|
8473
8499
|
});
|
|
8474
8500
|
const archiveDocument = (document2) => __async(void 0, null, function* () {
|
|
8475
|
-
if (!document2.id)
|
|
8476
|
-
return;
|
|
8501
|
+
if (!document2.id) return;
|
|
8477
8502
|
try {
|
|
8478
8503
|
if (document2.error) {
|
|
8479
8504
|
setReceiptUrls(receiptUrls.filter((url) => url.id !== document2.id));
|
|
@@ -8568,7 +8593,7 @@ var Eye = (_a) => {
|
|
|
8568
8593
|
var Eye_default = Eye;
|
|
8569
8594
|
|
|
8570
8595
|
// src/components/FileThumb/FileThumb.tsx
|
|
8571
|
-
var
|
|
8596
|
+
var import_classnames36 = __toESM(require("classnames"));
|
|
8572
8597
|
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
8573
8598
|
var FileThumb = ({
|
|
8574
8599
|
url,
|
|
@@ -8587,7 +8612,7 @@ var FileThumb = ({
|
|
|
8587
8612
|
return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
|
|
8588
8613
|
"div",
|
|
8589
8614
|
{
|
|
8590
|
-
className: (0,
|
|
8615
|
+
className: (0, import_classnames36.default)(
|
|
8591
8616
|
"Layer__file-thumb",
|
|
8592
8617
|
floatingActions && "Layer__file-thumb--floating"
|
|
8593
8618
|
),
|
|
@@ -8620,7 +8645,7 @@ var FileThumb = ({
|
|
|
8620
8645
|
enableOpen || enableDownload || onDelete ? /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
|
|
8621
8646
|
"div",
|
|
8622
8647
|
{
|
|
8623
|
-
className: (0,
|
|
8648
|
+
className: (0, import_classnames36.default)(
|
|
8624
8649
|
"Layer__file-thumb__actions",
|
|
8625
8650
|
floatingActions && "Layer__file-thumb__actions--floating"
|
|
8626
8651
|
),
|
|
@@ -8778,7 +8803,7 @@ var MatchBadge = ({
|
|
|
8778
8803
|
};
|
|
8779
8804
|
|
|
8780
8805
|
// src/components/MatchForm/MatchForm.tsx
|
|
8781
|
-
var
|
|
8806
|
+
var import_classnames37 = __toESM(require("classnames"));
|
|
8782
8807
|
var import_date_fns15 = require("date-fns");
|
|
8783
8808
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
8784
8809
|
var MatchForm = ({
|
|
@@ -8807,7 +8832,7 @@ var MatchForm = ({
|
|
|
8807
8832
|
return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
|
|
8808
8833
|
"div",
|
|
8809
8834
|
{
|
|
8810
|
-
className: (0,
|
|
8835
|
+
className: (0, import_classnames37.default)(
|
|
8811
8836
|
`${classNamePrefix}__match-row`,
|
|
8812
8837
|
match.id === selectedMatchId ? `${classNamePrefix}__match-row--selected` : ""
|
|
8813
8838
|
),
|
|
@@ -8884,7 +8909,7 @@ var MatchForm = ({
|
|
|
8884
8909
|
};
|
|
8885
8910
|
|
|
8886
8911
|
// src/components/MatchForm/MatchFormMobile.tsx
|
|
8887
|
-
var
|
|
8912
|
+
var import_classnames38 = __toESM(require("classnames"));
|
|
8888
8913
|
var import_date_fns16 = require("date-fns");
|
|
8889
8914
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
8890
8915
|
var MatchFormMobile = ({
|
|
@@ -8900,7 +8925,7 @@ var MatchFormMobile = ({
|
|
|
8900
8925
|
return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
|
|
8901
8926
|
"div",
|
|
8902
8927
|
{
|
|
8903
|
-
className: (0,
|
|
8928
|
+
className: (0, import_classnames38.default)(
|
|
8904
8929
|
`${classNamePrefix}__match-item`,
|
|
8905
8930
|
match.id === selectedMatchId ? `${classNamePrefix}__match-item--selected` : ""
|
|
8906
8931
|
),
|
|
@@ -8961,7 +8986,7 @@ var MatchFormMobile = ({
|
|
|
8961
8986
|
};
|
|
8962
8987
|
|
|
8963
8988
|
// src/components/Textarea/Textarea.tsx
|
|
8964
|
-
var
|
|
8989
|
+
var import_classnames39 = __toESM(require("classnames"));
|
|
8965
8990
|
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
8966
8991
|
var Textarea = (_a) => {
|
|
8967
8992
|
var _b = _a, {
|
|
@@ -8973,7 +8998,7 @@ var Textarea = (_a) => {
|
|
|
8973
8998
|
"isInvalid",
|
|
8974
8999
|
"errorMessage"
|
|
8975
9000
|
]);
|
|
8976
|
-
const baseClassName = (0,
|
|
9001
|
+
const baseClassName = (0, import_classnames39.default)(
|
|
8977
9002
|
"Layer__textarea",
|
|
8978
9003
|
isInvalid ? "Layer__textarea--error" : "",
|
|
8979
9004
|
className
|
|
@@ -8986,7 +9011,7 @@ var Textarea = (_a) => {
|
|
|
8986
9011
|
|
|
8987
9012
|
// src/components/Toggle/Toggle.tsx
|
|
8988
9013
|
var import_react54 = require("react");
|
|
8989
|
-
var
|
|
9014
|
+
var import_classnames40 = __toESM(require("classnames"));
|
|
8990
9015
|
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
8991
9016
|
var import_react55 = require("react");
|
|
8992
9017
|
var Toggle = ({
|
|
@@ -9007,7 +9032,7 @@ var Toggle = ({
|
|
|
9007
9032
|
setCurrentWidth(c.width);
|
|
9008
9033
|
}
|
|
9009
9034
|
});
|
|
9010
|
-
const baseClassName = (0,
|
|
9035
|
+
const baseClassName = (0, import_classnames40.default)(
|
|
9011
9036
|
"Layer__toggle",
|
|
9012
9037
|
`Layer__toggle--${size}`,
|
|
9013
9038
|
initialized ? "Layer__toggle--initialized" : ""
|
|
@@ -9092,7 +9117,7 @@ var ToggleOption = ({
|
|
|
9092
9117
|
style,
|
|
9093
9118
|
index
|
|
9094
9119
|
}) => {
|
|
9095
|
-
const optionClassName = (0,
|
|
9120
|
+
const optionClassName = (0, import_classnames40.default)("Layer__toggle-option", {
|
|
9096
9121
|
"Layer__toggle-option--active": checked
|
|
9097
9122
|
});
|
|
9098
9123
|
if (disabled) {
|
|
@@ -9257,7 +9282,7 @@ var Notification = ({
|
|
|
9257
9282
|
};
|
|
9258
9283
|
|
|
9259
9284
|
// src/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow.tsx
|
|
9260
|
-
var
|
|
9285
|
+
var import_classnames41 = __toESM(require("classnames"));
|
|
9261
9286
|
|
|
9262
9287
|
// src/hooks/bookkeeping/useBookkeepingStatus.ts
|
|
9263
9288
|
var import_swr5 = __toESM(require("swr"));
|
|
@@ -9280,7 +9305,12 @@ function LegacyModeProvider({
|
|
|
9280
9305
|
}
|
|
9281
9306
|
|
|
9282
9307
|
// src/hooks/bookkeeping/useBookkeepingStatus.ts
|
|
9283
|
-
var BOOKKEEPING_STATUSES = [
|
|
9308
|
+
var BOOKKEEPING_STATUSES = [
|
|
9309
|
+
"NOT_PURCHASED",
|
|
9310
|
+
"ACTIVE",
|
|
9311
|
+
"ONBOARDING",
|
|
9312
|
+
"BOOKKEEPING_PAUSED"
|
|
9313
|
+
];
|
|
9284
9314
|
function constrainToKnownBookkeepingStatus(status) {
|
|
9285
9315
|
if (BOOKKEEPING_STATUSES.includes(status)) {
|
|
9286
9316
|
return status;
|
|
@@ -9300,7 +9330,7 @@ function buildKey4({
|
|
|
9300
9330
|
accessToken,
|
|
9301
9331
|
apiUrl,
|
|
9302
9332
|
businessId,
|
|
9303
|
-
tags: ["#bookkeeping, #status"]
|
|
9333
|
+
tags: ["#bookkeeping", "#status"]
|
|
9304
9334
|
};
|
|
9305
9335
|
}
|
|
9306
9336
|
}
|
|
@@ -9371,7 +9401,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
|
|
|
9371
9401
|
({
|
|
9372
9402
|
bankTransaction,
|
|
9373
9403
|
isOpen = false,
|
|
9374
|
-
close,
|
|
9404
|
+
close: close2,
|
|
9375
9405
|
categorized,
|
|
9376
9406
|
asListItem = false,
|
|
9377
9407
|
submitBtnText = "Save",
|
|
@@ -9516,7 +9546,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
|
|
|
9516
9546
|
yield onMatchSubmit(selectedMatchId);
|
|
9517
9547
|
return;
|
|
9518
9548
|
}
|
|
9519
|
-
|
|
9549
|
+
close2();
|
|
9520
9550
|
return;
|
|
9521
9551
|
}
|
|
9522
9552
|
if (!validateSplit(rowState)) {
|
|
@@ -9542,7 +9572,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
|
|
|
9542
9572
|
}))
|
|
9543
9573
|
}
|
|
9544
9574
|
);
|
|
9545
|
-
|
|
9575
|
+
close2();
|
|
9546
9576
|
});
|
|
9547
9577
|
const fetchMemos = () => __async(void 0, null, function* () {
|
|
9548
9578
|
const getBankTransactionMetadata2 = Layer.getBankTransactionMetadata(
|
|
@@ -9556,8 +9586,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
|
|
|
9556
9586
|
}
|
|
9557
9587
|
);
|
|
9558
9588
|
const result = yield getBankTransactionMetadata2();
|
|
9559
|
-
if (result.data.memo)
|
|
9560
|
-
setMemoText(result.data.memo);
|
|
9589
|
+
if (result.data.memo) setMemoText(result.data.memo);
|
|
9561
9590
|
});
|
|
9562
9591
|
(0, import_react58.useImperativeHandle)(ref, () => ({
|
|
9563
9592
|
save
|
|
@@ -9571,7 +9600,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
|
|
|
9571
9600
|
return;
|
|
9572
9601
|
}
|
|
9573
9602
|
yield matchBankTransaction2(bankTransaction.id, foundMatch.id);
|
|
9574
|
-
|
|
9603
|
+
close2();
|
|
9575
9604
|
});
|
|
9576
9605
|
const getDivHeight = (0, import_react58.useCallback)(() => {
|
|
9577
9606
|
const { height: height2 } = bodyRef.current ? bodyRef.current.getBoundingClientRect() : { height: void 0 };
|
|
@@ -9607,8 +9636,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
|
|
|
9607
9636
|
}, [getDivHeight, isOpen]);
|
|
9608
9637
|
(0, import_react58.useEffect)(() => {
|
|
9609
9638
|
const loadDocumentsAndMetadata = () => __async(void 0, null, function* () {
|
|
9610
|
-
if (showDescriptions && isOpen)
|
|
9611
|
-
yield fetchMemos();
|
|
9639
|
+
if (showDescriptions && isOpen) yield fetchMemos();
|
|
9612
9640
|
setIsLoaded(true);
|
|
9613
9641
|
setOver(true);
|
|
9614
9642
|
});
|
|
@@ -9656,7 +9684,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
|
|
|
9656
9684
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
9657
9685
|
"div",
|
|
9658
9686
|
{
|
|
9659
|
-
className: (0,
|
|
9687
|
+
className: (0, import_classnames41.default)(
|
|
9660
9688
|
`${className}__match`,
|
|
9661
9689
|
`${className}__content-panel`,
|
|
9662
9690
|
purpose === "match" /* match */ ? `${className}__content-panel--active` : ""
|
|
@@ -9680,7 +9708,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
|
|
|
9680
9708
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
9681
9709
|
"div",
|
|
9682
9710
|
{
|
|
9683
|
-
className: (0,
|
|
9711
|
+
className: (0, import_classnames41.default)(
|
|
9684
9712
|
`${className}__splits`,
|
|
9685
9713
|
`${className}__content-panel`,
|
|
9686
9714
|
purpose === "categorize" /* categorize */ ? `${className}__content-panel--active` : ""
|
|
@@ -9874,7 +9902,7 @@ var SplitTooltipDetails = ({
|
|
|
9874
9902
|
};
|
|
9875
9903
|
|
|
9876
9904
|
// src/components/BankTransactionRow/BankTransactionRow.tsx
|
|
9877
|
-
var
|
|
9905
|
+
var import_classnames42 = __toESM(require("classnames"));
|
|
9878
9906
|
var import_date_fns17 = require("date-fns");
|
|
9879
9907
|
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
9880
9908
|
var extractDescriptionForSplit = (category) => {
|
|
@@ -9988,7 +10016,7 @@ var BankTransactionRow = ({
|
|
|
9988
10016
|
const categorized = isCategorized(bankTransaction);
|
|
9989
10017
|
const className = "Layer__bank-transaction-row";
|
|
9990
10018
|
const openClassName = open ? `${className}--expanded` : "";
|
|
9991
|
-
const rowClassName = (0,
|
|
10019
|
+
const rowClassName = (0, import_classnames42.default)(
|
|
9992
10020
|
className,
|
|
9993
10021
|
bankTransaction.recently_categorized && editable && shouldHideAfterCategorize(bankTransaction) ? "Layer__bank-transaction-row--removing" : "",
|
|
9994
10022
|
open ? openClassName : "",
|
|
@@ -10066,7 +10094,7 @@ var BankTransactionRow = ({
|
|
|
10066
10094
|
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
10067
10095
|
"td",
|
|
10068
10096
|
{
|
|
10069
|
-
className: (0,
|
|
10097
|
+
className: (0, import_classnames42.default)(
|
|
10070
10098
|
"Layer__table-cell",
|
|
10071
10099
|
"Layer__table-cell__category-col",
|
|
10072
10100
|
`${className}__actions-cell`,
|
|
@@ -10248,7 +10276,7 @@ var Assignment = ({ bankTransaction }) => {
|
|
|
10248
10276
|
};
|
|
10249
10277
|
|
|
10250
10278
|
// src/components/BankTransactionList/BankTransactionListItem.tsx
|
|
10251
|
-
var
|
|
10279
|
+
var import_classnames43 = __toESM(require("classnames"));
|
|
10252
10280
|
var import_date_fns19 = require("date-fns");
|
|
10253
10281
|
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
10254
10282
|
var BankTransactionListItem = ({
|
|
@@ -10319,7 +10347,7 @@ var BankTransactionListItem = ({
|
|
|
10319
10347
|
const categorized = isCategorized(bankTransaction);
|
|
10320
10348
|
const className = "Layer__bank-transaction-list-item";
|
|
10321
10349
|
const openClassName = open ? `${className}--expanded` : "";
|
|
10322
|
-
const rowClassName = (0,
|
|
10350
|
+
const rowClassName = (0, import_classnames43.default)(
|
|
10323
10351
|
className,
|
|
10324
10352
|
bankTransaction.recently_categorized && editable && shouldHideAfterCategorize(bankTransaction) ? "Layer__bank-transaction-row--removing" : "",
|
|
10325
10353
|
open ? openClassName : "",
|
|
@@ -10525,8 +10553,7 @@ var useMemoText = ({ bankTransaction, isActive }) => {
|
|
|
10525
10553
|
}
|
|
10526
10554
|
);
|
|
10527
10555
|
const result = yield getBankTransactionMetadata2();
|
|
10528
|
-
if (result.data.memo)
|
|
10529
|
-
setMemoText(result.data.memo);
|
|
10556
|
+
if (result.data.memo) setMemoText(result.data.memo);
|
|
10530
10557
|
} catch (error) {
|
|
10531
10558
|
console.error(error);
|
|
10532
10559
|
}
|
|
@@ -10564,7 +10591,7 @@ var MemoTextProvider = ({
|
|
|
10564
10591
|
};
|
|
10565
10592
|
|
|
10566
10593
|
// src/components/BankTransactionMobileList/BusinessForm.tsx
|
|
10567
|
-
var
|
|
10594
|
+
var import_classnames44 = __toESM(require("classnames"));
|
|
10568
10595
|
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
10569
10596
|
var BusinessForm = ({
|
|
10570
10597
|
bankTransaction,
|
|
@@ -10574,7 +10601,7 @@ var BusinessForm = ({
|
|
|
10574
10601
|
showDescriptions
|
|
10575
10602
|
}) => {
|
|
10576
10603
|
const receiptsRef = (0, import_react62.useRef)(null);
|
|
10577
|
-
const { setContent, close } = (0, import_react62.useContext)(DrawerContext);
|
|
10604
|
+
const { setContent, close: close2 } = (0, import_react62.useContext)(DrawerContext);
|
|
10578
10605
|
const { categorize: categorizeBankTransaction2, isLoading } = useBankTransactionsContext();
|
|
10579
10606
|
const [selectedCategory, setSelectedCategory] = (0, import_react62.useState)(
|
|
10580
10607
|
getAssignedValue(bankTransaction)
|
|
@@ -10608,7 +10635,7 @@ var BusinessForm = ({
|
|
|
10608
10635
|
return options2;
|
|
10609
10636
|
}, [bankTransaction, selectedCategory]);
|
|
10610
10637
|
const onDrawerCategorySelect = (value) => {
|
|
10611
|
-
|
|
10638
|
+
close2();
|
|
10612
10639
|
setSelectedCategory(value);
|
|
10613
10640
|
};
|
|
10614
10641
|
const openDrawer = () => {
|
|
@@ -10698,7 +10725,7 @@ var BusinessForm = ({
|
|
|
10698
10725
|
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
10699
10726
|
"div",
|
|
10700
10727
|
{
|
|
10701
|
-
className: (0,
|
|
10728
|
+
className: (0, import_classnames44.default)(
|
|
10702
10729
|
"Layer__bank-transaction-mobile-list-item__receipts",
|
|
10703
10730
|
hasReceipts(bankTransaction) ? "Layer__bank-transaction-mobile-list-item__actions--with-receipts" : void 0
|
|
10704
10731
|
),
|
|
@@ -10760,7 +10787,7 @@ var PersonalCategories = /* @__PURE__ */ ((PersonalCategories2) => {
|
|
|
10760
10787
|
})(PersonalCategories || {});
|
|
10761
10788
|
|
|
10762
10789
|
// src/components/BankTransactionMobileList/PersonalForm.tsx
|
|
10763
|
-
var
|
|
10790
|
+
var import_classnames45 = __toESM(require("classnames"));
|
|
10764
10791
|
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
10765
10792
|
var isAlreadyAssigned = (bankTransaction) => {
|
|
10766
10793
|
if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */ || (bankTransaction == null ? void 0 : bankTransaction.categorization_status) === "SPLIT" /* SPLIT */) {
|
|
@@ -10833,7 +10860,7 @@ var PersonalForm = ({
|
|
|
10833
10860
|
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
10834
10861
|
"div",
|
|
10835
10862
|
{
|
|
10836
|
-
className: (0,
|
|
10863
|
+
className: (0, import_classnames45.default)(
|
|
10837
10864
|
"Layer__bank-transaction-mobile-list-item__receipts",
|
|
10838
10865
|
hasReceipts(bankTransaction) ? "Layer__bank-transaction-mobile-list-item__actions--with-receipts" : void 0
|
|
10839
10866
|
),
|
|
@@ -10880,7 +10907,7 @@ var import_react66 = require("react");
|
|
|
10880
10907
|
|
|
10881
10908
|
// src/components/BankTransactionMobileList/MatchForm.tsx
|
|
10882
10909
|
var import_react64 = require("react");
|
|
10883
|
-
var
|
|
10910
|
+
var import_classnames46 = __toESM(require("classnames"));
|
|
10884
10911
|
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
10885
10912
|
var MatchForm2 = ({
|
|
10886
10913
|
bankTransaction,
|
|
@@ -10967,7 +10994,7 @@ var MatchForm2 = ({
|
|
|
10967
10994
|
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10968
10995
|
"div",
|
|
10969
10996
|
{
|
|
10970
|
-
className: (0,
|
|
10997
|
+
className: (0, import_classnames46.default)(
|
|
10971
10998
|
"Layer__bank-transaction-mobile-list-item__receipts",
|
|
10972
10999
|
hasReceipts(bankTransaction) ? "Layer__bank-transaction-mobile-list-item__actions--with-receipts" : void 0
|
|
10973
11000
|
),
|
|
@@ -11012,7 +11039,7 @@ var MatchForm2 = ({
|
|
|
11012
11039
|
|
|
11013
11040
|
// src/components/BankTransactionMobileList/SplitForm.tsx
|
|
11014
11041
|
var import_react65 = require("react");
|
|
11015
|
-
var
|
|
11042
|
+
var import_classnames47 = __toESM(require("classnames"));
|
|
11016
11043
|
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
11017
11044
|
var SplitForm = ({
|
|
11018
11045
|
bankTransaction,
|
|
@@ -11189,7 +11216,7 @@ var SplitForm = ({
|
|
|
11189
11216
|
{
|
|
11190
11217
|
type: "text",
|
|
11191
11218
|
name: `split-${index}`,
|
|
11192
|
-
className: (0,
|
|
11219
|
+
className: (0, import_classnames47.default)(
|
|
11193
11220
|
"Layer__split-amount-input",
|
|
11194
11221
|
index === 0 && "Layer__split-amount-input--first"
|
|
11195
11222
|
),
|
|
@@ -11256,7 +11283,7 @@ var SplitForm = ({
|
|
|
11256
11283
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
11257
11284
|
"div",
|
|
11258
11285
|
{
|
|
11259
|
-
className: (0,
|
|
11286
|
+
className: (0, import_classnames47.default)(
|
|
11260
11287
|
"Layer__bank-transaction-mobile-list-item__receipts",
|
|
11261
11288
|
hasReceipts(bankTransaction) ? "Layer__bank-transaction-mobile-list-item__actions--with-receipts" : void 0
|
|
11262
11289
|
),
|
|
@@ -11405,7 +11432,7 @@ var TransactionToOpenContext = (0, import_react67.createContext)({
|
|
|
11405
11432
|
});
|
|
11406
11433
|
|
|
11407
11434
|
// src/components/BankTransactionMobileList/BankTransactionMobileListItem.tsx
|
|
11408
|
-
var
|
|
11435
|
+
var import_classnames48 = __toESM(require("classnames"));
|
|
11409
11436
|
var import_date_fns20 = require("date-fns");
|
|
11410
11437
|
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
11411
11438
|
var DATE_FORMAT2 = "LLL d";
|
|
@@ -11474,7 +11501,7 @@ var BankTransactionMobileListItem = ({
|
|
|
11474
11501
|
setRemoveAnim(true);
|
|
11475
11502
|
openNext();
|
|
11476
11503
|
} else {
|
|
11477
|
-
|
|
11504
|
+
close2();
|
|
11478
11505
|
}
|
|
11479
11506
|
}
|
|
11480
11507
|
}, [
|
|
@@ -11488,7 +11515,7 @@ var BankTransactionMobileListItem = ({
|
|
|
11488
11515
|
}
|
|
11489
11516
|
setOpen(!open);
|
|
11490
11517
|
};
|
|
11491
|
-
const
|
|
11518
|
+
const close2 = () => {
|
|
11492
11519
|
setOpen(false);
|
|
11493
11520
|
setHeight(0);
|
|
11494
11521
|
};
|
|
@@ -11515,7 +11542,7 @@ var BankTransactionMobileListItem = ({
|
|
|
11515
11542
|
const categorized = isCategorized(bankTransaction);
|
|
11516
11543
|
const className = "Layer__bank-transaction-mobile-list-item";
|
|
11517
11544
|
const openClassName = open ? `${className}--expanded` : "";
|
|
11518
|
-
const rowClassName = (0,
|
|
11545
|
+
const rowClassName = (0, import_classnames48.default)(
|
|
11519
11546
|
className,
|
|
11520
11547
|
removeAnim ? "Layer__bank-transaction-row--removing" : "",
|
|
11521
11548
|
open ? openClassName : "",
|
|
@@ -11593,7 +11620,7 @@ var BankTransactionMobileListItem = ({
|
|
|
11593
11620
|
onChange: onChangePurpose
|
|
11594
11621
|
}
|
|
11595
11622
|
),
|
|
11596
|
-
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(CloseButton, { onClick: () =>
|
|
11623
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(CloseButton, { onClick: () => close2() })
|
|
11597
11624
|
] }) : null,
|
|
11598
11625
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
11599
11626
|
BankTransactionMobileForms,
|
|
@@ -11650,14 +11677,14 @@ var BankTransactionMobileList = ({
|
|
|
11650
11677
|
var import_react69 = require("react");
|
|
11651
11678
|
|
|
11652
11679
|
// src/components/SkeletonLoader/SkeletonLoader.tsx
|
|
11653
|
-
var
|
|
11680
|
+
var import_classnames49 = __toESM(require("classnames"));
|
|
11654
11681
|
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
11655
11682
|
var SkeletonLoader = ({
|
|
11656
11683
|
height,
|
|
11657
11684
|
width,
|
|
11658
11685
|
className
|
|
11659
11686
|
}) => {
|
|
11660
|
-
const baseClassName = (0,
|
|
11687
|
+
const baseClassName = (0, import_classnames49.default)(
|
|
11661
11688
|
"Layer__skeleton-loader Layer__anim--skeleton-loading",
|
|
11662
11689
|
className
|
|
11663
11690
|
);
|
|
@@ -11757,7 +11784,7 @@ var BankTransactionsLoader = ({
|
|
|
11757
11784
|
};
|
|
11758
11785
|
|
|
11759
11786
|
// src/components/SyncingComponent/SyncingComponent.tsx
|
|
11760
|
-
var
|
|
11787
|
+
var import_classnames50 = __toESM(require("classnames"));
|
|
11761
11788
|
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
11762
11789
|
var SyncingComponent = ({
|
|
11763
11790
|
title = "Syncing account data",
|
|
@@ -11779,7 +11806,7 @@ var SyncingComponent = ({
|
|
|
11779
11806
|
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
11780
11807
|
"div",
|
|
11781
11808
|
{
|
|
11782
|
-
className: (0,
|
|
11809
|
+
className: (0, import_classnames50.default)(
|
|
11783
11810
|
"Layer__syncing-component",
|
|
11784
11811
|
inProgress ? "Layer__syncing-component--with-border" : ""
|
|
11785
11812
|
),
|
|
@@ -11974,7 +12001,7 @@ var usePagination = ({
|
|
|
11974
12001
|
};
|
|
11975
12002
|
|
|
11976
12003
|
// src/components/Pagination/Pagination.tsx
|
|
11977
|
-
var
|
|
12004
|
+
var import_classnames51 = __toESM(require("classnames"));
|
|
11978
12005
|
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
11979
12006
|
var Pagination = (props) => {
|
|
11980
12007
|
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "Layer__pagination-container", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(PaginationContent, __spreadValues({}, props)) });
|
|
@@ -12005,7 +12032,7 @@ var PaginationContent = ({
|
|
|
12005
12032
|
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
12006
12033
|
"li",
|
|
12007
12034
|
{
|
|
12008
|
-
className: (0,
|
|
12035
|
+
className: (0, import_classnames51.default)(
|
|
12009
12036
|
"Layer__pagination-item Layer__pagination-arrow Layer__pagination-arrow--previous",
|
|
12010
12037
|
{
|
|
12011
12038
|
disabled: currentPage === 1
|
|
@@ -12030,7 +12057,7 @@ var PaginationContent = ({
|
|
|
12030
12057
|
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
12031
12058
|
"li",
|
|
12032
12059
|
{
|
|
12033
|
-
className: (0,
|
|
12060
|
+
className: (0, import_classnames51.default)("Layer__pagination-item", {
|
|
12034
12061
|
selected: pageNumber === currentPage
|
|
12035
12062
|
}),
|
|
12036
12063
|
onClick: () => {
|
|
@@ -12058,7 +12085,7 @@ var PaginationContent = ({
|
|
|
12058
12085
|
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
12059
12086
|
"li",
|
|
12060
12087
|
{
|
|
12061
|
-
className: (0,
|
|
12088
|
+
className: (0, import_classnames51.default)(
|
|
12062
12089
|
"Layer__pagination-item Layer__pagination-arrow Layer__pagination-arrow--next",
|
|
12063
12090
|
{
|
|
12064
12091
|
disabled: currentPage === lastPage
|
|
@@ -12074,7 +12101,7 @@ var PaginationContent = ({
|
|
|
12074
12101
|
|
|
12075
12102
|
// src/components/BankTransactions/BankTransactionsHeader.tsx
|
|
12076
12103
|
var import_react72 = require("react");
|
|
12077
|
-
var
|
|
12104
|
+
var import_classnames52 = __toESM(require("classnames"));
|
|
12078
12105
|
var import_date_fns21 = require("date-fns");
|
|
12079
12106
|
var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
12080
12107
|
var DownloadButton2 = ({
|
|
@@ -12144,7 +12171,7 @@ var BankTransactionsHeader = ({
|
|
|
12144
12171
|
return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
|
|
12145
12172
|
Header,
|
|
12146
12173
|
{
|
|
12147
|
-
className: (0,
|
|
12174
|
+
className: (0, import_classnames52.default)(
|
|
12148
12175
|
"Layer__bank-transactions__header",
|
|
12149
12176
|
withDatePicker && "Layer__bank-transactions__header--with-date-picker",
|
|
12150
12177
|
mobileComponent && listView ? "Layer__bank-transactions__header--mobile" : void 0
|
|
@@ -13130,25 +13157,36 @@ function prepareFiltersBody(compareOptions) {
|
|
|
13130
13157
|
const noneFilters = compareOptions.filter(
|
|
13131
13158
|
({ tagFilterConfig: { tagFilters: tagFilters2 } }) => tagFilters2 === "None"
|
|
13132
13159
|
);
|
|
13133
|
-
const tagFilters = compareOptions.flatMap(({ tagFilterConfig: { tagFilters: tagFilters2 } }) => {
|
|
13160
|
+
const tagFilters = compareOptions.flatMap(({ tagFilterConfig: { tagFilters: tagFilters2, structure } }) => {
|
|
13134
13161
|
if (tagFilters2 === "None") {
|
|
13135
13162
|
return null;
|
|
13136
13163
|
}
|
|
13137
13164
|
if (tagFilters2.tagValues.length === 0) {
|
|
13138
|
-
|
|
13139
|
-
|
|
13140
|
-
|
|
13141
|
-
|
|
13142
|
-
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
|
|
13165
|
+
const filter = {
|
|
13166
|
+
structure,
|
|
13167
|
+
required_tags: []
|
|
13168
|
+
};
|
|
13169
|
+
return filter;
|
|
13170
|
+
}
|
|
13171
|
+
return tagFilters2.tagValues.map((tagValue) => {
|
|
13172
|
+
const filter = {
|
|
13173
|
+
structure,
|
|
13174
|
+
required_tags: [{
|
|
13175
|
+
key: tagFilters2.tagKey,
|
|
13176
|
+
value: tagValue
|
|
13177
|
+
}]
|
|
13178
|
+
};
|
|
13179
|
+
return filter;
|
|
13180
|
+
});
|
|
13146
13181
|
}).filter((item) => item !== null);
|
|
13147
13182
|
if (tagFilters.length === 0) {
|
|
13148
13183
|
return;
|
|
13149
13184
|
}
|
|
13150
13185
|
const allFilters = [
|
|
13151
|
-
noneFilters.length > 0 ? {
|
|
13186
|
+
noneFilters.length > 0 ? {
|
|
13187
|
+
structure: noneFilters[0].tagFilterConfig.structure,
|
|
13188
|
+
required_tags: []
|
|
13189
|
+
} : null,
|
|
13152
13190
|
...tagFilters
|
|
13153
13191
|
].filter((item) => item !== null);
|
|
13154
13192
|
return isArrayWithAtLeastOne(allFilters) ? allFilters : void 0;
|
|
@@ -13456,7 +13494,7 @@ var Indicator = ({
|
|
|
13456
13494
|
};
|
|
13457
13495
|
|
|
13458
13496
|
// src/components/ProfitAndLossChart/ProfitAndLossChart.tsx
|
|
13459
|
-
var
|
|
13497
|
+
var import_classnames53 = __toESM(require("classnames"));
|
|
13460
13498
|
var import_date_fns26 = require("date-fns");
|
|
13461
13499
|
var import_recharts = require("recharts");
|
|
13462
13500
|
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
@@ -13863,7 +13901,7 @@ var ProfitAndLossChart = ({
|
|
|
13863
13901
|
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
13864
13902
|
import_recharts.ResponsiveContainer,
|
|
13865
13903
|
{
|
|
13866
|
-
className: (0,
|
|
13904
|
+
className: (0, import_classnames53.default)(
|
|
13867
13905
|
"Layer__chart-container",
|
|
13868
13906
|
loaded !== "complete" && "Layer__chart-container--loading"
|
|
13869
13907
|
),
|
|
@@ -13983,7 +14021,7 @@ var ProfitAndLossChart = ({
|
|
|
13983
14021
|
isAnimationActive: barAnimActive,
|
|
13984
14022
|
animationDuration: 100,
|
|
13985
14023
|
radius: [2, 2, 0, 0],
|
|
13986
|
-
className: (0,
|
|
14024
|
+
className: (0, import_classnames53.default)(
|
|
13987
14025
|
"Layer__profit-and-loss-chart__bar--loading",
|
|
13988
14026
|
loaded !== "complete" && "Layer__profit-and-loss-chart__bar--loading-anim"
|
|
13989
14027
|
),
|
|
@@ -13999,7 +14037,7 @@ var ProfitAndLossChart = ({
|
|
|
13999
14037
|
isAnimationActive: barAnimActive,
|
|
14000
14038
|
animationDuration: 100,
|
|
14001
14039
|
radius: [2, 2, 0, 0],
|
|
14002
|
-
className: (0,
|
|
14040
|
+
className: (0, import_classnames53.default)(
|
|
14003
14041
|
"Layer__profit-and-loss-chart__bar--loading",
|
|
14004
14042
|
loaded !== "complete" && "Layer__profit-and-loss-chart__bar--loading-anim"
|
|
14005
14043
|
),
|
|
@@ -14556,7 +14594,7 @@ var SortArrows = (_a) => {
|
|
|
14556
14594
|
var SortArrows_default = SortArrows;
|
|
14557
14595
|
|
|
14558
14596
|
// src/components/ProfitAndLossDetailedCharts/DetailedTable.tsx
|
|
14559
|
-
var
|
|
14597
|
+
var import_classnames54 = __toESM(require("classnames"));
|
|
14560
14598
|
var import_jsx_runtime154 = require("react/jsx-runtime");
|
|
14561
14599
|
var mapTypesToColors = (data, colorList = DEFAULT_CHART_COLOR_TYPE) => {
|
|
14562
14600
|
const typeToColor = {};
|
|
@@ -14650,7 +14688,7 @@ var DetailedTable = ({
|
|
|
14650
14688
|
}) => {
|
|
14651
14689
|
const buildColClass = (column) => {
|
|
14652
14690
|
var _a, _b, _c;
|
|
14653
|
-
return (0,
|
|
14691
|
+
return (0, import_classnames54.default)(
|
|
14654
14692
|
"Layer__sortable-col",
|
|
14655
14693
|
sidebarScope && ((_a = filters[sidebarScope]) == null ? void 0 : _a.sortBy) === column ? `sort--${(_c = sidebarScope && ((_b = filters[sidebarScope]) == null ? void 0 : _b.sortDirection)) != null ? _c : "desc"}` : ""
|
|
14656
14694
|
);
|
|
@@ -14702,7 +14740,7 @@ var DetailedTable = ({
|
|
|
14702
14740
|
return /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(
|
|
14703
14741
|
"tr",
|
|
14704
14742
|
{
|
|
14705
|
-
className: (0,
|
|
14743
|
+
className: (0, import_classnames54.default)(
|
|
14706
14744
|
"Layer__profit-and-loss-detailed-table__row",
|
|
14707
14745
|
hoveredItem && hoveredItem === item.display_name ? "active" : ""
|
|
14708
14746
|
),
|
|
@@ -14735,7 +14773,7 @@ var DetailedTable = ({
|
|
|
14735
14773
|
};
|
|
14736
14774
|
|
|
14737
14775
|
// src/components/ProfitAndLossDetailedCharts/DetailedChart.tsx
|
|
14738
|
-
var
|
|
14776
|
+
var import_classnames55 = __toESM(require("classnames"));
|
|
14739
14777
|
var import_recharts2 = require("recharts");
|
|
14740
14778
|
var import_jsx_runtime155 = require("react/jsx-runtime");
|
|
14741
14779
|
var DetailedChart = ({
|
|
@@ -14829,7 +14867,7 @@ var DetailedChart = ({
|
|
|
14829
14867
|
return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
14830
14868
|
import_recharts2.Cell,
|
|
14831
14869
|
{
|
|
14832
|
-
className: (0,
|
|
14870
|
+
className: (0, import_classnames55.default)(
|
|
14833
14871
|
"Layer__profit-and-loss-detailed-charts__pie",
|
|
14834
14872
|
hoveredItem && active ? "active" : "inactive",
|
|
14835
14873
|
entry.type === "Uncategorized" && "Layer__profit-and-loss-detailed-charts__pie--border"
|
|
@@ -15295,11 +15333,11 @@ var import_react91 = require("react");
|
|
|
15295
15333
|
|
|
15296
15334
|
// src/components/Header/Header.tsx
|
|
15297
15335
|
var import_react88 = require("react");
|
|
15298
|
-
var
|
|
15336
|
+
var import_classnames56 = __toESM(require("classnames"));
|
|
15299
15337
|
var import_jsx_runtime161 = require("react/jsx-runtime");
|
|
15300
15338
|
var Header2 = (0, import_react88.forwardRef)(
|
|
15301
15339
|
({ className, children, style, sticky, asHeader, rounded }, ref) => {
|
|
15302
|
-
const baseClassName = (0,
|
|
15340
|
+
const baseClassName = (0, import_classnames56.default)(
|
|
15303
15341
|
"Layer__header",
|
|
15304
15342
|
sticky && "Layer__header--sticky",
|
|
15305
15343
|
rounded && "Layer__header--top-rounded",
|
|
@@ -15322,24 +15360,24 @@ var Header2 = (0, import_react88.forwardRef)(
|
|
|
15322
15360
|
Header2.displayName = "Header";
|
|
15323
15361
|
|
|
15324
15362
|
// src/components/Header/HeaderRow.tsx
|
|
15325
|
-
var
|
|
15363
|
+
var import_classnames57 = __toESM(require("classnames"));
|
|
15326
15364
|
var import_jsx_runtime162 = require("react/jsx-runtime");
|
|
15327
15365
|
var HeaderRow = ({ className, children, direction, style }) => {
|
|
15328
15366
|
const dataProps = toDataProperties({ direction });
|
|
15329
|
-
return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", __spreadProps(__spreadValues({}, dataProps), { className: (0,
|
|
15367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", __spreadProps(__spreadValues({}, dataProps), { className: (0, import_classnames57.default)("Layer__header__row", className), style, children }));
|
|
15330
15368
|
};
|
|
15331
15369
|
|
|
15332
15370
|
// src/components/Header/HeaderCol.tsx
|
|
15333
|
-
var
|
|
15371
|
+
var import_classnames58 = __toESM(require("classnames"));
|
|
15334
15372
|
var import_jsx_runtime163 = require("react/jsx-runtime");
|
|
15335
15373
|
var HeaderCol = ({ className, children, style, noPadding = false }) => {
|
|
15336
15374
|
const dataProperties = toDataProperties({ "no-padding": noPadding });
|
|
15337
|
-
return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", __spreadProps(__spreadValues({}, dataProperties), { className: (0,
|
|
15375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", __spreadProps(__spreadValues({}, dataProperties), { className: (0, import_classnames58.default)("Layer__header__col", className), style, children }));
|
|
15338
15376
|
};
|
|
15339
15377
|
|
|
15340
15378
|
// src/components/Panel/Panel.tsx
|
|
15341
15379
|
var import_react89 = require("react");
|
|
15342
|
-
var
|
|
15380
|
+
var import_classnames59 = __toESM(require("classnames"));
|
|
15343
15381
|
var import_jsx_runtime164 = require("react/jsx-runtime");
|
|
15344
15382
|
var Panel = ({
|
|
15345
15383
|
children,
|
|
@@ -15359,7 +15397,7 @@ var Panel = ({
|
|
|
15359
15397
|
setSidebarHeight((_b = parentRef == null ? void 0 : parentRef.current) == null ? void 0 : _b.offsetHeight);
|
|
15360
15398
|
}
|
|
15361
15399
|
}, [parentRef, (_a = parentRef == null ? void 0 : parentRef.current) == null ? void 0 : _a.offsetHeight, sidebarIsOpen]);
|
|
15362
|
-
const sidebarClass = (0,
|
|
15400
|
+
const sidebarClass = (0, import_classnames59.default)(
|
|
15363
15401
|
"Layer__panel__sidebar",
|
|
15364
15402
|
defaultSidebarHeight && "Layer__panel__sidebar--default",
|
|
15365
15403
|
floating && "Layer__panel__sidebar--floating"
|
|
@@ -15367,7 +15405,7 @@ var Panel = ({
|
|
|
15367
15405
|
return /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)(
|
|
15368
15406
|
"div",
|
|
15369
15407
|
{
|
|
15370
|
-
className: (0,
|
|
15408
|
+
className: (0, import_classnames59.default)(
|
|
15371
15409
|
"Layer__panel",
|
|
15372
15410
|
className,
|
|
15373
15411
|
sidebarIsOpen && "Layer__panel--open"
|
|
@@ -15396,17 +15434,17 @@ var Panel = ({
|
|
|
15396
15434
|
var import_react90 = require("react");
|
|
15397
15435
|
|
|
15398
15436
|
// src/components/ViewHeader/ViewHeader.tsx
|
|
15399
|
-
var
|
|
15437
|
+
var import_classnames60 = __toESM(require("classnames"));
|
|
15400
15438
|
var import_jsx_runtime165 = require("react/jsx-runtime");
|
|
15401
15439
|
var ViewHeader = ({ title, className, children }) => {
|
|
15402
|
-
return /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("div", { className: (0,
|
|
15440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("div", { className: (0, import_classnames60.default)("Layer__view-header", className), children: /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)("div", { className: "Layer__view-header__content", children: [
|
|
15403
15441
|
title && /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(Heading, { className: "Layer__view-header__title", children: title }),
|
|
15404
15442
|
children && /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("div", { className: "Layer__view-header__children", children })
|
|
15405
15443
|
] }) });
|
|
15406
15444
|
};
|
|
15407
15445
|
|
|
15408
15446
|
// src/components/View/View.tsx
|
|
15409
|
-
var
|
|
15447
|
+
var import_classnames61 = __toESM(require("classnames"));
|
|
15410
15448
|
var import_jsx_runtime166 = require("react/jsx-runtime");
|
|
15411
15449
|
var View = (0, import_react90.forwardRef)(
|
|
15412
15450
|
({
|
|
@@ -15422,7 +15460,7 @@ var View = (0, import_react90.forwardRef)(
|
|
|
15422
15460
|
}, ref) => {
|
|
15423
15461
|
const { theme } = useLayerContext();
|
|
15424
15462
|
const styles = parseStylesFromThemeConfig(theme);
|
|
15425
|
-
const viewClassNames = (0,
|
|
15463
|
+
const viewClassNames = (0, import_classnames61.default)(
|
|
15426
15464
|
"Layer__view",
|
|
15427
15465
|
type === "panel" && "Layer__view--panel",
|
|
15428
15466
|
viewClassName
|
|
@@ -15432,7 +15470,7 @@ var View = (0, import_react90.forwardRef)(
|
|
|
15432
15470
|
ViewHeader,
|
|
15433
15471
|
{
|
|
15434
15472
|
title,
|
|
15435
|
-
className: (0,
|
|
15473
|
+
className: (0, import_classnames61.default)(
|
|
15436
15474
|
headerControls ? "Layer__view-header--paddings" : void 0
|
|
15437
15475
|
),
|
|
15438
15476
|
children: header != null ? header : headerControls
|
|
@@ -15941,7 +15979,7 @@ var TableBody = ({ children }) => {
|
|
|
15941
15979
|
};
|
|
15942
15980
|
|
|
15943
15981
|
// src/components/TableCell/TableCell.tsx
|
|
15944
|
-
var
|
|
15982
|
+
var import_classnames62 = __toESM(require("classnames"));
|
|
15945
15983
|
var import_jsx_runtime176 = require("react/jsx-runtime");
|
|
15946
15984
|
var TableCell = ({
|
|
15947
15985
|
children,
|
|
@@ -15961,7 +15999,7 @@ var TableCell = ({
|
|
|
15961
15999
|
const amount = typeof children === "number" ? children : 0;
|
|
15962
16000
|
const isPositive = amount >= 0;
|
|
15963
16001
|
const amountString = centsToDollars(Math.abs(amount));
|
|
15964
|
-
const cellClassNames = (0,
|
|
16002
|
+
const cellClassNames = (0, import_classnames62.default)(
|
|
15965
16003
|
"Layer__table-cell",
|
|
15966
16004
|
(primary || isHeaderCell) && "Layer__table-cell--primary",
|
|
15967
16005
|
isHeaderCell && "Layer__table-header",
|
|
@@ -16004,7 +16042,7 @@ var TableHead = ({ children }) => {
|
|
|
16004
16042
|
};
|
|
16005
16043
|
|
|
16006
16044
|
// src/components/TableRow/TableRow.tsx
|
|
16007
|
-
var
|
|
16045
|
+
var import_classnames63 = __toESM(require("classnames"));
|
|
16008
16046
|
var import_jsx_runtime178 = require("react/jsx-runtime");
|
|
16009
16047
|
var TableRow = ({
|
|
16010
16048
|
rowKey,
|
|
@@ -16024,12 +16062,11 @@ var TableRow = ({
|
|
|
16024
16062
|
if (onClick) {
|
|
16025
16063
|
onClick(e);
|
|
16026
16064
|
} else {
|
|
16027
|
-
if (variant === "summation" || !expandable)
|
|
16028
|
-
return;
|
|
16065
|
+
if (variant === "summation" || !expandable) return;
|
|
16029
16066
|
handleExpand && handleExpand();
|
|
16030
16067
|
}
|
|
16031
16068
|
};
|
|
16032
|
-
const rowClassNames = (0,
|
|
16069
|
+
const rowClassNames = (0, import_classnames63.default)([
|
|
16033
16070
|
"Layer__table-row",
|
|
16034
16071
|
!isHeadRow && `Layer__table-row--depth-${depth}`,
|
|
16035
16072
|
!isHeadRow && `Layer__table-row--variant-${variant}`,
|
|
@@ -16053,7 +16090,7 @@ var TableRow = ({
|
|
|
16053
16090
|
|
|
16054
16091
|
// src/components/Table/Table.tsx
|
|
16055
16092
|
var import_react97 = require("react");
|
|
16056
|
-
var
|
|
16093
|
+
var import_classnames64 = __toESM(require("classnames"));
|
|
16057
16094
|
var import_jsx_runtime179 = require("react/jsx-runtime");
|
|
16058
16095
|
var Table = ({
|
|
16059
16096
|
componentName,
|
|
@@ -16094,11 +16131,11 @@ var Table = ({
|
|
|
16094
16131
|
prevChildrenRef.current = newChildrenKeys;
|
|
16095
16132
|
}
|
|
16096
16133
|
}, [children]);
|
|
16097
|
-
const tableWrapperClassNames = (0,
|
|
16134
|
+
const tableWrapperClassNames = (0, import_classnames64.default)(
|
|
16098
16135
|
"Layer__table-wrapper",
|
|
16099
16136
|
bottomSpacing && "Layer__table-wrapper--bottom-spacing"
|
|
16100
16137
|
);
|
|
16101
|
-
const tableClassNames = (0,
|
|
16138
|
+
const tableClassNames = (0, import_classnames64.default)(
|
|
16102
16139
|
"Layer__table",
|
|
16103
16140
|
componentName && `Layer__${componentName}__table`,
|
|
16104
16141
|
borderCollapse && `Layer__table__${borderCollapse}-rows`
|
|
@@ -16107,7 +16144,7 @@ var Table = ({
|
|
|
16107
16144
|
};
|
|
16108
16145
|
|
|
16109
16146
|
// src/components/ProfitAndLossTable/ProfitAndLossCompareTable.tsx
|
|
16110
|
-
var
|
|
16147
|
+
var import_classnames65 = __toESM(require("classnames"));
|
|
16111
16148
|
var import_jsx_runtime180 = require("react/jsx-runtime");
|
|
16112
16149
|
var ProfitAndLossCompareTable = ({
|
|
16113
16150
|
stringOverrides
|
|
@@ -16128,7 +16165,7 @@ var ProfitAndLossCompareTable = ({
|
|
|
16128
16165
|
return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
|
|
16129
16166
|
"div",
|
|
16130
16167
|
{
|
|
16131
|
-
className: (0,
|
|
16168
|
+
className: (0, import_classnames65.default)("Layer__profit-and-loss-table__loader-container"),
|
|
16132
16169
|
children: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(Loader2, {})
|
|
16133
16170
|
}
|
|
16134
16171
|
);
|
|
@@ -16318,7 +16355,7 @@ var empty_profit_and_loss_report_default = {
|
|
|
16318
16355
|
};
|
|
16319
16356
|
|
|
16320
16357
|
// src/components/ProfitAndLossTable/ProfitAndLossTableComponent.tsx
|
|
16321
|
-
var
|
|
16358
|
+
var import_classnames66 = __toESM(require("classnames"));
|
|
16322
16359
|
var import_jsx_runtime182 = require("react/jsx-runtime");
|
|
16323
16360
|
var ProfitAndLossTableComponent = ({
|
|
16324
16361
|
asContainer,
|
|
@@ -16339,7 +16376,7 @@ var ProfitAndLossTableComponent = ({
|
|
|
16339
16376
|
return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
|
|
16340
16377
|
"div",
|
|
16341
16378
|
{
|
|
16342
|
-
className: (0,
|
|
16379
|
+
className: (0, import_classnames66.default)(
|
|
16343
16380
|
"Layer__profit-and-loss-table__loader-container",
|
|
16344
16381
|
asContainer && "Layer__component-container"
|
|
16345
16382
|
),
|
|
@@ -18652,10 +18689,10 @@ var lineEntryNumber = (ledgerEntryLine) => {
|
|
|
18652
18689
|
};
|
|
18653
18690
|
|
|
18654
18691
|
// src/components/Card/Card.tsx
|
|
18655
|
-
var
|
|
18692
|
+
var import_classnames67 = __toESM(require("classnames"));
|
|
18656
18693
|
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
18657
18694
|
var Card = ({ children, className }) => {
|
|
18658
|
-
return /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("div", { className: (0,
|
|
18695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("div", { className: (0, import_classnames67.default)("Layer__card", className), children });
|
|
18659
18696
|
};
|
|
18660
18697
|
|
|
18661
18698
|
// src/components/DateTime/DateTime.tsx
|
|
@@ -18699,7 +18736,7 @@ var DateTime = ({
|
|
|
18699
18736
|
};
|
|
18700
18737
|
|
|
18701
18738
|
// src/components/DetailsList/DetailsList.tsx
|
|
18702
|
-
var
|
|
18739
|
+
var import_classnames68 = __toESM(require("classnames"));
|
|
18703
18740
|
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
18704
18741
|
var DetailsList = ({
|
|
18705
18742
|
title,
|
|
@@ -18708,7 +18745,7 @@ var DetailsList = ({
|
|
|
18708
18745
|
titleClassName,
|
|
18709
18746
|
actions
|
|
18710
18747
|
}) => {
|
|
18711
|
-
return /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)("div", { className: (0,
|
|
18748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)("div", { className: (0, import_classnames68.default)("Layer__details-list", className), children: [
|
|
18712
18749
|
title && /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(Header, { className: titleClassName, children: [
|
|
18713
18750
|
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)(Heading, { size: "secondary" /* secondary */, children: title }),
|
|
18714
18751
|
actions && /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("div", { className: "Layer__details-list__actions", children: actions })
|
|
@@ -19023,7 +19060,7 @@ var LedgerAccountEntryDetails = ({
|
|
|
19023
19060
|
|
|
19024
19061
|
// src/components/LedgerAccount/LedgerAccountRow.tsx
|
|
19025
19062
|
var import_react116 = require("react");
|
|
19026
|
-
var
|
|
19063
|
+
var import_classnames69 = __toESM(require("classnames"));
|
|
19027
19064
|
var import_date_fns36 = require("date-fns");
|
|
19028
19065
|
var import_jsx_runtime208 = require("react/jsx-runtime");
|
|
19029
19066
|
var LedgerAccountRow = ({
|
|
@@ -19049,7 +19086,7 @@ var LedgerAccountRow = ({
|
|
|
19049
19086
|
return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(
|
|
19050
19087
|
"tr",
|
|
19051
19088
|
{
|
|
19052
|
-
className: (0,
|
|
19089
|
+
className: (0, import_classnames69.default)(
|
|
19053
19090
|
"Layer__table-row",
|
|
19054
19091
|
row.entry_id === selectedEntryId && "Layer__table-row--active",
|
|
19055
19092
|
initialLoad && "initial-load",
|
|
@@ -19090,7 +19127,7 @@ var LedgerAccountRow = ({
|
|
|
19090
19127
|
return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
19091
19128
|
"tr",
|
|
19092
19129
|
{
|
|
19093
|
-
className: (0,
|
|
19130
|
+
className: (0, import_classnames69.default)(
|
|
19094
19131
|
"Layer__table-row",
|
|
19095
19132
|
row.entry_id === selectedEntryId && "Layer__table-row--active",
|
|
19096
19133
|
initialLoad && "initial-load",
|
|
@@ -19142,7 +19179,7 @@ var LedgerAccountRow = ({
|
|
|
19142
19179
|
return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(
|
|
19143
19180
|
"tr",
|
|
19144
19181
|
{
|
|
19145
|
-
className: (0,
|
|
19182
|
+
className: (0, import_classnames69.default)(
|
|
19146
19183
|
"Layer__table-row",
|
|
19147
19184
|
row.entry_id === selectedEntryId && "Layer__table-row--active",
|
|
19148
19185
|
initialLoad && "initial-load",
|
|
@@ -19170,7 +19207,7 @@ var LedgerAccountRow = ({
|
|
|
19170
19207
|
};
|
|
19171
19208
|
|
|
19172
19209
|
// src/components/LedgerAccount/LedgerAccountIndex.tsx
|
|
19173
|
-
var
|
|
19210
|
+
var import_classnames70 = __toESM(require("classnames"));
|
|
19174
19211
|
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
19175
19212
|
var LedgerAccount = ({
|
|
19176
19213
|
containerRef,
|
|
@@ -19201,7 +19238,7 @@ var LedgerAccount = ({
|
|
|
19201
19238
|
return () => clearTimeout(timeoutLoad);
|
|
19202
19239
|
}
|
|
19203
19240
|
}, [isLoading]);
|
|
19204
|
-
const baseClassName = (0,
|
|
19241
|
+
const baseClassName = (0, import_classnames70.default)(
|
|
19205
19242
|
"Layer__ledger-account__index",
|
|
19206
19243
|
accountId && "open"
|
|
19207
19244
|
);
|
|
@@ -19216,7 +19253,7 @@ var LedgerAccount = ({
|
|
|
19216
19253
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
19217
19254
|
return (_a2 = rawData == null ? void 0 : rawData.sort((a, b) => Date.parse(b.date) - Date.parse(a.date))) == null ? void 0 : _a2.slice(firstPageIndex, lastPageIndex);
|
|
19218
19255
|
}, [rawData, currentPage]);
|
|
19219
|
-
const
|
|
19256
|
+
const close2 = () => {
|
|
19220
19257
|
setAccountId(void 0);
|
|
19221
19258
|
closeSelectedEntry();
|
|
19222
19259
|
};
|
|
@@ -19234,7 +19271,7 @@ var LedgerAccount = ({
|
|
|
19234
19271
|
className: "Layer__ledger-account__panel",
|
|
19235
19272
|
children: /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { className: baseClassName, children: [
|
|
19236
19273
|
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(Header2, { className: "Layer__ledger-account__header", children: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(HeaderRow, { children: /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(HeaderCol, { children: [
|
|
19237
|
-
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(BackButton, { onClick:
|
|
19274
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(BackButton, { onClick: close2 }),
|
|
19238
19275
|
/* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { className: "Layer__ledger-account__title-container", children: [
|
|
19239
19276
|
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
19240
19277
|
Text,
|
|
@@ -20842,8 +20879,7 @@ var useTasks = ({
|
|
|
20842
20879
|
}).then(refetch);
|
|
20843
20880
|
});
|
|
20844
20881
|
const submitResponseToTask2 = (taskId, userResponse) => {
|
|
20845
|
-
if (!taskId || !userResponse || userResponse.length === 0)
|
|
20846
|
-
return;
|
|
20882
|
+
if (!taskId || !userResponse || userResponse.length === 0) return;
|
|
20847
20883
|
const data2 = {
|
|
20848
20884
|
type: "FreeResponse",
|
|
20849
20885
|
user_response: userResponse
|
|
@@ -20996,7 +21032,7 @@ var ProgressIcon_default = ProgressIcon;
|
|
|
20996
21032
|
|
|
20997
21033
|
// src/components/TasksHeader/TasksHeader.tsx
|
|
20998
21034
|
var import_date_fns40 = require("date-fns");
|
|
20999
|
-
var
|
|
21035
|
+
var import_classnames71 = __toESM(require("classnames"));
|
|
21000
21036
|
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
21001
21037
|
var ICONS = {
|
|
21002
21038
|
loading: {
|
|
@@ -21039,7 +21075,7 @@ var TasksHeader = ({
|
|
|
21039
21075
|
const completedTasks = tasks == null ? void 0 : tasks.filter((task) => isComplete(task.status)).length;
|
|
21040
21076
|
const badgeVariant = completedTasks === (tasks == null ? void 0 : tasks.length) ? ICONS.done : ICONS.pending;
|
|
21041
21077
|
const minDate = getEarliestDateToBrowse(business);
|
|
21042
|
-
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)("div", { className: (0,
|
|
21078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)("div", { className: (0, import_classnames71.default)("Layer__tasks-header", collapsable && "Layer__tasks-header--collapsable"), children: /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "Layer__tasks-header__left-col", children: [
|
|
21043
21079
|
/* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "Layer__tasks-header__left-col__title", children: [
|
|
21044
21080
|
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(Text, { size: "lg" /* lg */, children: tasksHeader }),
|
|
21045
21081
|
loadedStatus !== "complete" && !open ? /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(Badge, { variant: ICONS.loading.badge, icon: ICONS.loading.icon, children: ICONS.loading.text }) : loadedStatus === "complete" && !open && (!tasks || error) ? /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
@@ -21143,7 +21179,7 @@ var SmileIcon_default = SmileIcon;
|
|
|
21143
21179
|
|
|
21144
21180
|
// src/components/TasksListItem/TasksListItem.tsx
|
|
21145
21181
|
var import_react130 = require("react");
|
|
21146
|
-
var
|
|
21182
|
+
var import_classnames72 = __toESM(require("classnames"));
|
|
21147
21183
|
var import_jsx_runtime222 = require("react/jsx-runtime");
|
|
21148
21184
|
var TasksListItem = ({
|
|
21149
21185
|
task,
|
|
@@ -21160,16 +21196,16 @@ var TasksListItem = ({
|
|
|
21160
21196
|
deleteUploadsForTask,
|
|
21161
21197
|
updateDocUploadTaskDescription
|
|
21162
21198
|
} = (0, import_react130.useContext)(TasksContext);
|
|
21163
|
-
const taskBodyClassName = (0,
|
|
21199
|
+
const taskBodyClassName = (0, import_classnames72.default)(
|
|
21164
21200
|
"Layer__tasks-list-item__body",
|
|
21165
21201
|
isOpen && "Layer__tasks-list-item__body--expanded",
|
|
21166
21202
|
isComplete(task.status) && "Layer__tasks-list-item--completed"
|
|
21167
21203
|
);
|
|
21168
|
-
const taskHeadClassName = (0,
|
|
21204
|
+
const taskHeadClassName = (0, import_classnames72.default)(
|
|
21169
21205
|
"Layer__tasks-list-item__head-info",
|
|
21170
21206
|
isComplete(task.status) ? "Layer__tasks-list-item--completed" : "Layer__tasks-list-item--pending"
|
|
21171
21207
|
);
|
|
21172
|
-
const taskItemClassName = (0,
|
|
21208
|
+
const taskItemClassName = (0, import_classnames72.default)(
|
|
21173
21209
|
"Layer__tasks-list-item",
|
|
21174
21210
|
isOpen && "Layer__tasks-list-item__expanded"
|
|
21175
21211
|
);
|
|
@@ -21378,7 +21414,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
21378
21414
|
|
|
21379
21415
|
// src/components/TasksPending/TasksPending.tsx
|
|
21380
21416
|
var import_react132 = require("react");
|
|
21381
|
-
var
|
|
21417
|
+
var import_classnames73 = __toESM(require("classnames"));
|
|
21382
21418
|
var import_date_fns42 = require("date-fns");
|
|
21383
21419
|
var import_recharts4 = require("recharts");
|
|
21384
21420
|
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
@@ -21401,7 +21437,7 @@ var TasksPending = () => {
|
|
|
21401
21437
|
value: data == null ? void 0 : data.filter((task) => !isComplete(task.status)).length
|
|
21402
21438
|
}
|
|
21403
21439
|
];
|
|
21404
|
-
const taskStatusClassName = (0,
|
|
21440
|
+
const taskStatusClassName = (0, import_classnames73.default)(
|
|
21405
21441
|
completedTasks && completedTasks > 0 ? "Layer__tasks-pending-bar__status--done" : "Layer__tasks-pending-bar__status--pending"
|
|
21406
21442
|
);
|
|
21407
21443
|
return /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)("div", { className: "Layer__tasks-pending", children: [
|
|
@@ -21450,11 +21486,11 @@ var import_react133 = require("react");
|
|
|
21450
21486
|
var import_date_fns43 = require("date-fns");
|
|
21451
21487
|
|
|
21452
21488
|
// src/components/TasksMonthSelector/TaskMonthTile.tsx
|
|
21453
|
-
var
|
|
21489
|
+
var import_classnames74 = __toESM(require("classnames"));
|
|
21454
21490
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
21455
21491
|
var TaskMonthTile = ({ monthData, onClick, active, disabled }) => {
|
|
21456
21492
|
const isCompleted = monthData.total === monthData.completed;
|
|
21457
|
-
const baseClass = (0,
|
|
21493
|
+
const baseClass = (0, import_classnames74.default)(
|
|
21458
21494
|
"Layer__tasks-month-selector__month",
|
|
21459
21495
|
isCompleted && "Layer__tasks-month-selector__month--completed",
|
|
21460
21496
|
active && "Layer__tasks-month-selector__month--active",
|
|
@@ -21498,7 +21534,6 @@ var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
|
|
|
21498
21534
|
{ year, month: i, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0 }
|
|
21499
21535
|
);
|
|
21500
21536
|
const endDate = (0, import_date_fns43.endOfMonth)(startDate);
|
|
21501
|
-
const disabled = minDate && (0, import_date_fns43.isBefore)(startDate, minDate) || (0, import_date_fns43.isAfter)(startDate, (0, import_date_fns43.startOfMonth)(/* @__PURE__ */ new Date()));
|
|
21502
21537
|
const taskData = (_a = tasks == null ? void 0 : tasks.find((x) => x.month === i && x.year === year)) != null ? _a : __spreadValues({
|
|
21503
21538
|
monthStr: (0, import_date_fns43.format)(startDate, "MMM"),
|
|
21504
21539
|
year,
|
|
@@ -21506,6 +21541,7 @@ var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
|
|
|
21506
21541
|
startDate,
|
|
21507
21542
|
endDate
|
|
21508
21543
|
}, DEFAULT_TASK_DATA);
|
|
21544
|
+
const disabled = taskData.total === 0 && (minDate && (0, import_date_fns43.isBefore)(startDate, minDate) || (0, import_date_fns43.isAfter)(startDate, (0, import_date_fns43.startOfMonth)(/* @__PURE__ */ new Date())));
|
|
21509
21545
|
return __spreadValues({
|
|
21510
21546
|
monthStr: (0, import_date_fns43.format)(startDate, "MMM"),
|
|
21511
21547
|
startDate,
|
|
@@ -21529,7 +21565,7 @@ var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
|
|
|
21529
21565
|
};
|
|
21530
21566
|
|
|
21531
21567
|
// src/components/Tasks/Tasks.tsx
|
|
21532
|
-
var
|
|
21568
|
+
var import_classnames75 = __toESM(require("classnames"));
|
|
21533
21569
|
var import_date_fns44 = require("date-fns");
|
|
21534
21570
|
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
21535
21571
|
var UseTasksContext = (0, import_react134.createContext)({
|
|
@@ -21619,7 +21655,7 @@ var TasksComponent = ({
|
|
|
21619
21655
|
return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(
|
|
21620
21656
|
"div",
|
|
21621
21657
|
{
|
|
21622
|
-
className: (0,
|
|
21658
|
+
className: (0, import_classnames75.default)(
|
|
21623
21659
|
"Layer__tasks-component",
|
|
21624
21660
|
collapsable && "Layer__tasks-component--collapsable"
|
|
21625
21661
|
),
|
|
@@ -21637,7 +21673,7 @@ var TasksComponent = ({
|
|
|
21637
21673
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
21638
21674
|
"div",
|
|
21639
21675
|
{
|
|
21640
|
-
className: (0,
|
|
21676
|
+
className: (0, import_classnames75.default)(
|
|
21641
21677
|
"Layer__tasks__content",
|
|
21642
21678
|
!open && "Layer__tasks__content--collapsed"
|
|
21643
21679
|
),
|
|
@@ -21792,7 +21828,7 @@ function LinkAccountsConfirmationStep() {
|
|
|
21792
21828
|
) }, index)
|
|
21793
21829
|
}
|
|
21794
21830
|
) }),
|
|
21795
|
-
/* @__PURE__ */ (0, import_jsx_runtime230.jsxs)(HStack, { pbs: "lg",
|
|
21831
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsxs)(HStack, { pbs: "lg", gap: "sm", children: [
|
|
21796
21832
|
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(Button, { variant: "secondary" /* secondary */, onClick: previous, children: "Back" }),
|
|
21797
21833
|
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
21798
21834
|
Subscribe,
|
|
@@ -21824,7 +21860,16 @@ function LinkAccountsConfirmationStep() {
|
|
|
21824
21860
|
// src/components/PlatformOnboarding/Steps/LinkAccountsLinkStep.tsx
|
|
21825
21861
|
var import_react137 = require("react");
|
|
21826
21862
|
var import_pluralize = __toESM(require("pluralize"));
|
|
21863
|
+
|
|
21864
|
+
// src/components/Separator/Separator.tsx
|
|
21827
21865
|
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
21866
|
+
var Separator = ({ mbs, mbe }) => {
|
|
21867
|
+
const dataProperties = toDataProperties({ mbs, mbe });
|
|
21868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)("div", __spreadValues({ className: "Layer__separator" }, dataProperties));
|
|
21869
|
+
};
|
|
21870
|
+
|
|
21871
|
+
// src/components/PlatformOnboarding/Steps/LinkAccountsLinkStep.tsx
|
|
21872
|
+
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
21828
21873
|
function LinkAccountsLinkStep() {
|
|
21829
21874
|
const {
|
|
21830
21875
|
data,
|
|
@@ -21835,48 +21880,57 @@ function LinkAccountsLinkStep() {
|
|
|
21835
21880
|
} = (0, import_react137.useContext)(LinkedAccountsContext);
|
|
21836
21881
|
const { next } = useWizard();
|
|
21837
21882
|
const effectiveAccounts = data != null ? data : [];
|
|
21838
|
-
return /* @__PURE__ */ (0,
|
|
21839
|
-
/* @__PURE__ */ (0,
|
|
21883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(import_jsx_runtime232.Fragment, { children: [
|
|
21884
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
21840
21885
|
ConditionalList,
|
|
21841
21886
|
{
|
|
21842
21887
|
list: effectiveAccounts,
|
|
21843
|
-
Empty: /* @__PURE__ */ (0,
|
|
21844
|
-
/* @__PURE__ */ (0,
|
|
21845
|
-
/* @__PURE__ */ (0,
|
|
21846
|
-
|
|
21888
|
+
Empty: /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(VStack, { gap: "xl", pbe: "md", children: [
|
|
21889
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Text, { status: "disabled", children: "Connect your bank accounts and credit cards to automatically import your business transactions." }),
|
|
21890
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
21891
|
+
ActionableRow,
|
|
21847
21892
|
{
|
|
21848
|
-
|
|
21849
|
-
|
|
21850
|
-
|
|
21851
|
-
|
|
21852
|
-
|
|
21853
|
-
|
|
21893
|
+
iconBox: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(PlaidIcon_default, {}),
|
|
21894
|
+
title: "Connect my bank",
|
|
21895
|
+
description: "Import data with one simple integration.",
|
|
21896
|
+
button: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
21897
|
+
Button,
|
|
21898
|
+
{
|
|
21899
|
+
onClick: () => addConnection("PLAID"),
|
|
21900
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Link_default, { size: 12 }),
|
|
21901
|
+
disabled: loadingStatus !== "complete",
|
|
21902
|
+
children: "Connect"
|
|
21903
|
+
}
|
|
21904
|
+
)
|
|
21854
21905
|
}
|
|
21855
|
-
)
|
|
21906
|
+
)
|
|
21856
21907
|
] }),
|
|
21857
|
-
Container: ({ children }) => /* @__PURE__ */ (0,
|
|
21858
|
-
/* @__PURE__ */ (0,
|
|
21859
|
-
/* @__PURE__ */ (0,
|
|
21860
|
-
/* @__PURE__ */ (0,
|
|
21908
|
+
Container: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(VStack, { children: [
|
|
21909
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(VStack, { gap: "2xs", pbe: "md", children: [
|
|
21910
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Heading2, { level: 3, size: "sm", children: `We've found ${(0, import_pluralize.default)("account", effectiveAccounts.length, true)}` }),
|
|
21911
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Text, { status: "disabled", children: "You'll have the chance to remove any accounts you don't use for your business in the next step." })
|
|
21861
21912
|
] }),
|
|
21862
|
-
/* @__PURE__ */ (0,
|
|
21863
|
-
/* @__PURE__ */ (0,
|
|
21864
|
-
|
|
21865
|
-
|
|
21866
|
-
|
|
21867
|
-
|
|
21868
|
-
|
|
21869
|
-
|
|
21870
|
-
|
|
21871
|
-
|
|
21872
|
-
|
|
21873
|
-
|
|
21874
|
-
|
|
21875
|
-
|
|
21876
|
-
|
|
21913
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(LinkAccountsListContainer, { children }),
|
|
21914
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(VStack, { pbs: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
21915
|
+
ActionableRow,
|
|
21916
|
+
{
|
|
21917
|
+
iconBox: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(PlaidIcon_default, {}),
|
|
21918
|
+
title: "Connect my next bank account",
|
|
21919
|
+
description: "Import data with one simple integration.",
|
|
21920
|
+
button: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
21921
|
+
Button,
|
|
21922
|
+
{
|
|
21923
|
+
onClick: () => addConnection("PLAID"),
|
|
21924
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Link_default, { size: 12 }),
|
|
21925
|
+
disabled: loadingStatus !== "complete",
|
|
21926
|
+
children: "Connect next"
|
|
21927
|
+
}
|
|
21928
|
+
)
|
|
21929
|
+
}
|
|
21930
|
+
) })
|
|
21877
21931
|
] }),
|
|
21878
21932
|
isError: Boolean(error),
|
|
21879
|
-
Error: /* @__PURE__ */ (0,
|
|
21933
|
+
Error: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
21880
21934
|
DataState,
|
|
21881
21935
|
{
|
|
21882
21936
|
status: "failed" /* failed */,
|
|
@@ -21888,20 +21942,23 @@ function LinkAccountsLinkStep() {
|
|
|
21888
21942
|
}
|
|
21889
21943
|
),
|
|
21890
21944
|
isLoading: loadingStatus === "loading" || loadingStatus === "initial",
|
|
21891
|
-
Loading: /* @__PURE__ */ (0,
|
|
21892
|
-
children: ({ item: account }) => /* @__PURE__ */ (0,
|
|
21945
|
+
Loading: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Loader2, {}),
|
|
21946
|
+
children: ({ item: account }) => /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(BasicLinkedAccountContainer, { isSelected: true, children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(BasicLinkedAccountContent, { account }) }, account.id)
|
|
21893
21947
|
}
|
|
21894
21948
|
),
|
|
21895
|
-
effectiveAccounts.length > 0 ? /* @__PURE__ */ (0,
|
|
21896
|
-
|
|
21897
|
-
|
|
21949
|
+
effectiveAccounts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(import_jsx_runtime232.Fragment, { children: [
|
|
21950
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Separator, { mbs: "lg", mbe: "lg" }),
|
|
21951
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(HStack, { justify: "start", gap: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Button, { onClick: () => {
|
|
21952
|
+
void next();
|
|
21953
|
+
}, rightIcon: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(ChevronRight_default, {}), children: "I\u2019m done linking my banks" }) })
|
|
21954
|
+
] }) : null
|
|
21898
21955
|
] });
|
|
21899
21956
|
}
|
|
21900
21957
|
|
|
21901
21958
|
// src/components/PlatformOnboarding/LinkAccounts.tsx
|
|
21902
|
-
var
|
|
21959
|
+
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
21903
21960
|
function LinkAccounts(props) {
|
|
21904
|
-
return /* @__PURE__ */ (0,
|
|
21961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(LinkedAccountsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(LinkAccountsContent, __spreadValues({}, props)) });
|
|
21905
21962
|
}
|
|
21906
21963
|
function LinkAccountsContent({
|
|
21907
21964
|
onComplete
|
|
@@ -21909,72 +21966,1139 @@ function LinkAccountsContent({
|
|
|
21909
21966
|
const { data: linkedAccounts, loadingStatus } = (0, import_react138.useContext)(LinkedAccountsContext);
|
|
21910
21967
|
const linkedAccountsNeedingConfirmation = linkedAccounts ? getAccountsNeedingConfirmation(linkedAccounts) : [];
|
|
21911
21968
|
const hideConfirmationStep = loadingStatus === "complete" && linkedAccountsNeedingConfirmation.length === 0;
|
|
21912
|
-
return /* @__PURE__ */ (0,
|
|
21969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)("section", { className: "Layer__link-accounts Layer__component", children: /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)(
|
|
21913
21970
|
Wizard,
|
|
21914
21971
|
{
|
|
21915
|
-
Header: /* @__PURE__ */ (0,
|
|
21972
|
+
Header: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(Heading2, { children: "Link your bank accounts and credit cards" }),
|
|
21916
21973
|
Footer: null,
|
|
21917
21974
|
onComplete,
|
|
21918
21975
|
children: [
|
|
21919
|
-
/* @__PURE__ */ (0,
|
|
21920
|
-
hideConfirmationStep ? null : /* @__PURE__ */ (0,
|
|
21976
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(LinkAccountsLinkStep, {}),
|
|
21977
|
+
hideConfirmationStep ? null : /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(LinkAccountsConfirmationStep, {})
|
|
21921
21978
|
]
|
|
21922
21979
|
}
|
|
21923
21980
|
) });
|
|
21924
21981
|
}
|
|
21925
21982
|
|
|
21926
|
-
// src/
|
|
21927
|
-
var
|
|
21928
|
-
|
|
21929
|
-
|
|
21930
|
-
|
|
21983
|
+
// src/components/PlatformOnboarding/PlatformOnboarding.tsx
|
|
21984
|
+
var import_react140 = require("react");
|
|
21985
|
+
|
|
21986
|
+
// src/components/ProgressSteps/ProgressSteps.tsx
|
|
21987
|
+
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
21988
|
+
var ProgressSteps = ({ steps, currentStep }) => {
|
|
21989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)("div", { className: "Layer__progress-steps", children: steps.map((step, index) => {
|
|
21990
|
+
const dataProperties = toDataProperties({ active: index <= currentStep, complete: currentStep > index });
|
|
21991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
21992
|
+
"div",
|
|
21993
|
+
{
|
|
21994
|
+
className: "Layer__progress-steps--step-wrapper",
|
|
21995
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", __spreadProps(__spreadValues({ className: "Layer__progress-steps--step" }, dataProperties), { children: [
|
|
21996
|
+
index < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime234.jsx)("div", { className: "Layer__progress-steps--step-line" }),
|
|
21997
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("div", { className: "Layer__progress-steps--circle", children: index < currentStep && /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Check_default, { size: 10 }) }),
|
|
21998
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("div", { className: "Layer__progress-steps--label", children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Text, { size: "sm" /* sm */, children: step }) })
|
|
21999
|
+
] }))
|
|
22000
|
+
},
|
|
22001
|
+
index
|
|
22002
|
+
);
|
|
22003
|
+
}) });
|
|
22004
|
+
};
|
|
22005
|
+
|
|
22006
|
+
// src/icons/Document.tsx
|
|
22007
|
+
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
22008
|
+
var Document = (_a) => {
|
|
22009
|
+
var _b = _a, { size = 20 } = _b, props = __objRest(_b, ["size"]);
|
|
22010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(
|
|
21931
22011
|
"svg",
|
|
21932
22012
|
__spreadProps(__spreadValues({
|
|
21933
22013
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21934
|
-
viewBox: "0 0
|
|
22014
|
+
viewBox: "0 0 20 20",
|
|
21935
22015
|
fill: "none"
|
|
21936
22016
|
}, props), {
|
|
21937
22017
|
width: size,
|
|
21938
22018
|
height: size,
|
|
21939
22019
|
children: [
|
|
21940
|
-
/* @__PURE__ */ (0,
|
|
21941
|
-
|
|
21942
|
-
|
|
21943
|
-
|
|
21944
|
-
|
|
21945
|
-
|
|
21946
|
-
|
|
21947
|
-
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
|
|
21953
|
-
|
|
21954
|
-
|
|
21955
|
-
|
|
21956
|
-
|
|
21957
|
-
|
|
21958
|
-
|
|
21959
|
-
|
|
21960
|
-
|
|
21961
|
-
|
|
21962
|
-
|
|
21963
|
-
|
|
21964
|
-
|
|
21965
|
-
|
|
21966
|
-
|
|
21967
|
-
|
|
21968
|
-
|
|
21969
|
-
|
|
21970
|
-
|
|
21971
|
-
|
|
21972
|
-
|
|
21973
|
-
|
|
21974
|
-
|
|
22020
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
22021
|
+
"path",
|
|
22022
|
+
{
|
|
22023
|
+
d: "M11.6667 1.66666H5.00004C4.55801 1.66666 4.13409 1.84226 3.82153 2.15482C3.50897 2.46738 3.33337 2.8913 3.33337 3.33333V16.6667C3.33337 17.1087 3.50897 17.5326 3.82153 17.8452C4.13409 18.1577 4.55801 18.3333 5.00004 18.3333H15C15.4421 18.3333 15.866 18.1577 16.1786 17.8452C16.4911 17.5326 16.6667 17.1087 16.6667 16.6667V6.66666L11.6667 1.66666Z",
|
|
22024
|
+
stroke: "white",
|
|
22025
|
+
strokeLinecap: "round",
|
|
22026
|
+
strokeLinejoin: "round"
|
|
22027
|
+
}
|
|
22028
|
+
),
|
|
22029
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
22030
|
+
"path",
|
|
22031
|
+
{
|
|
22032
|
+
d: "M11.6667 1.66666H5.00004C4.55801 1.66666 4.13409 1.84226 3.82153 2.15482C3.50897 2.46738 3.33337 2.8913 3.33337 3.33333V16.6667C3.33337 17.1087 3.50897 17.5326 3.82153 17.8452C4.13409 18.1577 4.55801 18.3333 5.00004 18.3333H15C15.4421 18.3333 15.866 18.1577 16.1786 17.8452C16.4911 17.5326 16.6667 17.1087 16.6667 16.6667V6.66666L11.6667 1.66666Z",
|
|
22033
|
+
stroke: "currentColor",
|
|
22034
|
+
strokeLinecap: "round",
|
|
22035
|
+
strokeLinejoin: "round"
|
|
22036
|
+
}
|
|
22037
|
+
),
|
|
22038
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
22039
|
+
"path",
|
|
22040
|
+
{
|
|
22041
|
+
d: "M11.6666 1.66666V6.66666H16.6666",
|
|
22042
|
+
stroke: "white",
|
|
22043
|
+
strokeLinecap: "round",
|
|
22044
|
+
strokeLinejoin: "round"
|
|
22045
|
+
}
|
|
22046
|
+
),
|
|
22047
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
22048
|
+
"path",
|
|
22049
|
+
{
|
|
22050
|
+
d: "M11.6666 1.66666V6.66666H16.6666",
|
|
22051
|
+
stroke: "currentColor",
|
|
22052
|
+
strokeLinecap: "round",
|
|
22053
|
+
strokeLinejoin: "round"
|
|
22054
|
+
}
|
|
22055
|
+
),
|
|
22056
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
22057
|
+
"path",
|
|
22058
|
+
{
|
|
22059
|
+
d: "M13.3333 10.8333H6.66663",
|
|
22060
|
+
stroke: "white",
|
|
22061
|
+
strokeLinecap: "round",
|
|
22062
|
+
strokeLinejoin: "round"
|
|
22063
|
+
}
|
|
22064
|
+
),
|
|
22065
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
22066
|
+
"path",
|
|
22067
|
+
{
|
|
22068
|
+
d: "M13.3333 10.8333H6.66663",
|
|
22069
|
+
stroke: "currentColor",
|
|
22070
|
+
strokeLinecap: "round",
|
|
22071
|
+
strokeLinejoin: "round"
|
|
22072
|
+
}
|
|
22073
|
+
),
|
|
22074
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
22075
|
+
"path",
|
|
22076
|
+
{
|
|
22077
|
+
d: "M13.3333 14.1667H6.66663",
|
|
22078
|
+
stroke: "white",
|
|
22079
|
+
strokeLinecap: "round",
|
|
22080
|
+
strokeLinejoin: "round"
|
|
22081
|
+
}
|
|
22082
|
+
),
|
|
22083
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
22084
|
+
"path",
|
|
22085
|
+
{
|
|
22086
|
+
d: "M13.3333 14.1667H6.66663",
|
|
22087
|
+
stroke: "currentColor",
|
|
22088
|
+
strokeLinecap: "round",
|
|
22089
|
+
strokeLinejoin: "round"
|
|
22090
|
+
}
|
|
22091
|
+
),
|
|
22092
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
22093
|
+
"path",
|
|
22094
|
+
{
|
|
22095
|
+
d: "M8.33329 7.5H7.49996H6.66663",
|
|
22096
|
+
stroke: "white",
|
|
22097
|
+
strokeLinecap: "round",
|
|
22098
|
+
strokeLinejoin: "round"
|
|
22099
|
+
}
|
|
22100
|
+
),
|
|
22101
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
22102
|
+
"path",
|
|
22103
|
+
{
|
|
22104
|
+
d: "M8.33329 7.5H7.49996H6.66663",
|
|
22105
|
+
stroke: "currentColor",
|
|
22106
|
+
strokeLinecap: "round",
|
|
22107
|
+
strokeLinejoin: "round"
|
|
22108
|
+
}
|
|
22109
|
+
)
|
|
22110
|
+
]
|
|
22111
|
+
})
|
|
22112
|
+
);
|
|
22113
|
+
};
|
|
22114
|
+
var Document_default = Document;
|
|
22115
|
+
|
|
22116
|
+
// src/icons/TrendingUp.tsx
|
|
22117
|
+
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
22118
|
+
var TrendingUp = (_a) => {
|
|
22119
|
+
var _b = _a, { size = 20 } = _b, props = __objRest(_b, ["size"]);
|
|
22120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(
|
|
22121
|
+
"svg",
|
|
22122
|
+
__spreadProps(__spreadValues({
|
|
22123
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22124
|
+
viewBox: "0 0 20 20",
|
|
22125
|
+
fill: "none"
|
|
22126
|
+
}, props), {
|
|
22127
|
+
width: size,
|
|
22128
|
+
height: size,
|
|
22129
|
+
children: [
|
|
22130
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
22131
|
+
"path",
|
|
22132
|
+
{
|
|
22133
|
+
d: "M19.1667 5L11.25 12.9167L7.08337 8.75L0.833374 15",
|
|
22134
|
+
stroke: "white",
|
|
22135
|
+
strokeLinecap: "round",
|
|
22136
|
+
strokeLinejoin: "round"
|
|
22137
|
+
}
|
|
22138
|
+
),
|
|
22139
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
22140
|
+
"path",
|
|
22141
|
+
{
|
|
22142
|
+
d: "M19.1667 5L11.25 12.9167L7.08337 8.75L0.833374 15",
|
|
22143
|
+
stroke: "currentColor",
|
|
22144
|
+
strokeLinecap: "round",
|
|
22145
|
+
strokeLinejoin: "round"
|
|
22146
|
+
}
|
|
22147
|
+
),
|
|
22148
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
22149
|
+
"path",
|
|
22150
|
+
{
|
|
22151
|
+
d: "M14.1666 5H19.1666V10",
|
|
22152
|
+
stroke: "white",
|
|
22153
|
+
strokeLinecap: "round",
|
|
22154
|
+
strokeLinejoin: "round"
|
|
22155
|
+
}
|
|
22156
|
+
),
|
|
22157
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
22158
|
+
"path",
|
|
22159
|
+
{
|
|
22160
|
+
d: "M14.1666 5H19.1666V10",
|
|
22161
|
+
stroke: "currentColor",
|
|
22162
|
+
strokeLinecap: "round",
|
|
22163
|
+
strokeLinejoin: "round"
|
|
22164
|
+
}
|
|
22165
|
+
)
|
|
22166
|
+
]
|
|
22167
|
+
})
|
|
22168
|
+
);
|
|
22169
|
+
};
|
|
22170
|
+
var TrendingUp_default = TrendingUp;
|
|
22171
|
+
|
|
22172
|
+
// src/components/PlatformOnboarding/Steps/WelcomeStep.tsx
|
|
22173
|
+
var import_jsx_runtime237 = require("react/jsx-runtime");
|
|
22174
|
+
var defaultTitle = "Welcome";
|
|
22175
|
+
var defaultDescription = "Welcome to the platform onboarding process";
|
|
22176
|
+
var WelcomeStep = ({ onNext, title = defaultTitle, description, stepsEnabled }) => {
|
|
22177
|
+
const buildDescription = () => {
|
|
22178
|
+
if (description) {
|
|
22179
|
+
return description;
|
|
22180
|
+
}
|
|
22181
|
+
if (stepsEnabled) {
|
|
22182
|
+
let text = "In this flow we\u2019ll ";
|
|
22183
|
+
if (stepsEnabled.includes("business-info")) {
|
|
22184
|
+
text += "confirm your business information, ";
|
|
22185
|
+
}
|
|
22186
|
+
if (stepsEnabled.includes("link-accounts")) {
|
|
22187
|
+
text += "connect your financial accounts, ";
|
|
22188
|
+
}
|
|
22189
|
+
text += "and start managing your books like a pro.";
|
|
22190
|
+
return text;
|
|
22191
|
+
}
|
|
22192
|
+
return defaultDescription;
|
|
22193
|
+
};
|
|
22194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(import_jsx_runtime237.Fragment, { children: [
|
|
22195
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome", children: [
|
|
22196
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { className: "Layer__platform-onboarding__heading", align: "left", children: title }),
|
|
22197
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { status: "disabled", children: buildDescription() })
|
|
22198
|
+
] }),
|
|
22199
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Button, { onClick: onNext, children: "Get started" })
|
|
22200
|
+
] });
|
|
22201
|
+
};
|
|
22202
|
+
var WelcomeStepFooter = () => {
|
|
22203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer", children: [
|
|
22204
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer__content", children: [
|
|
22205
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer__header", children: [
|
|
22206
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { align: "left", children: "How it works" }),
|
|
22207
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { status: "disabled", children: "Discover how seamless accounting can transform your business." })
|
|
22208
|
+
] }),
|
|
22209
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(VStack, { gap: "lg", children: [
|
|
22210
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(VStack, { gap: "xs", children: [
|
|
22211
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(HStack, { gap: "xs", children: [
|
|
22212
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(TrendingUp_default, {}),
|
|
22213
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { size: "secondary" /* secondary */, children: "Understand your business health" })
|
|
22214
|
+
] }),
|
|
22215
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { status: "disabled", children: "Get an accurate picture of your financial performance and insight into how to grow your profit." })
|
|
22216
|
+
] }),
|
|
22217
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(VStack, { gap: "xs", children: [
|
|
22218
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(HStack, { gap: "xs", children: [
|
|
22219
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Document_default, {}),
|
|
22220
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { size: "secondary" /* secondary */, children: "Be ready for tax time" })
|
|
22221
|
+
] }),
|
|
22222
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { status: "disabled", children: "Keep your business finances organized to avoid paying more taxes than needed or IRS fines at tax time." })
|
|
22223
|
+
] })
|
|
22224
|
+
] })
|
|
22225
|
+
] }),
|
|
22226
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer__images", children: [
|
|
22227
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer__image", children: [
|
|
22228
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)("div", { className: "Layer__platform__onboarding__welcome-footer__image-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(
|
|
22229
|
+
"img",
|
|
22230
|
+
{
|
|
22231
|
+
src: "https://layer-public.s3.us-west-2.amazonaws.com/site-images/linked-accounts.png",
|
|
22232
|
+
alt: "Connect your accounts"
|
|
22233
|
+
}
|
|
22234
|
+
) }),
|
|
22235
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform__onboarding__welcome-footer__image-text", children: [
|
|
22236
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { size: "secondary" /* secondary */, children: "Connect your accounts" }),
|
|
22237
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { as: "p", children: "Connect your bank accounts and credit cards to see a complete picture of your business finances." })
|
|
22238
|
+
] })
|
|
22239
|
+
] }),
|
|
22240
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer__image", children: [
|
|
22241
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)("div", { className: "Layer__platform__onboarding__welcome-footer__image-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(
|
|
22242
|
+
"img",
|
|
22243
|
+
{
|
|
22244
|
+
src: "https://layer-public.s3.us-west-2.amazonaws.com/site-images/bookkeeping-tasks.png",
|
|
22245
|
+
alt: "Bookkeeping tasks"
|
|
22246
|
+
}
|
|
22247
|
+
) }),
|
|
22248
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform__onboarding__welcome-footer__image-text", children: [
|
|
22249
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { size: "secondary" /* secondary */, children: "Ongoing monthly bookkeeping" }),
|
|
22250
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { as: "p", children: "Receive a monthly report of your financial performance to review with your PSM." })
|
|
22251
|
+
] })
|
|
22252
|
+
] }),
|
|
22253
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer__image", children: [
|
|
22254
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)("div", { className: "Layer__platform__onboarding__welcome-footer__image-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(
|
|
22255
|
+
"img",
|
|
22256
|
+
{
|
|
22257
|
+
src: "https://layer-public.s3.us-west-2.amazonaws.com/site-images/revenue.png",
|
|
22258
|
+
alt: "Profitability"
|
|
22259
|
+
}
|
|
22260
|
+
) }),
|
|
22261
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform__onboarding__welcome-footer__image-text", children: [
|
|
22262
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { size: "secondary" /* secondary */, children: "See your profitability" }),
|
|
22263
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { as: "p", children: "Our bookkeeping team organized and categorizes your business transactions." })
|
|
22264
|
+
] })
|
|
22265
|
+
] })
|
|
22266
|
+
] })
|
|
22267
|
+
] });
|
|
22268
|
+
};
|
|
22269
|
+
|
|
22270
|
+
// src/components/PlatformOnboarding/Steps/SummaryStep.tsx
|
|
22271
|
+
var import_jsx_runtime238 = require("react/jsx-runtime");
|
|
22272
|
+
var defaultTitle2 = "You\u2019re all set!";
|
|
22273
|
+
var defaultDescription2 = "We\u2019re syncing your accounts. This process may take a while to complete.";
|
|
22274
|
+
var defaultNextBtnText = "Go to dashboard";
|
|
22275
|
+
var SummaryStep = ({ onNext, title = defaultTitle2, description = defaultDescription2, nextBtnText = defaultNextBtnText }) => {
|
|
22276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(import_jsx_runtime238.Fragment, { children: [
|
|
22277
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsxs)("div", { className: "Layer__platform-onboarding__summary", children: [
|
|
22278
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Heading, { className: "Layer__platform-onboarding__heading", align: "left", children: title }),
|
|
22279
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Text, { status: "disabled", children: description })
|
|
22280
|
+
] }),
|
|
22281
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Button, { onClick: onNext, children: nextBtnText })
|
|
22282
|
+
] });
|
|
22283
|
+
};
|
|
22284
|
+
|
|
22285
|
+
// src/utils/form.ts
|
|
22286
|
+
var notEmpty = (value) => {
|
|
22287
|
+
if (!value) {
|
|
22288
|
+
return false;
|
|
22289
|
+
}
|
|
22290
|
+
return value.trim().length > 0;
|
|
22291
|
+
};
|
|
22292
|
+
var validateEmailFormat = (email, required = false) => {
|
|
22293
|
+
if (!email) {
|
|
22294
|
+
return !required;
|
|
22295
|
+
}
|
|
22296
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
|
22297
|
+
};
|
|
22298
|
+
|
|
22299
|
+
// src/components/BusinessForm/useBusinessForm.ts
|
|
22300
|
+
var import_react_form2 = require("@tanstack/react-form");
|
|
22301
|
+
|
|
22302
|
+
// src/hooks/businessPersonnel/useBusinessPersonnel.ts
|
|
22303
|
+
var import_swr16 = __toESM(require("swr"));
|
|
22304
|
+
|
|
22305
|
+
// src/utils/array/readonlyTransformations.ts
|
|
22306
|
+
function mapReadonly(array, callbackFn) {
|
|
22307
|
+
return array.map(callbackFn);
|
|
22308
|
+
}
|
|
22309
|
+
function filterReadonly(array, predicate) {
|
|
22310
|
+
return array.filter(predicate);
|
|
22311
|
+
}
|
|
22312
|
+
|
|
22313
|
+
// src/hooks/businessPersonnel/types.ts
|
|
22314
|
+
var PERSONNEL_ROLES = ["ACCOUNTANT", "ADMINISTRATOR", "OWNER"];
|
|
22315
|
+
function isPersonnelRole(role) {
|
|
22316
|
+
return PERSONNEL_ROLES.includes(role);
|
|
22317
|
+
}
|
|
22318
|
+
|
|
22319
|
+
// src/hooks/businessPersonnel/useBusinessPersonnel.ts
|
|
22320
|
+
var BUSINESS_PERSONNEL_TAG_KEY = "#business-personnel";
|
|
22321
|
+
function buildKey13({
|
|
22322
|
+
access_token: accessToken,
|
|
22323
|
+
apiUrl,
|
|
22324
|
+
businessId
|
|
22325
|
+
}) {
|
|
22326
|
+
if (accessToken && apiUrl) {
|
|
22327
|
+
return {
|
|
22328
|
+
accessToken,
|
|
22329
|
+
apiUrl,
|
|
22330
|
+
businessId,
|
|
22331
|
+
tags: [BUSINESS_PERSONNEL_TAG_KEY]
|
|
22332
|
+
};
|
|
22333
|
+
}
|
|
22334
|
+
}
|
|
22335
|
+
var getBusinessPersonnel = get(({ businessId }) => `/v1/businesses/${businessId}/personnel`);
|
|
22336
|
+
function useBusinessPersonnel() {
|
|
22337
|
+
const { data } = useAuth();
|
|
22338
|
+
const { businessId } = useLayerContext();
|
|
22339
|
+
return (0, import_swr16.default)(
|
|
22340
|
+
() => buildKey13(__spreadProps(__spreadValues({}, data), {
|
|
22341
|
+
businessId
|
|
22342
|
+
})),
|
|
22343
|
+
({ accessToken, apiUrl, businessId: businessId2 }) => getBusinessPersonnel(
|
|
22344
|
+
apiUrl,
|
|
22345
|
+
accessToken,
|
|
22346
|
+
{
|
|
22347
|
+
params: { businessId: businessId2 }
|
|
22348
|
+
}
|
|
22349
|
+
)().then(({ data: data2 }) => data2.map(({
|
|
22350
|
+
id,
|
|
22351
|
+
full_name: fullName,
|
|
22352
|
+
preferred_name: preferredName,
|
|
22353
|
+
external_id: externalId,
|
|
22354
|
+
email_addresses,
|
|
22355
|
+
phone_numbers,
|
|
22356
|
+
roles
|
|
22357
|
+
}) => ({
|
|
22358
|
+
id,
|
|
22359
|
+
fullName,
|
|
22360
|
+
preferredName,
|
|
22361
|
+
externalId,
|
|
22362
|
+
emailAddresses: mapReadonly(
|
|
22363
|
+
email_addresses,
|
|
22364
|
+
({ id: id2, email_address: emailAddress }) => ({ id: id2, emailAddress })
|
|
22365
|
+
),
|
|
22366
|
+
phoneNumbers: mapReadonly(
|
|
22367
|
+
phone_numbers,
|
|
22368
|
+
({ id: id2, phone_number: phoneNumber }) => ({ id: id2, phoneNumber })
|
|
22369
|
+
),
|
|
22370
|
+
roles: filterReadonly(
|
|
22371
|
+
roles,
|
|
22372
|
+
(roleEntity) => isPersonnelRole(roleEntity.role)
|
|
22373
|
+
)
|
|
22374
|
+
})))
|
|
22375
|
+
);
|
|
22376
|
+
}
|
|
22377
|
+
|
|
22378
|
+
// src/hooks/businessPersonnel/useCreateBusinessPersonnel.ts
|
|
22379
|
+
var import_mutation7 = __toESM(require("swr/mutation"));
|
|
22380
|
+
var import_swr17 = require("swr");
|
|
22381
|
+
|
|
22382
|
+
// src/utils/swr/withSWRKeyTags.ts
|
|
22383
|
+
function withSWRKeyTags(key, predicate) {
|
|
22384
|
+
if (typeof key !== "object" || key === null || !("tags" in key)) {
|
|
22385
|
+
return false;
|
|
22386
|
+
}
|
|
22387
|
+
return isStringArray(key.tags) ? predicate(key.tags) : false;
|
|
22388
|
+
}
|
|
22389
|
+
|
|
22390
|
+
// src/hooks/businessPersonnel/useCreateBusinessPersonnel.ts
|
|
22391
|
+
var createBusinessPersonnel = post(({ businessId }) => `/v1/businesses/${businessId}/personnel`);
|
|
22392
|
+
function buildKey14({
|
|
22393
|
+
access_token: accessToken,
|
|
22394
|
+
apiUrl,
|
|
22395
|
+
businessId
|
|
22396
|
+
}) {
|
|
22397
|
+
if (accessToken && apiUrl) {
|
|
22398
|
+
return {
|
|
22399
|
+
accessToken,
|
|
22400
|
+
apiUrl,
|
|
22401
|
+
businessId,
|
|
22402
|
+
tags: [`${BUSINESS_PERSONNEL_TAG_KEY}:create`]
|
|
22403
|
+
};
|
|
22404
|
+
}
|
|
22405
|
+
}
|
|
22406
|
+
function useCreateBusinessPersonnel() {
|
|
22407
|
+
const { data } = useAuth();
|
|
22408
|
+
const { businessId } = useLayerContext();
|
|
22409
|
+
const { mutate } = (0, import_swr17.useSWRConfig)();
|
|
22410
|
+
const mutationResponse = (0, import_mutation7.default)(
|
|
22411
|
+
() => buildKey14(__spreadProps(__spreadValues({}, data), {
|
|
22412
|
+
businessId
|
|
22413
|
+
})),
|
|
22414
|
+
({ accessToken, apiUrl, businessId: businessId2 }, { arg: body }) => createBusinessPersonnel(
|
|
22415
|
+
apiUrl,
|
|
22416
|
+
accessToken,
|
|
22417
|
+
{
|
|
22418
|
+
params: { businessId: businessId2 },
|
|
22419
|
+
body
|
|
22420
|
+
}
|
|
22421
|
+
).then(({ data: data2 }) => data2),
|
|
22422
|
+
{
|
|
22423
|
+
revalidate: false,
|
|
22424
|
+
throwOnError: false
|
|
22425
|
+
}
|
|
22426
|
+
);
|
|
22427
|
+
const { trigger: originalTrigger } = mutationResponse;
|
|
22428
|
+
return Object.assign(
|
|
22429
|
+
mutationResponse,
|
|
22430
|
+
{
|
|
22431
|
+
trigger: (...triggerParameters) => __async(this, null, function* () {
|
|
22432
|
+
const data2 = yield originalTrigger(...triggerParameters);
|
|
22433
|
+
if (data2) {
|
|
22434
|
+
yield mutate((key) => withSWRKeyTags(key, (tags) => tags.includes(BUSINESS_PERSONNEL_TAG_KEY)));
|
|
22435
|
+
}
|
|
22436
|
+
return data2;
|
|
22437
|
+
})
|
|
22438
|
+
}
|
|
22439
|
+
);
|
|
22440
|
+
}
|
|
22441
|
+
|
|
22442
|
+
// src/hooks/businessPersonnel/useUpdateBusinessPersonnel.ts
|
|
22443
|
+
var import_mutation8 = __toESM(require("swr/mutation"));
|
|
22444
|
+
var import_swr18 = require("swr");
|
|
22445
|
+
|
|
22446
|
+
// src/api/layer/businessPersonnel/updateBusinessPersonnel.ts
|
|
22447
|
+
var updateBusinessPersonnel = post(({ businessId, businessPersonnelId }) => {
|
|
22448
|
+
return `/v1/businesses/${businessId}/personnel/${businessPersonnelId}/update`;
|
|
22449
|
+
});
|
|
22450
|
+
|
|
22451
|
+
// src/hooks/businessPersonnel/useUpdateBusinessPersonnel.ts
|
|
22452
|
+
function buildKey15({
|
|
22453
|
+
access_token: accessToken,
|
|
22454
|
+
apiUrl,
|
|
22455
|
+
businessId,
|
|
22456
|
+
businessPersonnelId
|
|
22457
|
+
}) {
|
|
22458
|
+
if (accessToken && apiUrl && businessPersonnelId) {
|
|
22459
|
+
return {
|
|
22460
|
+
accessToken,
|
|
22461
|
+
apiUrl,
|
|
22462
|
+
businessId,
|
|
22463
|
+
businessPersonnelId,
|
|
22464
|
+
tags: [`${BUSINESS_PERSONNEL_TAG_KEY}:${businessPersonnelId}`]
|
|
22465
|
+
};
|
|
22466
|
+
}
|
|
22467
|
+
}
|
|
22468
|
+
function useUpdateBusinessPersonnel({ businessPersonnelId }) {
|
|
22469
|
+
const { data } = useAuth();
|
|
22470
|
+
const { businessId } = useLayerContext();
|
|
22471
|
+
const { mutate } = (0, import_swr18.useSWRConfig)();
|
|
22472
|
+
const mutationResponse = (0, import_mutation8.default)(
|
|
22473
|
+
() => buildKey15(__spreadProps(__spreadValues({}, data), {
|
|
22474
|
+
businessId,
|
|
22475
|
+
businessPersonnelId
|
|
22476
|
+
})),
|
|
22477
|
+
({ accessToken, apiUrl, businessId: businessId2, businessPersonnelId: businessPersonnelId2 }, { arg: body }) => updateBusinessPersonnel(
|
|
22478
|
+
apiUrl,
|
|
22479
|
+
accessToken,
|
|
22480
|
+
{
|
|
22481
|
+
params: {
|
|
22482
|
+
businessId: businessId2,
|
|
22483
|
+
businessPersonnelId: businessPersonnelId2
|
|
22484
|
+
},
|
|
22485
|
+
body
|
|
22486
|
+
}
|
|
22487
|
+
).then(({ data: data2 }) => data2),
|
|
22488
|
+
{
|
|
22489
|
+
revalidate: false,
|
|
22490
|
+
throwOnError: false
|
|
22491
|
+
}
|
|
22492
|
+
);
|
|
22493
|
+
const { trigger: originalTrigger } = mutationResponse;
|
|
22494
|
+
return Object.assign(
|
|
22495
|
+
mutationResponse,
|
|
22496
|
+
{
|
|
22497
|
+
trigger: (...triggerParameters) => __async(this, null, function* () {
|
|
22498
|
+
const data2 = yield originalTrigger(...triggerParameters);
|
|
22499
|
+
if (data2) {
|
|
22500
|
+
yield mutate((key) => withSWRKeyTags(key, (tags) => tags.includes(BUSINESS_PERSONNEL_TAG_KEY)));
|
|
22501
|
+
}
|
|
22502
|
+
return data2;
|
|
22503
|
+
})
|
|
22504
|
+
}
|
|
22505
|
+
);
|
|
22506
|
+
}
|
|
22507
|
+
|
|
22508
|
+
// src/hooks/business/useUpdateBusiness.ts
|
|
22509
|
+
var import_mutation9 = __toESM(require("swr/mutation"));
|
|
22510
|
+
var import_swr19 = require("swr");
|
|
22511
|
+
var BUSINESS_TAG_KEY = "business";
|
|
22512
|
+
function buildKey16({
|
|
22513
|
+
access_token: accessToken,
|
|
22514
|
+
apiUrl,
|
|
22515
|
+
businessId
|
|
22516
|
+
}) {
|
|
22517
|
+
if (accessToken && apiUrl && businessId) {
|
|
22518
|
+
return {
|
|
22519
|
+
accessToken,
|
|
22520
|
+
apiUrl,
|
|
22521
|
+
businessId,
|
|
22522
|
+
tags: [`${BUSINESS_TAG_KEY}:${businessId}`]
|
|
22523
|
+
};
|
|
22524
|
+
}
|
|
22525
|
+
}
|
|
22526
|
+
function useUpdateBusiness() {
|
|
22527
|
+
const { data } = useAuth();
|
|
22528
|
+
const { businessId } = useLayerContext();
|
|
22529
|
+
const { mutate } = (0, import_swr19.useSWRConfig)();
|
|
22530
|
+
const mutationResponse = (0, import_mutation9.default)(
|
|
22531
|
+
() => buildKey16(__spreadProps(__spreadValues({}, data), {
|
|
22532
|
+
businessId
|
|
22533
|
+
})),
|
|
22534
|
+
({ accessToken, apiUrl, businessId: businessId2 }, { arg: body }) => updateBusiness(
|
|
22535
|
+
apiUrl,
|
|
22536
|
+
accessToken,
|
|
22537
|
+
{
|
|
22538
|
+
params: { businessId: businessId2 },
|
|
22539
|
+
body
|
|
22540
|
+
}
|
|
22541
|
+
).then(({ data: data2 }) => data2),
|
|
22542
|
+
{
|
|
22543
|
+
revalidate: false,
|
|
22544
|
+
throwOnError: false
|
|
22545
|
+
}
|
|
22546
|
+
);
|
|
22547
|
+
const { trigger: originalTrigger } = mutationResponse;
|
|
22548
|
+
return Object.assign(
|
|
22549
|
+
mutationResponse,
|
|
22550
|
+
{
|
|
22551
|
+
trigger: (...triggerParameters) => __async(this, null, function* () {
|
|
22552
|
+
const data2 = yield originalTrigger(...triggerParameters);
|
|
22553
|
+
if (data2) {
|
|
22554
|
+
yield mutate((key) => withSWRKeyTags(key, (tags) => tags.includes(BUSINESS_TAG_KEY)));
|
|
22555
|
+
}
|
|
22556
|
+
return data2;
|
|
22557
|
+
})
|
|
22558
|
+
}
|
|
22559
|
+
);
|
|
22560
|
+
}
|
|
22561
|
+
|
|
22562
|
+
// src/components/BusinessForm/useBusinessForm.ts
|
|
22563
|
+
var import_react139 = require("react");
|
|
22564
|
+
var getPerson = (personnel) => {
|
|
22565
|
+
const owners = personnel == null ? void 0 : personnel.filter((p) => p.roles.find((x) => x.role === "OWNER"));
|
|
22566
|
+
if (owners && owners.length > 0) {
|
|
22567
|
+
return owners[0];
|
|
22568
|
+
}
|
|
22569
|
+
return personnel == null ? void 0 : personnel[0];
|
|
22570
|
+
};
|
|
22571
|
+
var useBusinessForm = ({ onSuccess }) => {
|
|
22572
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
22573
|
+
const { business } = useLayerContext();
|
|
22574
|
+
const [submitError, setSubmitError] = (0, import_react139.useState)(void 0);
|
|
22575
|
+
const { data: personnel } = useBusinessPersonnel();
|
|
22576
|
+
const person = getPerson(personnel);
|
|
22577
|
+
const { trigger: createBusinessPersonnel2 } = useCreateBusinessPersonnel();
|
|
22578
|
+
const { trigger: updateBusinessPersonnel2 } = useUpdateBusinessPersonnel({ businessPersonnelId: person == null ? void 0 : person.id });
|
|
22579
|
+
const { trigger: updateBusiness2 } = useUpdateBusiness();
|
|
22580
|
+
const form = (0, import_react_form2.useForm)({
|
|
22581
|
+
defaultValues: {
|
|
22582
|
+
full_name: (_a = person == null ? void 0 : person.fullName) != null ? _a : void 0,
|
|
22583
|
+
preferred_name: (_b = person == null ? void 0 : person.preferredName) != null ? _b : void 0,
|
|
22584
|
+
phone_number: (_d = (_c = person == null ? void 0 : person.phoneNumbers) == null ? void 0 : _c[0]) == null ? void 0 : _d.phoneNumber,
|
|
22585
|
+
email: (_f = (_e = person == null ? void 0 : person.emailAddresses) == null ? void 0 : _e[0]) == null ? void 0 : _f.emailAddress,
|
|
22586
|
+
legal_name: (_g = business == null ? void 0 : business.legal_name) != null ? _g : void 0,
|
|
22587
|
+
entity_type: (_h = business == null ? void 0 : business.entity_type) != null ? _h : void 0,
|
|
22588
|
+
us_state: (_i = business == null ? void 0 : business.us_state) != null ? _i : void 0,
|
|
22589
|
+
tin: business == null ? void 0 : business.tin
|
|
22590
|
+
},
|
|
22591
|
+
onSubmit: (_0) => __async(void 0, [_0], function* ({ value }) {
|
|
22592
|
+
var _a2;
|
|
22593
|
+
try {
|
|
22594
|
+
setSubmitError(void 0);
|
|
22595
|
+
if (person) {
|
|
22596
|
+
yield updateBusinessPersonnel2({
|
|
22597
|
+
id: person.id,
|
|
22598
|
+
full_name: value.full_name,
|
|
22599
|
+
preferred_name: value.preferred_name,
|
|
22600
|
+
email_addresses: value.email ? [{ email_address: value.email }] : [],
|
|
22601
|
+
phone_numbers: value.phone_number ? [{ phone_number: value.phone_number }] : []
|
|
22602
|
+
});
|
|
22603
|
+
} else {
|
|
22604
|
+
if (value.full_name) {
|
|
22605
|
+
yield createBusinessPersonnel2({
|
|
22606
|
+
full_name: value.full_name,
|
|
22607
|
+
preferred_name: (_a2 = value.preferred_name) != null ? _a2 : null,
|
|
22608
|
+
email_addresses: value.email ? [{ email_address: value.email }] : [],
|
|
22609
|
+
phone_numbers: value.phone_number ? [{ phone_number: value.phone_number }] : [],
|
|
22610
|
+
external_id: null,
|
|
22611
|
+
roles: [{ role: "OWNER" }]
|
|
22612
|
+
});
|
|
22613
|
+
}
|
|
22614
|
+
}
|
|
22615
|
+
yield updateBusiness2({
|
|
22616
|
+
legal_name: value.legal_name,
|
|
22617
|
+
entity_type: value.entity_type,
|
|
22618
|
+
us_state: value.us_state,
|
|
22619
|
+
tin: value.tin
|
|
22620
|
+
});
|
|
22621
|
+
onSuccess == null ? void 0 : onSuccess();
|
|
22622
|
+
} catch (e) {
|
|
22623
|
+
setSubmitError("Something went wrong. Please try again.");
|
|
22624
|
+
}
|
|
22625
|
+
})
|
|
22626
|
+
});
|
|
22627
|
+
const isFormValid = (0, import_react_form2.useStore)(form.store, (state) => state.isValid);
|
|
22628
|
+
return { form, submitError, isFormValid };
|
|
22629
|
+
};
|
|
22630
|
+
|
|
22631
|
+
// src/components/Input/FormSection.tsx
|
|
22632
|
+
var import_jsx_runtime239 = require("react/jsx-runtime");
|
|
22633
|
+
var FormSection = ({ children, title }) => {
|
|
22634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime239.jsxs)(VStack, { className: "Layer__form-section", gap: "sm", children: [
|
|
22635
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
|
|
22636
|
+
Text,
|
|
22637
|
+
{
|
|
22638
|
+
className: "Layer__form-section__title",
|
|
22639
|
+
size: "sm" /* sm */,
|
|
22640
|
+
weight: "bold" /* bold */,
|
|
22641
|
+
children: title
|
|
22642
|
+
}
|
|
22643
|
+
),
|
|
22644
|
+
children
|
|
22645
|
+
] });
|
|
22646
|
+
};
|
|
22647
|
+
|
|
22648
|
+
// src/components/Input/BusinessTypeSelect.tsx
|
|
22649
|
+
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
22650
|
+
var findSelectOption = (options, value) => {
|
|
22651
|
+
if (!value) {
|
|
22652
|
+
return void 0;
|
|
22653
|
+
}
|
|
22654
|
+
return options.find((o) => o.value === value);
|
|
22655
|
+
};
|
|
22656
|
+
var BusinessTypeSelect = ({ value, onChange }) => {
|
|
22657
|
+
const entityTypeOptions = ENTITY_TYPES;
|
|
22658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
22659
|
+
Select,
|
|
22660
|
+
{
|
|
22661
|
+
options: entityTypeOptions,
|
|
22662
|
+
value: findSelectOption(entityTypeOptions, value),
|
|
22663
|
+
onChange: (option) => onChange(option == null ? void 0 : option.value)
|
|
22664
|
+
}
|
|
22665
|
+
);
|
|
22666
|
+
};
|
|
22667
|
+
|
|
22668
|
+
// src/types/location.ts
|
|
22669
|
+
var US_STATES = [
|
|
22670
|
+
{ value: "AL", label: "Alabama" },
|
|
22671
|
+
{ value: "AK", label: "Alaska" },
|
|
22672
|
+
{ value: "AZ", label: "Arizona" },
|
|
22673
|
+
{ value: "AR", label: "Arkansas" },
|
|
22674
|
+
{ value: "CA", label: "California" },
|
|
22675
|
+
{ value: "CO", label: "Colorado" },
|
|
22676
|
+
{ value: "CT", label: "Connecticut" },
|
|
22677
|
+
{ value: "DE", label: "Delaware" },
|
|
22678
|
+
{ value: "DC", label: "District of Columbia" },
|
|
22679
|
+
{ value: "FL", label: "Florida" },
|
|
22680
|
+
{ value: "GA", label: "Georgia" },
|
|
22681
|
+
{ value: "HI", label: "Hawaii" },
|
|
22682
|
+
{ value: "ID", label: "Idaho" },
|
|
22683
|
+
{ value: "IL", label: "Illinois" },
|
|
22684
|
+
{ value: "IN", label: "Indiana" },
|
|
22685
|
+
{ value: "IA", label: "Iowa" },
|
|
22686
|
+
{ value: "KS", label: "Kansas" },
|
|
22687
|
+
{ value: "KY", label: "Kentucky" },
|
|
22688
|
+
{ value: "LA", label: "Louisiana" },
|
|
22689
|
+
{ value: "ME", label: "Maine" },
|
|
22690
|
+
{ value: "MD", label: "Maryland" },
|
|
22691
|
+
{ value: "MA", label: "Massachusetts" },
|
|
22692
|
+
{ value: "MI", label: "Michigan" },
|
|
22693
|
+
{ value: "MN", label: "Minnesota" },
|
|
22694
|
+
{ value: "MS", label: "Mississippi" },
|
|
22695
|
+
{ value: "MO", label: "Missouri" },
|
|
22696
|
+
{ value: "MT", label: "Montana" },
|
|
22697
|
+
{ value: "NE", label: "Nebraska" },
|
|
22698
|
+
{ value: "NV", label: "Nevada" },
|
|
22699
|
+
{ value: "NH", label: "New Hampshire" },
|
|
22700
|
+
{ value: "NJ", label: "New Jersey" },
|
|
22701
|
+
{ value: "NM", label: "New Mexico" },
|
|
22702
|
+
{ value: "NY", label: "New York" },
|
|
22703
|
+
{ value: "NC", label: "North Carolina" },
|
|
22704
|
+
{ value: "ND", label: "North Dakota" },
|
|
22705
|
+
{ value: "OH", label: "Ohio" },
|
|
22706
|
+
{ value: "OK", label: "Oklahoma" },
|
|
22707
|
+
{ value: "OR", label: "Oregon" },
|
|
22708
|
+
{ value: "PA", label: "Pennsylvania" },
|
|
22709
|
+
{ value: "RI", label: "Rhode Island" },
|
|
22710
|
+
{ value: "SC", label: "South Carolina" },
|
|
22711
|
+
{ value: "SD", label: "South Dakota" },
|
|
22712
|
+
{ value: "TN", label: "Tennessee" },
|
|
22713
|
+
{ value: "TX", label: "Texas" },
|
|
22714
|
+
{ value: "UT", label: "Utah" },
|
|
22715
|
+
{ value: "VT", label: "Vermont" },
|
|
22716
|
+
{ value: "VA", label: "Virginia" },
|
|
22717
|
+
{ value: "WA", label: "Washington" },
|
|
22718
|
+
{ value: "WV", label: "West Virginia" },
|
|
22719
|
+
{ value: "WI", label: "Wisconsin" },
|
|
22720
|
+
{ value: "WY", label: "Wyoming" },
|
|
22721
|
+
{ value: "PR", label: "Puerto Rico" }
|
|
22722
|
+
];
|
|
22723
|
+
|
|
22724
|
+
// src/components/Input/USStateSelect.tsx
|
|
22725
|
+
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
22726
|
+
var findSelectOption2 = (options, selected) => {
|
|
22727
|
+
if (!selected) {
|
|
22728
|
+
return void 0;
|
|
22729
|
+
}
|
|
22730
|
+
return options.find(
|
|
22731
|
+
(o) => String(o.value).toLowerCase() === String(selected).toLowerCase() || String(o.label).toLowerCase() === String(selected).toLowerCase()
|
|
22732
|
+
);
|
|
22733
|
+
};
|
|
22734
|
+
var USStateSelect = ({ value, onChange }) => {
|
|
22735
|
+
const usStateOptions = US_STATES.map((state) => ({
|
|
22736
|
+
label: state.label,
|
|
22737
|
+
value: state.value
|
|
22738
|
+
}));
|
|
22739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
22740
|
+
Select,
|
|
22741
|
+
{
|
|
22742
|
+
options: usStateOptions,
|
|
22743
|
+
value: findSelectOption2(usStateOptions, value),
|
|
22744
|
+
onChange: (option) => onChange(option),
|
|
22745
|
+
placeholder: "US state"
|
|
22746
|
+
}
|
|
22747
|
+
);
|
|
22748
|
+
};
|
|
22749
|
+
|
|
22750
|
+
// src/components/Input/PhoneInput.tsx
|
|
22751
|
+
var import_libphonenumber_js = require("libphonenumber-js");
|
|
22752
|
+
var import_jsx_runtime242 = require("react/jsx-runtime");
|
|
22753
|
+
var PhoneInput = (_a) => {
|
|
22754
|
+
var _b = _a, {
|
|
22755
|
+
value,
|
|
22756
|
+
onChange,
|
|
22757
|
+
placeholder = "Phone number"
|
|
22758
|
+
} = _b, props = __objRest(_b, [
|
|
22759
|
+
"value",
|
|
22760
|
+
"onChange",
|
|
22761
|
+
"placeholder"
|
|
22762
|
+
]);
|
|
22763
|
+
const handleChange = (e) => {
|
|
22764
|
+
const input = e.target.value;
|
|
22765
|
+
const formattedNumber = (0, import_libphonenumber_js.formatIncompletePhoneNumber)(input, "US");
|
|
22766
|
+
onChange(formattedNumber != null ? formattedNumber : input);
|
|
22767
|
+
};
|
|
22768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
|
|
22769
|
+
Input,
|
|
22770
|
+
__spreadValues({
|
|
22771
|
+
type: "tel",
|
|
22772
|
+
value: value ? (0, import_libphonenumber_js.formatIncompletePhoneNumber)(value, "US") : void 0,
|
|
22773
|
+
onChange: handleChange,
|
|
22774
|
+
placeholder,
|
|
22775
|
+
"aria-label": "Phone number input"
|
|
22776
|
+
}, props)
|
|
22777
|
+
);
|
|
22778
|
+
};
|
|
22779
|
+
|
|
22780
|
+
// src/components/BusinessForm/BusinessForm.tsx
|
|
22781
|
+
var import_libphonenumber_js2 = require("libphonenumber-js");
|
|
22782
|
+
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
22783
|
+
var BusinessForm2 = ({ stringOverrides, onSuccess }) => {
|
|
22784
|
+
var _a;
|
|
22785
|
+
const { form, submitError, isFormValid } = useBusinessForm({ onSuccess });
|
|
22786
|
+
const { isSubmitting } = form.state;
|
|
22787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(
|
|
22788
|
+
"form",
|
|
22789
|
+
{
|
|
22790
|
+
className: "Layer__form Layer__business-form",
|
|
22791
|
+
onSubmit: (e) => {
|
|
22792
|
+
e.preventDefault();
|
|
22793
|
+
e.stopPropagation();
|
|
22794
|
+
void form.handleSubmit();
|
|
22795
|
+
},
|
|
22796
|
+
children: [
|
|
22797
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(FormSection, { title: "Contact information", children: [
|
|
22798
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsxs)("div", { className: "Layer__business-form__name-fields", children: [
|
|
22799
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22800
|
+
form.Field,
|
|
22801
|
+
{
|
|
22802
|
+
name: "full_name",
|
|
22803
|
+
validators: {
|
|
22804
|
+
onSubmit: ({ value }) => notEmpty(value) ? void 0 : "Full name is required"
|
|
22805
|
+
},
|
|
22806
|
+
children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "full_name", label: "Full name", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22807
|
+
Input,
|
|
22808
|
+
{
|
|
22809
|
+
name: "full_name",
|
|
22810
|
+
placeholder: "John Doe",
|
|
22811
|
+
value: field.state.value,
|
|
22812
|
+
onChange: (e) => field.handleChange(e.target.value),
|
|
22813
|
+
isInvalid: field.state.meta.errors.length > 0,
|
|
22814
|
+
errorMessage: field.state.meta.errors.join(", ")
|
|
22815
|
+
}
|
|
22816
|
+
) }) })
|
|
22817
|
+
}
|
|
22818
|
+
),
|
|
22819
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(form.Field, { name: "preferred_name", children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "preferred_name", label: "Preferred name", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22820
|
+
Input,
|
|
22821
|
+
{
|
|
22822
|
+
name: "preferred_name",
|
|
22823
|
+
placeholder: "John",
|
|
22824
|
+
value: field.state.value,
|
|
22825
|
+
onChange: (e) => field.handleChange(e.target.value)
|
|
22826
|
+
}
|
|
22827
|
+
) }) }) })
|
|
22828
|
+
] }),
|
|
22829
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22830
|
+
form.Field,
|
|
22831
|
+
{
|
|
22832
|
+
name: "email",
|
|
22833
|
+
validators: {
|
|
22834
|
+
onSubmit: ({ value }) => validateEmailFormat(value, true) ? void 0 : "Email is invalid"
|
|
22835
|
+
},
|
|
22836
|
+
children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22837
|
+
InputGroup,
|
|
22838
|
+
{
|
|
22839
|
+
name: "email",
|
|
22840
|
+
label: "What\u2019s the email you want to use for bookkeeping communication?",
|
|
22841
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22842
|
+
Input,
|
|
22843
|
+
{
|
|
22844
|
+
name: "email",
|
|
22845
|
+
placeholder: "john@company.com",
|
|
22846
|
+
value: field.state.value,
|
|
22847
|
+
onChange: (e) => field.handleChange(e.target.value),
|
|
22848
|
+
isInvalid: field.state.meta.errors.length > 0,
|
|
22849
|
+
errorMessage: field.state.meta.errors.join(", ")
|
|
22850
|
+
}
|
|
22851
|
+
)
|
|
22852
|
+
}
|
|
22853
|
+
) })
|
|
22854
|
+
}
|
|
22855
|
+
),
|
|
22856
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22857
|
+
form.Field,
|
|
22858
|
+
{
|
|
22859
|
+
name: "phone_number",
|
|
22860
|
+
validators: {
|
|
22861
|
+
onSubmit: ({ value }) => (0, import_libphonenumber_js2.isPossiblePhoneNumber)(value != null ? value : "", "US") ? void 0 : "Phone number is invalid"
|
|
22862
|
+
},
|
|
22863
|
+
children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22864
|
+
InputGroup,
|
|
22865
|
+
{
|
|
22866
|
+
name: "phone_number",
|
|
22867
|
+
label: "What\u2019s the phone number you want to use for bookkeeping communication?",
|
|
22868
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22869
|
+
PhoneInput,
|
|
22870
|
+
{
|
|
22871
|
+
value: field.state.value,
|
|
22872
|
+
onChange: (value) => field.handleChange(value),
|
|
22873
|
+
isInvalid: field.state.meta.errors.length > 0,
|
|
22874
|
+
errorMessage: field.state.meta.errors.join(", ")
|
|
22875
|
+
}
|
|
22876
|
+
)
|
|
22877
|
+
}
|
|
22878
|
+
) })
|
|
22879
|
+
}
|
|
22880
|
+
)
|
|
22881
|
+
] }),
|
|
22882
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(FormSection, { title: "Business information", children: [
|
|
22883
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22884
|
+
form.Field,
|
|
22885
|
+
{
|
|
22886
|
+
name: "legal_name",
|
|
22887
|
+
validators: {
|
|
22888
|
+
onBlur: ({ value }) => notEmpty(value) ? void 0 : "Company name is required"
|
|
22889
|
+
},
|
|
22890
|
+
children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "legal_name", label: "Company", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22891
|
+
Input,
|
|
22892
|
+
{
|
|
22893
|
+
name: "legal_name",
|
|
22894
|
+
placeholder: "Company",
|
|
22895
|
+
value: field.state.value,
|
|
22896
|
+
onChange: (e) => field.handleChange(e.target.value),
|
|
22897
|
+
isInvalid: field.state.meta.errors.length > 0,
|
|
22898
|
+
errorMessage: field.state.meta.errors.join(", ")
|
|
22899
|
+
}
|
|
22900
|
+
) }) })
|
|
21975
22901
|
}
|
|
21976
22902
|
),
|
|
21977
|
-
/* @__PURE__ */ (0,
|
|
22903
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(form.Field, { name: "dba", children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "dba", label: "DBA (optional)", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22904
|
+
Input,
|
|
22905
|
+
{
|
|
22906
|
+
name: "dba",
|
|
22907
|
+
placeholder: "Alternative name",
|
|
22908
|
+
value: field.state.value,
|
|
22909
|
+
onChange: (e) => field.handleChange(e.target.value),
|
|
22910
|
+
isInvalid: field.state.meta.errors.length > 0,
|
|
22911
|
+
errorMessage: field.state.meta.errors.join(", ")
|
|
22912
|
+
}
|
|
22913
|
+
) }) }) }),
|
|
22914
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(form.Field, { name: "entity_type", children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "entity_type", label: "Entity type", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22915
|
+
BusinessTypeSelect,
|
|
22916
|
+
{
|
|
22917
|
+
value: field.state.value,
|
|
22918
|
+
onChange: (value) => field.handleChange(value)
|
|
22919
|
+
}
|
|
22920
|
+
) }) }) }),
|
|
22921
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsxs)("div", { className: "Layer__business-form__state-tin-fields", children: [
|
|
22922
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(form.Field, { name: "us_state", children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "us_state", label: "State", className: "Layer__business-form__state", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22923
|
+
USStateSelect,
|
|
22924
|
+
{
|
|
22925
|
+
value: field.state.value,
|
|
22926
|
+
onChange: (option) => field.handleChange(option.value)
|
|
22927
|
+
}
|
|
22928
|
+
) }) }) }),
|
|
22929
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(form.Field, { name: "tin", children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "tin", label: "Tax ID number (optional)", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22930
|
+
Input,
|
|
22931
|
+
{
|
|
22932
|
+
name: "tin",
|
|
22933
|
+
placeholder: "Tax ID number",
|
|
22934
|
+
value: field.state.value,
|
|
22935
|
+
onChange: (e) => field.handleChange(e.target.value),
|
|
22936
|
+
isInvalid: field.state.meta.errors.length > 0,
|
|
22937
|
+
errorMessage: field.state.meta.errors.join(", ")
|
|
22938
|
+
}
|
|
22939
|
+
) }) }) })
|
|
22940
|
+
] })
|
|
22941
|
+
] }),
|
|
22942
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
22943
|
+
SubmitButton,
|
|
22944
|
+
{
|
|
22945
|
+
type: "submit",
|
|
22946
|
+
processing: isSubmitting,
|
|
22947
|
+
noIcon: true,
|
|
22948
|
+
withRetry: true,
|
|
22949
|
+
error: submitError,
|
|
22950
|
+
children: (_a = stringOverrides == null ? void 0 : stringOverrides.saveButton) != null ? _a : "Save"
|
|
22951
|
+
}
|
|
22952
|
+
),
|
|
22953
|
+
!isFormValid && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(ErrorText, { pb: "xs", children: "Please check all fields." })
|
|
22954
|
+
]
|
|
22955
|
+
}
|
|
22956
|
+
);
|
|
22957
|
+
};
|
|
22958
|
+
|
|
22959
|
+
// src/components/PlatformOnboarding/Steps/BusinessInfoStep.tsx
|
|
22960
|
+
var import_jsx_runtime244 = require("react/jsx-runtime");
|
|
22961
|
+
var defaultTitle3 = "We\u2019ll use this information to contact you whenever we have questions on your books.";
|
|
22962
|
+
var BusinessInfoStep = ({ title = defaultTitle3, onNext }) => {
|
|
22963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(import_jsx_runtime244.Fragment, { children: [
|
|
22964
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsx)(Heading2, { children: title }),
|
|
22965
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsx)(BusinessForm2, { onSuccess: onNext })
|
|
22966
|
+
] });
|
|
22967
|
+
};
|
|
22968
|
+
|
|
22969
|
+
// src/components/PlatformOnboarding/PlatformOnboarding.tsx
|
|
22970
|
+
var import_jsx_runtime245 = require("react/jsx-runtime");
|
|
22971
|
+
var PLATFORM_ONBOARDING_STEPS = [
|
|
22972
|
+
{
|
|
22973
|
+
id: "welcome",
|
|
22974
|
+
label: "Get started"
|
|
22975
|
+
},
|
|
22976
|
+
{
|
|
22977
|
+
id: "business-info",
|
|
22978
|
+
label: "Confirm your informations"
|
|
22979
|
+
},
|
|
22980
|
+
{
|
|
22981
|
+
id: "link-accounts",
|
|
22982
|
+
label: "Connect accounts"
|
|
22983
|
+
},
|
|
22984
|
+
{
|
|
22985
|
+
id: "summary",
|
|
22986
|
+
label: "Summary"
|
|
22987
|
+
}
|
|
22988
|
+
];
|
|
22989
|
+
var PlatformOnboarding = ({ onComplete }) => {
|
|
22990
|
+
const [step, setStep] = (0, import_react140.useState)(PLATFORM_ONBOARDING_STEPS[0].id);
|
|
22991
|
+
const isFirstStep = PLATFORM_ONBOARDING_STEPS[0].id === step;
|
|
22992
|
+
const nextStep = () => {
|
|
22993
|
+
const currentStepIndex = PLATFORM_ONBOARDING_STEPS.findIndex((s) => s.id === step);
|
|
22994
|
+
if (currentStepIndex === PLATFORM_ONBOARDING_STEPS.length - 1) {
|
|
22995
|
+
onComplete == null ? void 0 : onComplete();
|
|
22996
|
+
return;
|
|
22997
|
+
}
|
|
22998
|
+
const nextStep2 = PLATFORM_ONBOARDING_STEPS[currentStepIndex + 1];
|
|
22999
|
+
if (nextStep2) {
|
|
23000
|
+
setStep(nextStep2.id);
|
|
23001
|
+
}
|
|
23002
|
+
};
|
|
23003
|
+
const previousStep = () => {
|
|
23004
|
+
const currentStepIndex = PLATFORM_ONBOARDING_STEPS.findIndex((s) => s.id === step);
|
|
23005
|
+
const previousStep2 = PLATFORM_ONBOARDING_STEPS[currentStepIndex - 1];
|
|
23006
|
+
if (previousStep2) {
|
|
23007
|
+
setStep(previousStep2.id);
|
|
23008
|
+
}
|
|
23009
|
+
};
|
|
23010
|
+
const renderStepContent = () => {
|
|
23011
|
+
switch (step) {
|
|
23012
|
+
case "welcome":
|
|
23013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(WelcomeStep, { onNext: nextStep, stepsEnabled: PLATFORM_ONBOARDING_STEPS.map((s) => s.id) });
|
|
23014
|
+
case "business-info":
|
|
23015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(BusinessInfoStep, { onNext: nextStep });
|
|
23016
|
+
case "link-accounts":
|
|
23017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(LinkAccounts, { onComplete: nextStep });
|
|
23018
|
+
case "summary":
|
|
23019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(SummaryStep, { onNext: nextStep });
|
|
23020
|
+
}
|
|
23021
|
+
};
|
|
23022
|
+
const renderStepFooter = () => {
|
|
23023
|
+
if (step === "welcome") {
|
|
23024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(WelcomeStepFooter, {});
|
|
23025
|
+
}
|
|
23026
|
+
};
|
|
23027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)("div", { className: "Layer__component Layer__platform-onboarding", children: /* @__PURE__ */ (0, import_jsx_runtime245.jsxs)("div", { className: "Layer__platform-onboarding-layout", children: [
|
|
23028
|
+
!isFirstStep && /* @__PURE__ */ (0, import_jsx_runtime245.jsx)("div", { className: "Layer__platform-onboarding__back-button-container", children: /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
|
|
23029
|
+
Button,
|
|
23030
|
+
{
|
|
23031
|
+
onClick: previousStep,
|
|
23032
|
+
variant: "secondary" /* secondary */,
|
|
23033
|
+
children: "Back"
|
|
23034
|
+
}
|
|
23035
|
+
) }),
|
|
23036
|
+
/* @__PURE__ */ (0, import_jsx_runtime245.jsxs)("div", { className: "Layer__platfom-onboarding-layout__box", children: [
|
|
23037
|
+
PLATFORM_ONBOARDING_STEPS.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
|
|
23038
|
+
ProgressSteps,
|
|
23039
|
+
{
|
|
23040
|
+
steps: PLATFORM_ONBOARDING_STEPS.map((step2) => step2.label),
|
|
23041
|
+
currentStep: step === "summary" ? PLATFORM_ONBOARDING_STEPS.length : PLATFORM_ONBOARDING_STEPS.findIndex((s) => s.id === step)
|
|
23042
|
+
}
|
|
23043
|
+
),
|
|
23044
|
+
/* @__PURE__ */ (0, import_jsx_runtime245.jsx)("div", { className: "Layer__platform-onboarding-layout__content", children: renderStepContent() })
|
|
23045
|
+
] }),
|
|
23046
|
+
/* @__PURE__ */ (0, import_jsx_runtime245.jsx)("div", { className: "Layer__platform-onboarding-layout__footer", children: renderStepFooter() })
|
|
23047
|
+
] }) });
|
|
23048
|
+
};
|
|
23049
|
+
|
|
23050
|
+
// src/icons/Coffee.tsx
|
|
23051
|
+
var import_jsx_runtime246 = require("react/jsx-runtime");
|
|
23052
|
+
var CoffeeIcon = (_a) => {
|
|
23053
|
+
var _b = _a, { size = 11 } = _b, props = __objRest(_b, ["size"]);
|
|
23054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(
|
|
23055
|
+
"svg",
|
|
23056
|
+
__spreadProps(__spreadValues({
|
|
23057
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
23058
|
+
viewBox: "0 0 12 12",
|
|
23059
|
+
fill: "none"
|
|
23060
|
+
}, props), {
|
|
23061
|
+
width: size,
|
|
23062
|
+
height: size,
|
|
23063
|
+
children: [
|
|
23064
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsxs)("g", { clipPath: "url(#clip0_5018_10141)", children: [
|
|
23065
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
23066
|
+
"path",
|
|
23067
|
+
{
|
|
23068
|
+
d: "M3.25 4.16666H2.79167C2.30544 4.16666 1.83912 4.35981 1.4953 4.70363C1.15149 5.04744 0.958333 5.51376 0.958333 5.99999C0.958333 6.48622 1.15149 6.95254 1.4953 7.29635C1.83912 7.64017 2.30544 7.83332 2.79167 7.83332H3.25",
|
|
23069
|
+
stroke: "currentColor",
|
|
23070
|
+
strokeLinecap: "round",
|
|
23071
|
+
strokeLinejoin: "round"
|
|
23072
|
+
}
|
|
23073
|
+
),
|
|
23074
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
23075
|
+
"path",
|
|
23076
|
+
{
|
|
23077
|
+
d: "M10.5834 4.16666H3.25004V8.29166C3.25004 8.77789 3.4432 9.2442 3.78701 9.58802C4.13083 9.93184 4.59714 10.125 5.08337 10.125H8.75004C9.23627 10.125 9.70259 9.93184 10.0464 9.58802C10.3902 9.2442 10.5834 8.77789 10.5834 8.29166V4.16666Z",
|
|
23078
|
+
stroke: "currentColor",
|
|
23079
|
+
strokeLinecap: "round",
|
|
23080
|
+
strokeLinejoin: "round"
|
|
23081
|
+
}
|
|
23082
|
+
),
|
|
23083
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
23084
|
+
"path",
|
|
23085
|
+
{
|
|
23086
|
+
d: "M8.75 0.958344V2.33334",
|
|
23087
|
+
stroke: "currentColor",
|
|
23088
|
+
strokeLinecap: "round",
|
|
23089
|
+
strokeLinejoin: "round"
|
|
23090
|
+
}
|
|
23091
|
+
),
|
|
23092
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
23093
|
+
"path",
|
|
23094
|
+
{
|
|
23095
|
+
d: "M6.91663 0.958344V2.33334",
|
|
23096
|
+
stroke: "currentColor",
|
|
23097
|
+
strokeLinecap: "round",
|
|
23098
|
+
strokeLinejoin: "round"
|
|
23099
|
+
}
|
|
23100
|
+
),
|
|
23101
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
21978
23102
|
"path",
|
|
21979
23103
|
{
|
|
21980
23104
|
d: "M5.08337 0.958344V2.33334",
|
|
@@ -21984,7 +23108,7 @@ var CoffeeIcon = (_a) => {
|
|
|
21984
23108
|
}
|
|
21985
23109
|
)
|
|
21986
23110
|
] }),
|
|
21987
|
-
/* @__PURE__ */ (0,
|
|
23111
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)("clipPath", { id: "clip0_5018_10141", children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
21988
23112
|
"rect",
|
|
21989
23113
|
{
|
|
21990
23114
|
width: "11",
|
|
@@ -22000,17 +23124,17 @@ var CoffeeIcon = (_a) => {
|
|
|
22000
23124
|
var Coffee_default = CoffeeIcon;
|
|
22001
23125
|
|
|
22002
23126
|
// src/components/UpsellBanner/BookkeepingUpsellBar.tsx
|
|
22003
|
-
var
|
|
23127
|
+
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
22004
23128
|
var BookkeepingUpsellBar = ({
|
|
22005
23129
|
onClick,
|
|
22006
23130
|
href
|
|
22007
23131
|
}) => {
|
|
22008
|
-
return /* @__PURE__ */ (0,
|
|
22009
|
-
/* @__PURE__ */ (0,
|
|
22010
|
-
/* @__PURE__ */ (0,
|
|
22011
|
-
/* @__PURE__ */ (0,
|
|
22012
|
-
/* @__PURE__ */ (0,
|
|
22013
|
-
/* @__PURE__ */ (0,
|
|
23132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)("div", { className: "Layer__bar-banner Layer__bar-banner--bookkeeping", children: [
|
|
23133
|
+
/* @__PURE__ */ (0, import_jsx_runtime247.jsxs)("div", { className: "Layer__bar-banner__left-col", children: [
|
|
23134
|
+
/* @__PURE__ */ (0, import_jsx_runtime247.jsx)(IconBox, { children: /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(Coffee_default, {}) }),
|
|
23135
|
+
/* @__PURE__ */ (0, import_jsx_runtime247.jsxs)("div", { className: "Layer__bar-banner__text-container", children: [
|
|
23136
|
+
/* @__PURE__ */ (0, import_jsx_runtime247.jsx)(Text, { size: "md" /* md */, weight: "bold" /* bold */, children: "Need help with your books?" }),
|
|
23137
|
+
/* @__PURE__ */ (0, import_jsx_runtime247.jsx)(
|
|
22014
23138
|
Text,
|
|
22015
23139
|
{
|
|
22016
23140
|
size: "sm" /* sm */,
|
|
@@ -22020,25 +23144,25 @@ var BookkeepingUpsellBar = ({
|
|
|
22020
23144
|
)
|
|
22021
23145
|
] })
|
|
22022
23146
|
] }),
|
|
22023
|
-
onClick ? /* @__PURE__ */ (0,
|
|
23147
|
+
onClick ? /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(Button, { variant: "secondary" /* secondary */, onClick, children: "Schedule a demo" }) : href ? /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(Link2, { href, target: "_blank", variant: "secondary" /* secondary */, children: "Schedule a demo" }) : null
|
|
22024
23148
|
] });
|
|
22025
23149
|
};
|
|
22026
23150
|
|
|
22027
23151
|
// src/views/BookkeepingOverview/BookkeepingOverview.tsx
|
|
22028
|
-
var
|
|
23152
|
+
var import_react141 = require("react");
|
|
22029
23153
|
|
|
22030
23154
|
// src/views/BookkeepingOverview/internal/BookkeepingProfitAndLossSummariesContainer.tsx
|
|
22031
|
-
var
|
|
23155
|
+
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
22032
23156
|
var CLASS_NAME10 = "Layer__BookkeepingProfitAndLossSummariesContainer";
|
|
22033
23157
|
function BookkeepingProfitAndLossSummariesContainer({
|
|
22034
23158
|
children
|
|
22035
23159
|
}) {
|
|
22036
|
-
return /* @__PURE__ */ (0,
|
|
23160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)("div", { className: CLASS_NAME10, children });
|
|
22037
23161
|
}
|
|
22038
23162
|
|
|
22039
23163
|
// src/views/BookkeepingOverview/BookkeepingOverview.tsx
|
|
22040
|
-
var
|
|
22041
|
-
var
|
|
23164
|
+
var import_classnames76 = __toESM(require("classnames"));
|
|
23165
|
+
var import_jsx_runtime249 = require("react/jsx-runtime");
|
|
22042
23166
|
var BookkeepingOverview = ({
|
|
22043
23167
|
title,
|
|
22044
23168
|
showTitle = true,
|
|
@@ -22046,19 +23170,19 @@ var BookkeepingOverview = ({
|
|
|
22046
23170
|
slotProps
|
|
22047
23171
|
}) => {
|
|
22048
23172
|
var _a, _b, _c, _d, _e, _f;
|
|
22049
|
-
const [pnlToggle, setPnlToggle] = (0,
|
|
23173
|
+
const [pnlToggle, setPnlToggle] = (0, import_react141.useState)("expenses");
|
|
22050
23174
|
const [width] = useWindowSize();
|
|
22051
23175
|
const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
|
|
22052
|
-
return /* @__PURE__ */ (0,
|
|
23176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(ProfitAndLoss, { asContainer: false, children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(TasksProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
|
|
22053
23177
|
View,
|
|
22054
23178
|
{
|
|
22055
23179
|
viewClassName: "Layer__bookkeeping-overview--view",
|
|
22056
23180
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "Bookkeeping overview",
|
|
22057
23181
|
withSidebar: width > 1100,
|
|
22058
|
-
sidebar: /* @__PURE__ */ (0,
|
|
23182
|
+
sidebar: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(TasksComponent, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks }),
|
|
22059
23183
|
showHeader: showTitle,
|
|
22060
23184
|
children: [
|
|
22061
|
-
width <= 1100 && /* @__PURE__ */ (0,
|
|
23185
|
+
width <= 1100 && /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
22062
23186
|
TasksComponent,
|
|
22063
23187
|
{
|
|
22064
23188
|
collapsable: true,
|
|
@@ -22066,33 +23190,33 @@ var BookkeepingOverview = ({
|
|
|
22066
23190
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks
|
|
22067
23191
|
}
|
|
22068
23192
|
),
|
|
22069
|
-
/* @__PURE__ */ (0,
|
|
23193
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
|
|
22070
23194
|
Container,
|
|
22071
23195
|
{
|
|
22072
23196
|
name: "bookkeeping-overview-profit-and-loss",
|
|
22073
23197
|
asWidget: true,
|
|
22074
23198
|
elevated: true,
|
|
22075
23199
|
children: [
|
|
22076
|
-
/* @__PURE__ */ (0,
|
|
23200
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
22077
23201
|
ProfitAndLoss.Header,
|
|
22078
23202
|
{
|
|
22079
23203
|
text: ((_c = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _c.header) || "Profit & Loss",
|
|
22080
23204
|
withDatePicker: true
|
|
22081
23205
|
}
|
|
22082
23206
|
),
|
|
22083
|
-
/* @__PURE__ */ (0,
|
|
23207
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsx)(BookkeepingProfitAndLossSummariesContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
22084
23208
|
ProfitAndLoss.Summaries,
|
|
22085
23209
|
{
|
|
22086
23210
|
stringOverrides: (_d = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _d.summaries,
|
|
22087
23211
|
variants: profitAndLossSummariesVariants
|
|
22088
23212
|
}
|
|
22089
23213
|
) }),
|
|
22090
|
-
/* @__PURE__ */ (0,
|
|
23214
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsx)(ProfitAndLoss.Chart, {})
|
|
22091
23215
|
]
|
|
22092
23216
|
}
|
|
22093
23217
|
),
|
|
22094
|
-
/* @__PURE__ */ (0,
|
|
22095
|
-
/* @__PURE__ */ (0,
|
|
23218
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsxs)("div", { className: "Layer__bookkeeping-overview-profit-and-loss-charts", children: [
|
|
23219
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
22096
23220
|
Toggle,
|
|
22097
23221
|
{
|
|
22098
23222
|
name: "pnl-detailed-charts",
|
|
@@ -22110,14 +23234,14 @@ var BookkeepingOverview = ({
|
|
|
22110
23234
|
onChange: (e) => setPnlToggle(e.target.value)
|
|
22111
23235
|
}
|
|
22112
23236
|
),
|
|
22113
|
-
/* @__PURE__ */ (0,
|
|
23237
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
22114
23238
|
Container,
|
|
22115
23239
|
{
|
|
22116
|
-
name: (0,
|
|
23240
|
+
name: (0, import_classnames76.default)(
|
|
22117
23241
|
"bookkeeping-overview-profit-and-loss-chart",
|
|
22118
23242
|
pnlToggle !== "revenue" && "bookkeeping-overview-profit-and-loss-chart--hidden"
|
|
22119
23243
|
),
|
|
22120
|
-
children: /* @__PURE__ */ (0,
|
|
23244
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
22121
23245
|
ProfitAndLoss.DetailedCharts,
|
|
22122
23246
|
{
|
|
22123
23247
|
scope: "revenue",
|
|
@@ -22127,14 +23251,14 @@ var BookkeepingOverview = ({
|
|
|
22127
23251
|
)
|
|
22128
23252
|
}
|
|
22129
23253
|
),
|
|
22130
|
-
/* @__PURE__ */ (0,
|
|
23254
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
22131
23255
|
Container,
|
|
22132
23256
|
{
|
|
22133
|
-
name: (0,
|
|
23257
|
+
name: (0, import_classnames76.default)(
|
|
22134
23258
|
"bookkeeping-overview-profit-and-loss-chart",
|
|
22135
23259
|
pnlToggle !== "expenses" && "bookkeeping-overview-profit-and-loss-chart--hidden"
|
|
22136
23260
|
),
|
|
22137
|
-
children: /* @__PURE__ */ (0,
|
|
23261
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
22138
23262
|
ProfitAndLoss.DetailedCharts,
|
|
22139
23263
|
{
|
|
22140
23264
|
scope: "expenses",
|
|
@@ -22151,23 +23275,23 @@ var BookkeepingOverview = ({
|
|
|
22151
23275
|
};
|
|
22152
23276
|
|
|
22153
23277
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
22154
|
-
var
|
|
23278
|
+
var import_react143 = require("react");
|
|
22155
23279
|
|
|
22156
23280
|
// src/views/AccountingOverview/internal/TransactionsToReview.tsx
|
|
22157
|
-
var
|
|
23281
|
+
var import_react142 = require("react");
|
|
22158
23282
|
|
|
22159
23283
|
// src/components/BadgeLoader/BadgeLoader.tsx
|
|
22160
|
-
var
|
|
23284
|
+
var import_jsx_runtime250 = require("react/jsx-runtime");
|
|
22161
23285
|
var BadgeLoader = ({ children }) => {
|
|
22162
|
-
return /* @__PURE__ */ (0,
|
|
22163
|
-
/* @__PURE__ */ (0,
|
|
23286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)("span", { className: "Layer__loader Layer__loader--as-badge", children: [
|
|
23287
|
+
/* @__PURE__ */ (0, import_jsx_runtime250.jsx)(Loader_default, { size: 11, className: "Layer__anim--rotating" }),
|
|
22164
23288
|
children
|
|
22165
23289
|
] });
|
|
22166
23290
|
};
|
|
22167
23291
|
|
|
22168
23292
|
// src/views/AccountingOverview/internal/TransactionsToReview.tsx
|
|
22169
23293
|
var import_date_fns45 = require("date-fns");
|
|
22170
|
-
var
|
|
23294
|
+
var import_jsx_runtime251 = require("react/jsx-runtime");
|
|
22171
23295
|
var CLASS_NAME11 = "Layer__TransactionsToReview";
|
|
22172
23296
|
function TransactionsToReview({
|
|
22173
23297
|
onClick,
|
|
@@ -22176,17 +23300,17 @@ function TransactionsToReview({
|
|
|
22176
23300
|
variants
|
|
22177
23301
|
}) {
|
|
22178
23302
|
const { size = "sm" } = variants != null ? variants : {};
|
|
22179
|
-
const { dateRange: contextDateRange } = (0,
|
|
23303
|
+
const { dateRange: contextDateRange } = (0, import_react142.useContext)(ProfitAndLoss.Context);
|
|
22180
23304
|
const dateRange = usePnlDateRange ? contextDateRange : void 0;
|
|
22181
|
-
const [toReview, setToReview] = (0,
|
|
23305
|
+
const [toReview, setToReview] = (0, import_react142.useState)(0);
|
|
22182
23306
|
const { data, loaded, error, refetch } = useProfitAndLossLTM({
|
|
22183
23307
|
currentDate: dateRange ? dateRange.startDate : (0, import_date_fns45.startOfMonth)(/* @__PURE__ */ new Date()),
|
|
22184
23308
|
tagFilter
|
|
22185
23309
|
});
|
|
22186
|
-
(0,
|
|
23310
|
+
(0, import_react142.useEffect)(() => {
|
|
22187
23311
|
checkTransactionsToReview();
|
|
22188
23312
|
}, []);
|
|
22189
|
-
(0,
|
|
23313
|
+
(0, import_react142.useEffect)(() => {
|
|
22190
23314
|
checkTransactionsToReview();
|
|
22191
23315
|
}, [dateRange, loaded]);
|
|
22192
23316
|
const checkTransactionsToReview = () => {
|
|
@@ -22208,26 +23332,26 @@ function TransactionsToReview({
|
|
|
22208
23332
|
verticalGap = "sm";
|
|
22209
23333
|
break;
|
|
22210
23334
|
}
|
|
22211
|
-
return /* @__PURE__ */ (0,
|
|
22212
|
-
/* @__PURE__ */ (0,
|
|
22213
|
-
/* @__PURE__ */ (0,
|
|
22214
|
-
loaded === "initial" || loaded === "loading" ? /* @__PURE__ */ (0,
|
|
22215
|
-
loaded === "complete" && error ? /* @__PURE__ */ (0,
|
|
23335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)("div", { onClick, className: CLASS_NAME11, children: [
|
|
23336
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(VStack, { gap: verticalGap, align: "start", children: [
|
|
23337
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(ProfitAndLossSummariesHeading, { variants, children: "Transactions to review" }),
|
|
23338
|
+
loaded === "initial" || loaded === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(BadgeLoader, {}) : null,
|
|
23339
|
+
loaded === "complete" && error ? /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
|
|
22216
23340
|
Badge,
|
|
22217
23341
|
{
|
|
22218
23342
|
variant: "error" /* ERROR */,
|
|
22219
23343
|
size: "small" /* SMALL */,
|
|
22220
|
-
icon: /* @__PURE__ */ (0,
|
|
23344
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(RefreshCcw_default, { size: 12 }),
|
|
22221
23345
|
onClick: () => refetch(),
|
|
22222
23346
|
children: "Refresh"
|
|
22223
23347
|
}
|
|
22224
23348
|
) : null,
|
|
22225
|
-
loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */ (0,
|
|
23349
|
+
loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(
|
|
22226
23350
|
Badge,
|
|
22227
23351
|
{
|
|
22228
23352
|
variant: "warning" /* WARNING */,
|
|
22229
23353
|
size: "small" /* SMALL */,
|
|
22230
|
-
icon: /* @__PURE__ */ (0,
|
|
23354
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(Bell_default, { size: 12 }),
|
|
22231
23355
|
children: [
|
|
22232
23356
|
toReview,
|
|
22233
23357
|
" ",
|
|
@@ -22235,23 +23359,23 @@ function TransactionsToReview({
|
|
|
22235
23359
|
]
|
|
22236
23360
|
}
|
|
22237
23361
|
) : null,
|
|
22238
|
-
loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */ (0,
|
|
23362
|
+
loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
|
|
22239
23363
|
Badge,
|
|
22240
23364
|
{
|
|
22241
23365
|
variant: "success" /* SUCCESS */,
|
|
22242
23366
|
size: "small" /* SMALL */,
|
|
22243
|
-
icon: /* @__PURE__ */ (0,
|
|
23367
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(Check_default, { size: 12 }),
|
|
22244
23368
|
children: "All done"
|
|
22245
23369
|
}
|
|
22246
23370
|
) : null
|
|
22247
23371
|
] }),
|
|
22248
|
-
/* @__PURE__ */ (0,
|
|
23372
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(IconButton, { icon: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(ChevronRight_default, {}), withBorder: true, onClick })
|
|
22249
23373
|
] });
|
|
22250
23374
|
}
|
|
22251
23375
|
|
|
22252
23376
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
22253
|
-
var
|
|
22254
|
-
var
|
|
23377
|
+
var import_classnames77 = __toESM(require("classnames"));
|
|
23378
|
+
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
22255
23379
|
var AccountingOverview = ({
|
|
22256
23380
|
title = "Accounting overview",
|
|
22257
23381
|
showTitle = true,
|
|
@@ -22266,35 +23390,35 @@ var AccountingOverview = ({
|
|
|
22266
23390
|
slotProps
|
|
22267
23391
|
}) => {
|
|
22268
23392
|
var _a, _b, _c, _d, _e;
|
|
22269
|
-
const [pnlToggle, setPnlToggle] = (0,
|
|
23393
|
+
const [pnlToggle, setPnlToggle] = (0, import_react143.useState)("expenses");
|
|
22270
23394
|
const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
|
|
22271
|
-
return /* @__PURE__ */ (0,
|
|
23395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
22272
23396
|
ProfitAndLoss,
|
|
22273
23397
|
{
|
|
22274
23398
|
asContainer: false,
|
|
22275
23399
|
tagFilter: tagFilter ? { key: tagFilter.tagKey, values: tagFilter.tagValues } : void 0,
|
|
22276
|
-
children: /* @__PURE__ */ (0,
|
|
23400
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)(
|
|
22277
23401
|
View,
|
|
22278
23402
|
{
|
|
22279
23403
|
title,
|
|
22280
23404
|
showHeader: showTitle,
|
|
22281
|
-
header: /* @__PURE__ */ (0,
|
|
23405
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(Header2, { children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(HeaderRow, { children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(HeaderCol, { children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(ProfitAndLoss.DatePicker, {}) }) }) }),
|
|
22282
23406
|
children: [
|
|
22283
|
-
enableOnboarding && /* @__PURE__ */ (0,
|
|
23407
|
+
enableOnboarding && /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
22284
23408
|
Onboarding,
|
|
22285
23409
|
{
|
|
22286
23410
|
onTransactionsToReviewClick,
|
|
22287
23411
|
onboardingStepOverride
|
|
22288
23412
|
}
|
|
22289
23413
|
),
|
|
22290
|
-
/* @__PURE__ */ (0,
|
|
23414
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
22291
23415
|
Internal_ProfitAndLossSummaries,
|
|
22292
23416
|
{
|
|
22293
23417
|
stringOverrides: (_c = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _c.summaries,
|
|
22294
23418
|
chartColorsList,
|
|
22295
23419
|
slots: {
|
|
22296
23420
|
unstable_AdditionalListItems: showTransactionsToReview ? [
|
|
22297
|
-
/* @__PURE__ */ (0,
|
|
23421
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
22298
23422
|
TransactionsToReview,
|
|
22299
23423
|
{
|
|
22300
23424
|
usePnlDateRange: true,
|
|
@@ -22308,20 +23432,20 @@ var AccountingOverview = ({
|
|
|
22308
23432
|
variants: profitAndLossSummariesVariants
|
|
22309
23433
|
}
|
|
22310
23434
|
),
|
|
22311
|
-
/* @__PURE__ */ (0,
|
|
23435
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsxs)(
|
|
22312
23436
|
Container,
|
|
22313
23437
|
{
|
|
22314
23438
|
name: "accounting-overview-profit-and-loss",
|
|
22315
23439
|
asWidget: true,
|
|
22316
23440
|
elevated: true,
|
|
22317
23441
|
children: [
|
|
22318
|
-
/* @__PURE__ */ (0,
|
|
23442
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
22319
23443
|
ProfitAndLoss.Header,
|
|
22320
23444
|
{
|
|
22321
23445
|
text: (stringOverrides == null ? void 0 : stringOverrides.header) || "Profit & Loss"
|
|
22322
23446
|
}
|
|
22323
23447
|
),
|
|
22324
|
-
/* @__PURE__ */ (0,
|
|
23448
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
22325
23449
|
ProfitAndLoss.Chart,
|
|
22326
23450
|
{
|
|
22327
23451
|
tagFilter: tagFilter ? { key: tagFilter.tagKey, values: tagFilter.tagValues } : void 0
|
|
@@ -22330,9 +23454,9 @@ var AccountingOverview = ({
|
|
|
22330
23454
|
]
|
|
22331
23455
|
}
|
|
22332
23456
|
),
|
|
22333
|
-
middleBanner && /* @__PURE__ */ (0,
|
|
22334
|
-
/* @__PURE__ */ (0,
|
|
22335
|
-
/* @__PURE__ */ (0,
|
|
23457
|
+
middleBanner && /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(Container, { name: "accounting-overview-middle-banner", children: middleBanner }),
|
|
23458
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsxs)("div", { className: "Layer__accounting-overview-profit-and-loss-charts", children: [
|
|
23459
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
22336
23460
|
Toggle,
|
|
22337
23461
|
{
|
|
22338
23462
|
name: "pnl-detailed-charts",
|
|
@@ -22350,14 +23474,14 @@ var AccountingOverview = ({
|
|
|
22350
23474
|
onChange: (e) => setPnlToggle(e.target.value)
|
|
22351
23475
|
}
|
|
22352
23476
|
),
|
|
22353
|
-
/* @__PURE__ */ (0,
|
|
23477
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
22354
23478
|
Container,
|
|
22355
23479
|
{
|
|
22356
|
-
name: (0,
|
|
23480
|
+
name: (0, import_classnames77.default)(
|
|
22357
23481
|
"accounting-overview-profit-and-loss-chart",
|
|
22358
23482
|
pnlToggle !== "revenue" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
22359
23483
|
),
|
|
22360
|
-
children: /* @__PURE__ */ (0,
|
|
23484
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
22361
23485
|
ProfitAndLoss.DetailedCharts,
|
|
22362
23486
|
{
|
|
22363
23487
|
scope: "revenue",
|
|
@@ -22368,14 +23492,14 @@ var AccountingOverview = ({
|
|
|
22368
23492
|
)
|
|
22369
23493
|
}
|
|
22370
23494
|
),
|
|
22371
|
-
/* @__PURE__ */ (0,
|
|
23495
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
22372
23496
|
Container,
|
|
22373
23497
|
{
|
|
22374
|
-
name: (0,
|
|
23498
|
+
name: (0, import_classnames77.default)(
|
|
22375
23499
|
"accounting-overview-profit-and-loss-chart",
|
|
22376
23500
|
pnlToggle !== "expenses" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
22377
23501
|
),
|
|
22378
|
-
children: /* @__PURE__ */ (0,
|
|
23502
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
22379
23503
|
ProfitAndLoss.DetailedCharts,
|
|
22380
23504
|
{
|
|
22381
23505
|
scope: "expenses",
|
|
@@ -22395,7 +23519,7 @@ var AccountingOverview = ({
|
|
|
22395
23519
|
};
|
|
22396
23520
|
|
|
22397
23521
|
// src/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts.tsx
|
|
22398
|
-
var
|
|
23522
|
+
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
22399
23523
|
var BankTransactionsWithLinkedAccounts = ({
|
|
22400
23524
|
title,
|
|
22401
23525
|
// deprecated
|
|
@@ -22411,13 +23535,13 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
22411
23535
|
mobileComponent,
|
|
22412
23536
|
stringOverrides
|
|
22413
23537
|
}) => {
|
|
22414
|
-
return /* @__PURE__ */ (0,
|
|
23538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(
|
|
22415
23539
|
View,
|
|
22416
23540
|
{
|
|
22417
23541
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "Bank transactions",
|
|
22418
23542
|
showHeader: showTitle,
|
|
22419
23543
|
children: [
|
|
22420
|
-
/* @__PURE__ */ (0,
|
|
23544
|
+
/* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
|
|
22421
23545
|
LinkedAccounts,
|
|
22422
23546
|
{
|
|
22423
23547
|
elevated: elevatedLinkedAccounts,
|
|
@@ -22427,7 +23551,7 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
22427
23551
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.linkedAccounts
|
|
22428
23552
|
}
|
|
22429
23553
|
),
|
|
22430
|
-
/* @__PURE__ */ (0,
|
|
23554
|
+
/* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
|
|
22431
23555
|
BankTransactions,
|
|
22432
23556
|
{
|
|
22433
23557
|
asWidget: true,
|
|
@@ -22445,8 +23569,8 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
22445
23569
|
};
|
|
22446
23570
|
|
|
22447
23571
|
// src/views/GeneralLedger/GeneralLedger.tsx
|
|
22448
|
-
var
|
|
22449
|
-
var
|
|
23572
|
+
var import_react144 = require("react");
|
|
23573
|
+
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
22450
23574
|
var GeneralLedgerView = ({
|
|
22451
23575
|
title,
|
|
22452
23576
|
// deprecated
|
|
@@ -22454,14 +23578,14 @@ var GeneralLedgerView = ({
|
|
|
22454
23578
|
stringOverrides,
|
|
22455
23579
|
chartOfAccountsOptions
|
|
22456
23580
|
}) => {
|
|
22457
|
-
const [activeTab, setActiveTab] = (0,
|
|
22458
|
-
return /* @__PURE__ */ (0,
|
|
23581
|
+
const [activeTab, setActiveTab] = (0, import_react144.useState)("chartOfAccounts");
|
|
23582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(ProfitAndLoss, { asContainer: false, children: /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(
|
|
22459
23583
|
View,
|
|
22460
23584
|
{
|
|
22461
23585
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "General Ledger",
|
|
22462
23586
|
showHeader: showTitle,
|
|
22463
23587
|
children: [
|
|
22464
|
-
/* @__PURE__ */ (0,
|
|
23588
|
+
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
22465
23589
|
Toggle,
|
|
22466
23590
|
{
|
|
22467
23591
|
name: "general-ledger-tabs",
|
|
@@ -22479,7 +23603,7 @@ var GeneralLedgerView = ({
|
|
|
22479
23603
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
22480
23604
|
}
|
|
22481
23605
|
),
|
|
22482
|
-
activeTab === "chartOfAccounts" ? /* @__PURE__ */ (0,
|
|
23606
|
+
activeTab === "chartOfAccounts" ? /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
22483
23607
|
ChartOfAccounts,
|
|
22484
23608
|
{
|
|
22485
23609
|
asWidget: true,
|
|
@@ -22489,16 +23613,16 @@ var GeneralLedgerView = ({
|
|
|
22489
23613
|
templateAccountsEditable: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.templateAccountsEditable,
|
|
22490
23614
|
showReversalEntries: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.showReversalEntries
|
|
22491
23615
|
}
|
|
22492
|
-
) : /* @__PURE__ */ (0,
|
|
23616
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(Journal, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.journal })
|
|
22493
23617
|
]
|
|
22494
23618
|
}
|
|
22495
23619
|
) });
|
|
22496
23620
|
};
|
|
22497
23621
|
|
|
22498
23622
|
// src/views/ProjectProfitability/ProjectProfitability.tsx
|
|
22499
|
-
var
|
|
23623
|
+
var import_react145 = require("react");
|
|
22500
23624
|
var import_react_select5 = __toESM(require("react-select"));
|
|
22501
|
-
var
|
|
23625
|
+
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
22502
23626
|
var ProjectProfitabilityView = ({
|
|
22503
23627
|
valueOptions,
|
|
22504
23628
|
showTitle,
|
|
@@ -22506,9 +23630,9 @@ var ProjectProfitabilityView = ({
|
|
|
22506
23630
|
datePickerMode = "monthPicker",
|
|
22507
23631
|
csvMoneyFormat = "DOLLAR_STRING"
|
|
22508
23632
|
}) => {
|
|
22509
|
-
const [activeTab, setActiveTab] = (0,
|
|
22510
|
-
const [tagFilter, setTagFilter] = (0,
|
|
22511
|
-
const [pnlTagFilter, setPnlTagFilter] = (0,
|
|
23633
|
+
const [activeTab, setActiveTab] = (0, import_react145.useState)("overview");
|
|
23634
|
+
const [tagFilter, setTagFilter] = (0, import_react145.useState)(null);
|
|
23635
|
+
const [pnlTagFilter, setPnlTagFilter] = (0, import_react145.useState)(
|
|
22512
23636
|
void 0
|
|
22513
23637
|
);
|
|
22514
23638
|
const isOptionSelected = (option, selectValue) => {
|
|
@@ -22522,15 +23646,15 @@ var ProjectProfitabilityView = ({
|
|
|
22522
23646
|
values: tagFilter2.tagValues
|
|
22523
23647
|
} : void 0;
|
|
22524
23648
|
};
|
|
22525
|
-
return /* @__PURE__ */ (0,
|
|
23649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(
|
|
22526
23650
|
View,
|
|
22527
23651
|
{
|
|
22528
23652
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || "",
|
|
22529
23653
|
showHeader: showTitle,
|
|
22530
23654
|
viewClassName: "Layer__project-view",
|
|
22531
23655
|
children: [
|
|
22532
|
-
/* @__PURE__ */ (0,
|
|
22533
|
-
/* @__PURE__ */ (0,
|
|
23656
|
+
/* @__PURE__ */ (0, import_jsx_runtime255.jsxs)("div", { className: "Layer__component Layer__header__actions", children: [
|
|
23657
|
+
/* @__PURE__ */ (0, import_jsx_runtime255.jsx)("div", { className: "Layer__component", children: /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
22534
23658
|
Toggle,
|
|
22535
23659
|
{
|
|
22536
23660
|
name: "project-tabs",
|
|
@@ -22552,7 +23676,7 @@ var ProjectProfitabilityView = ({
|
|
|
22552
23676
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
22553
23677
|
}
|
|
22554
23678
|
) }),
|
|
22555
|
-
/* @__PURE__ */ (0,
|
|
23679
|
+
/* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
22556
23680
|
import_react_select5.default,
|
|
22557
23681
|
{
|
|
22558
23682
|
className: "Layer__category-menu Layer__select",
|
|
@@ -22571,8 +23695,8 @@ var ProjectProfitabilityView = ({
|
|
|
22571
23695
|
}
|
|
22572
23696
|
)
|
|
22573
23697
|
] }),
|
|
22574
|
-
/* @__PURE__ */ (0,
|
|
22575
|
-
activeTab === "overview" && /* @__PURE__ */ (0,
|
|
23698
|
+
/* @__PURE__ */ (0, import_jsx_runtime255.jsx)(Container, { name: "project", children: /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(import_jsx_runtime255.Fragment, { children: [
|
|
23699
|
+
activeTab === "overview" && /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
22576
23700
|
AccountingOverview,
|
|
22577
23701
|
{
|
|
22578
23702
|
stringOverrides: { header: "Project Overview" },
|
|
@@ -22583,7 +23707,7 @@ var ProjectProfitabilityView = ({
|
|
|
22583
23707
|
showTitle: false
|
|
22584
23708
|
}
|
|
22585
23709
|
),
|
|
22586
|
-
activeTab === "transactions" && /* @__PURE__ */ (0,
|
|
23710
|
+
activeTab === "transactions" && /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
22587
23711
|
BankTransactions,
|
|
22588
23712
|
{
|
|
22589
23713
|
hideHeader: true,
|
|
@@ -22593,7 +23717,7 @@ var ProjectProfitabilityView = ({
|
|
|
22593
23717
|
}
|
|
22594
23718
|
}
|
|
22595
23719
|
),
|
|
22596
|
-
activeTab === "report" && /* @__PURE__ */ (0,
|
|
23720
|
+
activeTab === "report" && /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(ProfitAndLoss, { asContainer: false, tagFilter: pnlTagFilter, children: /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
22597
23721
|
ProfitAndLoss.Report,
|
|
22598
23722
|
{
|
|
22599
23723
|
stringOverrides,
|
|
@@ -22608,8 +23732,8 @@ var ProjectProfitabilityView = ({
|
|
|
22608
23732
|
};
|
|
22609
23733
|
|
|
22610
23734
|
// src/views/Reports/Reports.tsx
|
|
22611
|
-
var
|
|
22612
|
-
var
|
|
23735
|
+
var import_react146 = require("react");
|
|
23736
|
+
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
22613
23737
|
var getOptions = (enabledReports) => {
|
|
22614
23738
|
return [
|
|
22615
23739
|
enabledReports.includes("profitAndLoss") ? {
|
|
@@ -22636,17 +23760,17 @@ var Reports = ({
|
|
|
22636
23760
|
statementOfCashFlowConfig
|
|
22637
23761
|
}) => {
|
|
22638
23762
|
var _a;
|
|
22639
|
-
const [activeTab, setActiveTab] = (0,
|
|
23763
|
+
const [activeTab, setActiveTab] = (0, import_react146.useState)(enabledReports[0]);
|
|
22640
23764
|
const { view, containerRef } = useElementViewSize();
|
|
22641
23765
|
const options = getOptions(enabledReports);
|
|
22642
|
-
const
|
|
22643
|
-
return /* @__PURE__ */ (0,
|
|
23766
|
+
const defaultTitle4 = enabledReports.length > 1 ? "Reports" : (_a = options.find((option) => option.value = enabledReports[0])) == null ? void 0 : _a.label;
|
|
23767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)(
|
|
22644
23768
|
View,
|
|
22645
23769
|
{
|
|
22646
|
-
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title ||
|
|
23770
|
+
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || defaultTitle4,
|
|
22647
23771
|
showHeader: showTitle,
|
|
22648
23772
|
children: [
|
|
22649
|
-
enabledReports.length > 1 && /* @__PURE__ */ (0,
|
|
23773
|
+
enabledReports.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime256.jsx)("div", { className: "Layer__component Layer__header__actions", children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
22650
23774
|
Toggle,
|
|
22651
23775
|
{
|
|
22652
23776
|
name: "reports-tabs",
|
|
@@ -22655,7 +23779,7 @@ var Reports = ({
|
|
|
22655
23779
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
22656
23780
|
}
|
|
22657
23781
|
) }),
|
|
22658
|
-
/* @__PURE__ */ (0,
|
|
23782
|
+
/* @__PURE__ */ (0, import_jsx_runtime256.jsx)(Container, { name: "reports", ref: containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(ProfitAndLoss, { asContainer: false, comparisonConfig, children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
22659
23783
|
ReportsPanel,
|
|
22660
23784
|
{
|
|
22661
23785
|
containerRef,
|
|
@@ -22678,8 +23802,8 @@ var ReportsPanel = ({
|
|
|
22678
23802
|
statementOfCashFlowConfig,
|
|
22679
23803
|
view
|
|
22680
23804
|
}) => {
|
|
22681
|
-
return /* @__PURE__ */ (0,
|
|
22682
|
-
openReport === "profitAndLoss" && /* @__PURE__ */ (0,
|
|
23805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)(import_jsx_runtime256.Fragment, { children: [
|
|
23806
|
+
openReport === "profitAndLoss" && /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
22683
23807
|
ProfitAndLoss.Report,
|
|
22684
23808
|
__spreadValues({
|
|
22685
23809
|
stringOverrides,
|
|
@@ -22687,8 +23811,8 @@ var ReportsPanel = ({
|
|
|
22687
23811
|
view
|
|
22688
23812
|
}, profitAndLossConfig)
|
|
22689
23813
|
),
|
|
22690
|
-
openReport === "balanceSheet" && /* @__PURE__ */ (0,
|
|
22691
|
-
openReport === "statementOfCashFlow" && /* @__PURE__ */ (0,
|
|
23814
|
+
openReport === "balanceSheet" && /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(BalanceSheet, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.balanceSheet }),
|
|
23815
|
+
openReport === "statementOfCashFlow" && /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
22692
23816
|
StatementOfCashFlow,
|
|
22693
23817
|
__spreadValues({
|
|
22694
23818
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.statementOfCashflow
|
|
@@ -22698,12 +23822,12 @@ var ReportsPanel = ({
|
|
|
22698
23822
|
};
|
|
22699
23823
|
|
|
22700
23824
|
// src/components/ProfitAndLossView/ProfitAndLossView.tsx
|
|
22701
|
-
var
|
|
22702
|
-
var
|
|
23825
|
+
var import_react147 = require("react");
|
|
23826
|
+
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
22703
23827
|
var COMPONENT_NAME7 = "profit-and-loss";
|
|
22704
23828
|
var ProfitAndLossView = (props) => {
|
|
22705
|
-
const containerRef = (0,
|
|
22706
|
-
return /* @__PURE__ */ (0,
|
|
23829
|
+
const containerRef = (0, import_react147.useRef)(null);
|
|
23830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(Container, { name: COMPONENT_NAME7, ref: containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(ProfitAndLoss, { children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(ProfitAndLossPanel, __spreadValues({ containerRef }, props)) }) });
|
|
22707
23831
|
};
|
|
22708
23832
|
var ProfitAndLossPanel = (_a) => {
|
|
22709
23833
|
var _b = _a, {
|
|
@@ -22713,11 +23837,11 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
22713
23837
|
"containerRef",
|
|
22714
23838
|
"stringOverrides"
|
|
22715
23839
|
]);
|
|
22716
|
-
const { sidebarScope } = (0,
|
|
22717
|
-
return /* @__PURE__ */ (0,
|
|
23840
|
+
const { sidebarScope } = (0, import_react147.useContext)(ProfitAndLoss.Context);
|
|
23841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)(
|
|
22718
23842
|
Panel,
|
|
22719
23843
|
{
|
|
22720
|
-
sidebar: /* @__PURE__ */ (0,
|
|
23844
|
+
sidebar: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
|
|
22721
23845
|
ProfitAndLossDetailedCharts,
|
|
22722
23846
|
{
|
|
22723
23847
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossDetailedCharts
|
|
@@ -22726,7 +23850,7 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
22726
23850
|
sidebarIsOpen: Boolean(sidebarScope),
|
|
22727
23851
|
parentRef: containerRef,
|
|
22728
23852
|
children: [
|
|
22729
|
-
/* @__PURE__ */ (0,
|
|
23853
|
+
/* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
|
|
22730
23854
|
ProfitAndLoss.Header,
|
|
22731
23855
|
{
|
|
22732
23856
|
text: (stringOverrides == null ? void 0 : stringOverrides.header) || "Profit & Loss",
|
|
@@ -22734,7 +23858,7 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
22734
23858
|
headingClassName: "Layer__profit-and-loss__title"
|
|
22735
23859
|
}
|
|
22736
23860
|
),
|
|
22737
|
-
/* @__PURE__ */ (0,
|
|
23861
|
+
/* @__PURE__ */ (0, import_jsx_runtime257.jsx)(Components, __spreadValues({ stringOverrides }, props))
|
|
22738
23862
|
]
|
|
22739
23863
|
}
|
|
22740
23864
|
);
|
|
@@ -22744,11 +23868,11 @@ var Components = ({
|
|
|
22744
23868
|
hideTable = false,
|
|
22745
23869
|
stringOverrides
|
|
22746
23870
|
}) => {
|
|
22747
|
-
const { error, isLoading, isValidating, refetch } = (0,
|
|
23871
|
+
const { error, isLoading, isValidating, refetch } = (0, import_react147.useContext)(
|
|
22748
23872
|
ProfitAndLoss.Context
|
|
22749
23873
|
);
|
|
22750
23874
|
if (!isLoading && error) {
|
|
22751
|
-
return /* @__PURE__ */ (0,
|
|
23875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)("div", { className: "Layer__table-state-container", children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
|
|
22752
23876
|
DataState,
|
|
22753
23877
|
{
|
|
22754
23878
|
status: "failed" /* failed */,
|
|
@@ -22759,15 +23883,15 @@ var Components = ({
|
|
|
22759
23883
|
}
|
|
22760
23884
|
) });
|
|
22761
23885
|
}
|
|
22762
|
-
return /* @__PURE__ */ (0,
|
|
22763
|
-
!hideChart && /* @__PURE__ */ (0,
|
|
22764
|
-
/* @__PURE__ */ (0,
|
|
23886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)(import_jsx_runtime257.Fragment, { children: [
|
|
23887
|
+
!hideChart && /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)("div", { className: `Layer__${COMPONENT_NAME7}__chart_with_summaries`, children: [
|
|
23888
|
+
/* @__PURE__ */ (0, import_jsx_runtime257.jsxs)(
|
|
22765
23889
|
"div",
|
|
22766
23890
|
{
|
|
22767
23891
|
className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__summary-col`,
|
|
22768
23892
|
children: [
|
|
22769
|
-
/* @__PURE__ */ (0,
|
|
22770
|
-
/* @__PURE__ */ (0,
|
|
23893
|
+
/* @__PURE__ */ (0, import_jsx_runtime257.jsx)(ProfitAndLoss.DatePicker, {}),
|
|
23894
|
+
/* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
|
|
22771
23895
|
ProfitAndLoss.Summaries,
|
|
22772
23896
|
{
|
|
22773
23897
|
actionable: true,
|
|
@@ -22777,15 +23901,15 @@ var Components = ({
|
|
|
22777
23901
|
]
|
|
22778
23902
|
}
|
|
22779
23903
|
),
|
|
22780
|
-
/* @__PURE__ */ (0,
|
|
23904
|
+
/* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
|
|
22781
23905
|
"div",
|
|
22782
23906
|
{
|
|
22783
23907
|
className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__chart-col`,
|
|
22784
|
-
children: /* @__PURE__ */ (0,
|
|
23908
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(ProfitAndLoss.Chart, {})
|
|
22785
23909
|
}
|
|
22786
23910
|
)
|
|
22787
23911
|
] }),
|
|
22788
|
-
!hideTable && /* @__PURE__ */ (0,
|
|
23912
|
+
!hideTable && /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
|
|
22789
23913
|
ProfitAndLoss.Table,
|
|
22790
23914
|
{
|
|
22791
23915
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossTable
|
|
@@ -22811,6 +23935,7 @@ var Components = ({
|
|
|
22811
23935
|
LinkAccounts,
|
|
22812
23936
|
LinkedAccounts,
|
|
22813
23937
|
Onboarding,
|
|
23938
|
+
PlatformOnboarding,
|
|
22814
23939
|
ProfitAndLoss,
|
|
22815
23940
|
ProfitAndLossView,
|
|
22816
23941
|
ProjectProfitabilityView,
|