@layerfi/components 0.1.121 → 0.1.122-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.
@@ -71,9 +71,9 @@ const useResizeObserver = require("@react-hook/resize-observer");
71
71
  const lucideReact = require("lucide-react");
72
72
  const pluralize = require("pluralize");
73
73
  const ReactSelect = require("react-select");
74
+ const CreatableSelect = require("react-select/creatable");
74
75
  const reactDropzone = require("react-dropzone");
75
76
  const reactForm = require("@tanstack/react-form");
76
- const BaseCreatableSelect = require("react-select/creatable");
77
77
  const reactTable = require("@tanstack/react-table");
78
78
  const reactVirtual = require("@tanstack/react-virtual");
79
79
  const react$1 = require("motion/react");
@@ -208,7 +208,7 @@ class ErrorHandlerClass {
208
208
  }
209
209
  const errorHandler = new ErrorHandlerClass();
210
210
  const reportError = (payload) => errorHandler.onError(payload);
211
- const version = "0.1.121";
211
+ const version = "0.1.122-alpha";
212
212
  const pkg = {
213
213
  version
214
214
  };
@@ -2334,6 +2334,12 @@ index.Schema.Struct({
2334
2334
  index.Schema.fromKey("update_categorization_rules_suggestion")
2335
2335
  )
2336
2336
  });
2337
+ var BankTransactionsTableContent = /* @__PURE__ */ ((BankTransactionsTableContent2) => {
2338
+ BankTransactionsTableContent2["List"] = "List";
2339
+ BankTransactionsTableContent2["MobileList"] = "MobileList";
2340
+ BankTransactionsTableContent2["Table"] = "Table";
2341
+ return BankTransactionsTableContent2;
2342
+ })(BankTransactionsTableContent || {});
2337
2343
  const CategorizedCategories = [
2338
2344
  CategorizationStatus.CATEGORIZED,
2339
2345
  CategorizationStatus.SPLIT,
@@ -9615,11 +9621,11 @@ function buildCustomPlaceholder({
9615
9621
  "children"
9616
9622
  ]);
9617
9623
  if (!placeholder) return null;
9618
- return /* @__PURE__ */ jsxRuntime.jsx(ReactSelect.components.Placeholder, __spreadProps(__spreadValues({}, restProps), { className: COMBO_BOX_CLASS_NAMES.PLACEHOLDER, children: /* @__PURE__ */ jsxRuntime.jsx(Span, { variant: "placeholder", ellipsis: true, children: placeholder }) }));
9624
+ return /* @__PURE__ */ jsxRuntime.jsx(ReactSelect.components.Placeholder, __spreadProps(__spreadValues({}, restProps), { children: /* @__PURE__ */ jsxRuntime.jsx(Span, { variant: "inherit", ellipsis: true, children: placeholder }) }));
9619
9625
  };
9620
9626
  }
9621
9627
  function buildCustomSingleValue({
9622
- SelectedValue
9628
+ SingleValue
9623
9629
  }) {
9624
9630
  return function CustomSingleValue(_a) {
9625
9631
  var _b = _a, {
@@ -9627,7 +9633,8 @@ function buildCustomSingleValue({
9627
9633
  } = _b, restProps = __objRest(_b, [
9628
9634
  "children"
9629
9635
  ]);
9630
- return /* @__PURE__ */ jsxRuntime.jsx(ReactSelect.components.SingleValue, __spreadProps(__spreadValues({}, restProps), { children: SelectedValue != null ? SelectedValue : children }));
9636
+ const defaultRenderedSingleValue = /* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, children });
9637
+ return /* @__PURE__ */ jsxRuntime.jsx(ReactSelect.components.SingleValue, __spreadProps(__spreadValues({}, restProps), { children: SingleValue ? /* @__PURE__ */ jsxRuntime.jsx(SingleValue, { option: restProps.data, fallback: defaultRenderedSingleValue }) : defaultRenderedSingleValue }));
9631
9638
  };
9632
9639
  }
9633
9640
  function useComboBoxSubcomponents({
@@ -9635,7 +9642,7 @@ function useComboBoxSubcomponents({
9635
9642
  slots,
9636
9643
  displayDisabledAsSelected
9637
9644
  }) {
9638
- const { EmptyMessage, SelectedValue, GroupHeading, Option } = slots != null ? slots : {};
9645
+ const { EmptyMessage, SingleValue, GroupHeading, Option } = slots != null ? slots : {};
9639
9646
  const ClearIndicatorRef = React.useRef(buildCustomClearIndicator());
9640
9647
  const DropdownIndicatorRef = React.useRef(buildCustomDropdownIndicator());
9641
9648
  const LoadingIndicatorRef = React.useRef(buildCustomLoadingIndicator());
@@ -9657,8 +9664,8 @@ function useComboBoxSubcomponents({
9657
9664
  [placeholder]
9658
9665
  );
9659
9666
  const SingleValueComponent = React.useMemo(
9660
- () => buildCustomSingleValue({ SelectedValue }),
9661
- [SelectedValue]
9667
+ () => buildCustomSingleValue({ SingleValue }),
9668
+ [SingleValue]
9662
9669
  );
9663
9670
  return React.useMemo(() => ({
9664
9671
  ClearIndicator: ClearIndicatorRef.current,
@@ -9688,6 +9695,7 @@ function useCommonComboBoxProps({
9688
9695
  slots,
9689
9696
  displayDisabledAsSelected,
9690
9697
  isDisabled,
9698
+ isError,
9691
9699
  isReadOnly = false,
9692
9700
  isClearable = true,
9693
9701
  isSearchable = true,
@@ -9710,10 +9718,14 @@ function useCommonComboBoxProps({
9710
9718
  COMBO_BOX_CLASS_NAMES.CONTROL,
9711
9719
  isFocused && `${COMBO_BOX_CLASS_NAMES.CONTROL}--focused`,
9712
9720
  isDisabled2 && `${COMBO_BOX_CLASS_NAMES.CONTROL}--disabled`,
9721
+ isError && `${COMBO_BOX_CLASS_NAMES.CONTROL}--error`,
9713
9722
  isReadOnly && `${COMBO_BOX_CLASS_NAMES.CONTROL}--readonly`
9714
9723
  ),
9715
9724
  valueContainer: () => COMBO_BOX_CLASS_NAMES.VALUE_CONTAINER,
9716
- placeholder: () => COMBO_BOX_CLASS_NAMES.PLACEHOLDER,
9725
+ placeholder: () => classNames(
9726
+ COMBO_BOX_CLASS_NAMES.PLACEHOLDER,
9727
+ isError && `${COMBO_BOX_CLASS_NAMES.PLACEHOLDER}--error`
9728
+ ),
9717
9729
  indicatorsContainer: () => classNames(
9718
9730
  COMBO_BOX_CLASS_NAMES.INDICATORS_CONTAINER,
9719
9731
  isReadOnly && `${COMBO_BOX_CLASS_NAMES.INDICATORS_CONTAINER}--readonly`
@@ -9721,7 +9733,7 @@ function useCommonComboBoxProps({
9721
9733
  menu: () => COMBO_BOX_CLASS_NAMES.MENU,
9722
9734
  menuList: () => COMBO_BOX_CLASS_NAMES.MENU_LIST,
9723
9735
  group: () => COMBO_BOX_CLASS_NAMES.GROUP
9724
- }), [isReadOnly]);
9736
+ }), [isError, isReadOnly]);
9725
9737
  const styles = React.useMemo(() => ({
9726
9738
  menuPortal: (base) => __spreadProps(__spreadValues({}, base), { zIndex: 101 })
9727
9739
  }), []);
@@ -9781,7 +9793,7 @@ function ComboBox(_la) {
9781
9793
  "selectedValue",
9782
9794
  "onSelectedValueChange"
9783
9795
  ]);
9784
- const commonSelectProps = useCommonComboBoxProps(__spreadValues({ className, slots }, props));
9796
+ const commonSelectProps = useCommonComboBoxProps(__spreadValues({ className, slots, isError }, props));
9785
9797
  return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", fluid: true, className: className ? `${className}__Container` : void 0, children: [
9786
9798
  /* @__PURE__ */ jsxRuntime.jsx(ReactSelect, __spreadProps(__spreadValues({}, commonSelectProps), { value: selectedValue, onChange: onSelectedValueChange })),
9787
9799
  /* @__PURE__ */ jsxRuntime.jsx(ComboBoxErrorMessage, { isError, errorMessage: slots == null ? void 0 : slots.ErrorMessage })
@@ -10279,7 +10291,7 @@ const BankTransactionCategoryComboBox = ({
10279
10291
  const numMatchOptions = (matchGroup == null ? void 0 : matchGroup.options.length) || 0;
10280
10292
  const loadingSuggestions = bankTransaction && isLoadingSuggestions(bankTransaction) && selectedValue === null;
10281
10293
  const placeholder = numMatchOptions > 1 ? `${numMatchOptions} possible matches...` : loadingSuggestions ? "Generating suggestions..." : includeSuggestedMatches ? "Categorize or match..." : "Select category";
10282
- const SelectedValue = React.useMemo(() => {
10294
+ const SingleValue = React.useCallback(() => {
10283
10295
  return /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsUncategorizedSelectedValue, { selectedValue });
10284
10296
  }, [selectedValue]);
10285
10297
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -10292,7 +10304,7 @@ const BankTransactionCategoryComboBox = ({
10292
10304
  selectedValue,
10293
10305
  placeholder,
10294
10306
  slots: {
10295
- SelectedValue,
10307
+ SingleValue,
10296
10308
  Option: BankTransactionCategoryComboBoxOption,
10297
10309
  GroupHeading: BankTransactionCategoryComboBoxGroupHeading
10298
10310
  },
@@ -11302,6 +11314,45 @@ function useCustomAccountParseCsv() {
11302
11314
  }
11303
11315
  );
11304
11316
  }
11317
+ const returnTrue = () => true;
11318
+ function CreatableComboBox(_Ba) {
11319
+ var _Ca = _Ba, {
11320
+ className,
11321
+ slots,
11322
+ isError,
11323
+ selectedValue,
11324
+ onSelectedValueChange,
11325
+ onCreateOption,
11326
+ formatCreateLabel: formatCreateLabel2,
11327
+ createOptionPosition = "first",
11328
+ isValidNewOption = returnTrue
11329
+ } = _Ca, props = __objRest(_Ca, [
11330
+ "className",
11331
+ "slots",
11332
+ "isError",
11333
+ "selectedValue",
11334
+ "onSelectedValueChange",
11335
+ "onCreateOption",
11336
+ "formatCreateLabel",
11337
+ "createOptionPosition",
11338
+ "isValidNewOption"
11339
+ ]);
11340
+ const commonSelectProps = useCommonComboBoxProps(__spreadValues({ className, slots, isError }, props));
11341
+ return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", fluid: true, className: className ? `${className}__Container` : void 0, children: [
11342
+ /* @__PURE__ */ jsxRuntime.jsx(
11343
+ CreatableSelect,
11344
+ __spreadProps(__spreadValues({}, commonSelectProps), {
11345
+ value: selectedValue,
11346
+ onChange: onSelectedValueChange,
11347
+ onCreateOption,
11348
+ isValidNewOption,
11349
+ formatCreateLabel: formatCreateLabel2,
11350
+ createOptionPosition
11351
+ })
11352
+ ),
11353
+ /* @__PURE__ */ jsxRuntime.jsx(ComboBoxErrorMessage, { isError, errorMessage: slots == null ? void 0 : slots.ErrorMessage })
11354
+ ] });
11355
+ }
11305
11356
  const copyTextToClipboard = (text) => {
11306
11357
  navigator.clipboard.writeText(text).catch(() => {
11307
11358
  });
@@ -11318,8 +11369,8 @@ const CopyTemplateHeadersButtonGroup = ({ headers, className }) => {
11318
11369
  key
11319
11370
  )) });
11320
11371
  };
11321
- const CloseIcon = (_Ba) => {
11322
- var _Ca = _Ba, { size = 12 } = _Ca, props = __objRest(_Ca, ["size"]);
11372
+ const CloseIcon = (_Da) => {
11373
+ var _Ea = _Da, { size = 12 } = _Ea, props = __objRest(_Ea, ["size"]);
11323
11374
  return /* @__PURE__ */ jsxRuntime.jsxs(
11324
11375
  "svg",
11325
11376
  __spreadProps(__spreadValues({
@@ -11631,15 +11682,15 @@ function useCreateCustomAccount() {
11631
11682
  }
11632
11683
  const FORM_CLASS_NAME = "Layer__UI__Form";
11633
11684
  const Form = React.forwardRef(
11634
- function Form2(_Da, ref) {
11635
- var _Ea = _Da, { children, className } = _Ea, restProps = __objRest(_Ea, ["children", "className"]);
11685
+ function Form2(_Fa, ref) {
11686
+ var _Ga = _Fa, { children, className } = _Ga, restProps = __objRest(_Ga, ["children", "className"]);
11636
11687
  return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Form, __spreadProps(__spreadValues({}, restProps), { className: classNames(FORM_CLASS_NAME, className), ref, children }));
11637
11688
  }
11638
11689
  );
11639
11690
  const TEXT_FIELD_CLASS_NAME = "Layer__UI__TextField";
11640
11691
  const TextField = React.forwardRef(
11641
- function TextField2(_Fa, ref) {
11642
- var _Ga = _Fa, { children, inline, textarea, className } = _Ga, restProps = __objRest(_Ga, ["children", "inline", "textarea", "className"]);
11692
+ function TextField2(_Ha, ref) {
11693
+ var _Ia = _Ha, { children, inline, textarea, className } = _Ia, restProps = __objRest(_Ia, ["children", "inline", "textarea", "className"]);
11643
11694
  const dataProperties = toDataProperties({ inline, textarea });
11644
11695
  return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.TextField, __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(TEXT_FIELD_CLASS_NAME, className), ref, children: withRenderProp(children, (node) => node) }));
11645
11696
  }
@@ -11769,8 +11820,8 @@ function formatBigDecimalToString(value, options2 = {
11769
11820
  }
11770
11821
  const INPUT_CLASS_NAME = "Layer__UI__Input";
11771
11822
  const Input$1 = React.forwardRef(
11772
- function Input2(_Ha, ref) {
11773
- var _Ia = _Ha, { inset, placement } = _Ia, restProps = __objRest(_Ia, ["inset", "placement"]);
11823
+ function Input2(_Ja, ref) {
11824
+ var _Ka = _Ja, { inset, placement } = _Ka, restProps = __objRest(_Ka, ["inset", "placement"]);
11774
11825
  const dataProperties = toDataProperties({ inset, placement });
11775
11826
  return /* @__PURE__ */ jsxRuntime.jsx(
11776
11827
  reactAriaComponents.Input,
@@ -11781,39 +11832,17 @@ const Input$1 = React.forwardRef(
11781
11832
  );
11782
11833
  }
11783
11834
  );
11784
- const DEFAULT_MAX_VALUE = effect.BigDecimal.fromBigInt(BigInt(1e7));
11785
- const DEFAULT_MIN_DECIMAL_PLACES = 0;
11786
- const DEFAULT_MAX_DECIMAL_PLACES = 3;
11787
11835
  const DECORATOR_CHARS_REGEX = /[,%$]/g;
11788
- const withForceUpdate = (value) => {
11789
- return Object.defineProperty(value, "__forceUpdate", {
11790
- value: Symbol(),
11791
- enumerable: true,
11792
- configurable: true,
11793
- writable: false
11794
- });
11795
- };
11796
- function FormBigDecimalField(_Ja) {
11797
- var _Ka = _Ja, {
11798
- mode = "decimal",
11799
- allowNegative = false,
11800
- maxValue = mode === "percent" ? BIG_DECIMAL_ONE : DEFAULT_MAX_VALUE,
11801
- minDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MIN_DECIMAL_PLACES,
11802
- maxDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MAX_DECIMAL_PLACES,
11803
- slots,
11804
- placeholder
11805
- } = _Ka, restProps = __objRest(_Ka, [
11806
- "mode",
11807
- "allowNegative",
11808
- "maxValue",
11809
- "minDecimalPlaces",
11810
- "maxDecimalPlaces",
11811
- "slots",
11812
- "placeholder"
11813
- ]);
11814
- const field = useFieldContext();
11815
- const { name, state, handleChange, handleBlur } = field;
11816
- const { value } = state;
11836
+ function useBigDecimalInput({
11837
+ value,
11838
+ onChange,
11839
+ onBlur,
11840
+ mode,
11841
+ maxValue,
11842
+ maxDecimalPlaces,
11843
+ minDecimalPlaces,
11844
+ allowNegative
11845
+ }) {
11817
11846
  const formattingProps = React.useMemo(() => ({
11818
11847
  minDecimalPlaces,
11819
11848
  maxDecimalPlaces,
@@ -11835,11 +11864,11 @@ function FormBigDecimalField(_Ja) {
11835
11864
  const normalized = effect.BigDecimal.normalize(adjustedForPercent);
11836
11865
  const clamped = effect.BigDecimal.min(normalized, maxValue);
11837
11866
  if (!effect.BigDecimal.equals(clamped, value)) {
11838
- handleChange(withForceUpdate(clamped));
11867
+ onChange(clamped);
11839
11868
  }
11840
- handleBlur();
11869
+ onBlur();
11841
11870
  setInputValue(formatBigDecimalToString(clamped, formattingProps));
11842
- }, [inputValue, mode, maxValue, maxDecimalPlaces, value, handleBlur, formattingProps, handleChange]);
11871
+ }, [inputValue, maxDecimalPlaces, mode, maxValue, value, onBlur, formattingProps, onChange]);
11843
11872
  const allowedChars = React.useMemo(
11844
11873
  () => buildDecimalCharRegex({ allowNegative, allowPercent: mode === "percent", allowDollar: mode === "currency" }),
11845
11874
  [allowNegative, mode]
@@ -11858,6 +11887,48 @@ function FormBigDecimalField(_Ja) {
11858
11887
  React.useEffect(() => {
11859
11888
  setInputValue(formatBigDecimalToString(value, formattingProps));
11860
11889
  }, [value, formattingProps]);
11890
+ return {
11891
+ inputValue,
11892
+ onInputChange,
11893
+ onInputBlur,
11894
+ onBeforeInput,
11895
+ onPaste
11896
+ };
11897
+ }
11898
+ const DEFAULT_MAX_VALUE$1 = effect.BigDecimal.fromBigInt(BigInt(1e7));
11899
+ const DEFAULT_MIN_DECIMAL_PLACES$1 = 0;
11900
+ const DEFAULT_MAX_DECIMAL_PLACES$1 = 3;
11901
+ function FormBigDecimalField(_La) {
11902
+ var _Ma = _La, {
11903
+ mode = "decimal",
11904
+ allowNegative = false,
11905
+ maxValue = mode === "percent" ? BIG_DECIMAL_ONE : DEFAULT_MAX_VALUE$1,
11906
+ minDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MIN_DECIMAL_PLACES$1,
11907
+ maxDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MAX_DECIMAL_PLACES$1,
11908
+ slots,
11909
+ placeholder
11910
+ } = _Ma, restProps = __objRest(_Ma, [
11911
+ "mode",
11912
+ "allowNegative",
11913
+ "maxValue",
11914
+ "minDecimalPlaces",
11915
+ "maxDecimalPlaces",
11916
+ "slots",
11917
+ "placeholder"
11918
+ ]);
11919
+ const field = useFieldContext();
11920
+ const { name, state, handleChange, handleBlur } = field;
11921
+ const { value } = state;
11922
+ const { inputValue, onInputChange, onInputBlur, onBeforeInput, onPaste } = useBigDecimalInput({
11923
+ value,
11924
+ onChange: handleChange,
11925
+ onBlur: handleBlur,
11926
+ mode,
11927
+ maxValue,
11928
+ maxDecimalPlaces,
11929
+ minDecimalPlaces,
11930
+ allowNegative
11931
+ });
11861
11932
  return /* @__PURE__ */ jsxRuntime.jsx(BaseFormTextField, __spreadProps(__spreadValues({}, restProps), { inputMode: "decimal", children: /* @__PURE__ */ jsxRuntime.jsxs(InputGroup$1, { slot: "input", actionCount: slots ? 2 : void 0, children: [
11862
11933
  /* @__PURE__ */ jsxRuntime.jsx(
11863
11934
  Input$1,
@@ -11882,8 +11953,8 @@ const CHECK_SIZE = {
11882
11953
  md: 14,
11883
11954
  lg: 16
11884
11955
  };
11885
- function Checkbox(_La) {
11886
- var _Ma = _La, { children, className, variant = "default", size = "sm", isIndeterminate } = _Ma, props = __objRest(_Ma, ["children", "className", "variant", "size", "isIndeterminate"]);
11956
+ function Checkbox(_Na) {
11957
+ var _Oa = _Na, { children, className, variant = "default", size = "sm", isIndeterminate } = _Oa, props = __objRest(_Oa, ["children", "className", "variant", "size", "isIndeterminate"]);
11887
11958
  const dataProperties = React.useMemo(() => toDataProperties({
11888
11959
  size,
11889
11960
  variant,
@@ -11901,8 +11972,8 @@ function Checkbox(_La) {
11901
11972
  })
11902
11973
  );
11903
11974
  }
11904
- function CheckboxWithTooltip(_Na) {
11905
- var _Oa = _Na, { tooltip } = _Oa, props = __objRest(_Oa, ["tooltip"]);
11975
+ function CheckboxWithTooltip(_Pa) {
11976
+ var _Qa = _Pa, { tooltip } = _Qa, props = __objRest(_Qa, ["tooltip"]);
11906
11977
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__checkbox-wrapper", children: /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { disabled: !tooltip, children: [
11907
11978
  /* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: /* @__PURE__ */ jsxRuntime.jsx(Checkbox, __spreadValues({}, props)) }),
11908
11979
  /* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: tooltip })
@@ -11946,10 +12017,11 @@ function FormCheckboxField({
11946
12017
  })
11947
12018
  );
11948
12019
  }
12020
+ const DATE_PICKER_CLASS_NAME = "Layer__UI__DatePicker";
11949
12021
  const DATE_FIELD_CLASS_NAME = "Layer__UI__DateField";
11950
12022
  const DateField = React.forwardRef(
11951
- function DateField2(_Pa, ref) {
11952
- var _Qa = _Pa, { inline, className, isReadOnly } = _Qa, restProps = __objRest(_Qa, ["inline", "className", "isReadOnly"]);
12023
+ function DateField2(_Ra, ref) {
12024
+ var _Sa = _Ra, { inline, className, isReadOnly } = _Sa, restProps = __objRest(_Sa, ["inline", "className", "isReadOnly"]);
11953
12025
  const dataProperties = toDataProperties({ inline, readonly: isReadOnly });
11954
12026
  return /* @__PURE__ */ jsxRuntime.jsx(
11955
12027
  reactAriaComponents.DateField,
@@ -11963,8 +12035,8 @@ const DateField = React.forwardRef(
11963
12035
  );
11964
12036
  const DATE_INPUT_CLASS_NAME = "Layer__UI__DateInput";
11965
12037
  const DateInput = React.forwardRef(
11966
- function DateInput2(_Ra, ref) {
11967
- var _Sa = _Ra, { inset, pointerEvents } = _Sa, restProps = __objRest(_Sa, ["inset", "pointerEvents"]);
12038
+ function DateInput2(_Ta, ref) {
12039
+ var _Ua = _Ta, { inset, pointerEvents } = _Ua, restProps = __objRest(_Ua, ["inset", "pointerEvents"]);
11968
12040
  const dataProperties = toDataProperties({ inset, "pointer-events": pointerEvents });
11969
12041
  return /* @__PURE__ */ jsxRuntime.jsx(
11970
12042
  reactAriaComponents.DateInput,
@@ -11977,8 +12049,8 @@ const DateInput = React.forwardRef(
11977
12049
  );
11978
12050
  const DATE_SEGMENT_CLASS_NAME = "Layer__UI__DateSegment";
11979
12051
  const DateSegment = React.forwardRef(
11980
- function DateSegment2(_Ta, ref) {
11981
- var _Ua = _Ta, { isReadOnly } = _Ua, restProps = __objRest(_Ua, ["isReadOnly"]);
12052
+ function DateSegment2(_Va, ref) {
12053
+ var _Wa = _Va, { isReadOnly } = _Wa, restProps = __objRest(_Wa, ["isReadOnly"]);
11982
12054
  const dataProperties = toDataProperties({ interactive: !isReadOnly });
11983
12055
  return /* @__PURE__ */ jsxRuntime.jsx(
11984
12056
  reactAriaComponents.DateSegment,
@@ -11989,13 +12061,13 @@ const DateSegment = React.forwardRef(
11989
12061
  );
11990
12062
  }
11991
12063
  );
11992
- const DATE_PICKER_CLASS_NAME = "Layer__UI__DatePicker";
11993
12064
  const DatePicker$1 = React.forwardRef(
11994
- function DatePicker2(props, ref) {
12065
+ function DatePicker2(_Xa, ref) {
12066
+ var _Ya = _Xa, { className } = _Ya, restProps = __objRest(_Ya, ["className"]);
11995
12067
  return /* @__PURE__ */ jsxRuntime.jsx(
11996
12068
  reactAriaComponents.DatePicker,
11997
- __spreadProps(__spreadValues({}, props), {
11998
- className: DATE_PICKER_CLASS_NAME,
12069
+ __spreadProps(__spreadValues({}, restProps), {
12070
+ className: classNames(DATE_PICKER_CLASS_NAME, className),
11999
12071
  ref
12000
12072
  })
12001
12073
  );
@@ -12057,10 +12129,349 @@ function FormDateField({
12057
12129
  })
12058
12130
  );
12059
12131
  }
12132
+ const ChevronLeft = (_Za) => {
12133
+ var props = __objRest(_Za, []);
12134
+ return /* @__PURE__ */ jsxRuntime.jsx(
12135
+ "svg",
12136
+ __spreadProps(__spreadValues({
12137
+ xmlns: "http://www.w3.org/2000/svg",
12138
+ width: "18",
12139
+ height: "18",
12140
+ viewBox: "0 0 18 18",
12141
+ fill: "none"
12142
+ }, props), {
12143
+ children: /* @__PURE__ */ jsxRuntime.jsx(
12144
+ "path",
12145
+ {
12146
+ d: "M11.25 13.5L6.75 9L11.25 4.5",
12147
+ stroke: "currentColor",
12148
+ strokeLinecap: "round",
12149
+ strokeLinejoin: "round"
12150
+ }
12151
+ )
12152
+ })
12153
+ );
12154
+ };
12155
+ const CALENDAR_CLASS_NAME = "Layer__UI__Calendar";
12156
+ const Calendar = React.forwardRef(
12157
+ function Calendar2(__a, ref) {
12158
+ var _$a = __a, { className, isReadOnly } = _$a, restProps = __objRest(_$a, ["className", "isReadOnly"]);
12159
+ const dataProperties = toDataProperties({ readonly: isReadOnly });
12160
+ return /* @__PURE__ */ jsxRuntime.jsx(
12161
+ reactAriaComponents.Calendar,
12162
+ __spreadProps(__spreadValues(__spreadValues({}, dataProperties), restProps), {
12163
+ isReadOnly,
12164
+ className: classNames(CALENDAR_CLASS_NAME, className),
12165
+ ref
12166
+ })
12167
+ );
12168
+ }
12169
+ );
12170
+ const CALENDAR_GRID_CLASS_NAME = "Layer__UI__CalendarGrid";
12171
+ const CalendarGrid = React.forwardRef(
12172
+ function CalendarGrid2(_ab, ref) {
12173
+ var _bb = _ab, { className } = _bb, restProps = __objRest(_bb, ["className"]);
12174
+ return /* @__PURE__ */ jsxRuntime.jsx(
12175
+ reactAriaComponents.CalendarGrid,
12176
+ __spreadProps(__spreadValues({}, restProps), {
12177
+ className: classNames(CALENDAR_GRID_CLASS_NAME, className),
12178
+ ref
12179
+ })
12180
+ );
12181
+ }
12182
+ );
12183
+ const CALENDAR_GRID_BODY_CLASS_NAME = "Layer__UI__CalendarGridBody";
12184
+ const CalendarGridBody = React.forwardRef(
12185
+ function CalendarGridBody2(_cb, ref) {
12186
+ var _db = _cb, { className } = _db, restProps = __objRest(_db, ["className"]);
12187
+ return /* @__PURE__ */ jsxRuntime.jsx(
12188
+ reactAriaComponents.CalendarGridBody,
12189
+ __spreadProps(__spreadValues({}, restProps), {
12190
+ className: classNames(CALENDAR_GRID_BODY_CLASS_NAME, className),
12191
+ ref
12192
+ })
12193
+ );
12194
+ }
12195
+ );
12196
+ const CALENDAR_CELL_CLASS_NAME = "Layer__UI__CalendarCell";
12197
+ const CalendarCell = React.forwardRef(
12198
+ function CalendarCell2(_eb, ref) {
12199
+ var _fb = _eb, { className, size = "sm" } = _fb, restProps = __objRest(_fb, ["className", "size"]);
12200
+ const dataProperties = toDataProperties({ size });
12201
+ return /* @__PURE__ */ jsxRuntime.jsx(
12202
+ reactAriaComponents.CalendarCell,
12203
+ __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
12204
+ className: classNames(CALENDAR_CELL_CLASS_NAME, className),
12205
+ ref
12206
+ })
12207
+ );
12208
+ }
12209
+ );
12210
+ const CALENDAR_GRID_HEADER_CLASS_NAME = "Layer__UI__CalendarGridHeader";
12211
+ const CalendarGridHeader = React.forwardRef(
12212
+ function CalendarGridHeader2(_gb, ref) {
12213
+ var _hb = _gb, { className } = _hb, restProps = __objRest(_hb, ["className"]);
12214
+ return /* @__PURE__ */ jsxRuntime.jsx(
12215
+ reactAriaComponents.CalendarGridHeader,
12216
+ __spreadProps(__spreadValues({}, restProps), {
12217
+ className: classNames(CALENDAR_GRID_HEADER_CLASS_NAME, className),
12218
+ ref
12219
+ })
12220
+ );
12221
+ }
12222
+ );
12223
+ const CALENDAR_HEADER_CELL_CLASS_NAME = "Layer__UI__CalendarHeaderCell";
12224
+ const CalendarHeaderCell = React.forwardRef(
12225
+ function CalendarHeaderCell2(_ib, ref) {
12226
+ var _jb = _ib, { className, size = "sm" } = _jb, restProps = __objRest(_jb, ["className", "size"]);
12227
+ const dataProperties = toDataProperties({ size });
12228
+ return /* @__PURE__ */ jsxRuntime.jsx(
12229
+ reactAriaComponents.CalendarHeaderCell,
12230
+ __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
12231
+ className: classNames(CALENDAR_HEADER_CELL_CLASS_NAME, className),
12232
+ ref
12233
+ })
12234
+ );
12235
+ }
12236
+ );
12237
+ const DateCalendar = ({ minDate, maxDate, variant }) => {
12238
+ return /* @__PURE__ */ jsxRuntime.jsxs(Calendar, { minValue: minDate, maxValue: maxDate, children: [
12239
+ /* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "center", justify: "space-between", pb: "xs", pi: "xs", className: "Layer__DateCalendar__Header", children: [
12240
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { icon: true, inset: true, variant: "ghost", slot: "previous", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeft, { size: 20 }) }),
12241
+ /* @__PURE__ */ jsxRuntime.jsx(Heading$1, { weight: "normal", size: "sm" }),
12242
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { icon: true, inset: true, variant: "ghost", slot: "next", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 20 }) })
12243
+ ] }),
12244
+ /* @__PURE__ */ jsxRuntime.jsx(HStack, { pb: "xs", pi: "xs", children: /* @__PURE__ */ jsxRuntime.jsxs(CalendarGrid, { children: [
12245
+ /* @__PURE__ */ jsxRuntime.jsx(CalendarGridHeader, { children: (day) => /* @__PURE__ */ jsxRuntime.jsx(CalendarHeaderCell, { size: variant === "mobile" ? "md" : "sm", children: day }) }),
12246
+ /* @__PURE__ */ jsxRuntime.jsx(CalendarGridBody, { children: (date2) => /* @__PURE__ */ jsxRuntime.jsx(CalendarCell, { date: date2, size: variant === "mobile" ? "md" : "sm" }) })
12247
+ ] }) })
12248
+ ] });
12249
+ };
12250
+ const PickerDropdownIndicator = ({ onClick }) => /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Button, { className: "Layer__PickerDropdownIndicator", onPress: onClick, children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 16 }) });
12251
+ const DatePickerInput = ({ errorText, variant, onClick, isReadOnly }) => {
12252
+ const errorTriangle = React.useMemo(() => {
12253
+ if (variant === "mobile" || !errorText) return null;
12254
+ return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { offset: 12, children: [
12255
+ /* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(FieldError, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, { size: 18 }) }) }),
12256
+ /* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", width: "md", children: errorText })
12257
+ ] });
12258
+ }, [errorText, variant]);
12259
+ if (variant === "mobile") {
12260
+ return /* @__PURE__ */ jsxRuntime.jsx(InputGroup$1, { slot: "input", isInvalid: !!errorText, onClick: isReadOnly ? void 0 : onClick, children: /* @__PURE__ */ jsxRuntime.jsx(DateInput, { inset: true, pointerEvents: "none", children: (segment) => /* @__PURE__ */ jsxRuntime.jsx(DateSegment, { isReadOnly: true, segment }) }) });
12261
+ }
12262
+ return /* @__PURE__ */ jsxRuntime.jsxs(InputGroup$1, { slot: "input", isInvalid: !!errorText, children: [
12263
+ /* @__PURE__ */ jsxRuntime.jsx(DateInput, { inset: true, children: (segment) => /* @__PURE__ */ jsxRuntime.jsx(DateSegment, { segment, isReadOnly }) }),
12264
+ /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "3xs", align: "center", pie: "4xs", children: [
12265
+ errorTriangle,
12266
+ !isReadOnly && /* @__PURE__ */ jsxRuntime.jsx(PickerDropdownIndicator, { onClick })
12267
+ ] })
12268
+ ] });
12269
+ };
12270
+ const POPOVER_CLASS_NAME = "Layer__Popover";
12271
+ const POPOVER_CLASS_NAMES = `Layer__Portal ${POPOVER_CLASS_NAME}`;
12272
+ const Popover = React.forwardRef(
12273
+ function Popover2(_kb, ref) {
12274
+ var _lb = _kb, { flexInline = false } = _lb, restProps = __objRest(_lb, ["flexInline"]);
12275
+ const dataProperties = toDataProperties({ "flex-inline": flexInline });
12276
+ return /* @__PURE__ */ jsxRuntime.jsx(
12277
+ reactAriaComponents.Popover,
12278
+ __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
12279
+ className: POPOVER_CLASS_NAMES,
12280
+ ref
12281
+ })
12282
+ );
12283
+ }
12284
+ );
12285
+ function ResponsivePopover({ children, triggerRef }) {
12286
+ const { isMobile } = useSizeClass();
12287
+ if (isMobile) {
12288
+ return /* @__PURE__ */ jsxRuntime.jsx(
12289
+ Modal,
12290
+ {
12291
+ flexBlock: true,
12292
+ flexInline: true,
12293
+ variant: "mobile-popover",
12294
+ isDismissable: true,
12295
+ children
12296
+ }
12297
+ );
12298
+ }
12299
+ return /* @__PURE__ */ jsxRuntime.jsx(
12300
+ Popover,
12301
+ {
12302
+ triggerRef,
12303
+ placement: "bottom left",
12304
+ flexInline: true,
12305
+ children
12306
+ }
12307
+ );
12308
+ }
12309
+ const DatePicker = ({
12310
+ label,
12311
+ showLabel = true,
12312
+ date: date2,
12313
+ minDate,
12314
+ maxDate,
12315
+ isInvalid,
12316
+ errorText,
12317
+ onBlur,
12318
+ onChange,
12319
+ isDisabled,
12320
+ isReadOnly,
12321
+ className,
12322
+ slotProps
12323
+ }) => {
12324
+ const additionalAriaProps = !showLabel && { "aria-label": label };
12325
+ const { value } = useSizeClass();
12326
+ const [isPopoverOpen, setPopoverOpen] = React.useState(false);
12327
+ return /* @__PURE__ */ jsxRuntime.jsxs(
12328
+ DatePicker$1,
12329
+ __spreadProps(__spreadValues({
12330
+ granularity: "day",
12331
+ value: date2,
12332
+ onBlur,
12333
+ onChange,
12334
+ isInvalid
12335
+ }, additionalAriaProps), {
12336
+ isOpen: isPopoverOpen,
12337
+ onOpenChange: setPopoverOpen,
12338
+ isDisabled,
12339
+ isReadOnly,
12340
+ className: classNames(DATE_PICKER_CLASS_NAME, className),
12341
+ children: [
12342
+ showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, __spreadProps(__spreadValues({ slot: "label", size: "sm" }, slotProps == null ? void 0 : slotProps.Label), { children: label })),
12343
+ /* @__PURE__ */ jsxRuntime.jsx(DatePickerInput, { errorText, variant: value, onClick: () => setPopoverOpen(true), isReadOnly }),
12344
+ /* @__PURE__ */ jsxRuntime.jsx(ResponsivePopover, { children: /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Dialog, { children: /* @__PURE__ */ jsxRuntime.jsx(DateCalendar, { minDate, maxDate, variant: value }) }) })
12345
+ ]
12346
+ })
12347
+ );
12348
+ };
12349
+ const FORM_DATE_PICKER_FIELD_CLASSNAME = "Layer__FormDatePickerField";
12350
+ function FormDatePickerField({
12351
+ label,
12352
+ className,
12353
+ inline = false,
12354
+ showLabel = true,
12355
+ showFieldError = true,
12356
+ isReadOnly = false,
12357
+ minDate,
12358
+ maxDate
12359
+ }) {
12360
+ const field = useFieldContext();
12361
+ const { state, handleChange, handleBlur } = field;
12362
+ const { meta, value } = state;
12363
+ const { errors, isValid } = meta;
12364
+ const [localDate, setLocalDate] = React.useState(value);
12365
+ React.useEffect(() => {
12366
+ setLocalDate(value);
12367
+ }, [value]);
12368
+ const onChange = React.useCallback((newValue) => {
12369
+ setLocalDate(newValue);
12370
+ }, []);
12371
+ const onBlur = React.useCallback(() => {
12372
+ handleChange(localDate);
12373
+ handleBlur();
12374
+ }, [handleBlur, handleChange, localDate]);
12375
+ const errorMessage = errors.length !== 0 ? errors[0] : void 0;
12376
+ const shouldShowErrorMessage = showFieldError && errorMessage;
12377
+ const datePickerClassNames = classNames(
12378
+ FORM_DATE_PICKER_FIELD_CLASSNAME,
12379
+ inline && `${FORM_DATE_PICKER_FIELD_CLASSNAME}--inline`,
12380
+ className
12381
+ );
12382
+ return /* @__PURE__ */ jsxRuntime.jsx(
12383
+ DatePicker,
12384
+ {
12385
+ label,
12386
+ showLabel,
12387
+ date: localDate,
12388
+ onChange,
12389
+ onBlur,
12390
+ minDate,
12391
+ maxDate,
12392
+ isInvalid: !isValid,
12393
+ errorText: shouldShowErrorMessage ? errorMessage : null,
12394
+ isReadOnly,
12395
+ className: datePickerClassNames
12396
+ }
12397
+ );
12398
+ }
12399
+ const NonRecursiveBigDecimalSchema = effect.Schema.Struct({
12400
+ value: effect.Schema.BigIntFromSelf,
12401
+ scale: effect.Schema.Int
12402
+ });
12403
+ const NRBD_ZERO = { value: /* @__PURE__ */ BigInt("0"), scale: 0 };
12404
+ const NRBD_ONE = { value: /* @__PURE__ */ BigInt("1"), scale: 0 };
12405
+ const toNonRecursiveBigDecimal = (bd) => {
12406
+ const normalized = effect.BigDecimal.normalize(bd);
12407
+ return { value: normalized.value, scale: normalized.scale };
12408
+ };
12409
+ const fromNonRecursiveBigDecimal = (nrbd) => {
12410
+ return effect.BigDecimal.make(nrbd.value, nrbd.scale);
12411
+ };
12412
+ const nrbdEquals = (a, b) => {
12413
+ return effect.BigDecimal.equals(fromNonRecursiveBigDecimal(a), fromNonRecursiveBigDecimal(b));
12414
+ };
12415
+ const DEFAULT_MAX_VALUE = effect.BigDecimal.fromBigInt(BigInt(1e7));
12416
+ const DEFAULT_MIN_DECIMAL_PLACES = 0;
12417
+ const DEFAULT_MAX_DECIMAL_PLACES = 3;
12418
+ function FormNonRecursiveBigDecimalField(_mb) {
12419
+ var _nb = _mb, {
12420
+ mode = "decimal",
12421
+ allowNegative = false,
12422
+ maxValue = mode === "percent" ? BIG_DECIMAL_ONE : DEFAULT_MAX_VALUE,
12423
+ minDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MIN_DECIMAL_PLACES,
12424
+ maxDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MAX_DECIMAL_PLACES,
12425
+ slots,
12426
+ placeholder
12427
+ } = _nb, restProps = __objRest(_nb, [
12428
+ "mode",
12429
+ "allowNegative",
12430
+ "maxValue",
12431
+ "minDecimalPlaces",
12432
+ "maxDecimalPlaces",
12433
+ "slots",
12434
+ "placeholder"
12435
+ ]);
12436
+ const field = useFieldContext();
12437
+ const { name, state, handleChange, handleBlur } = field;
12438
+ const { value: nrbdValue } = state;
12439
+ const value = React.useMemo(() => fromNonRecursiveBigDecimal(nrbdValue), [nrbdValue]);
12440
+ const onChange = React.useCallback((bd) => {
12441
+ handleChange(toNonRecursiveBigDecimal(bd));
12442
+ }, [handleChange]);
12443
+ const { inputValue, onInputChange, onInputBlur, onBeforeInput, onPaste } = useBigDecimalInput({
12444
+ value,
12445
+ onChange,
12446
+ onBlur: handleBlur,
12447
+ mode,
12448
+ maxValue,
12449
+ maxDecimalPlaces,
12450
+ minDecimalPlaces,
12451
+ allowNegative
12452
+ });
12453
+ return /* @__PURE__ */ jsxRuntime.jsx(BaseFormTextField, __spreadProps(__spreadValues({}, restProps), { inputMode: "decimal", children: /* @__PURE__ */ jsxRuntime.jsxs(InputGroup$1, { slot: "input", actionCount: slots ? 2 : void 0, children: [
12454
+ /* @__PURE__ */ jsxRuntime.jsx(
12455
+ Input$1,
12456
+ {
12457
+ inset: true,
12458
+ id: name,
12459
+ name,
12460
+ value: inputValue,
12461
+ onChange: onInputChange,
12462
+ onBlur: onInputBlur,
12463
+ onBeforeInput,
12464
+ onPaste,
12465
+ placeholder
12466
+ }
12467
+ ),
12468
+ (slots == null ? void 0 : slots.badge) && /* @__PURE__ */ jsxRuntime.jsx(HStack, { children: slots.badge })
12469
+ ] }) }));
12470
+ }
12060
12471
  const NUMBER_FIELD_CLASS_NAME = "Layer__UI__NumberField";
12061
12472
  const NumberField = React.forwardRef(
12062
- function NumberField2(_Va, ref) {
12063
- var _Wa = _Va, { inline, className, isReadOnly } = _Wa, restProps = __objRest(_Wa, ["inline", "className", "isReadOnly"]);
12473
+ function NumberField2(_ob, ref) {
12474
+ var _pb = _ob, { inline, className, isReadOnly } = _pb, restProps = __objRest(_pb, ["inline", "className", "isReadOnly"]);
12064
12475
  const dataProperties = toDataProperties({ inline, readonly: isReadOnly });
12065
12476
  return /* @__PURE__ */ jsxRuntime.jsx(
12066
12477
  reactAriaComponents.NumberField,
@@ -12129,17 +12540,13 @@ function FormNumberField({
12129
12540
  }
12130
12541
  const RADIO_GROUP_CLASS_NAME = "Layer__RadioGroup";
12131
12542
  const RADIO_CLASS_NAME = "Layer__Radio";
12132
- const INDICATOR_SIZE = {
12133
- sm: 8,
12134
- md: 10,
12135
- lg: 12
12136
- };
12137
- function RadioGroup(_Xa) {
12138
- var _Ya = _Xa, {
12543
+ const INDICATOR_SIZE = 10;
12544
+ function RadioGroup(_qb) {
12545
+ var _rb = _qb, {
12139
12546
  children,
12140
12547
  className,
12141
12548
  onChange
12142
- } = _Ya, restProps = __objRest(_Ya, [
12549
+ } = _rb, restProps = __objRest(_rb, [
12143
12550
  "children",
12144
12551
  "className",
12145
12552
  "onChange"
@@ -12153,26 +12560,20 @@ function RadioGroup(_Xa) {
12153
12560
  })
12154
12561
  );
12155
12562
  }
12156
- function Radio(_Za) {
12157
- var __a = _Za, {
12563
+ function Radio(_sb) {
12564
+ var _tb = _sb, {
12158
12565
  children,
12159
- className,
12160
- size = "sm"
12161
- } = __a, restProps = __objRest(__a, [
12566
+ className
12567
+ } = _tb, restProps = __objRest(_tb, [
12162
12568
  "children",
12163
- "className",
12164
- "size"
12569
+ "className"
12165
12570
  ]);
12166
- const dataProperties = React.useMemo(() => toDataProperties({
12167
- size,
12168
- labeled: typeof children === "string" && children.length > 0
12169
- }), [children, size]);
12170
12571
  return /* @__PURE__ */ jsxRuntime.jsx(
12171
12572
  reactAriaComponents.Radio,
12172
- __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
12573
+ __spreadProps(__spreadValues({}, restProps), {
12173
12574
  className: classNames(RADIO_CLASS_NAME, className),
12174
12575
  children: withRenderProp(children, (node) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12175
- /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "radio", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { size: INDICATOR_SIZE[size] }) }),
12576
+ /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "radio", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { size: INDICATOR_SIZE }) }),
12176
12577
  node
12177
12578
  ] }))
12178
12579
  })
@@ -12193,7 +12594,6 @@ function FormRadioGroupField({
12193
12594
  const { name, state, handleChange, handleBlur } = field;
12194
12595
  const { meta, value } = state;
12195
12596
  const { errors, isValid } = meta;
12196
- const errorMessage = errors.length !== 0 ? errors[0] : void 0;
12197
12597
  const labelId = React.useId();
12198
12598
  const additionalAriaProps = showLabel ? { "aria-labelledby": labelId } : { "aria-label": label };
12199
12599
  const radioGroupClassNames = classNames(
@@ -12201,25 +12601,30 @@ function FormRadioGroupField({
12201
12601
  inline && `${FORM_RADIO_GROUP_FIELD_CLASSNAME$1}--inline`,
12202
12602
  className
12203
12603
  );
12204
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: radioGroupClassNames, children: [
12205
- showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", size: "sm", id: labelId, children: label }),
12206
- /* @__PURE__ */ jsxRuntime.jsx(
12207
- RadioGroup,
12208
- __spreadProps(__spreadValues({
12209
- slot: "radiogroup",
12210
- value,
12211
- onChange: handleChange,
12212
- onBlur: handleBlur,
12213
- name,
12214
- orientation,
12215
- isReadOnly,
12216
- isInvalid: !isValid
12217
- }, additionalAriaProps), {
12218
- children: options2.map((option) => /* @__PURE__ */ jsxRuntime.jsx(Radio, { value: option.value, size: "md", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { size: "md", slot: "description", children: option.label }) }, option.value))
12219
- })
12220
- ),
12221
- showFieldError && errorMessage && /* @__PURE__ */ jsxRuntime.jsx("span", { slot: "error", className: `${FORM_RADIO_GROUP_FIELD_CLASSNAME$1}__Error`, children: errorMessage })
12222
- ] });
12604
+ const errorMessage = errors.length !== 0 ? errors[0] : void 0;
12605
+ const shouldShowErrorMessage = showFieldError && errorMessage;
12606
+ return /* @__PURE__ */ jsxRuntime.jsxs(
12607
+ RadioGroup,
12608
+ __spreadProps(__spreadValues({
12609
+ slot: "radiogroup",
12610
+ value,
12611
+ onChange: handleChange,
12612
+ onBlur: handleBlur,
12613
+ name,
12614
+ orientation,
12615
+ isReadOnly,
12616
+ isInvalid: !isValid,
12617
+ className: radioGroupClassNames
12618
+ }, additionalAriaProps), {
12619
+ children: [
12620
+ showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", size: "sm", id: labelId, children: label }),
12621
+ /* @__PURE__ */ jsxRuntime.jsxs(VStack, { slot: "options", gap: "3xs", children: [
12622
+ /* @__PURE__ */ jsxRuntime.jsx(Stack, { direction: orientation === "horizontal" ? "row" : "column", gap: orientation === "horizontal" ? "sm" : "xs", children: options2.map((option) => /* @__PURE__ */ jsxRuntime.jsx(Radio, { value: option.value, children: /* @__PURE__ */ jsxRuntime.jsx(Span, { slot: "description", children: option.label }) }, option.value)) }),
12623
+ shouldShowErrorMessage && /* @__PURE__ */ jsxRuntime.jsx(FieldError, { children: errorMessage })
12624
+ ] })
12625
+ ]
12626
+ })
12627
+ );
12223
12628
  }
12224
12629
  const FORM_RADIO_GROUP_FIELD_CLASSNAME = "Layer__FormRadioGroupField";
12225
12630
  function FormRadioGroupYesNoField({
@@ -12236,6 +12641,7 @@ function FormRadioGroupYesNoField({
12236
12641
  const { meta, value } = state;
12237
12642
  const { errors, isValid } = meta;
12238
12643
  const errorMessage = errors.length !== 0 ? errors[0] : void 0;
12644
+ const shouldShowErrorMessage = showFieldError && errorMessage;
12239
12645
  const labelId = React.useId();
12240
12646
  const additionalAriaProps = showLabel ? { "aria-labelledby": labelId } : { "aria-label": label };
12241
12647
  const radioGroupClassNames = classNames(
@@ -12247,35 +12653,38 @@ function FormRadioGroupYesNoField({
12247
12653
  const handleRadioChange = (newValue) => {
12248
12654
  handleChange(newValue === "yes");
12249
12655
  };
12250
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: radioGroupClassNames, children: [
12251
- showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", size: "sm", id: labelId, children: label }),
12252
- /* @__PURE__ */ jsxRuntime.jsxs(
12253
- RadioGroup,
12254
- __spreadProps(__spreadValues({
12255
- slot: "radiogroup",
12256
- value: radioValue,
12257
- onChange: handleRadioChange,
12258
- onBlur: handleBlur,
12259
- name,
12260
- orientation,
12261
- isReadOnly,
12262
- isInvalid: !isValid
12263
- }, additionalAriaProps), {
12264
- children: [
12265
- /* @__PURE__ */ jsxRuntime.jsx(Radio, { value: "no", size: "md", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { size: "md", slot: "description", children: "No" }) }),
12266
- /* @__PURE__ */ jsxRuntime.jsx(Radio, { value: "yes", size: "md", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { size: "md", slot: "description", children: "Yes" }) })
12267
- ]
12268
- })
12269
- ),
12270
- showFieldError && errorMessage && /* @__PURE__ */ jsxRuntime.jsx("span", { slot: "error", className: `${FORM_RADIO_GROUP_FIELD_CLASSNAME}__Error`, children: errorMessage })
12271
- ] });
12656
+ return /* @__PURE__ */ jsxRuntime.jsxs(
12657
+ RadioGroup,
12658
+ __spreadProps(__spreadValues({
12659
+ slot: "radiogroup",
12660
+ value: radioValue,
12661
+ onChange: handleRadioChange,
12662
+ onBlur: handleBlur,
12663
+ name,
12664
+ orientation,
12665
+ isReadOnly,
12666
+ isInvalid: !isValid,
12667
+ className: radioGroupClassNames
12668
+ }, additionalAriaProps), {
12669
+ children: [
12670
+ showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", size: "sm", id: labelId, children: label }),
12671
+ /* @__PURE__ */ jsxRuntime.jsxs(VStack, { slot: "options", gap: "3xs", children: [
12672
+ /* @__PURE__ */ jsxRuntime.jsxs(Stack, { direction: orientation === "horizontal" ? "row" : "column", gap: orientation === "horizontal" ? "sm" : "xs", children: [
12673
+ /* @__PURE__ */ jsxRuntime.jsx(Radio, { value: "no", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { slot: "description", children: "No" }) }),
12674
+ /* @__PURE__ */ jsxRuntime.jsx(Radio, { value: "yes", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { slot: "description", children: "Yes" }) })
12675
+ ] }),
12676
+ shouldShowErrorMessage && /* @__PURE__ */ jsxRuntime.jsx(FieldError, { children: errorMessage })
12677
+ ] })
12678
+ ]
12679
+ })
12680
+ );
12272
12681
  }
12273
12682
  const SWITCH_CLASS_NAME = "Layer__UI__Switch";
12274
- const Switch = React.forwardRef((_$a, ref) => {
12275
- var _ab = _$a, {
12683
+ const Switch = React.forwardRef((_ub, ref) => {
12684
+ var _vb = _ub, {
12276
12685
  children,
12277
12686
  className
12278
- } = _ab, props = __objRest(_ab, [
12687
+ } = _vb, props = __objRest(_vb, [
12279
12688
  "children",
12280
12689
  "className"
12281
12690
  ]);
@@ -12325,8 +12734,8 @@ function FormSwitchField({
12325
12734
  }
12326
12735
  const TEXTAREA_CLASS_NAME = "Layer__UI__TextArea";
12327
12736
  const TextArea = React.forwardRef(
12328
- function TextArea2(_bb, ref) {
12329
- var _cb = _bb, { resize = "none" } = _cb, restProps = __objRest(_cb, ["resize"]);
12737
+ function TextArea2(_wb, ref) {
12738
+ var _xb = _wb, { resize = "none" } = _xb, restProps = __objRest(_xb, ["resize"]);
12330
12739
  const dataProperties = toDataProperties({ resize });
12331
12740
  return /* @__PURE__ */ jsxRuntime.jsx(
12332
12741
  reactAriaComponents.TextArea,
@@ -12337,8 +12746,8 @@ const TextArea = React.forwardRef(
12337
12746
  );
12338
12747
  }
12339
12748
  );
12340
- function FormTextAreaField(_db) {
12341
- var _eb = _db, { placeholder } = _eb, props = __objRest(_eb, ["placeholder"]);
12749
+ function FormTextAreaField(_yb) {
12750
+ var _zb = _yb, { placeholder } = _zb, props = __objRest(_zb, ["placeholder"]);
12342
12751
  const field = useFieldContext();
12343
12752
  const { name, state, handleChange, handleBlur } = field;
12344
12753
  const { value } = state;
@@ -12358,8 +12767,8 @@ function FormTextAreaField(_db) {
12358
12767
  }
12359
12768
  ) }));
12360
12769
  }
12361
- function FormTextField(_fb) {
12362
- var _gb = _fb, { placeholder } = _gb, props = __objRest(_gb, ["placeholder"]);
12770
+ function FormTextField(_Ab) {
12771
+ var _Bb = _Ab, { placeholder } = _Bb, props = __objRest(_Bb, ["placeholder"]);
12363
12772
  const field = useFieldContext();
12364
12773
  const { name, state, handleChange, handleBlur } = field;
12365
12774
  const { value } = state;
@@ -12386,6 +12795,8 @@ const { useAppForm: useRawAppForm } = reactForm.createFormHook({
12386
12795
  FormBigDecimalField,
12387
12796
  FormCheckboxField,
12388
12797
  FormDateField,
12798
+ FormDatePickerField,
12799
+ FormNonRecursiveBigDecimalField,
12389
12800
  FormNumberField,
12390
12801
  FormRadioGroupField,
12391
12802
  FormRadioGroupYesNoField,
@@ -12450,13 +12861,13 @@ const useCustomAccountForm = ({ onSuccess }) => {
12450
12861
  const isFormValid = reactForm.useStore(form.store, (state) => state.isValid);
12451
12862
  return { form, submitError, isFormValid };
12452
12863
  };
12453
- const Input = (_hb) => {
12454
- var _ib = _hb, {
12864
+ const Input = (_Cb) => {
12865
+ var _Db = _Cb, {
12455
12866
  className,
12456
12867
  isInvalid,
12457
12868
  errorMessage,
12458
12869
  leftText
12459
- } = _ib, props = __objRest(_ib, [
12870
+ } = _Db, props = __objRest(_Db, [
12460
12871
  "className",
12461
12872
  "isInvalid",
12462
12873
  "errorMessage",
@@ -12502,8 +12913,8 @@ const InputGroup = ({
12502
12913
  children
12503
12914
  ] });
12504
12915
  };
12505
- const ChevronDownFill = (_jb) => {
12506
- var _kb = _jb, { size = 18 } = _kb, props = __objRest(_kb, ["size"]);
12916
+ const ChevronDownFill = (_Eb) => {
12917
+ var _Fb = _Eb, { size = 18 } = _Fb, props = __objRest(_Fb, ["size"]);
12507
12918
  return /* @__PURE__ */ jsxRuntime.jsxs(
12508
12919
  "svg",
12509
12920
  __spreadProps(__spreadValues({
@@ -12528,10 +12939,10 @@ const ChevronDownFill = (_jb) => {
12528
12939
  })
12529
12940
  );
12530
12941
  };
12531
- const SelectMenuPortal = (_lb) => {
12532
- var _mb = _lb, {
12942
+ const SelectMenuPortal = (_Gb) => {
12943
+ var _Hb = _Gb, {
12533
12944
  children
12534
- } = _mb, restProps = __objRest(_mb, [
12945
+ } = _Hb, restProps = __objRest(_Hb, [
12535
12946
  "children"
12536
12947
  ]);
12537
12948
  const dataProperties = toDataProperties({ "react-aria-top-layer": true });
@@ -12556,7 +12967,7 @@ const Select = ({
12556
12967
  errorMessage,
12557
12968
  inputId,
12558
12969
  isLoading,
12559
- formatOptionLabel: formatOptionLabel2
12970
+ formatOptionLabel
12560
12971
  }) => {
12561
12972
  const baseClassName2 = classNames(
12562
12973
  "Layer__select",
@@ -12574,7 +12985,7 @@ const Select = ({
12574
12985
  classNamePrefix,
12575
12986
  placeholder: placeholder != null ? placeholder : "Select...",
12576
12987
  options: options2,
12577
- formatOptionLabel: formatOptionLabel2,
12988
+ formatOptionLabel,
12578
12989
  value,
12579
12990
  onChange: (newValue) => newValue && onChange(newValue),
12580
12991
  menuPortalTarget: document.body,
@@ -12587,8 +12998,8 @@ const Select = ({
12587
12998
  /* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
12588
12999
  ] });
12589
13000
  };
12590
- const ErrorText = (_nb) => {
12591
- var _ob = _nb, { className } = _ob, props = __objRest(_ob, ["className"]);
13001
+ const ErrorText = (_Ib) => {
13002
+ var _Jb = _Ib, { className } = _Jb, props = __objRest(_Jb, ["className"]);
12592
13003
  return /* @__PURE__ */ jsxRuntime.jsx(Text, __spreadProps(__spreadValues({}, props), { status: "error", className }));
12593
13004
  };
12594
13005
  const accountTypeOptions = [
@@ -12698,61 +13109,6 @@ const CustomAccountForm = ({ initialAccountName, onCancel, onSuccess }) => {
12698
13109
  }
12699
13110
  );
12700
13111
  };
12701
- const CreatableSelect = ({
12702
- name,
12703
- options: options2,
12704
- className,
12705
- classNamePrefix = "Layer__select",
12706
- value,
12707
- onChange,
12708
- disabled,
12709
- placeholder,
12710
- isInvalid,
12711
- errorMessage,
12712
- formatOptionLabel: formatOptionLabel2,
12713
- onCreateOption,
12714
- isValidNewOption,
12715
- formatCreateLabel: formatCreateLabel2,
12716
- inputId,
12717
- isLoading,
12718
- isClearable,
12719
- createOptionPosition = "first"
12720
- }) => {
12721
- const baseClassName2 = classNames(
12722
- "Layer__select",
12723
- isInvalid ? "Layer__select--error" : "",
12724
- className
12725
- );
12726
- const DropdownIndicator = React.useCallback((props) => /* @__PURE__ */ jsxRuntime.jsx(ReactSelect.components.DropdownIndicator, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownFill, {}) })), []);
12727
- return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { disabled: !isInvalid || !errorMessage, children: [
12728
- /* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: /* @__PURE__ */ jsxRuntime.jsx(
12729
- BaseCreatableSelect,
12730
- {
12731
- inputId,
12732
- name,
12733
- className: baseClassName2,
12734
- classNamePrefix,
12735
- placeholder: placeholder != null ? placeholder : "Select...",
12736
- options: options2,
12737
- formatOptionLabel: formatOptionLabel2,
12738
- value,
12739
- onChange: (newValue) => onChange(newValue),
12740
- onCreateOption,
12741
- isValidNewOption,
12742
- formatCreateLabel: formatCreateLabel2,
12743
- menuPortalTarget: document.body,
12744
- styles: { menuPortal: (base) => __spreadProps(__spreadValues({}, base), { zIndex: 9999 }) },
12745
- components: { DropdownIndicator, MenuPortal: SelectMenuPortal },
12746
- isLoading,
12747
- isDisabled: disabled,
12748
- isClearable,
12749
- escapeClearsValue: isClearable,
12750
- createOptionPosition
12751
- }
12752
- ) }),
12753
- /* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
12754
- ] });
12755
- };
12756
13112
  const templateHeaders = {
12757
13113
  date: "Date",
12758
13114
  description: "Description",
@@ -12780,18 +13136,27 @@ const templateExampleTransactions = [
12780
13136
  const formatCreateLabel$1 = (inputValue) => {
12781
13137
  return inputValue ? `Create "${inputValue}"` : "Create account";
12782
13138
  };
12783
- const formatOptionLabel = (option, meta) => {
13139
+ const AccountOption = ({ option, fallback }) => {
12784
13140
  if (option.account && !option.__isNew__) {
12785
- return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { children: [
12786
- /* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, children: option.account.accountName }),
12787
- (meta == null ? void 0 : meta.context) === "menu" && /* @__PURE__ */ jsxRuntime.jsxs(Span, { size: "sm", variant: "subtle", noWrap: true, children: [
12788
- option.account.institutionName,
12789
- " · ",
12790
- humanizeEnum(option.account.accountSubtype)
13141
+ return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", children: [
13142
+ /* @__PURE__ */ jsxRuntime.jsx(Check, { size: 16, className: COMBO_BOX_CLASS_NAMES.OPTION_CHECK_ICON }),
13143
+ /* @__PURE__ */ jsxRuntime.jsxs(VStack, { children: [
13144
+ /* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, children: option.account.accountName }),
13145
+ /* @__PURE__ */ jsxRuntime.jsxs(Span, { size: "sm", variant: "subtle", noWrap: true, children: [
13146
+ option.account.institutionName,
13147
+ " · ",
13148
+ humanizeEnum(option.account.accountSubtype)
13149
+ ] })
12791
13150
  ] })
12792
13151
  ] });
12793
13152
  }
12794
- return /* @__PURE__ */ jsxRuntime.jsx(Span, { children: option.label });
13153
+ return fallback;
13154
+ };
13155
+ const AccountSingleValue = ({ option, fallback }) => {
13156
+ if (option.account && !option.__isNew__) {
13157
+ return /* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, children: option.account.accountName });
13158
+ }
13159
+ return fallback;
12795
13160
  };
12796
13161
  function UploadTransactionsUploadCsvStep({ selectedAccount, onSelectAccount, selectedFile, onSelectFile, onParseCsv }) {
12797
13162
  var _a;
@@ -12846,30 +13211,27 @@ function UploadTransactionsUploadCsvStep({ selectedAccount, onSelectAccount, sel
12846
13211
  setHasParseCsvError(true);
12847
13212
  });
12848
13213
  }, [selectedAccount, isCreatingNewAccount, selectedFile, parseCsv2, onParseCsv, next]);
12849
- const inputClassName = classNames(
12850
- "Layer__upload-transactions__select-account-name-input",
12851
- !!customAccountsError && "Layer__upload-transactions__select-account-name-input--error"
12852
- );
12853
13214
  const hasSelectedAccount = selectedAccount && !isCreatingNewAccount;
12854
13215
  return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "lg", children: [
12855
- /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", className: "Layer__upload-transactions__select-account-name-field", children: [
13216
+ /* @__PURE__ */ jsxRuntime.jsxs(VStack, { pis: "3xs", gap: "xs", children: [
12856
13217
  /* @__PURE__ */ jsxRuntime.jsx(Label, { size: "md", htmlFor: "account_name", children: "Which account are these transactions from?" }),
12857
13218
  /* @__PURE__ */ jsxRuntime.jsx(
12858
- CreatableSelect,
13219
+ CreatableComboBox,
12859
13220
  {
12860
13221
  inputId: "account_name",
12861
13222
  placeholder: customAccountsError ? "Failed to load options" : "Select account...",
12862
13223
  options: accountOptions,
12863
- formatOptionLabel,
12864
- onChange: onSelectAccount,
13224
+ onSelectedValueChange: onSelectAccount,
12865
13225
  onCreateOption,
12866
13226
  formatCreateLabel: formatCreateLabel$1,
12867
13227
  isValidNewOption: () => true,
12868
- value: selectedAccount,
13228
+ selectedValue: selectedAccount,
12869
13229
  isClearable: true,
12870
13230
  isLoading: isLoadingCustomAccounts,
12871
- disabled: !!customAccountsError,
12872
- className: inputClassName
13231
+ isDisabled: !!customAccountsError,
13232
+ isError: !!customAccountsError,
13233
+ className: "Layer__upload-transactions__select-account-name-input",
13234
+ slots: { Option: AccountOption, SingleValue: AccountSingleValue }
12873
13235
  }
12874
13236
  )
12875
13237
  ] }),
@@ -13236,7 +13598,8 @@ function UploadTransactionsHeader({ currentStep, isValid, onClose }) {
13236
13598
  {
13237
13599
  heading: /* @__PURE__ */ jsxRuntime.jsx(Heading$1, { level: 1, size: "sm", children: title }),
13238
13600
  description: /* @__PURE__ */ jsxRuntime.jsx(Heading$1, { level: 2, size: "xs", variant: "subtle", weight: "normal", children: description }),
13239
- onClose
13601
+ onClose,
13602
+ hideBottomPadding: true
13240
13603
  }
13241
13604
  );
13242
13605
  }
@@ -13446,8 +13809,8 @@ const BulkActionsModule = ({ showSelectedLabel = true, fullWidth = false, slots
13446
13809
  /* @__PURE__ */ jsxRuntime.jsx(slots.BulkActions, {})
13447
13810
  ] });
13448
13811
  };
13449
- const DownloadCloud = (_pb) => {
13450
- var _qb = _pb, { size = 18 } = _qb, props = __objRest(_qb, ["size"]);
13812
+ const DownloadCloud = (_Kb) => {
13813
+ var _Lb = _Kb, { size = 18 } = _Lb, props = __objRest(_Lb, ["size"]);
13451
13814
  return /* @__PURE__ */ jsxRuntime.jsxs(
13452
13815
  "svg",
13453
13816
  __spreadProps(__spreadValues({
@@ -13665,45 +14028,6 @@ function MonthCalendar({
13665
14028
  )
13666
14029
  ] });
13667
14030
  }
13668
- const POPOVER_CLASS_NAME = "Layer__Popover";
13669
- const POPOVER_CLASS_NAMES = `Layer__Portal ${POPOVER_CLASS_NAME}`;
13670
- const Popover = React.forwardRef(
13671
- function Popover2(_rb, ref) {
13672
- var _sb = _rb, { flexInline = false } = _sb, restProps = __objRest(_sb, ["flexInline"]);
13673
- const dataProperties = toDataProperties({ "flex-inline": flexInline });
13674
- return /* @__PURE__ */ jsxRuntime.jsx(
13675
- reactAriaComponents.Popover,
13676
- __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
13677
- className: POPOVER_CLASS_NAMES,
13678
- ref
13679
- })
13680
- );
13681
- }
13682
- );
13683
- function ResponsivePopover({ children, triggerRef }) {
13684
- const { isMobile } = useSizeClass();
13685
- if (isMobile) {
13686
- return /* @__PURE__ */ jsxRuntime.jsx(
13687
- Modal,
13688
- {
13689
- flexBlock: true,
13690
- flexInline: true,
13691
- variant: "mobile-popover",
13692
- isDismissable: true,
13693
- children
13694
- }
13695
- );
13696
- }
13697
- return /* @__PURE__ */ jsxRuntime.jsx(
13698
- Popover,
13699
- {
13700
- triggerRef,
13701
- placement: "bottom left",
13702
- flexInline: true,
13703
- children
13704
- }
13705
- );
13706
- }
13707
14031
  const MonthPicker = ({
13708
14032
  label,
13709
14033
  showLabel = true,
@@ -13723,7 +14047,7 @@ const MonthPicker = ({
13723
14047
  const inputValue = dateFns.format(date2.toDate(), truncateMonth ? MONTH_YEAR_FORMAT_SHORT : MONTH_YEAR_FORMAT);
13724
14048
  const additionalAriaProps = !showLabel && { "aria-label": label };
13725
14049
  return /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.DialogTrigger, { isOpen: isPopoverOpen, onOpenChange: setPopoverOpen, children: [
13726
- showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { children: label }),
14050
+ showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", size: "sm", children: label }),
13727
14051
  /* @__PURE__ */ jsxRuntime.jsxs(
13728
14052
  InputGroup$1,
13729
14053
  {
@@ -13733,7 +14057,7 @@ const MonthPicker = ({
13733
14057
  onClick: () => setPopoverOpen(true),
13734
14058
  children: [
13735
14059
  /* @__PURE__ */ jsxRuntime.jsx(Input$1, __spreadProps(__spreadValues({ inset: true }, additionalAriaProps), { value: inputValue, readOnly: true })),
13736
- /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "3xs", align: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { icon: true, inset: true, variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 20 }) }) })
14060
+ /* @__PURE__ */ jsxRuntime.jsx(PickerDropdownIndicator, { onClick: () => setPopoverOpen(true) })
13737
14061
  ]
13738
14062
  }
13739
14063
  ),
@@ -13908,8 +14232,7 @@ const DownloadButton = ({
13908
14232
  const BankTransactionsHeader = ({
13909
14233
  shiftStickyHeader,
13910
14234
  asWidget,
13911
- mobileComponent,
13912
- listView,
14235
+ tableContentMode,
13913
14236
  stringOverrides,
13914
14237
  isSyncing,
13915
14238
  withUploadMenu,
@@ -13939,7 +14262,8 @@ const BankTransactionsHeader = ({
13939
14262
  }, [setFilters]);
13940
14263
  const { count } = useCountSelectedIds();
13941
14264
  const showBulkActions = count > 0;
13942
- const isMobileList = listView && mobileComponent === "mobileList";
14265
+ const isMobileList = tableContentMode === BankTransactionsTableContent.MobileList;
14266
+ const isListView = isMobileList || tableContentMode === BankTransactionsTableContent.List;
13943
14267
  const headerTopRow = React.useMemo(() => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__bank-transactions__header__content", children: [
13944
14268
  /* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "center", children: [
13945
14269
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -13955,7 +14279,7 @@ const BankTransactionsHeader = ({
13955
14279
  {
13956
14280
  timeSync: 5,
13957
14281
  inProgress: true,
13958
- hideContent: listView
14282
+ hideContent: isListView
13959
14283
  }
13960
14284
  )
13961
14285
  ] }),
@@ -13975,7 +14299,7 @@ const BankTransactionsHeader = ({
13975
14299
  activationDate,
13976
14300
  asWidget,
13977
14301
  isSyncing,
13978
- listView,
14302
+ isListView,
13979
14303
  monthPickerDate,
13980
14304
  setDateRange,
13981
14305
  stringOverrides == null ? void 0 : stringOverrides.header,
@@ -14010,7 +14334,8 @@ const BankTransactionsHeader = ({
14010
14334
  }
14011
14335
  );
14012
14336
  }, [isMobileList]);
14013
- const statusToggle = isCategorizationEnabled && showStatusToggle ? /* @__PURE__ */ jsxRuntime.jsx(
14337
+ const isStatusToggleVisible = isCategorizationEnabled && showStatusToggle;
14338
+ const statusToggle = isStatusToggleVisible ? /* @__PURE__ */ jsxRuntime.jsx(
14014
14339
  Toggle,
14015
14340
  {
14016
14341
  ariaLabel: "Categorization status",
@@ -14023,50 +14348,34 @@ const BankTransactionsHeader = ({
14023
14348
  fullWidth: isMobileList
14024
14349
  }
14025
14350
  ) : null;
14026
- if (isMobileList) {
14351
+ if (isListView) {
14027
14352
  return /* @__PURE__ */ jsxRuntime.jsx(
14028
14353
  Header$1,
14029
14354
  {
14030
14355
  className: classNames(
14031
14356
  "Layer__bank-transactions__header",
14032
14357
  withDatePicker && "Layer__bank-transactions__header--with-date-picker",
14033
- "Layer__bank-transactions__header--mobile"
14358
+ isMobileList && "Layer__bank-transactions__header--mobile"
14034
14359
  ),
14035
14360
  style: { top: shiftStickyHeader },
14036
- children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", children: [
14361
+ children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
14037
14362
  headerTopRow,
14038
- /* @__PURE__ */ jsxRuntime.jsx(HStack, { justify: "space-between", align: "center", gap: "xs", children: showBulkActions ? /* @__PURE__ */ jsxRuntime.jsx(
14363
+ showBulkActions && /* @__PURE__ */ jsxRuntime.jsx(
14039
14364
  BulkActionsModule,
14040
14365
  {
14041
- showSelectedLabel: false,
14042
- fullWidth: true,
14366
+ showSelectedLabel: !isMobileList,
14367
+ fullWidth: isMobileList,
14043
14368
  slots: { BulkActions }
14044
14369
  }
14045
- ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14046
- statusToggle,
14047
- /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsHeaderMenu, { actions: headerMenuActions, isDisabled: showBulkActions })
14048
- ] }) }),
14049
- /* @__PURE__ */ jsxRuntime.jsx(TransactionsSearch, { isDisabled: showBulkActions })
14050
- ] })
14051
- }
14052
- );
14053
- }
14054
- if (listView) {
14055
- return /* @__PURE__ */ jsxRuntime.jsx(
14056
- Header$1,
14057
- {
14058
- className: classNames(
14059
- "Layer__bank-transactions__header",
14060
- withDatePicker && "Layer__bank-transactions__header--with-date-picker"
14061
- ),
14062
- style: { top: shiftStickyHeader },
14063
- children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
14064
- headerTopRow,
14065
- /* @__PURE__ */ jsxRuntime.jsx(HStack, { justify: "space-between", align: "center", gap: "xs", children: showBulkActions ? /* @__PURE__ */ jsxRuntime.jsx(BulkActionsModule, { slots: { BulkActions } }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14370
+ ),
14371
+ !showBulkActions && isStatusToggleVisible && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "space-between", align: "center", gap: "xs", children: [
14066
14372
  statusToggle,
14067
- /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsHeaderMenu, { actions: headerMenuActions, isDisabled: showBulkActions })
14068
- ] }) }),
14069
- /* @__PURE__ */ jsxRuntime.jsx(TransactionsSearch, { isDisabled: showBulkActions })
14373
+ /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsHeaderMenu, { actions: headerMenuActions })
14374
+ ] }),
14375
+ /* @__PURE__ */ jsxRuntime.jsxs(HStack, { className: "Layer__bank-transactions__header__search-and-menu", align: "center", gap: "xs", children: [
14376
+ /* @__PURE__ */ jsxRuntime.jsx(TransactionsSearch, { isDisabled: showBulkActions }),
14377
+ !isStatusToggleVisible && /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsHeaderMenu, { actions: headerMenuActions, isDisabled: showBulkActions })
14378
+ ] })
14070
14379
  ] })
14071
14380
  }
14072
14381
  );
@@ -14092,7 +14401,7 @@ const BankTransactionsHeader = ({
14092
14401
  DownloadButton,
14093
14402
  {
14094
14403
  downloadButtonTextOverride: stringOverrides == null ? void 0 : stringOverrides.downloadButton,
14095
- iconOnly: listView,
14404
+ iconOnly: isListView,
14096
14405
  disabled: showBulkActions
14097
14406
  }
14098
14407
  ),
@@ -14476,8 +14785,8 @@ function useDelayedVisibility({
14476
14785
  );
14477
14786
  return { isVisible };
14478
14787
  }
14479
- const File$1 = (_tb) => {
14480
- var _ub = _tb, { size = 12 } = _ub, props = __objRest(_ub, ["size"]);
14788
+ const File$1 = (_Mb) => {
14789
+ var _Nb = _Mb, { size = 12 } = _Nb, props = __objRest(_Nb, ["size"]);
14481
14790
  return /* @__PURE__ */ jsxRuntime.jsxs(
14482
14791
  "svg",
14483
14792
  __spreadProps(__spreadValues({
@@ -14560,15 +14869,15 @@ const variants = {
14560
14869
  }
14561
14870
  }
14562
14871
  };
14563
- function AnimatedPresenceElementInner(_vb, ref) {
14564
- var _wb = _vb, {
14872
+ function AnimatedPresenceElementInner(_Ob, ref) {
14873
+ var _Pb = _Ob, {
14565
14874
  as,
14566
14875
  children,
14567
14876
  variant,
14568
14877
  isOpen,
14569
14878
  slotProps = { AnimatePresence: { initial: false } },
14570
14879
  motionKey
14571
- } = _wb, props = __objRest(_wb, [
14880
+ } = _Pb, props = __objRest(_Pb, [
14572
14881
  "as",
14573
14882
  "children",
14574
14883
  "variant",
@@ -14767,8 +15076,8 @@ function useBookkeepingPeriods() {
14767
15076
  }
14768
15077
  });
14769
15078
  }
14770
- const Clock = (_xb) => {
14771
- var _yb = _xb, { size = 18 } = _yb, props = __objRest(_yb, ["size"]);
15079
+ const Clock = (_Qb) => {
15080
+ var _Rb = _Qb, { size = 18 } = _Rb, props = __objRest(_Rb, ["size"]);
14772
15081
  return /* @__PURE__ */ jsxRuntime.jsxs(
14773
15082
  "svg",
14774
15083
  __spreadProps(__spreadValues({
@@ -15094,8 +15403,8 @@ const useSplitsForm = ({
15094
15403
  saveLocalSplitsToCategoryStore
15095
15404
  };
15096
15405
  };
15097
- const ScissorsFullOpen = (_zb) => {
15098
- var _Ab = _zb, { size = 12 } = _Ab, props = __objRest(_Ab, ["size"]);
15406
+ const ScissorsFullOpen = (_Sb) => {
15407
+ var _Tb = _Sb, { size = 12 } = _Tb, props = __objRest(_Tb, ["size"]);
15099
15408
  return /* @__PURE__ */ jsxRuntime.jsx(
15100
15409
  "svg",
15101
15410
  __spreadProps(__spreadValues({
@@ -15160,8 +15469,8 @@ const ScissorsFullOpen = (_zb) => {
15160
15469
  })
15161
15470
  );
15162
15471
  };
15163
- const Trash = (_Bb) => {
15164
- var _Cb = _Bb, { size = 18 } = _Cb, props = __objRest(_Cb, ["size"]);
15472
+ const Trash = (_Ub) => {
15473
+ var _Vb = _Ub, { size = 18 } = _Vb, props = __objRest(_Vb, ["size"]);
15165
15474
  return /* @__PURE__ */ jsxRuntime.jsxs(
15166
15475
  "svg",
15167
15476
  __spreadProps(__spreadValues({
@@ -15412,8 +15721,8 @@ const ReceiptsProvider = ({
15412
15721
  const contextData = useReceipts({ bankTransaction, isActive });
15413
15722
  return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsContext.Provider, { value: contextData, children });
15414
15723
  };
15415
- const Eye = (_Db) => {
15416
- var _Eb = _Db, { size = 18 } = _Eb, props = __objRest(_Eb, ["size"]);
15724
+ const Eye = (_Wb) => {
15725
+ var _Xb = _Wb, { size = 18 } = _Xb, props = __objRest(_Xb, ["size"]);
15417
15726
  return /* @__PURE__ */ jsxRuntime.jsx(
15418
15727
  "svg",
15419
15728
  __spreadProps(__spreadValues({
@@ -15549,11 +15858,11 @@ const FileThumb = ({
15549
15858
  }
15550
15859
  );
15551
15860
  };
15552
- const TextButton = (_Fb) => {
15553
- var _Gb = _Fb, {
15861
+ const TextButton = (_Yb) => {
15862
+ var _Zb = _Yb, {
15554
15863
  className,
15555
15864
  children
15556
- } = _Gb, props = __objRest(_Gb, [
15865
+ } = _Zb, props = __objRest(_Zb, [
15557
15866
  "className",
15558
15867
  "children"
15559
15868
  ]);
@@ -15641,8 +15950,8 @@ const openReceiptInNewTab = (url, index2) => (e) => {
15641
15950
  `);
15642
15951
  }
15643
15952
  };
15644
- const BankTransactionReceiptsWithProvider = React.forwardRef((_Hb, ref) => {
15645
- var _Ib = _Hb, { bankTransaction, isActive } = _Ib, props = __objRest(_Ib, ["bankTransaction", "isActive"]);
15953
+ const BankTransactionReceiptsWithProvider = React.forwardRef((__b, ref) => {
15954
+ var _$b = __b, { bankTransaction, isActive } = _$b, props = __objRest(_$b, ["bankTransaction", "isActive"]);
15646
15955
  return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsProvider, { bankTransaction, isActive, children: /* @__PURE__ */ jsxRuntime.jsx(BankTransactionReceipts, __spreadProps(__spreadValues({}, props), { ref })) });
15647
15956
  });
15648
15957
  BankTransactionReceiptsWithProvider.displayName = "BankTransactionReceiptsWithProvider";
@@ -15704,8 +16013,8 @@ const transformCurrencyValue = (rawValue) => {
15704
16013
  }
15705
16014
  return cleaned;
15706
16015
  };
15707
- const AmountInput = (_Jb) => {
15708
- var _Kb = _Jb, {
16016
+ const AmountInput = (_ac) => {
16017
+ var _bc = _ac, {
15709
16018
  onChange,
15710
16019
  className,
15711
16020
  leftText,
@@ -15713,7 +16022,7 @@ const AmountInput = (_Jb) => {
15713
16022
  isInvalid,
15714
16023
  badge,
15715
16024
  placeholder = "$0.00"
15716
- } = _Kb, props = __objRest(_Kb, [
16025
+ } = _bc, props = __objRest(_bc, [
15717
16026
  "onChange",
15718
16027
  "className",
15719
16028
  "leftText",
@@ -16027,12 +16336,12 @@ const useBankTransactionMemo = ({ bankTransactionId }) => {
16027
16336
  isSaved
16028
16337
  }), [form, isErrorUpdatingMemo, isUpdatingMemo, isSaved]);
16029
16338
  };
16030
- const Textarea = (_Lb) => {
16031
- var _Mb = _Lb, {
16339
+ const Textarea = (_cc) => {
16340
+ var _dc = _cc, {
16032
16341
  className,
16033
16342
  isInvalid,
16034
16343
  errorMessage
16035
- } = _Mb, props = __objRest(_Mb, [
16344
+ } = _dc, props = __objRest(_dc, [
16036
16345
  "className",
16037
16346
  "isInvalid",
16038
16347
  "errorMessage"
@@ -17011,9 +17320,6 @@ function useTagDimensionByKey({ isEnabled = true, dimensionKey }) {
17011
17320
  );
17012
17321
  return new TagDimensionByKeySWRResponse(swrResponse);
17013
17322
  }
17014
- function usePreloadTagDimensionByKey(parameters) {
17015
- useTagDimensionByKey(parameters);
17016
- }
17017
17323
  class TagValueDefinitionAsOption {
17018
17324
  constructor(tagValueDefinition) {
17019
17325
  __publicField(this, "tagValueDefinition");
@@ -17819,8 +18125,8 @@ const BankTransactionsMobileListItemCheckbox = ({
17819
18125
  }
17820
18126
  ) });
17821
18127
  };
17822
- const Paperclip = (_Nb) => {
17823
- var _Ob = _Nb, { size = 20 } = _Ob, props = __objRest(_Ob, ["size"]);
18128
+ const Paperclip = (_ec) => {
18129
+ var _fc = _ec, { size = 20 } = _fc, props = __objRest(_fc, ["size"]);
17824
18130
  return /* @__PURE__ */ jsxRuntime.jsx(
17825
18131
  "svg",
17826
18132
  __spreadProps(__spreadValues({
@@ -19541,8 +19847,8 @@ function useArchiveCategorizationRule() {
19541
19847
  }
19542
19848
  });
19543
19849
  }
19544
- const BackArrow = (_Pb) => {
19545
- var _Qb = _Pb, { size = 18 } = _Qb, props = __objRest(_Qb, ["size"]);
19850
+ const BackArrow = (_gc) => {
19851
+ var _hc = _gc, { size = 18 } = _hc, props = __objRest(_hc, ["size"]);
19546
19852
  return /* @__PURE__ */ jsxRuntime.jsx(
19547
19853
  "svg",
19548
19854
  __spreadProps(__spreadValues({
@@ -19709,31 +20015,8 @@ const usePaginationRange = ({
19709
20015
  }, [totalCount, pageSize, siblingCount, currentPage]);
19710
20016
  return paginationRange;
19711
20017
  };
19712
- const ChevronLeft = (_Rb) => {
19713
- var props = __objRest(_Rb, []);
19714
- return /* @__PURE__ */ jsxRuntime.jsx(
19715
- "svg",
19716
- __spreadProps(__spreadValues({
19717
- xmlns: "http://www.w3.org/2000/svg",
19718
- width: "18",
19719
- height: "18",
19720
- viewBox: "0 0 18 18",
19721
- fill: "none"
19722
- }, props), {
19723
- children: /* @__PURE__ */ jsxRuntime.jsx(
19724
- "path",
19725
- {
19726
- d: "M11.25 13.5L6.75 9L11.25 4.5",
19727
- stroke: "currentColor",
19728
- strokeLinecap: "round",
19729
- strokeLinejoin: "round"
19730
- }
19731
- )
19732
- })
19733
- );
19734
- };
19735
- const PaginationButton = (_Sb) => {
19736
- var _Tb = _Sb, { children, isSelected } = _Tb, buttonProps = __objRest(_Tb, ["children", "isSelected"]);
20018
+ const PaginationButton = (_ic) => {
20019
+ var _jc = _ic, { children, isSelected } = _jc, buttonProps = __objRest(_jc, ["children", "isSelected"]);
19737
20020
  return /* @__PURE__ */ jsxRuntime.jsx(
19738
20021
  Button,
19739
20022
  __spreadProps(__spreadValues({
@@ -19934,8 +20217,8 @@ const getColumnDefs = (columnConfig2) => {
19934
20217
  const CSS_PREFIX$1 = "Layer__UI__Table";
19935
20218
  const getClassName = (component, additionalClassNames, withHidden) => classNames(`${CSS_PREFIX$1}-${component}`, withHidden && `${CSS_PREFIX$1}-${component}--hidden`, additionalClassNames);
19936
20219
  const Table$1 = React.forwardRef(
19937
- (_Ub, ref) => {
19938
- var _Vb = _Ub, { children, className, nonAria, slot } = _Vb, restProps = __objRest(_Vb, ["children", "className", "nonAria", "slot"]);
20220
+ (_kc, ref) => {
20221
+ var _lc = _kc, { children, className, nonAria, slot } = _lc, restProps = __objRest(_lc, ["children", "className", "nonAria", "slot"]);
19939
20222
  const TableComponent = nonAria ? "table" : reactAriaComponents.Table;
19940
20223
  return /* @__PURE__ */ jsxRuntime.jsx(
19941
20224
  TableComponent,
@@ -19950,8 +20233,8 @@ const Table$1 = React.forwardRef(
19950
20233
  }
19951
20234
  );
19952
20235
  Table$1.displayName = "Table";
19953
- const TableHeaderInner = (_Wb, ref) => {
19954
- var _Xb = _Wb, { children, className, hideHeader, nonAria } = _Xb, restProps = __objRest(_Xb, ["children", "className", "hideHeader", "nonAria"]);
20236
+ const TableHeaderInner = (_mc, ref) => {
20237
+ var _nc = _mc, { children, className, hideHeader, nonAria } = _nc, restProps = __objRest(_nc, ["children", "className", "hideHeader", "nonAria"]);
19955
20238
  const TableHeaderComponent = nonAria ? "thead" : reactAriaComponents.TableHeader;
19956
20239
  return /* @__PURE__ */ jsxRuntime.jsx(
19957
20240
  TableHeaderComponent,
@@ -19965,8 +20248,8 @@ const TableHeaderInner = (_Wb, ref) => {
19965
20248
  };
19966
20249
  const TableHeader = React.forwardRef(TableHeaderInner);
19967
20250
  TableHeader.displayName = "TableHeader";
19968
- const TableBodyInner = (_Yb, ref) => {
19969
- var _Zb = _Yb, { children, className, nonAria } = _Zb, restProps = __objRest(_Zb, ["children", "className", "nonAria"]);
20251
+ const TableBodyInner = (_oc, ref) => {
20252
+ var _pc = _oc, { children, className, nonAria } = _pc, restProps = __objRest(_pc, ["children", "className", "nonAria"]);
19970
20253
  const TableBodyComponent = nonAria ? "tbody" : reactAriaComponents.TableBody;
19971
20254
  return /* @__PURE__ */ jsxRuntime.jsx(
19972
20255
  TableBodyComponent,
@@ -19980,8 +20263,8 @@ const TableBodyInner = (_Yb, ref) => {
19980
20263
  };
19981
20264
  const TableBody$1 = React.forwardRef(TableBodyInner);
19982
20265
  TableBody$1.displayName = "TableBody";
19983
- const RowInner = (__b, ref) => {
19984
- var _$b = __b, { children, className, depth = 0, nonAria, id } = _$b, restProps = __objRest(_$b, ["children", "className", "depth", "nonAria", "id"]);
20266
+ const RowInner = (_qc, ref) => {
20267
+ var _rc = _qc, { children, className, depth = 0, nonAria, id } = _rc, restProps = __objRest(_rc, ["children", "className", "depth", "nonAria", "id"]);
19985
20268
  const dataProperties = toDataProperties({ depth });
19986
20269
  const RowComponent = nonAria ? "tr" : reactAriaComponents.Row;
19987
20270
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -19998,8 +20281,8 @@ const RowInner = (__b, ref) => {
19998
20281
  const Row = React.forwardRef(RowInner);
19999
20282
  Row.displayName = "Row";
20000
20283
  const Column = React.forwardRef(
20001
- (_ac, ref) => {
20002
- var _bc = _ac, { children, className, nonAria, id, textAlign = "left", colSpan = 1 } = _bc, restProps = __objRest(_bc, ["children", "className", "nonAria", "id", "textAlign", "colSpan"]);
20284
+ (_sc, ref) => {
20285
+ var _tc = _sc, { children, className, nonAria, id, textAlign = "left", colSpan = 1 } = _tc, restProps = __objRest(_tc, ["children", "className", "nonAria", "id", "textAlign", "colSpan"]);
20003
20286
  const dataProperties = toDataProperties({ "text-align": textAlign });
20004
20287
  const columnClassName = getClassName("Column", className);
20005
20288
  const ColumnComponent = nonAria ? "th" : reactAriaComponents.Column;
@@ -20018,8 +20301,8 @@ const Column = React.forwardRef(
20018
20301
  );
20019
20302
  Column.displayName = "Column";
20020
20303
  const Cell = React.forwardRef(
20021
- (_cc, ref) => {
20022
- var _dc = _cc, { children, className, nonAria, id } = _dc, restProps = __objRest(_dc, ["children", "className", "nonAria", "id"]);
20304
+ (_uc, ref) => {
20305
+ var _vc = _uc, { children, className, nonAria, id } = _vc, restProps = __objRest(_vc, ["children", "className", "nonAria", "id"]);
20023
20306
  const CellComponent = nonAria ? "td" : reactAriaComponents.Cell;
20024
20307
  return /* @__PURE__ */ jsxRuntime.jsx(
20025
20308
  CellComponent,
@@ -20932,8 +21215,8 @@ function useTagDimensions({ isEnabled = true } = {}) {
20932
21215
  function usePreloadTagDimensions(parameters) {
20933
21216
  useTagDimensions(parameters);
20934
21217
  }
20935
- const Inbox = (_ec) => {
20936
- var _fc = _ec, { size = 18 } = _fc, props = __objRest(_fc, ["size"]);
21218
+ const Inbox = (_wc) => {
21219
+ var _xc = _wc, { size = 18 } = _xc, props = __objRest(_xc, ["size"]);
20937
21220
  return /* @__PURE__ */ jsxRuntime.jsxs(
20938
21221
  "svg",
20939
21222
  __spreadProps(__spreadValues({
@@ -21013,8 +21296,8 @@ function BankTransactionsListWithEmptyStates({
21013
21296
  return slots.List;
21014
21297
  }
21015
21298
  const COMPONENT_NAME$d = "bank-transactions";
21016
- const BankTransactions = (_gc) => {
21017
- var _hc = _gc, {
21299
+ const BankTransactions = (_yc) => {
21300
+ var _zc = _yc, {
21018
21301
  onError,
21019
21302
  showTags = false,
21020
21303
  showCustomerVendor = false,
@@ -21023,7 +21306,7 @@ const BankTransactions = (_gc) => {
21023
21306
  mode,
21024
21307
  renderInAppLink,
21025
21308
  filters
21026
- } = _hc, restProps = __objRest(_hc, [
21309
+ } = _zc, restProps = __objRest(_zc, [
21027
21310
  "onError",
21028
21311
  "showTags",
21029
21312
  "showCustomerVendor",
@@ -21118,7 +21401,7 @@ const BankTransactionsTableView = ({
21118
21401
  }
21119
21402
  });
21120
21403
  const isLastPage = data && !hasMore && Math.ceil(((data == null ? void 0 : data.length) || 0) / pageSize) === currentPage;
21121
- const tableContentMode = listView && mobileComponent === "mobileList" ? "MobileList" : listView ? "List" : "Table";
21404
+ const tableContentMode = listView && mobileComponent === "mobileList" ? BankTransactionsTableContent.MobileList : listView ? BankTransactionsTableContent.List : BankTransactionsTableContent.Table;
21122
21405
  const BankTransactionsTableViewContent = React.useMemo(() => {
21123
21406
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__bank-transactions__table-wrapper", children: /* @__PURE__ */ jsxRuntime.jsx(
21124
21407
  BankTransactionsTable,
@@ -21173,16 +21456,16 @@ const BankTransactionsTableView = ({
21173
21456
  }, [bankTransactions, showDescriptions, showReceiptUploads, showTooltips]);
21174
21457
  const slots = React.useMemo(() => {
21175
21458
  switch (tableContentMode) {
21176
- case "Table":
21459
+ case BankTransactionsTableContent.Table:
21177
21460
  return {
21178
21461
  List: BankTransactionsTableViewContent
21179
21462
  };
21180
- case "List":
21463
+ case BankTransactionsTableContent.List:
21181
21464
  return {
21182
21465
  List: BankTransactionsListView,
21183
21466
  Loader: BankTransactionsListLoader
21184
21467
  };
21185
- case "MobileList":
21468
+ case BankTransactionsTableContent.MobileList:
21186
21469
  return {
21187
21470
  List: BankTransactionsMobileListView,
21188
21471
  Loader: /* @__PURE__ */ jsxRuntime.jsx(MobileListSkeleton, {})
@@ -21216,8 +21499,7 @@ const BankTransactionsTableView = ({
21216
21499
  {
21217
21500
  shiftStickyHeader,
21218
21501
  asWidget,
21219
- mobileComponent,
21220
- listView,
21502
+ tableContentMode,
21221
21503
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.bankTransactionsHeader,
21222
21504
  isSyncing,
21223
21505
  withUploadMenu: showUploadOptions,
@@ -21233,7 +21515,7 @@ const BankTransactionsTableView = ({
21233
21515
  isOpen: !!ruleSuggestion,
21234
21516
  onOpenChange: handleRuleSuggestionOpenChange,
21235
21517
  ruleSuggestion,
21236
- variant: tableContentMode === "MobileList" ? "drawer" : "modal"
21518
+ variant: tableContentMode === BankTransactionsTableContent.MobileList ? "drawer" : "modal"
21237
21519
  }
21238
21520
  ),
21239
21521
  !isMonthlyViewMode && !isLoading && /* @__PURE__ */ jsxRuntime.jsx(HStack, { justify: "end", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -21330,8 +21612,8 @@ function QuickbooksContextProvider({ children }) {
21330
21612
  const quickbooksContextData = useQuickbooks();
21331
21613
  return /* @__PURE__ */ jsxRuntime.jsx(QuickbooksContext.Provider, { value: quickbooksContextData, children });
21332
21614
  }
21333
- const Cog = (_ic) => {
21334
- var _jc = _ic, { size = 12 } = _jc, props = __objRest(_jc, ["size"]);
21615
+ const Cog = (_Ac) => {
21616
+ var _Bc = _Ac, { size = 12 } = _Bc, props = __objRest(_Bc, ["size"]);
21335
21617
  const id = React.useId();
21336
21618
  return /* @__PURE__ */ jsxRuntime.jsxs(
21337
21619
  "svg",
@@ -21352,8 +21634,8 @@ const Cog = (_ic) => {
21352
21634
  })
21353
21635
  );
21354
21636
  };
21355
- const QuickbooksIcon = (_kc) => {
21356
- var _lc = _kc, { size = 24 } = _lc, props = __objRest(_lc, ["size"]);
21637
+ const QuickbooksIcon = (_Cc) => {
21638
+ var _Dc = _Cc, { size = 24 } = _Dc, props = __objRest(_Dc, ["size"]);
21357
21639
  return /* @__PURE__ */ jsxRuntime.jsxs(
21358
21640
  "svg",
21359
21641
  __spreadProps(__spreadValues({
@@ -21512,8 +21794,8 @@ function IntegrationsQuickbooksUnlinkConfirmationModal({ isOpen, onOpenChange })
21512
21794
  }
21513
21795
  );
21514
21796
  }
21515
- const MoreVertical = (_mc) => {
21516
- var _nc = _mc, { size = 18 } = _nc, props = __objRest(_nc, ["size"]);
21797
+ const MoreVertical = (_Ec) => {
21798
+ var _Fc = _Ec, { size = 18 } = _Fc, props = __objRest(_Fc, ["size"]);
21517
21799
  return /* @__PURE__ */ jsxRuntime.jsxs(
21518
21800
  "svg",
21519
21801
  __spreadProps(__spreadValues({
@@ -21742,8 +22024,8 @@ const IntegrationsComponent = ({
21742
22024
  (quickbooksConnectionStatus == null ? void 0 : quickbooksConnectionStatus.is_connected) && /* @__PURE__ */ jsxRuntime.jsx(IntegrationsContent, {})
21743
22025
  ] });
21744
22026
  };
21745
- const PlusIcon = (_oc) => {
21746
- var _pc = _oc, { size = 14 } = _pc, props = __objRest(_pc, ["size"]);
22027
+ const PlusIcon = (_Gc) => {
22028
+ var _Hc = _Gc, { size = 14 } = _Hc, props = __objRest(_Hc, ["size"]);
21747
22029
  return /* @__PURE__ */ jsxRuntime.jsxs(
21748
22030
  "svg",
21749
22031
  __spreadProps(__spreadValues({
@@ -21785,8 +22067,8 @@ const PlusIcon = (_oc) => {
21785
22067
  })
21786
22068
  );
21787
22069
  };
21788
- const InstitutionIcon = (_qc) => {
21789
- var _rc = _qc, { size = 18 } = _rc, props = __objRest(_rc, ["size"]);
22070
+ const InstitutionIcon = (_Ic) => {
22071
+ var _Jc = _Ic, { size = 18 } = _Jc, props = __objRest(_Jc, ["size"]);
21790
22072
  return /* @__PURE__ */ jsxRuntime.jsxs(
21791
22073
  "svg",
21792
22074
  __spreadProps(__spreadValues({
@@ -22404,8 +22686,8 @@ const MenuItem = React.forwardRef(
22404
22686
  );
22405
22687
  const PILL_CLASS_NAME = "Layer__Pill";
22406
22688
  const Pill = React.forwardRef(
22407
- function Pill2(_sc, ref) {
22408
- var _tc = _sc, { children, status } = _tc, restProps = __objRest(_tc, ["children", "status"]);
22689
+ function Pill2(_Kc, ref) {
22690
+ var _Lc = _Kc, { children, status } = _Lc, restProps = __objRest(_Lc, ["children", "status"]);
22409
22691
  const dataProperties = toDataProperties({ status });
22410
22692
  return /* @__PURE__ */ jsxRuntime.jsx(
22411
22693
  reactAriaComponents.Button,
@@ -22766,158 +23048,9 @@ const LinkedAccountsContent = ({
22766
23048
  /* @__PURE__ */ jsxRuntime.jsx(LinkedAccountsConfirmationModal, {})
22767
23049
  ] });
22768
23050
  };
22769
- const CALENDAR_CLASS_NAME = "Layer__UI__Calendar";
22770
- const Calendar = React.forwardRef(
22771
- function Calendar2(_uc, ref) {
22772
- var _vc = _uc, { className, isReadOnly } = _vc, restProps = __objRest(_vc, ["className", "isReadOnly"]);
22773
- const dataProperties = toDataProperties({ readonly: isReadOnly });
22774
- return /* @__PURE__ */ jsxRuntime.jsx(
22775
- reactAriaComponents.Calendar,
22776
- __spreadProps(__spreadValues(__spreadValues({}, dataProperties), restProps), {
22777
- isReadOnly,
22778
- className: classNames(CALENDAR_CLASS_NAME, className),
22779
- ref
22780
- })
22781
- );
22782
- }
22783
- );
22784
- const CALENDAR_GRID_CLASS_NAME = "Layer__UI__CalendarGrid";
22785
- const CalendarGrid = React.forwardRef(
22786
- function CalendarGrid2(_wc, ref) {
22787
- var _xc = _wc, { className } = _xc, restProps = __objRest(_xc, ["className"]);
22788
- return /* @__PURE__ */ jsxRuntime.jsx(
22789
- reactAriaComponents.CalendarGrid,
22790
- __spreadProps(__spreadValues({}, restProps), {
22791
- className: classNames(CALENDAR_GRID_CLASS_NAME, className),
22792
- ref
22793
- })
22794
- );
22795
- }
22796
- );
22797
- const CALENDAR_GRID_BODY_CLASS_NAME = "Layer__UI__CalendarGridBody";
22798
- const CalendarGridBody = React.forwardRef(
22799
- function CalendarGridBody2(_yc, ref) {
22800
- var _zc = _yc, { className } = _zc, restProps = __objRest(_zc, ["className"]);
22801
- return /* @__PURE__ */ jsxRuntime.jsx(
22802
- reactAriaComponents.CalendarGridBody,
22803
- __spreadProps(__spreadValues({}, restProps), {
22804
- className: classNames(CALENDAR_GRID_BODY_CLASS_NAME, className),
22805
- ref
22806
- })
22807
- );
22808
- }
22809
- );
22810
- const CALENDAR_CELL_CLASS_NAME = "Layer__UI__CalendarCell";
22811
- const CalendarCell = React.forwardRef(
22812
- function CalendarCell2(_Ac, ref) {
22813
- var _Bc = _Ac, { className, size = "sm" } = _Bc, restProps = __objRest(_Bc, ["className", "size"]);
22814
- const dataProperties = toDataProperties({ size });
22815
- return /* @__PURE__ */ jsxRuntime.jsx(
22816
- reactAriaComponents.CalendarCell,
22817
- __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
22818
- className: classNames(CALENDAR_CELL_CLASS_NAME, className),
22819
- ref
22820
- })
22821
- );
22822
- }
22823
- );
22824
- const CALENDAR_GRID_HEADER_CLASS_NAME = "Layer__UI__CalendarGridHeader";
22825
- const CalendarGridHeader = React.forwardRef(
22826
- function CalendarGridHeader2(_Cc, ref) {
22827
- var _Dc = _Cc, { className } = _Dc, restProps = __objRest(_Dc, ["className"]);
22828
- return /* @__PURE__ */ jsxRuntime.jsx(
22829
- reactAriaComponents.CalendarGridHeader,
22830
- __spreadProps(__spreadValues({}, restProps), {
22831
- className: classNames(CALENDAR_GRID_HEADER_CLASS_NAME, className),
22832
- ref
22833
- })
22834
- );
22835
- }
22836
- );
22837
- const CALENDAR_HEADER_CELL_CLASS_NAME = "Layer__UI__CalendarHeaderCell";
22838
- const CalendarHeaderCell = React.forwardRef(
22839
- function CalendarHeaderCell2(_Ec, ref) {
22840
- var _Fc = _Ec, { className, size = "sm" } = _Fc, restProps = __objRest(_Fc, ["className", "size"]);
22841
- const dataProperties = toDataProperties({ size });
22842
- return /* @__PURE__ */ jsxRuntime.jsx(
22843
- reactAriaComponents.CalendarHeaderCell,
22844
- __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
22845
- className: classNames(CALENDAR_HEADER_CELL_CLASS_NAME, className),
22846
- ref
22847
- })
22848
- );
22849
- }
22850
- );
22851
- const DateCalendar = ({ minDate, maxDate, variant }) => {
22852
- return /* @__PURE__ */ jsxRuntime.jsxs(Calendar, { minValue: minDate, maxValue: maxDate, children: [
22853
- /* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "center", justify: "space-between", pb: "xs", pi: "xs", className: "Layer__DateCalendar__Header", children: [
22854
- /* @__PURE__ */ jsxRuntime.jsx(Button, { icon: true, inset: true, variant: "ghost", slot: "previous", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeft, { size: 20 }) }),
22855
- /* @__PURE__ */ jsxRuntime.jsx(Heading$1, { weight: "normal", size: "sm" }),
22856
- /* @__PURE__ */ jsxRuntime.jsx(Button, { icon: true, inset: true, variant: "ghost", slot: "next", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 20 }) })
22857
- ] }),
22858
- /* @__PURE__ */ jsxRuntime.jsx(HStack, { pb: "xs", pi: "xs", children: /* @__PURE__ */ jsxRuntime.jsxs(CalendarGrid, { children: [
22859
- /* @__PURE__ */ jsxRuntime.jsx(CalendarGridHeader, { children: (day) => /* @__PURE__ */ jsxRuntime.jsx(CalendarHeaderCell, { size: variant === "mobile" ? "md" : "sm", children: day }) }),
22860
- /* @__PURE__ */ jsxRuntime.jsx(CalendarGridBody, { children: (date2) => /* @__PURE__ */ jsxRuntime.jsx(CalendarCell, { date: date2, size: variant === "mobile" ? "md" : "sm" }) })
22861
- ] }) })
22862
- ] });
22863
- };
22864
- const DatePickerInput = ({ errorText, variant, onClick }) => {
22865
- const errorTriangle = React.useMemo(() => {
22866
- if (variant === "mobile" || !errorText) return null;
22867
- return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { offset: 12, children: [
22868
- /* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(FieldError, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, { size: 18 }) }) }),
22869
- /* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", width: "md", children: errorText })
22870
- ] });
22871
- }, [errorText, variant]);
22872
- if (variant === "mobile") {
22873
- return /* @__PURE__ */ jsxRuntime.jsx(InputGroup$1, { slot: "input", isInvalid: !!errorText, onClick, children: /* @__PURE__ */ jsxRuntime.jsx(DateInput, { inset: true, pointerEvents: "none", children: (segment) => /* @__PURE__ */ jsxRuntime.jsx(DateSegment, { isReadOnly: true, segment }) }) });
22874
- }
22875
- return /* @__PURE__ */ jsxRuntime.jsxs(InputGroup$1, { slot: "input", isInvalid: !!errorText, children: [
22876
- /* @__PURE__ */ jsxRuntime.jsx(DateInput, { inset: true, children: (segment) => /* @__PURE__ */ jsxRuntime.jsx(DateSegment, { segment }) }),
22877
- /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "3xs", align: "center", children: [
22878
- errorTriangle,
22879
- /* @__PURE__ */ jsxRuntime.jsx(Button, { icon: true, inset: true, variant: "ghost", onClick, children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 20 }) })
22880
- ] })
22881
- ] });
22882
- };
22883
- const DatePicker = ({
22884
- label,
22885
- showLabel = true,
22886
- date: date2,
22887
- minDate,
22888
- maxDate,
22889
- isInvalid,
22890
- errorText,
22891
- onBlur,
22892
- onChange,
22893
- isDisabled
22894
- }) => {
22895
- const additionalAriaProps = !showLabel && { "aria-label": label };
22896
- const { value } = useSizeClass();
22897
- const [isPopoverOpen, setPopoverOpen] = React.useState(false);
22898
- return /* @__PURE__ */ jsxRuntime.jsxs(
22899
- DatePicker$1,
22900
- __spreadProps(__spreadValues({
22901
- granularity: "day",
22902
- value: date2,
22903
- onBlur,
22904
- onChange,
22905
- isInvalid
22906
- }, additionalAriaProps), {
22907
- isOpen: isPopoverOpen,
22908
- onOpenChange: setPopoverOpen,
22909
- isDisabled,
22910
- children: [
22911
- showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { children: label }),
22912
- /* @__PURE__ */ jsxRuntime.jsx(DatePickerInput, { errorText, variant: value, onClick: () => setPopoverOpen(true) }),
22913
- /* @__PURE__ */ jsxRuntime.jsx(ResponsivePopover, { children: /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Dialog, { children: /* @__PURE__ */ jsxRuntime.jsx(DateCalendar, { minDate, maxDate, variant: value }) }) })
22914
- ]
22915
- })
22916
- );
22917
- };
22918
23051
  const getIsDateInvalid = (date2, { minDate, maxDate }) => {
22919
23052
  if (date2 === null) return "Cannot select empty date";
22920
- if (minDate && date2.compare(minDate) < 0) return "Cannot select date before the business activation date";
23053
+ if (minDate && date2.compare(minDate) < 0) return `Cannot select date before ${formatDate(minDate.toDate())}`;
22921
23054
  if (maxDate && date2.compare(maxDate) > 0) return "Cannot select date in the future";
22922
23055
  return null;
22923
23056
  };
@@ -23945,14 +24078,14 @@ const formatYAxisValue = (value) => {
23945
24078
  return value;
23946
24079
  }
23947
24080
  };
23948
- const CustomizedYTick = (_Gc) => {
23949
- var _Hc = _Gc, {
24081
+ const CustomizedYTick = (_Mc) => {
24082
+ var _Nc = _Mc, {
23950
24083
  verticalAnchor: _verticalAnchor,
23951
24084
  visibleTicksCount: _visibleTicksCount,
23952
24085
  tickFormatter: _tickFormatter,
23953
24086
  format,
23954
24087
  payload
23955
- } = _Hc, restProps = __objRest(_Hc, [
24088
+ } = _Nc, restProps = __objRest(_Nc, [
23956
24089
  "verticalAnchor",
23957
24090
  "visibleTicksCount",
23958
24091
  "tickFormatter",
@@ -23961,8 +24094,8 @@ const CustomizedYTick = (_Gc) => {
23961
24094
  ]);
23962
24095
  return /* @__PURE__ */ jsxRuntime.jsx("text", __spreadProps(__spreadValues({}, restProps), { className: "Layer__ChartYAxis__tick", children: /* @__PURE__ */ jsxRuntime.jsx("tspan", { dy: "0.355em", children: format(payload.value) }) }));
23963
24096
  };
23964
- const ChartYAxis = (_Ic) => {
23965
- var _Jc = _Ic, { format = formatYAxisValue } = _Jc, props = __objRest(_Jc, ["format"]);
24097
+ const ChartYAxis = (_Oc) => {
24098
+ var _Pc = _Oc, { format = formatYAxisValue } = _Pc, props = __objRest(_Pc, ["format"]);
23966
24099
  const tick = (tickProps) => /* @__PURE__ */ jsxRuntime.jsx(CustomizedYTick, __spreadProps(__spreadValues({}, tickProps), { format }));
23967
24100
  return /* @__PURE__ */ jsxRuntime.jsx(recharts.YAxis, __spreadValues({ tick }, props));
23968
24101
  };
@@ -24210,8 +24343,8 @@ const renderLegendContent = () => {
24210
24343
  )) });
24211
24344
  };
24212
24345
  const ProfitAndLossChartLegend = () => /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, { verticalAlign: "top", align: "right", content: renderLegendContent });
24213
- const BarChart2 = (_Kc) => {
24214
- var _Lc = _Kc, { size = 12 } = _Lc, props = __objRest(_Lc, ["size"]);
24346
+ const BarChart2 = (_Qc) => {
24347
+ var _Rc = _Qc, { size = 12 } = _Rc, props = __objRest(_Rc, ["size"]);
24215
24348
  return /* @__PURE__ */ jsxRuntime.jsxs(
24216
24349
  "svg",
24217
24350
  __spreadProps(__spreadValues({
@@ -24291,13 +24424,13 @@ const ChartTooltipCursor = ({ width, points, height }) => {
24291
24424
  }
24292
24425
  ) });
24293
24426
  };
24294
- const ChartTooltip = (_Mc) => {
24295
- var _Nc = _Mc, {
24427
+ const ChartTooltip = (_Sc) => {
24428
+ var _Tc = _Sc, {
24296
24429
  content,
24297
24430
  cursorWidth,
24298
24431
  animationDuration = 100,
24299
24432
  animationEasing = "ease-out"
24300
- } = _Nc, props = __objRest(_Nc, [
24433
+ } = _Tc, props = __objRest(_Tc, [
24301
24434
  "content",
24302
24435
  "cursorWidth",
24303
24436
  "animationDuration",
@@ -24559,11 +24692,11 @@ const ProfitAndLossChart = ({ tagFilter }) => {
24559
24692
  isSyncing ? /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossChartStateCard, {}) : null
24560
24693
  ] });
24561
24694
  };
24562
- const BackButton = (_Oc) => {
24563
- var _Pc = _Oc, {
24695
+ const BackButton = (_Uc) => {
24696
+ var _Vc = _Uc, {
24564
24697
  className,
24565
24698
  textOnly = false
24566
- } = _Pc, props = __objRest(_Pc, [
24699
+ } = _Vc, props = __objRest(_Vc, [
24567
24700
  "className",
24568
24701
  "textOnly"
24569
24702
  ]);
@@ -24617,8 +24750,8 @@ const TASKS_CHARTS_COLORS = {
24617
24750
  done: "#3B9C63",
24618
24751
  pending: "#DFA000"
24619
24752
  };
24620
- const SortArrows = (_Qc) => {
24621
- var _Rc = _Qc, { size = 13 } = _Rc, props = __objRest(_Rc, ["size"]);
24753
+ const SortArrows = (_Wc) => {
24754
+ var _Xc = _Wc, { size = 13 } = _Xc, props = __objRest(_Xc, ["size"]);
24622
24755
  return /* @__PURE__ */ jsxRuntime.jsxs(
24623
24756
  "svg",
24624
24757
  __spreadProps(__spreadValues({
@@ -25149,11 +25282,11 @@ const LedgerAccountsContext = React.createContext({
25149
25282
  fetchMore: () => {
25150
25283
  }
25151
25284
  });
25152
- const CloseButton = (_Sc) => {
25153
- var _Tc = _Sc, {
25285
+ const CloseButton = (_Yc) => {
25286
+ var _Zc = _Yc, {
25154
25287
  className,
25155
25288
  textOnly = false
25156
- } = _Tc, props = __objRest(_Tc, [
25289
+ } = _Zc, props = __objRest(_Zc, [
25157
25290
  "className",
25158
25291
  "textOnly"
25159
25292
  ]);
@@ -26163,16 +26296,21 @@ const DateSelectionComboBox = () => {
26163
26296
  const nextRange = rangeForPreset(nextPreset);
26164
26297
  setDateRange(nextRange);
26165
26298
  }, [setDateRange]);
26166
- return /* @__PURE__ */ jsxRuntime.jsx(
26167
- ComboBox,
26168
- {
26169
- options: options$4,
26170
- onSelectedValueChange,
26171
- selectedValue: selectedOption,
26172
- isSearchable: false,
26173
- isClearable: false
26174
- }
26175
- );
26299
+ const inputId = React.useId();
26300
+ return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { children: [
26301
+ /* @__PURE__ */ jsxRuntime.jsx(Label, { size: "2xs", htmlFor: inputId, children: "Date Range" }),
26302
+ /* @__PURE__ */ jsxRuntime.jsx(
26303
+ ComboBox,
26304
+ {
26305
+ options: options$4,
26306
+ onSelectedValueChange,
26307
+ selectedValue: selectedOption,
26308
+ isSearchable: false,
26309
+ isClearable: false,
26310
+ inputId
26311
+ }
26312
+ )
26313
+ ] });
26176
26314
  };
26177
26315
  const GlobalDateRangePicker = () => {
26178
26316
  const { startDate: globalStartDate, endDate: globalEndDate } = useGlobalDateRange({ dateSelectionMode: "full" });
@@ -26214,28 +26352,36 @@ const GlobalDateRangePicker = () => {
26214
26352
  DatePicker,
26215
26353
  {
26216
26354
  label: "Start Date",
26217
- showLabel: false,
26218
26355
  date: localStartDate,
26219
26356
  onChange: onChangeStartDate,
26220
26357
  minDate: minStartDate,
26221
26358
  maxDate: maxStartDate,
26222
26359
  isInvalid: startDateInvalid,
26223
26360
  errorText: startDateErrorText,
26224
- onBlur: onBlurStartDate
26361
+ onBlur: onBlurStartDate,
26362
+ slotProps: {
26363
+ Label: {
26364
+ size: "2xs"
26365
+ }
26366
+ }
26225
26367
  }
26226
26368
  ),
26227
26369
  /* @__PURE__ */ jsxRuntime.jsx(
26228
26370
  DatePicker,
26229
26371
  {
26230
26372
  label: "End Date",
26231
- showLabel: false,
26232
26373
  date: localEndDate,
26233
26374
  onChange: onChangeEndDate,
26234
26375
  minDate: minEndDate,
26235
26376
  maxDate: maxEndDate,
26236
26377
  isInvalid: endDateInvalid,
26237
26378
  errorText: endDateErrorText,
26238
- onBlur: onBlurEndDate
26379
+ onBlur: onBlurEndDate,
26380
+ slotProps: {
26381
+ Label: {
26382
+ size: "2xs"
26383
+ }
26384
+ }
26239
26385
  }
26240
26386
  )
26241
26387
  ] });
@@ -27697,10 +27843,10 @@ function Internal_ProfitAndLossSummaries({
27697
27843
  unstable_AdditionalListItems.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossSummariesListItem, { children: item }, index2))
27698
27844
  ] }) });
27699
27845
  }
27700
- function ProfitAndLossSummaries(_Uc) {
27701
- var _Vc = _Uc, {
27846
+ function ProfitAndLossSummaries(__c) {
27847
+ var _$c = __c, {
27702
27848
  onTransactionsToReviewClick
27703
- } = _Vc, restProps = __objRest(_Vc, [
27849
+ } = _$c, restProps = __objRest(_$c, [
27704
27850
  "onTransactionsToReviewClick"
27705
27851
  ]);
27706
27852
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -27899,8 +28045,8 @@ function BalanceSheetDownloadButton({
27899
28045
  /* @__PURE__ */ jsxRuntime.jsx(InvisibleDownload, { ref: invisibleDownloadRef })
27900
28046
  ] });
27901
28047
  }
27902
- const Collapse = (_Wc) => {
27903
- var props = __objRest(_Wc, []);
28048
+ const Collapse = (_ad) => {
28049
+ var props = __objRest(_ad, []);
27904
28050
  return /* @__PURE__ */ jsxRuntime.jsxs(
27905
28051
  "svg",
27906
28052
  __spreadProps(__spreadValues({
@@ -27933,8 +28079,8 @@ const Collapse = (_Wc) => {
27933
28079
  })
27934
28080
  );
27935
28081
  };
27936
- const Expand = (_Xc) => {
27937
- var props = __objRest(_Xc, []);
28082
+ const Expand = (_bd) => {
28083
+ var props = __objRest(_bd, []);
27938
28084
  return /* @__PURE__ */ jsxRuntime.jsxs(
27939
28085
  "svg",
27940
28086
  __spreadProps(__spreadValues({
@@ -28101,14 +28247,18 @@ const GlobalDatePicker = () => {
28101
28247
  DatePicker,
28102
28248
  {
28103
28249
  label: "Effective Date",
28104
- showLabel: false,
28105
28250
  date: localDate,
28106
28251
  onChange,
28107
28252
  minDate: minDateZdt,
28108
28253
  maxDate: maxDateZdt,
28109
28254
  isInvalid,
28110
28255
  errorText,
28111
- onBlur
28256
+ onBlur,
28257
+ slotProps: {
28258
+ Label: {
28259
+ size: "2xs"
28260
+ }
28261
+ }
28112
28262
  }
28113
28263
  );
28114
28264
  };
@@ -29622,8 +29772,8 @@ const ChartOfAccountsContext = React.createContext(
29622
29772
  }
29623
29773
  }
29624
29774
  );
29625
- const Plus = (_Yc) => {
29626
- var _Zc = _Yc, { size = 14 } = _Zc, props = __objRest(_Zc, ["size"]);
29775
+ const Plus = (_cd) => {
29776
+ var _dd = _cd, { size = 14 } = _dd, props = __objRest(_dd, ["size"]);
29627
29777
  return /* @__PURE__ */ jsxRuntime.jsxs(
29628
29778
  "svg",
29629
29779
  __spreadProps(__spreadValues({
@@ -29994,8 +30144,8 @@ var LedgerAccountNodeType = /* @__PURE__ */ ((LedgerAccountNodeType2) => {
29994
30144
  LedgerAccountNodeType2["Parent"] = "Parent";
29995
30145
  return LedgerAccountNodeType2;
29996
30146
  })(LedgerAccountNodeType || {});
29997
- const Edit2 = (__c) => {
29998
- var _$c = __c, { size = 18 } = _$c, props = __objRest(_$c, ["size"]);
30147
+ const Edit2 = (_ed) => {
30148
+ var _fd = _ed, { size = 18 } = _fd, props = __objRest(_fd, ["size"]);
29999
30149
  return /* @__PURE__ */ jsxRuntime.jsx(
30000
30150
  "svg",
30001
30151
  __spreadProps(__spreadValues({
@@ -32626,8 +32776,8 @@ const TasksHeader = ({
32626
32776
  }) => {
32627
32777
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__tasks-header", children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.lg, children: tasksHeader }) });
32628
32778
  };
32629
- const SmileIcon = (_ad) => {
32630
- var _bd = _ad, { size = 12 } = _bd, props = __objRest(_bd, ["size"]);
32779
+ const SmileIcon = (_gd) => {
32780
+ var _hd = _gd, { size = 12 } = _hd, props = __objRest(_hd, ["size"]);
32631
32781
  return /* @__PURE__ */ jsxRuntime.jsxs(
32632
32782
  "svg",
32633
32783
  __spreadProps(__spreadValues({
@@ -33472,8 +33622,8 @@ const useBookkeepingYearsStatus = () => {
33472
33622
  isLoading
33473
33623
  };
33474
33624
  };
33475
- const ArrowRightCircle = (_cd) => {
33476
- var _dd = _cd, { size = 18 } = _dd, props = __objRest(_dd, ["size"]);
33625
+ const ArrowRightCircle = (_id) => {
33626
+ var _jd = _id, { size = 18 } = _jd, props = __objRest(_jd, ["size"]);
33477
33627
  return /* @__PURE__ */ jsxRuntime.jsxs(
33478
33628
  "svg",
33479
33629
  __spreadProps(__spreadValues({
@@ -35521,12 +35671,12 @@ const FormSection = ({ children, title }) => {
35521
35671
  children
35522
35672
  ] });
35523
35673
  };
35524
- const PhoneInput = (_ed) => {
35525
- var _fd = _ed, {
35674
+ const PhoneInput = (_kd) => {
35675
+ var _ld = _kd, {
35526
35676
  value,
35527
35677
  onChange,
35528
35678
  placeholder = "Phone number"
35529
- } = _fd, props = __objRest(_fd, [
35679
+ } = _ld, props = __objRest(_ld, [
35530
35680
  "value",
35531
35681
  "onChange",
35532
35682
  "placeholder"
@@ -35818,8 +35968,8 @@ const SummaryStep = ({ onNext, title = defaultTitle$1, description = defaultDesc
35818
35968
  /* @__PURE__ */ jsxRuntime.jsx(Button$1, { onClick: onNext, children: nextBtnText })
35819
35969
  ] });
35820
35970
  };
35821
- const Document = (_gd) => {
35822
- var _hd = _gd, { size = 20 } = _hd, props = __objRest(_hd, ["size"]);
35971
+ const Document = (_md) => {
35972
+ var _nd = _md, { size = 20 } = _nd, props = __objRest(_nd, ["size"]);
35823
35973
  return /* @__PURE__ */ jsxRuntime.jsxs(
35824
35974
  "svg",
35825
35975
  __spreadProps(__spreadValues({
@@ -35924,8 +36074,8 @@ const Document = (_gd) => {
35924
36074
  })
35925
36075
  );
35926
36076
  };
35927
- const TrendingUp = (_id) => {
35928
- var _jd = _id, { size = 20 } = _jd, props = __objRest(_jd, ["size"]);
36077
+ const TrendingUp = (_od) => {
36078
+ var _pd = _od, { size = 20 } = _pd, props = __objRest(_pd, ["size"]);
35929
36079
  return /* @__PURE__ */ jsxRuntime.jsxs(
35930
36080
  "svg",
35931
36081
  __spreadProps(__spreadValues({
@@ -36182,8 +36332,8 @@ const PlatformOnboarding = ({ onComplete }) => {
36182
36332
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__platform-onboarding-layout__footer", children: renderStepFooter() })
36183
36333
  ] }) });
36184
36334
  };
36185
- const CoffeeIcon = (_kd) => {
36186
- var _ld = _kd, { size = 11 } = _ld, props = __objRest(_ld, ["size"]);
36335
+ const CoffeeIcon = (_qd) => {
36336
+ var _rd = _qd, { size = 11 } = _rd, props = __objRest(_rd, ["size"]);
36187
36337
  return /* @__PURE__ */ jsxRuntime.jsxs(
36188
36338
  "svg",
36189
36339
  __spreadProps(__spreadValues({
@@ -36254,8 +36404,8 @@ const CoffeeIcon = (_kd) => {
36254
36404
  })
36255
36405
  );
36256
36406
  };
36257
- const Link = (_md) => {
36258
- var _nd = _md, {
36407
+ const Link = (_sd) => {
36408
+ var _td = _sd, {
36259
36409
  className,
36260
36410
  children,
36261
36411
  variant = ButtonVariant.primary,
@@ -36265,7 +36415,7 @@ const Link = (_md) => {
36265
36415
  iconAsPrimary = false,
36266
36416
  justify = "center",
36267
36417
  fullWidth
36268
- } = _nd, props = __objRest(_nd, [
36418
+ } = _td, props = __objRest(_td, [
36269
36419
  "className",
36270
36420
  "children",
36271
36421
  "variant",
@@ -36357,8 +36507,8 @@ const BookkeepingUpsellBar = ({
36357
36507
  onClick ? /* @__PURE__ */ jsxRuntime.jsx(Button$1, { variant: ButtonVariant.secondary, onClick, children: "Schedule a demo" }) : href ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href, target: "_blank", variant: ButtonVariant.secondary, children: "Schedule a demo" }) : null
36358
36508
  ] });
36359
36509
  };
36360
- const ChevronRightFill = (_od) => {
36361
- var _pd = _od, { size = 18 } = _pd, props = __objRest(_pd, ["size"]);
36510
+ const ChevronRightFill = (_ud) => {
36511
+ var _vd = _ud, { size = 18 } = _vd, props = __objRest(_vd, ["size"]);
36362
36512
  return /* @__PURE__ */ jsxRuntime.jsxs(
36363
36513
  "svg",
36364
36514
  __spreadProps(__spreadValues({
@@ -36654,7 +36804,11 @@ const InvoiceSchema = effect.Schema.Struct({
36654
36804
  effect.Schema.propertySignature(effect.Schema.NullOr(effect.Schema.Date)),
36655
36805
  effect.Schema.fromKey("updated_at")
36656
36806
  ),
36657
- memo: effect.Schema.NullOr(effect.Schema.String)
36807
+ memo: effect.Schema.NullOr(effect.Schema.String),
36808
+ customPaymentInstructions: effect.pipe(
36809
+ effect.Schema.propertySignature(effect.Schema.NullOr(effect.Schema.String)),
36810
+ effect.Schema.fromKey("custom_payment_instructions")
36811
+ )
36658
36812
  });
36659
36813
  const UpsertInvoiceTaxLineItemSchema = effect.Schema.Struct({
36660
36814
  amount: effect.Schema.Number
@@ -36691,6 +36845,9 @@ const UpsertInvoiceSchema = effect.Schema.Struct({
36691
36845
  effect.Schema.fromKey("customer_id")
36692
36846
  ),
36693
36847
  memo: effect.Schema.optional(effect.Schema.String),
36848
+ customPaymentInstructions: effect.Schema.optional(effect.Schema.String).pipe(
36849
+ effect.Schema.fromKey("custom_payment_instructions")
36850
+ ),
36694
36851
  lineItems: effect.pipe(
36695
36852
  effect.Schema.propertySignature(effect.Schema.Array(UpsertInvoiceLineItemSchema)),
36696
36853
  effect.Schema.fromKey("line_items")
@@ -36701,12 +36858,10 @@ const UpsertInvoiceSchema = effect.Schema.Struct({
36701
36858
  });
36702
36859
  const InvoiceFormLineItemSchema = effect.Schema.Struct({
36703
36860
  description: effect.Schema.String,
36704
- unitPrice: effect.Schema.BigDecimal,
36705
- quantity: effect.Schema.BigDecimal,
36706
- amount: effect.Schema.BigDecimal,
36707
- isTaxable: effect.Schema.Boolean,
36708
- accountIdentifier: effect.Schema.NullOr(AccountIdentifierSchema),
36709
- tags: effect.Schema.Array(TagSchema)
36861
+ unitPrice: NonRecursiveBigDecimalSchema,
36862
+ quantity: NonRecursiveBigDecimalSchema,
36863
+ amount: NonRecursiveBigDecimalSchema,
36864
+ isTaxable: effect.Schema.Boolean
36710
36865
  });
36711
36866
  const InvoiceFormLineItemEquivalence = effect.Schema.equivalence(InvoiceFormLineItemSchema);
36712
36867
  const InvoiceTermsValuesSchema = effect.Schema.Enums(InvoiceTermsValues);
@@ -37202,7 +37357,7 @@ const InvoiceTable = () => {
37202
37357
  };
37203
37358
  }, [fetchMore, hasMore]);
37204
37359
  const options2 = React.useMemo(() => Object.values(InvoiceStatusOptionConfig), []);
37205
- const SelectedValue = React.useMemo(() => {
37360
+ const SingleValue = React.useCallback(() => {
37206
37361
  const label = selectedInvoiceStatusOption.label;
37207
37362
  return label ? `Status: ${label}` : "Status";
37208
37363
  }, [selectedInvoiceStatusOption.label]);
@@ -37217,11 +37372,11 @@ const InvoiceTable = () => {
37217
37372
  isSearchable: false,
37218
37373
  isClearable: false,
37219
37374
  placeholder: "Status",
37220
- slots: { SelectedValue },
37375
+ slots: { SingleValue },
37221
37376
  "aria-label": "Status Filter"
37222
37377
  }
37223
37378
  ),
37224
- [SelectedValue, options2, selectedInvoiceStatusOption, setTableFilters]
37379
+ [SingleValue, options2, selectedInvoiceStatusOption, setTableFilters]
37225
37380
  );
37226
37381
  const CreateInvoiceButton = React.useCallback(
37227
37382
  () => /* @__PURE__ */ jsxRuntime.jsxs(Button, { onPress: toCreateInvoice, children: [
@@ -39199,8 +39354,8 @@ const useCustomerForm = (props) => {
39199
39354
  }, [form, formDefaults]);
39200
39355
  return React.useMemo(() => ({ form, submitError }), [form, submitError]);
39201
39356
  };
39202
- const CustomerForm = (_qd) => {
39203
- var _rd = _qd, { onSuccess, isReadOnly } = _rd, formState = __objRest(_rd, ["onSuccess", "isReadOnly"]);
39357
+ const CustomerForm = (_wd) => {
39358
+ var _xd = _wd, { onSuccess, isReadOnly } = _xd, formState = __objRest(_xd, ["onSuccess", "isReadOnly"]);
39204
39359
  const { form, submitError } = useCustomerForm(__spreadValues({ onSuccess }, formState));
39205
39360
  const blockNativeOnSubmit = React.useCallback((e) => {
39206
39361
  e.preventDefault();
@@ -39302,7 +39457,8 @@ const CustomerFormDrawer = (props) => {
39302
39457
  }
39303
39458
  );
39304
39459
  };
39305
- const InvoiceFormErrorBanner = ({ form, submitError }) => {
39460
+ const InvoiceFormErrorBanner = ({ submitError }) => {
39461
+ const form = useFormContext();
39306
39462
  return /* @__PURE__ */ jsxRuntime.jsx(form.Subscribe, { selector: (state) => state.errorMap, children: (errorMap) => {
39307
39463
  const validationErrors = flattenValidationErrors(errorMap);
39308
39464
  if (validationErrors.length > 0 || submitError) {
@@ -39320,9 +39476,9 @@ const InvoiceFormErrorBanner = ({ form, submitError }) => {
39320
39476
  } });
39321
39477
  };
39322
39478
  function computeSubtotal(lineItems) {
39323
- return lineItems.reduce((sum, item) => effect.BigDecimal.sum(sum, item.amount), BIG_DECIMAL_ZERO);
39479
+ return lineItems.reduce((sum, item) => effect.BigDecimal.sum(sum, fromNonRecursiveBigDecimal(item.amount)), BIG_DECIMAL_ZERO);
39324
39480
  }
39325
- const computeRawTaxableSubtotal = (lineItems) => lineItems.filter((item) => item.isTaxable).reduce((sum, item) => effect.BigDecimal.sum(sum, item.amount), BIG_DECIMAL_ZERO);
39481
+ const computeRawTaxableSubtotal = (lineItems) => lineItems.filter((item) => item.isTaxable).reduce((sum, item) => effect.BigDecimal.sum(sum, fromNonRecursiveBigDecimal(item.amount)), BIG_DECIMAL_ZERO);
39326
39482
  function computeAdditionalDiscount({
39327
39483
  subtotal,
39328
39484
  discountRate
@@ -39366,15 +39522,22 @@ const getGrandTotalFromInvoice = (invoice) => {
39366
39522
  const grandTotal = computeGrandTotal({ subtotal, additionalDiscount, taxes });
39367
39523
  return grandTotal;
39368
39524
  };
39369
- const INVOICE_MECE_TAG_DIMENSION = "Job";
39370
39525
  const EMPTY_LINE_ITEM = {
39371
39526
  description: "",
39372
- unitPrice: BIG_DECIMAL_ZERO,
39373
- quantity: BIG_DECIMAL_ONE,
39374
- amount: BIG_DECIMAL_ZERO,
39375
- isTaxable: false,
39376
- accountIdentifier: null,
39377
- tags: []
39527
+ unitPrice: NRBD_ZERO,
39528
+ quantity: NRBD_ONE,
39529
+ amount: NRBD_ZERO,
39530
+ isTaxable: false
39531
+ };
39532
+ const computeLineItemAmount = (unitPrice, quantity) => {
39533
+ const bdUnitPrice = fromNonRecursiveBigDecimal(unitPrice);
39534
+ const bdQuantity = fromNonRecursiveBigDecimal(quantity);
39535
+ return toNonRecursiveBigDecimal(effect.BigDecimal.round(effect.BigDecimal.normalize(effect.BigDecimal.multiply(bdUnitPrice, bdQuantity)), { scale: 2 }));
39536
+ };
39537
+ const computeLineItemUnitPrice = (amount, quantity) => {
39538
+ const bdAmount = fromNonRecursiveBigDecimal(amount);
39539
+ const bdQuantity = fromNonRecursiveBigDecimal(quantity);
39540
+ return toNonRecursiveBigDecimal(effect.BigDecimal.round(effect.BigDecimal.normalize(safeDivide(bdAmount, bdQuantity)), { scale: 2 }));
39378
39541
  };
39379
39542
  const getEmptyInvoiceFormValues = () => {
39380
39543
  const sentAt = date.fromDate(dateFns.startOfToday(), date.getLocalTimeZone());
@@ -39393,13 +39556,6 @@ const getEmptyInvoiceFormValues = () => {
39393
39556
  taxRate: BIG_DECIMAL_ZERO
39394
39557
  };
39395
39558
  };
39396
- const getAdditionalTags = (tags) => {
39397
- return tags.filter((obj) => obj.key.toLowerCase() !== INVOICE_MECE_TAG_DIMENSION.toLowerCase());
39398
- };
39399
- const getSelectedTag = (tags) => {
39400
- var _a;
39401
- return (_a = tags.find((obj) => obj.key.toLowerCase() === INVOICE_MECE_TAG_DIMENSION.toLowerCase())) != null ? _a : null;
39402
- };
39403
39559
  const getInvoiceLineItemAmount = (lineItem) => {
39404
39560
  const { unitPrice, quantity } = lineItem;
39405
39561
  return effect.BigDecimal.multiply(quantity, convertCentsToBigDecimal(unitPrice));
@@ -39408,12 +39564,10 @@ const getInvoiceFormLineItem = (lineItem) => {
39408
39564
  const { description, unitPrice, quantity } = lineItem;
39409
39565
  return {
39410
39566
  description: description || "",
39411
- quantity: effect.BigDecimal.normalize(quantity),
39412
- unitPrice: convertCentsToBigDecimal(unitPrice),
39413
- amount: getInvoiceLineItemAmount(lineItem),
39414
- isTaxable: lineItem.salesTaxTotal > 0,
39415
- accountIdentifier: lineItem.accountIdentifier,
39416
- tags: lineItem.transactionTags.map(makeTagFromTransactionTag)
39567
+ quantity: toNonRecursiveBigDecimal(quantity),
39568
+ unitPrice: toNonRecursiveBigDecimal(convertCentsToBigDecimal(unitPrice)),
39569
+ amount: toNonRecursiveBigDecimal(getInvoiceLineItemAmount(lineItem)),
39570
+ isTaxable: lineItem.salesTaxTotal > 0
39417
39571
  };
39418
39572
  };
39419
39573
  const getInvoiceFormInitialValues = (invoice) => {
@@ -39471,14 +39625,6 @@ const validateInvoiceForm = ({ value: invoice }) => {
39471
39625
  errors.push({ lineItems: "Invoice requires at least one non-empty line item." });
39472
39626
  }
39473
39627
  nonEmptyLineItems.some((item) => {
39474
- if (item.accountIdentifier === null) {
39475
- errors.push({ lineItems: "Invoice has incomplete line items. Please include required field: Revenue account." });
39476
- return true;
39477
- }
39478
- if (getSelectedTag(item.tags) === null) {
39479
- errors.push({ lineItems: `Invoice has incomplete line items. Please include required field: ${INVOICE_MECE_TAG_DIMENSION}.` });
39480
- return true;
39481
- }
39482
39628
  if (item.description.trim() === "") {
39483
39629
  errors.push({ lineItems: "Invoice has incomplete line items. Please include required field: Description." });
39484
39630
  return true;
@@ -39499,14 +39645,14 @@ const convertInvoiceFormToParams = (form) => {
39499
39645
  invoiceNumber: form.invoiceNumber.trim(),
39500
39646
  memo: form.memo.trim(),
39501
39647
  lineItems: form.lineItems.filter((item) => !InvoiceFormLineItemEquivalence(EMPTY_LINE_ITEM, item)).map((item) => {
39502
- const baseLineItem = __spreadValues({
39648
+ const baseLineItem = {
39503
39649
  description: item.description.trim(),
39504
- unitPrice: convertBigDecimalToCents(item.unitPrice),
39505
- quantity: item.quantity,
39506
- tags: item.tags.map(makeTagKeyValueFromTag)
39507
- }, item.accountIdentifier && { accountIdentifier: item.accountIdentifier });
39650
+ unitPrice: convertBigDecimalToCents(fromNonRecursiveBigDecimal(item.unitPrice)),
39651
+ quantity: fromNonRecursiveBigDecimal(item.quantity)
39652
+ };
39508
39653
  if (!item.isTaxable || effect.BigDecimal.equals(form.taxRate, BIG_DECIMAL_ZERO)) return baseLineItem;
39509
- const itemTaxableSubtotal = computeTaxableSubtotal({ rawTaxableSubtotal: item.amount, discountRate: form.discountRate });
39654
+ const itemAmount = fromNonRecursiveBigDecimal(item.amount);
39655
+ const itemTaxableSubtotal = computeTaxableSubtotal({ rawTaxableSubtotal: itemAmount, discountRate: form.discountRate });
39510
39656
  const itemTaxes = computeTaxes({ taxableSubtotal: itemTaxableSubtotal, taxRate: form.taxRate });
39511
39657
  return __spreadProps(__spreadValues({}, baseLineItem), { salesTaxes: [{ amount: convertBigDecimalToCents(itemTaxes) }] });
39512
39658
  })
@@ -39517,50 +39663,13 @@ const convertInvoiceFormToParams = (form) => {
39517
39663
  });
39518
39664
  };
39519
39665
  const InvoiceFormLineItemRow = ({ form, index: index2, isReadOnly, onDeleteLine }) => {
39520
- return /* @__PURE__ */ jsxRuntime.jsx(VStack, { gap: "xs", children: /* @__PURE__ */ jsxRuntime.jsxs(
39666
+ return /* @__PURE__ */ jsxRuntime.jsx(VStack, { children: /* @__PURE__ */ jsxRuntime.jsxs(
39521
39667
  HStack,
39522
39668
  {
39523
39669
  gap: "xs",
39524
39670
  align: "end",
39525
39671
  className: classNames("Layer__InvoiceForm__LineItem", isReadOnly && "Layer__InvoiceForm__LineItem--readonly"),
39526
39672
  children: [
39527
- /* @__PURE__ */ jsxRuntime.jsx(form.Field, { name: `lineItems[${index2}].accountIdentifier`, children: (field) => {
39528
- const onValueChange = (value) => {
39529
- if (value && !isClassificationAccountIdentifier(value)) {
39530
- return;
39531
- }
39532
- field.setValue(value);
39533
- };
39534
- return /* @__PURE__ */ jsxRuntime.jsx(
39535
- LedgerAccountCombobox,
39536
- {
39537
- label: "Revenue account (hidden)",
39538
- value: field.state.value,
39539
- mode: CategoriesListMode.Revenue,
39540
- onValueChange,
39541
- isReadOnly,
39542
- showLabel: index2 === 0
39543
- }
39544
- );
39545
- } }),
39546
- /* @__PURE__ */ jsxRuntime.jsx(form.Field, { name: `lineItems[${index2}].tags`, children: (field) => {
39547
- const additionalTags = getAdditionalTags(field.state.value);
39548
- const selectedTag = getSelectedTag(field.state.value);
39549
- const onValueChange = (value) => {
39550
- field.setValue(value ? [...additionalTags, value] : additionalTags);
39551
- };
39552
- return /* @__PURE__ */ jsxRuntime.jsx(
39553
- TagDimensionCombobox,
39554
- {
39555
- dimensionKey: INVOICE_MECE_TAG_DIMENSION,
39556
- isReadOnly,
39557
- value: selectedTag,
39558
- onValueChange,
39559
- showLabel: index2 === 0,
39560
- isClearable: false
39561
- }
39562
- );
39563
- } }),
39564
39673
  /* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: `lineItems[${index2}].description`, children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormTextField, { label: "Description", showLabel: index2 === 0, isReadOnly }) }),
39565
39674
  /* @__PURE__ */ jsxRuntime.jsx(
39566
39675
  form.AppField,
@@ -39570,13 +39679,13 @@ const InvoiceFormLineItemRow = ({ form, index: index2, isReadOnly, onDeleteLine
39570
39679
  onBlur: ({ value: quantity }) => {
39571
39680
  const amount = form.getFieldValue(`lineItems[${index2}].amount`);
39572
39681
  const unitPrice = form.getFieldValue(`lineItems[${index2}].unitPrice`);
39573
- const nextAmount = effect.BigDecimal.round(effect.BigDecimal.normalize(effect.BigDecimal.multiply(unitPrice, quantity)), { scale: 2 });
39574
- if (!effect.BigDecimal.equals(amount, nextAmount)) {
39575
- form.setFieldValue(`lineItems[${index2}].amount`, withForceUpdate(nextAmount));
39682
+ const nextAmount = computeLineItemAmount(unitPrice, quantity);
39683
+ if (!nrbdEquals(amount, nextAmount)) {
39684
+ form.setFieldValue(`lineItems[${index2}].amount`, nextAmount);
39576
39685
  }
39577
39686
  }
39578
39687
  },
39579
- children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormBigDecimalField, { label: "Quantity", showLabel: index2 === 0, isReadOnly })
39688
+ children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormNonRecursiveBigDecimalField, { label: "Quantity", showLabel: index2 === 0, isReadOnly })
39580
39689
  }
39581
39690
  ),
39582
39691
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -39587,13 +39696,13 @@ const InvoiceFormLineItemRow = ({ form, index: index2, isReadOnly, onDeleteLine
39587
39696
  onBlur: ({ value: unitPrice }) => {
39588
39697
  const amount = form.getFieldValue(`lineItems[${index2}].amount`);
39589
39698
  const quantity = form.getFieldValue(`lineItems[${index2}].quantity`);
39590
- const nextAmount = effect.BigDecimal.round(effect.BigDecimal.normalize(effect.BigDecimal.multiply(unitPrice, quantity)), { scale: 2 });
39591
- if (!effect.BigDecimal.equals(amount, nextAmount)) {
39592
- form.setFieldValue(`lineItems[${index2}].amount`, withForceUpdate(nextAmount));
39699
+ const nextAmount = computeLineItemAmount(unitPrice, quantity);
39700
+ if (!nrbdEquals(amount, nextAmount)) {
39701
+ form.setFieldValue(`lineItems[${index2}].amount`, nextAmount);
39593
39702
  }
39594
39703
  }
39595
39704
  },
39596
- children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormBigDecimalField, { label: "Rate", mode: "currency", showLabel: index2 === 0, allowNegative: true, isReadOnly })
39705
+ children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormNonRecursiveBigDecimalField, { label: "Rate", mode: "currency", showLabel: index2 === 0, allowNegative: true, isReadOnly })
39597
39706
  }
39598
39707
  ),
39599
39708
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -39604,13 +39713,13 @@ const InvoiceFormLineItemRow = ({ form, index: index2, isReadOnly, onDeleteLine
39604
39713
  onBlur: ({ value: amount }) => {
39605
39714
  const unitPrice = form.getFieldValue(`lineItems[${index2}].unitPrice`);
39606
39715
  const quantity = form.getFieldValue(`lineItems[${index2}].quantity`);
39607
- const nextUnitPrice = effect.BigDecimal.round(effect.BigDecimal.normalize(safeDivide(amount, quantity)), { scale: 2 });
39608
- if (!effect.BigDecimal.equals(unitPrice, nextUnitPrice)) {
39609
- form.setFieldValue(`lineItems[${index2}].unitPrice`, withForceUpdate(nextUnitPrice));
39716
+ const nextUnitPrice = computeLineItemUnitPrice(amount, quantity);
39717
+ if (!nrbdEquals(unitPrice, nextUnitPrice)) {
39718
+ form.setFieldValue(`lineItems[${index2}].unitPrice`, nextUnitPrice);
39610
39719
  }
39611
39720
  }
39612
39721
  },
39613
- children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormBigDecimalField, { label: "Amount", mode: "currency", showLabel: index2 === 0, allowNegative: true, isReadOnly })
39722
+ children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormNonRecursiveBigDecimalField, { label: "Amount", mode: "currency", showLabel: index2 === 0, allowNegative: true, isReadOnly })
39614
39723
  }
39615
39724
  ),
39616
39725
  /* @__PURE__ */ jsxRuntime.jsx(form.AppField, { name: `lineItems[${index2}].isTaxable`, children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormCheckboxField, { label: "Taxable", showLabel: index2 === 0, isReadOnly }) }),
@@ -39624,7 +39733,16 @@ const InvoiceFormLineItemsSection = ({
39624
39733
  isReadOnly
39625
39734
  }) => {
39626
39735
  return /* @__PURE__ */ jsxRuntime.jsx(form.Field, { name: "lineItems", mode: "array", children: (field) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", align: "baseline", children: [
39627
- field.state.value.map((_value, index2) => /* @__PURE__ */ jsxRuntime.jsx(InvoiceFormLineItemRow, { form, index: index2, isReadOnly, onDeleteLine: () => field.removeValue(index2) }, index2)),
39736
+ field.state.value.map((_lineItem, index2) => /* @__PURE__ */ jsxRuntime.jsx(
39737
+ InvoiceFormLineItemRow,
39738
+ {
39739
+ form,
39740
+ index: index2,
39741
+ isReadOnly,
39742
+ onDeleteLine: () => field.removeValue(index2)
39743
+ },
39744
+ index2
39745
+ )),
39628
39746
  !isReadOnly && /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outlined", onClick: () => field.pushValue(EMPTY_LINE_ITEM), children: [
39629
39747
  "Add line item",
39630
39748
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { size: 16 })
@@ -39659,45 +39777,6 @@ const InvoiceFormMetadataSection = ({
39659
39777
  ] })
39660
39778
  ] }) });
39661
39779
  };
39662
- const returnTrue = () => true;
39663
- function CreatableComboBox(_sd) {
39664
- var _td = _sd, {
39665
- className,
39666
- slots,
39667
- isError,
39668
- selectedValue,
39669
- onSelectedValueChange,
39670
- onCreateOption,
39671
- formatCreateLabel: formatCreateLabel2,
39672
- createOptionPosition = "first",
39673
- isValidNewOption = returnTrue
39674
- } = _td, props = __objRest(_td, [
39675
- "className",
39676
- "slots",
39677
- "isError",
39678
- "selectedValue",
39679
- "onSelectedValueChange",
39680
- "onCreateOption",
39681
- "formatCreateLabel",
39682
- "createOptionPosition",
39683
- "isValidNewOption"
39684
- ]);
39685
- const commonSelectProps = useCommonComboBoxProps(__spreadValues({ className, slots }, props));
39686
- return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", fluid: true, className: className ? `${className}__Container` : void 0, children: [
39687
- /* @__PURE__ */ jsxRuntime.jsx(
39688
- BaseCreatableSelect,
39689
- __spreadProps(__spreadValues({}, commonSelectProps), {
39690
- value: selectedValue,
39691
- onChange: onSelectedValueChange,
39692
- onCreateOption,
39693
- isValidNewOption,
39694
- formatCreateLabel: formatCreateLabel2,
39695
- createOptionPosition
39696
- })
39697
- ),
39698
- /* @__PURE__ */ jsxRuntime.jsx(ComboBoxErrorMessage, { isError, errorMessage: slots == null ? void 0 : slots.ErrorMessage })
39699
- ] });
39700
- }
39701
39780
  function MaybeCreatableComboBox(props) {
39702
39781
  if (props.isCreatable) {
39703
39782
  return /* @__PURE__ */ jsxRuntime.jsx(CreatableComboBox, __spreadValues({}, props));
@@ -39907,7 +39986,7 @@ const InvoiceFormTermsSection = ({
39907
39986
  updateDueAtFromTermsAndSentAt(terms, sentAt);
39908
39987
  }
39909
39988
  },
39910
- children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormDateField, { label: "Invoice date", inline: true, className: "Layer__InvoiceForm__Field__SentAt", isReadOnly })
39989
+ children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormDatePickerField, { label: "Invoice date", inline: true, className: "Layer__InvoiceForm__Field__SentAt", isReadOnly })
39911
39990
  }
39912
39991
  ),
39913
39992
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -39925,7 +40004,7 @@ const InvoiceFormTermsSection = ({
39925
40004
  lastDueAtRef.current = dueAt;
39926
40005
  }
39927
40006
  },
39928
- children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormDateField, { label: "Due date", inline: true, className: "Layer__InvoiceForm__Field__DueAt", isReadOnly })
40007
+ children: (field) => /* @__PURE__ */ jsxRuntime.jsx(field.FormDatePickerField, { label: "Due date", inline: true, className: "Layer__InvoiceForm__Field__DueAt", isReadOnly })
39929
40008
  }
39930
40009
  )
39931
40010
  ] })
@@ -39978,23 +40057,26 @@ const useInvoiceForm = (props) => {
39978
40057
  const upsertInvoiceProps = mode === UpsertInvoiceMode.Update ? { mode, invoiceId: props.invoice.id } : { mode };
39979
40058
  const { trigger: upsertInvoice } = useUpsertInvoice(upsertInvoiceProps);
39980
40059
  const invoice = isUpdateMode(props) ? props.invoice : null;
39981
- const defaultValuesRef = React.useRef(getInvoiceFormDefaultValues(invoice));
39982
- const defaultValues = defaultValuesRef.current;
39983
- const onSubmit = React.useCallback((_0) => __async(null, [_0], function* ({ value, meta }) {
39984
- try {
39985
- const upsertInvoiceParams = convertInvoiceFormToParams(value);
39986
- const upsertInvoiceRequest = effect.Schema.encodeUnknownSync(UpsertInvoiceSchema)(upsertInvoiceParams);
39987
- const { data: invoice2 } = yield upsertInvoice(upsertInvoiceRequest);
39988
- setSubmitError(void 0);
39989
- onSuccess(invoice2);
39990
- if (meta.submitAction === "send" && onSendInvoice) {
39991
- yield onSendInvoice(invoice2.id);
40060
+ const defaultValues = React.useMemo(() => getInvoiceFormDefaultValues(invoice), [invoice]);
40061
+ const onSubmit = React.useCallback(
40062
+ (_0) => __async(null, [_0], function* ({ value, meta, formApi }) {
40063
+ try {
40064
+ const upsertInvoiceParams = convertInvoiceFormToParams(value);
40065
+ const upsertInvoiceRequest = effect.Schema.encodeUnknownSync(UpsertInvoiceSchema)(upsertInvoiceParams);
40066
+ const { data: invoice2 } = yield upsertInvoice(upsertInvoiceRequest);
40067
+ setSubmitError(void 0);
40068
+ onSuccess(invoice2);
40069
+ formApi.reset();
40070
+ if (meta.submitAction === "send" && onSendInvoice) {
40071
+ yield onSendInvoice(invoice2.id);
40072
+ }
40073
+ } catch (e) {
40074
+ console.error(e);
40075
+ setSubmitError("Something went wrong. Please try again.");
39992
40076
  }
39993
- } catch (e) {
39994
- console.error(e);
39995
- setSubmitError("Something went wrong. Please try again.");
39996
- }
39997
- }), [onSendInvoice, onSuccess, upsertInvoice]);
40077
+ }),
40078
+ [onSendInvoice, onSuccess, upsertInvoice]
40079
+ );
39998
40080
  const validators = React.useMemo(() => ({
39999
40081
  onDynamic: validateInvoiceForm
40000
40082
  }), []);
@@ -40081,7 +40163,7 @@ const InvoiceForm = React.forwardRef((props, ref) => {
40081
40163
  }, [formState, onChangeFormState]);
40082
40164
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
40083
40165
  /* @__PURE__ */ jsxRuntime.jsxs(Form, { className: "Layer__InvoiceForm", onSubmit: blockNativeOnSubmit, children: [
40084
- /* @__PURE__ */ jsxRuntime.jsx(InvoiceFormErrorBanner, { form, submitError }),
40166
+ /* @__PURE__ */ jsxRuntime.jsx(form.AppForm, { children: /* @__PURE__ */ jsxRuntime.jsx(InvoiceFormErrorBanner, { submitError }) }),
40085
40167
  /* @__PURE__ */ jsxRuntime.jsx(
40086
40168
  InvoiceFormTermsSection,
40087
40169
  {
@@ -40191,8 +40273,8 @@ const getClassnameForSubComponent = (className, suffix) => {
40191
40273
  };
40192
40274
  const METER_CLASS_NAME = "Layer__Meter";
40193
40275
  const Meter = React.forwardRef(
40194
- function Meter2(_ud, ref) {
40195
- var _vd = _ud, { className, label, meterOnly } = _vd, restProps = __objRest(_vd, ["className", "label", "meterOnly"]);
40276
+ function Meter2(_yd, ref) {
40277
+ var _zd = _yd, { className, label, meterOnly } = _zd, restProps = __objRest(_zd, ["className", "label", "meterOnly"]);
40196
40278
  return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Meter, __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, restProps), { className: classNames(METER_CLASS_NAME, className), ref }), meterOnly && { "aria-label": label }), { children: ({ percentage, valueText }) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", fluid: true, children: [
40197
40279
  !meterOnly && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "space-between", children: [
40198
40280
  /* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", children: label }),
@@ -40619,15 +40701,9 @@ const InvoiceOverview = () => {
40619
40701
  /* @__PURE__ */ jsxRuntime.jsx(InvoiceTable, {})
40620
40702
  ] });
40621
40703
  };
40622
- const Invoices = ({
40623
- showTitle = true,
40624
- stringOverrides,
40625
- onSendInvoice
40626
- }) => {
40704
+ const Invoices = ({ stringOverrides, onSendInvoice }) => {
40627
40705
  usePreloadCustomers();
40628
- usePreloadCategories({ mode: CategoriesListMode.Revenue });
40629
- usePreloadTagDimensionByKey({ dimensionKey: INVOICE_MECE_TAG_DIMENSION });
40630
- return /* @__PURE__ */ jsxRuntime.jsx(InvoicesProvider, { onSendInvoice, children: /* @__PURE__ */ jsxRuntime.jsx(View, { title: (stringOverrides == null ? void 0 : stringOverrides.title) || "Invoices", showHeader: showTitle, children: /* @__PURE__ */ jsxRuntime.jsx(InvoicesContent, {}) }) });
40706
+ return /* @__PURE__ */ jsxRuntime.jsx(InvoicesProvider, { onSendInvoice, children: /* @__PURE__ */ jsxRuntime.jsx(View, { title: (stringOverrides == null ? void 0 : stringOverrides.title) || "Invoices", children: /* @__PURE__ */ jsxRuntime.jsx(InvoicesContent, {}) }) });
40631
40707
  };
40632
40708
  const InvoicesContent = () => {
40633
40709
  const routeState = useInvoiceRouteState();
@@ -40638,11 +40714,11 @@ const ProfitAndLossView = (props) => {
40638
40714
  const containerRef = React.useRef(null);
40639
40715
  return /* @__PURE__ */ jsxRuntime.jsx(Container, { name: COMPONENT_NAME$4, ref: containerRef, children: /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLoss, { children: /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossPanel, __spreadValues({ containerRef }, props)) }) });
40640
40716
  };
40641
- const ProfitAndLossPanel = (_wd) => {
40642
- var _xd = _wd, {
40717
+ const ProfitAndLossPanel = (_Ad) => {
40718
+ var _Bd = _Ad, {
40643
40719
  containerRef,
40644
40720
  stringOverrides
40645
- } = _xd, props = __objRest(_xd, [
40721
+ } = _Bd, props = __objRest(_Bd, [
40646
40722
  "containerRef",
40647
40723
  "stringOverrides"
40648
40724
  ]);
@@ -40893,14 +40969,14 @@ function ExpandableDataTable({
40893
40969
  );
40894
40970
  }
40895
40971
  const UNIFIED_REPORT_TAG_KEY = "#unified-report";
40896
- function buildKey$g(_yd) {
40897
- var _zd = _yd, {
40972
+ function buildKey$g(_Cd) {
40973
+ var _Dd = _Cd, {
40898
40974
  access_token: accessToken,
40899
40975
  apiUrl,
40900
40976
  businessId,
40901
40977
  report,
40902
40978
  groupBy
40903
- } = _zd, dateParams = __objRest(_zd, [
40979
+ } = _Dd, dateParams = __objRest(_Dd, [
40904
40980
  "access_token",
40905
40981
  "apiUrl",
40906
40982
  "businessId",
@@ -40918,8 +40994,8 @@ function buildKey$g(_yd) {
40918
40994
  }, dateParams);
40919
40995
  }
40920
40996
  }
40921
- const getUnifiedReport = get$1((_Ad) => {
40922
- var _Bd = _Ad, { businessId, report, groupBy } = _Bd, dateParams = __objRest(_Bd, ["businessId", "report", "groupBy"]);
40997
+ const getUnifiedReport = get$1((_Ed) => {
40998
+ var _Fd = _Ed, { businessId, report, groupBy } = _Fd, dateParams = __objRest(_Fd, ["businessId", "report", "groupBy"]);
40923
40999
  const parameters = toDefinedSearchParameters(__spreadProps(__spreadValues({}, dateParams), { groupBy }));
40924
41000
  return `/v1/businesses/${businessId}/reports/unified/${report}?${parameters}`;
40925
41001
  });
@@ -40944,8 +41020,8 @@ class UnifiedReportSWRResponse {
40944
41020
  return this.swrResponse.mutate;
40945
41021
  }
40946
41022
  }
40947
- function useUnifiedReport(_Cd) {
40948
- var _Dd = _Cd, { report, groupBy } = _Dd, dateParams = __objRest(_Dd, ["report", "groupBy"]);
41023
+ function useUnifiedReport(_Gd) {
41024
+ var _Hd = _Gd, { report, groupBy } = _Hd, dateParams = __objRest(_Hd, ["report", "groupBy"]);
40949
41025
  const { data: auth } = useAuth();
40950
41026
  const { apiUrl } = useEnvironment();
40951
41027
  const { businessId } = useLayerContext();
@@ -41064,8 +41140,8 @@ const S3PresignedUrlSchema = effect.Schema.Struct({
41064
41140
  createdAt: effect.Schema.Date,
41065
41141
  documentId: effect.Schema.NullishOr(effect.Schema.UUID)
41066
41142
  });
41067
- const getUnifiedReportExcel = get$1((_Ed) => {
41068
- var _Fd = _Ed, { businessId, report, groupBy } = _Fd, dateParams = __objRest(_Fd, ["businessId", "report", "groupBy"]);
41143
+ const getUnifiedReportExcel = get$1((_Id) => {
41144
+ var _Jd = _Id, { businessId, report, groupBy } = _Jd, dateParams = __objRest(_Jd, ["businessId", "report", "groupBy"]);
41069
41145
  const parameters = toDefinedSearchParameters(__spreadProps(__spreadValues({}, dateParams), { groupBy }));
41070
41146
  return `/v1/businesses/${businessId}/reports/unified/${report}/exports/excel?${parameters}`;
41071
41147
  });
@@ -42478,19 +42554,19 @@ const VendorsProvider = ({ children }) => {
42478
42554
  const vendors = useVendors();
42479
42555
  return /* @__PURE__ */ jsxRuntime.jsx(VendorsContext.Provider, { value: vendors, children });
42480
42556
  };
42481
- const SelectVendor = (_Gd) => {
42482
- var _Hd = _Gd, { withContext = true } = _Hd, props = __objRest(_Hd, ["withContext"]);
42557
+ const SelectVendor = (_Kd) => {
42558
+ var _Ld = _Kd, { withContext = true } = _Ld, props = __objRest(_Ld, ["withContext"]);
42483
42559
  if (withContext) {
42484
42560
  return /* @__PURE__ */ jsxRuntime.jsx(VendorsProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectVendorContent, __spreadValues({}, props)) });
42485
42561
  }
42486
42562
  return /* @__PURE__ */ jsxRuntime.jsx(SelectVendorContent, __spreadValues({}, props));
42487
42563
  };
42488
- const SelectVendorContent = (_Id) => {
42489
- var _Jd = _Id, {
42564
+ const SelectVendorContent = (_Md) => {
42565
+ var _Nd = _Md, {
42490
42566
  value,
42491
42567
  onChange,
42492
42568
  placeholder = "Select vendor"
42493
- } = _Jd, props = __objRest(_Jd, [
42569
+ } = _Nd, props = __objRest(_Nd, [
42494
42570
  "value",
42495
42571
  "onChange",
42496
42572
  "placeholder"
@@ -43228,8 +43304,8 @@ const BillsTableWithPanel = ({
43228
43304
  }
43229
43305
  );
43230
43306
  };
43231
- const Bills = (_Kd) => {
43232
- var _Ld = _Kd, { context = true } = _Ld, props = __objRest(_Ld, ["context"]);
43307
+ const Bills = (_Od) => {
43308
+ var _Pd = _Od, { context = true } = _Pd, props = __objRest(_Pd, ["context"]);
43233
43309
  if (context) {
43234
43310
  return /* @__PURE__ */ jsxRuntime.jsx(BillsProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(BillsContent, __spreadValues({}, props)) });
43235
43311
  }
@@ -43284,8 +43360,8 @@ const getTimezoneDisplay = (date2) => {
43284
43360
  }
43285
43361
  };
43286
43362
  const LinkButton = React.forwardRef(
43287
- function LinkButton2(_Md, ref) {
43288
- var _Nd = _Md, {
43363
+ function LinkButton2(_Qd, ref) {
43364
+ var _Rd = _Qd, {
43289
43365
  children,
43290
43366
  ellipsis,
43291
43367
  icon,
@@ -43298,7 +43374,7 @@ const LinkButton = React.forwardRef(
43298
43374
  href,
43299
43375
  target,
43300
43376
  rel
43301
- } = _Nd, restProps = __objRest(_Nd, [
43377
+ } = _Rd, restProps = __objRest(_Rd, [
43302
43378
  "children",
43303
43379
  "ellipsis",
43304
43380
  "icon",
@@ -48079,11 +48155,11 @@ const TaxPaymentsMobileList = ({ data, isLoading, isError, slots }) => {
48079
48155
  ) });
48080
48156
  };
48081
48157
  const EMPTY_ARRAY = [];
48082
- const SimpleDataTable = (_Od) => {
48083
- var _Pd = _Od, {
48158
+ const SimpleDataTable = (_Sd) => {
48159
+ var _Td = _Sd, {
48084
48160
  data,
48085
48161
  columnConfig: columnConfig2
48086
- } = _Pd, rest = __objRest(_Pd, [
48162
+ } = _Td, rest = __objRest(_Td, [
48087
48163
  "data",
48088
48164
  "columnConfig"
48089
48165
  ]);
@@ -49195,14 +49271,14 @@ const BusinessProvider = ({
49195
49271
  }
49196
49272
  );
49197
49273
  };
49198
- const LayerProvider = (_Qd) => {
49199
- var _Rd = _Qd, {
49274
+ const LayerProvider = (_Ud) => {
49275
+ var _Vd = _Ud, {
49200
49276
  appId,
49201
49277
  appSecret,
49202
49278
  businessAccessToken,
49203
49279
  environment,
49204
49280
  usePlaidSandbox
49205
- } = _Rd, restProps = __objRest(_Rd, [
49281
+ } = _Vd, restProps = __objRest(_Vd, [
49206
49282
  "appId",
49207
49283
  "appSecret",
49208
49284
  "businessAccessToken",
@@ -49210,7 +49286,7 @@ const LayerProvider = (_Qd) => {
49210
49286
  "usePlaidSandbox"
49211
49287
  ]);
49212
49288
  const [cache] = React.useState(() => /* @__PURE__ */ new Map());
49213
- return /* @__PURE__ */ jsxRuntime.jsx(useSWR.SWRConfig, { value: __spreadProps(__spreadValues({}, DEFAULT_SWR_CONFIG), { provider: () => cache }), children: /* @__PURE__ */ jsxRuntime.jsx(EnvironmentInputProvider, { environment, usePlaidSandbox, children: /* @__PURE__ */ jsxRuntime.jsx(
49289
+ return /* @__PURE__ */ jsxRuntime.jsx(useSWR.SWRConfig, { value: __spreadProps(__spreadValues({}, DEFAULT_SWR_CONFIG), { provider: () => cache }), children: /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.I18nProvider, { locale: "en-US", children: /* @__PURE__ */ jsxRuntime.jsx(EnvironmentInputProvider, { environment, usePlaidSandbox, children: /* @__PURE__ */ jsxRuntime.jsx(
49214
49290
  AuthInputProvider,
49215
49291
  {
49216
49292
  appId,
@@ -49218,7 +49294,7 @@ const LayerProvider = (_Qd) => {
49218
49294
  businessAccessToken,
49219
49295
  children: /* @__PURE__ */ jsxRuntime.jsx(GlobalDateStoreProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(BusinessProvider, __spreadValues({}, restProps)) })
49220
49296
  }
49221
- ) }) });
49297
+ ) }) }) });
49222
49298
  };
49223
49299
  exports.AccountingOverview = AccountingOverview;
49224
49300
  exports.BalanceSheet = BalanceSheet;