@tight-embedded/react 1.2.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +666 -319
- package/dist/index.css.gz +0 -0
- package/dist/index.d.ts +55 -12
- package/dist/index.js +1 -1
- package/dist/index.js.gz +0 -0
- package/dist/index.js.map +1 -1
- package/dist/index.js.map.gz +0 -0
- package/package.json +8 -4
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{create as e}from"zustand";import{devtools as t}from"zustand/middleware";import{cloneDeep as r,entries as n,mapValues as o,isEqual as a,isEmpty as i}from"lodash-es";import*as l from"zod";import{z as s}from"zod";import*as c from"react";import{useRef as d,useMemo as u,createContext as h,useContext as p,Component as g,useState as m,useCallback as v,useEffect as b,createElement as f,forwardRef as y,useReducer as T,useLayoutEffect as x,useImperativeHandle as k}from"react";import{jsx as w,Fragment as C,jsxs as E}from"react/jsx-runtime";import{QueryClient as I,useIsRestoring as S,useQuery as A,keepPreviousData as N,useMutation as P}from"@tanstack/react-query";import M from"yocto-queue";import D from"big.js";import{ResponsiveContainer as R,BarChart as O,Legend as _,CartesianGrid as L,XAxis as F,YAxis as B,Tooltip as W,Bar as H,ReferenceLine as U,Line as V}from"recharts";import{flexRender as z,createColumnHelper as j,useReactTable as K,getCoreRowModel as $,getExpandedRowModel as q}from"@tanstack/react-table";import{useFloatingNodeId as Y,useFloating as G,offset as Q,flip as X,shift as Z,size as J,autoUpdate as ee,useClick as te,useDismiss as re,useRole as ne,useInteractions as oe,useFloatingParentNodeId as ae,FloatingTree as ie,FloatingNode as le,useMergeRefs as se,FloatingOverlay as ce,FloatingPortal as de,FloatingFocusManager as ue}from"@floating-ui/react";import{ContextAwareConfirmation as he,confirmable as pe}from"react-confirm";import{usePlaidLink as ge}from"react-plaid-link";import me from"fuse.js";import{openDB as ve}from"idb";import{PersistQueryClientProvider as be}from"@tanstack/react-query-persist-client";import{createFormHookContexts as fe,useStore as ye,createFormHook as Te}from"@tanstack/react-form";import{NumericFormat as xe}from"react-number-format";import{fetchEventSource as ke}from"@microsoft/fetch-event-source";function we(e,t){return`${e.trim()}:${t.trim()}`}const Ce=e=>({FEATUREFLAG_BULK_SELECT:!1,FEATUREFLAG_HAS_MERGE_ACCOUNTS:!1,FEATUREFLAG_PLAID_CONNECTION_DRAWER:!1,FEATUREFLAG_SERVER_SIDE_EVENTS:!1,updateFlags:t=>e(e=>({...e,...t}),void 0,we("featureFlags","updateFlags"))});function Ee(){return Le(e=>e.FEATUREFLAG_PLAID_CONNECTION_DRAWER)}const Ie="drawerNavigation",Se=e=>({drawerHistory:[],openDrawer:(t,n={})=>e(e=>{const{replaceHistory:o,routeProps:a}=n,i={[t]:{routeProps:a}};if(o||0===e.drawerHistory.length)return{drawerHistory:[i]};{const t=r(e.drawerHistory);return t.push(i),{drawerHistory:t}}},void 0,we(Ie,"openDrawer")),closeDrawer:()=>e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1)}},void 0,we(Ie,"closeDrawer")),closeAllDrawers:()=>e(()=>({drawerHistory:[]}),void 0,we(Ie,"closeAllDrawers"))}),Ae=e=>({externalOptions:{},setOptions:(t,r=!1)=>e(e=>r?{externalOptions:{...t}}:{externalOptions:{...e.externalOptions,...t}},void 0,we("externalOptions","setOptions"))});function Ne(e,t){return t>-1&&t<=e.length-1?[...e.slice(0,t),...e.slice(t+1)]:[...e]}function Pe(e){return e[e.length-1]}const Me="transactionsDashFilters",De=e=>({transactionsDashFilters:[],addTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:[...e.transactionsDashFilters,...t]}),void 0,we(Me,"addFilter")),removeTransactionsDashFilter:t=>e(e=>({...e,transactionsDashFilters:Ne(e.transactionsDashFilters,t)}),void 0,we(Me,"removeFilter")),setTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:t}),void 0,we(Me,"setFilters"))}),Re={label:"Connected Accounts",value:"connected"},Oe="banksAndIntegrationsState",_e=e=>({banksAndIntegrationsSelectedTab:Re,expandedPlaidItems:[],hasExpandedUpdated:!1,setBanksAndIntegrationsSelectedTab:t=>e({banksAndIntegrationsSelectedTab:t},void 0,we(Oe,"setBanksAndIntegrationsSelectedTab")),toggleExpandedPlaidItem:(t,r)=>e(e=>({expandedPlaidItems:e.expandedPlaidItems.includes(t)||r&&!e.hasExpandedUpdated?e.expandedPlaidItems.filter(e=>e!==t):[...e.expandedPlaidItems,t],hasExpandedUpdated:!0}),void 0,we(Oe,"toggleExpandedPlaidItem"))}),Le=e()(t((...e)=>({...Ce(...e),...Se(...e),...Ae(...e),...De(...e),..._e(...e)}),{name:"globalStore",enabled:!1,store:"globalStore"})),Fe={SELECT:"select",EXPAND:"expand",DATE:"date",DESCRIPTION:"description",AMOUNT:"amount",CATEGORY:"category",CLASS_SEGMENT:"classSegment",REVIEW_STATUS:"reviewStatus",COMMENTS:"comments"},Be=[Fe.COMMENTS,Fe.DATE,Fe.DESCRIPTION,Fe.AMOUNT,Fe.CATEGORY,Fe.CLASS_SEGMENT,Fe.REVIEW_STATUS],We=l.object({pageSize:l.optional(l.int32().positive()),columns:l.optional(l.array(l.enum(Be)))}),He=l.optional(l.string().trim()),Ue=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Ve=l.optional(l.array(l.string().trim())),ze={transactionsDashboard:e=>{const t=We.safeParse(e);return t.success?t.data:void 0},accessToken:e=>{const t=He.safeParse(e);return t.success?t.data:void 0},dataVisualizationColors:e=>{const t=Ve.safeParse(e);if(!t.success||void 0===t.data)return;const r=t.data.filter(e=>Ue.test(e));return r.length>0?r:void 0}},je=(e,t)=>{if(void 0!==ze[e])return(0,ze[e])(t)};function Ke(e){const t=d(!1),o=Le(e=>e.setOptions);if(e&&!t.current){o(function(e){let t={};for(const[r,o]of n(e)){const e=je(r,o);void 0!==e&&(t={...t,[r]:e})}return t}(e)),t.current=!0}const a=Le(e=>e.externalOptions);return{options:u(()=>r(a),[a]),setOptions:o}}function $e(e){return"object"==typeof e&&null!=e&&!Array.isArray(e)}function qe(e){return Object.fromEntries(Object.entries(e??{}).filter(([e,t])=>void 0!==t))}function Ye(e){return String.fromCharCode(e+(e>25?39:97))}function Ge(e){return function(e){let t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=Ye(t%52)+r;return Ye(t%52)+r}(function(e,t){let r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return e}(5381,e)>>>0)}var Qe=/\s*!(important)?/i;function Xe(e){return"string"==typeof e?e.replaceAll(" ","_"):e}var Ze=e=>{const t=/* @__PURE__ */new Map;return(...r)=>{const n=JSON.stringify(r);if(t.has(n))return t.get(n);const o=e(...r);return t.set(n,o),o}},Je=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]);function et(...e){return e.reduce((e,t)=>t?(Object.keys(t).forEach(r=>{if(Je.has(r))return;const n=e[r],o=t[r];$e(n)&&$e(o)?e[r]=et(n,o):e[r]=o}),e):e,{})}var tt=e=>null!=e;function rt(e,t,r={}){const{stop:n,getKey:o}=r;return function e(r,a=[]){if("object"==typeof(i=r)&&null!==i){const i={};for(const[l,s]of Object.entries(r)){const c=o?.(l,s)??l,d=[...a,c];if(n?.(r,d))return t(r,a);const u=e(s,d);tt(u)&&(i[c]=u)}return i}var i;return t(r,a)}(e)}function nt(e,t,r=!0){const{utility:n,conditions:o}=t,{hasShorthand:a,resolveShorthand:i}=n;return rt(e,e=>{return Array.isArray(e)?(t=e,r=o.breakpoints.keys,t.reduce((e,t,n)=>{const o=r[n];return null!=t&&(e[o]=t),e},{})):e;var t,r},{stop:e=>Array.isArray(e),getKey:r?e=>a?i(e):e:void 0})}var ot={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},at=/([A-Z])/g,it=/^ms-/,lt=Ze(e=>e.startsWith("--")?e:e.replace(at,"-$1").replace(it,"-ms-").toLowerCase()),st=new RegExp(`^(${["min","max","clamp","calc"].join("|")})\\(.*\\)`),ct=`(?:${"cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%".split(",").join("|")})`,dt=new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${ct}$`),ut={map:function(e,t){return Array.isArray(e)?e.map(e=>t(e)):$e(e)?rt(e,e=>t(e)):t(e)},isCssFunction:e=>"string"==typeof e&&st.test(e),isCssVar:e=>"string"==typeof e&&/^var\(--.+\)$/.test(e),isCssUnit:e=>"string"==typeof e&&dt.test(e)},ht=(e,t)=>{if(!e?.defaultValues)return t;const r="function"==typeof e.defaultValues?e.defaultValues(t):e.defaultValues;return Object.assign({},r,qe(t))};const pt=new Set("_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_supportHover,_notDisabled,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,1.5xl,1.5xlOnly,1.5xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo1.5xl,smTo2xl,mdToLg,mdToXl,mdTo1.5xl,mdTo2xl,lgToXl,lgTo1.5xl,lgTo2xl,xlTo1.5xl,xlTo2xl,1.5xlTo2xl,base".split(",")),gt=/^@|&|&$/;function mt(e){return pt.has(e)||gt.test(e)}const vt=/^_/,bt=/&|@/,ft=/* @__PURE__ */new Map;"aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos,top:top,left:left,inset:inset,insetInline:inset-x,insetBlock:inset-y,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e,insetInlineStart:inset-s,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p,paddingLeft:pl,paddingRight:pr,paddingTop:pt,paddingBottom:pb,paddingBlock:py,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px,paddingInlineEnd:pe,paddingInlineStart:ps,marginLeft:ml,marginRight:mr,marginTop:mt,marginBottom:mb,margin:m,marginBlock:my,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx,marginInlineEnd:me,marginInlineStart:ms,spaceX:sx,spaceY:sy,outlineWidth:ring-w,outlineColor:ring-c,outline:ring,outlineOffset:ring-o,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w,inlineSize:w-is,minWidth:min-w,minInlineSize:min-w-is,maxWidth:max-w,maxInlineSize:max-w-is,height:h,blockSize:h-bs,minHeight:min-h,minBlockSize:min-h-bs,maxHeight:max-h,maxBlockSize:max-b,boxSize:size,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p,backgroundPositionX:bg-p-x,backgroundPositionY:bg-p-y,backgroundAttachment:bg-a,backgroundClip:bg-cp,background:bg,backgroundColor:bg-c,backgroundOrigin:bg-o,backgroundImage:bg-i,backgroundRepeat:bg-r,backgroundBlendMode:bg-bm,backgroundSize:bg-s,backgroundGradient:bg-grad,backgroundLinear:bg-linear,backgroundRadial:bg-radial,backgroundConic:bg-conic,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr,borderTopLeftRadius:bdr-tl,borderTopRightRadius:bdr-tr,borderBottomRightRadius:bdr-br,borderBottomLeftRadius:bdr-bl,borderTopRadius:bdr-t,borderRightRadius:bdr-r,borderBottomRadius:bdr-b,borderLeftRadius:bdr-l,borderStartStartRadius:bdr-ss,borderStartEndRadius:bdr-se,borderStartRadius:bdr-s,borderEndStartRadius:bdr-es,borderEndEndRadius:bdr-ee,borderEndRadius:bdr-e,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderBlockStartWidth:bd-bs-w,borderBlockEndWidth:bd-be-w,borderColor:bd-c,borderInline:bd-x,borderInlineWidth:bd-x-w,borderInlineColor:bd-x-c,borderBlock:bd-y,borderBlockWidth:bd-y-w,borderBlockColor:bd-y-c,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s,borderInlineStartWidth:bd-s-w,borderInlineStartColor:bd-s-c,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e,borderInlineEndWidth:bd-e-w,borderInlineEndColor:bd-e-c,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh,boxShadowColor:bx-sh-c,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x,translateY:translate-y,translateZ:translate-z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,cursor:cursor".split(",").forEach(e=>{const[t,r]=e.split(":");ft.set(t,r)});const yt={conditions:{shift:function(e){return e.sort((e,t)=>{const r=mt(e),n=mt(t);return r&&!n?1:!r&&n?-1:0})},finalize:function(e){return e.map(e=>pt.has(e)?e.replace(vt,""):bt.test(e)?`[${Xe(e.trim())}]`:e)},breakpoints:{keys:["base","sm","md","lg","xl","1.5xl","2xl"]}},utility:{prefix:"tsystem",transform:(e,t)=>({className:`${ft.get(e)||lt(e)}_${Xe(t)}`}),toHash:(e,t)=>t(e.join(":")),resolveShorthand:e=>e}},Tt=function(e){const{utility:t,hash:r,conditions:n=ot}=e,o=e=>[t.prefix,e].filter(Boolean).join("-");return Ze(({base:a,...i}={})=>{const l=nt(Object.assign(i,a),e),s=/* @__PURE__ */new Set;return rt(l,(e,a)=>{if(null==e)return;const i="string"==typeof(u=e)&&Qe.test(u),[l,...c]=n.shift(a),d=c.slice().filter(e=>!/* @__PURE__ */(e=>"base"===e)(e));var u;const h=t.transform(l,function(e){return"string"==typeof e?e.replace(Qe,"").trim():e}((e=>"string"==typeof e?e.replaceAll(/[\n\s]+/g," "):e)(e)));let p=((e,a)=>{let i;if(r){const r=[...n.finalize(e),a];i=o(t.toHash(r,Ge))}else i=[...n.finalize(e),o(a)].join(":");return i})(d,h.className);i&&(p=`${p}!`),s.add(p)}),Array.from(s).join(" ")})}(yt),xt=(...e)=>Tt(kt(...e));xt.raw=(...e)=>kt(...e);const{mergeCss:kt}=function(e){function t(t){const r=function(...e){return e.flat().filter(e=>$e(e)&&Object.keys(qe(e)).length>0)}(...t);return 1===r.length?r:r.map(t=>nt(t,e))}return{mergeCss:Ze(function(...e){return et(...t(e))}),assignCss:function(...e){return Object.assign({},...t(e))}}}(yt);function wt(){let e,t="",r=0;for(;r<arguments.length;)(e=arguments[r++])&&"string"==typeof e&&(t&&(t+=" "),t+=e);return t}const Ct=e=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function Et(e){const{base:t,variants:r,defaultVariants:n,compoundVariants:o}=Ct(e),a=e=>({...n,...qe(e)});function i(e={}){const n=a(e);let i={...t};for(const[t,o]of Object.entries(n))r[t]?.[o]&&(i=kt(i,r[t][o]));const l=function(e,t){let r={};return e.forEach(e=>{Object.entries(e).every(([e,r])=>"css"===e||(Array.isArray(r)?r:[r]).some(r=>t[e]===r))&&(r=kt(r,e.css))}),r}(o,n);return kt(i,l)}const l=Object.keys(r),s=Object.fromEntries(Object.entries(r).map(([e,t])=>[e,Object.keys(t)]));return Object.assign(Ze(function(e){return xt(i(e))}),{__cva__:!0,variantMap:s,variantKeys:l,raw:i,config:e,merge:function(e){const a=Ct(e.config),i=((...e)=>{const t=e.reduce((e,t)=>(t&&t.forEach(t=>e.add(t)),e),/* @__PURE__ */new Set([]));return Array.from(t)})(e.variantKeys,Object.keys(r));return Et({base:kt(t,a.base),variants:Object.fromEntries(i.map(e=>[e,kt(r[e],a.variants[e])])),defaultVariants:et(n,a.defaultVariants),compoundVariants:[...o,...a.compoundVariants]})},splitVariantProps:function(e){return function(e,...t){const r=Object.getOwnPropertyDescriptors(e),n=Object.keys(r),o=e=>{const t={};for(let n=0;n<e.length;n++){const o=e[n];r[o]&&(Object.defineProperty(t,o,r[o]),delete r[o])}return t};return t.map(e=>o(Array.isArray(e)?e:n.filter(e))).concat(o(n))}(e,l)},getVariantProps:a})}var It,St=((It=St||{}).component="component",It["dashboard-placeholder-table"]="dashboard-placeholder-table",It["dashboard-header"]="dashboard-header",It["dashboard-table"]="dashboard-table",It["dashboard-table-body"]="dashboard-table-body",It["dashboard-table-cell"]="dashboard-table-cell",It["dashboard-table-column-header"]="dashboard-table-column-header",It["dashboard-table-header"]="dashboard-table-header",It.label="label",It.popup="popup",It["popup-sort-row"]="popup-sort-row",It["progress-bar"]="progress-bar",It["progress-bar-fill"]="progress-bar-fill",It.summation="summation",It["table-parent-row"]="table-parent-row",It["table-row"]="table-row",It["table-sub-row"]="table-sub-row",It.tile="tile",It["tile-bar-label"]="tile-bar-label",It["tile-body"]="tile-body",It["tile-filter-button"]="tile-filter-button",It["tile-filter-list"]="tile-filter-list",It["tile-filter-row"]="tile-filter-row",It["tile-header"]="tile-header",It["tile-title"]="tile-title",It.title="title",It["business-owner-dashboard"]="business-owner-dashboard",It["business-owner-dashboard-header"]="business-owner-dashboard-header",It["business-owner-table"]="business-owner-table",It["transaction-type-label"]="transaction-type-label",It["selector-row"]="selector-row",It["popup-list"]="popup-list",It.badge="badge",It["date-cell"]="date-cell",It["expander-cell"]="expander-cell",It["vertical-divider"]="vertical-divider",It["horizontal-divider"]="horizontal-divider",It["table-cell-divider"]="table-cell-divider",It["checkbox-input"]="checkbox-input",It["bulk-select"]="bulk-select",It["button-base"]="button-base",It["button-discrete-small"]="button-discrete-small",It["button-primary"]="button-primary",It["button-secondary"]="button-secondary",It["button-tertiary"]="button-tertiary",It["button-danger"]="button-danger",It["button-warning"]="button-warning",It["button-action"]="button-action",It.text="text",It["cell-button"]="cell-button",It["month-picker-left-button"]="month-picker-left-button",It["month-picker-right-button"]="month-picker-right-button",It["filter-bar"]="filter-bar",It["filter-search-bar"]="filter-search-bar",It["filter-pill"]="filter-pill",It["discrete-form-input"]="discrete-form-input",It["editable-form-input"]="editable-form-input",It["category-text"]="category-text",It["amount-input-container"]="amount-input-container",It["amount-input"]="amount-input",It["modal-popup"]="modal-popup",It["drawer-header"]="drawer-header",It["drawer-header-border"]="drawer-header-border",It["form-body"]="form-body",It.body="body",It.heading="heading",It["sub-label"]="sub-label",It["strong-label"]="strong-label",It["strong-sub-label"]="strong-sub-label",It["metric-xl"]="metric-xl",It["metric-md"]="metric-md",It["large-icon"]="large-icon",It["medium-icon"]="medium-icon",It["small-icon"]="small-icon",It["tiny-icon"]="tiny-icon",It["neutral-badge"]="neutral-badge",It["highlight-badge"]="highlight-badge",It["success-badge"]="success-badge",It["warning-badge"]="warning-badge",It["critical-badge"]="critical-badge",It["button-group"]="button-group",It["alert-dialog"]="alert-dialog",It["emphasis-label"]="emphasis-label",It["profit-loss-graph"]="profit-loss-graph",It.banner="banner",It["banner-high"]="banner-high",It["banner-medium"]="banner-medium",It["banner-low"]="banner-low",It["banner-urgent"]="banner-urgent",It["banner-default"]="banner-default",It["banner-button"]="banner-button",It["banner-button-text"]="banner-button-text",It["banner-button-icon"]="banner-button-icon",It["empty-dashboard-layout"]="empty-dashboard-layout",It["zero-state-layout"]="zero-state-layout",It["emphasis-sub-label"]="emphasis-sub-label",It);const At="Tight-",Nt=e=>`${At}${e}`;function Pt(e){return e in St}function Mt(e){const t=e.indexOf("-"),r=e.slice(0,t+1),n=e.slice(t+1);return r===At&&n in St}function Dt(e){return!Pt(e)&&!Mt(e)}const Rt=(e,...t)=>{const r=[],n=[];return null!==e&&r.push(Nt(e)),t.forEach(e=>{void 0!==e&&(Dt(e)?n.push(e):Pt(e)&&r.push(Nt(e)))}),{className:wt(...r,...n)}},Ot=Rt(St["business-owner-dashboard-header"],xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:80}));function _t({children:e}){return w("div",{...Ot,children:e})}function Lt(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Mt(t)&&e.push(t),e),[])],[])}function Ft(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Dt(t)&&e.push(t),e),[])],[])}function Bt(e){const t=Array.isArray(e)?e:[e];return{className:wt(...Lt(t),...Ft(t))}}const Wt=Et({base:{},variants:{body:{default:{fontWeight:"body",fontSize:{sm:"body",base:"lg"},fontFamily:"body",color:"typography.base",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"}},label:{default:{fontWeight:"label",fontSize:{sm:"label",base:"lg"},fontFamily:"label",color:"typography.label",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"},subLabel:{fontWeight:"label.sub",fontSize:{sm:"label.sub",base:"md"},fontFamily:"label",color:"typography.label.sub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.66px"},strongLabel:{fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"},strongSubLabel:{fontWeight:"label.strongSub",fontSize:{sm:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.strongSub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.84px"},emphasisSubLabel:{fontWeight:"label.emphasisSub",fontSize:{sm:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.emphasisSub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.84px"}},heading:{default:{fontWeight:"heading",fontSize:"heading",fontFamily:"heading",color:"typography.heading",lineHeight:"25px",letterSpacing:"2px"}},metric:{sm:{fontWeight:"metric.sm",fontSize:"metric.sm",fontFamily:"metric",color:"typography.metric.sm"},md:{fontWeight:"metric.md",fontSize:"metric.md",fontFamily:"metric",color:"typography.metric.md"},lg:{fontWeight:"metric.lg",fontSize:"metric.lg",fontFamily:"metric",color:"typography.metric.lg"},xl:{fontWeight:"metric.xl",fontSize:"metric.xl",fontFamily:"metric",color:"typography.metric.xl"}}}}),Ht=Rt(St.heading,Wt({heading:"default"}));function Ut({children:e,stylists:t=[]}){const r=Bt([Ht,...t]);return w("div",{...r,children:e})}function Vt(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function zt(e,t,r){return new Date(e,t,r)}function jt(e,t){return Vt(zt(t,e,1))}const Kt={THIS_YEAR:"THIS_YEAR",THIS_MONTH:"THIS_MONTH",LAST_YEAR:"LAST_YEAR",LAST_MONTH:"LAST_MONTH",PAST_YEAR:"PAST_YEAR"},$t=e=>{switch(e){case Kt.THIS_YEAR:return Vt(zt(/* @__PURE__ */(new Date).getFullYear(),0,1));case Kt.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return jt(e.getMonth(),e.getFullYear())}();case Kt.LAST_YEAR:return Vt(zt(/* @__PURE__ */(new Date).getFullYear()-1,0,1));case Kt.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return Vt(zt(e.getFullYear(),e.getMonth()-1,1))}();case Kt.PAST_YEAR:return function(){const e=/* @__PURE__ */new Date;return Vt(zt(e.getFullYear()-1,e.getMonth(),1))}();default:return""}},qt=e=>{switch(e){case Kt.THIS_YEAR:return Vt(zt(/* @__PURE__ */(new Date).getFullYear()+1,0,0));case Kt.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return Vt(zt(e.getFullYear(),e.getMonth()+1,0))}();case Kt.LAST_YEAR:return Vt(zt(/* @__PURE__ */(new Date).getFullYear(),0,0));case Kt.PAST_YEAR:case Kt.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return Vt(zt(e.getFullYear(),e.getMonth(),0))}();default:return""}},Yt=e=>{return t=e,Object.values(Kt).includes(t)?{beginDate:$t(e),endDate:qt(e)}:{beginDate:Vt((r=e).beginDate),endDate:Vt(r.endDate)};var t,r},Gt=["SUN","MON","TUE","WED","THU","FRI","SAT"],Qt=["January","February","March","April","May","June","July","August","September","October","November","December"];function Xt({yearsBack:e=10,startYear:t}){const r=t??/* @__PURE__ */(new Date).getFullYear(),n=[r];for(let o=r-1;o>=r-e;o--)n.push(o);return n}function Zt(e,t){return e.toDateString()===t.toDateString()}function Jt(e){return Zt(e,/* @__PURE__ */new Date)}function er(e,t){const r=zt(e.getFullYear(),e.getMonth(),e.getDate()),n=zt(t.getFullYear(),t.getMonth(),t.getDate());return r.getTime()>n.getTime()}function tr(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${String(e.getMonth()+1).padStart(2,"0")}/${String(e.getDate()).padStart(2,"0")}/${e.getFullYear()}`:""}function rr(e,t,r){if(e<1||e>12||t<1||t>31)return!1;const n=zt(r,e-1,t);return!(n.getFullYear()!==r||n.getMonth()!==e-1||n.getDate()!==t)}function nr(e){if(!e.trim())return null;const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/);if(!t)return null;const[,r,n,o]=t,a=parseInt(r,10),i=parseInt(n,10),l=parseInt(o,10);return rr(a,i,l)?zt(l,a-1,i):null}function or(e){if(!e.trim())return null;const t=e.match(/^(\d{1,4})-(\d{1,2})-(\d{1,2})$/);if(!t)return null;const[,r,n,o]=t,a=parseInt(r,10),i=parseInt(n,10),l=parseInt(o,10);return rr(i,l,a)?zt(a,i-1,l):null}function ar(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:""}const ir=(e,t)=>{const r={month:t.abbreviateMonth?"short":"long",year:t.abbreviateYear?"2-digit":"numeric"};return e.toLocaleString("default",r)},lr=e=>{const t=new Date(e||""),r=/* @__PURE__ */new Date;return Jt(t)?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):t.getFullYear()===r.getFullYear()?(e=>e.toLocaleString("default",{month:"short"})+" "+e.getDate())(t):ir(t,{abbreviateMonth:!0,abbreviateYear:!1})};function sr(e,t,r){return[...e,{accessToken:t,environment:r}]}function cr(e,t){return[...e,t]}const dr=e=>null==e,ur=e=>!dr(e);function hr(e){return dr(e)||""===e.trim()}function pr(e){return!hr(e)}const gr=h({activeToken:void 0,accountantToken:void 0});function mr(){const{activeToken:e}=p(gr);return e}const vr=()=>{throw new Error("No access token provided")},br=72e5,fr=new I({defaultOptions:{queries:{gcTime:br,staleTime:3e4,refetchInterval:6e4}}}),yr=h("SANDBOX");function Tr(){return p(yr)}function xr({queryKey:e,queryFn:t,...r}){const n=mr(),o=Tr(),a=pr(n),i=sr(e,n??"",o),l=S(),s=A({...r,queryKey:i,queryFn:a?t:vr,placeholderData:r.keepPreviousDataPlaceholder?N:void 0,...a?{}:{retry:!1,staleTime:1/0}},fr);return{isRehydrating:l,isFilling:l||s.isLoading,query:s}}class kr{constructor(e){this.client=e}async sendEvent({apiKey:e,events:t,notifier:r,payloadVersion:n}){const o=/* @__PURE__ */(new Date).toISOString(),a=JSON.stringify({apiKey:e,payloadVersion:n,notifier:r,events:t});await fetch(this.client.endpoints.notify,{method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"application/json","Bugsnag-Api-Key":e,"Bugsnag-Payload-Version":n,"Bugsnag-Sent-At":o},referrerPolicy:"no-referrer",body:a})}}const wr=Symbol("Circular"),Cr=Symbol("AccessError");function Er(e,t,r){return Ir({key:"",value:e,replacer:t,seen:[],depth:0,depthLimit:r?.depthLimit,edgeIndex:0,edgesLimit:r?.edgesLimit})}function Ir({key:e,value:t,replacer:r,seen:n,depthLimit:o=1/0,depth:a,edgeIndex:i,edgesLimit:l=1/0}){let s=t;if(n.includes(s)&&(s=wr),r&&(s=r(e,s)),"object"==typeof(c=s)&&null!==c&&"toJSON"in c&&"function"==typeof c.toJSON&&(s=Sr(()=>s.toJSON(String(e)))),null===s||"object"!=typeof s)return s;var c;if(a>o||i+1>l)return"[...]";if(n.push(t),Array.isArray(s)){const e=[],t=Math.min(s.length,l);for(let i=0;i<t;i++){const t=Sr(()=>s[i]);e.push(Ir({key:i,value:t,replacer:r,seen:n,depth:a,depthLimit:o,edgeIndex:i,edgesLimit:l}))}t<s.length&&e.push("[...]"),s=e}else{const e={},t=Object.keys(s);for(let i=0;i<t.length;i++){const c=t[i],d=Sr(()=>s[c]);e[c]=Ir({key:c,value:d,replacer:r,seen:n,depth:a,depthLimit:o,edgeIndex:i,edgesLimit:l})}s=e}return n.pop(),s}function Sr(e){try{return e()}catch{return Cr}}const Ar=Object.prototype.toString,Nr=Object.getPrototypeOf;function Pr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Mr=/^\s*at .*(\S+:\d+|\(native\))/m,Dr=/^(eval@)?(\[native code])?$/;function Rr(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)return[e];const r=t[2]?parseInt(t[2],10):void 0,n=t[3]?parseInt(t[3],10):void 0;return[t[1],r,n]}function Or(e,t){const r=_r(e,t);let n;"InvalidError"===r.name&&(n={[t]:{"non-error parameter":e}}),void 0!==r.metadata&&Pr(r.metadata)&&(n={...n,[r.name]:r.metadata});const o=[Lr(r)];return o.push(...Wr(r).map(e=>Lr(e,{backtrace:!1}))),{exceptions:o,metadata:n}}function _r(e,t){if(function(e){if(e instanceof Error)return!0;let t=e;for(;t;){if("[object Error]"===Ar.call(t))return!0;t=Nr(t)}return!1}(e))return e;let r=function(e){if(!Pr(e))return null;const t=t=>{const r=e[t];if("string"==typeof r&&e[t.length])return r},r=t("name")||t("errorClass"),n=t("message")||t("errorMessage");if(!r||!n)return null;const o=new Error(n);return o.name=r,o}(e);if(r)return r;switch(typeof r){case"string":case"number":case"boolean":return new Error(String(e));default:return r=new Error(`${t} received a non-error. See "${t}" tab for more detail.`),r.name="InvalidError",r}}function Lr(e,t={backtrace:!1}){return{errorClass:e.name,message:e.message,stacktrace:Fr(e,t),type:"object"==typeof self&&self.navigator?"browserjs":"nodejs"}}function Fr(e,{backtrace:t}){const r=function(e){let t=e.stack;return void 0===t&&(t=e.stacktrace),"string"==typeof t&&t.length&&t!==`${e.name}: ${e.message}`?t:void 0}(e);return r?function(e){return(e.match(Mr)?e.split("\n").filter(e=>!!e.match(Mr)).map(e=>{e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),o=Rr(r?r[1]:n.pop()||"(no location)"),a=n.join(" ")||void 0;return{file:["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0],lineNumber:o[1],columnNumber:o[2],method:a}}):(t=e,t.split("\n").filter(e=>!e.match(Dr)).map(e=>{if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return{method:e};{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,o=Rr(e.replace(t,""));return{file:o[0],lineNumber:o[1],columnNumber:o[2],method:n}}}))).reduce((e,t)=>{if("{}"===JSON.stringify(t))return e;let r=t.file||t.method||"number"!=typeof t.lineNumber?t.file||"(unknown file)":"global code";r=r.replace(/\?.*$/,"").replace(/#.*$/,"");let n=t.method||"(unknown function)";return n=/^global code$/i.test(n)?"global code":n,e.concat([{file:r,lineNumber:t.lineNumber,columnNumber:t.columnNumber,method:n}])},[]);var t}(r):t?function(){const e=[];let t;try{t=arguments.callee}catch{return[]}for(;t&&e.length<Br;){t.name?e.push({method:t.name,file:"(unknown file)"}):/function(?:\s+([\w$]+))+\s*\(/.test(t.toString())&&e.push({method:RegExp.$1,file:"(unknown file)"});try{t=t.caller}catch{break}}return e}():[]}const Br=20;function Wr(e){const t=e;if(t.cause){const e=_r(t.cause,"cause");return"InvalidError"===e.name?[]:[e].concat(Wr(e))}return[]}function Hr(...e){console.error}const Ur={name:"errorBreadcrumbs",load(e){e.addOnPostError(t=>{e.leaveBreadcrumb(t.exceptions[0].errorClass,{errorClass:t.exceptions[0].errorClass,errorMessage:t.exceptions[0].message,severity:t.severity},"error")})}};let Vr=Date.now();const zr=()=>{Vr=Date.now()},jr={name:"appDuration",load:e=>(e.addOnError(e=>{const t=Date.now();return e.app=e.app||{},e.app.duration=t-Vr,!0}),{reset:zr})},Kr=[["Edge (EdgeHTML)",/Edge\/([0-9._]+)/],["Edge (iOS)",/EdgiOS\/([0-9._]+)/],["Yandex",/YaBrowser\/([0-9._]+)/],["KakaoTalk",/KAKAOTALK\s([0-9.]+)/],["Samsung",/SamsungBrowser\/([0-9.]+)/],["Silk",/\bSilk\/([0-9._-]+)\b/],["MIUI",/MiuiBrowser\/([0-9.]+)$/],["Beaker",/BeakerBrowser\/([0-9.]+)/],["Edge (Chromium)",/EdgA?\/([0-9.]+)/],["Chromium WebView",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/],["Chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/],["Chrome (iOS)",/CriOS\/([0-9.]+)(:?\s|$)/],["Firefox",/Firefox\/([0-9.]+)(?:\s|$)/],["Firefox (iOS)",/FxiOS\/([0-9.]+)/],["Opera Mini",/Opera Mini.*Version\/([0-9.]+)/],["Opera",/Opera\/([0-9.]+)(?:\s|$)/],["Opera",/OPR\/([0-9.]+)(:?\s|$)/],["Internet Explorer",/Trident\/7\.0.*rv:([0-9.]+).*\).*Gecko$/],["Internet Explorer",/MSIE\s([0-9.]+);.*Trident\/[4-7].0/],["Internet Explorer",/MSIE\s(7\.0)/],["Blackberry",/BB10;\sTouch.*Version\/([0-9.]+)/],["Android",/Android\s([0-9.]+)/],["Safari (iOS)",/Version\/([0-9._]+).*Mobile.*Safari.*/],["Safari",/Version\/([0-9._]+).*Safari/],["Facebook",/FB[AS]V\/([0-9.]+)/],["Instagram",/Instagram\s([0-9.]+)/],["iOS WebView",/AppleWebKit\/([0-9.]+).*Mobile/],["iOS WebView",/AppleWebKit\/([0-9.]+).*Gecko\)$/]],$r=[["iOS",void 0,/iP(hone|od|ad)/],["Android",void 0,/Android/],["BlackBerry",void 0,/BlackBerry|BB10/],["Windows Mobile",void 0,/IEMobile/],["Kindle",void 0,/Kindle/],["Windows","3.11",/Win16/],["Windows","95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows","98",/(Windows 98)|(Win98)/],["Windows","2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows","XP",/(Windows NT 5.1)|(Windows XP)/],["Windows","Server 2003",/(Windows NT 5.2)/],["Windows","Vista",/(Windows NT 6.0)/],["Windows","7",/(Windows NT 6.1)/],["Windows","8",/(Windows NT 6.2)/],["Windows","8.1",/(Windows NT 6.3)/],["Windows","10+",/(Windows NT 10.0)/],["Windows","ME",/Windows ME/],["Open BSD",void 0,/OpenBSD/],["Sun OS",void 0,/SunOS/],["Chrome OS",void 0,/CrOS/],["Linux",void 0,/(Linux)|(X11)/],["Mac OS",void 0,/(Mac_PowerPC)|(Macintosh)/],["QNX",void 0,/QNX/],["BeOS",void 0,/BeOS/],["OS/2",void 0,/OS\/2/]],qr=(Yr=function(e){const t=""!==(r=e)&&Kr.reduce((e,[t,n])=>{if(e)return e;const o=n.exec(r);return!!o&&[t,o]},!1);var r;if(!t)return{};const[n,o]=t,a=function(e){for(const[t,r,n]of $r)if(n.exec(e))return{osName:t,osVersion:r};return null}(e),i="iOS"===a?.osName?function(e){const t=/iPad|iPhone|iPod/.exec(e);return t?{manufacturer:"Apple",model:t[0]}:/MacIntel/.test(e)&&self.navigator&&self.navigator.maxTouchPoints&&self.navigator.maxTouchPoints>2?{manufacturer:"Apple",model:"iPad"}:null}(e):{};return{browserName:n,browserVersion:o[1],osName:a?.osName,osVersion:a?.osVersion,manufacturer:i?.manufacturer,model:i?.model}},{name:"browserContext",load(e){e.addOnError(e=>{e.request={...e.request,url:self.location.href},e.context=e.context||self.location.pathname,e.device={...e.device,...Yr(self.navigator.userAgent),locale:self.navigator.language,userAgent:self.navigator.userAgent};let t=["n/a"];try{t=self.navigator.languages}catch{}return e.metaData={...e.metaData,language:{language:self.navigator.language,languages:t}},!0})}});var Yr;class Gr{limit;period;events;constructor(e,t){this.limit=e,this.period=t,this.events=new M}reset(){this.events.clear()}increment(){const e=/* @__PURE__ */(new Date).getTime();if(void 0!==this.period){let t=this.events.peek();for(;void 0!==t&&e-this.period>t;)this.events.dequeue(),t=this.events.peek()}const t=this.events.size+1<=this.limit;return t&&this.events.enqueue(e),t}get size(){return this.events.size}}class Qr extends g{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}handleClearError(){this.setState({error:void 0,errorInfo:void 0})}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){const{exceptions:r,metadata:n}=Or(e,"notify");t&&t.componentStack&&(t.componentStack=function(e){const t=e.split(/\s*\n\s*/g);let r="";for(let n=0,o=t.length;n<o;n++)t[n].length&&(r+=`${r.length?"\n":""}${t[n]}`);return r}(t.componentStack));const{onError:o,client:a}=this.props;a.notifyEvent({exceptions:r,unhandled:!0,severity:"error",severityReason:{type:"unhandledException"},metadata:{...n,react:t},onError:o},e),this.setState({errorInfo:t})}render(){const{error:e}=this.state;if(e){const{FallbackComponent:e}=this.props;if(e)return w(e,{error:this.state.error,errorInfo:this.state.errorInfo,clearError:()=>this.handleClearError()})}return w(C,{children:this.props.children})}}const Xr={name:"react",load:e=>({BugsnagErrorBoundary:({onError:t,fallbackComponent:r,children:n})=>w(Qr,{client:e,onError:t,FallbackComponent:r,children:n})})},Zr=new class{breadcrumbs=[];config;delivery=new kr(this);errorCallbacks=/* @__PURE__ */new Set;postErrorCallbacks=/* @__PURE__ */new Set;plugins=[];start(e){if(this.config)return Hr(),this;let t;this.config=e,this.config.onError&&(t=Array.isArray(this.config.onError)?this.config.onError:[this.config.onError]),this.errorCallbacks=new Set(t);for(const r of this.config.plugins||[])this.plugins.push({name:r.name||"unknown",plugin:r.load(this)});return this}get endpoints(){return{notify:this.config?.endpoints?.notify||"https://notify.bugsnag.com/"}}notify(e,t={}){const{exceptions:r,metadata:n}=Or(e,"notify");let o,a,i=n;return"function"==typeof t?o=t:(a=t.severity,t.metadata&&(i={...n,...t.metadata})),this.notifyEvent({exceptions:r,metadata:i,severity:a,onError:o},e)}leaveBreadcrumb(e,t,r){if(!this.config)return;if("string"!=typeof e)try{e=String(e)}catch{e="Unable to stringify breadcrumb message"}if(!e.length)return;this.breadcrumbs.push({name:e,metaData:t,type:r||"manual",timestamp:/* @__PURE__ */(new Date).toISOString()});const{maxBreadcrumbs:n=25}=this.config;this.breadcrumbs.length>n&&this.breadcrumbs.splice(0,this.breadcrumbs.length-n)}async notifyEvent({exceptions:e,unhandled:t,severity:r,severityReason:n,metadata:o,onError:a},i){if(!this.config)return;const l=this.config.releaseStage||"production";if(this.config.enabledReleaseStages&&!this.config.enabledReleaseStages.includes(l))return;const s={exceptions:e,breadcrumbs:this.breadcrumbs.length?this.breadcrumbs:void 0,originalError:i,unhandled:"boolean"==typeof t&&t,severity:r||"warning",severityReason:n,user:this.config.user||void 0,app:{releaseStage:l,version:this.config.appVersion,type:this.config.appType||("object"==typeof window?"browser":"node")},device:{time:/* @__PURE__ */(new Date).toISOString()},metaData:o||{}},c=[...this.errorCallbacks];a&&c.push(a);const d=["stringifyValues","redact"];c.sort((e,t)=>d.includes(e.name)&&d.includes(t.name)?0:d.includes(e.name)?1:d.includes(t.name)?-1:0);for(const m of c){const e=await m(s);if("boolean"==typeof e&&!e)return}const u=Er(s,(e,t)=>{if("originalError"!==e)return t},{depthLimit:20,edgesLimit:500});let h;const p={apiKey:this.config.apiKey,payloadVersion:"5",notifier:{name:"Tight Components",version:"1",url:"https://github.com/Hurdlr/TraxComponents/tree/dev/src/bugsnag/README.md"},events:[u]};try{h=JSON.stringify(p)}catch{u.metaData={notifier:"Unable to serialize metadata"},h=JSON.stringify(p)}if(h.length>1e6&&(u.metaData={notifier:`Payload was ${h.length/1e6}Mb. Metadata removed.`},h=JSON.stringify(p),h.length>1e6))throw new Error("Payload exceeded 1Mb limit");for(const m of this.postErrorCallbacks)m(s);try{await this.delivery.sendEvent(p)}catch(g){Hr()}}getUser(){return this.config?.user||{}}setUser(e,t,r){this.config&&(this.config.user={id:e,email:t,name:r})}setProperties(e){this.config&&(this.config.releaseStage=e)}addOnError(e){this.errorCallbacks.add(e)}removeOnError(e){this.errorCallbacks.delete(e)}addOnPostError(e){this.postErrorCallbacks.add(e)}removeOnPostError(e){this.postErrorCallbacks.delete(e)}getPlugin(e){return this.plugins.find(t=>t.name===e)?.plugin}setDelivery(e){this.delivery=e}};let Jr="",en="";const tn="prod",rn=Zr.start({apiKey:"899aec02393ac236377b73b483800d2c",appVersion:"1.2.0",appType:"browser",releaseStage:tn,plugins:[jr,qr,Ur,(()=>{const e=new Gr(15,1e3);return"undefined"!=typeof window&&window.addEventListener("popstate",e.reset),{name:"limitEvents",load:t=>(t.addOnError(function(){return e.increment()}),{reset:e.reset})}})(),Xr]}),nn=(e,t)=>{try{Zr.leaveBreadcrumb(e,t)}catch(r){r instanceof Error?on({error:r,severity:"error"}):on({error:new Error("Unknown error in logging.breadcrumb"),severity:"error",extraData:{originalError:r}})}},on=async e=>{try{await Zr.notify(e.error,t=>(t.severity=e.severity,e.groupingHash&&(t.groupingHash=e.groupingHash),t.metaData={...t.metaData,custom:{...e.extraData,accessToken:Jr,environment:en}},!0)),e.error,e.error.message,e.extraData,console.warn}catch(t){t instanceof Error?await on({error:t,severity:"error"}):await on({error:new Error("Unknown error in logging.notify"),severity:"error",extraData:{originalError:t}})}},an=rn.getPlugin("react"),ln=an?.BugsnagErrorBoundary,sn=(e,t)=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`,cn=({extraHeaders:e,authorization:t})=>{const r={...e};return void 0!==t&&(r.Authorization=t),r},dn=async e=>{const t=await e.json();return e.ok?t:Promise.reject(t)},un={"hurdlr-cache-session":!0,"hurdlr-auto-refresh-token":!0};function hn(e){const t=(({accessToken:e,extraHeaders:t})=>{const r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};return void 0!==t?{...o(t,e=>`${e}`),...r}:r})({accessToken:e.accessToken,extraHeaders:{...e.extraHeaders,...e.pagination,..."v5"===e.endpointManager.apiVersion?un:{}}});return{url:(r=e.endpointManager.getUrl(e.path),n=e.pathParams,void 0!==n&&Object.entries(n).forEach(([e,t])=>{r=r.replace(`{${e}}`,t)}),r),headers:t};var r,n}async function pn({authorization:e,extraHeaders:t,includeCredentials:r,method:n="POST",params:o,url:a}){const i=cn({extraHeaders:t,authorization:e});nn("HTTP POST Request",{url:a,accessToken:e});try{const e=await fetch(a,{method:n,headers:i,credentials:"include",body:JSON.stringify(o)});return nn("HTTP POST Response",{url:a,status:e.status,statusText:e.statusText}),dn(e)}catch(l){return Promise.reject(l)}}async function gn(e){const{url:t,headers:r}=hn(e);return pn({url:t,params:e.bodyParams,includeCredentials:!0,extraHeaders:r})}async function mn(e){return gn(e)}async function vn(e){return gn(e)}const bn=(e,t)=>({getUrl:t=>((e,t)=>{let r=t;for(;r.length>0&&"/"===r.charAt(0);)r=r.slice(1);return`${e}/${r}`})(e,t),baseUrl:e,apiVersion:t}),fn={DEVELOPMENT:"https://dev.hurdlr.com/rest",PRODUCTION:"https://prod.hurdlr.com/rest",SANDBOX:"https://sandbox.hurdlr.com/rest",LOCAL:"http://localhost:8081/TraxAngular/rest"},yn={DEVELOPMENT:"https://dev.tight.com",PRODUCTION:"https://prod.tight.com",SANDBOX:"https://sandbox.tight.com",LOCAL:"http://localhost:8080"},Tn={...yn,LOCAL:"http://localhost:8082"};function xn(e){return bn(`${t=e,fn[t]}/v5`,"v5");var t}const kn=({filter:e,grouping:t})=>["reports/profitAndLoss",{filter:e,...t&&{grouping:t}}],wn=async e=>{const t=e.queryKey,r=t[1],n=t[2].accessToken,o=t[2].environment,a={path:"/reports/profitAndLoss",bodyParams:{exportType:"JSON",...Yt(r.filter),...r.grouping&&{grouping:r.grouping}},accessToken:n,endpointManager:xn(o)};return await vn(a)};function Cn({filter:e,grouping:t,select:r}){return xr({queryKey:kn({filter:e,grouping:t}),queryFn:wn,select:r})}const En="noDataHeight";function In(e){const t=function(e){const t=or(e??"");return null!==t?ir(t,{abbreviateMonth:!0,abbreviateYear:!0}):""}(e.period?.beginDate),r=e.netIncome??0,{profit:n,remainingIncome:o,loss:a,remainingExpenses:i}=function(e,t,r){const n=e>0?e:0,o=e<0?e:0;return{profit:n,remainingIncome:void 0!==t?D(t).minus(n).toNumber():0,loss:o,remainingExpenses:void 0!==r?D(r).plus(o).toNumber():0}}(r,e.income?.total,e.expenses?.total);return{month:{month:t,income:o,expenses:-i,profit:n,loss:a,netIncome:r,hasNoData:/* @__PURE__ */function(e,t,r){return 0===e&&0===t&&0===r}(r,o,i)},netIncome:r}}function Sn(e){const t={total:0,domain:[],months:[],hasAnyData:!1};if("FAILURE_NO_DATA"===e.result)return t;const r=e.json?.data;if(dr(r))return t;for(const i of r){const{month:e,netIncome:r}=In(i);t.total=D(r).plus(t.total).toNumber(),t.months.push(e)}const{domainMin:n,domainMax:o}=r.reduce((e,t)=>({domainMin:Math.min(e.domainMin,-(t.expenses?.total??0)),domainMax:Math.max(e.domainMax,t.income?.total??0)}),{domainMin:0,domainMax:0});t.domain=[n,o],t.hasAnyData=t.months.some(e=>!e.hasNoData);const a=function(e,t){const r=t-e;return r>0?.03*r:3}(n,o);return t.months=t.months.map(e=>e.hasNoData?{...e,noDataHeight:a}:e),t}const An=Rt(St["tile-header"],xt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderTopRadius:"lg",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"15px"}));function Nn({title:e}){return w("div",{...An,children:w(Ut,{children:e})})}const Pn=Rt(St["tile-body"],xt({display:"flex",justifyContent:"start",alignItems:"start",flexDirection:"column",gap:"20px",height:"100%",padding:"20px 15px",backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderBottomRadius:"lg",borderTop:"hidden"}));function Mn({children:e}){return w("div",{...Pn,children:e})}const Dn=Et({base:{display:"flex",flexDirection:"column",boxShadow:"box-shadow",transition:"height 0.5s, width 0.5s",position:"relative"},variants:{type:{default:{width:"400px",flexShrink:0,height:"300px"},chart:{minWidth:"900px",maxWidth:"1440px",height:"481px"}},isSample:{true:{pointerEvents:"none"},false:{}}},defaultVariants:{type:"default"}});function Rn({children:e,type:t,isSample:r=!1}){const n=Rt(St.tile,Dn({type:t,isSample:r}));return w("div",{...n,children:e})}const On=xt({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),_n=xt.raw({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"}),Ln=xt({fontSize:"sm",fontStyle:"normal",fontWeight:"sm",lineHeight:"12px",letterSpacing:"0.66px"}),Fn=Rt(St.text,xt({fontSize:"md",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On);function Bn({children:e}){return w("div",{...Fn,children:e})}const Wn=Rt(St["metric-xl"],Wt({metric:"xl"}));function Hn(e){return w("div",{...Wn,children:e.children})}const Un=Rt(St.summation,xt({display:"flex",flexDirection:"column",flexShrink:1,alignItems:"flex-start",justifyContent:"space-between"}));function Vn({title:e,label:t}){return E("div",{...Un,children:[w(Hn,{children:e}),w(Bn,{children:t})]})}const zn=Rt(null,xt({display:"flex",flexDirection:"column",justifyContent:"space-evenly",alignItems:"start",height:"100%",width:"100%"}));function jn({children:e}){return w("div",{...zn,children:e})}const Kn=(e,t=0)=>{const r=Math.abs(e);let n;if(t<=0)n=Math.round(r);else{const e=r.toFixed(t);n=parseFloat(e)}return Math.sign(e)*n},$n=(e,t=0,r=2)=>e.toLocaleString(void 0,{useGrouping:!0,minimumFractionDigits:t,maximumFractionDigits:r}),qn=1e9;function Yn(e,{cents:t="default",condense:r=!1,dollarSign:n=!1,signage:o="default"}={}){const a="string"==typeof e?parseFloat(e):e;if(Number.isNaN(a))return"";let i;const l=Math.abs(a);let s;if(r&&l>99999){s=Math.sign(a)<0;const e=Math.floor((d=l,Math.log(d)/Math.log(1e3)))-1,t=Math.pow(1e3,e),r=Math.round(l/t),n=r*t;let o,c=r/1e3;l<qn&&c>=1e3&&(c/=1e3),n>=qn?o="B":n>=1e6?o="M":(c=Math.round(c),o="K"),i=`${$n(c,0,1)}${o}`}else{let e;const r=2,n=0;let o,l;"floor"===t?(o=n,l=n,c=a,e=Math.sign(c)*Math.floor(Math.abs(c))):"round"===t?(o=n,l=n,e=Kn(a,o)):"always"===t?(o=r,l=r,e=Kn(a,o)):"default"===t&&Math.abs(a)>=1e3?(o=n,l=n,e=Kn(a,o)):(o=r,e=Kn(a,o),l=e%1==0?n:r),s=Math.sign(e)<0;const d=Math.abs(e);i=$n(d,l,o)}var c,d;let u=i;const h=n?"$":"";return void 0===o||"off"===o?u=i:"parens"===o?u=`${h}${s?`(${i})`:i}`:"always"===o?u=`${s?"-":"+"}${h}${i}`:"default"===o&&(u=`${s?"-":""}${h}${i}`),u}function Gn(e){return Yn(e,{condense:!0,dollarSign:!0})}function Qn(e){return Yn(e,{cents:"always",condense:!1,dollarSign:!0,signage:"always"})}const Xn={"sm-sm":Rt(St.text,xt({fontSize:{sm:"sm",base:"md"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"sm-med":Rt(St.text,xt({fontSize:{sm:"sm",base:"md"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"sm-lg":Rt(St.text,xt({fontSize:"sm",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"med-sm":Rt(St.text,xt({fontSize:{sm:"md",base:"lg"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"med-med":Rt(St.text,xt({fontSize:{sm:"md",base:"lg"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"med-lg":Rt(St.text,xt({fontSize:{sm:"md",base:"lg"},fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On)};function Zn({children:e,size:t,weight:r,stylists:n=[]}){const o=Bt([Xn[`${t}-${r}`],...n]);return w("div",{title:e,...o,children:e})}const Jn=Et({variants:{wrap:{ellipsis:_n,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},textAlign:{start:{textAlign:"start"},center:{textAlign:"center"}}}});function eo({wrap:e="ellipsis",textAlign:t="start",children:r,stylists:n=[]}){if(hr(r))return null;const o=Rt(St["strong-label"],Wt({label:"strongLabel"}),Jn({wrap:e,textAlign:t}));return w(Zn,{size:"med",weight:"med",stylists:[o,...n],children:r})}const to=Et({base:{fontWeight:"label.sub",fontSize:{sm:"label.sub",base:"md"},fontFamily:"label",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.66px",fontStyle:"normal"},variants:{intent:{normal:{color:"typography.label.sub"},action:{color:"typography.intent.action"},primary:{color:"typography.intent.primary"},danger:{color:"typography.accent.danger"}},accent:{action:{_supportHover:{color:"typography.accent.action",transition:"color 100ms ease-out"},transition:"color 300ms ease-out"},active:{color:"typography.accent.action"}},wrap:{ellipsis:_n,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}}}});function ro({intent:e,wrap:t="ellipsis",children:r,accent:n}){const o=void 0===e&&void 0===n?"normal":void 0,a=Rt(St["sub-label"],to({intent:o,wrap:t,accent:n}),On);return hr(r)?null:w("div",{...a,children:r})}const no=Rt(null,xt({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",border:"1px solid {colors.border.layout}",borderRadius:"sm",backgroundColor:"surface.background",boxShadow:"box-shadow",padding:"10px",width:"fit-content",height:"fit-content"}));function oo({active:e,payload:t}){if(t.length<=0||!e||t[0].dataKey===En)return null;let r=t[0].value??0;return"expenses"===t[0].dataKey?r+=t[0].payload.loss:"income"===t[0].dataKey&&(r+=t[0].payload.profit),E("div",{...no,children:[w(eo,{children:t[0].name??""}),w(ro,{children:Gn(Number(r))})]})}const ao={"colors.white100":{value:"#FFFFFF",variable:"var(--Tight-colors-white100)"},"colors.white200":{value:"#F9F9F9",variable:"var(--Tight-colors-white200)"},"colors.white300":{value:"#EDEDED",variable:"var(--Tight-colors-white300)"},"colors.white600":{value:"#E7E8E9",variable:"var(--Tight-colors-white600)"},"colors.black100":{value:"#CED1D2",variable:"var(--Tight-colors-black100)"},"colors.black400":{value:"#6F7576",variable:"var(--Tight-colors-black400)"},"colors.black600":{value:"#50595C",variable:"var(--Tight-colors-black600)"},"colors.black700":{value:"#182428",variable:"var(--Tight-colors-black700)"},"colors.blue300":{value:"#DAF4FA",variable:"var(--Tight-colors-blue300)"},"colors.blue400":{value:"#CAECF3",variable:"var(--Tight-colors-blue400)"},"colors.blue500":{value:"#94D8E8",variable:"var(--Tight-colors-blue500)"},"colors.blue700":{value:"#2AB2D1",variable:"var(--Tight-colors-blue700)"},"colors.blue900":{value:"#177F96",variable:"var(--Tight-colors-blue900)"},"colors.green300":{value:"#B8F3D5",variable:"var(--Tight-colors-green300)"},"colors.green400":{value:"#94E8BD",variable:"var(--Tight-colors-green400)"},"colors.green500":{value:"#5FDD9C",variable:"var(--Tight-colors-green500)"},"colors.green700":{value:"#009C75",variable:"var(--Tight-colors-green700)"},"colors.yellow300":{value:"#FFE787",variable:"var(--Tight-colors-yellow300)"},"colors.yellow400":{value:"#FCD34D",variable:"var(--Tight-colors-yellow400)"},"colors.yellow500":{value:"#FBBF24",variable:"var(--Tight-colors-yellow500)"},"colors.red300":{value:"#FF9797",variable:"var(--Tight-colors-red300)"},"colors.red400":{value:"#F45C5C",variable:"var(--Tight-colors-red400)"},"colors.red500":{value:"#E84747",variable:"var(--Tight-colors-red500)"},"colors.red700":{value:"#E42525",variable:"var(--Tight-colors-red700)"},"fonts.base":{value:"Duplet Regular, sans-serif",variable:"var(--Tight-fonts-base)"},"fontSizes.sm":{value:"11px",variable:"var(--Tight-fontSizes-sm)"},"fontSizes.md":{value:"14px",variable:"var(--Tight-fontSizes-md)"},"fontSizes.lg":{value:"16px",variable:"var(--Tight-fontSizes-lg)"},"fontSizes.xl":{value:"20px",variable:"var(--Tight-fontSizes-xl)"},"fontSizes.2xl":{value:"36px",variable:"var(--Tight-fontSizes-2xl)"},"fontWeights.sm":{value:"400",variable:"var(--Tight-fontWeights-sm)"},"fontWeights.md":{value:"600",variable:"var(--Tight-fontWeights-md)"},"fontWeights.lg":{value:"900",variable:"var(--Tight-fontWeights-lg)"},"radii.zero":{value:"0",variable:"var(--Tight-radii-zero)"},"radii.sm":{value:"1px",variable:"var(--Tight-radii-sm)"},"radii.md":{value:"2px",variable:"var(--Tight-radii-md)"},"radii.lg":{value:"4px",variable:"var(--Tight-radii-lg)"},"borderWidths.sm":{value:"0.5px",variable:"var(--Tight-borderWidths-sm)"},"borderWidths.md":{value:"1px",variable:"var(--Tight-borderWidths-md)"},"borderWidths.lg":{value:"1px",variable:"var(--Tight-borderWidths-lg)"},"borderWidths.xl":{value:"2px",variable:"var(--Tight-borderWidths-xl)"},"animations.appear.instant":{value:"0.25s linear fade-in",variable:"var(--Tight-animations-appear-instant)"},"animations.appear.delay":{value:"0.25s linear both 1.5s fade-in",variable:"var(--Tight-animations-appear-delay)"},"animations.shimmer":{value:"2s ease-in-out infinite shimmer",variable:"var(--Tight-animations-shimmer)"},"animations.spin":{value:"1.5s ease-in-out 0.1s spin infinite",variable:"var(--Tight-animations-spin)"},"shadows.box-shadow":{value:"0px 10px 30px 0px rgba(24, 36, 40, 0.10)",variable:"var(--Tight-shadows-box-shadow)"},"breakpoints.sm":{value:"640px",variable:"var(--Tight-breakpoints-sm)"},"breakpoints.md":{value:"850px",variable:"var(--Tight-breakpoints-md)"},"breakpoints.lg":{value:"1024px",variable:"var(--Tight-breakpoints-lg)"},"breakpoints.xl":{value:"1280px",variable:"var(--Tight-breakpoints-xl)"},"breakpoints.1.5xl":{value:"1400px",variable:"var(--Tight-breakpoints-1.5xl)"},"breakpoints.2xl":{value:"1536px",variable:"var(--Tight-breakpoints-2xl)"},"sizes.breakpoint-sm":{value:"640px",variable:"var(--Tight-sizes-breakpoint-sm)"},"sizes.breakpoint-md":{value:"850px",variable:"var(--Tight-sizes-breakpoint-md)"},"sizes.breakpoint-lg":{value:"1024px",variable:"var(--Tight-sizes-breakpoint-lg)"},"sizes.breakpoint-xl":{value:"1280px",variable:"var(--Tight-sizes-breakpoint-xl)"},"sizes.breakpoint-1.5xl":{value:"1400px",variable:"var(--Tight-sizes-breakpoint-1.5xl)"},"sizes.breakpoint-2xl":{value:"1536px",variable:"var(--Tight-sizes-breakpoint-2xl)"},"colors.brand.primary.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-brand-primary-weak)"},"colors.brand.primary":{value:"var(--Tight-colors-black600)",variable:"var(--Tight-colors-brand-primary)"},"colors.brand.primary.strong":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-brand-primary-strong)"},"colors.brand.secondary.weak":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-brand-secondary-weak)"},"colors.brand.secondary":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-brand-secondary)"},"colors.brand.secondary.strong":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-brand-secondary-strong)"},"colors.brand.action.weak":{value:"var(--Tight-colors-blue300)",variable:"var(--Tight-colors-brand-action-weak)"},"colors.brand.action":{value:"var(--Tight-colors-blue400)",variable:"var(--Tight-colors-brand-action)"},"colors.brand.action.strong":{value:"var(--Tight-colors-blue500)",variable:"var(--Tight-colors-brand-action-strong)"},"colors.brand.action.stronger":{value:"var(--Tight-colors-blue700)",variable:"var(--Tight-colors-brand-action-stronger)"},"colors.brand.action.strongest":{value:"var(--Tight-colors-blue900)",variable:"var(--Tight-colors-brand-action-strongest)"},"colors.brand.success.weak":{value:"var(--Tight-colors-green300)",variable:"var(--Tight-colors-brand-success-weak)"},"colors.brand.success":{value:"var(--Tight-colors-green400)",variable:"var(--Tight-colors-brand-success)"},"colors.brand.success.strong":{value:"var(--Tight-colors-green500)",variable:"var(--Tight-colors-brand-success-strong)"},"colors.brand.warning.weak":{value:"var(--Tight-colors-yellow300)",variable:"var(--Tight-colors-brand-warning-weak)"},"colors.brand.warning":{value:"var(--Tight-colors-yellow400)",variable:"var(--Tight-colors-brand-warning)"},"colors.brand.warning.strong":{value:"var(--Tight-colors-yellow500)",variable:"var(--Tight-colors-brand-warning-strong)"},"colors.brand.danger.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-brand-danger-weak)"},"colors.brand.danger":{value:"var(--Tight-colors-red400)",variable:"var(--Tight-colors-brand-danger)"},"colors.brand.danger.strong":{value:"var(--Tight-colors-red500)",variable:"var(--Tight-colors-brand-danger-strong)"},"colors.surface.background":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-background)"},"colors.surface.background.hover":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-background-hover)"},"colors.surface.foreground":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-surface-foreground)"},"colors.surface.foreground.hover":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-foreground-hover)"},"colors.surface.foreground.disabled":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-foreground-disabled)"},"colors.surface.elevated":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-elevated)"},"colors.surface.elevated.hover":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-elevated-hover)"},"colors.surface.intent.primary":{value:"var(--Tight-colors-brand-primary-weak)",variable:"var(--Tight-colors-surface-intent-primary)"},"colors.surface.intent.primary.hover":{value:"var(--Tight-colors-brand-primary)",variable:"var(--Tight-colors-surface-intent-primary-hover)"},"colors.surface.intent.primary.active":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-surface-intent-primary-active)"},"colors.surface.intent.primary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-primary-disabled)"},"colors.surface.intent.secondary":{value:"var(--Tight-colors-brand-secondary-weak)",variable:"var(--Tight-colors-surface-intent-secondary)"},"colors.surface.intent.secondary.hover":{value:"var(--Tight-colors-brand-secondary)",variable:"var(--Tight-colors-surface-intent-secondary-hover)"},"colors.surface.intent.secondary.active":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-surface-intent-secondary-active)"},"colors.surface.intent.secondary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-secondary-disabled)"},"colors.surface.intent.action":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action)"},"colors.surface.intent.action.hover":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-hover)"},"colors.surface.intent.action.active":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-surface-intent-action-active)"},"colors.surface.intent.action.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-action-disabled)"},"colors.surface.intent.action.discrete":{value:"transparent",variable:"var(--Tight-colors-surface-intent-action-discrete)"},"colors.surface.intent.action.discrete.hover":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action-discrete-hover)"},"colors.surface.intent.action.discrete.active":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-discrete-active)"},"colors.surface.intent.success":{value:"var(--Tight-colors-brand-success-weak)",variable:"var(--Tight-colors-surface-intent-success)"},"colors.surface.intent.success.hover":{value:"var(--Tight-colors-brand-success)",variable:"var(--Tight-colors-surface-intent-success-hover)"},"colors.surface.intent.success.active":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-surface-intent-success-active)"},"colors.surface.intent.success.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-success-disabled)"},"colors.surface.intent.warning":{value:"var(--Tight-colors-brand-warning-weak)",variable:"var(--Tight-colors-surface-intent-warning)"},"colors.surface.intent.warning.hover":{value:"var(--Tight-colors-brand-warning)",variable:"var(--Tight-colors-surface-intent-warning-hover)"},"colors.surface.intent.warning.active":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-surface-intent-warning-active)"},"colors.surface.intent.warning.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-warning-disabled)"},"colors.surface.intent.danger":{value:"var(--Tight-colors-brand-danger-weak)",variable:"var(--Tight-colors-surface-intent-danger)"},"colors.surface.intent.danger.hover":{value:"var(--Tight-colors-brand-danger)",variable:"var(--Tight-colors-surface-intent-danger-hover)"},"colors.surface.intent.danger.active":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-surface-intent-danger-active)"},"colors.surface.intent.danger.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-danger-disabled)"},"colors.typography.base":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-typography-base)"},"colors.typography.base.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-typography-base-weak)"},"colors.typography.contrast":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-contrast)"},"colors.typography.contrast.weak":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-typography-contrast-weak)"},"colors.typography.intent.primary":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary)"},"colors.typography.intent.primary.hover":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-hover)"},"colors.typography.intent.primary.active":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-active)"},"colors.typography.intent.secondary":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary)"},"colors.typography.intent.secondary.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-hover)"},"colors.typography.intent.secondary.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-active)"},"colors.typography.intent.action":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action)"},"colors.typography.intent.action.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action-hover)"},"colors.typography.intent.action.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action-active)"},"colors.typography.intent.success":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success)"},"colors.typography.intent.success.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success-hover)"},"colors.typography.intent.success.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success-active)"},"colors.typography.intent.warning":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning)"},"colors.typography.intent.warning.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning-hover)"},"colors.typography.intent.warning.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning-active)"},"colors.typography.intent.danger":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger)"},"colors.typography.intent.danger.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger-hover)"},"colors.typography.intent.danger.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger-active)"},"colors.typography.accent.success":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-typography-accent-success)"},"colors.typography.accent.warning":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-typography-accent-warning)"},"colors.typography.accent.danger":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-typography-accent-danger)"},"colors.typography.accent.action":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-typography-accent-action)"},"colors.typography.body":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-body)"},"colors.typography.label":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label)"},"colors.typography.label.sub":{value:"var(--Tight-colors-typography-base-weak)",variable:"var(--Tight-colors-typography-label-sub)"},"colors.typography.label.strong":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-strong)"},"colors.typography.label.strongSub":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-strongSub)"},"colors.typography.label.emphasisSub":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-emphasisSub)"},"colors.typography.heading":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-heading)"},"colors.typography.metric.sm":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-sm)"},"colors.typography.metric.md":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-md)"},"colors.typography.metric.lg":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-lg)"},"colors.typography.metric.xl":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-xl)"},"colors.icon.base":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-icon-base)"},"colors.icon.base.weak":{value:"var(--Tight-colors-typography-base-weak)",variable:"var(--Tight-colors-icon-base-weak)"},"colors.icon.contrast":{value:"var(--Tight-colors-typography-contrast)",variable:"var(--Tight-colors-icon-contrast)"},"colors.icon.contrast.weak":{value:"var(--Tight-colors-typography-contrast-weak)",variable:"var(--Tight-colors-icon-contrast-weak)"},"colors.icon.intent.primary":{value:"var(--Tight-colors-typography-intent-primary)",variable:"var(--Tight-colors-icon-intent-primary)"},"colors.icon.intent.primary.hover":{value:"var(--Tight-colors-typography-intent-primary-hover)",variable:"var(--Tight-colors-icon-intent-primary-hover)"},"colors.icon.intent.primary.active":{value:"var(--Tight-colors-typography-intent-primary-active)",variable:"var(--Tight-colors-icon-intent-primary-active)"},"colors.icon.intent.secondary":{value:"var(--Tight-colors-typography-intent-secondary)",variable:"var(--Tight-colors-icon-intent-secondary)"},"colors.icon.intent.secondary.hover":{value:"var(--Tight-colors-typography-intent-secondary-hover)",variable:"var(--Tight-colors-icon-intent-secondary-hover)"},"colors.icon.intent.secondary.active":{value:"var(--Tight-colors-typography-intent-secondary-active)",variable:"var(--Tight-colors-icon-intent-secondary-active)"},"colors.icon.intent.action":{value:"var(--Tight-colors-typography-intent-action)",variable:"var(--Tight-colors-icon-intent-action)"},"colors.icon.intent.action.hover":{value:"var(--Tight-colors-typography-intent-action-hover)",variable:"var(--Tight-colors-icon-intent-action-hover)"},"colors.icon.intent.action.active":{value:"var(--Tight-colors-typography-intent-action-active)",variable:"var(--Tight-colors-icon-intent-action-active)"},"colors.icon.intent.success":{value:"var(--Tight-colors-typography-intent-success)",variable:"var(--Tight-colors-icon-intent-success)"},"colors.icon.intent.success.hover":{value:"var(--Tight-colors-typography-intent-success-hover)",variable:"var(--Tight-colors-icon-intent-success-hover)"},"colors.icon.intent.success.active":{value:"var(--Tight-colors-typography-intent-success-active)",variable:"var(--Tight-colors-icon-intent-success-active)"},"colors.icon.intent.warning":{value:"var(--Tight-colors-typography-intent-warning)",variable:"var(--Tight-colors-icon-intent-warning)"},"colors.icon.intent.warning.hover":{value:"var(--Tight-colors-typography-intent-warning-hover)",variable:"var(--Tight-colors-icon-intent-warning-hover)"},"colors.icon.intent.warning.active":{value:"var(--Tight-colors-typography-intent-warning-active)",variable:"var(--Tight-colors-icon-intent-warning-active)"},"colors.icon.intent.danger":{value:"var(--Tight-colors-typography-intent-danger)",variable:"var(--Tight-colors-icon-intent-danger)"},"colors.icon.intent.danger.hover":{value:"var(--Tight-colors-typography-intent-danger-hover)",variable:"var(--Tight-colors-icon-intent-danger-hover)"},"colors.icon.intent.danger.active":{value:"var(--Tight-colors-typography-intent-danger-active)",variable:"var(--Tight-colors-icon-intent-danger-active)"},"colors.icon.accent.success":{value:"var(--Tight-colors-typography-accent-success)",variable:"var(--Tight-colors-icon-accent-success)"},"colors.icon.accent.warning":{value:"var(--Tight-colors-typography-accent-warning)",variable:"var(--Tight-colors-icon-accent-warning)"},"colors.icon.accent.danger":{value:"var(--Tight-colors-typography-accent-danger)",variable:"var(--Tight-colors-icon-accent-danger)"},"colors.border.layout.weak":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-border-layout-weak)"},"colors.border.layout":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-border-layout)"},"colors.border.layout.strong":{value:"var(--Tight-colors-black600)",variable:"var(--Tight-colors-border-layout-strong)"},"colors.border.intent.primary.hover":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary-hover)"},"colors.border.intent.primary":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary)"},"colors.border.intent.primary.active":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary-active)"},"colors.border.intent.primary.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-primary-disabled)"},"colors.border.intent.secondary.hover":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary-hover)"},"colors.border.intent.secondary":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary)"},"colors.border.intent.secondary.active":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary-active)"},"colors.border.intent.secondary.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-secondary-disabled)"},"colors.border.intent.danger.hover":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger-hover)"},"colors.border.intent.danger":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger)"},"colors.border.intent.danger.active":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger-active)"},"colors.border.intent.danger.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-danger-disabled)"},"colors.border.intent.warning.hover":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning-hover)"},"colors.border.intent.warning":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning)"},"colors.border.intent.warning.active":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning-active)"},"colors.border.intent.warning.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-warning-disabled)"},"colors.border.intent.success.hover":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success-hover)"},"colors.border.intent.success":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success)"},"colors.border.intent.success.active":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success-active)"},"colors.border.intent.success.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-success-disabled)"},"colors.border.intent.action.hover":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action-hover)"},"colors.border.intent.action":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action)"},"colors.border.intent.action.active":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action-active)"},"colors.border.intent.action.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-action-disabled)"},"colors.money":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-money)"},"colors.money.positive":{value:"var(--Tight-colors-green700)",variable:"var(--Tight-colors-money-positive)"},"colors.money.positive.weak":{value:"var(--Tight-colors-green500)",variable:"var(--Tight-colors-money-positive-weak)"},"colors.money.negative":{value:"var(--Tight-colors-red700)",variable:"var(--Tight-colors-money-negative)"},"colors.money.negative.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-money-negative-weak)"},"colors.overlay":{value:"rgba(0, 0, 0, 0.5)",variable:"var(--Tight-colors-overlay)"},"colors.transparent":{value:"transparent",variable:"var(--Tight-colors-transparent)"},"colors.none":{value:"none",variable:"var(--Tight-colors-none)"},"colors.inherit":{value:"inherit",variable:"var(--Tight-colors-inherit)"},"colors.currentColor":{value:"currentColor",variable:"var(--Tight-colors-currentColor)"},"fonts.body":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-body)"},"fonts.label":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-label)"},"fonts.heading":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-heading)"},"fonts.metric":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-metric)"},"fontWeights.global":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-global)"},"fontWeights.body":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-body)"},"fontWeights.label":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label)"},"fontWeights.label.strong":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strong)"},"fontWeights.label.sub":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label-sub)"},"fontWeights.label.strongSub":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strongSub)"},"fontWeights.label.emphasisSub":{value:"var(--Tight-fontWeights-lg)",variable:"var(--Tight-fontWeights-label-emphasisSub)"},"fontWeights.heading":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-heading)"},"fontWeights.title":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-title)"},"fontWeights.metric.sm":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-sm)"},"fontWeights.metric.md":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-md)"},"fontWeights.metric.lg":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-lg)"},"fontWeights.metric.xl":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-xl)"},"fontSizes.title":{value:"var(--Tight-fontSizes-2xl)",variable:"var(--Tight-fontSizes-title)"},"fontSizes.body":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-body)"},"fontSizes.label":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-label)"},"fontSizes.label.strong":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-label-strong)"},"fontSizes.label.sub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-sub)"},"fontSizes.label.strongSub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-strongSub)"},"fontSizes.label.emphasisSub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-emphasisSub)"},"fontSizes.heading":{value:"var(--Tight-fontSizes-xl)",variable:"var(--Tight-fontSizes-heading)"},"fontSizes.metric.sm":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-metric-sm)"},"fontSizes.metric.md":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-metric-md)"},"fontSizes.metric.lg":{value:"var(--Tight-fontSizes-xl)",variable:"var(--Tight-fontSizes-metric-lg)"},"fontSizes.metric.xl":{value:"var(--Tight-fontSizes-2xl)",variable:"var(--Tight-fontSizes-metric-xl)"},"colors.colorPalette":{value:"var(--Tight-colors-colorPalette)",variable:"var(--Tight-colors-colorPalette)"},"colors.colorPalette.primary.weak":{value:"var(--Tight-colors-colorPalette-primary-weak)",variable:"var(--Tight-colors-colorPalette-primary-weak)"},"colors.colorPalette.weak":{value:"var(--Tight-colors-colorPalette-weak)",variable:"var(--Tight-colors-colorPalette-weak)"},"colors.colorPalette.primary":{value:"var(--Tight-colors-colorPalette-primary)",variable:"var(--Tight-colors-colorPalette-primary)"},"colors.colorPalette.primary.strong":{value:"var(--Tight-colors-colorPalette-primary-strong)",variable:"var(--Tight-colors-colorPalette-primary-strong)"},"colors.colorPalette.strong":{value:"var(--Tight-colors-colorPalette-strong)",variable:"var(--Tight-colors-colorPalette-strong)"},"colors.colorPalette.secondary.weak":{value:"var(--Tight-colors-colorPalette-secondary-weak)",variable:"var(--Tight-colors-colorPalette-secondary-weak)"},"colors.colorPalette.secondary":{value:"var(--Tight-colors-colorPalette-secondary)",variable:"var(--Tight-colors-colorPalette-secondary)"},"colors.colorPalette.secondary.strong":{value:"var(--Tight-colors-colorPalette-secondary-strong)",variable:"var(--Tight-colors-colorPalette-secondary-strong)"},"colors.colorPalette.action.weak":{value:"var(--Tight-colors-colorPalette-action-weak)",variable:"var(--Tight-colors-colorPalette-action-weak)"},"colors.colorPalette.action":{value:"var(--Tight-colors-colorPalette-action)",variable:"var(--Tight-colors-colorPalette-action)"},"colors.colorPalette.action.strong":{value:"var(--Tight-colors-colorPalette-action-strong)",variable:"var(--Tight-colors-colorPalette-action-strong)"},"colors.colorPalette.action.stronger":{value:"var(--Tight-colors-colorPalette-action-stronger)",variable:"var(--Tight-colors-colorPalette-action-stronger)"},"colors.colorPalette.stronger":{value:"var(--Tight-colors-colorPalette-stronger)",variable:"var(--Tight-colors-colorPalette-stronger)"},"colors.colorPalette.action.strongest":{value:"var(--Tight-colors-colorPalette-action-strongest)",variable:"var(--Tight-colors-colorPalette-action-strongest)"},"colors.colorPalette.strongest":{value:"var(--Tight-colors-colorPalette-strongest)",variable:"var(--Tight-colors-colorPalette-strongest)"},"colors.colorPalette.success.weak":{value:"var(--Tight-colors-colorPalette-success-weak)",variable:"var(--Tight-colors-colorPalette-success-weak)"},"colors.colorPalette.success":{value:"var(--Tight-colors-colorPalette-success)",variable:"var(--Tight-colors-colorPalette-success)"},"colors.colorPalette.success.strong":{value:"var(--Tight-colors-colorPalette-success-strong)",variable:"var(--Tight-colors-colorPalette-success-strong)"},"colors.colorPalette.warning.weak":{value:"var(--Tight-colors-colorPalette-warning-weak)",variable:"var(--Tight-colors-colorPalette-warning-weak)"},"colors.colorPalette.warning":{value:"var(--Tight-colors-colorPalette-warning)",variable:"var(--Tight-colors-colorPalette-warning)"},"colors.colorPalette.warning.strong":{value:"var(--Tight-colors-colorPalette-warning-strong)",variable:"var(--Tight-colors-colorPalette-warning-strong)"},"colors.colorPalette.danger.weak":{value:"var(--Tight-colors-colorPalette-danger-weak)",variable:"var(--Tight-colors-colorPalette-danger-weak)"},"colors.colorPalette.danger":{value:"var(--Tight-colors-colorPalette-danger)",variable:"var(--Tight-colors-colorPalette-danger)"},"colors.colorPalette.danger.strong":{value:"var(--Tight-colors-colorPalette-danger-strong)",variable:"var(--Tight-colors-colorPalette-danger-strong)"},"colors.colorPalette.background":{value:"var(--Tight-colors-colorPalette-background)",variable:"var(--Tight-colors-colorPalette-background)"},"colors.colorPalette.background.hover":{value:"var(--Tight-colors-colorPalette-background-hover)",variable:"var(--Tight-colors-colorPalette-background-hover)"},"colors.colorPalette.hover":{value:"var(--Tight-colors-colorPalette-hover)",variable:"var(--Tight-colors-colorPalette-hover)"},"colors.colorPalette.foreground":{value:"var(--Tight-colors-colorPalette-foreground)",variable:"var(--Tight-colors-colorPalette-foreground)"},"colors.colorPalette.foreground.hover":{value:"var(--Tight-colors-colorPalette-foreground-hover)",variable:"var(--Tight-colors-colorPalette-foreground-hover)"},"colors.colorPalette.foreground.disabled":{value:"var(--Tight-colors-colorPalette-foreground-disabled)",variable:"var(--Tight-colors-colorPalette-foreground-disabled)"},"colors.colorPalette.disabled":{value:"var(--Tight-colors-colorPalette-disabled)",variable:"var(--Tight-colors-colorPalette-disabled)"},"colors.colorPalette.elevated":{value:"var(--Tight-colors-colorPalette-elevated)",variable:"var(--Tight-colors-colorPalette-elevated)"},"colors.colorPalette.elevated.hover":{value:"var(--Tight-colors-colorPalette-elevated-hover)",variable:"var(--Tight-colors-colorPalette-elevated-hover)"},"colors.colorPalette.intent.primary":{value:"var(--Tight-colors-colorPalette-intent-primary)",variable:"var(--Tight-colors-colorPalette-intent-primary)"},"colors.colorPalette.intent.primary.hover":{value:"var(--Tight-colors-colorPalette-intent-primary-hover)",variable:"var(--Tight-colors-colorPalette-intent-primary-hover)"},"colors.colorPalette.primary.hover":{value:"var(--Tight-colors-colorPalette-primary-hover)",variable:"var(--Tight-colors-colorPalette-primary-hover)"},"colors.colorPalette.intent.primary.active":{value:"var(--Tight-colors-colorPalette-intent-primary-active)",variable:"var(--Tight-colors-colorPalette-intent-primary-active)"},"colors.colorPalette.primary.active":{value:"var(--Tight-colors-colorPalette-primary-active)",variable:"var(--Tight-colors-colorPalette-primary-active)"},"colors.colorPalette.active":{value:"var(--Tight-colors-colorPalette-active)",variable:"var(--Tight-colors-colorPalette-active)"},"colors.colorPalette.intent.primary.disabled":{value:"var(--Tight-colors-colorPalette-intent-primary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-primary-disabled)"},"colors.colorPalette.primary.disabled":{value:"var(--Tight-colors-colorPalette-primary-disabled)",variable:"var(--Tight-colors-colorPalette-primary-disabled)"},"colors.colorPalette.intent.secondary":{value:"var(--Tight-colors-colorPalette-intent-secondary)",variable:"var(--Tight-colors-colorPalette-intent-secondary)"},"colors.colorPalette.intent.secondary.hover":{value:"var(--Tight-colors-colorPalette-intent-secondary-hover)",variable:"var(--Tight-colors-colorPalette-intent-secondary-hover)"},"colors.colorPalette.secondary.hover":{value:"var(--Tight-colors-colorPalette-secondary-hover)",variable:"var(--Tight-colors-colorPalette-secondary-hover)"},"colors.colorPalette.intent.secondary.active":{value:"var(--Tight-colors-colorPalette-intent-secondary-active)",variable:"var(--Tight-colors-colorPalette-intent-secondary-active)"},"colors.colorPalette.secondary.active":{value:"var(--Tight-colors-colorPalette-secondary-active)",variable:"var(--Tight-colors-colorPalette-secondary-active)"},"colors.colorPalette.intent.secondary.disabled":{value:"var(--Tight-colors-colorPalette-intent-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-secondary-disabled)"},"colors.colorPalette.secondary.disabled":{value:"var(--Tight-colors-colorPalette-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-secondary-disabled)"},"colors.colorPalette.intent.action":{value:"var(--Tight-colors-colorPalette-intent-action)",variable:"var(--Tight-colors-colorPalette-intent-action)"},"colors.colorPalette.intent.action.hover":{value:"var(--Tight-colors-colorPalette-intent-action-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-hover)"},"colors.colorPalette.action.hover":{value:"var(--Tight-colors-colorPalette-action-hover)",variable:"var(--Tight-colors-colorPalette-action-hover)"},"colors.colorPalette.intent.action.active":{value:"var(--Tight-colors-colorPalette-intent-action-active)",variable:"var(--Tight-colors-colorPalette-intent-action-active)"},"colors.colorPalette.action.active":{value:"var(--Tight-colors-colorPalette-action-active)",variable:"var(--Tight-colors-colorPalette-action-active)"},"colors.colorPalette.intent.action.disabled":{value:"var(--Tight-colors-colorPalette-intent-action-disabled)",variable:"var(--Tight-colors-colorPalette-intent-action-disabled)"},"colors.colorPalette.action.disabled":{value:"var(--Tight-colors-colorPalette-action-disabled)",variable:"var(--Tight-colors-colorPalette-action-disabled)"},"colors.colorPalette.intent.action.discrete":{value:"var(--Tight-colors-colorPalette-intent-action-discrete)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete)"},"colors.colorPalette.action.discrete":{value:"var(--Tight-colors-colorPalette-action-discrete)",variable:"var(--Tight-colors-colorPalette-action-discrete)"},"colors.colorPalette.discrete":{value:"var(--Tight-colors-colorPalette-discrete)",variable:"var(--Tight-colors-colorPalette-discrete)"},"colors.colorPalette.intent.action.discrete.hover":{value:"var(--Tight-colors-colorPalette-intent-action-discrete-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete-hover)"},"colors.colorPalette.action.discrete.hover":{value:"var(--Tight-colors-colorPalette-action-discrete-hover)",variable:"var(--Tight-colors-colorPalette-action-discrete-hover)"},"colors.colorPalette.discrete.hover":{value:"var(--Tight-colors-colorPalette-discrete-hover)",variable:"var(--Tight-colors-colorPalette-discrete-hover)"},"colors.colorPalette.intent.action.discrete.active":{value:"var(--Tight-colors-colorPalette-intent-action-discrete-active)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete-active)"},"colors.colorPalette.action.discrete.active":{value:"var(--Tight-colors-colorPalette-action-discrete-active)",variable:"var(--Tight-colors-colorPalette-action-discrete-active)"},"colors.colorPalette.discrete.active":{value:"var(--Tight-colors-colorPalette-discrete-active)",variable:"var(--Tight-colors-colorPalette-discrete-active)"},"colors.colorPalette.intent.success":{value:"var(--Tight-colors-colorPalette-intent-success)",variable:"var(--Tight-colors-colorPalette-intent-success)"},"colors.colorPalette.intent.success.hover":{value:"var(--Tight-colors-colorPalette-intent-success-hover)",variable:"var(--Tight-colors-colorPalette-intent-success-hover)"},"colors.colorPalette.success.hover":{value:"var(--Tight-colors-colorPalette-success-hover)",variable:"var(--Tight-colors-colorPalette-success-hover)"},"colors.colorPalette.intent.success.active":{value:"var(--Tight-colors-colorPalette-intent-success-active)",variable:"var(--Tight-colors-colorPalette-intent-success-active)"},"colors.colorPalette.success.active":{value:"var(--Tight-colors-colorPalette-success-active)",variable:"var(--Tight-colors-colorPalette-success-active)"},"colors.colorPalette.intent.success.disabled":{value:"var(--Tight-colors-colorPalette-intent-success-disabled)",variable:"var(--Tight-colors-colorPalette-intent-success-disabled)"},"colors.colorPalette.success.disabled":{value:"var(--Tight-colors-colorPalette-success-disabled)",variable:"var(--Tight-colors-colorPalette-success-disabled)"},"colors.colorPalette.intent.warning":{value:"var(--Tight-colors-colorPalette-intent-warning)",variable:"var(--Tight-colors-colorPalette-intent-warning)"},"colors.colorPalette.intent.warning.hover":{value:"var(--Tight-colors-colorPalette-intent-warning-hover)",variable:"var(--Tight-colors-colorPalette-intent-warning-hover)"},"colors.colorPalette.warning.hover":{value:"var(--Tight-colors-colorPalette-warning-hover)",variable:"var(--Tight-colors-colorPalette-warning-hover)"},"colors.colorPalette.intent.warning.active":{value:"var(--Tight-colors-colorPalette-intent-warning-active)",variable:"var(--Tight-colors-colorPalette-intent-warning-active)"},"colors.colorPalette.warning.active":{value:"var(--Tight-colors-colorPalette-warning-active)",variable:"var(--Tight-colors-colorPalette-warning-active)"},"colors.colorPalette.intent.warning.disabled":{value:"var(--Tight-colors-colorPalette-intent-warning-disabled)",variable:"var(--Tight-colors-colorPalette-intent-warning-disabled)"},"colors.colorPalette.warning.disabled":{value:"var(--Tight-colors-colorPalette-warning-disabled)",variable:"var(--Tight-colors-colorPalette-warning-disabled)"},"colors.colorPalette.intent.danger":{value:"var(--Tight-colors-colorPalette-intent-danger)",variable:"var(--Tight-colors-colorPalette-intent-danger)"},"colors.colorPalette.intent.danger.hover":{value:"var(--Tight-colors-colorPalette-intent-danger-hover)",variable:"var(--Tight-colors-colorPalette-intent-danger-hover)"},"colors.colorPalette.danger.hover":{value:"var(--Tight-colors-colorPalette-danger-hover)",variable:"var(--Tight-colors-colorPalette-danger-hover)"},"colors.colorPalette.intent.danger.active":{value:"var(--Tight-colors-colorPalette-intent-danger-active)",variable:"var(--Tight-colors-colorPalette-intent-danger-active)"},"colors.colorPalette.danger.active":{value:"var(--Tight-colors-colorPalette-danger-active)",variable:"var(--Tight-colors-colorPalette-danger-active)"},"colors.colorPalette.intent.danger.disabled":{value:"var(--Tight-colors-colorPalette-intent-danger-disabled)",variable:"var(--Tight-colors-colorPalette-intent-danger-disabled)"},"colors.colorPalette.danger.disabled":{value:"var(--Tight-colors-colorPalette-danger-disabled)",variable:"var(--Tight-colors-colorPalette-danger-disabled)"},"colors.colorPalette.base":{value:"var(--Tight-colors-colorPalette-base)",variable:"var(--Tight-colors-colorPalette-base)"},"colors.colorPalette.base.weak":{value:"var(--Tight-colors-colorPalette-base-weak)",variable:"var(--Tight-colors-colorPalette-base-weak)"},"colors.colorPalette.contrast":{value:"var(--Tight-colors-colorPalette-contrast)",variable:"var(--Tight-colors-colorPalette-contrast)"},"colors.colorPalette.contrast.weak":{value:"var(--Tight-colors-colorPalette-contrast-weak)",variable:"var(--Tight-colors-colorPalette-contrast-weak)"},"colors.colorPalette.accent.success":{value:"var(--Tight-colors-colorPalette-accent-success)",variable:"var(--Tight-colors-colorPalette-accent-success)"},"colors.colorPalette.accent.warning":{value:"var(--Tight-colors-colorPalette-accent-warning)",variable:"var(--Tight-colors-colorPalette-accent-warning)"},"colors.colorPalette.accent.danger":{value:"var(--Tight-colors-colorPalette-accent-danger)",variable:"var(--Tight-colors-colorPalette-accent-danger)"},"colors.colorPalette.accent.action":{value:"var(--Tight-colors-colorPalette-accent-action)",variable:"var(--Tight-colors-colorPalette-accent-action)"},"colors.colorPalette.body":{value:"var(--Tight-colors-colorPalette-body)",variable:"var(--Tight-colors-colorPalette-body)"},"colors.colorPalette.label":{value:"var(--Tight-colors-colorPalette-label)",variable:"var(--Tight-colors-colorPalette-label)"},"colors.colorPalette.label.sub":{value:"var(--Tight-colors-colorPalette-label-sub)",variable:"var(--Tight-colors-colorPalette-label-sub)"},"colors.colorPalette.sub":{value:"var(--Tight-colors-colorPalette-sub)",variable:"var(--Tight-colors-colorPalette-sub)"},"colors.colorPalette.label.strong":{value:"var(--Tight-colors-colorPalette-label-strong)",variable:"var(--Tight-colors-colorPalette-label-strong)"},"colors.colorPalette.label.strongSub":{value:"var(--Tight-colors-colorPalette-label-strongSub)",variable:"var(--Tight-colors-colorPalette-label-strongSub)"},"colors.colorPalette.strongSub":{value:"var(--Tight-colors-colorPalette-strongSub)",variable:"var(--Tight-colors-colorPalette-strongSub)"},"colors.colorPalette.label.emphasisSub":{value:"var(--Tight-colors-colorPalette-label-emphasisSub)",variable:"var(--Tight-colors-colorPalette-label-emphasisSub)"},"colors.colorPalette.emphasisSub":{value:"var(--Tight-colors-colorPalette-emphasisSub)",variable:"var(--Tight-colors-colorPalette-emphasisSub)"},"colors.colorPalette.heading":{value:"var(--Tight-colors-colorPalette-heading)",variable:"var(--Tight-colors-colorPalette-heading)"},"colors.colorPalette.metric.sm":{value:"var(--Tight-colors-colorPalette-metric-sm)",variable:"var(--Tight-colors-colorPalette-metric-sm)"},"colors.colorPalette.sm":{value:"var(--Tight-colors-colorPalette-sm)",variable:"var(--Tight-colors-colorPalette-sm)"},"colors.colorPalette.metric.md":{value:"var(--Tight-colors-colorPalette-metric-md)",variable:"var(--Tight-colors-colorPalette-metric-md)"},"colors.colorPalette.md":{value:"var(--Tight-colors-colorPalette-md)",variable:"var(--Tight-colors-colorPalette-md)"},"colors.colorPalette.metric.lg":{value:"var(--Tight-colors-colorPalette-metric-lg)",variable:"var(--Tight-colors-colorPalette-metric-lg)"},"colors.colorPalette.lg":{value:"var(--Tight-colors-colorPalette-lg)",variable:"var(--Tight-colors-colorPalette-lg)"},"colors.colorPalette.metric.xl":{value:"var(--Tight-colors-colorPalette-metric-xl)",variable:"var(--Tight-colors-colorPalette-metric-xl)"},"colors.colorPalette.xl":{value:"var(--Tight-colors-colorPalette-xl)",variable:"var(--Tight-colors-colorPalette-xl)"},"colors.colorPalette.layout.weak":{value:"var(--Tight-colors-colorPalette-layout-weak)",variable:"var(--Tight-colors-colorPalette-layout-weak)"},"colors.colorPalette.layout":{value:"var(--Tight-colors-colorPalette-layout)",variable:"var(--Tight-colors-colorPalette-layout)"},"colors.colorPalette.layout.strong":{value:"var(--Tight-colors-colorPalette-layout-strong)",variable:"var(--Tight-colors-colorPalette-layout-strong)"},"colors.colorPalette.positive":{value:"var(--Tight-colors-colorPalette-positive)",variable:"var(--Tight-colors-colorPalette-positive)"},"colors.colorPalette.positive.weak":{value:"var(--Tight-colors-colorPalette-positive-weak)",variable:"var(--Tight-colors-colorPalette-positive-weak)"},"colors.colorPalette.negative":{value:"var(--Tight-colors-colorPalette-negative)",variable:"var(--Tight-colors-colorPalette-negative)"},"colors.colorPalette.negative.weak":{value:"var(--Tight-colors-colorPalette-negative-weak)",variable:"var(--Tight-colors-colorPalette-negative-weak)"}};function io(e,t){return ao[e]?.value||t}io.var=function(e,t){return ao[e]?.variable||t};const lo=Rt(null,xt({borderRadius:"50%",flexShrink:0})),so=Rt(null,xt({display:"flex",flexDirection:"row",gap:"10px",alignItems:"center",minWidth:0})),co=io.var("colors.surface.foreground.disabled");function uo({color:e=co,diameter:t=17,label:r}){return E("div",{...so,"data-testid":"bullet-row",children:[w("div",{...lo,style:{backgroundColor:e,width:`${t}px`,height:`${t}px`},"data-testid":"bullet"}),r&&w(ro,{children:r})]})}const ho=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"30px"}));function po({payload:e}){return void 0===e?null:w("div",{...ho,children:e.map((e,t)=>"none"!==e.type&&w(uo,{color:e.color,label:e.value,diameter:17},t))})}const go={right:20,left:20},mo=["income","profit","expenses","loss"],vo=e=>mo.findIndex(t=>t===e.dataKey),bo={paddingBottom:"20px",marginLeft:"-20px"},fo={stackId:"stack",isAnimationActive:!1},yo=Rt(St["profit-loss-graph"],xt({"& .recharts-surface":{outline:"none"}})),To=io.var("colors.money"),xo=io.var("colors.border.layout"),ko=io.var("colors.border.layout.strong"),wo={fill:io.var("colors.typography.base"),fontSize:io.var("fontSizes.metric.sm")},Co={profit:io.var("colors.money.positive"),income:io.var("colors.money.positive.weak"),loss:io.var("colors.money.negative"),expenses:io.var("colors.money.negative.weak")},Eo=[0,100],Io=["auto","auto"];function So({data:e}){const[t,r]=m(!0);if(void 0===e)return null;const n=e.hasAnyData?Io:Eo;return w(R,{width:"100%",height:"100%",...yo,children:E(O,{data:e.months,stackOffset:"sign",accessibilityLayer:!0,barSize:35,margin:go,children:[w(_,{verticalAlign:"top",itemSorter:vo,wrapperStyle:bo,content:({payload:e})=>w(po,{payload:e})}),w(L,{strokeDasharray:"0",vertical:!1,stroke:xo}),w(F,{dataKey:"month",interval:0,tickLine:!1,stroke:xo,tick:wo}),w(B,{type:"number",tickCount:7,domain:n,axisLine:!1,tickLine:!1,stroke:xo,tick:wo,tickFormatter:e=>Gn(e)}),w(W,{content:({active:e,payload:t})=>w(oo,{active:e,payload:t}),isAnimationActive:!1,shared:!1}),w(H,{name:"Profit",dataKey:"profit",fill:Co.profit,...fo}),w(H,{name:"Income",dataKey:"income",fill:Co.income,...fo}),w(H,{name:"Loss",dataKey:"loss",fill:Co.loss,...fo}),w(H,{name:"Expenses",dataKey:"expenses",fill:Co.expenses,...fo}),w(H,{dataKey:En,fill:xo,legendType:"none",...fo}),w(U,{y:0,stroke:ko}),w(V,{dataKey:"netIncome",fill:To,stroke:To,strokeWidth:1,legendType:"none",activeDot:!1,isAnimationActive:t,onAnimationStart:()=>r(!0),onAnimationEnd:()=>r(!1)})]})})}const Ao=xt({backgroundColor:"surface.elevated",borderRadius:"sm",backgroundImage:"linear-gradient(90deg, {colors.surface.elevated} 30%, {colors.surface.foreground} 50%, {colors.surface.elevated} 70%)",backgroundSize:"400%",backgroundPosition:"100% 0",animation:"shimmer"});function No({styles:e}){const t=Rt(null,Ao,e);return w("div",{...t,"data-testid":"shimmer-block"})}const Po=xt({width:"40%",minHeight:65});function Mo({children:e}){return E(C,{children:[w(No,{styles:Po}),w(jn,{children:e})]})}const Do=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:16})),Ro=xt({width:"80px",height:"17px",marginBottom:"10px"}),Oo=xt({width:"100%",height:"100%"});function _o(){return E(C,{children:[E("div",{...Do,children:[w(No,{styles:Ro}),w(No,{styles:Ro}),w(No,{styles:Ro}),w(No,{styles:Ro})]}),w(No,{styles:Oo})]})}const Lo=Et({base:{color:"typography.base.weak",boxSizing:"border-box",position:"absolute",bottom:"0",left:"0",right:"0",top:"0",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",margin:"0 auto",transform:"rotate(-20deg)",opacity:"80%"},variants:{size:{sm:{fontSize:"4em"},lg:{fontSize:"7em"},xl:{fontSize:"10em"}}}});function Fo({size:e}){const t=Lo({size:e});return w("div",{className:t,children:"Sample"})}const Bo=20200,Wo=5043,Ho=Object.freeze({income:Bo,expenses:Wo,netIncome:15157,absoluteSum:Math.abs(Bo)+Math.abs(Wo)}),Uo=Object.freeze({total:Wo,children:[{name:"Plane/Train/Bus",total:2500},{name:"Business Meals",total:1800},{name:"Employee Entertainment",total:743}]}),Vo=Object.freeze({moneyIn:25300,moneyOut:8150,netMoneyIn:17150}),zo=[{income:1247,expenses:7434},{income:2103,expenses:8672},{income:1876,expenses:7656},{income:3291,expenses:6623},{income:5647,expenses:7034},{income:8923,expenses:6456},{income:11547,expenses:5892},{income:9834,expenses:6721},{income:15283,expenses:5347},{income:18467,expenses:4923},{income:17924,expenses:4534},{income:20200,expenses:5043}];function jo({filter:e=Kt.PAST_YEAR,isSample:t=!1}){const{query:{data:r},isFilling:n}=function({filter:e,grouping:t}){return Cn({filter:e,grouping:t,select:Sn})}({filter:e,grouping:"MONTHLY"}),o=t?function(){const e=[],t=/* @__PURE__ */new Date;let r=0,n=0,o=0;for(let a=11;a>=0;a--){const i=new Date(t.getFullYear(),t.getMonth()-a,1),l=ir(i,{abbreviateMonth:!0,abbreviateYear:!0}),s=zo[11-a],c=s.income-s.expenses,d=c>0?c:0,u=c<0?c:0,h=s.income-d,p=s.expenses+u;e.push({month:l,income:h,expenses:-p,profit:d,loss:u,netIncome:c,hasNoData:!1}),r+=c,n=Math.max(n,s.income),o=Math.max(o,s.expenses)}return{total:r,domain:[-o,n],months:e,hasAnyData:!0}}():r;return E(Rn,{type:"chart",children:[w(Nn,{title:"Profit + Loss"}),w(Mn,{children:n?w(Mo,{children:w(_o,{})}):E(C,{children:[w(Vn,{title:Gn(o?.total??0),label:"Profit"}),w(jn,{children:w(So,{data:o})})]})}),t&&w(Fo,{size:"xl"})]})}const Ko=Rt(null,xt({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",alignSelf:"stretch"}));function $o({children:e}){return w("div",{...Ko,children:e})}const qo="conversations-section",Yo="transactions-section",Go={MESSAGE_REVIEW:qo,TRANSACTION_REVIEW:Yo,RULE_REVIEW:"",CSV_IMPORT_REVIEW:""},Qo={reviewStatus:{in:["USER_REVIEW_REQUIRED"]},status:{in:["ACTIVE"]},category:{expand:!0},glAccount:{expand:!0},bankAccount:{expand:!0}},Xo={resolutionStatus:{in:["OPEN"]}},Zo=[],Jo=[];function ea(e){return bn(`${t=e,yn[t]}`,"v6");var t}const ta={LINK_BANK:"LINK_BANK",RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT",MESSAGE_REVIEW:"MESSAGE_REVIEW",TRANSACTION_REVIEW:"TRANSACTION_REVIEW",BANK_ERROR:"BANK_ERROR",RULE_REVIEW:"RULE_REVIEW",CSV_IMPORT_REVIEW:"CSV_IMPORT_REVIEW",ONBOARDING_FORM:"ONBOARDING_FORM"},ra=e=>["tasks",e??{}],na={URGENT:0,HIGH:1,MEDIUM:2,LOW:3},oa=async e=>{const t=e.queryKey,r=t[1],n={path:"/v6/tasks/query",accessToken:t[2].accessToken,bodyParams:{...r},endpointManager:ea(t[2].environment)},o=await mn(n);return"SUCCESS"===o.result&&void 0!==o.data?{data:o.data}:{data:void 0}},aa=Et({base:{stroke:"currentColor"},variants:{primary:{DEFAULT:{stroke:"icon.intent.primary"},hover:{stroke:"icon.intent.primary.hover"},active:{stroke:"icon.intent.primary.active"}},secondary:{DEFAULT:{stroke:"icon.intent.secondary"},hover:{stroke:"icon.intent.secondary.hover"},active:{stroke:"icon.intent.secondary.active"}},success:{DEFAULT:{stroke:"icon.intent.success"},hover:{stroke:"icon.intent.success.hover"},active:{stroke:"icon.intent.success.active"}},warning:{DEFAULT:{stroke:"icon.intent.warning"},hover:{stroke:"icon.intent.warning.hover"},active:{stroke:"icon.intent.warning.active"}},danger:{DEFAULT:{stroke:"icon.intent.danger"},hover:{stroke:"icon.intent.danger.hover"},active:{stroke:"icon.intent.danger.active"}},action:{DEFAULT:{stroke:"icon.intent.action"},hover:{stroke:"icon.intent.action.hover"},active:{stroke:"icon.intent.action.active"}}}});function ia(e,t){const r=({size:t=24,fill:r="transparent",stylists:n})=>{const o=Bt([Rt(null,aa()),...n]);return w(e,{...o,style:{minHeight:t,minWidth:t},width:t,height:t,fill:r})};return r.displayName=t,r}const la=ia(e=>c.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M8.31473 0.399963L2.71472 5.99997L8.31473 11.6",stroke:"#182428",strokeMiterlimit:10})),"ArrowLeft"),sa=ia(e=>c.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"#182428",strokeMiterlimit:10})),"ArrowRight"),ca=xt({transition:"background 300ms ease-out, background-color 300ms ease-out, border-color 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, background-color 100ms ease-out, border-color 100ms ease-out, box-shadow 0ms"}}),da=xt({transition:"background 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, box-shadow 0ms"}}),ua=xt({transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}});xt({"& > .Tight-text":{transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}}});const ha=xt({"& path":{transition:"stroke 300ms ease-out",_supportHover:{transition:"stroke 100ms ease-out"}}}),pa=h({hasNextPage:!1,hasPreviousPage:!1,getFirstPage:()=>{},getLastPage:()=>{},pageBackwards:()=>{},pageForwards:()=>{}});function ga({Component:e,stylists:t}){return w(e,{stylists:[Rt(St["small-icon"]),...t??[]],size:12})}const ma=Rt(null,xt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout",color:"typography.base",display:"inline-flex",alignItems:"center",justifyContent:"center",height:{sm:"35px",base:"50px"},gap:{sm:0,base:20}})),va=Rt(null,xt({border:"none",borderRadius:"sm",backgroundColor:"surface.intent.action.discrete",padding:{sm:"4px",base:"12px"},margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none",boxShadow:"0 0 0 0 transparent","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:disabled":{opacity:.6,pointerEvents:"none"},_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}}),da),ba=Rt(null,xt({display:"flex",gap:"9px",padding:"10px",justifyContent:"center",alignItems:"center"})),fa=Rt(null,xt({height:{sm:"12px",base:"20px"},width:{sm:"12px",base:"20px"}}));function ya(){const{hasNextPage:e,hasPreviousPage:t,pageForwards:r,pageBackwards:n}=function(){const e=p(pa);if(void 0===e)throw new Error("usePaginationContext must be used within a PaginationProvider");return e}();return E("div",{...ma,children:[w("div",{...ba,children:w("button",{...va,onClick:n,disabled:!t,children:w(ga,{Component:la,stylists:[fa]})})}),w("div",{...ba,children:w("button",{...va,onClick:r,disabled:!e,children:w(ga,{Component:sa,stylists:[fa]})})})]})}const Ta=xt({width:"100%",height:"50px"});function xa(){return w(No,{styles:Ta})}const ka=Rt(St["dashboard-placeholder-table"],xt({display:"flex",flexDirection:"column",gap:"4px"})),wa=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"52px",paddingLeft:"64px",paddingRight:"64px"})),Ca=xt({width:"100px",height:"20px"});function Ea({numColumns:e=6}){return E("div",{...ka,children:[w("div",{...wa,children:Array.from({length:e},(e,t)=>w(No,{styles:Ca},t))}),w(xa,{}),w(xa,{}),w(xa,{}),w(xa,{}),w(xa,{}),w(xa,{})]})}function Ia(e,t){const r=mr(),n=Tr();return v(o=>{const a=pr(r),i=a?{}:{retry:!1,staleTime:1/0};return fr.prefetchQuery({queryKey:sr(e(o),r??"",n),queryFn:a?t:vr,...i})},[e,t,r,n])}const Sa=Object.freeze({}),Aa=Object.freeze({cursor:"FINAL_PAGE"});function Na({queryKey:e,queryFn:t,...r}){const[n,o]=m(Sa),i=d(e);a(i.current,e)||(i.current=e,o(Sa));const l=xr({...r,queryKey:cr(e,n),queryFn:t,keepPreviousDataPlaceholder:!0}),s=u(()=>{return e=l.query.data?.cursor,t=o,{getFirstPage:()=>t(Sa),getLastPage:()=>t(Aa),hasNextPage:ur(e?.after),hasPreviousPage:ur(e?.before),pageForwards:()=>{e?.after&&t({cursor:e.after})},pageBackwards:()=>{e?.before&&t({cursor:e.before})}};var e,t},[l.query.data?.cursor]),c=Ia(v(t=>cr(e,t),[e]),t),h=Ia(v(t=>cr(e,t),[e]),t);return b(()=>{const e=l.query.data?.cursor;!l.query.isFetching&&e&&(e.after&&c({cursor:e.after}).catch(e=>{on({error:e,severity:"error"})}),e.before&&h({cursor:e.before}).catch(e=>{on({error:e,severity:"error"})}))},[l.query.data?.cursor,l.query.isFetching,c,h]),{...l,paginationControls:s}}async function Pa({authorization:e,extraHeaders:t,includeCredentials:r,params:n,url:o,cache:a}){const i=cn({extraHeaders:t,authorization:e}),l=(({url:e,params:t})=>{let r=e;const n=null==(o=t)?"":Object.entries(o).map(([e,t])=>{let r;return r=Array.isArray(t)?t.map(t=>sn(e,t)).join("&"):sn(e,t),r}).join("&");var o;return""!==n&&(r+=`?${n}`),r})({url:o,params:n});nn("HTTP GET Request",{url:o,accessToken:e});try{const e=await fetch(l,{method:"GET",headers:i,credentials:"include",cache:a});return nn("HTTP GET Response",{url:o,status:e.status,statusText:e.statusText}),dn(e)}catch(s){return Promise.reject(s)}}async function Ma(e){const{url:t,headers:r}=hn(e);return Pa({url:t,params:e.params,includeCredentials:!0,extraHeaders:r})}async function Da(e){return Ma({...e,endpointManager:ea(e.environment)})}async function Ra(e){return Ma({...e,endpointManager:xn(e.environment)})}function Oa({delay:e,callback:t}){const r=u(()=>function({delay:e,callback:t}){let r;const n=()=>{r&&(clearTimeout(r),r=void 0)};return{startCallback:o=>{n(),r=setTimeout(()=>{t(o)},e)},cancelCallback:()=>n()}}({delay:e,callback:t}),[e,t]);return b(()=>()=>{r.cancelCallback()},[r]),{startCallback:v(e=>{r.startCallback(e)},[r]),cancelCallback:v(()=>{r.cancelCallback()},[r])}}function _a({prefetchFn:e}){const{startCallback:t,cancelCallback:r}=Oa({delay:250,callback:e});return{startPrefetch:t,cancelPrefetch:r}}const La={CREATED_DATE_TIME:"CREATED_DATE_TIME",SUBJECT:"SUBJECT",EMAIL:"EMAIL",LAST_MESSAGE_CREATED_DATE_TIME:"LAST_MESSAGE_CREATED_DATE_TIME",LAST_MESSAGE_TEXT:"LAST_MESSAGE_TEXT"},Fa={ASC:"ASC",DESC:"DESC"},Ba=e=>["conversations",e??{}],Wa=e=>["conversations","conversation",e],Ha=async e=>{const t=e.queryKey,r={path:"/v6/conversations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ea(t[3].environment)},n=await mn(r);return"SUCCESS"===n.result&&void 0!==n.data?{data:n.data,cursor:n.cursor}:{data:void 0,cursor:void 0}};function Ua(e){return Na({queryKey:e?Ba(e):["conversations",{}],queryFn:Ha})}const Va=async e=>{const t=e.queryKey,{id:r}=t[2],n={path:"/v6/conversations/{id}",pathParams:{id:r},accessToken:t[3].accessToken,environment:t[3].environment},o=await Da(n);return"SUCCESS"===o.result&&void 0!==o.data?o.data:null};function za(e){const t=ur(e);return xr({queryKey:Wa({id:e??""}),queryFn:Va,enabled:t})}const ja=async({data:e,accessToken:t,environment:r})=>{const n={path:"/v6/conversations",bodyParams:e,accessToken:t,endpointManager:ea(r)};return await mn(n)};function Ka(){return _a({prefetchFn:Ia(Wa,Va)})}function $a(e){const t=e.getSize(),r=e.columnDef.maxSize;return{flex:`${t} 0 auto`,width:t,maxWidth:void 0!==r?`${r}px`:"auto"}}function qa({header:e}){const t=$a(e.column);return w("div",{...Rt(St["dashboard-table-column-header"]),style:t,children:e.isPlaceholder?null:z(e.column.columnDef.header,e.getContext())})}const Ya=Rt(St["dashboard-table-header"],xt({display:"flex",flexDirection:"row",alignItems:"center",paddingBlock:"10px"}));function Ga({headerGroups:e}){return w("div",{children:e.map(e=>f("div",{...Ya,key:e.id},e.headers.map(e=>w(qa,{header:e},e.id))))})}const Qa=Rt(St["dashboard-table-body"],xt({display:"flex",flexDirection:"column"}));function Xa({children:e}){return w("div",{...Qa,children:e})}const Za=Et({base:{},variants:{alignment:{vertical:{width:"{borderWidths.md}",minWidth:"{borderWidths.md}",height:"100%"},horizontal:{width:"100%",height:"{borderWidths.md}",minHeight:"{borderWidths.md}"}},color:{normal:{backgroundColor:"border.layout"},strong:{backgroundColor:"border.layout.strong"}}}});function Ja({alignment:e="vertical",color:t="normal",additionalClassName:r}){const n=Rt("vertical"===e?St["vertical-divider"]:St["horizontal-divider"],r,Za({alignment:e,color:t}));return w("div",{...n})}function ei(){return w(Ja,{additionalClassName:St["table-cell-divider"]})}function ti({cell:e,index:t,onCellClick:r,shouldDisplayDivider:n}){const o=$a(e.column),a=Rt(St["dashboard-table-cell"],xt({height:"100%",display:"flex",justifyContent:"center",flexDirection:"column"})),i=Rt(null,xt({display:"flex",flexDirection:"row",height:"100%"})),l=n(t);return E("div",{...i,style:o,onClick:()=>{r&&r(e)},children:[l&&w(ei,{}),w("div",{style:o,...a,children:z(e.column.columnDef.cell,e.getContext())})]})}const ri=Rt(St["table-sub-row"],xt({display:"flex",alignItems:"center",justifyContent:"flex-start",height:"60px",overflow:"hidden",minWidth:"fit-content",borderRadius:"zero"}));function ni({rowData:e,onCellClick:t,shouldDisplayDivider:r}){const n=e.getVisibleCells();return w("div",{...ri,children:n.map((e,n)=>w(ti,{cell:e,index:n,onCellClick:t,shouldDisplayDivider:r,isChild:!0},e.id))})}const oi=xt({display:"flex",flexDirection:"column",borderRadius:"zero",cursor:"pointer",minWidth:"fit-content"}),ai=xt({background:"surface.background"}),ii=Rt(St["table-row"],xt({display:"flex",alignItems:"center",justifyContent:"flex-start",height:{sm:"60px",base:"85px"},minWidth:"fit-content"}));function li({rowData:e,onMouseEnter:t,onMouseLeave:r,onCellClick:n,shouldDisplayDivider:o}){const a=e.getIsExpanded(),i=Rt(St["table-parent-row"],oi,e.index%2==0?ai:void 0),l=e.getVisibleCells();return E("div",{...i,onMouseEnter:t,onMouseLeave:r,children:[w("div",{...ii,children:l.map((e,t)=>w(ti,{cell:e,index:t,onCellClick:n,shouldDisplayDivider:o},e.id))}),a&&w("div",{children:e.subRows.map(e=>w(ni,{rowData:e,onCellClick:n,shouldDisplayDivider:o},e.id))})]})}const si=(e,t={})=>{Le.getState().openDrawer(e,t)},ci=()=>{Le.getState().closeDrawer()},di={DATE:"DATE",DESCRIPTION:"DESCRIPTION",AMOUNT:"AMOUNT",STATUS:"STATUS",REVIEW_STATUS:"REVIEW_STATUS"},ui={ASC:"ASC",DESC:"DESC"},hi=e=>["banks/transactions",e??{}],pi=e=>["banks/transactions",e.id],gi=async e=>{const t=e.queryKey,r={path:"/v6/banks/transactions/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ea(t[3].environment)},n=await mn(r);return"SUCCESS"===n.result&&void 0!==n.data?{data:n.data,cursor:n.cursor}:{data:void 0,cursor:void 0}};function mi(e){return Na({queryKey:hi(e),queryFn:gi})}const vi=async e=>{const t=e.queryKey,r={path:"/v6/banks/transactions/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},n=await Da(r);return"SUCCESS"===n.result&&void 0!==n.data?n.data:null};function bi({id:e}){return xr({queryKey:pi({id:e}),queryFn:vi})}function fi(){return _a({prefetchFn:Ia(pi,vi)})}const yi={COMPANY:"co",EMPLOYEE:"emp",CLASS_SEGMENT:"cls",CLASS_LABEL:"cll",CUSTOMER:"cus",BANK_ACCOUNT:"bka",GL_ACCOUNT:"gla",TRANSACTION_CATEGORY:"ctg",BANK_TRANSACTION:"btxn",PROCESSOR_TRANSACTION:"ptxn",TRANSACTION_LINE_ITEM:"tli",VENDOR:"vnd",TRANSACTION_RULE:"trl",INVOICE:"inv",INVOICE_LINE_ITEM:"ili",BILL:"bll",BILL_LINE_ITEM:"bli",PAYROLL:"prl",PAYROLL_LINE_ITEM:"pli",FINANCIAL_SUMMARY:"fsm",TASK:"tsk",CONVERSATION:"cnv",MESSAGE:"msg",REACTION:"rct",BUSINESS_TYPE:"bzt",TEMPLATE_CLASS_LABEL:"tcll",TEMPLATE_COA:"tcoa",TEMPLATE_GL_ACCOUNT:"tgla",TEMPLATE_TRANSACTION_RULES:"ttrl",MANUAL_JOURNAL_ENTRY:"mje",ASSET:"ast",ASSET_DEPRECIATION:"asd",EXPENSE_AMORTIZATION:"exa",REVENUE_RECOGNITION:"rvr",GL_TRANSACTION:"glt",ATTACHMENT:"att",CAR:"car",MILEAGE:"mlg",INTEGRATION:"int",TIME:"tme",TIME_TYPE:"tmt",TAX_RETURN:"txr"};function Ti(e,t){return!hr(e)&&e.startsWith(t)}function xi({id:e,prefix:t}){return void 0!==e?`${yi[t]}_${e}`:""}const ki=e=>["conversations/messages",e];function wi(e){if(dr(e)||0===e.length)return null;const t=[[e[0]]];for(let r=1;r<e.length;r++){const n=e[r],o=t[t.length-1],a=o[0].author.userId;n.author.userId===a?o.push(n):t.push([n])}return t}const Ci=async e=>{const t=e.queryKey,{id:r}=t[1],n={path:"/v6/conversations/{id}/messages",pathParams:{id:r},accessToken:t[2].accessToken,environment:t[2].environment},o=await Da(n);return"SUCCESS"===o.result&&void 0!==o.data?o.data:null},Ei=async({data:e,accessToken:t,environment:r})=>{const n={path:"/v6/messages",bodyParams:{data:[e]},endpointManager:ea(r),accessToken:t};return await mn(n)};function Ii(){return _a({prefetchFn:Ia(ki,Ci)})}const Si=e=>["summaries",e??{}],Ai=e=>["summaries",e.id],Ni=async e=>{const t=e.queryKey,r={path:"/v6/summaries/query",bodyParams:{...t[1]},accessToken:t[2].accessToken,endpointManager:ea(t[2].environment)},n=await mn(r);return"SUCCESS"===n.result&&void 0!==n.data?{data:n.data}:{data:void 0}};const Pi=async e=>{const t=e.queryKey,r={path:"/v6/summaries/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},n=await Da(r);return"SUCCESS"===n.result&&void 0!==n.data?n.data:null};function Mi({rowData:e,isMobile:t}){const{startPrefetch:r,cancelPrefetch:n}=Ka(),{startPrefetch:o,cancelPrefetch:a}=Ii(),{startPrefetch:i,cancelPrefetch:l}=fi(),{startPrefetch:s,cancelPrefetch:c}=_a({prefetchFn:Ia(Ai,Pi)}),d=v(()=>{ur(e.original.attachedEntityId)&&Ti(e.original.attachedEntityId,yi.BANK_TRANSACTION)?i({id:e.original.attachedEntityId}):ur(e.original.attachedEntityId)&&Ti(e.original.attachedEntityId,yi.FINANCIAL_SUMMARY)&&s({id:e.original.attachedEntityId}),o({id:e.original.id}),r({id:e.original.id})},[e.original.attachedEntityId,e.original.id,o,r,i,s]),u=v(()=>{ur(e.original.attachedEntityId)&&Ti(e.original.attachedEntityId,yi.BANK_TRANSACTION)?l():ur(e.original.attachedEntityId)&&Ti(e.original.attachedEntityId,yi.FINANCIAL_SUMMARY)&&c(),a(),n()},[l,c,n,a,e.original.attachedEntityId]);return w(li,{rowData:e,onMouseEnter:d,onMouseLeave:u,shouldDisplayDivider:e=>0!==e,onCellClick:()=>((e,t,r)=>{r?si("MobileConversation",{routeProps:{conversationId:e,transactionId:t}}):ur(t)?Ti(t,yi.BANK_TRANSACTION)?si("BankTransactionFormRouter",{routeProps:{transactionId:t,initialTab:"conversation"}}):Ti(t,yi.FINANCIAL_SUMMARY)&&(n=e,o=t,si("FinancialSummary",{routeProps:{conversationId:n,summaryId:o}})):function(e){si("Conversation",{routeProps:{conversationId:e}})}(e);var n,o})(e.original.id,e.original.attachedEntityId,t)})}const Di=ia(e=>c.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},c.createElement("path",{d:"M0.328064 7.5H14.6719",strokeMiterlimit:10}),c.createElement("path",{d:"M7.5 0.328064V14.6719",strokeMiterlimit:10})),"Plus"),Ri=xt({display:"flex",alignItems:"center",justifyContent:"center",outline:"none",cursor:"pointer",borderRadius:"md","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout",outlineOffset:"-1px"},"&:disabled":{cursor:"not-allowed",opacity:.6}}),Oi=xt({color:"typography.intent.secondary",border:"{borderWidths.md} solid",borderColor:"border.layout",backgroundColor:"surface.intent.action.discrete",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.discrete.hover",borderColor:"border.layout","& .Tight-text":{color:"typography.intent.secondary.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discrete.active","& .Tight-text":{color:"typography.intent.secondary.active"}},"& .Tight-text":{color:"typography.intent.secondary"}}),_i=xt({padding:"10px",fontSize:"md",fontWeight:"md",gap:"9px"}),Li=xt({padding:"6px",fontSize:"sm",fontWeight:"sm",gap:"5px"}),Fi=xt.raw({display:"flex",alignItems:"center",gap:"5px",backgroundColor:"surface.intent.action.discrete",borderRadius:"md",border:"{borderWidths.md} solid transparent",outline:"none",boxShadow:"0 0 0 0 transparent",position:"relative",cursor:"pointer",color:"icon.base","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:disabled":{cursor:"default"},_supportHover:{_enabled:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discrete.hover",color:"icon.intent.action.hover",fill:"icon.intent.action.hover"}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discrete.active",borderColor:"transparent",color:"icon.intent.action.active",fill:"icon.intent.action.active"}}),Bi=Et({variants:{width:{default:{width:"fit-content"},"fill-parent":{width:"100%"}}}}),Wi={default:_i,small:Li},Hi=e=>{const t=Wi[e];return Rt(St["button-base"],t,Ri,ca)},Ui=["default","small"],Vi={default:{className:""},small:{className:""}};for(const kT of Ui)Vi[kT]=Hi(kT);const zi=y(function({children:e,stylists:t=[],type:r="button",onClick:n,disabled:o,size:a="default",width:i="default",active:l=!1,onMouseEnter:s,onMouseLeave:c,popupTriggerProps:d},u){const h=Bt([Vi[a],Rt(null,Bi({width:i})),...t]);return w("button",{ref:u,...h,type:r,onClick:n,disabled:o,"data-active":l,onMouseEnter:s,onMouseLeave:c,...d,children:e})}),ji=Rt(St["button-primary"],Oi),Ki=y(function({children:e,active:t,stylists:r=[],width:n,...o},a){return w(zi,{ref:a,stylists:[ji,...r],active:t,width:n,...o,children:e})}),$i=()=>{si("Conversation",{routeProps:{conversationId:null}})};function qi(){return w(Ki,{onClick:$i,children:w(ga,{Component:Di})})}const Yi=Et({base:{display:"flex",flexDirection:"column",flexGrow:1,animation:"appear.instant",overflow:"hidden"},variants:{dashboard:{transactionDashboard:{border:"none"},businessOwnerDashboard:{marginTop:"10px",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderRadius:"lg"}}}});function Gi({children:e,dashboard:t}){const r=Rt(St["dashboard-table"],Yi({dashboard:t}));return w("div",{...r,children:e})}const Qi=h(null),Xi="mobile",Zi=Et({base:{fontWeight:"label",fontSize:{sm:"label",base:"lg"},fontFamily:"label",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px",maxWidth:"100%"},variants:{intent:{default:{color:"typography.label"},primary:{color:"typography.intent.primary"},contrast:{color:"typography.contrast"}},wrap:{ellipsis:_n,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},alignment:{left:{textAlign:"left"},center:{textAlign:"center"}}}});function Ji({children:e,intent:t="default",wrap:r="ellipsis",alignment:n="left"}){const o=Rt(St.label,Zi({intent:t,wrap:r,alignment:n}));return hr(e)?null:w("div",{title:"ellipsis"===r?e:void 0,...o,children:e})}const el=Rt(St["emphasis-label"],xt({lineHeight:"16px"}));function tl({children:e}){return w(Zn,{size:"med",weight:"lg",stylists:[el],children:e})}function rl({text:e,isRead:t}){return w(t?Ji:tl,{children:e})}const nl=Et({base:{padding:"0 25px",height:"100%",display:"flex",justifyContent:"center",flexDirection:"column",width:"100%"},variants:{alignVariant:{flexStart:{alignItems:"flex-start"},center:{alignItems:"center"}}},defaultVariants:{alignVariant:"flexStart"}});function ol({children:e,alignVariant:t="flexStart"}){const r=Rt(null,nl({alignVariant:t}));return w("div",{...r,children:e})}function al({date:e,isRead:t=!1}){const r=lr(e);return w(rl,{text:r,isRead:t})}const il=Rt(St["strong-sub-label"],Wt({label:"strongSubLabel"}));function ll({children:e,stylists:t=[]}){return hr(e)?null:w(Zn,{size:"sm",weight:"med",stylists:[il,...t],children:e})}const sl=h(null),cl=xt({overflow:"auto",display:"flex",flexDirection:"column",width:"325px",maxHeight:"314px",minWidth:"325px","&:focus, &:focus-within":{outline:"none"},scrollbar:"hidden"}),dl=Rt(St["selector-row"],xt({borderRadius:"zero",backgroundColor:"surface.intent.action.discrete",boxShadow:"none",border:"{borderWidths.md} solid",borderColor:"border.layout",display:"flex",width:"100%",minHeight:"35px",height:"fit-content",padding:"10px",alignItems:"flex-start",gap:"9px",flexShrink:0,textAlign:"start",cursor:"pointer","&[data-focused='true']":{boxShadow:"none",outline:"none",backgroundColor:"surface.intent.action.discrete.hover"}}));function ul(e,t,r){const[n,o]=m(e);return[t??n,r??o]}function hl({children:e}){return null===ae()?w(ie,{children:e}):e}function pl({children:e,modal:t=!1,initialOpen:r,placement:n,offsetPx:o,open:a,onOpenChange:i,blockInteraction:l=!0,enableClickMiddleware:s=!0}){const c=function({initialOpen:e=!1,placement:t="bottom",offsetPx:r=0,modal:n,open:o,onOpenChange:a,enableClickMiddleware:i=!0}={}){const[l,s]=m(),[c,d]=m(),[h,p]=ul(e,o,a),g=Y(),v=G({placement:t,open:h,nodeId:g,onOpenChange:(e,t)=>{!e&&t instanceof MouseEvent&&(t.clientX<0||t.clientY<0||t.clientX>window.innerWidth||t.clientY>window.innerHeight)||p(e)},whileElementsMounted:ee,middleware:[Q(r),X({crossAxis:t.includes("-"),fallbackStrategy:"bestFit",fallbackAxisSideDirection:"none",padding:8}),Z({padding:8}),J({apply({availableHeight:e,elements:t}){let r=e;if(e<314){const t=37*Math.floor(e/37)-18.5;r=Math.max(t,55.5)}Object.assign(t.floating.style,{maxHeight:`${r}px`,overflowY:"auto"})},padding:8})]}),b=v.context,f=te(b,{enabled:i}),y=re(b,{bubbles:{escapeKey:!0}}),T=ne(b),x=oe([f,y,T]);return u(()=>({open:h,setOpen:p,...x,...v,modal:n,labelId:l,descriptionId:c,setLabelId:s,setDescriptionId:d,nodeId:g}),[h,p,x,v,n,l,c,g])}({modal:t,initialOpen:r,placement:n,offsetPx:o,open:a,onOpenChange:i,enableClickMiddleware:s}),d=ae(),h=l&&null===d,p=c.nodeId;return w(hl,{children:w(le,{id:p,children:w(sl.Provider,{value:{...c,popupParentNodeId:d,blockInteraction:h},children:e})})})}function gl(){const e=p(sl);if(null==e)throw new Error("Popup components must be wrapped in <PopupManager />");return e}function ml({children:e}){const t=gl(),r=t.refs.setReference,n=t.open?"open":"closed",o={...t.getReferenceProps(),ref:r,"data-state":n};return w(C,{children:e(o)})}const vl=ia(e=>c.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M1.23712 1.23718L8.76283 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10}),c.createElement("path",{d:"M8.76288 1.23718L1.23717 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10})),"Cross");function bl({Component:e,stylists:t}){return w(e,{stylists:[Rt(St["tiny-icon"]),...t??[]],size:9})}const fl=ia(e=>c.createElement("svg",{width:11,height:10,viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M1.03625 2.20312H9.96378",stroke:"#182428"}),c.createElement("path",{d:"M1.03625 5H9.96378",stroke:"#182428"}),c.createElement("path",{d:"M1.03625 7.79688H7.24223",stroke:"#182428"})),"Sort"),yl=Rt(null,xt({display:"flex",alignItems:"center",borderRadius:"md",border:"{borderWidths.lg} solid transparent",maxWidth:"fit-content",justifyContent:"center",_supportHover:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discrete.hover"},"&[data-active='true']":{backgroundColor:"surface.intent.action.discrete.active",borderColor:"border.intent.action.active"},"&:has(button:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),ca),Tl=Rt(null,xt({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",backgroundColor:"transparent",padding:"6px 0 6px 6px",border:"none",outline:"none",cursor:"pointer"})),xl=Rt(null,xt({display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",padding:0,margin:"6px 6px 6px 5px",border:"none",outline:"none",position:"relative",cursor:"pointer","&::before":{content:"''",position:"absolute",top:"-9px",right:"-7px",bottom:"-9px",left:"-5px"},_focusVisible:{borderRadius:"sm",outline:"4px solid",outlineColor:"border.layout"}})),kl=Rt(null,xt({padding:"0 6px 0 0",display:"flex",alignItems:"center"}));function wl({onClearClick:e,columnName:t,active:r,popupTriggerProps:n}){const o=r||"open"===n?.["data-state"];return E("div",{...yl,"data-active":o,children:[E("button",{...Tl,...n,children:[w(ll,{children:t}),!o&&w("div",{...kl,children:w(bl,{Component:fl})})]}),o&&w("button",{...xl,onClick:e,children:w(bl,{Component:vl})})]})}const Cl=Et({base:{border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background",borderRadius:"zero",boxShadow:"box-shadow",animation:"appear.instant",display:"flex",flexShrink:1,width:"max-content",position:"absolute",top:0,left:0,"& *":{boxSizing:"border-box"}},variants:{type:{reaction:{borderRadius:"sm"}}}});function El({initialFocus:e=!0,style:t,ref:r,type:n,...o}){const{context:a,blockInteraction:i,...l}=gl(),s=se([l.refs.setFloating,r]),c=Rt(St.popup,Cl({type:n}));return a.open?E(C,{children:[i&&w(ce,{lockScroll:!0}),w(de,{children:w(ue,{context:a,modal:l.modal,initialFocus:e?void 0:-1,children:w("div",{ref:s,...c,style:{...l.floatingStyles,...t},...l.getFloatingProps(o),"aria-labelledby":l.labelId,"aria-describedby":l.descriptionId,children:o.children})})})]}):null}const Il=Rt(St["popup-sort-row"],xt({border:"none",background:"none",paddingLeft:"10px",paddingRight:"10px",paddingTop:"4px",paddingBottom:"4px",margin:0,cursor:"pointer",display:"flex",alignItems:"center",width:"100%",outline:"none",_focusVisible:{outline:"4px solid",outlineOffset:"-2px",outlineColor:"border.layout"}}));function Sl({onClick:e,children:t,active:r}){return w("button",{onClick:e,...Il,children:w(ro,{accent:r?"active":"action",children:t})})}const Al=Rt(null,xt({display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"})),Nl=Rt(null,xt({paddingTop:"10px",paddingLeft:"10px",paddingRight:"10px",paddingBottom:"8px",color:"typography.base.weak"}));function Pl({sortDef:e,sortAscDisplay:t,sortDescDisplay:r,handleSortClick:n,sortInstance:o}){const a=gl(),i=e=>{n(e),a?.setOpen(!1)},l=o?.orderBy===e&&"ASC"===o?.direction,s=o?.orderBy===e&&"DESC"===o?.direction;return E("div",{...Al,children:[w(ll,{stylists:[Nl],children:"Sort by:"}),w(Sl,{onClick:()=>i({orderBy:e,direction:"ASC"}),active:l,children:t}),w(Sl,{onClick:()=>i({orderBy:e,direction:"DESC"}),active:s,children:r})]})}const Ml=xt(Fi,{width:"fit-content",padding:"6px","&::before":{content:"''",position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}}),Dl=Rt(St["button-discrete-small"],Ml,ca);function Rl({children:e,active:t,disabled:r,onClick:n,popupTriggerProps:o,ariaLabel:a,ariaExpanded:i}){const[l,s]=m(!1),c=t??function(e){switch(e){case"open":return!0;case"closed":return!1;case void 0:return}}(o?.["data-state"]);return w("button",{type:"button",...Dl,onClick:e=>{void 0===c&&s(!l),n&&n(e)},"data-active":c??l,disabled:r,...o,"aria-label":a,"aria-expanded":i,children:e})}const Ol={minWidth:"140px"};function _l({columnName:e,sortDef:t,sortAscDisplay:r,sortDescDisplay:n}){const o=p(Qi);if(!o)return null;const{sortInstance:a,setSortInstance:i}=o,l=a?.orderBy===t,s=()=>{i(void 0)};return t&&r&&n?E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>w(wl,{active:l,onClearClick:s,columnName:e,popupTriggerProps:t})}),w(El,{style:Ol,children:w(Pl,{sortDef:t,sortAscDisplay:r,sortDescDisplay:n,handleSortClick:e=>{i(e)},sortInstance:a})})]}):w(Rl,{disabled:!0,children:w(ll,{children:e})})}const Ll=Rt(null,xt({paddingLeft:"19px"}));function Fl({columnName:e,sortDef:t,sortAscDisplay:r,sortDescDisplay:n}){return w("div",{...Ll,children:w(_l,{columnName:e,sortDef:t,sortAscDisplay:r,sortDescDisplay:n})})}const Bl="Oldest to Newest",Wl="Newest to Oldest";const Hl=h({userId:void 0,userRole:void 0,userEmail:void 0,companyId:void 0,customerPartnerId:void 0,apiPartnerName:void 0});function Ul({authorUserId:e,isRead:t}){const{userRole:r,userId:n}=p(Hl);let o="";return e===n?o="Me":"OWNER"===r?o="Bookkeeper":"ACCOUNTANT"===r&&(o="User"),w(rl,{text:o,isRead:t})}const Vl=Rt(St.text,xt({fontSize:"md",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",lineHeight:"16px",maxWidth:"100%",fontFamily:"label"}),On);function zl({children:e,stylists:t=[]}){const r=Bt([Vl,...t]);return w("div",{...r,children:e})}const jl=Rt(St["emphasis-sub-label"],Wt({label:"emphasisSubLabel"}));function Kl({children:e}){return hr(e)?null:w(Zn,{size:"sm",weight:"lg",stylists:[jl],children:e})}const $l=xt({display:"grid",gridTemplateColumns:"3fr 1fr",border:"none",borderRadius:0,padding:"10px",width:"100%",cursor:"pointer",backgroundColor:"transparent",alignItems:"start"}),ql=wt(xt({display:"flex",flexDirection:"column",alignItems:"start",gap:"2px",maxWidth:"100%"}),On),Yl=xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"end",gap:"2px"});function Gl({sender:e,subject:t,date:r,message:n,isRead:o,handleFormOpen:a}){return E("button",{className:$l,onTouchEnd:a,children:[E("div",{className:ql,children:[w(Ul,{authorUserId:e,isRead:o}),w(o?ro:Kl,{children:t}),w(ro,{children:n})]}),E("div",{className:Yl,children:[w(al,{date:r,isRead:o}),o?w(ga,{Component:sa}):w(zl,{children:w(ga,{Component:sa})})]})]})}const Ql=j(),Xl=Rt(null,xt({paddingLeft:"25px"})),Zl=[Ql.accessor("latestMessage.author.userId",{id:"from",cell:({row:e})=>w(ol,{children:w(Ul,{authorUserId:e.original.latestMessage.author.userId,isRead:"READ"===e.original.readStatus})}),header:()=>w(ll,{stylists:[Xl],children:"From"}),size:150,maxSize:150}),Ql.accessor("subject",{id:"subject",cell:({row:e})=>w(ol,{children:w(rl,{text:e.original.subject,isRead:"READ"===e.original.readStatus})}),header:()=>w(ll,{stylists:[Xl],children:"Subject"}),size:150}),Ql.accessor("latestMessage.text",{id:"message",cell:({row:e})=>w(ol,{children:w(rl,{text:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus})}),header:()=>w(ll,{stylists:[Xl],children:"Message"}),size:200}),Ql.accessor("lastUpdatedDateTime",{id:"date",cell:({row:e})=>w(ol,{children:w(al,{date:e.original.lastUpdatedDateTime,isRead:"READ"===e.original.readStatus})}),header:()=>w(Fl,{columnName:"Date",sortDef:"LAST_MESSAGE_CREATED_DATE_TIME",sortDescDisplay:Wl,sortAscDisplay:Bl}),size:130,maxSize:130}),Ql.display({id:Xi,cell:({row:e})=>w(Gl,{sender:e.original.latestMessage.author.userId,subject:e.original.subject,date:e.original.lastUpdatedDateTime,message:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus,handleFormOpen:()=>{}})})];function Jl(e){return e?Zl.filter(e=>e.id===Xi):Zl.filter(e=>e.id!==Xi)}const es=[],ts=xt({display:"flex",flexDirection:"column",height:"250px",width:"100%",paddingBottom:"20px",alignItems:"center",justifyContent:"center",boxSizing:"border-box",textAlign:"center",backgroundColor:"surface.background",gap:"10px"}),rs=Rt(St["empty-dashboard-layout"],ts);function ns({children:e}){return w("div",{...rs,"data-testid":"empty-dashboard-layout",children:e})}function os({Component:e,stylists:t}){return w(e,{stylists:[Rt(St["large-icon"]),...t??[]],size:25})}const as=ia(e=>c.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M14.0625 2.14374L1.5625 6.90624L11.6813 12.8562L14.0625 2.14374Z",strokeWidth:.9375,strokeMiterlimit:10}),c.createElement("path",{d:"M8.25624 10.8375L5.73124 12.8562L5.33749 9.12499L13.4687 2.73749",strokeWidth:.9375,strokeMiterlimit:10})),"Paperplane"),is=()=>{si("Conversation",{routeProps:{conversationId:null}})};function ls(){return E(C,{children:[w(os,{Component:as}),w(eo,{wrap:"wrap",children:"Need help with your financials?"}),w(Ki,{onClick:is,children:w(eo,{children:"Talk to a bookkeeper"})})]})}function ss(){return E(C,{children:[w(os,{Component:as}),w(eo,{wrap:"wrap",children:"All caught up"}),w(ro,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const cs=Rt(null,xt({display:"flex",flexDirection:"row",gap:"5px"}));function ds({children:e}){return w("div",{...cs,children:e})}const us=Et({variants:{isMobile:{true:{},false:{minWidth:"900px"}}}});function hs(e){return w(e?ss:ls,{})}function ps({sortInstance:e,setSortInstance:t,conversations:r,paginationControls:n,isFilling:o,isMobile:a}){const i=function({conversations:e,isMobile:t}){return K({data:e??es,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??es.length,columns:Jl(t),getCoreRowModel:$(),getRowId:e=>e.id})}({conversations:r,isMobile:a}),{query:{data:l},isFilling:s}=Ua({limit:1,filter:{resolutionStatus:{in:["OPEN","CLOSED"]}}}),c=!dr(l?.data?.[0])&&!s;return E("div",{className:us({isMobile:a}),children:[w("div",{id:qo}),E(pa.Provider,{value:n,children:[E(_t,{children:[w(Ut,{children:"Conversations"}),E(ds,{children:[w(ya,{}),w(qi,{})]})]}),w(Gi,{dashboard:"businessOwnerDashboard",children:o?w(Ea,{numColumns:4}):E(C,{children:[!a&&w(Qi.Provider,{value:{sortInstance:e,setSortInstance:t},children:w(Ga,{headerGroups:i.getHeaderGroups()})}),r.length>0?w(Xa,{children:i.getRowModel().rows.map(e=>w(Mi,{rowData:e,isMobile:a},e.id))}):w(ns,{children:hs(c)})]})})]})]})}const gs=Rt(St.body,Wt({body:"default"}));function ms({children:e,stylists:t=[]}){if(hr(e))return null;const r=Bt([gs,...t]);return w("div",{...r,children:e})}const vs=Rt(null,xt({display:"flex",flexDirection:"column",gap:"6px",width:"100%",padding:"10px"})),bs=Et({base:{height:16},variants:{width:{w92:{width:"92%"},w90:{width:"90%"},w88:{width:"88%"},w87:{width:"87%"},w85:{width:"85%"},w70:{width:"70%"}}}}),fs=[{width:"w85"},{width:"w90"},{width:"w88"},{width:"w85"},{width:"w92"},{width:"w87"},{width:"w90"},{width:"w85"},{width:"w88"}];function ys(){return w("div",{...vs,children:fs.map((e,t)=>w(No,{styles:bs({width:e?.width})},t))})}const Ts=ia(e=>c.createElement("svg",{width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M12 1.47998C6.2 1.47998 1.5 5.74998 1.5 11C1.52866 13.0153 2.23294 14.9626 3.5 16.53L2.5 21.53L9.16 20.2C10.1031 20.4499 11.0744 20.5776 12.05 20.58C17.85 20.58 22.55 16.3 22.55 11.03C22.55 5.75998 17.8 1.47998 12 1.47998Z",strokeWidth:1.5,strokeMiterlimit:10}),c.createElement("path",{d:"M11.05 11.02H12.95",strokeWidth:1.5,strokeMiterlimit:10}),c.createElement("path",{d:"M15.82 11.02H17.73",strokeWidth:1.5,strokeMiterlimit:10}),c.createElement("path",{d:"M6.27 11.02H8.18",strokeWidth:1.5,strokeMiterlimit:10})),"Comment"),xs=xt({position:"absolute",top:"-1",right:"-1",width:"10",height:"10",borderRadius:"999px",backgroundColor:"surface.intent.warning",boxShadow:"0 0 0 1px {colors.border.intent.warning}"}),ks=xt({position:"relative",width:"25px",height:"25px"});function ws({hasUnread:e}){return E("div",{className:ks,children:[w(os,{Component:Ts}),e&&w("div",{"data-testid":"unread-comment-badge",className:xs,"aria-hidden":"true"})]})}const Cs=xt({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"5px",padding:"10px",width:"100%",borderBottom:"{borderWidths.lg} solid {colors.border.layout.strong}",boxSizing:"border-box"});function Es({hasUnreadMessages:e=!1,showMessageIndicator:t}){return E("div",{className:Cs,children:[w(eo,{children:"Message Bookkeeper"}),t&&w(ws,{hasUnread:e})]})}const Is=xt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",textAlign:"center"});function Ss(){return E("div",{className:Is,children:[w(os,{Component:as}),w(eo,{wrap:"wrap",textAlign:"center",children:"Your financial summary will be ready soon"}),w(ro,{wrap:"wrap",children:"In the meantime, you can start a conversation with your bookkeeper."}),w(Ki,{onClick:()=>si("Conversation"),children:w(eo,{children:"Talk to a bookkeeper"})})]})}const As=xt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Ns({summaryId:e,conversationId:t}){const{startPrefetch:r,cancelPrefetch:n}=Ka(),{startPrefetch:o,cancelPrefetch:a}=Ii(),i=v(()=>{o({id:t}),r({id:t})},[t,o,r]),l=v(()=>{a(),n()},[a,n]);return E("div",{className:As,children:[w(os,{Component:as}),w(eo,{wrap:"wrap",textAlign:"center",children:"Continue conversation with your bookkeeper"}),w(ro,{wrap:"wrap",children:"Pick up where you left off."}),w(Ki,{onClick:()=>si("FinancialSummary",{routeProps:{summaryId:e,conversationId:t}}),onMouseEnter:i,onMouseLeave:l,children:w(eo,{children:"Continue conversation"})})]})}const Ps=xt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Ms({summaryId:e}){return E("div",{className:Ps,children:[w(os,{Component:as}),w(eo,{wrap:"wrap",textAlign:"center",children:"Ask questions about your financial summary"}),w(ro,{wrap:"wrap",children:"Your bookkeeper will respond here."}),w(Ki,{onClick:()=>si("FinancialSummary",{routeProps:{summaryId:e}}),children:w(eo,{children:"Talk to a bookkeeper"})})]})}function Ds({summaryId:e,conversationId:t}){const r=ur(t);return dr(e)?w(Ss,{}):r?w(Ns,{conversationId:t,summaryId:e}):w(Ms,{summaryId:e})}const Rs=xt({display:"flex",flexDirection:"column",flex:{base:"1 1 100%",md:"0 0 342px"},maxHeight:"247px",minHeight:"247px",width:"342px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderRadius:"lg",alignItems:"center",overflow:"hidden",boxSizing:"border-box"}),Os=xt({display:"flex",flexDirection:"column",flex:"1 1 0",minHeight:0,width:"100%",backgroundColor:"surface.background",padding:"10px",gap:"10px",alignItems:"flex-start",boxSizing:"border-box"});function _s({summaryData:e}){const t=ur(e?.summary),r=ur(e?.conversation);return E("div",{className:Rs,children:[w(Es,{showMessageIndicator:t&&r,hasUnreadMessages:"UNREAD"===e?.conversation?.readStatus}),w("div",{className:Os,children:w(Ds,{summaryId:e?.id,conversationId:e?.conversation?.id})})]})}const Ls=xt({borderRadius:"lg",overflow:"auto",height:"100%",width:"100%",padding:"10px"}),Fs=Et({base:{display:"flex",flex:{base:"1 1 100%",md:"1 1 0"},maxHeight:"247px",minHeight:"247px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderRadius:"lg",gap:"10px",alignItems:"flex-start",boxSizing:"border-box",position:"relative",marginBottom:10,overflow:"auto"},variants:{isSample:{true:{pointerEvents:"none",overflow:"hidden"},false:{}}}}),Bs=Rt(null,xt({whiteSpace:"pre-wrap",display:"flex",alignItems:"start",gap:"10px",height:"fit-content"})),Ws=xt({display:"flex",flexWrap:"wrap",gap:"10px",maxWidth:"1440px",alignItems:"flex-start"});function Hs({isSample:e,period:t}){const{query:{data:r},isFilling:n}=function(e){return r={select:e=>e?.data?.[0]},xr({queryKey:(t={limit:1,filter:{date:{equal:jt(e.month,e.year)},status:{in:["ACTIVE"]}},sort:{direction:"DESC",orderBy:"DATE"}})?Si(t):["summaries",{}],queryFn:Ni,...r});var t,r}(t),o=e?function(){const e=/* @__PURE__ */new Date;return`In ${e.toLocaleString("en-US",{month:"long"})} ${e.getFullYear()}, your total income increased significantly to $${Bo.toLocaleString()}, up from $${17924..toLocaleString()} the previous month, reflecting strong revenue growth. However, expenses also rose slightly to $${Wo.toLocaleString()}, compared to $${4534..toLocaleString()} last month, which slightly narrowed your net profit margin despite a healthy $${15157..toLocaleString()} net profit. \n\nA key area for improvement is transaction categorization; with one transaction remaining uncategorized and only two user-categorized, enhancing categorization accuracy will improve financial tracking and insights. To maintain positive momentum, consider reviewing variable expenses to identify any controllable cost increases.\n\nGoing forward, continue focusing on revenue growth while keeping a close eye on expense management, and aim to fully categorize all transactions to gain more precise financial visibility.`}():r?.summary??"A summary of this month's financials will appear here once more data is available.";return E("div",{className:Ws,children:[w("div",{"data-testid":"financial-summary-layout",className:Fs({isSample:e}),children:!e&&n?w(ys,{}):E("div",{className:Ls,children:[w(ms,{stylists:[Bs],children:o}),e&&w(Fo,{size:"lg"})]})}),w(_s,{summaryData:r})]})}async function Us(e){const{url:t,headers:r}=hn(e);return async function(e){const{authorization:t,extraHeaders:r,params:n,url:o}=e,a=cn({extraHeaders:r,authorization:t});nn("HTTP DELETE Request",{url:o,accessToken:t});try{const e=await fetch(o,{method:"DELETE",headers:a,credentials:"include",body:JSON.stringify(n)});return nn("HTTP DELETE Response",{url:o,status:e.status,statusText:e.statusText}),dn(e)}catch(i){return Promise.reject(i)}}({url:t,params:e.bodyParams,extraHeaders:r})}function Vs({mutationFn:e,onMutateFn:t,...r}){const n=mr(),o=Tr(),a=!hr(n);return P({...r,mutationFn:a?t=>e({data:t,accessToken:n,environment:o}):vr,onMutate:a&&ur(t)?e=>t({data:e,accessToken:n,environment:o}):void 0},fr)}const zs=async e=>{const t=e.queryKey,r={path:"/banks/plaidItems",accessToken:t[1].accessToken,environment:t[1].environment};return await Ra(r)};function js(e){return xr({...e,queryKey:["banks/plaidItems"],queryFn:zs})}function Ks(){return js({select:e=>{return t=e,t?.filter(e=>"ACTIVE"===e.status);var t}})}const $s=async({data:e,accessToken:t,environment:r})=>{const n={path:"/banks/integration",bodyParams:{id:e.id,removeFromApi:!0},accessToken:t,endpointManager:xn(r)};return await async function(e){return Us(e)}(n)};function qs(){return Vs({mutationFn:$s,onSuccess:()=>{const e=["banks/plaidItems"];return fr.invalidateQueries({queryKey:e})}})}const Ys=Rt(St["button-danger"],xt({color:"typography.intent.danger",border:"{borderWidths.md} solid",borderColor:"border.intent.danger",backgroundColor:"surface.intent.danger",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-text":{color:"typography.intent.danger.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.danger.active",borderColor:"border.intent.danger.active","& .Tight-text":{color:"typography.intent.danger.active"}},"& .Tight-text":{color:"typography.intent.danger"}}));function Gs({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Ys,...t],...r,children:e})}const Qs=Rt(St["button-tertiary"],xt({color:"typography.intent.success",border:"{borderWidths.md} solid",borderColor:"border.intent.success",backgroundColor:"surface.intent.success","& .Tight-text":{color:"typography.intent.success"},"& path":{stroke:"icon.intent.success"},_supportHover:{_notDisabled:{backgroundColor:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-text":{color:"typography.intent.success.hover"},"& path":{stroke:"icon.intent.success.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.success.active",borderColor:"border.intent.success.active","& .Tight-text":{color:"typography.intent.success.active"},"& path":{stroke:"icon.intent.success.active"}}}));function Xs({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Qs,...t],...r,children:e})}const Zs="cancel",Js="danger",ec="success",tc=Rt(null,xt({position:"fixed",inset:0,minHeight:"100dvh",display:"grid",placeItems:"center",backgroundColor:"overlay"})),rc=Rt(St["alert-dialog"],xt({background:"surface.background",borderRadius:"md",display:"flex",flexDirection:"column",padding:"16px",maxWidth:"360px",gap:"16px",minWidth:0,margin:"32px"})),nc=Rt(null,xt({display:"flex",justifyContent:"flex-end",gap:"8px"})),oc="success",ac="danger",ic=he.createConfirmation(pe(function({show:e,proceed:t,title:r,body:n,buttons:o=[{key:"ok",type:"default",label:"OK"}]}){const{context:a}=G({open:e,strategy:"fixed"}),i=re(a,{outsidePress:!1,escapeKey:!0}),l=ne(a,{role:"alertdialog"}),{getFloatingProps:s}=oe([i,l]);return e?w(de,{children:w(ce,{lockScroll:!0,...tc,children:w(ue,{context:a,modal:!0,returnFocus:!0,children:E("div",{...s(),...rc,children:[w(eo,{wrap:"wrap",children:r}),n&&"string"==typeof n?w(Ji,{wrap:"wrap",children:n}):w(C,{children:n}),w("div",{...nc,children:o.map(e=>{const r=(e=>{switch(e){case ac:return Gs;case oc:return Xs;default:return Ki}})(e.type);return w(r,{onClick:()=>e.onClick?t(e.onClick()):t(e.key),children:w(eo,{children:e.label})},e.key)})})]})})})}):null}));function lc(e){return bn(`${t=e,fn[t]}/v1`,"v1");var t}const sc=[{displayName:"Chase",institutionName:"ins_56"},{displayName:"Bank of America",institutionName:"ins_127989"},{displayName:"Capital One",institutionName:"ins_128026"},{displayName:"Wells Fargo",institutionName:"ins_127991"}];async function cc({institutionId:e,accessToken:t,environment:r}){if(!t)throw new Error("Access token is required to get Plaid item institution");const n={path:"/banks2/bankUrl",accessToken:t,endpointManager:lc(r)},{url:o,headers:a}=hn(n);return await Pa({url:o,includeCredentials:!0,extraHeaders:a,params:e?{institutionId:e}:void 0})}function dc(e,t,r,n){const o=1===r?e:t;return n?`${r} ${o}`:o}const uc=async({error:e,metadata:t,additionalInfo:r})=>{const n=await(e=>{const t=(e?.institution?.name?`${e.institution.name} failed to link.`:"Something went wrong.")+" Please try again later.";return ic({title:"Uh oh!",body:t,buttons:[{key:"cancel",label:"Cancel"},{key:"success",label:"Chat"}]})})(t);var o;"success"===n&&(o=e?.error_code?`I need help with my ${t?.institution?.name||"Plaid"} bank connection (code: ${e.error_code}).`:`I need help with my ${t?.institution?.name||"Plaid"} bank connection. ${r||""}`,si("Conversation",{routeProps:{conversationId:null,defaultValues:{message:o}}}))};function hc(e,t){const r=mr(),n=Tr(),[o,a]=m(""),{open:i,ready:l}=function(e,t,r){return ge({token:e,onSuccess:async(e,n)=>{try{const{plaidItem:i}=await async function({publicToken:e,metadata:t,accessToken:r,environment:n}){if(!r)throw new Error("Access token is required to create Plaid link token");const o={path:"/banks2/webPlaidPublicToken",accessToken:r,endpointManager:lc(n)},{url:a,headers:i}=hn(o);return await pn({url:a,params:{publicToken:e,plaidMetadata:t},includeCredentials:!0,extraHeaders:i})}({publicToken:e,metadata:n,accessToken:t,environment:r});await(o=i.apiInstitutionName,a=i.plaidItemAccounts.length,ic({title:"All set! Ready to track your transactions?",body:`Your ${a} ${o} ${dc("account","accounts",a)} are now linked. All transactions will be organized into easy-to-understand categories.`,buttons:[{key:ec,label:"Get started",type:oc}]})),on({error:new Error("Plaid Public Token exchanged successfully"),severity:"info",extraData:{metadata:n,publicToken:e}}),await fr.invalidateQueries()}catch(i){on({error:new Error("Plaid Public Token exchange failed"),severity:"error",extraData:{metadata:n,publicToken:e,error:i}}),uc({additionalInfo:"Error exchanging Plaid public token."})}var o,a},onExit:(t,r)=>{ur(t)?(on({error:new Error(t?.error_message),severity:"error",extraData:{metadata:r,error:t,token:e}}),uc({error:t,metadata:r})):on({error:new Error("Plaid Link exited by user without error"),severity:"info",extraData:{metadata:r,token:e}})},onEvent:(e,t)=>{on({error:new Error(`Plaid event: ${e}`),severity:"info",extraData:{metadata:t,eventName:e}})}})}(o,r,n);return b(()=>{l&&o&&(i(),t?.())},[l,i,o,t]),{linkPlaid:async()=>{try{const t=await async function({accessToken:e,plaidItemId:t,environment:r}){if(!e)throw new Error("Access token is required to create Plaid link token");const n={path:"/banks2/createPlaidLinkToken",accessToken:e,endpointManager:lc(r)},{url:o,headers:a}=hn(n);return Pa({url:o,includeCredentials:!0,extraHeaders:a,params:t?{plaidItemId:t}:void 0})}({accessToken:r,plaidItemId:e,environment:n});on({error:new Error("Plaid Link Token created successfully"),severity:"info",extraData:{accessToken:r,plaidItemId:e}}),a(t.link_token)}catch(t){on({error:new Error("Plaid Link Token creation failed"),severity:"error",extraData:{accessToken:r,plaidItemId:e,error:t}}),uc({additionalInfo:"Error creating Plaid link token."})}}}}const pc=h({dimensions:{width:null,height:null}});function gc(){const{dimensions:e}=p(pc);return ur(e.width)&&e.width<parseInt(io("sizes.breakpoint-sm"))}const mc={RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT"},vc={short:{credentialsChanged:e=>`${e} Credentials Changed`,accountLocked:e=>`${e} Account Locked`,supportChanged:e=>`${e} Support Changed`,updateNeeded:e=>`${e} Update Needed`,noAccountsAvailable:e=>`No ${e} Accounts Available`,connectionError:e=>`${e} Connection Error`,serverError:e=>`${e} Server Error`,temporarilyDown:e=>`${e} Temporarily Down`,serverDown:e=>`${e} Server Down`,requestError:e=>`${e} Request Error`,inputError:e=>`${e} Input Error`,volumeDown:e=>`${e} Down Due to Volume`,credentialsExpiring:e=>`${e} Credentials Expiring`,relinkNeeded:e=>`${e} Relink Needed`,generic:()=>"Bank Connection Error"},long:{relinkCredentials:()=>"Please relink your account using your latest credentials.",invalidUpdatedUsername:({isMobile:e})=>`Your bank account has an updated username and needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,accountLocked:({isMobile:e})=>`Your bank account has been locked. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" and ask your financial institution to unlock your account. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,supportChanged:({apiPartnerName:e})=>`Unfortunately, your bank has added restrictions that block services like ${e||"ours"} from linking with it. Please chat with support to resolve this issue.`,updateNeeded:({isMobile:e})=>`Your bank requires you to take some action. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to log in and perform the requested action. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,mfaUpdateNeeded:({isMobile:e})=>`You have an unsupported "Multi-Factor Authentication" enabled. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to disable it on your banking site. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,noAccountsUnlink:()=>"It seems that you have no active accounts with this bank. Please unlink this bank.",connectionError:()=>"Your bank connection encountered an error. Please chat with support to resolve the issue.",productNotReady:()=>"Your institution was not ready for transactions to be pulled. Please chat with support to resolve the issue.",permissionRevoked:({apiInstitutionName:e})=>`Access to your accounts with ${e} has been revoked. Please unlink and relink your account using your latest credentials.`,bankMaintenance:()=>"Your bank's server is down for maintenance, so it may take a little longer than normal to receive new transactions.",serverDown:()=>"Your bank's server is unexpectedly down. Please chat with support to resolve the issue.",bankConnectionMaintenance:()=>"Your bank connection is down for maintenance, so it may take a little longer than normal to receive new transactions.",partnerCredsChange:({isMobile:e})=>`Your bank account needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,credentialsExpiring:({apiInstitutionName:e})=>`Your authorization for ${e} will expire soon. Please relink your bank with your latest credentials.`,relinkForStatements:()=>"Please relink your account using your latest credentials to enable automatic retrieval of bank statements.",generic:()=>"There was an error with your bank connection. Please chat with our team so they can resolve it."}},bc={ITEM_ERROR:{INVALID_CREDENTIALS:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.relinkCredentials,buttonType:mc.RELINK},INSUFFICIENT_CREDENTIALS:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.relinkCredentials,buttonType:mc.RELINK},INVALID_MFA:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.relinkCredentials,buttonType:mc.RELINK},INVALID_UPDATED_USERNAME:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.invalidUpdatedUsername,buttonType:mc.UNLINK_RELINK},ITEM_LOCKED:{shortMessage:vc.short.accountLocked,longMessage:vc.long.accountLocked,buttonType:mc.OPEN_BANK},ITEM_LOGIN_REQUIRED:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.relinkCredentials,buttonType:mc.DELETE_OR_RELINK},ITEM_NOT_SUPPORTED:{shortMessage:vc.short.supportChanged,longMessage:vc.long.supportChanged,buttonType:mc.CHAT},USER_SETUP_REQUIRED:{shortMessage:vc.short.updateNeeded,longMessage:vc.long.updateNeeded,buttonType:mc.OPEN_BANK},MFA_NOT_SUPPORTED:{shortMessage:vc.short.supportChanged,longMessage:vc.long.mfaUpdateNeeded,buttonType:mc.OPEN_BANK},NO_ACCOUNTS:{shortMessage:vc.short.noAccountsAvailable,longMessage:vc.long.noAccountsUnlink,buttonType:mc.UNLINK_ONLY},NO_AUTH_ACCOUNTS:{shortMessage:vc.short.noAccountsAvailable,longMessage:vc.long.noAccountsUnlink,buttonType:mc.UNLINK_ONLY},INVALID_SEND_METHOD:{shortMessage:vc.short.connectionError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},NO_INVESTMENT_ACCOUNTS:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},NO_INVESTMENT_AUTH_ACCOUNTS:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},NO_LIABILITY_ACCOUNTS:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},PRODUCTS_NOT_SUPPORTED:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},ITEM_NOT_FOUND:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},PRODUCT_NOT_READY:{shortMessage:vc.short.serverError,longMessage:vc.long.productNotReady,buttonType:mc.CHAT},USER_PERMISSION_REVOKED:{shortMessage:vc.short.connectionError,longMessage:vc.long.permissionRevoked,buttonType:mc.UNLINK_RELINK}},INSTITUTION_ERROR:{INSTITUTION_DOWN:{shortMessage:vc.short.temporarilyDown,longMessage:vc.long.bankMaintenance,buttonType:mc.CHAT},INSTITUTION_NOT_RESPONDING:{shortMessage:vc.short.serverDown,longMessage:vc.long.serverDown,buttonType:mc.CHAT},INSTITUTION_NOT_AVAILABLE:{shortMessage:vc.short.temporarilyDown,longMessage:vc.long.bankMaintenance,buttonType:mc.CHAT},INSTITUTION_NO_LONGER_SUPPORTED:{shortMessage:vc.short.supportChanged,longMessage:vc.long.supportChanged,buttonType:mc.CHAT}},API_ERROR:{INTERNAL_SERVER_ERROR:{shortMessage:vc.short.connectionError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},PLANNED_MAINTENANCE:{shortMessage:vc.short.temporarilyDown,longMessage:vc.long.bankConnectionMaintenance,buttonType:mc.CHAT}},INVALID_REQUEST:{DEFAULT:{shortMessage:vc.short.requestError,longMessage:vc.long.connectionError,buttonType:mc.CHAT}},INVALID_INPUT:{DEFAULT:{shortMessage:vc.short.inputError,longMessage:vc.long.connectionError,buttonType:mc.CHAT}},INVALID_RESULT:{DEFAULT:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT}},RATE_LIMIT_EXCEEDED:{DEFAULT:{shortMessage:vc.short.volumeDown,longMessage:vc.long.bankMaintenance,buttonType:mc.CHAT}},OAUTH_ERROR:{DEFAULT:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.RELINK}},CHANGE_TO_PARTNER_CREDS:{DEFAULT:{shortMessage:vc.short.updateNeeded,longMessage:vc.long.partnerCredsChange,buttonType:mc.UNLINK_RELINK}},PENDING_DISCONNECT:{DEFAULT:{shortMessage:vc.short.credentialsExpiring,longMessage:vc.long.credentialsExpiring,buttonType:mc.RELINK}},ADDITIONAL_CONSENT_REQUIRED:{DEFAULT:{shortMessage:vc.short.relinkNeeded,longMessage:vc.long.relinkForStatements,buttonType:mc.RELINK}},DEFAULT:{DEFAULT:{shortMessage:vc.short.connectionError,longMessage:vc.long.connectionError,buttonType:mc.CHAT}},UNKNOWN:{UNKNOWN:{shortMessage:vc.short.generic,longMessage:vc.long.generic,buttonType:mc.CHAT}}};function fc({apiErrorType:e,apiErrorCode:t}){if(!e||!t)return on({error:new Error("No bank error provided. Should not get here"),severity:"error"}),bc.DEFAULT.DEFAULT;const r=bc[e];if(!r)return on({error:new Error(`Unknown bank error type: ${e}`),severity:"error"}),bc.DEFAULT.DEFAULT;return(r[t]??r.DEFAULT)||(on({error:new Error(`Unknown bank error code: ${t} for type: ${e}`),severity:"error"}),bc.DEFAULT.DEFAULT)}function yc(e,t,r,n,o){return()=>ic({title:e?.shortMessage(t)||"Bank Error",body:e?.longMessage({apiInstitutionName:t,apiPartnerName:r,isMobile:n}),buttons:o})}function Tc(e,t,r,n,o,a){return{alert:yc(e,t,o,a,[{key:Zs,label:"Cancel"},{key:ec,label:"Chat",type:oc}]),actions:{success:()=>si("Conversation",{routeProps:{conversationId:null,defaultValues:{message:`I need help with my ${t} bank connection: ${r} - ${n}`}}})}}}function xc(e){const{mutate:t}=qs(),r=mr(),n=Tr(),{apiPartnerName:o}=p(Hl),a=gc(),{linkPlaid:i}=hc(e?.id);if(dr(e))return Tc(fc({apiErrorType:"UNKNOWN",apiErrorCode:"UNKNOWN"}),"UNKNOWN","UNKNOWN","UNKNOWN","",!1);const l=fc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}),s="ITEM_LOCKED"===e.apiErrorCode;switch(l.buttonType){case mc.DELETE_OR_RELINK:case mc.RELINK:return c=l,d=e.apiInstitutionName,u=i,{alert:yc(c,d,o,a,[{key:Zs,label:"Cancel"},{key:ec,label:"Relink",type:oc}]),actions:{success:()=>{u()}}};case mc.UNLINK_RELINK:return function(e,t,r,n,o,a,i,l,s){return{alert:yc(e,t,l,s,[{key:Zs,label:"Cancel"},{key:mc.CHAT,label:"Chat"},{key:ec,label:"Unlink and Relink",type:oc}]),actions:{success:()=>{a({id:String(r)}),i()},[mc.CHAT]:()=>si("Conversation",{routeProps:{conversationId:null,defaultValues:{message:`I need help with my ${t} bank connection: ${n} - ${o}`}}})}}}(l,e.apiInstitutionName,e.id,e.apiErrorType,e.apiErrorCode,t,i,o,a);case mc.OPEN_BANK:return function(e,t,r,n,o,a,i,l,s,c,d){return{alert:yc(e,t,c,d,[{key:Zs,label:"Cancel"},{key:mc.CHAT,label:"Chat"},{key:mc.RELINK,label:"Relink"},{key:ec,label:"Go To Bank",type:oc}]),actions:{success:async()=>{const e=await cc({institutionId:r,accessToken:i,environment:l}),t=a?e.map.accountLockedUrl:e.map.accountSetupUrl;t&&window.open(t,"_blank")},[mc.RELINK]:()=>{s()},[mc.CHAT]:()=>si("Conversation",{routeProps:{conversationId:null,defaultValues:{message:`I need help with my ${t} bank connection: ${n} - ${o}`}}})}}}(l,e.apiInstitutionName,e.apiInstitutionId,e.apiErrorType,e.apiErrorCode,s,r,n,i,o,a);case mc.UNLINK_ONLY:return function(e,t,r,n,o,a){return{alert:yc(e,t,o,a,[{key:Zs,label:"Cancel"},{key:ec,label:"Unlink",type:oc}]),actions:{success:()=>{n({id:String(r)})}}}}(l,e.apiInstitutionName,e.id,t,o,a);default:return Tc(l,e.apiInstitutionName,e.apiErrorType,e.apiErrorCode,o,a)}var c,d,u}const kc=async(e,t)=>{const r=await e();"string"==typeof r&&t[r]&&await t[r]()},wc={id:"mock_task_link_bank",priority:"HIGH",name:"Link your bank account",description:"Effortlessly track every dollar by linking your bank account",type:"LINK_BANK",dismissable:"DISMISSABLE",status:"ACTIVE"};function Cc(e,t=!0){const r=fc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode});return{id:`${e.apiInstitutionName}_${e.id}_${e.apiErrorCode}_bank_error_task`,priority:"URGENT",name:r?.shortMessage(e.apiInstitutionName)||"",description:t&&"RELINK"===r?.buttonType&&r?.longMessage({apiInstitutionName:e.apiInstitutionName,isMobile:!1,apiPartnerName:""})||"",type:r?.buttonType||"CHAT",dismissable:"DISMISSABLE",status:"ACTIVE",meta:{plaidItem:e}}}const Ec=async e=>{const t=e.queryKey,r={path:"/banks/accounts",accessToken:t[1].accessToken,environment:t[1].environment},n=await Ra(r),o=void 0!==n.data?n.data.map(e=>({...e,id:xi({id:e.id,prefix:"BANK_ACCOUNT"})})):[];return{...n,data:o}};function Ic(e){return xr({...e,queryKey:["banks/accounts"],queryFn:Ec})}const Sc=e=>{const{query:{data:t}}=Ic({select:t=>{return r=t?.data,n=e,r?.find(e=>e.id===n);var r,n}});return t},Ac=e=>void 0!==e?.find(e=>"PLAID"===e.apiName),Nc=e=>{if(dr(e))return!1;const t=e.filter(e=>"PLAID"===e.apiName&&"ACTIVE"===e.status&&!0===e.isSupported);return void 0!==t&&t.length>0&&!t.some(e=>!e.syncTransactions||ur(e.lastApiSyncedDate))};function Pc(e){return e?.filter(e=>"USER_IMPORTED"===e.apiName&&"ACTIVE"===e.status)}const Mc=Rt(null,xt({display:"flex",alignItems:"center",gap:"15px",borderRadius:"md",border:"1px solid {colors.border.layout}",background:"surface.foreground",width:"fit-content"})),Dc=Rt(St["month-picker-left-button"],xt({border:"none",borderRight:"1px solid {colors.border.layout}",borderRightRadius:0,_disabled:{cursor:"default"}})),Rc=Rt(St["month-picker-right-button"],xt({border:"none",borderLeft:"1px solid {colors.border.layout}",borderLeftRadius:0,_disabled:{cursor:"default"}})),Oc=Rt(null,xt({cursor:"default",display:"flex",justifyContent:"center",width:"75px"}));function _c({period:e,setPeriod:t,disableNext:r=!1,disablePrev:n=!1}){const o=zt(e.year,e.month,1),a=ir(o,{abbreviateMonth:!0});return E("div",{...Mc,children:[w(Ki,{stylists:[Dc],onClick:()=>{return t(0===(r=e).month?{month:11,year:r.year-1}:{month:r.month-1,year:r.year});var r},disabled:n,children:w(ga,{Component:la})}),w("div",{...Oc,children:w(eo,{children:a})}),w(Ki,{stylists:[Rc],onClick:()=>{return t(11===(r=e).month?{month:0,year:r.year+1}:{month:r.month+1,year:r.year});var r},disabled:r,children:w(ga,{Component:sa})})]})}const Lc=xt({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",gap:"10px",maxWidth:"1440px"});function Fc({children:e}){return w("div",{className:Lc,children:e})}const Bc=Rt(St["progress-bar"],xt({height:"32px",backgroundColor:"surface.intent.secondary",display:"flex",flexDirection:"row",alignItems:"center",border:"{borderWidths.lg} solid {colors.border.layout.weak}",borderRadius:"sm"})),Wc=Rt(St["progress-bar-fill"],xt({borderRadius:"sm",height:"100%",display:"flex",alignItems:"center"})),Hc=Rt(St["tile-bar-label"],xt({paddingLeft:"10px"}));function Uc({label:e="",percentage:t,color:r,width:n}){const o=void 0===n?"100%":`${n}px`,a=t>=50,i=Bt([Wc,Rt(null,r)]);return E("div",{...Bc,style:{width:o},children:[w("div",{...i,style:{width:`${t}%`},children:a&&w("div",{...Hc,children:w(Ji,{children:e})})}),!a&&w("div",{...Hc,children:w(Ji,{children:e})})]})}const Vc=Rt(St["metric-md"],Wt({metric:"md"}));function zc(e){return w("div",{...Vc,children:e.children})}const jc=Rt(null,xt({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"45px",width:"100%"})),Kc=Rt(null,xt({overflow:"visible",width:"80px",display:"flex",justifyContent:"end"})),$c=({label:e,amount:t,total:r,colorCss:n})=>{const o=r>0?function(e,t,r,n=0,o=100){return n+(e-t)*(o-n)/(r-t)}(t,0,r):0;return E("div",{...jc,children:[w(Uc,{label:e,percentage:o,color:n}),w("div",{...Kc,children:w(zc,{children:Gn(t)})})]})},qc={netIncome:0,income:0,expenses:0,absoluteSum:0},Yc=e=>{if(void 0===e.result||"FAILURE_NO_DATA"===e.result)return qc;const t=e.json?.data?.[0];if(dr(t))return qc;const r=t.income?.total??0,n=t.expenses?.total??0,o=D(r).plus(n).toNumber();return{netIncome:t.netIncome??0,income:r,expenses:n,absoluteSum:o}},Gc=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M13.3131 0.489685V4.15097H9.65182",strokeMiterlimit:10}),c.createElement("path",{d:"M2.32925 15.1348V11.4735H5.99054",strokeMiterlimit:10}),c.createElement("path",{d:"M1.34228 9.57602C1.18256 9.00181 1.10327 8.40823 1.10669 7.81223C1.1074 6.38654 1.56211 4.99811 2.4049 3.8482C3.2477 2.69828 4.4348 1.84664 5.79412 1.41671C7.15345 0.986775 8.61437 1.00089 9.96513 1.45702C11.3159 1.91314 12.4863 2.78757 13.3067 3.95356",strokeMiterlimit:10}),c.createElement("path",{d:"M14.2937 6.04849C14.4534 6.6227 14.5327 7.21628 14.5293 7.81228C14.5286 9.23797 14.0739 10.6264 13.2311 11.7763C12.3883 12.9262 11.2012 13.7779 9.84185 14.2078C8.48253 14.6377 7.02161 14.6236 5.67085 14.1675C4.32008 13.7114 3.14967 12.8369 2.32925 11.671",strokeMiterlimit:10})),"Sync");function Qc({Component:e,stylists:t}){return w(e,{stylists:[Rt(St["medium-icon"]),...t??[]],size:15})}const Xc=Rt(null,Ri,xt({position:"absolute",left:1,right:1,bottom:1,width:"calc(100% - 2)",height:"44px",background:"surface.intent.primary",border:"none",borderRadius:0,gap:9,color:"icon.intent.primary",pointerEvents:"all",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.primary.hover",borderColor:"border.intent.primary.hover","& .Tight-text":{color:"typography.intent.primary.hover"}}}}),ca);function Zc(){const{linkPlaid:e}=hc();return E("button",{onClick:()=>e(),...Xc,children:[w(Qc,{Component:Gc}),w(Ji,{intent:"primary",children:"Link Account"})]})}const Jc=xt({width:266,minHeight:32});function ed(){return w(No,{styles:Jc})}const td=xt({backgroundColor:"money.positive.weak"}),rd=xt({backgroundColor:"money.negative.weak"}),nd=Object.freeze({income:0,expenses:0,netIncome:0,absoluteSum:0}),od=({defaultRange:e=Kt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:r})=>{const{query:{data:n},isFilling:o}=function({filter:e}){return Cn({filter:e,select:Yc})}({filter:e});let a;return a=t?Ho:n??nd,E(Rn,{isSample:t,children:[w(Nn,{title:"Profit + Loss"}),w(Mn,{children:o?E(Mo,{children:[w(ed,{}),w(ed,{})]}):E(C,{children:[w(Vn,{title:Gn(a.netIncome),label:"Profit"}),E(jn,{children:[w($c,{amount:a.income,total:a.absoluteSum,colorCss:td,label:"Income"}),w($c,{amount:a.expenses,total:a.absoluteSum,colorCss:rd,label:"Expenses"})]})]})}),t&&w(Fo,{size:"sm"}),r&&w(Zc,{})]})},ad=({filter:e})=>["reports/cashFlowStatementDirect","reports",{filter:e}],id={moneyIn:0,moneyOut:0,netMoneyIn:0};const ld=async e=>{const t=e.queryKey,r=t[2],n=t[3].accessToken,o=t[3].environment,a={path:"/reports/cashFlowStatementDirect",bodyParams:{exportType:"JSON",...Yt(r.filter)},accessToken:n,endpointManager:xn(o)};return function(e){const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,r=e.json?.data[0];return t||dr(r)||dr(r.operatingActivities)||!r.operatingActivities.children?id:function(e){let t=new D(0),r=new D(0);for(const n of e.children)n.total<0?r=r.plus(D(n.total).abs()):t=t.plus(n.total);return{moneyIn:t.toNumber(),moneyOut:r.toNumber(),netMoneyIn:e.total}}(r.operatingActivities)}(await vn(a))},sd=xt({backgroundColor:"money.positive.weak"}),cd=xt({backgroundColor:"money.negative.weak"}),dd=Object.freeze({moneyIn:0,moneyOut:0,netMoneyIn:0}),ud=({defaultRange:e=Kt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:r})=>{const{query:{data:n,isFetched:o},isFilling:a}=function({filter:e}){return xr({queryKey:ad({filter:e}),queryFn:ld})}({filter:e});let i;i=t?Vo:n??dd;let l=0;return(t||o)&&(l=Math.abs(i.moneyIn)+Math.abs(i.moneyOut)),E(Rn,{isSample:t,children:[w(Nn,{title:"Cash Flow"}),w(Mn,{children:a?E(Mo,{children:[w(ed,{}),w(ed,{})]}):E(C,{children:[w(Vn,{title:Gn(i.netMoneyIn),label:"Change in Cash"}),E(jn,{children:[w($c,{amount:i.moneyIn,total:l,colorCss:sd,label:"Money In"}),w($c,{amount:i.moneyOut,total:l,colorCss:cd,label:"Money Out"})]})]})}),t&&w(Fo,{size:"sm"}),r&&w(Zc,{})]})},hd=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",width:"100%"})),pd=Rt(null,xt({display:"flex",justifyContent:"end"}));function gd({color:e,bulletLabel:t,moneySummary:r}){return E("div",{...hd,children:[w(uo,{color:e,label:t}),w("div",{...pd,children:w(Ji,{children:r})})]})}const md={total:0,children:[]},vd=e=>{const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,r=e.json?.data?.[0];return t||dr(r)||dr(r.expenses)||!r.expenses.children?md:{total:r.expenses.total??0,children:(n=r.expenses.children,n.sort((e,t)=>(t.total??0)-(e.total??0)).slice(0,3).map(e=>({name:e.name??"",total:e.total??0})))};var n},bd=Rt(null,xt({display:"flex",gap:"10px",alignItems:"center"})),fd=xt({width:"200px",height:"16px",backgroundColor:"brand.secondary"}),yd=Rt(null,fd);function Td({bulletAmount:e=3,shimmer:t=!1}){return w(C,{children:Array.from({length:e},(e,r)=>E("div",{...bd,children:[w(uo,{color:io.var("colors.brand.secondary")}),t?w(No,{styles:fd}):w("div",{...yd})]},r))})}const xd=Rt(null,xt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"})),kd=[io.var("colors.brand.primary"),io.var("colors.brand.success"),io.var("colors.brand.action")],wd=Object.freeze({total:0,children:[]});function Cd({defaultRange:e=Kt.THIS_YEAR,monthIndex:t,isSample:r=!1,showLinkAccountButton:n}){const o=Le(e=>e.externalOptions).dataVisualizationColors??kd,{query:{data:a},isFilling:i}=function({filter:e}){return Cn({filter:e,select:vd})}({filter:e});let l;l=r?Uo:a??wd;const s=void 0===t?"Total Expenses":`${Qt[t]} Total`,c=l.children.length>0;return E(Rn,{isSample:r,children:[w(Nn,{title:"Expenses"}),w(Mn,{children:i?w(Mo,{children:w(Td,{shimmer:!0})}):E(C,{children:[w("div",{...xd,children:w(Vn,{title:Gn(l.total),label:s})}),w(jn,{children:c?l.children.map((e,t)=>w(gd,{color:o[t],bulletLabel:e.name,moneySummary:Gn(e.total)},t)):w(Td,{})})]})}),r&&w(Fo,{size:"sm"}),n&&w(Zc,{})]})}const Ed=Rt(null,xt({display:"flex",flexDirection:"column",gap:"10px",maxWidth:"1440px"}));function Id({period:e,handleDateChange:t,todayPeriod:r,showSamples:n,showLinkAccountButton:o}){const a=(i=e.month,{beginDate:zt(l=e.year,i,1),endDate:zt(l,i+1,0)});var i,l,s,c,d,u,h,p;return E("div",{...Ed,children:[E(_t,{children:[w(Ut,{children:"Monthly Review"}),w(_c,{period:e,setPeriod:t,disableNext:n||(s=e,c=r,h=s.month,p=c.month,h===p&&(d=s.year,u=c.year,d===u)),disablePrev:n})]}),E(Fc,{children:[w(od,{defaultRange:a,isSample:n,showLinkAccountButton:o}),w(ud,{defaultRange:a,isSample:n,showLinkAccountButton:o}),w(Cd,{defaultRange:a,monthIndex:e.month,isSample:n,showLinkAccountButton:o})]})]})}const Sd="Oldest to Newest",Ad="Newest to Oldest",Nd="A-Z",Pd="Z-A",Md="Lowest to Highest",Dd="Highest to Lowest",Rd="A-Z",Od="Z-A";const _d=ia(e=>c.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{id:"icon/check"},c.createElement("path",{id:"Vector",d:"M0.986511 5L3.66217 7.67566L9.01349 2.32434",stroke:"white",strokeWidth:1.25,strokeMiterlimit:10}))),"Check"),Ld=xt({width:"15px",height:"15px",borderRadius:"sm",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,margin:0,position:"relative","&::before":{content:"''",position:"absolute",top:"-10px",left:"-10px",right:"-10px",bottom:"-10px"},_supportHover:{"&[data-is-checked='false']":{backgroundColor:"surface.background.hover"}}}),Fd=xt({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",background:"surface.foreground"}),Bd=xt({background:"brand.primary.strong",border:"none"});function Wd({checked:e,onClick:t}){const[r,n]=m(e??!1),o=void 0===e?r:e;return w("button",{...Rt(St["checkbox-input"],Ld,o?Bd:Fd,da),type:"button",onClick:o=>{void 0===e&&n(!r),t&&t(o)},"data-is-checked":o,children:o&&w(bl,{Component:_d})})}const Hd=Rt(null,xt({paddingLeft:"20px",paddingRight:"5px"}));function Ud({checked:e,onClick:t}){return w("div",{...Hd,children:w(Wd,{checked:e,onClick:t})})}const Vd=Rt(St.text,xt({fontSize:"sm",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.66px",maxWidth:"100%"}),On);function zd({children:e}){return w("div",{...Vd,children:e})}const jd=Rt(St["date-cell"],xt({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"}));function Kd({date:e,annotation:t}){return E("div",{...jd,children:[t&&w(zd,{children:t}),w(Ji,{children:e})]})}const $d=xt({color:"money.negative"}),qd=xt({color:"money.positive"});function Yd({transaction:e}){const t=(e=>{let t;switch(e.type){case"EXPENSE":t=(e=>{const t=e.amount>0;let r;return r=t?"Expense Refund":e.children?.length>0?"Split Expense":"Expense",{type:"EXPENSE",displayName:r,css:t?qd:$d}})(e);break;case"REVENUE":t=(e=>{const t=e.amount<0;return{type:"REVENUE",displayName:t?"Income Refund":"Income",css:t?$d:qd}})(e);break;case"BANK_TRANSFER":t=(e=>{let t="Bank Transfer";return e.children?.length>0&&(t="Payout"),{type:"BANK_TRANSFER",displayName:t,css:e.amount<0?$d:qd}})(e);break;case"TAX_PAYMENT":t={type:"TAX_PAYMENT",displayName:"Tax Payment",css:$d};break;case"INVOICE_PAYMENT":t=(e=>{let t="Invoice Payment",r=qd;return e.amount<0&&(t="Invoice Payment Refund",r=$d),{type:"INVOICE_PAYMENT",displayName:t,css:r}})(e)}return t})(e),r=Rt(St["transaction-type-label"],t.css),n=w("span",{...r,children:t.displayName});return w(Kd,{date:e.date,annotation:n})}function Gd({label:e,subLabel:t}){return E(C,{children:[w(eo,{children:e}),w(ro,{children:t})]})}function Qd({bankTransaction:e}){return w(Gd,{label:e.description,subLabel:e.bankAccount?.name})}function Xd(e){return new D(e).div(100).toNumber()}function Zd(e){return new D(e).times(100).toNumber()}function Jd(e){return Qn(Xd(e.amount))}function eu({transaction:e}){return w(Ji,{children:Jd(e)})}const tu=Rt(null,xt({padding:"0 25px",height:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"}));function ru({annotation:e,accountName:t}){return E("div",{...tu,children:[e&&w(ro,{children:e}),t&&w(eo,{children:t})]})}function nu(e,t){return`${e?`#${e}`:""} ${t??""}`.trim()}const ou=Rt(St["cell-button"],xt({border:"none",backgroundColor:"transparent",padding:"0 25px",gap:"10px",margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",flexDirection:"row",flex:1,outline:"none",borderRadius:"md",boxShadow:"0 0 0 0 transparent","&:focus-visible":{transition:"none",position:"relative"},"&:focus-visible::before":{content:"''",position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:"md",outline:"4px solid",outlineColor:"border.layout",pointerEvents:"none"},_supportHover:{backgroundColor:"surface.intent.action.hover"},"&[data-state='open']":{backgroundColor:"surface.intent.action.active"},"& .Tight-text":{position:"relative"},"& .Tight-text::after":{content:"''",position:"absolute",bottom:0,left:0,width:0,height:"1px",backgroundColor:"currentColor",transition:"width 100ms ease-out",_supportHover:{width:"100%",transition:"width 300ms ease-out"}},"&[data-state='open'] > .Tight-text::after":{width:"100%",transition:"width 300ms ease-out"}}),da),au=y(function({children:e,...t},r){return w("button",{ref:r,...ou,...t,children:e})}),iu=h(Object.freeze({map:/* @__PURE__ */new Map,register:()=>{},unregister:()=>{},focusedIndex:null,isMousing:!0,isScrolling:!1,listRef:void 0,popupNodeId:void 0}));function lu(e,t){switch(t.type){case"increment":return((e,t)=>{let r;if(null===e.focusedIndex)r=0;else{const n=e.focusedIndex+1;r=!t.repeat&&n>e.maxIndex?0:Math.min(n,e.maxIndex)}return{...e,focusedIndex:r}})(e,t);case"decrement":return((e,t)=>{let r;if(null===e.focusedIndex)r=e.maxIndex;else{const n=e.focusedIndex-1;r=!t.repeat&&n<0?e.maxIndex:Math.max(n,0)}return{...e,focusedIndex:r}})(e,t);case"set":return{...e,focusedIndex:Math.min(t.focusedIndex,e.maxIndex)};case"max":return{...e,maxIndex:t.max}}}function su(e,t){const r=e.compareDocumentPosition(t);return r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS?1:0}function cu(e,t){const r=t.getBoundingClientRect(),n=e.getBoundingClientRect();return n.top>=r.top&&n.bottom<=r.bottom&&n.left>=r.left&&n.right<=r.right}function du(e,t,r){if(null===e)return{node:void 0,metadata:void 0};const n=t[e];return{node:n,metadata:r.get(n)}}function uu(e){const[t,r]=m(()=>/* @__PURE__ */new Map),{listRef:n,focusedState:o,isMousing:a,isScrolling:i}=function(e,t){const r=d(null),[n,o]=m(!0),[a,i]=m(!1),l=p(iu),[s,c]=T(lu,{focusedIndex:null,maxIndex:e});b(()=>{const e=r.current,t=()=>{null==s.focusedIndex&&void 0!==l?.popupNodeId&&c({type:"set",focusedIndex:0})};return e?.addEventListener("focus",t),()=>{e?.removeEventListener("focus",t)}},[r,s.focusedIndex,c,l?.popupNodeId]);const u=d(null);return b(()=>{c({type:"max",max:e})},[e]),b(()=>{const e=r.current;if(null!==e){const r=e=>{i(!1);const r=e.target instanceof HTMLElement&&e.target.getAttribute("data-listitem");if(!r)return;const n=Number(e.target.getAttribute("data-index"));s.focusedIndex===n&&u.current===e.target||(0!==e.movementX||0!==e.movementY)&&r&&(o(!0),u.current=e.target,c({type:"set",focusedIndex:n}),t.setCascadeState(!0,n))},n=e=>{const t="ArrowDown"===e.key||"Tab"===e.key&&!e.shiftKey,r="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey;o(!1),i(!1),t?(e.preventDefault(),c({type:"increment",repeat:e.repeat})):r&&(e.preventDefault(),c({type:"decrement",repeat:e.repeat}))},a=()=>i(!0);return e.addEventListener("mousemove",r),e.addEventListener("keydown",n),e.addEventListener("scroll",a),()=>{e.removeEventListener("mousemove",r),e.removeEventListener("keydown",n),e.removeEventListener("scroll",a)}}},[t,s.focusedIndex]),{listRef:r,focusedState:s,isMousing:n,isScrolling:a}}(t.size-1,e),l=gl(),s=v((e,t)=>{r(r=>new Map(r).set(e,t??null))},[]),c=v(e=>{r(t=>{const r=new Map(t);return r.delete(e),r})},[]),{sortedNodes:h,sortedMap:g}=function(e,t){const r=u(()=>{let r=[];return null!==t.current&&(r=Array.from(e.keys()).sort(su)),r},[e,t]),n=u(()=>{const t=/* @__PURE__ */new Map;return r.forEach((r,n)=>{const o=e.get(r)??{};t.set(r,{...o,index:n})}),t},[r,e]);return{sortedNodes:r,sortedMap:n}}(t,n);!function(e,t,r,n,o,a){b(()=>{const i=e.current;if(!i)return;const l=e=>{const{node:l,metadata:s}=du(n,t,r),{shouldOpenCascade:c,shouldCloseCascade:d}=function(e,t,r){const n=e.placement.includes("left"),o=e?.popupParentNodeId,a=o&&r?.hasCascading&&n?"ArrowLeft":"ArrowRight",i=n?"ArrowRight":"ArrowLeft";return{shouldOpenCascade:r?.hasCascading&&t.key===a,shouldCloseCascade:o&&t.key===i}}(o,e,s),u=!(e.target instanceof HTMLInputElement&&""!==e.target.value)&&" "===e.key;var h,p,g,m,v;c||"Enter"===e.key||u?(p=n,g=l,m=i,v=a,!(!(h=s)||!h.hasCascading||null===p||g&&m&&cu(g,m)&&(v.setCascadeState(!0,p),v.setFocus(!0),0))||function(e){const t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e?.dispatchEvent(t)}(l),e.preventDefault()):d&&(e.preventDefault(),o.setOpen(!1))};return i.addEventListener("keydown",l),()=>{i.removeEventListener("keydown",l)}},[e,t,n,r,o,a])}(n,h,g,o.focusedIndex,l,e);const{startCallback:f,cancelCallback:y}=Oa({delay:200,callback:({focusedIndex:t,node:r,listElement:n})=>{r&&n&&cu(r,n)?e.setCascadeState(!0,t):e.closeCurrentCascade()}});return x=o.focusedIndex,b(()=>{const e=E.current;if(null===x||k)return;const{node:t,metadata:r}=du(x,w,C);return I.lastOpenedIndex!==x&&r?.hasCascading&&(I.closeCurrentCascade(),S({focusedIndex:x,node:t,listElement:e})),()=>A()},[x,k=a,E=n,I=e,A=y,w=h,C=g,S=f]),function(e,t,r,n){b(()=>{const{metadata:o}=du(e,t,r);null===e||o?.hasCascading||n.closeCurrentCascade()},[n,e,r,t])}(o.focusedIndex,h,g,e),u(()=>({register:s,unregister:c,map:g,focusedIndex:o.focusedIndex,listRef:n,isMousing:a,isScrolling:i,popupNodeId:l?.nodeId}),[s,c,g,o.focusedIndex,n,a,i,l?.nodeId]);var x,k,w,C,E,I,S,A}const hu=h(Object.freeze({cascadeIndex:null,setCascadeState:()=>{},onScroll:()=>{},focus:!1,setFocus:()=>{},lastOpenedIndex:null,closeCurrentCascade:()=>{}}));function pu({style:e,children:t}){const r=Rt(St["popup-list"],cl,e),n=function(){const[e,t]=m(null),[r,n]=m(!1),[o,a]=m(null),i=v((r,o)=>{r&&e!==o?(a(o),t(o)):r||e!==o||(n(!1),t(null))},[e,n]),l=v(()=>{t(null),a(null),n(!1)},[t,a,n]),s=v(()=>{t(null),a(null),n(!1)},[]);return{cascadeIndex:e,setCascadeState:i,onScroll:l,focus:r,setFocus:n,lastOpenedIndex:o,closeCurrentCascade:s}}(),o=uu(n);return w("div",{...r,onScroll:n.onScroll,ref:o.listRef,tabIndex:0,children:w(iu.Provider,{value:o,children:w(hu.Provider,{value:n,children:t})})})}function gu({hasCascading:e=!1}={}){const t=d(null),{register:r,unregister:n,map:o,focusedIndex:a,isMousing:i,listRef:l}=p(iu);x(()=>{const o=t.current;if(o)return r(o,{index:0,hasCascading:e}),()=>{n(o)}},[r,n,e]);const s=u(()=>void 0!==o&&null!==t.current?o.get(t.current)?.index??-1:-1,[o]),c=s===a;x(()=>{c&&(i||t.current?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}))},[c,i]);const h=v(()=>{l?.current?.focus()},[l]),g=u(()=>({onFocus:h,"data-focused":c}),[h,c]);return{itemRef:t,isActive:c,index:s,itemProps:g}}const mu=y(function({onClick:e,index:t,children:r,itemProps:n,popupTriggerProps:o},a){return w("button",{...dl,onClick:e,"data-listitem":!0,"data-index":t,...o,...n,ref:a,children:r})}),vu=y(function({onClick:e,children:t,popupTriggerProps:r},n){const{index:o,itemProps:a,itemRef:i}=gu(),l=se([i,n]);return w(mu,{...dl,onClick:e,index:o,...r,itemProps:a,ref:l,children:t})}),bu=Rt(St.text,Wt({label:"strongLabel"}),xt({maxWidth:"100%"}),On);function fu({children:e,stylists:t=[]}){const r=Bt([bu,...t]);return w("div",{...r,children:e})}function yu({text:e}){return w("div",{...dl,children:e?w(eo,{children:e}):w(No,{styles:xt({width:"100%",height:"16px"})})})}const Tu=Rt(St["popup-list"],cl),xu=()=>E("div",{...Tu,children:[w(yu,{}),w(yu,{}),w(yu,{}),w(yu,{}),w(yu,{})]}),ku=["LIABILITY","EQUITY","INCOME","OTHER_INCOME"];function wu(e,t){return u(()=>e?.filter(e=>t.includes(e.type))??[],[e,t])}const Cu=e=>({id:e.id||"",name:e.name,accountNo:e.accountNo}),Eu=()=>["accounting/glAccounts"],Iu=async e=>{const t=e.queryKey,r={path:"/accounting/glAccounts",params:{leavesOnly:"false"},accessToken:t[1].accessToken,environment:t[1].environment},n=await Ra(r);return Nu(n)};function Su(e){return xr({...e,queryKey:["accounting/glAccounts"],queryFn:Iu})}function Au(){return Su({select:Ru})}const Nu=e=>e.map(e=>({...e,id:xi({id:e.id,prefix:"GL_ACCOUNT"})}));function Pu(e,t){const r=t.get(e.accountNo)??[];return 0===r.length?[{...e,children:[]}]:r.flatMap(e=>Pu(e,t))}const Mu=e=>!e.parentAccountNo;function Du(e){const t=function(e){const t=/* @__PURE__ */new Map;for(const r of e)if(r.parentAccountNo){const e=t.get(r.parentAccountNo)??[];e.push(r),t.set(r.parentAccountNo,e)}return t}(e);return e.filter(Mu).map(e=>({...e,children:Pu(e,t)}))}function Ru(e){return Du(e).flatMap(e=>[e,...e.children])}function Ou(e,t,r){var n;n=t,r.some(({child:e})=>e.accountNo===n.accountNo)||r.push({parent:e,child:t})}const _u=[Rt(null,xt({marginLeft:"6px",marginRight:"6px"}))],Lu=Rt(null,xt({whiteSpace:"normal"})),Fu={keys:[{name:"accountNo",weight:.3},{name:"name",weight:.7}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Bu({types:e,onClick:t,searchTerm:r}){const{query:{data:n},isFilling:o}=Au(),a=wu(n,e),i=u(()=>new me(a,Fu),[a]),l=u(()=>function(e,t){const r=[];return e.forEach(e=>{const n=e.item,o=(a=n,t.find(e=>e.children.some(e=>e.accountNo===a.accountNo)));var a;!o&&n.children.length>0?function(e,t){e.children.forEach(r=>{Ou(e,r,t)})}(n,r):o&&Ou(o,n,r)}),r}(i.search(r),a),[a,r,i]);return o?w(xu,{}):l.map(({parent:e,child:r})=>w(vu,{onClick:()=>t(r),children:E(fu,{stylists:[Lu],children:[nu(e.accountNo,e.name),w(ga,{Component:sa,stylists:_u}),nu(r.accountNo,r.name)]})},`${r.accountNo}`))}const Wu=y(function({index:e,popupTriggerProps:t,children:r,itemProps:n},o){const a=se([o,t?.ref]);return w(mu,{index:e,ref:a,itemProps:n,popupTriggerProps:t,children:r})});function Hu({triggerChildren:e,popupChildren:t}){const{cascadeIndex:r,setCascadeState:n,focus:o}=p(hu),{itemRef:a,index:i,itemProps:l}=gu({hasCascading:!0}),{isScrolling:s}=p(iu);return E(pl,{open:r===i,onOpenChange:e=>{s||n(e,i)},placement:"right-start",children:[w(ml,{children:t=>w(Wu,{itemProps:l,index:i,ref:a,popupTriggerProps:t,children:e})}),w(El,{initialFocus:o,children:t})]})}const Uu=Rt(null,xt({display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}));function Vu({icon:e,displayLabel:t}){return E("div",{...Uu,children:[e,w(eo,{wrap:"wrap",children:t}),w(ga,{Component:sa})]})}function zu({types:e,onClick:t}){const{query:{data:r,isFetching:n},isFilling:o}=Su({select:Du}),a=wu(r,e);return o?w(xu,{}):o||n||void 0!==r?a.map(e=>{const r=nu(e.accountNo,e.name);return w(Hu,{triggerChildren:w(Vu,{displayLabel:r}),popupChildren:w(ju,{glAccount:e,onClick:t})},e.accountNo)}):w(yu,{text:"No data"})}function ju({glAccount:e,onClick:t}){return w(pu,{children:e.children.map(e=>w(vu,{onClick:()=>t(e),children:w(eo,{children:nu(e.accountNo,e.name)})},e.accountNo))})}const Ku=Rt(null,xt({display:"flex",alignItems:"center",padding:"10px",flex:1,border:"none",outline:"none",background:"transparent",fontSize:"sm",fontWeight:"sm","&::placeholder":{color:"typography.base.weak"}}));function $u({searchTerm:e,setSearchTerm:t,placeholder:r}){const n=d(null);return b(()=>{n.current?.focus({preventScroll:!0});const e=e=>{!n.current||document.activeElement===n.current||(1!==e.key.length||e.ctrlKey||e.altKey||e.metaKey)&&"Backspace"!==e.key||n.current.focus()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),w("input",{ref:n,type:"text",placeholder:r,value:e,onChange:e=>t(e.target.value),...Ku})}function qu({onClick:e,types:t}){const r=gl(),[n,o]=m(""),a=pr(n)?xt({maxWidth:"420px",width:"fit-content"}):void 0,i=t=>{e(t),r?.setOpen(!1)};return w(El,{children:E(pu,{style:a,children:[w($u,{searchTerm:n,setSearchTerm:o,placeholder:"Search revenue accounts..."}),pr(n)?w(Bu,{types:t,onClick:i,searchTerm:n}):w(zu,{types:t,onClick:i})]})})}const Yu=async({data:e,accessToken:t,environment:r})=>Qu({data:{data:e},accessToken:t,environment:r}),Gu=async({data:e,accessToken:t,environment:r})=>Yu({data:[e],accessToken:t,environment:r}),Qu=async({data:e,accessToken:t,environment:r})=>{const n={path:"/v6/banks/transactions",bodyParams:e,accessToken:t,endpointManager:ea(r)};return await mn(n)};function Xu(){return Vs({onSuccess:async()=>{const e=["banks/transactions"];return nn("mutation successful, invalidating BT queries"),fr.invalidateQueries({queryKey:e}).catch(e=>on({error:e,severity:"error"}))},mutationFn:Yu})}function Zu(){return Vs({onSuccess:async()=>(nn("mutation successful, invalidating BT queries"),fr.invalidateQueries({predicate:e=>e.queryKey.includes("tasks")||e.queryKey.includes("banks/transactions")||e.queryKey.includes("reports")}).catch(e=>on({error:e,severity:"error"}))),mutationFn:Gu})}function Ju({transaction:e,parentTransaction:t,accountNo:r,accountName:n}){const{startPrefetch:o,cancelPrefetch:a}=_a({prefetchFn:Ia(Eu,Iu)}),{mutate:i}=Zu(),l=void 0!==t;return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>w(au,{...e,onMouseEnter:o,onMouseLeave:a,children:w(eo,{children:nu(r,n)})})}),w(qu,{onClick:l?r=>{if(r?.id&&l){const{id:n,children:o}=t,{id:a}=e,l=o.map(e=>e.id===a?{...e,glAccountId:r.id.toString()}:e);i({id:n,children:l})}}:t=>{i({id:e.id,glAccountId:t.id})},types:ku})]})}const eh=()=>["expenses/categories"],th=async e=>{const t=e.queryKey,r={path:"/expenses/categories",accessToken:t[1].accessToken,environment:t[1].environment},n=await Ra(r);return{...n,data:n.data?(o=n.data,o.map(e=>({...e,id:xi({id:e.id,prefix:"TRANSACTION_CATEGORY"}),parentCategoryId:e.parentCategoryId?xi({id:e.parentCategoryId,prefix:"TRANSACTION_CATEGORY"}):void 0}))):void 0};var o};function rh(e){return xr({...e,queryKey:["expenses/categories"],queryFn:th})}function nh(e){const t=/* @__PURE__ */new Map;for(const r of e)if(r.parentCategoryId){const e=t.get(r.parentCategoryId)??[];e.push(r),t.set(r.parentCategoryId,e)}return t}function oh(e){if(0===e.length)return[];const t=nh(e);return e.map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function ah(e){if(0===e.length)return[];const t=nh(e);return e.filter(e=>!e.parentCategoryId).map(e=>({...e,children:e.id?t.get(e.id):void 0}))}const ih=e=>({id:e.id,name:e.name});function lh(e,t,r){var n;n=t,r.some(e=>e.child.id===n.id)||r.push({parent:e,child:t})}const sh=Rt(null,xt({whiteSpace:"normal"})),ch=[Rt(null,xt({marginLeft:"6px",marginRight:"6px"}))],dh={keys:[{name:"name"}],threshold:.2,includeScore:!0,minMatchCharLength:1};function uh({searchTerm:e,onClick:t}){const{query:{data:r,isFetched:n},isFilling:o}=rh({select:e=>({...e,data:e.data?oh(e.data):void 0})}),a=r?.data,i=!o&&n&&(void 0===a||0===a.length),l=u(()=>new me(a??[],dh),[a]),s=u(()=>a?function(e,t){const r=[];return e.forEach(e=>{const n=e.item,o=(l=n,t.find(e=>e.children?.some(e=>e.id===l.id))),a=!(o||0!==n?.children?.length&&n.children),i=!o&&n.children&&n.children.length>0;var l;o?lh(o,n,r):a?lh(n,n,r):i&&function(e,t){e.children&&e.children.forEach(r=>{lh(e,r,t)})}(n,r)}),r}(l.search(e),a):[],[a,e,l]);return o?w(xu,{}):i?w(yu,{text:"No data"}):0===s.length?w(yu,{text:"No results found"}):w(C,{children:s.map(({parent:e,child:r})=>{const n=e.id===r.id;return w(vu,{onClick:()=>t(ih(r)),children:w(fu,{stylists:[sh],children:n?r.name:E(C,{children:[e.name,w(ga,{Component:sa,stylists:ch}),r.name]})})},`${e.id}_${r.id}`)})})}function hh({category:e,handleCategoryChange:t}){return w(pu,{children:e.children?.map(e=>w(vu,{onClick:()=>t(ih(e)),children:w(eo,{wrap:"wrap",children:e.name})},e.id))})}function ph({onClick:e}){const{query:{data:t,isFetched:r},isFilling:n}=rh({select:e=>({...e,data:e.data?ah(e.data):void 0})}),o=t?.data,a=!n&&r&&void 0===o;return n?w(xu,{}):a?w(yu,{text:"No data"}):w(C,{children:o?.map(t=>t.hasChilds?w(Hu,{triggerChildren:w(Vu,{displayLabel:t.name}),popupChildren:w(hh,{category:t,handleCategoryChange:e})},t.id):w(vu,{onClick:()=>e(ih(t)),children:w(eo,{wrap:"wrap",children:t.name})},t?.id))})}const gh=({onClick:e})=>{const t=gl(),[r,n]=m(""),o=r=>{void 0!==e&&e(r),t.setOpen(!1)};return w(El,{children:E(pu,{children:[w($u,{searchTerm:r,setSearchTerm:n,placeholder:"Search expense categories..."}),pr(r)?w(uh,{searchTerm:r,onClick:o}):w(ph,{onClick:o})]})})},mh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M12.6809 12.4781H12.0645L6.49121 9.38327V4.42636L12.0645 1.33154H12.6809V12.4781Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M4.01263 4.42627H6.49108V9.38317H4.01263C3.35531 9.38317 2.7249 9.12205 2.2601 8.65725C1.7953 8.19245 1.53418 7.56205 1.53418 6.90472C1.53418 6.2474 1.7953 5.61699 2.2601 5.15219C2.7249 4.68739 3.35531 4.42627 4.01263 4.42627Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M4.0127 9.3833H6.49115L7.72389 14.9566H5.25192L4.0127 9.3833Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.6807 5.66553H13.9199C14.2486 5.66553 14.5638 5.79609 14.7962 6.02849C15.0286 6.26089 15.1591 6.57609 15.1591 6.90475C15.1591 7.06749 15.1271 7.22864 15.0648 7.37898C15.0025 7.52933 14.9112 7.66595 14.7962 7.78102C14.6811 7.89609 14.5445 7.98737 14.3941 8.04965C14.2438 8.11193 14.0826 8.14398 13.9199 8.14398H12.6807V5.66553Z",stroke:"#182428",strokeMiterlimit:10})),"Advertising"),vh=ia(e=>c.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M7.84644 15.0764C11.6751 15.0764 14.7788 11.9727 14.7788 8.14405C14.7788 4.3154 11.6751 1.21167 7.84644 1.21167C4.0178 1.21167 0.914062 4.3154 0.914062 8.14405C0.914062 11.9727 4.0178 15.0764 7.84644 15.0764Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M7.79217 9.6784V8.95116C7.79192 8.79114 7.82335 8.63265 7.88467 8.48484C7.94598 8.33703 8.03596 8.20282 8.14941 8.08996L8.65337 7.586C8.88132 7.35726 9.00972 7.04774 9.01061 6.7248V6.61636C9.00892 6.29431 8.8798 5.98603 8.65149 5.75891C8.42317 5.53179 8.11422 5.40429 7.79217 5.4043C7.47012 5.40429 7.16117 5.53179 6.93285 5.75891C6.70453 5.98603 6.57542 6.29431 6.57373 6.61636",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M7.18604 10.8838H8.39809",stroke:"#182428",strokeMiterlimit:10})),"Uncategorized"),bh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M7.71472 0.800293V4.79785C7.71535 5.25195 7.58889 5.69716 7.34964 6.08313C7.11039 6.46909 6.7679 6.78039 6.36091 6.98182C6.02094 7.15207 5.64596 7.24072 5.26574 7.24072C4.88552 7.24072 4.51053 7.15207 4.17056 6.98182C3.76928 6.77569 3.43283 6.4626 3.19841 6.07716C2.964 5.69173 2.84075 5.24897 2.8423 4.79785V0.800293",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M5.29443 0.800293V15.4878",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M10.1861 15.4879V1.43896C10.668 1.43896 11.1451 1.53399 11.5903 1.71859C12.0354 1.9032 12.4398 2.17377 12.7802 2.51482C13.1207 2.85587 13.3905 3.2607 13.5744 3.70616C13.7582 4.15161 13.8524 4.62894 13.8516 5.11084V8.78271L10.1797 10.6155",stroke:"#182428",strokeMiterlimit:10})),"Meals"),fh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M14.9092 4.60259V6.39635H1.78418V4.60259L8.34669 1.62134L14.9092 4.60259Z",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M14.9092 12.3589H1.78418V14.7464H14.9092V12.3589Z",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M2.97803 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M6.55908 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M10.1343 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M13.7153 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"})),"Bank"),yh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M13.7665 10.8572H2.9268C2.60718 10.8572 2.30065 10.7302 2.07465 10.5042C1.84865 10.2782 1.72168 9.9717 1.72168 9.65208V4.97673C1.72168 4.87842 1.74114 4.78109 1.77895 4.69035C1.81676 4.5996 1.87217 4.51725 1.94197 4.44803C2.01178 4.37881 2.0946 4.3241 2.18566 4.28706C2.27672 4.25001 2.37421 4.23137 2.47251 4.2322C2.598 4.23423 2.7211 4.2669 2.83107 4.32739C2.94104 4.38787 3.03455 4.47433 3.10346 4.57923C4.03096 5.93577 7.14155 5.34899 7.14155 4.2322L13.3312 7.08411C13.8209 7.31135 14.2355 7.67379 14.5261 8.12874C14.8167 8.5837 14.9713 9.11222 14.9717 9.65208C14.9717 9.9717 14.8447 10.2782 14.6187 10.5042C14.3927 10.7302 14.0862 10.8572 13.7665 10.8572Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M14.9717 9.6521V10.8572C14.97 11.4954 14.7153 12.1068 14.2635 12.5574C13.8117 13.0081 13.1996 13.2611 12.5614 13.2611H2.92681C2.76832 13.262 2.61124 13.2314 2.46465 13.1711C2.31806 13.1108 2.18487 13.0221 2.0728 12.91C1.96073 12.798 1.87199 12.6648 1.81173 12.5182C1.75146 12.3716 1.72086 12.2145 1.7217 12.056V9.6521",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M6.54199 3.0271L7.1414 4.23222",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.34668 7.24174L9.5518 5.43091",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M10.1514 8.44706L11.3565 6.63623",stroke:"#182428",strokeMiterlimit:10})),"Sports"),Th=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M2.64551 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M14.6148 10.5042H2.07861V13.3517H14.6148V10.5042Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M5.07515 7.62671H11.6417C12.2861 7.62671 12.9041 7.88269 13.3598 8.33833C13.8154 8.79398 14.0714 9.41197 14.0714 10.0563V10.4742H2.64551V10.0563C2.64551 9.41197 2.90149 8.79398 3.35713 8.33833C3.81278 7.88269 4.43077 7.62671 5.07515 7.62671Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M5.49942 5.37623H6.63962C6.86383 5.37623 7.08584 5.42039 7.29298 5.50619C7.50012 5.59199 7.68833 5.71775 7.84687 5.87629C8.00541 6.03483 8.13117 6.22304 8.21697 6.43018C8.30277 6.63733 8.34693 6.85934 8.34693 7.08355V7.68051H3.78613V7.08355C3.78613 6.85884 3.83049 6.63633 3.91666 6.4288C4.00284 6.22127 4.12913 6.03279 4.2883 5.87418C4.44747 5.71556 4.63639 5.58992 4.84422 5.50448C5.05205 5.41903 5.27471 5.37545 5.49942 5.37623Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M10.054 5.37622H11.1942C11.647 5.37622 12.0813 5.5561 12.4014 5.87628C12.7216 6.19647 12.9015 6.63073 12.9015 7.08354V7.6805H8.34668V7.08354C8.34668 6.63073 8.52656 6.19647 8.84674 5.87628C9.16692 5.5561 9.60119 5.37622 10.054 5.37622Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9018 3.0957H3.78613V7.6565H12.9018V3.0957Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M14.0479 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M3.78613 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9077 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10})),"Bedding"),xh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M3.58312 11.8285C3.40778 11.6564 3.29681 11.4294 3.26874 11.1854C3.24068 10.9414 3.29723 10.6951 3.42894 10.4878L6.01648 6.34502L10.8698 1.4917C11.2763 1.0884 11.8256 0.861929 12.3982 0.861572C12.6808 0.861572 12.9606 0.917231 13.2217 1.02537C13.4827 1.13351 13.7199 1.29201 13.9198 1.49183C14.1196 1.69164 14.2781 1.92885 14.3862 2.18992C14.4944 2.451 14.55 2.73081 14.55 3.01339C14.5497 3.586 14.3232 4.1353 13.9199 4.54178L9.06657 9.3951L4.92381 11.9826C4.71647 12.1144 4.47021 12.1709 4.22618 12.1428C3.98215 12.1148 3.75515 12.0038 3.58312 11.8285Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.1101 6.34497L9.67676 8.78504L12.7201 14.2685L14.5502 13.0485L12.1101 6.34497Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M9.06658 3.30164L6.62651 5.735L1.14307 2.69162L2.3631 0.861572L9.06658 3.30164Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M4.49481 8.78516H1.75308L1.14307 10.6152L3.58313 11.8285L4.80317 14.2686L6.62651 13.6586V10.9169",stroke:"#182428",strokeMiterlimit:10})),"Airplane"),kh=ia(e=>c.createElement("svg",{width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M8.58591 0.969731H4.86823C4.67602 0.970222 4.4865 1.01495 4.31436 1.10046C4.14222 1.18597 3.99207 1.30996 3.87555 1.46283L2.38978 3.44818L0.53418 4.06455V8.3986H2.38978C2.38978 8.06994 2.52034 7.75473 2.75274 7.52233C2.98514 7.28993 3.30034 7.15937 3.629 7.15937C3.95766 7.15937 4.27287 7.28993 4.50527 7.52233C4.73767 7.75473 4.86823 8.06994 4.86823 8.3986H9.20228C9.20228 8.06994 9.33284 7.75473 9.56524 7.52233C9.79764 7.28993 10.1128 7.15937 10.4415 7.15937C10.7702 7.15937 11.0854 7.28993 11.3178 7.52233C11.5502 7.75473 11.6807 8.06994 11.6807 8.3986H14.1592V5.52437C14.1588 5.27713 14.0844 5.03565 13.9457 4.831C13.8069 4.62636 13.6101 4.46789 13.3806 4.37598L11.0644 3.44818L9.57858 1.46283C9.46275 1.30922 9.31275 1.18469 9.14045 1.09911C8.96815 1.01352 8.77829 0.969227 8.58591 0.969731Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M10.4414 9.63788C11.1258 9.63788 11.6806 9.08306 11.6806 8.39865C11.6806 7.71424 11.1258 7.15942 10.4414 7.15942C9.75697 7.15942 9.20215 7.71424 9.20215 8.39865C9.20215 9.08306 9.75697 9.63788 10.4414 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M3.62887 9.63788C4.31328 9.63788 4.8681 9.08306 4.8681 8.39865C4.8681 7.71424 4.31328 7.15942 3.62887 7.15942C2.94447 7.15942 2.38965 7.71424 2.38965 8.39865C2.38965 9.08306 2.94447 9.63788 3.62887 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.6021 4.06445H4.25195",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9199 6.54297H14.1591",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M7.34668 2.20898V4.06458",stroke:"#182428",strokeMiterlimit:10})),"Vehicle");function wh(e){switch(e){case"Advertising":case"Advertising and Marketing":return mh;case"Bank Fees":case"Bank Charges & Fees":case"College Loans":case"Merchant Processing Fees":return fh;case"Health & Fitness":case"Sports":case"Sporting Goods":return yh;case"Linen/Key Service":case"Linens (sheets, towels, etc.)":case"Hotel":case"Hotels":return Th;case"Plane / Train / Bus":case"Airlines":case"Airfare":return xh;case"Vehicle":case"Taxi":case"Rental Car":case"Rental Cars":case"Car Payment":case"Auto Insurance":case"Other Vehicle Expenses":case"Parking and Tolls":case"Parking & Tolls":case"Transportation (Taxi, Rideshare, Train)":return kh;case"Meals & Entertainment":case"Meals":case"Business Meals":case"Food & Dining":case"Groceries":case"Restaurants":case"Other Food & Dining":case"Lead Gen - Meals":case"PAX Food & Drink":return bh;default:return vh}}function Ch({transaction:e,parentTransaction:t}){const{startPrefetch:r,cancelPrefetch:n}=_a({prefetchFn:Ia(eh,th)}),o=e.category?.name??"Uncategorized",{mutate:a}=Zu(),i=void 0!==t;return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>E(au,{...e,onMouseEnter:r,onMouseLeave:n,children:[w(Qc,{Component:wh(o)}),w(eo,{children:o})]})}),w(gh,{onClick:i?r=>{if(r?.id&&i){const{id:n,children:o}=t,{id:i}=e,l=o.map(e=>e.id===i?{...e,categoryId:r.id.toString()}:e);a({id:n,children:l})}}:t=>{t?.id&&a({id:e.id,categoryId:t.id.toString()})}})]})}const Eh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M4.31676 1.37476L1.67926 4.01226L4.31676 6.64976",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.2292 6.64976L14.8667 4.01226L12.2292 1.37476",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.27301 14.5623V7.96852C8.27301 6.91926 7.85619 5.91297 7.11425 5.17103C6.37231 4.42909 5.36602 4.01227 4.31676 4.01227H1.67926",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.27301 14.5623V7.96852C8.27301 6.91926 8.68983 5.91297 9.43177 5.17103C10.1737 4.42909 11.18 4.01227 12.2293 4.01227H14.8668",stroke:"#182428",strokeMiterlimit:10})),"Split"),Ih=Rt(null,xt({flexDirection:"column",textAlign:"start",width:"100%",overflow:"hidden"})),Sh=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",width:"100%",gap:"10px"}));function Ah({transaction:e}){const t=e.children.map(e=>e?.category?.name).filter(e=>void 0!==e),r=new Set(t),n=[...r].join(", "),o=dc("Category","Categories",r.size,!0);return w(ol,{children:E("div",{...Sh,children:[w(Qc,{Component:Eh}),E("div",{...Ih,children:[w(eo,{children:o}),w(ro,{children:n})]})]})})}function Nh({transaction:e,parentTransaction:t}){return e.children?.length>0?w(Ah,{transaction:e}):w(Ch,{transaction:e,parentTransaction:t})}function Ph(e){const t=Math.max(4-e.length,0);return`*${e+"*".repeat(t)}`}function Mh(e,t){return t?e?`${e} ${Ph(t)}`:t?Ph(t):"":e??""}const Dh=e=>e>0?"Deposited to":"Withdrawn from",Rh=e=>Number(e.split("_")[1]),Oh=e=>({id:Rh(e.id),apiAccountName:e.apiAccountName,apiAccountNo:e.apiAccountNo,apiAccountType:e.apiAccountType,duplicateBankAccountIds:[]});function _h({transaction:e,parentTransaction:t}){switch(e.type){case"EXPENSE":return w(Nh,{transaction:e,parentTransaction:t});case"BANK_TRANSFER":return w(ru,{annotation:Dh(e.amount),accountName:e.bankAccount?.name});default:return w(Ju,{transaction:e,parentTransaction:t,accountNo:e.glAccount?.accountNo,accountName:e.glAccount?.name})}}function Lh({name:e}){return w(C,{children:e&&w(Ji,{children:e})})}const Fh="USER_REVIEW_REQUIRED",Bh="ACCOUNTANT_REVIEW_REQUIRED",Wh=ia(e=>c.createElement("svg",{width:13,height:15,viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M0.743464 14.9687V0.96875H11.6465L9.22218 4.59886L11.6465 8.24166H0.743464",stroke:"#182428",strokeMiterlimit:10})),"Flag"),Hh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M8.54708 2.09833H8.37602C8.21004 2.09808 8.04676 2.14026 7.90167 2.22087C7.75657 2.30147 7.6345 2.41783 7.54702 2.55888L1.70458 11.9081C1.60602 12.0636 1.55355 12.2438 1.55325 12.4279C1.55324 12.5569 1.57886 12.6846 1.62861 12.8036C1.67837 12.9226 1.75127 13.0305 1.84309 13.1211C1.93491 13.2117 2.04381 13.2832 2.16348 13.3313C2.28314 13.3795 2.41118 13.4034 2.54015 13.4016H14.3829C14.6412 13.4016 14.8889 13.299 15.0715 13.1164C15.2541 12.9338 15.3567 12.6861 15.3567 12.4279C15.3564 12.2438 15.3039 12.0636 15.2054 11.9081L9.37608 2.55888C9.2886 2.41783 9.16652 2.30147 9.02143 2.22087C8.87634 2.14026 8.71306 2.09808 8.54708 2.09833Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.46158 5.23663V9.00659",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.46158 10.2632V11.5199",stroke:"#182428",strokeMiterlimit:10})),"Attention"),Uh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M8.32497 15.1744C12.1492 15.1744 15.2494 12.0742 15.2494 8.24998C15.2494 4.42573 12.1492 1.32556 8.32497 1.32556C4.50071 1.32556 1.40054 4.42573 1.40054 8.24998C1.40054 12.0742 4.50071 15.1744 8.32497 15.1744Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M4.54623 8.25001L7.06541 10.7692L12.1037 5.73083",stroke:"#182428",strokeMiterlimit:10})),"CircleCheck"),Vh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M7.81985 0.464722V3.49919",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M7.81985 12.0008V15.0353",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M15.1051 7.75H12.0706",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M3.56907 7.75H0.534607",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9702 2.59967L10.8227 4.74724",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M4.81706 10.7528L2.66949 12.9004",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9702 12.9004L10.8227 10.7528",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M4.81706 4.74724L2.66949 2.59967",stroke:"black",strokeMiterlimit:10})),"Processing"),zh=xt({maxWidth:"100%",width:"fit-content",display:"inline-flex",padding:"4px 5px",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background",cursor:"pointer","&:focus":{outline:"none"},"&[data-state='closed']":{},"& .Tight-sub-label":{color:"typography.base"},"& .Tight-medium-icon > path":{stroke:"icon.base"}}),jh=xt({background:"surface.intent.secondary",border:"{borderWidths.sm} solid",borderColor:"border.intent.secondary","& .Tight-sub-label":{color:"typography.intent.secondary"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary"},_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary.hover"}}}),Kh=xt({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.action",background:"surface.intent.action","& .Tight-sub-label":{color:"typography.intent.action"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action"},_supportHover:{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action.hover"}}}),$h=xt({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.success",background:"surface.intent.success","& .Tight-sub-label":{color:"typography.intent.success"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success"},_supportHover:{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success.hover"}}}),qh=xt({background:"surface.intent.warning",border:"{borderWidths.sm} solid",borderColor:"border.intent.warning","& .Tight-sub-label":{color:"typography.intent.warning"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning"},_supportHover:{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning.hover"}}}),Yh=xt({background:"surface.intent.danger",border:"{borderWidths.sm} solid",borderColor:"border.intent.danger","& .Tight-sub-label":{color:"typography.intent.danger"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger"},_supportHover:{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger.hover"}}}),Gh=Rt(St.badge,zh),Qh=Rt(null,Ln),Xh=Rt(null,da),Zh=Rt(St["neutral-badge"],jh),Jh=Rt(St["highlight-badge"],Kh),ep=Rt(St["success-badge"],$h),tp=Rt(St["warning-badge"],qh),rp=Rt(St["critical-badge"],Yh);function np({type:e,children:t,onClick:r,popupTriggerProps:n}){let o;switch(e){case"critical":o=rp;break;case"warning":o=tp;break;case"neutral":o=Zh;break;case"success":o=ep;break;case"highlight":o=Jh}const a=Bt([Gh,Qh,o,Xh]);return w("button",{...a,onClick:r,...n,children:t})}const op=[{status:"USER_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Flag to Accountant"},{status:"RECONCILED",displayName:"Reconciled"}],ap=[{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"RECONCILIATION_DISCREPANCY",displayName:"Discrepancy"},{status:"USER_REVIEW_REQUIRED",displayName:"Flag to User"},{status:"RECONCILED",displayName:"Reconciled"}];function ip({onClick:e}){const t=gl(),{userRole:r}=p(Hl),n=(e=>{switch(e){case"OWNER":default:return op;case"ACCOUNTANT":return ap}})(r)||[];return w(El,{children:w(pu,{children:n.map(({status:r,displayName:n})=>w(vu,{onClick:()=>(e(r),void t.setOpen(!1)),children:n},r))})})}function lp({status:e,transactionId:t}){const[r,n]=m(!1),{mutate:o}=Zu(),a=()=>{n(!1)},i=()=>{n(!r)},{userRole:l}=p(Hl),{text:s,type:c,Icon:d}=((e,t)=>{const r=((e,t)=>{switch(t){case"ACCOUNTANT":return e===Bh;case"OWNER":return e===Fh}})(e,t),n=/* @__PURE__ */((e,t)=>"OWNER"===t&&e===Bh)(e,t),o=/* @__PURE__ */((e,t)=>"ACCOUNTANT"===t&&e===Fh)(e,t),a=/* @__PURE__ */(e=>"RECONCILIATION_DISCREPANCY"===e)(e),i=/* @__PURE__ */(e=>"RECONCILED"===e)(e);let l,s,c;return n?(l="Pending Review",s=w(Qc,{Component:Vh}),c="neutral"):o?(l="Pending User Review",s=w(Qc,{Component:Vh}),c="neutral"):r?(l="Needs Review",s=w(Qc,{Component:Wh}),c="warning"):a?(l="Discrepancy",s=w(Qc,{Component:Hh}),c="critical"):i?(l="Reconciled",s=w(Qc,{Component:Uh}),c="success"):(l="Processing",s=w(Qc,{Component:Vh}),c="neutral"),{text:l,type:c,Icon:s}})(e,l);return!t||((u=t).startsWith(yi.TRANSACTION_LINE_ITEM)||u.startsWith(yi.PROCESSOR_TRANSACTION))?null:E(pl,{open:r,blockInteraction:!1,onOpenChange:a,enableClickMiddleware:!1,children:[w(ml,{children:e=>E(np,{type:c,popupTriggerProps:e,onClick:i,children:[d,w(ro,{children:s})]})}),w(ip,{onClick:e=>{o({id:t,reviewStatus:e}),a()}})]});var u}function sp({status:e,transactionId:t}){return w(lp,{status:e,transactionId:t},t)}const cp=ia(e=>c.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_9779_2940)"},c.createElement("path",{d:"M11.9147 7.99997L6.31472 2.39996L0.714716 7.99997",stroke:"#182428",strokeMiterlimit:10})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_9779_2940"},c.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowUp"),dp=ia(e=>c.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_9779_2922)"},c.createElement("path",{d:"M0.714706 3.99996L6.31472 9.59998L11.9147 3.99996",stroke:"#182428",strokeMiterlimit:10})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_9779_2922"},c.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowDown");function up({row:e}){const t=e.getIsExpanded();return e.getCanExpand()?w(Rl,{"aria-label":t?"Collapse row":"Expand row","aria-expanded":t,children:w(ga,{Component:t?cp:dp})}):w(Rl,{active:!1,children:w(ga,{Component:sa})})}function hp({row:e}){return w(up,{row:e})}const pp=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M0.495239 8.15601H14.7767",strokeMiterlimit:10})),"Dash"),gp=Rt(null,xt({stroke:"icon.base.weak"}));function mp({hasConversation:e,hasUnread:t=!1}){return w(C,{children:e?w(ws,{hasUnread:t}):w("div",{"data-testid":"no-conversations-dash",children:w(bl,{Component:pp,stylists:[gp]})})})}function vp({conversationId:e}){const{query:{data:t}}=za(e??null),{startPrefetch:r,cancelPrefetch:n}=Ka(),{startPrefetch:o,cancelPrefetch:a}=Ii(),i=ur(t),l=i&&"READ"==t?.readStatus,s=v(()=>{ur(e)&&(r({id:e}),o({id:e}))},[e,r,o]),c=v(()=>{ur(e)&&(n(),a())},[e,n,a]);return w("div",{onMouseEnter:s,onMouseLeave:c,children:w(mp,{hasConversation:i,hasUnread:!l})})}const bp=j(),fp=[bp.display({id:Fe.SELECT,header:()=>null,cell:({row:e})=>void 0===e.getParentRow()?w(Ud,{checked:e.getIsSelected(),onClick:e.getToggleSelectedHandler()},e.original.id):null,maxSize:35,meta:{clickable:!0}}),bp.accessor("date",{id:Fe.DATE,cell:e=>w(ol,{children:w(Yd,{transaction:e.row.original})}),header:()=>w(Fl,{columnName:"Date",sortDef:"DATE",sortAscDisplay:Sd,sortDescDisplay:Ad}),size:130,maxSize:144}),bp.accessor("description",{id:Fe.DESCRIPTION,cell:e=>w(ol,{children:w(Qd,{bankTransaction:e.row.original})}),header:()=>w(Fl,{columnName:"Source",sortDef:"DESCRIPTION",sortAscDisplay:Nd,sortDescDisplay:Pd}),size:180}),bp.accessor("amount",{id:Fe.AMOUNT,cell:e=>w(ol,{children:w(eu,{transaction:e.row.original})}),header:()=>w(Fl,{columnName:"Amount",sortDef:"AMOUNT",sortAscDisplay:Md,sortDescDisplay:Dd}),size:130,maxSize:180}),bp.accessor("category.id",{id:Fe.CATEGORY,cell:({row:e})=>w(_h,{transaction:e.original,parentTransaction:e.getParentRow()?.original}),header:()=>w(Fl,{columnName:"Category"}),size:130,meta:{clickable:!0}}),bp.accessor(e=>e.classSegments[0]?.id,{id:Fe.CLASS_SEGMENT,cell:e=>w(ol,{children:w(Lh,{name:e.row.original.classSegments[0]?.name})}),header:()=>w(Fl,{columnName:"Business"}),size:130}),bp.accessor("reviewStatus",{id:Fe.REVIEW_STATUS,cell:e=>w(ol,{children:w(sp,{status:e.getValue(),transactionId:e.row.original.id})}),header:()=>w(Fl,{columnName:"Reviewed",sortDef:"REVIEW_STATUS",sortAscDisplay:Rd,sortDescDisplay:Od}),size:130,maxSize:160,meta:{clickable:!0}}),bp.display({id:Fe.COMMENTS,cell:e=>{const t=e.row.original;return w(ol,{alignVariant:"center",children:w(vp,{conversationId:t.conversation?.id})})},header:()=>w(Fl,{columnName:"Comments"}),size:110,maxSize:110,meta:{clickable:!0}}),bp.display({id:Fe.EXPAND,cell:e=>w(hp,{row:e.row}),size:40,maxSize:60})];function yp(e){return e?fp.filter(t=>e.includes(t.id)):fp}function Tp(e){if(e)return Object.values(Fe).reduce((t,r)=>(t[r]=e.includes(r),t),{})}const xp=[],kp=[Fe.COMMENTS,Fe.DATE,Fe.DESCRIPTION,Fe.AMOUNT,Fe.CATEGORY,Fe.REVIEW_STATUS];function wp(e,t){return si("BankTransactionFormRouter",{routeProps:{transactionId:e,initialTab:t}})}function Cp(e){const t=e.row,r=e.column.columnDef.meta?.clickable,n=t.getCanExpand(),o="BANK_TRANSFER"===t.original.type,a="category"===e.column.id&&(n||o);if("comments"===e.column.id){const e=t.getParentRow();wp(e?.original.id??t.original.id,"conversation")}else if(!r||a)if(n)t.toggleExpanded();else{const e=t.getParentRow();wp(e?.original.id??t.original.id)}}function Ep({rowData:e,hasSelect:t=!0}){const{startPrefetch:r,cancelPrefetch:n}=fi(),o=v(()=>r({id:e.original.id}),[r,e.original]);return w(li,{rowData:e,onMouseEnter:o,onMouseLeave:n,onCellClick:Cp,shouldDisplayDivider:r=>{return n=r,o=t,a=e.getVisibleCells().length,!(0===n||o&&1===n||n===a-1||o||1===n);var n,o,a}})}function Ip(){return E(C,{children:[w(os,{Component:Uh}),w(eo,{wrap:"wrap",children:"All caught up"}),w(ro,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const Sp=Rt(St["button-warning"],xt({color:"typography.intent.warning",border:"1px solid {colors.border.intent.warning}",backgroundColor:"surface.intent.warning",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-text":{color:"typography.intent.warning.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.warning.active",borderColor:"border.intent.warning.active","& .Tight-text":{color:"typography.intent.warning.active"}},"& .Tight-text":{color:"typography.intent.warning"}}));function Ap({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Sp,...t],...r,children:e})}function Np(){const{linkPlaid:e}=hc();return w(Ap,{onClick:e,children:w(eo,{children:"Link your bank"})})}const Pp=Rt(null,xt({whiteSpace:"wrap"}));function Mp(){return E(C,{children:[w(os,{Component:fh}),w(eo,{stylists:[Pp],children:"Your bank transactions will be categorized for you"}),w(ro,{wrap:"wrap",children:"If any require your review, they'll be flagged here."}),w(Np,{})]})}const Dp=xt({animation:"spin",display:"flex",alignItems:"center",justifyContent:"center",width:"15px",height:"15px"});function Rp(){return E(C,{children:[w("div",{className:Dp,children:w(Qc,{Component:Vh})}),w(eo,{children:"Transactions are being processed"}),w(ro,{children:"Any transactions that require review will show up here."})]})}function Op({hasLinkedAccount:e,sortInstance:t,setSortInstance:r,isFilling:n,paginationControls:o,transactions:a}){const i=function({transactions:e}){return function({transactions:e,columns:t}){return function({transactions:e,columns:t}){return K({data:e??xp,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??xp.length,columns:yp(t),getCoreRowModel:$(),getRowCanExpand:e=>e.original.children.length>0,getSubRows:e=>e.children.map(e=>{return t=e,{...t,matchingBankTransaction:null,rule:null,tax:{paymentInfo:null},customData:null,children:[],conversation:null};var t}),getExpandedRowModel:q(),paginateExpandedRows:!1,getRowId:e=>e.id,state:{columnOrder:t,columnVisibility:Tp(t)}})}({transactions:e,columns:t?[...t,Fe.EXPAND]:void 0})}({transactions:e,columns:kp})}({transactions:a}),{query:{data:l},isFilling:s}=mi({limit:1,filter:{status:{in:["ACTIVE","INACTIVE","REMOVED"]}}}),c=!dr(l?.data?.[0])&&!s,d=function(e,t,r){let n;return e||t?!e||r||t?e&&r&&!t&&(n=w(Ip,{})):n=w(Rp,{}):n=w(Mp,{}),n}(e??!1,a.length>0,c);return E(C,{children:[w("div",{id:Yo}),E(pa.Provider,{value:o,children:[E(_t,{children:[w(Ut,{children:"Transactions For Your Review"}),w(ds,{children:w(ya,{})})]}),w(Gi,{dashboard:"businessOwnerDashboard",children:n?w(Ea,{}):E(C,{children:[w(Qi.Provider,{value:{sortInstance:t,setSortInstance:r},children:w(Ga,{headerGroups:i.getHeaderGroups()})}),dr(d)?w(Xa,{children:i.getRowModel().rows.map(e=>w(Ep,{rowData:e,hasSelect:!1},e.id))}):w(ns,{children:d})]})})]})]})}function _p(){const{sortInstance:e,setSortInstance:t,apiSort:r}=function(){const[e,t]=m(void 0),r=u(()=>{if(e&&(e.orderBy||e.direction))return e},[e]);return{sortInstance:e,setSortInstance:e=>{(function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in di)??!1,r=(e.direction&&e.direction in ui)??!1;return t&&r})(e)&&t(e)},apiSort:r}}(),{query:{data:n},isFilling:o,paginationControls:a}=mi({filter:Qo,sort:r,limit:10}),i=n?.data??Zo,{query:{data:l},isFilling:s}=Ic({select:e=>Ac(e?.data)});return w(Op,{sortInstance:e,setSortInstance:t,isFilling:o||s,paginationControls:a,transactions:i,hasLinkedAccount:l??!1})}const Lp=Rt(St["button-action"],xt({color:"typography.intent.action",border:"1px solid {colors.border.intent.action}",backgroundColor:"surface.intent.action",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-text":{color:"typography.intent.action.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.active",borderColor:"border.intent.action.active","& .Tight-text":{color:"typography.intent.action.active"}},"& .Tight-text":{color:"typography.intent.action"}}));function Fp({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Lp,...t],...r,children:e})}const Bp=ia(e=>c.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M4.66504 7.91458H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M4.66504 10.6418H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M12.8125 3.95627V13.9937H2.1875V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10}),c.createElement("path",{d:"M12.8125 3.95627V4.54998H9.26877V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10})),"Doc"),Wp=e=>{switch(e){case"MESSAGE_REVIEW":return{Icon:Ts,buttonText:"Respond now"};case"TRANSACTION_REVIEW":return{Icon:Wh,buttonText:"Review"};case"LINK_BANK":return{Icon:fh,buttonText:"Link your bank"};case"DELETE_OR_RELINK":case"UNLINK_RELINK":case"OPEN_BANK":return{Icon:fh,buttonText:"Fix now"};case"RELINK":return{Icon:fh,buttonText:"Relink"};case"CHAT":return{Icon:Hh,buttonText:"Learn more"};case"ONBOARDING_FORM":return{Icon:Bp,buttonText:"Fill out form"};case"ALL_CAUGHT_UP":case"NO_ACTION_ITEMS":return{Icon:Uh,buttonText:""};default:return{Icon:Hh,buttonText:""}}},Hp=Rt(null,xt({display:"flex",alignItems:"center",gap:"15px"})),Up=Rt(null,xt({width:"20px",height:"20px"}));function Vp({title:e,type:t}){const{Icon:r}=Wp(t);return E("div",{...Hp,children:[w(Qc,{Component:r,stylists:[Up]}),w(eo,{wrap:"wrap",children:e})]})}const zp=Rt(null,xt({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"5px",flex:"1 1 0",minWidth:"200px",width:"100%"}));function jp({title:e,description:t,type:r}){return E("div",{...zp,children:[w(Vp,{title:e,type:r}),w(ro,{wrap:"wrap",children:t})]})}const Kp=Rt(St["banner-button"],xt({display:"flex",width:"202px",justifyContent:"flex-end",alignItems:"center",gap:"15px",flexShrink:"0"})),$p=Rt(St["banner-button-text"]),qp=Rt(St["banner-button-icon"]);function Yp({priority:e,type:t,handleClick:r}){const{buttonText:n}=Wp(t),{Button:o}=(e=>{switch(e){case"URGENT":return{Button:Gs};case"HIGH":return{Button:Ap};case"MEDIUM":return{Button:Fp};default:return{Button:zi}}})(e);return E(o,{onClick:r,stylists:[Kp],children:[w(eo,{stylists:[$p],children:n}),w(ga,{stylists:[qp],Component:sa})]})}const Gp=Et({base:{display:"flex",flexDirection:{sm:"row",base:"column"},padding:"15px",justifyContent:"space-between",alignItems:{sm:"center",base:"flex-start"},alignSelf:"stretch",flexWrap:"wrap",minWidth:"300px",gap:"15px",borderRadius:"lg",border:"1px solid",backgroundColor:"surface.foreground"},variants:{priority:{HIGH:{borderColor:"border.intent.warning"},MEDIUM:{borderColor:"border.intent.action"},LOW:{borderColor:"border.intent.success"},URGENT:{borderColor:"border.intent.danger"},DEFAULT:{borderColor:"border.intent.secondary"}}}}),Qp={HIGH:St["banner-high"],MEDIUM:St["banner-medium"],LOW:St["banner-low"],URGENT:St["banner-urgent"]};function Xp({task:e,handleClick:t}){const{name:r,description:n,type:o,priority:a}=e,i=Rt(St.banner,Qp[a],Gp({priority:a}));return E("div",{...i,children:[w(jp,{title:r,description:n,type:o}),w(Yp,{priority:a,type:o,handleClick:t})]})}function Zp({task:e}){const t=Ee(),{linkPlaid:r}=hc(e?.meta?.plaidItem?.id),{alert:n,actions:o}=xc(e?.meta?.plaidItem);return w(Xp,{task:e,handleClick:()=>{"RELINK"===e.type?r():"LINK_BANK"===e.type?t?si("NewPlaidConnection"):r():kc(n,o)}})}const Jp=Rt(St.banner,St["banner-default"],Gp({priority:"DEFAULT"}));function eg(){const e=gc()?"We'll let you know of new items":"We'll let you know if a new action item comes up";return w("div",{...Jp,children:w(jp,{title:"All Caught Up",description:e,type:"ALL_CAUGHT_UP"})})}const tg=Rt(St.banner,St["banner-default"],Gp({priority:"DEFAULT"}));function rg(){const e=gc()?"No action items yet":"No action items yet as your bookkeeper is setting up your books";return w("div",{...tg,children:w(jp,{title:"Onboarding In Progress",description:e,type:"NO_ACTION_ITEMS"})})}const ng=xt({width:"100%",height:72,minWidth:"300px"});function og(){return E(C,{children:[w(No,{styles:ng}),w(No,{styles:ng}),w(No,{styles:ng})]})}function ag({taskBanners:e,handleScrollAction:t,isWaitingForPlaidItemAccountsSync:r,isFilling:n}){const o=e.length>0;return n?w(og,{}):o?e.map(e=>{if(void 0===ta[e.type]||"ONBOARDING_FORM"===e.type&&dr(e.actionLink))return null;if("LINK_BANK"===e.type||"BANK_ERROR"===e.type||Object.values(mc).includes(e.type))return w(Zp,{task:e},e.id);const r=e.actionLink,n=ur(r)?()=>window.open(r,"_blank"):()=>t(e.type);return w(Xp,{task:e,handleClick:n},e.id)}):w(r?rg:eg,{})}function ig(){return E(Ki,{onClick:()=>si("BanksAndIntegrations"),children:[w(ga,{Component:Gc}),w(ll,{children:"Banks & Integrations"})]})}const lg=Rt(St["business-owner-dashboard"],xt({gap:10,display:"flex",flexDirection:"column",width:"100%",maxWidth:1440})),sg=xt({display:"flex",width:"100%",justifyContent:"center"}),cg=e=>{const t=Go[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}},dg={status:{in:["ACTIVE","INACTIVE"]}},ug={filter:{status:{in:["ACTIVE"]}}};function hg({period:e,onChangePeriod:t}){const{sortInstance:r,setSortInstance:n,apiSort:o}=function(){const[e,t]=m(void 0);return{sortInstance:e,setSortInstance:v(e=>{!function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in La)??!1,r=(e.direction&&e.direction in Fa)??!1;return t&&r}(e)?t(void 0):t(e)},[t]),apiSort:e}}(),{query:{data:a},isFilling:i,paginationControls:l}=Ua({limit:10,sort:o,filter:Xo}),s=a?.data??Jo,c=gc(),{query:{data:d},isFilling:h}=(p={select:e=>((e,t)=>{const r=dr(n=e)||dr(n.data)?[]:[...n.data].sort((e,t)=>na[e.priority]-na[t.priority]);var n;return t?r.filter(e=>"MESSAGE_REVIEW"===e.type||"BANK_ERROR"===e.type):r})(e,c)},g=ug,xr({...p,queryKey:g?ra(g):["tasks",{}],queryFn:oa}));var p,g;const{query:{data:b}}=Ic({select:e=>({plaidItemAccountsReadyToSync:Nc(e?.data),hasPlaidLinkedBankAccount:Ac(e?.data)})}),{query:{data:f}}=js({select:e=>{return t=e,t?.filter(({status:e,apiErrorType:t,apiErrorCode:r})=>"ACTIVE"===e&&t&&r);var t}}),y=gc(),T=u(()=>{let e=[];f&&(e=f.map(e=>Cc(e)));let t=[];!1===b?.hasPlaidLinkedBankAccount&&(t=[wc]);const r=d??[];return[...e,...t,...r]},[d,b,f]),x=function(){const{query:{data:e}}=mi({filter:dg,limit:1});return(e?.data?.length??0)>0}(),k=function(e,t){const r=!(void 0===t||t.hasPlaidLinkedBankAccount&&!t.plaidItemAccountsReadyToSync);return!e&&r}(x,b),I=/* @__PURE__ */new Date,S={month:I.getMonth(),year:I.getFullYear()};const[A,N]=ul(S,e,t),P=(M=A.month,{beginDate:zt((D=A.year)-1,M+1,1),endDate:zt(D,M+1,0)});var M,D;return w("div",{className:sg,children:E("div",{...lg,children:[E(_t,{children:[w(Ut,{children:"Action Items"}),w(ig,{})]}),w($o,{children:w(ag,{taskBanners:T,handleScrollAction:cg,isWaitingForPlaidItemAccountsSync:!x&&!0===b?.plaidItemAccountsReadyToSync,isFilling:h})}),!y&&E(C,{children:[w(Id,{period:A,handleDateChange:e=>{var t,r;(t=S).year===(r=e).year&&r.month>t.month||r.year>t.year||N(e)},todayPeriod:S,showSamples:k,showLinkAccountButton:k&&!b?.plaidItemAccountsReadyToSync}),w(_t,{children:w(Ut,{children:"Financial Summary"})}),w(Hs,{isSample:k,period:A}),w(jo,{filter:P,isSample:k})]}),w(ps,{sortInstance:r,setSortInstance:n,conversations:s,paginationControls:l,isFilling:i,isMobile:y}),!y&&w(_p,{})]})})}function pg(e){return w(ln||C,{children:e.children})}const gg="undefined"!=typeof window?x:b,mg={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function vg({children:e}){const[t,{width:r,height:n}]=function(e={}){const{debounceMs:t=0}=e,[r,n]=m(null),[o,a]=m(mg),i=u(()=>{let e=null;return new window.ResizeObserver(r=>{if(r[0]){const{x:n,y:o,width:i,height:l,top:s,left:c,bottom:d,right:u}=r[0].contentRect;t>0?(null!==e&&clearTimeout(e),e=setTimeout(()=>{a({x:n,y:o,width:i,height:l,top:s,left:c,bottom:d,right:u}),e=null},t)):a({x:n,y:o,width:i,height:l,top:s,left:c,bottom:d,right:u})}})},[t]);return gg(()=>{if(r)return i.observe(r),()=>{i.disconnect()}},[r]),[n,o]}({debounceMs:150});return w(pg,{children:w(pc.Provider,{value:{dimensions:{width:r,height:n}},children:w("div",{ref:t,className:Nt(St.component),children:e})})})}function bg(e){return w(vg,{children:w(hg,{...e})})}const fg=ve("tight-component-store",1,{upgrade(e){e.createObjectStore("queryClient")}}),yg={queryClient:fr,persister:/* @__PURE__ */function(e="reactQuery"){return{persistClient:async t=>{await async function(e,t){return(await fg).put("queryClient",t,e)}(e,t)},restoreClient:async()=>await async function(e){return(await fg).get("queryClient",e)}(e),removeClient:async()=>{await async function(e){return(await fg).delete("queryClient",e)}(e)}}}(),maxAge:br,dehydrateOptions:{shouldDehydrateQuery:e=>!e.isStale()}};function Tg({children:e}){return w(be,{client:fr,persistOptions:yg,children:e})}const xg=xt({position:"absolute",top:0,left:0,width:{base:0,sm:"100dvw"},height:{base:0,sm:"100dvh"},minWidth:{base:0,sm:"100dvw"},minHeight:{base:0,sm:"100dvh"},maxHeight:{base:0,sm:"100dvh"},maxWidth:{base:0,sm:"100dvw"},overflow:"hidden",backgroundColor:"overlay"}),kg=xt({position:"absolute",top:0,left:{base:0,sm:"auto"},right:0,bottom:{base:0,sm:"auto"},width:"100dvw",height:"100dvh",minWidth:"100dvw",minHeight:"100dvh",maxHeight:"100dvh",maxWidth:"100dvw",overflow:"hidden"}),wg=Rt(null,St.component,kg);function Cg({children:e}){const t=d(null),r=d(null);return E(ce,{lockScroll:!0,children:[w("div",{className:xg}),w("div",{onMouseDown:e=>{r.current=e.target},onClick:e=>{const n=r.current===t.current,o=e.target===t.current;n&&o&&(r.current=null,Le.getState().closeAllDrawers())},ref:t,...wg,children:e})]})}const Eg=h({drawerHistory:[]});function Ig({children:e}){const t=Le(e=>e.drawerHistory),r=u(()=>({drawerHistory:t}),[t]);return w(Eg.Provider,{value:r,children:t.length>0&&w(Cg,{children:e})})}function Sg({Component:e,name:t}){const{drawerHistory:r}=p(Eg),n=r.at(-1);if(void 0===n)return null;const o=n[t];return void 0!==o?w(e,{...o.routeProps}):void 0}const{formContext:Ag,fieldContext:Ng,useFieldContext:Pg,useFormContext:Mg}=fe();function Dg({showIcon:e=!0,textContent:t="Save",disabled:r=!1}){return E(Xs,{type:"submit",disabled:r,children:[e&&w(ga,{Component:_d}),w(eo,{children:t})]})}const Rg=[Rt(null,xt({color:"icon.accent.danger","& path":{stroke:"icon.accent.danger"}}))],Og=Rt(null,xt({display:"flex",alignItems:"center",gap:"4px"}));function _g({errorMessage:e}){return E("div",{...Og,children:[w(Qc,{Component:Hh,stylists:Rg}),w(ro,{intent:"danger",children:e})]})}const Lg=xt({display:"flex",flexDirection:"column",padding:"12px 16px",cursor:"pointer",outline:"none",gap:"8px",borderRadius:"md",backgroundColor:"surface.intent.action.discrete","&[data-state='closed'][data-disablehover='false']":{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}},"&:not([data-state])[data-disablehover='false']:not(:focus-within)":{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}},"&[data-state='open']":{backgroundColor:"surface.intent.action.discrete.active"},"&[data-clicked='false']:has(:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),Fg=xt({"&[data-haserror='true']":{border:"{borderWidths.lg} solid",borderColor:"border.intent.danger"}}),Bg=xt({display:"flex",justifyContent:"space-between",alignItems:"center"});function Wg({children:e,inputRef:t,popupTriggerProps:r,label:n,isDefaultValue:o,isTouched:a,className:i,additionalStyles:l,onClick:s,onBlur:c,errorMessage:d,disableHover:u=!1,type:h,remainingChars:p}){const g=Rt(i||null,Lg,l,Fg,da),[v,b]=m(!0);return E(C,{children:[E("div",{...g,onClick:s,...r,onMouseDown:e=>{b(!0),t&&t.current&&e.target!==t.current&&(e.preventDefault(),t.current.focus())},onFocus:()=>{t&&t.current&&function(e,t){if("setSelectionRange"in e&&"number"!==t){const t=e.value.length;e.setSelectionRange(t,t)}}(t.current,h)},onBlur:()=>{b(!1),c?.()},"data-clicked":v,"data-isdefaultvalue":o,"data-haserror":a&&void 0!==d,"data-disablehover":u,children:[E("div",{className:Bg,children:[void 0!==n&&w(ro,{children:n}),ur(p)&&w(ro,{intent:p&&p<0?"danger":"normal",children:`${p}`})]}),e]}),a&&d&&w(_g,{errorMessage:d})]})}const Hg=xt({border:"{borderWidths.lg} solid transparent","&:focus-within, &[data-isdefaultvalue='false']":{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},"&:focus-within":{cursor:"text"}});function Ug({children:e,inputRef:t,popupTriggerProps:r,label:n,onClick:o}){const a=Pg(),i=ye(a.store,e=>e.meta.errors[0]?.message),l=ye(a.store,e=>e.meta.isDefaultValue),s=ye(a.store,e=>e.meta.isTouched);return w(Wg,{label:n,inputRef:t,popupTriggerProps:r,isDefaultValue:l,isTouched:s,className:St["discrete-form-input"],additionalStyles:Hg,errorMessage:i,onClick:o,onBlur:a.handleBlur,children:e})}function Vg(e){((navigator.userAgent?navigator.userAgent.toLowerCase().includes("mac"):navigator.platform.toLowerCase().includes("mac"))?e.metaKey:e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),e.currentTarget.requestSubmit())}function zg(e){"Escape"===e.key&&e.target instanceof HTMLElement&&e.target.blur()}function jg(e){"Enter"===e.key&&e.currentTarget.blur()}const Kg=Rt(St["amount-input"],Wt({body:"default"}),xt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer",width:"100%",_focus:{cursor:"text"}})),$g=Rt(null,xt({display:"flex",alignItems:"center",gap:"2px"}));function qg({value:e,onChange:t,inputRef:r,onClick:n,onBlur:o,autofocus:a=!1}){return E("div",{...$g,children:[w(ms,{children:"$"}),w(xe,{...Kg,getInputRef:r,thousandSeparator:!0,decimalScale:2,value:e,onValueChange:e=>{t(void 0===e.floatValue?null:e.floatValue)},fixedDecimalScale:!0,onClick:n,onBlur:o,onKeyDown:jg,autoFocus:a})]})}const Yg=xt({backgroundColor:"surface.foreground.disabled",pointerEvents:"none",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"}),Gg=Et({base:{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},variants:{kind:{text:{cursor:"text"},button:{cursor:"pointer"},container:{cursor:"default"}}}});function Qg({kind:e,label:t,children:r,inputRef:n,disabled:o,popupTriggerProps:a,onClick:i,disableHover:l=!1,type:s,maxLength:c}){const d=Pg(),u=ye(d.store,e=>e.meta.errors[0]?.message),h=ye(d.store,e=>e.meta.isTouched),p="string"==typeof d.state.value?d.state.value.length:0,g=ur(c)?c-p:void 0,m=o?Yg:Gg({kind:e});return w(Wg,{label:t,inputRef:n,popupTriggerProps:a,className:St["editable-form-input"],additionalStyles:m,errorMessage:u,onBlur:d.handleBlur,disableHover:l,onClick:i,type:s,isTouched:h,remainingChars:g,children:r})}const Xg=Rt(St["button-secondary"],xt({color:"typography.intent.primary",border:"{borderWidths.md} solid",borderColor:"border.intent.primary",backgroundColor:"surface.intent.primary","& .Tight-text":{color:"typography.intent.primary"},"& path":{stroke:"icon.intent.primary"},_supportHover:{_notDisabled:{backgroundColor:"surface.intent.primary.hover",borderColor:"border.intent.primary.hover","& .Tight-text":{color:"typography.intent.primary.hover"},"& path":{stroke:"icon.intent.primary.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.primary.active",borderColor:"border.intent.primary.active","& .Tight-text":{color:"typography.intent.primary.active"},"& path":{stroke:"icon.intent.primary.active"}}}));function Zg({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Xg,...t],...r,children:e})}const Jg=[Rt(null,xt({"& path":{stroke:"surface.foreground"}}))];function em({onClick:e}){return E(Zg,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),e()},children:[w(ga,{stylists:Jg,Component:Eh}),w(ro,{intent:"primary",children:"Add Split"})]})}const tm=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",height:"39px",padding:0})),rm=Rt(null,xt({display:"flex",flexDirection:"column",maxHeight:"200px",overflowY:"auto",minWidth:"120px"}));function nm({options:e,onSelect:t,selectedLabel:r}){const n=gl();return w("div",{...rm,children:e.map(e=>w(Sl,{onClick:()=>{return r=Number(e.value),n?.setOpen(!1),void t(r);var r},active:r===e.label,children:e.label},e.value))})}const om=Rt(null,xt({cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px",borderRadius:"sm",gap:"7px",backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}}),ca);function am({selectedLabel:e,options:t,onSelect:r}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>E("div",{...om,...t,children:[w(eo,{children:e}),w(bl,{Component:dp})]})}),w(El,{children:w(nm,{options:t,onSelect:r,selectedLabel:e})})]})}const im=Rt(null,xt({display:"flex",alignItems:"center",gap:"15px"})),lm=Qt.map((e,t)=>({value:t,label:e})),sm=Xt({}).map(e=>({value:e,label:String(e)}));function cm({currentMonthYear:e,onMonthYearChange:t}){const r=e.getFullYear(),n=e.getMonth(),o=(e,r)=>{const n=new Date(e,r,1);t(n)};return E("div",{...im,children:[w(am,{selectedLabel:Qt[n],options:lm,onSelect:e=>o(r,e)}),w(am,{selectedLabel:String(r),options:sm,onSelect:e=>o(e,n)})]})}const dm=Rt(null,xt({background:"surface.foreground",padding:"25px",gap:"15px"})),um=Rt(null,xt({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",alignSelf:"stretch",marginBottom:"30px"})),hm=Rt(null,xt({backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",padding:"8px",borderRadius:"sm",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"},"&:disabled":{opacity:.6,pointerEvents:"none"}}),ca),pm=Rt(null,xt({display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px 2px"})),gm=Rt(null,xt({padding:"8px",textAlign:"center"})),mm=Rt(null,xt({backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",padding:"6px",width:"36px",height:"36px",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"sm",cursor:"pointer",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}},"&[data-selected='true']":{backgroundColor:"surface.intent.action.discrete.active",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.active"},"&[data-today='true']::after":{content:"''",position:"absolute",bottom:"3px",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:"brand.primary"},"&:disabled":{cursor:"default"}}),ca),vm=Rt(null,xt({color:"typography.base"}));function bm({date:e,selectedDate:t,currentMonth:r,onClick:n,maxDate:o}){const a=t&&Zt(e,t),i=Jt(e),l=e.getMonth()!==r,s=!!o&&er(e,o);return w("button",{...mm,onClick:()=>n(e),"data-selected":a,"data-today":i,disabled:s,children:w(eo,{stylists:l||s?[vm]:[],children:e.getDate().toString()})})}function fm({selectedDate:e,onDateSelect:t,viewDate:r,onViewDateChange:n,maxDate:o}){const a=gl(),i=r||/* @__PURE__ */new Date,l=i.getFullYear(),s=i.getMonth(),c=function(e,t){const r=zt(e,t,1),n=new Date(r);return n.setDate(n.getDate()-r.getDay()),Array.from({length:42},(e,t)=>{const r=new Date(n);return r.setDate(n.getDate()+t),r})}(l,s),d=Pe(c),u=void 0===o||d&&er(o,d),h=e=>{t(e),a.setOpen(!1)},p=e=>{const t=new Date(i);t.setMonth(i.getMonth()+e),n(t)};return E("div",{...dm,children:[E("div",{...um,children:[w("button",{...hm,onClick:()=>p(-1),children:w(ga,{Component:la})}),w(cm,{currentMonthYear:i,onMonthYearChange:n}),w("button",{...hm,onClick:()=>p(1),disabled:!u,children:w(ga,{Component:sa})})]}),E("div",{...pm,children:[Gt.map(e=>w("div",{...gm,children:w(ro,{children:e})},e)),c.map(t=>w(bm,{date:t,selectedDate:e,currentMonth:s,onClick:h,maxDate:o},t.toISOString()))]})]})}const ym=Rt(null,Wt({body:"default"}),xt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer","&:focus":{cursor:"text"}})),Tm=Rt(null,Wt({body:"default"}),xt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",cursor:"text",overflowWrap:"break-word",minWidth:"100%",maxWidth:"100%","&::placeholder":{color:"typography.base.weak"},"&:focus":{outline:"none"}})),xm=s.object({message:s.string().refine(e=>""!==e,{message:"Required"})});function km(e){null!==e.current&&(e.current.scrollIntoView({behavior:"instant"}),e.current.setAttribute("data-hasscrolled","true"))}const wm=xt.raw({maxHeight:150,maxWidth:"100%",whiteSpace:"pre-wrap",overflowWrap:"break-word",width:"100%",boxSizing:"border-box",margin:0,padding:0,fontFamily:"body"}),Cm=xt.raw({visibility:"hidden",fontSizeAdjust:"none",fontSize:"100%",fontStyle:"normal",letterSpacing:"normal",fontStretch:"normal",fontVariant:"normal",fontWeight:"normal",textAlign:"left",textAlignLast:"initial",textDecoration:"none",textEmphasis:"none",textIndent:"0px",textJustify:"auto",textShadow:"none",textTransform:"none"}),Em=xt(Cm,wm),Im=xt.raw({resize:"none",inset:0,outline:"none",overflow:"auto",position:"absolute",appearance:"none",border:"none",backgroundColor:"transparent",fontSize:"16px"}),Sm=xt(Im,wm,Wt.raw({body:"default"})),Am=xt({display:"block",width:"100%"}),Nm=xt({position:"relative"}),Pm=xt({display:"flex",justifyContent:"flex-end"}),Mm=xt({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),Dm=y(function({blockSubmit:e=!1,scrollRef:t,setActiveKeyboard:r},n){const o=Pg(),a=d(null),{startCallback:i}=Oa({delay:50,callback:e=>r(e)});k(n,()=>a.current);const l=!e&&xm.safeParse(o.form.state.values).success;return w(Qg,{kind:"text",inputRef:a,disableHover:!0,onClick:()=>(km(t),void i(!0)),children:E("div",{className:Am,children:[E("div",{className:Nm,children:[E("pre",{className:Em,children:[o.state.value,w("br",{})]}),w("textarea",{ref:a,placeholder:"Message...",value:o.state.value,className:Sm,onChange:e=>o.handleChange(e.target.value)})]}),w("div",{className:Pm,children:w(Ki,{disabled:!l,type:"submit",children:w("span",{className:Mm,children:w(Qc,{Component:as})})})})]})})}),Rm=Rt(St["category-text"],xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",padding:0,outline:"none",border:"none",background:"none",borderRadius:"md",color:"typography.intent.action",flex:"1 1 0",minWidth:0,cursor:"pointer",_supportHover:{color:"typography.intent.action.hover"},"&:focus-visible":{outline:"4px solid",outlineOffset:"2px",outlineColor:"border.layout"},"& .Tight-medium-icon > path":{_supportHover:{stroke:"typography.intent.action.hover"}}}),ua),Om=Rt(null,xt({color:"inherit"})),_m=Rt(St["amount-input-container"],xt({borderRadius:"md",border:"none",background:"transparent",color:"typography.intent.action",maxWidth:"120px","&:not(:focus-within)":{_supportHover:{color:"typography.intent.action.hover"}},"& .Tight-amount-input, & .Tight-text":{color:"inherit"},"&[data-clicked='true']:focus-within":{outline:"1px solid",outlineOffset:"2px",outlineColor:"border.layout.strong"},"&[data-clicked='false']:has(:focus-visible)":{outline:"4px solid",outlineOffset:"2px",outlineColor:"border.layout"}}),ua),Lm=e=>"MANUAL_ENTRY"===e.apiName||"CSV_IMPORT"===e.apiName,Fm=e=>{const t=e?.description;return`${t} | ${Yn(Number(e?.amount),{dollarSign:!0})} | ${tr(or(e?.date||""))}`},Bm=({bankAccounts:e,onClick:t,isFilling:r})=>{const n=gl();return w(El,{children:w(pu,{children:r?w(xu,{}):e?.map(e=>w(vu,{onClick:()=>{return r=e,void 0!==t&&t(r),void n.setOpen(!1);var r},children:w(eo,{wrap:"wrap",children:Mh(e?.apiAccountName,e?.apiAccountNo)})},e?.id))})})};function Wm({onClick:e}){const{query:{data:t},isFilling:r}=Ic(),n=t?.data?.filter(e=>e.glAccountId&&"ACTIVE"===e.status&&e.isSupported);return w(Bm,{bankAccounts:n,isFilling:r,onClick:e})}const Hm=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"}));function Um({label:e,disabled:t,bankAccount:r,onClick:n}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:n=>w(Qg,{label:e,popupTriggerProps:n,disabled:t,children:w("button",{...Hm,type:"button",disabled:t,children:w(eo,{children:Mh(r?.apiAccountName,r?.apiAccountNo)})})})}),w(Wm,{onClick:n})]})}const Vm=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",height:"39px",padding:0,cursor:"pointer"})),zm={filter:{type:{in:["BANK_TRANSFER"]}}},jm=Rt(null,xt({whiteSpace:"normal"}));function Km({onClick:e,transactionId:t}){const{query:{data:r},isFilling:n}=mi(zm),o=r?.data?.filter(e=>e.id!==t),a=gl();return w(El,{children:w(pu,{children:n?w(xu,{}):o?.map(t=>w(vu,{onClick:()=>(e(t),void a?.setOpen(!1)),children:w(eo,{stylists:[jm],children:Fm(t)})},t.id))})})}const $m=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),qm=Rt(null,xt({color:"typography.base.weak"})),Ym=Rt(null,xt({display:"grid",textWrap:"nowrap"}));function Gm({children:e,rows:t,cols:r}){return w("div",{...Ym,style:{gridTemplateColumns:`repeat(${r}, 1fr)`,gridTemplateRows:`repeat(${t}, 1fr)`},children:e})}const Qm=Et({base:{minWidth:0,borderRadius:"zero",_focus:{zIndex:1}},variants:{width:{full:{width:"100%"}},backgroundColor:{foreground:{backgroundColor:"surface.foreground"}}}});function Xm({option:e,handleClick:t,selected:r,width:n,backgroundColor:o}){const a=wt(Qm({width:n,backgroundColor:o}),_i,Ri,Oi,ca);return void 0===e?null:w("button",{type:"button",className:a,onClick:()=>t(e),"data-active":r?.value===e.value,children:w(Ji,{wrap:"wrap",alignment:"center",children:e.label})})}function Zm({options:e,handleClick:t,selected:r,rows:n,cols:o}){return w(Gm,{rows:n,cols:o,children:e?.map(e=>w(Xm,{option:e,handleClick:t,selected:r},e.value))})}function Jm({options:e}){const t=gl(),r=Pg();return w(El,{children:w(pu,{children:e.map(e=>w(vu,{onClick:()=>{r.handleChange(e.value),r.handleBlur(),t.setOpen(!1)},children:w(Ji,{children:e.label})},e.value))})})}const ev=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),tv=Rt(null,xt({color:"typography.base.weak"})),rv=(e,t)=>{const r=e.find(e=>e.value===t);return r?.label},nv=xt({border:"none",outline:"none",backgroundColor:"transparent",fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"}),{useAppForm:ov,withForm:av}=Te({formContext:Ag,fieldContext:Ng,formComponents:{SaveButton:Dg},fieldComponents:{DiscreteAmountField:function({label:e}){const t=d(null),r=Pg();return w(Ug,{inputRef:t,label:e,children:w(qg,{value:r.state.value,onChange:r.handleChange,inputRef:t})})},EditableAmountField:function({label:e,autofocus:t=!1}){const r=d(null),n=Pg();return w(Qg,{inputRef:r,label:e,children:w(qg,{value:n.state.value,onChange:n.handleChange,inputRef:r,autofocus:t})})},ExpenseCategoryField:function({category:e,onClick:t,childrenField:r,totalAmount:n,glAccount:o}){const a=()=>{const t=Math.floor(n/2*100)/100,a=n-t;r?.pushValue({amount:t,category:e,classSegments:[],glAccount:o}),r?.pushValue({amount:a,category:e,classSegments:[],glAccount:o})};return E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>E(Qg,{label:"Category",popupTriggerProps:t,children:[E("button",{...tm,type:"button",children:[w(Qc,{Component:wh(e?.name)}),w(eo,{children:e?.name||"Uncategorized"})]}),r&&w(em,{onClick:a})]})}),w(gh,{onClick:t})]})},DateInput:function({label:e,maxDate:t,autofocus:r=!1,editable:n=!1}){const o=Pg(),a=ye(o.store,e=>e.meta.isDefaultValue),i=d(null),[l,s]=m(()=>o.state.value?or(o.state.value):/* @__PURE__ */new Date),c=o.state.value?or(o.state.value):null,[u,h]=m(""),p=e=>{const r=function(e){const t=e.replace(/\D/g,"");return t.length<=2?t:t.length<=4?`${t.slice(0,2)}/${t.slice(2)}`:`${t.slice(0,2)}/${t.slice(2,4)}/${t.slice(4,8)}`}(e.target.value);h(r);const n=nr(r);if(n){const e=t?er(a=n,i=t)?i:a:n;o.handleChange(ar(e)),s(e)}else o.handleChange("");var a,i},g=u||(c?tr(c):""),[v,b]=m(!1),f=e=>{v&&(()=>{if(t&&c&&!a){const e=nr(u);e&&er(e,t)&&h(tr(c))}})(),b(e)},y=e=>{"Enter"===e.key&&(e.preventDefault(),f(!v))},T=n?Qg:Ug;return E(pl,{placement:"bottom-start",onOpenChange:f,open:v,children:[w(ml,{children:t=>w(T,{label:e,inputRef:i,popupTriggerProps:t,onClick:()=>b(!0),children:w("input",{...ym,ref:i,type:"text",id:o.name,value:g,onChange:p,placeholder:"MM/DD/YYYY",maxLength:10,autoFocus:r,onKeyDown:y,autoComplete:"off"})})}),w(El,{initialFocus:!1,children:w(fm,{selectedDate:c,onDateSelect:e=>{o.handleChange(ar(e)),h(tr(e)),s(e)},viewDate:l,onViewDateChange:s,maxDate:t})})]})},TextAreaInput:function({label:e,placeholder:t,autofocus:r=!1,resizeable:n=!0}){const o=Pg(),a=d(null);return w(Qg,{label:e,inputRef:a,children:w("textarea",{...Tm,ref:a,value:o.state.value||"",onChange:e=>o.handleChange(e.target.value),placeholder:t??"Add note...",rows:4,style:{resize:n?"both":"none"},autoFocus:r})})},MessageAreaInput:Dm,SplitExpenseCategoryField:function({value:e,onChange:t}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>E("button",{...Rm,...t,type:"button",children:[w(Qc,{Component:wh(e?.name)}),w(eo,{stylists:[Om],children:e?.name||"Uncategorized"})]})}),w(gh,{onClick:t})]})},SplitExpenseAmountField:function({value:e,onChange:t,onBlur:r}){const[n,o]=m(!1);return w("div",{..._m,"data-clicked":n,children:w(qg,{value:e,onChange:t,onClick:()=>o(!0),onBlur:()=>(o(!1),void r())})})},BankAccountField:function({transaction:e}){const{state:{value:t},handleChange:r}=Pg(),n=Sc(t.id),o=dr(e)||!Lm(e);return w(Um,{label:"Bank Account",disabled:o,onClick:e=>{var t;r({id:(t=e).id,name:t.apiAccountName})},bankAccount:n})},GlAccountField:function(){const e=Pg(),t=e.state.value;return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>w(Qg,{label:"Account",popupTriggerProps:e,children:w("button",{...Vm,type:"button",children:w(eo,{children:nu(t.accountNo,t.name)})})})}),w(qu,{onClick:t=>{const r=Cu(t);e.handleChange(r)},types:ku})]})},BankGlAccountField:function({transaction:e}){const{state:{value:t},handleChange:r}=Pg(),{query:{data:n}}=Au(),{query:{data:o}}=function(e){return Ic({select:t=>((e,t)=>{const r=Number(t.split("_")[1]);return e?.find(e=>Number(e.glAccountId)===r)})(t.data,e)})}(t?.id),a=e?Dh(e.amount):"";return w(Um,{label:a,onClick:e=>{const t=(o=n,a=e,o?.flatMap(e=>[e,...e.children??[]]).find(e=>Number(e.id?.split("_")[1])===a.glAccountId));var o,a;t&&r(Cu(t))},bankAccount:o})},MatchingBankTransferField:function({transaction:e}){const t=Pg(),r=t.state.value,n=r?Fm(r):"Select",o=r?[]:[qm];return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>w(Qg,{label:"Matching Bank Transfer",popupTriggerProps:e,children:w("button",{...$m,children:w(eo,{stylists:o,children:n})})})}),w(Km,{onClick:e=>{const r={id:(n=e).id,description:n?.description,amount:n?.amount,date:n?.date,bankAccountId:n?.bankAccount?.id,apiName:n?.apiName};var n;t.handleChange(r),t.handleBlur()},transactionId:e?.id})]})},ButtonGroupField:function({label:e,options:t}){const r=Pg(),n=t.find(e=>e.value===r.state.value);return w(Qg,{label:e,disableHover:!0,children:w(Zm,{options:t,selected:n,handleClick:e=>{r.handleChange(e.value.toString())},rows:1,cols:t.length})})},ButtonGrid:Zm,GenericSelectorField:function({options:e,label:t,disabled:r}){const n=Pg();return E(pl,{placement:"bottom-start",children:[w(ml,{children:o=>w(Qg,{label:t,popupTriggerProps:o,disabled:r,children:w("button",{...ev,type:"button",children:n.state.value?w(eo,{children:rv(e,n.state.value)}):w(eo,{stylists:[tv],children:`Select ${t}...`})})})}),w(Jm,{options:e})]})},TextField:function({label:e,type:t="text",maxLength:r,disabled:n,placeholder:o="Enter value..."}){const a=Pg(),i=d(null);return w(Qg,{label:e,disabled:n,inputRef:i,kind:"text",type:t,maxLength:r,children:w("input",{className:nv,value:a.state.value,onChange:e=>a.handleChange(e.target.value),type:t,maxLength:r,ref:i,placeholder:o})})}}}),iv=s.object({amount:s.number({message:"Required"}).refine(e=>0!==e,{message:"Amount must not be 0"}),date:s.string("Required").refine(e=>(function(e,t){const r=zt(e.getFullYear(),e.getMonth(),e.getDate()),n=zt(t.getFullYear(),t.getMonth(),t.getDate());return r.getTime()<n.getTime()}(new Date(e),/* @__PURE__ */new Date)||Zt(new Date(e),/* @__PURE__ */new Date))&&er(new Date(e),/* @__PURE__ */new Date("2000-01-01")),{message:"Invalid date"}),category:s.object({id:s.string(),name:s.string().optional()},{message:"Required"}).nullable(),classSegments:s.array(s.object({id:s.string(),name:s.string().optional()})),bankAccount:s.object({id:s.string(),name:s.string().optional()},{message:"Required"}),glAccount:s.object({id:s.string(),name:s.string().optional(),accountNo:s.string().optional()},{message:"Required"}),notes:s.string().nullable(),children:s.array(s.object({amount:s.number().refine(e=>0!==e,{message:"Child expense amounts must not be 0"}),category:s.object({id:s.string(),name:s.string().optional()},{message:"Required"}),glAccount:s.object({id:s.string()},{message:"Required"}),classSegments:s.array(s.object({id:s.string(),name:s.string().optional()}))}))}),lv=iv.extend({}).check(e=>{const t=e.value?.children?.reduce((e,t)=>e+t.amount,0);i(e.value?.children)||t===e.value.amount||e.issues.push({code:"custom",message:"Sum of children amounts must equal total amount",input:e.value,path:["children"]})}),sv=iv.extend({matchingBankTransaction:s.object({id:s.string(),description:s.string().optional(),amount:s.number().optional(),date:s.string().optional(),bankAccountId:s.string().optional(),apiName:s.enum({BOX:"BOX",CLOVER:"CLOVER",STRIPE:"STRIPE",PLAID:"PLAID",KNOX:"KNOX",UBER:"UBER",FRESHBOOKS:"FRESHBOOKS",HARVEST:"HARVEST",KW:"KW",FRESHBOOKS2:"FRESHBOOKS2",CAPITAL_ONE:"CAPITAL_ONE",SQUARE:"SQUARE",DOTLOOP:"DOTLOOP",REALOGY:"REALOGY",UPWORK:"UPWORK",SHOPIFY:"SHOPIFY",DEDUCTR:"DEDUCTR",ENTERPRISE:"ENTERPRISE",MOXIWORKS:"MOXIWORKS",APPDIRECT:"APPDIRECT",LONEWOLF:"LONEWOLF",LONEWOLF_TRANSACTIONDESK:"LONEWOLF_TRANSACTIONDESK",SAMPLE_BANK:"SAMPLE_BANK",TAXBOT:"TAXBOT",GUSTO:"GUSTO",XERO:"XERO",UNIT:"UNIT",MOOV:"MOOV",QBO:"QBO",QUALPAY:"QUALPAY",BENCH:"BENCH",PARTNER_IMPLEMENTATION:"PARTNER_IMPLEMENTATION",CHECK:"CHECK",RUTTER:"RUTTER",WAVE:"WAVE",MANUAL_ENTRY:"MANUAL_ENTRY",CSV_IMPORT:"CSV_IMPORT"}).optional()}).nullish()}).refine(e=>{const t=e.matchingBankTransaction?.amount,r=e.amount;return!!dr(t)||t===r},{message:"Transfer amount must equal the matching bank transaction amount",path:["matchingBankTransaction"],when:e=>sv.pick({amount:!0,matchingBankTransaction:!0}).safeParse(e.value).success}),cv=iv.extend({}),dv=[{value:"FEDERAL",label:"Federal"},{value:"STATE",label:"State"},{value:"SALES",label:"Sales"}],uv=[{value:"Q1",label:"Q1"},{value:"Q2",label:"Q2"},{value:"Q3",label:"Q3"},{value:"Q4",label:"Q4"}],hv=["FEDERAL","STATE","SALES"],pv=["Q1","Q2","Q3","Q4"],gv=iv.extend({tax:s.object({paymentInfo:s.object({region:s.enum(hv,{message:`Tax region must be one of: ${hv.join(", ")}`}),quarter:s.enum(pv,{message:`Tax quarter must be one of: ${pv.join(", ")}`}),year:s.number({message:"Tax year is required"})}).nullable()})}).superRefine((e,t)=>{e.tax?.paymentInfo||(t.addIssue({path:["tax","paymentInfo","region"],code:"custom",message:`Tax region must be one of: ${hv.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","quarter"],code:"custom",message:`Tax quarter must be one of: ${pv.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","year"],code:"custom",message:"Tax year is required"}))}),mv={amount:null,category:{id:"",name:""},bankAccount:{id:"",name:""},glAccount:{id:"",name:"",accountNo:""},date:"",notes:null,classSegments:[],children:[],matchingBankTransaction:{id:"",description:"",amount:0,date:"",bankAccountId:"",apiName:void 0},tax:{paymentInfo:null}};function vv(e){const{mutate:t}=Zu(),r=e?{amount:Xd((o=e).amount),category:o.category,date:o.date,bankAccount:o.bankAccount,glAccount:o.glAccount,notes:o.notes,classSegments:o.classSegments,children:o.children.map(e=>({amount:Xd(e.amount),category:e.category,glAccount:e.glAccount,classSegments:e.classSegments})),matchingBankTransaction:o.matchingBankTransaction,tax:o.tax}:mv,n=e?function(e){switch(e.type){case"EXPENSE":return lv;case"BANK_TRANSFER":return sv;case"REVENUE":return cv;case"TAX_PAYMENT":return gv;default:return}}(e):void 0;var o;return ov({defaultValues:r,validators:{onBlur:n},onSubmit:r=>{var n;e&&(t({id:e.id,amount:(n=r.value).amount?Zd(n.amount):0,categoryId:n.category?.id,bankAccountId:n.bankAccount.id,glAccountId:n.glAccount?.id,date:n.date,notes:n.notes,classSegmentIds:n.classSegments.map(e=>e.id),children:n.children.map(e=>({amount:e.amount?Zd(e.amount):0,categoryId:e.category?.id,glAccountId:e.glAccount?.id,classSegmentIds:n.classSegments.map(e=>e.id)})),matchingBankTransactionId:n.matchingBankTransaction?.id,tax:n.tax}),r.formApi.reset(r.value,{keepDefaultValues:!0}))},onSubmitInvalid:()=>{}})}const bv=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M10.6196 14.2124H4.3803C4.06894 14.2128 3.7693 14.0937 3.54327 13.8795C3.31724 13.6654 3.18207 13.3726 3.16568 13.0617L2.61591 3.22968H12.384L11.8342 13.0617C11.8179 13.3726 11.6827 13.6654 11.4567 13.8795C11.2306 14.0937 10.931 14.2128 10.6196 14.2124Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M1.3949 3.22968H13.605",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M6.27894 0.787598H8.72097C9.0448 0.787598 9.35537 0.91624 9.58435 1.14522C9.81334 1.37421 9.94198 1.68478 9.94198 2.00861V3.22963H5.05792V2.00861C5.05792 1.68478 5.18656 1.37421 5.41555 1.14522C5.64453 0.91624 5.9551 0.787598 6.27894 0.787598Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M9.09821 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M5.90167 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10})),"Delete"),fv=Rt(null,xt({position:"relative",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",outline:"none",border:"none",background:"none",padding:"15px 0px",gap:"15px",width:"100%"})),yv=Rt(null,xt({backgroundColor:"border.layout",height:"25px",width:"1px",margin:0})),Tv=Rt(null,xt({backgroundColor:"border.layout",height:"1px",width:"100%"})),xv=Rt(null,xt({background:"none",border:"none",outline:"none",marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center",padding:"4px",borderRadius:"md",cursor:"pointer","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:hover":{"& svg":{"& path":{stroke:"icon.accent.danger"}}}}),ha),kv=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px"})),wv=av({defaultValues:mv,props:{index:0,numRows:1,removeSplit:()=>{}},render:function({form:e,index:t,numRows:r,removeSplit:n}){return E(C,{children:[E("div",{...fv,children:[w(e.AppField,{name:`children[${t}].category`,children:e=>w(e.SplitExpenseCategoryField,{value:e.state.value,onChange:e.handleChange})}),E("div",{...kv,children:[w("div",{...yv}),w(e.AppField,{name:`children[${t}].amount`,children:e=>w(e.SplitExpenseAmountField,{value:e.state.value,onChange:e.handleChange,onBlur:e.handleBlur})}),w("button",{onClick:()=>n(t),...xv,children:w(Qc,{Component:bv})})]})]}),t<r-1&&w("div",{...Tv})]})}}),Cv=Rt(null,xt({display:"flex",flexDirection:"column",alignItems:"flex-start",outline:"none",border:"none",background:"none"})),Ev=xt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout.strong",display:"flex",flexDirection:"column",padding:"12px 16px",cursor:"pointer",outline:"none"}),Iv=xt({borderColor:"border.intent.danger"}),Sv=av({defaultValues:mv,render:function({form:e}){const t=ye(e.store,e=>{const t=e.errors?.[0]??{},r=Object.values(t).flat().filter(e=>"object"==typeof e&&null!==e&&"message"in e);return r[0]?.message}),r=Rt(null,Ev,t?Iv:void 0);return E(C,{children:[E("div",{...r,children:[w(ro,{children:"Category"}),w(e.AppField,{name:"children",mode:"array",children:t=>{const r=r=>{t.removeValue(r),1===t.state.value.length&&(e.setFieldValue("category",t.state.value[0].category),t.removeValue(0)),e.validate("blur")};return E("div",{...Cv,children:[t.state.value.map((n,o)=>w(wv,{form:e,index:o,numRows:t.state.value.length,removeSplit:r},`${n?.category?.id}-${o}`)),w(em,{onClick:()=>{const e=Pe(t.state.value)?.category,r=Pe(t.state.value)?.classSegments,n=Pe(t.state.value)?.glAccount;t.pushValue({amount:0,category:e||{id:"",name:""},glAccount:n||{id:""},classSegments:r||[]})}})]})}})]}),t&&w(_g,{errorMessage:t})]})}}),Av=av({defaultValues:mv,render:function({form:e}){const t=ye(e.store,e=>e.values.amount)??0;return w(e.Subscribe,{selector:e=>e.values.children,children:r=>Array.isArray(r)&&0!==r.length?w(Sv,{form:e}):w(e.AppField,{name:"children",mode:"array",children:r=>w(e.AppField,{name:"category",children:n=>w(n.ExpenseCategoryField,{category:n.state.value,glAccount:e.state.values.glAccount,onClick:n.handleChange,childrenField:r,totalAmount:t})})})})}}),Nv=Rt(null,xt({position:"absolute",right:0,top:0,left:{base:0,sm:"auto"},bottom:{base:0,sm:"auto"},height:"100%",maxHeight:"100%",maxWidth:"100%",backgroundColor:"surface.background",width:{base:"100%",sm:"512px"},minWidth:{base:"100%",sm:"fit-content"},display:"flex",_focus:{outline:"none"}}));function Pv({children:e}){const t=d(null);return b(()=>{t.current?.focus()},[]),w("div",{ref:t,tabIndex:-1,...Nv,children:e})}const Mv=Rt(null,xt({display:"flex",backgroundColor:"surface.foreground",flexDirection:"column",height:"100%",maxHeight:"100%",overflowY:"auto",overflowX:"hidden",minWidth:"fit-content",borderLeft:"1px solid {colors.border.layout.strong}",justifyContent:"flex-start",alignItems:"center",padding:5,gap:"10px"}));function Dv({children:e}){return w("div",{tabIndex:-1,...Mv,children:e})}function Rv({active:e,icon:t,onClick:r,ariaLabel:n}){return w(Rl,{ariaLabel:n,onClick:r,active:e,children:w(os,{Component:t})})}const Ov=Rt(null,xt({display:"flex",height:"100%",maxHeight:"100%",minHeight:0,flexDirection:"column",minWidth:{base:"128px",sm:"512px"},maxWidth:{base:"100%",sm:"512px"},flexGrow:1,overflow:"hidden"}));function _v({children:e}){return w("div",{...Ov,children:e})}const Lv=Object.freeze({thumbs_up:"👍",thumbs_down:"👎",red_heart:"❤️",hundred_points:"💯",eyes:"👀"});function Fv(e){return void 0!==Lv[e]}function Bv(e){return Lv[e]}const Wv=ia(e=>c.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",strokeWidth:1.5,width:24,height:24,...e},c.createElement("defs",null,c.createElement("style",null,".cls-63ce7444ea57ea6c838005ed-1{fill:none;stroke:currentColor;stroke-miterlimit:10;}")),c.createElement("path",{className:"cls-63ce7444ea57ea6c838005ed-1",d:"M6.27,21.55H8.5l2.33.95h7.92a2.86,2.86,0,0,0,2.85-2.59l.88-9.13c0-.14,0-.28,0-.42h0a2.18,2.18,0,0,0-2.18-2.18H15.63l.52-1.09a6.27,6.27,0,0,0,.62-2.73h0A2.86,2.86,0,0,0,13.91,1.5h0A1.9,1.9,0,0,0,12,3.41h0a6,6,0,0,1-1.25,3.66l-2.33,3H6.27"}),c.createElement("rect",{className:"cls-63ce7444ea57ea6c838005ed-1",x:1.5,y:9.14,width:4.77,height:13.36})),"ThumbsUp"),Hv=xt({fontSize:"26px",lineHeight:"26px",width:"26px",userSelect:"none"});function Uv({cldrShortName:e}){return w("div",{className:Hv,children:Bv(e)})}const Vv=Et({base:{padding:0,border:"none",outline:"none"},variants:{type:{sent:{cursor:"default"},received:{cursor:"pointer"}}}}),zv=xt({display:"flex",gap:"4px",backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",padding:"4px 8px",alignItems:"center",justifyContent:"center",scrollbar:"hidden",overflow:"hidden"});function jv({reactions:e,type:t,handleClick:r}){return w("div",{className:zv,children:e.map((e,n)=>w("button",{className:Vv({type:t}),onClick:"received"===t?()=>r(e.emojiCode):void 0,children:w(Uv,{cldrShortName:e.emojiCode})},`${e.emojiCode}_${n}`))})}const Kv=async({data:e,accessToken:t,environment:r})=>{const{id:n,emojiCode:o}=e,a={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:n,emojiCode:o},accessToken:t,endpointManager:ea(r)};return await mn(a)},$v=async({data:e,accessToken:t,environment:r})=>{const{id:n,emojiCode:o}=e,a={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:n,emojiCode:o},accessToken:t,endpointManager:ea(r)};return await async function(e){return Us(e)}(a)};function qv(e,t,r){return sr(ki({id:e}),t,r)}async function Yv(e){const t=ki({id:e});return nn("mutation successful, invalidating messages queries"),fr.invalidateQueries({queryKey:t}).catch(e=>on({error:e,severity:"error"}))}function Gv(e,t,r){const n=[...e];return n[r]=t,n}const Qv=xt({backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",display:"flex",justifyContent:"center",alignItems:"center",padding:"8px",cursor:"pointer"}),Xv=Object.keys(Lv).filter(Fv).map(e=>({emojiCode:e,authorInfo:[]}));function Zv({conversationId:e,messageId:t,type:r,reactions:n,reactionIsOpen:o,setReactionIsOpen:a}){const{userId:i}=p(Hl),{mutate:l}=function(e){const{userId:t,userEmail:r}=p(Hl);return Vs({mutationFn:Kv,onMutateFn:({data:n,accessToken:o,environment:a})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:r,environment:n,userId:o,userEmail:a}){const i=qv(r,t,n);await fr.cancelQueries({queryKey:i});const l=fr.getQueryData(i);return fr.setQueryData(i,t=>{const r=t.findIndex(t=>t.id===e.id);return-1===r?t:Gv(t,(n=t[r],i=e,l=o,s=a,{...n,reactions:[...n.reactions,{emojiCode:i.emojiCode,authorInfo:[{userId:l,email:s}]}]}),r);var n,i,l,s}),{oldMessages:l}}({data:n,accessToken:o,conversationId:e,environment:a,userId:t,userEmail:r})},onSettled:()=>Yv(e)})}(e);return E(pl,{placement:"top-end",open:o,onOpenChange:a,blockInteraction:!0,children:[w(ml,{children:e=>w("button",{className:Qv,...e,children:w(Qc,{Component:Wv})})}),w(El,{type:"reaction",children:w(jv,{reactions:Xv,type:r,handleClick:e=>{n.some(t=>{const r=t.emojiCode===e,n=t.authorInfo.some(e=>e.userId===i);return r&&n})||(l({id:t,emojiCode:e}),a(!1))}})})]})}const Jv=Et({base:{position:"absolute",bottom:"-25px"},variants:{type:{sent:{right:"2px"},received:{left:"2px"}}}});function eb({reactions:e,type:t,handleClick:r}){const n=Jv({type:t});return w("div",{className:n,children:w(jv,{reactions:e,handleClick:r,type:t})})}const tb=Et({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}},hasReactionsOnMessage:{true:{marginBottom:"18px"}}}}),rb=Et({base:{position:"static",display:"flex",maxWidth:325,padding:"12px 16px",flexDirection:"column",alignItems:"flex-start",borderRadius:"md",borderWidth:1,borderStyle:"solid",flexShrink:1,overflow:"wrap",wordBreak:"break-word",whiteSpace:"pre-wrap"},variants:{type:{sent:{color:"typography.intent.primary",borderColor:"border.intent.primary",backgroundColor:"surface.intent.primary"},received:{color:"typography.base",borderColor:"border.layout",backgroundColor:"surface.foreground"}}}}),nb=xt({position:"relative",display:"flex",flexDirection:"column"});function ob({conversationId:e,messageId:t,sentByCurrentUser:r,children:n,reactions:o=[]}){const a=d(null),{isHover:i,setIsHover:l,reactionIsOpen:s,setReactionIsOpen:c}=function(e){const[t,r]=m(!1),[n,o]=m(!1);return b(()=>{if(null===a.current||!i||s)return;const e=a.current,t=t=>{t.target===e||e.contains(t.target)||l(!1)};return window.addEventListener("mousemove",t),()=>{window.removeEventListener("mousemove",t)}},[i=t,a=e,s=n,l=r]),{isHover:t,reactionIsOpen:n,setIsHover:r,setReactionIsOpen:o};var a,i,l,s}(a),{mutate:u}=function(e){const{userId:t}=p(Hl);return Vs({mutationFn:$v,onMutateFn:({data:r,accessToken:n,environment:o})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:r,environment:n,userId:o}){const a=qv(r,t,n);await fr.cancelQueries({queryKey:a});const i=fr.getQueryData(a);return fr.setQueryData(a,t=>{const r=t.findIndex(t=>t.id===e.id),n=t[r];return dr(n)||0===n.reactions.length?t:Gv(t,function(e,t,r){const n=e.reactions.filter(e=>e.emojiCode!==t||!e.authorInfo.some(e=>e.userId===r));return{...e,reactions:n}}(n,e.emojiCode,o),r)}),{oldMessages:i}}({data:r,accessToken:n,conversationId:e,environment:o,userId:t})},onSettled:()=>Yv(e)})}(e),h=r?"sent":"received",g=o.filter(e=>Fv(e.emojiCode)),v=g.length>0;return E("div",{className:tb({type:h,hasReactionsOnMessage:v}),ref:a,onMouseEnter:()=>"received"===h&&l(!0),children:[E("div",{className:nb,children:[w("div",{className:rb({type:h}),children:n}),v&&w(eb,{reactions:g,type:h,handleClick:e=>u({id:t,emojiCode:e})})]}),i&&w(Zv,{conversationId:e,messageId:t,type:h,reactions:g,reactionIsOpen:s,setReactionIsOpen:c})]})}const ab=Rt(null,xt({display:"flex",flexDirection:"column-reverse",justifyContent:"center",gap:"10px",alignSelf:"stretch"}));function ib({children:e}){return w("div",{...ab,children:e})}const lb=Rt(null,xt({display:"flex",flexDirection:"column-reverse",alignItems:"flex-start",gap:"26px",flex:"1 1 0%",alignSelf:"stretch",overflowY:"auto",overflowX:"hidden",flexFlow:"column",padding:15,scrollbarWidth:"thin",maxHeight:"calc(100% + 15px)",marginBottom:"-15px"})),sb=xt({minHeight:1,width:"100%"}),cb=y(function({children:e,activeKeyboard:t,setActiveKeyboard:r,inputRef:n},o){const a=d(null);t&&n?.current?.focus();const i=v(()=>{t&&ur(n?.current)&&(r(!1),n.current.blur())},[t,n,r]);return function(e,t,r){b(()=>{const n=e.current;if(null!==n){let e=n.scrollTop,o=Date.now();const a=()=>{if(t){const{scrollVelocity:t,currentScrollTop:a,currentTime:i}=function(e,t,r){const n=e.scrollTop,o=Date.now(),a=Math.abs(n-t),i=o-r;return{scrollVelocity:i>0?a/i:0,currentScrollTop:n,currentTime:o}}(n,e,o);t>5&&r(),e=a,o=i}};return n.addEventListener("scroll",a),()=>{n.removeEventListener("scroll",a)}}},[t,r,e])}(a,t,i),E("div",{tabIndex:-1,...lb,ref:a,children:[w("div",{className:sb,ref:o}),e]})}),db=Object.freeze({message:""}),ub=xt({width:"100%"});function hb({conversationId:e,addMessage:t,blockSubmit:r,isMobile:n,scrollRef:o,setActiveKeyboard:a,inputRef:i,defaultValues:l}){const{form:s}=function({onSubmit:e,defaultValues:t}){return{form:ov({defaultValues:t??db,onSubmit:t=>{xm.safeParse(t.value).success&&(e(t),t.formApi.reset())}})}}({onSubmit:t,defaultValues:l}),c=d(null);return w("form",{className:ub,ref:c,onKeyDown:e=>function(e,t,r,n){if(!n&&!e.shiftKey&&"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),null!==t&&!r)){const e=new SubmitEvent("submit",{bubbles:!0,cancelable:!0});t.dispatchEvent(e)}}(e,c.current,r,n),onSubmit:e=>{if(!r)return e.preventDefault(),e.stopPropagation(),s.handleSubmit()},children:w(s.AppField,{name:"message",children:e=>w(e.MessageAreaInput,{blockSubmit:r,scrollRef:o,setActiveKeyboard:a,ref:i})})})}function pb(e,t){return{id:`placeholder_${e.conversationId}_${Date.now()}`,conversationId:e.conversationId,author:{userId:t??"placeholderUserId",email:"placeholderEmail"},status:"ACTIVE",createdDateTime:"",lastUpdatedDateTime:"",text:e.text,reactions:[]}}async function gb(){const e=["conversations/messages"],t=["tasks"],r=["conversations"];return nn("mutation successful, invalidating messages queries"),Promise.all([fr.invalidateQueries({queryKey:e}),fr.invalidateQueries({queryKey:t}),fr.invalidateQueries({queryKey:r})]).catch(e=>on({error:e,severity:"error"}))}const mb=async({data:e,accessToken:t,environment:r})=>(async({data:e,accessToken:t,environment:r})=>ja({data:{data:e},accessToken:t,environment:r}))({data:[e],accessToken:t,environment:r}),vb=async({data:e,accessToken:t,environment:r})=>ja({data:{data:[e]},accessToken:t,environment:r}),bb=xt({minHeight:"{borderWidths.lg}",maxHeight:"{borderWidths.lg}",width:"100%",backgroundColor:"border.layout",flex:"1 1 0",display:"flex"}),fb=xt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:5,paddingLeft:15,paddingRight:15}),yb=xt({wordBreak:"break-word",maxWidth:250,textAlign:"center"}),Tb="Marked As Resolved";function xb({resolver:e}){const t=e?`${e} ${Tb}`:Tb;return E("div",{className:fb,children:[w("div",{className:bb}),w("div",{className:yb,children:t}),w("div",{className:bb})]})}const kb=Et({variants:{width:{xs:{width:"30px"},sm:{width:"60px"},md:{width:"120px"},lg:{width:"240px"},xl:{width:"420px"}},height:{xs:{height:"5px"},sm:{height:"10px"},md:{height:"20px"},lg:{height:"40px"},xl:{height:"80px"}}}});function wb({width:e="md",height:t="md"}){return w(No,{styles:kb({width:e,height:t})})}const Cb=xt({display:"flex",flexDirection:"row-reverse"});function Eb(){return E(C,{children:[w(wb,{width:"lg",height:"lg"}),w("div",{className:Cb,children:w(wb,{width:"md",height:"lg"})}),w("div",{className:Cb,children:w(wb,{width:"lg",height:"xl"})}),w(wb,{width:"md",height:"lg"})]})}const Ib=xt({height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"8px"});function Sb({isConversationLoading:e,isFilling:t,message:r}){return e?w(ib,{children:w(ob,{conversationId:"",messageId:"",sentByCurrentUser:!0,children:r})}):!e&&t?w(ib,{children:w(Eb,{})}):E("div",{className:Ib,children:[w(eo,{stylists:[Rt(null,xt({whiteSpace:"normal",textAlign:"center"}))],children:"Send your bookkeeper a message"}),w(Ji,{wrap:"wrap",alignment:"center",children:"Typical response time is within one business day"})]})}const Ab=Rt(null,xt({display:"flex",alignItems:"center",justifyContent:"center",maxWidth:"100%",minHeight:0,height:"auto",padding:"0 15px 15px",flexDirection:"column",position:"relative"}));function Nb({conversationId:e,setConversationId:t,isResolved:r,isUnread:n,isMobile:o=!1,attachedEntityId:a,defaultValues:i}){const{userId:l}=p(Hl),{mutate:s}=function(){const{userId:e}=p(Hl);return Vs({mutationFn:Ei,onMutateFn:({data:t,accessToken:r,environment:n})=>async function({data:e,accessToken:t,environment:r,userId:n}){const o=sr(ki({id:e.conversationId}),t,r);await fr.cancelQueries({queryKey:o});const a=fr.getQueryData(o);return fr.setQueryData(o,t=>[pb(e,n),...t]),{oldMessages:a}}({data:t,accessToken:r,environment:n,userId:e}),onSettled:gb})}(),{query:{data:c},isFilling:u}=function(e){const t=ur(e);return xr({queryKey:ki({id:e??""}),queryFn:Ci,select:wi,enabled:t})}(e),{mutate:h,isPending:g,variables:v}=(I=t,S=a,Vs({mutationFn:vb,onSuccess:e=>{const t=e.data?.[0]?.data?.id;if(dr(e)||dr(t))return;I(t);const r=["conversations"],n=["banks/transactions",{}],o=["summaries",{}];let a=async()=>{},i=async()=>{};if(ur(S)){const e={id:S};Ti(S,yi.BANK_TRANSACTION)?a=async()=>{const t=pi(e);return await fr.invalidateQueries({queryKey:t})}:Ti(S,yi.FINANCIAL_SUMMARY)&&(i=async()=>await fr.invalidateQueries({queryKey:o}))}return nn("mutation successful, invalidating conversation, bank transaction, financial summary, and message queries"),Promise.all([fr.invalidateQueries({queryKey:r}),fr.invalidateQueries({queryKey:n}),a(),i()]).catch(e=>on({error:e,severity:"error"}))}})),{mutate:f}=Vs({mutationFn:mb,onSuccess:async()=>{const e=["conversations"],t=["tasks"];return nn("mutation successful, invalidating conversations queries"),Promise.all([fr.invalidateQueries({queryKey:e}),fr.invalidateQueries({queryKey:t})]).catch(e=>on({error:e,severity:"error"}))}}),[y,T]=m(!1),x=d(null),k=d(null);var I,S;b(()=>{r&&n&&e&&f({id:e,readStatus:"READ"})},[r,n,e,f]),b(()=>{km(k)},[c,k]);const A=dr(e)||dr(c)||u;return E(C,{children:[A?w(cb,{ref:k,inputRef:x,activeKeyboard:y,setActiveKeyboard:T,children:w(Sb,{isConversationLoading:g,isFilling:u,message:v?.message?.text})}):E(cb,{ref:k,activeKeyboard:y,setActiveKeyboard:T,inputRef:x,children:[r&&w(xb,{resolver:"Conversation"}),c.map((t,r)=>{const n=t[0].author.userId===l;return w(ib,{children:t.map(t=>w(ob,{conversationId:e,messageId:t.id,sentByCurrentUser:n,reactions:t.reactions,children:t.text},t.id))},r)})]}),w("div",{...Ab,children:w(hb,{scrollRef:k,inputRef:x,conversationId:e,blockSubmit:g,isMobile:o,addMessage:({value:t})=>{if(dr(e)){const e=(r=t.message,n=a,{subject:r.slice(0,40),status:"ACTIVE",readStatus:"READ",resolutionStatus:"OPEN",...ur(n)&&{attachedEntityId:n},message:{text:r}});h(e)}else s({conversationId:e,text:t.message});var r,n},setActiveKeyboard:T,defaultValues:i})})]})}const Pb=Rt(St["drawer-header"],xt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"10px 25px 10px 15px",backgroundColor:"surface.foreground",height:"55px",minHeight:"55px"}));function Mb({children:e}){return E(C,{children:[w("div",{...Pb,children:e}),w(Ja,{alignment:"horizontal",color:"strong"})]})}function Db({conversationId:e,attachedEntityId:t}){const[r,n]=m(e),{query:{data:o}}=za(r),a="CLOSED"===o?.resolutionStatus;return E(_v,{children:[w(Mb,{}),w(Nb,{conversationId:r,setConversationId:n,isResolved:a,isUnread:"UNREAD"===o?.readStatus,attachedEntityId:t})]})}const Rb=Rt(St["form-body"],xt({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",overflow:"auto",width:"512px"}));function Ob({children:e}){return w("div",{...Rb,children:e})}const _b=Rt(null,xt({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1})),Lb=Rt(null,xt({display:"flex",flexDirection:"column",flex:1,backgroundColor:"surface.background",maxHeight:"100%"})),Fb=xt({maxWidth:1,width:1,display:"flex",flexGrow:1,backgroundColor:"border.layout.strong"}),Bb=e=>{Vg(e),zg(e)},Wb=({children:e,onSubmit:t,Header:r,initialTab:n,conversationId:o,transactionId:a})=>{const[i,l]=m(n??null);return w(Pv,{children:E("div",{..._b,children:[w(_v,{children:E("form",{onSubmit:e=>{e.preventDefault(),t()},onKeyDown:Bb,...Lb,children:[r,w(Ob,{children:e})]})}),null!==i&&w("div",{className:Fb}),"conversation"===i&&w(Db,{conversationId:o,attachedEntityId:a}),w(Dv,{children:w(Rv,{active:"conversation"===i,onClick:()=>l("conversation"===i?null:"conversation"),icon:Ts,ariaLabel:"conversation-tab"})})]})})},Hb=Rt(null,xt({display:"flex",flexDirection:"column",margin:"0 0 7px 0",padding:0,justifyContent:"center",minHeight:"36px",backgroundColor:"surface.background",gap:"4px"}));function Ub({transaction:e,bankAccount:t}){const r=e?e.description:"",n=dr(t)||dr(e)?"":((e,t)=>{const r="BANK_TRANSFER"===t.type,n=Dh(t.amount);return`${r?`${n} `:""}${Mh(e.apiAccountName,e.apiAccountNo)}`})(t,e);return E("div",{...Hb,children:[w(eo,{wrap:"wrap",children:r}),t&&w(ro,{children:n})]})}const Vb=Rt(null,xt({display:"flex",backgroundColor:"surface.intent.action.discrete",border:"none",padding:"6px",margin:0,borderRadius:"sm",outline:"none",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"},"&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"}}),da);function zb({Icon:e=vl}={}){return w("button",{...Vb,onClick:()=>ci(),type:"button",children:w(Qc,{Component:e,...Vb})})}const jb=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_9779_2768)"},c.createElement("path",{d:"M2.70654 9.12132C3.60197 9.12132 4.32787 8.39543 4.32787 7.49999C4.32787 6.60456 3.60197 5.87866 2.70654 5.87866C1.8111 5.87866 1.08521 6.60456 1.08521 7.49999C1.08521 8.39543 1.8111 9.12132 2.70654 9.12132Z",fill:"currentColor"}),c.createElement("path",{d:"M8.32496 9.12132C9.22039 9.12132 9.94629 8.39543 9.94629 7.49999C9.94629 6.60456 9.22039 5.87866 8.32496 5.87866C7.42952 5.87866 6.70363 6.60456 6.70363 7.49999C6.70363 8.39543 7.42952 9.12132 8.32496 9.12132Z",fill:"currentColor"}),c.createElement("path",{d:"M13.9434 9.12132C14.8388 9.12132 15.5647 8.39543 15.5647 7.49999C15.5647 6.60456 14.8388 5.87866 13.9434 5.87866C13.048 5.87866 12.3221 6.60456 12.3221 7.49999C12.3221 8.39543 13.048 9.12132 13.9434 9.12132Z",fill:"currentColor"}))),"Dots");function Kb({children:e}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>w(Rl,{popupTriggerProps:e,children:w(ga,{Component:jb})})}),w(El,{children:e})]})}const $b="ACTIVE",qb="INACTIVE";function Yb({transaction:e}){const{mutate:t}=Xu(),r=()=>t([e].map(e=>({id:e.id,status:qb})));return w(vu,{onClick:()=>{return e=r,void ic({title:"Delete transaction",body:"Are you sure you want to delete this transaction?",buttons:[{key:Zs,label:"Cancel"},{key:Js,label:"Delete",type:ac}]}).then(t=>{t===Js&&e()});var e},children:w(eo,{children:"Delete"})})}function Gb({transaction:e}){const{mutate:t}=Xu();return w(vu,{onClick:()=>{t([e].map(e=>({id:e.id,status:$b})))},children:w(eo,{children:"Restore"})})}const Qb=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px",flexShrink:1}),On);function Xb({children:e}){return w("div",{...Qb,children:e})}const Zb=av({defaultValues:mv,props:{title:"Transaction",transaction:null},render:function({form:e,title:t,transaction:r}){return E(Mb,{children:[E(Xb,{children:[w(zb,{}),w(eo,{children:t}),w(Kb,{children:E(pu,{children:[r?.status===$b&&w(Yb,{transaction:r}),r?.status===qb&&w(Gb,{transaction:r})]})})]}),w(e.Subscribe,{selector:e=>e.isDefaultValue,children:t=>t?null:w(e.SaveButton,{})})]})}});function Jb({transactionId:e}){const{query:{data:t,isFetching:r},isFilling:n}=bi({id:e});return{transaction:t,form:vv(t),bankAccount:Sc(t?.bankAccount.id),showBankAccountField:!dr(t)&&Lm(t),isLoading:n||r&&!t}}function ef({transactionId:e,initialTab:t}){const{transaction:r,form:n,bankAccount:o,showBankAccountField:a,isLoading:i}=Jb({transactionId:e});if(i)return null;const l=w(Zb,{form:n,transaction:r,title:"Expense"}),s=r?.conversation?.id??null;return E(Wb,{onSubmit:n.handleSubmit,Header:l,initialTab:t,conversationId:s,transactionId:e,children:[r?.description&&w(Ub,{transaction:r,bankAccount:o}),w(n.AppField,{name:"amount",children:e=>w(e.DiscreteAmountField,{label:"Total"})}),w(n.AppField,{name:"date",children:e=>w(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date})}),w(Av,{form:n}),a&&w(n.AppField,{name:"bankAccount",children:e=>w(e.BankAccountField,{transaction:r})}),w(n.AppField,{name:"notes",children:e=>w(e.TextAreaInput,{label:"Note"})})]})}function tf({transactionId:e,initialTab:t}){const{transaction:r,form:n,bankAccount:o,isLoading:a}=Jb({transactionId:e});if(a)return null;const i=w(Zb,{form:n,transaction:r,title:"Bank Transfer"}),l=r?.conversation?.id??null;return E(Wb,{onSubmit:n.handleSubmit,Header:i,initialTab:t,conversationId:l,transactionId:e,children:[r?.description&&w(Ub,{transaction:r,bankAccount:o}),w(n.AppField,{name:"amount",children:e=>w(e.DiscreteAmountField,{label:"Total"})}),w(n.AppField,{name:"date",children:e=>w(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date})}),w(n.AppField,{name:"bankAccount",children:e=>w(e.BankAccountField,{transaction:r})}),w(n.AppField,{name:"glAccount",children:e=>w(e.BankGlAccountField,{transaction:r})}),w(n.AppField,{name:"matchingBankTransaction",children:e=>w(e.MatchingBankTransferField,{transaction:r})}),w(n.AppField,{name:"notes",children:e=>w(e.TextAreaInput,{label:"Note"})})]})}function rf({transactionId:e,initialTab:t}){const{transaction:r,form:n,bankAccount:o,showBankAccountField:a,isLoading:i}=Jb({transactionId:e});if(i)return null;const l=w(Zb,{form:n,transaction:r,title:"Income"}),s=r?.conversation?.id??null;return E(Wb,{onSubmit:n.handleSubmit,Header:l,initialTab:t,conversationId:s,transactionId:e,children:[r?.description&&w(Ub,{transaction:r,bankAccount:o}),w(n.AppField,{name:"amount",children:e=>w(e.DiscreteAmountField,{label:"Total"})}),w(n.AppField,{name:"date",children:e=>w(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date})}),w(n.AppField,{name:"glAccount",children:e=>w(e.GlAccountField,{})}),a&&w(n.AppField,{name:"bankAccount",children:e=>w(e.BankAccountField,{transaction:r})}),w(n.AppField,{name:"notes",children:e=>w(e.TextAreaInput,{label:"Note"})})]})}function nf({transactionId:e,initialTab:t}){const{transaction:r,form:n,bankAccount:o,showBankAccountField:a,isLoading:i}=Jb({transactionId:e});if(i)return null;const l=w(Zb,{form:n,transaction:r,title:"Tax Payment"}),s=r?.conversation?.id??null;return E(Wb,{Header:l,onSubmit:n.handleSubmit,initialTab:t,conversationId:s,transactionId:e,children:[r?.description&&w(Ub,{transaction:r,bankAccount:o}),w(n.AppField,{name:"amount",children:e=>w(e.DiscreteAmountField,{label:"Total"})}),w(n.AppField,{name:"date",children:e=>w(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date})}),w(n.AppField,{name:"tax.paymentInfo.region",children:e=>w(e.ButtonGroupField,{label:"Region",options:dv})}),w(n.AppField,{name:"tax.paymentInfo.quarter",children:e=>w(e.ButtonGroupField,{label:"Quarter",options:uv})}),w(n.AppField,{name:"tax.paymentInfo.year",children:e=>w(e.GenericSelectorField,{label:"Year",options:Xt({startYear:/* @__PURE__ */(new Date).getFullYear()+1}).map(e=>({value:e,label:String(e)}))})}),a&&w(n.AppField,{name:"bankAccount",children:e=>w(e.BankAccountField,{transaction:r})}),w(n.AppField,{name:"notes",children:e=>w(e.TextAreaInput,{label:"Note"})})]})}function of({transactionId:e,initialTab:t}){const{query:{data:r},isFilling:n}=bi({id:e});if(b(()=>{!n&&dr(r)&&ci()},[r,n]),dr(r))return null;switch(r.type){case"EXPENSE":return w(ef,{transactionId:e,initialTab:t});case"BANK_TRANSFER":return w(tf,{transactionId:e,initialTab:t});case"REVENUE":return w(rf,{transactionId:e,initialTab:t});case"TAX_PAYMENT":return w(nf,{transactionId:e,initialTab:t})}}const af={transform(e){const{justify:t,gap:r,...n}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:r,flexDirection:"column",...n}},defaultValues:{gap:"10px"}},lf=(e={})=>{const t=ht(af,e);return af.transform(t,ut)},sf=e=>xt(lf(e));sf.raw=lf;const cf={transform(e){const{justify:t,gap:r,...n}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:r,flexDirection:"row",...n}},defaultValues:{gap:"10px"}},df=(e={})=>{const t=ht(cf,e);return cf.transform(t,ut)},uf=e=>xt(df(e));function hf({subject:e,children:t}){return E(Mb,{children:[E(Xb,{children:[w(zb,{}),w(eo,{children:e})]}),w("div",{className:uf({alignItems:"center",gap:15}),children:t})]})}function pf({conversationId:e,defaultValues:t}){const[r,n]=m(e),{query:{data:o}}=za(r),a="CLOSED"===o?.resolutionStatus;return w(Pv,{children:E(_v,{children:[w(hf,{subject:o?.subject??"Conversation"}),w(Nb,{conversationId:r,setConversationId:n,isResolved:a,isUnread:"UNREAD"===o?.readStatus,defaultValues:t})]})})}uf.raw=df;const gf=ia(e=>c.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_18201_5557)"},c.createElement("path",{d:"M7.5 14.0625C11.1244 14.0625 14.0625 11.1244 14.0625 7.5C14.0625 3.87563 11.1244 0.9375 7.5 0.9375C3.87563 0.9375 0.9375 3.87563 0.9375 7.5C0.9375 11.1244 3.87563 14.0625 7.5 14.0625Z",strokeWidth:.9375,strokeMiterlimit:10}),c.createElement("path",{d:"M7.49999 10.4812V6.30624H6.30624",strokeWidth:.9375,strokeMiterlimit:10}),c.createElement("path",{d:"M6.30624 10.4813H8.69374",strokeWidth:.9375,strokeMiterlimit:10}),c.createElement("path",{d:"M6.90625 4.51874H8.09375",strokeWidth:.9375,strokeMiterlimit:10})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_18201_5557"},c.createElement("rect",{width:15,height:15,fill:"white"})))),"Info");function mf({onClick:e,active:t}){return w(Ki,{type:"button",onClick:e,active:t,children:w(Qc,{Component:gf})})}const vf=xt({display:"flex",flexDirection:"column"});function bf({label:e,data:t,isFilling:r,shimmerWidth:n}){return E("div",{className:vf,children:[w(ro,{children:e}),r?w(wb,{width:n}):w(eo,{wrap:"wrap",children:t??""})]})}function ff({transactionId:e,isOpen:t}){const{query:{data:r},isFilling:n}=bi({id:e}),o=Sc(r?.bankAccount.id);if(dr(r))return null;const a=sf({alignItems:"stretch",gap:5,paddingLeft:16,paddingRight:16,backgroundColor:"surface.foreground",borderWidth:0,borderBottomStyle:"solid",borderColor:"border.layout.strong",maxHeight:0,overflow:"hidden",transition:"all 300ms ease-out","&[data-open='true']":{maxHeight:"1/3",paddingTop:16,paddingBottom:16,borderWidth:"lg",overflow:"scroll"}});return E("div",{"data-open":t,className:a,children:[E("div",{className:uf({justifyContent:"space-between"}),children:[w(bf,{label:"Date",data:r?.date,isFilling:n,shimmerWidth:"md"}),w(bf,{label:"Amount",data:Qn(Xd(r.amount)),isFilling:n,shimmerWidth:"sm"})]}),w(bf,{label:"Bank Account",data:Mh(o?.apiAccountName,o?.apiAccountNo),isFilling:n,shimmerWidth:"lg"}),w(bf,{label:"Description",data:r?.description,isFilling:n,shimmerWidth:"lg"})]})}function yf({conversationId:e,transactionId:t}){const[r,n]=m(e),[o,a]=m(!0),{query:{data:i}}=za(r),l="CLOSED"===i?.resolutionStatus;return w(Pv,{children:E(_v,{children:[w(hf,{subject:i?.subject??"Conversation",children:ur(t)&&w(mf,{onClick:()=>a(!o),active:o},"infoButton")}),ur(t)&&w(ff,{transactionId:t,isOpen:o}),w(Nb,{conversationId:r,setConversationId:n,isResolved:l,isUnread:"UNREAD"===i?.readStatus})]})})}const Tf=xt({marginBottom:"20px"}),xf=xt({display:"flex",marginBlock:"20px",flexDirection:"column",gap:"15px"});function kf({title:e,children:t}){return E("div",{className:Tf,children:[w(ro,{children:e}),w("div",{className:xf,children:t}),w(Ja,{alignment:"horizontal"})]})}const wf=e=>["plaidInstitutionLogo",e??{}];function Cf(e){const t=mr(),r=Tr();return A({queryKey:wf({institutionId:e,accessToken:t,environment:r}),queryFn:async()=>await cc({institutionId:e,accessToken:t,environment:r}),staleTime:864e5}).data?.map.logo}const Ef=xt(Fi,{minWidth:"100%",padding:"10px"}),If=xt({display:"flex",justifyContent:"space-between",alignItems:"center",minWidth:"100%",width:"100%",height:"25px",gap:"15px"}),Sf=xt({display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",gap:"12px"}),Af=xt({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"});function Nf({plaidItem:e}){const{linkPlaid:t}=hc(e.id),r=Cf(e.apiInstitutionId);return w("button",{className:Ef,onClick:()=>t(),children:E("span",{className:If,children:[E("div",{className:Sf,children:[r?w("img",{src:r,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):w(os,{Component:fh}),w(eo,{children:e.apiInstitutionName})]}),E("div",{className:Af,children:[w(ga,{Component:Gc}),w(Ji,{children:"Relink"})]})]})})}const Pf=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M6.19899 11.5105C8.9944 11.5105 11.2605 9.2444 11.2605 6.44899C11.2605 3.65358 8.9944 1.38745 6.19899 1.38745C3.40358 1.38745 1.13745 3.65358 1.13745 6.44899C1.13745 9.2444 3.40358 11.5105 6.19899 11.5105Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M15.05 15.3L9.67714 9.92712",stroke:"#182428",strokeMiterlimit:10})),"Search"),Mf=xt(Fi,{minWidth:"100%",justifyContent:"start",paddingBlock:"10px",marginBottom:"5px"}),Df=xt({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),Rf=xt({display:"flex",flexDirection:"column",alignItems:"start",width:"100%",marginInline:"15px"});function Of(){const{linkPlaid:e}=hc();return w("button",{className:Mf,onClick:()=>e(),children:E("div",{className:Df,children:[w(Qc,{Component:Pf}),E("div",{className:Rf,children:[w(eo,{children:"Connect your bank"}),w(ro,{children:"Find your banking institution with Plaid"})]}),w(Qc,{Component:sa})]})})}const _f=xt({padding:"10px 20px",minWidth:"100%",height:"45px"}),Lf=xt({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function Ff({bank:e}){const t=Cf(e.institutionName);return w("div",{className:_f,children:E("div",{className:Lf,children:[t?w("img",{src:t,alt:`${e.displayName} logo`,width:"25px",height:"25px"}):w(os,{Component:fh}),w(eo,{children:e.displayName})]})})}const Bf=xt({minWidth:"100%",height:"45px"});function Wf(){return E(C,{children:[w(No,{styles:Bf}),w(No,{styles:Bf}),w(No,{styles:Bf})]})}const Hf=xt({margin:"15px"});function Uf(){const{query:{data:e},isFilling:t}=Ks(),r=ur(e)&&e.length>0,n=Le(e=>e.drawerHistory).length>1,o=new Set(e?.map(e=>e.apiInstitutionName)??[]),a=sc.filter(e=>!o.has(e.displayName));return w(Pv,{children:E(_v,{children:[w(Mb,{children:E(Xb,{children:[w(zb,n?{Icon:la}:{}),w(eo,{children:"Add New Connection"})]})}),E("div",{className:Hf,children:[(t||r)&&w(kf,{title:"Already Connected",children:t?w(Wf,{}):e?.map(e=>w(Nf,{plaidItem:e},e.id))}),E(kf,{title:"Banks",children:[w(Of,{}),a.length>0&&E(C,{children:[w("div",{className:xt({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"}),children:a.map(e=>w(Ff,{bank:e},e.institutionName))}),w(eo,{children:"...and 12,000+"})]})]})]})]})})}function Vf(){return w(Mb,{children:E(Xb,{children:[w(zb,{}),w(eo,{children:"Financial Summary"})]})})}const zf=xt({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",width:"512px",overflow:"scroll"}),jf=Wt.raw({body:"default"}),Kf=xt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"md",padding:"12px",whiteSpace:"pre-wrap",overflowWrap:"break-word"},jf);function $f({summaryText:e}){return w("div",{className:zf,children:w("div",{className:Kf,children:e})})}const qf=xt({display:"flex",flexDirection:"column",overflow:"auto"});function Yf({summary:e}){return E("div",{className:qf,children:[w(Vf,{}),w($f,{summaryText:e})]})}const Gf=xt({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1});function Qf({summaryId:e,conversationId:t}){const{query:{data:r}}=function({id:e}){return xr({queryKey:Ai({id:e}),queryFn:Pi})}({id:e});return w(Pv,{children:E("div",{className:Gf,children:[w(_v,{children:w(Yf,{summary:r?.summary})}),w(Ja,{}),w(Db,{conversationId:t??null,attachedEntityId:e})]})})}const Xf=xt({display:"flex",flexDirection:"column",gap:"16px"});function Zf({id:e,apiInstitutionName:t}){const{mutate:r}=qs(),n=gl(),{linkPlaid:o}=hc(e,()=>n?.setOpen(!1));return E(pu,{children:[w(vu,{onClick:()=>o(),children:w(eo,{children:"Add Account"})}),w(vu,{onClick:()=>(async()=>{const o=await(async e=>ic({title:"Remove Institution",body:w("div",{className:Xf,children:w(Ji,{wrap:"wrap",children:`Would you like to unlink ${e} altogether? If you unlink now and relink ${e} again in the future, you may see duplicate transactions.`})}),buttons:[{key:Zs,label:"Cancel"},{key:Js,label:"Remove",type:ac}]}))(t);n?.setOpen(!1),o===Js&&r({id:String(e)})})(),children:w(eo,{children:"Remove Institution"})})]})}const Jf=xt({borderTop:"{colors.border.layout.strong} {borderWidths.md} solid"});function ey({children:e}){return w("div",{className:Jf,children:e})}const ty=xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:"20px",paddingBottom:"14px",paddingLeft:"15px",paddingRight:"15px",backgroundColor:"surface.foreground"});function ry({children:e}){return w("div",{className:ty,children:e})}function ny({plaidItem:e}){const{alert:t,actions:r}=xc(e);return E(np,{type:"critical",onClick:()=>{kc(t,r)},children:[w(Qc,{Component:Hh}),w(ro,{children:"Fix Bank Error"}),w(ga,{Component:sa})]})}const oy=xt({display:"flex",flexDirection:"column",alignItems:"start",justifyContent:"flex-start",textAlign:"start",gap:"5px",maxWidth:"100%"});function ay({accountName:e,accountNo:t,syncText:r,active:n=!0}){return E("div",{className:oy,children:[r&&w(ro,{intent:n?"normal":"danger",children:r}),w(eo,{children:e}),t&&w(eo,{children:Ph(t)})]})}const iy=Et({base:{padding:"15px",borderBottom:"{borderWidths.md} solid",borderColor:"border.layout.weak",backgroundColor:"surface.foreground",display:"flex",borderTop:"none",borderLeft:"none",borderRight:"none",width:"100%",justifyContent:"space-between",alignItems:"center"},variants:{active:{true:{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",cursor:"pointer"}}}}});function ly({bankAccountId:e,apiAccountName:t,apiAccountNo:r,syncText:n,active:o}){const a=wt(iy({active:o}),da);return E("button",{className:a,onClick:()=>{si("BankAccountForm",{routeProps:{bankAccountId:e}})},disabled:!o,children:[w(ay,{accountName:t,accountNo:r,syncText:n,active:o}),o&&w(Qc,{Component:sa})]})}const sy=xt({overflow:"hidden"}),cy=e=>{let t;return t=e.isSupported?e.lastApiSyncedDate?`Last synced ${lr(e.lastApiSyncedDate)}`:e.syncTransactions?"Processing":"Not Synced":"Not Supported",t};function dy({plaidItem:e,plaidItemAccounts:t,itemIndex:r,numPlaidItems:n}){const o=1===n,{expanded:a,toggleExpanded:i}=function(e,t){const r=Le(e=>e.toggleExpandedPlaidItem),n=Le(e=>e.expandedPlaidItems);return{toggleExpanded:r,expanded:Le(e=>e.hasExpandedUpdated)?n.includes(e):t}}(e.id,o),l=r===n-1;return E(ey,{children:[E(ry,{children:[E(Xb,{children:[w(eo,{children:e.apiInstitutionName}),w(Kb,{children:w(Zf,{id:e.id,apiInstitutionName:e.apiInstitutionName})})]}),E(Xb,{children:[ur(e.apiErrorCode)&&w(ny,{plaidItem:e}),w(Rl,{active:!1,onClick:()=>i(e.id,o),children:w(ga,{Component:a?cp:dp})})]})]}),a&&w("div",{className:sy,children:t.map(e=>w(ly,{bankAccountId:e.id,apiAccountNo:e.apiAccountNo,apiAccountName:e.apiAccountName,syncText:cy(e),active:e.isSupported},e.id))}),!l&&w(Ja,{alignment:"horizontal",color:"strong"})]})}const uy=xt({overflow:"hidden"});function hy({manualBankAccounts:e}){return E(ey,{children:[w(ry,{children:w(Xb,{children:w(eo,{children:"Manually Tracked Accounts"})})}),w("div",{className:uy,children:e.map(e=>w(ly,{bankAccountId:e.id,apiAccountName:e.apiAccountName,apiAccountNo:e.apiAccountNo,active:"ACTIVE"===e.status},e.id))})]})}const py=Et({base:{display:"flex",flexDirection:"row",border:"{borderWidths.lg} solid",borderColor:"border.layout"},variants:{width:{full:{width:"100%"}}}});function gy({width:e,children:t}){return w("div",{className:py({width:e}),children:t})}function my({options:e,handleClick:t,selected:r}){return w(gy,{width:"full",children:e.map(e=>w(Xm,{option:e,handleClick:t,selected:r,width:"full",backgroundColor:"foreground"},e.value))})}const vy=xt({display:"flex",flexDirection:"column",padding:"15px"});function by({task:e}){return w("div",{className:vy,children:w(Zp,{task:e})})}const fy=xt({display:"flex",flexDirection:"column",gap:"15px",position:"relative",marginTop:"15px"}),yy=xt({overflowY:"auto",position:"relative"}),Ty=Et({base:{paddingTop:"20px",paddingBottom:"20px",display:"flex",justifyContent:"center",alignItems:"center",position:"sticky",bottom:0},variants:{hasPlaidItems:{true:{borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"}}}}),xy=[{label:"Connected Accounts",value:"connected"},{label:"Manually Tracked Banks",value:"manual"}];function ky(){const e=Ee(),{linkPlaid:t}=hc(),{query:{data:r}}=Ks(),{query:{data:n}}=Ic({select:e=>{return{plaidItemAccounts:(t=e?.data,t?.filter(e=>"PLAID"===e.apiName&&("ACTIVE"===e.status||!1===e.isSupported))),manualAccounts:Pc(e?.data)};var t}}),o=n?n.plaidItemAccounts:null,a=n?n.manualAccounts:null,i=r&&o&&((e,t)=>{const r=/* @__PURE__ */new Map;return e.forEach(e=>r.set(e.id,{...e,plaidItemAccounts:[]})),t.forEach(e=>{r.get(e.integrationId)?.plaidItemAccounts.push(e)}),[...r.values()]})(r,o),l=i?i.length:0,s=r?.find(e=>e.apiErrorCode),c=s&&Cc(s,!1),d=Le(e=>e.banksAndIntegrationsSelectedTab),u=Le(e=>e.setBanksAndIntegrationsSelectedTab),h="connected"===d.value,p=h?"Add New Connection":"Add New Account";return w(Pv,{children:E(_v,{children:[w(Mb,{children:E(Xb,{children:[w(zb,{}),w(eo,{children:"Banks & Integrations"})]})}),c&&w(by,{task:c}),w(my,{options:xy,handleClick:e=>u(e),selected:d}),w("div",{className:yy,children:w("div",{className:fy,children:h?i&&i.map((e,t)=>w(dy,{plaidItem:e,plaidItemAccounts:e.plaidItemAccounts,itemIndex:t,numPlaidItems:l},e.id)):a&&w(hy,{manualBankAccounts:a})})}),w("div",{className:Ty({hasPlaidItems:l>0}),children:E(Zg,{onClick:()=>{h?e?si("NewPlaidConnection"):t():si("BankAccountForm")},children:[w(Qc,{Component:Di}),w(eo,{children:p})]})})]})})}const wy=async({data:e,accessToken:t,environment:r})=>{const n={path:"/banks/account",bodyParams:{account:e},accessToken:t,endpointManager:xn(r)};return await vn(n)},Cy=async({data:e,accessToken:t,environment:r})=>wy({data:e,accessToken:t,environment:r}),Ey=async({data:e,accessToken:t,environment:r})=>wy({data:e,accessToken:t,environment:r});function Iy(e){return Vs({onSuccess:async()=>{nn("mutation successful, invalidating bank account queries");try{return fr.invalidateQueries({queryKey:["banks/accounts"]})}catch(e){e instanceof Error&&on({error:e,severity:"error"})}},...e})}function Sy(){return Iy({mutationFn:Ey})}const Ay=s.object({id:s.string(),apiAccountName:s.string({message:"Required"}).refine(e=>e.trim().length>0,{message:"Required"}),apiAccountNo:s.string({message:"Required"}).refine(e=>e.trim().length<=4,{message:"Must be 4 digits or less"}).refine(e=>e.trim().length>0,{message:"Required"}),apiAccountType:s.enum(["DEPOSITORY","CREDIT"],{message:"Required"})}),Ny=ia(e=>c.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M11.7346 14.5L11.7346 12.9152C11.7333 12.2895 11.5704 11.6747 11.2616 11.1305C10.9528 10.5863 10.5087 10.1311 9.97233 9.80895L7.43662 8.29386C6.90079 7.97055 6.45795 7.51384 6.1513 6.96831C5.84465 6.42279 5.68467 5.80708 5.68698 5.18127L5.68698 3.60913",strokeMiterlimit:10}),c.createElement("path",{d:"M5.68701 1.1875L5.68701 14.5",strokeMiterlimit:10}),c.createElement("path",{d:"M3.26538 3.60911L5.68699 1.1875L8.10859 3.60911",strokeMiterlimit:10}),c.createElement("path",{d:"M5.68701 7.24146L5.68701 2.39825",strokeMiterlimit:10})),"Merge"),Py={transform:"none",willChange:"auto"};function My({children:e}){return w(El,{style:Py,children:e})}const Dy=xt({backgroundColor:"overlay",display:"flex",justifyContent:"center",alignItems:"center"}),Ry=Rt(null,Dy);function Oy({children:e,clickHandler:t}){const r=gl();return t||(t=()=>{r.setOpen(!1)}),w(ce,{lockScroll:!0,...Ry,onClick:t,children:e})}const _y=Rt(St["modal-popup"],xt({display:"flex",justifyContent:"center",flexDirection:"column",minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"},minHeight:"200px",height:"fit-content",backgroundColor:"surface.background",borderRadius:"md",padding:"15px",position:"relative"}));function Ly({children:e}){return w("div",{..._y,onClick:e=>{e.stopPropagation()},children:e})}const Fy=xt({display:"flex",gap:"10px",maxWidth:"100%"});function By({accountName:e,accountNo:t,institutionId:r,syncText:n,active:o=!0,showIcon:a=!0}){const i=Cf(r);return E("div",{className:Fy,children:[i&&a?w("img",{src:i,alt:"Bank Logo",width:"25px",height:"25px"}):w(os,{Component:fh}),w(ay,{accountName:e,accountNo:t,active:o,syncText:n})]})}const Wy="TRIGGER_ACCOUNT",Hy="FORM_SELECTABLE_ACCOUNT";function Uy({onClick:e,excludedAccountId:t}){const{query:{data:r},isFilling:n}=Ic(),o=r?.data?.filter(e=>e.glAccountId&&e.isSupported&&e.id!==t);return w(Bm,{bankAccounts:o,isFilling:n,onClick:e})}const Vy=xt({maxWidth:"100%",display:"flex",gap:"10px",alignItems:"center"});function zy({selectedAccount:e,setSelectedAccount:t,mergeDestination:r,excludedAccountId:n}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>w(Ki,{...t,width:"fill-parent",children:w(fu,{children:e?Mh(e?.apiAccountName,e?.apiAccountNo):E("div",{className:Vy,children:[w(Ji,{children:r===Wy?"Select Duplicate Bank Account":"Select Destination Bank Account"}),w(ga,{Component:Di})]})})})}),w(Uy,{onClick:t,excludedAccountId:n})]})}const jy=[Rt(null,xt({"& path":{stroke:"icon.base"}}))];function Ky({showIcon:e=!0,textContent:t="Cancel",onClick:r}){return E(Ki,{type:"button",onClick:r,children:[e&&w(ga,{Component:vl,stylists:jy}),w(eo,{children:t})]})}const $y=xt({display:"flex",flexDirection:"column",gap:"16px"}),qy={mergeDestination:Hy,selectedAccount:null};const Yy=xt({display:"flex",flexDirection:"column",gap:"20px"}),Gy=xt({display:"grid",gridTemplateColumns:{sm:"300px auto 300px",base:"100%"},gap:"10px",rowGap:"25px",justifyContent:"space-between",paddingLeft:"10px",paddingRight:"10px"}),Qy=xt.raw({display:"flex",flexDirection:"column",gap:"15px",width:"100%",maxWidth:"300px",height:"100%",justifyContent:"space-between"}),Xy=xt(Qy,{placeSelf:{sm:"flex-start",base:"center"},alignItems:{sm:"flex-start",base:"center"},maxWidth:{sm:"300",base:"auto"}}),Zy=xt(Qy,{placeSelf:"center",alignItems:"center"}),Jy=xt(Qy,{placeSelf:{sm:"flex-end",base:"center"},alignItems:{sm:"flex-end",base:"center"},maxWidth:{sm:"300",base:"auto"}}),eT=xt({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),tT=xt({justifyContent:"center",display:"flex",transform:{sm:"none",base:"rotate(90deg)"}}),rT=xt({width:"100%",display:"flex",justifyContent:"flex-start"}),nT=xt({width:"100%",display:"flex",justifyContent:{sm:"center",base:"flex-start"}}),oT=xt({width:"100%",display:"flex",justifyContent:{sm:"flex-end",base:"flex-start"}}),aT=e=>{Vg(e),zg(e)};function iT({account:e}){const t=gl(),r=function(e,t){const{mutateAsync:r}=Sy();return ov({defaultValues:qy,onSubmit:async n=>{if(await(async()=>ic({title:"Merge Accounts",body:E("div",{className:$y,children:[w(Ji,{wrap:"wrap",children:"The selected accounts and their transactions will be merged into your linked accounts."}),w(Ji,{wrap:"wrap",children:"This action can't be undone."}),w(Ji,{wrap:"wrap",children:"It may take a few minutes for this process to complete."})]}),buttons:[{key:Zs,label:"Cancel"},{key:Js,label:"Continue",type:ac}]}))()===Js&&ur(e)&&ur(n.value.selectedAccount)){const l=(o=e,a=n.value.mergeDestination,i=n.value.selectedAccount,a===Hy?{...Oh(i),duplicateBankAccountIds:[Rh(o.id)]}:{...Oh(o),duplicateBankAccountIds:[Rh(i.id)]});r(l).then(()=>{t.setOpen(!1),n.value.mergeDestination===Hy&&ci()}).catch(()=>{ic({title:"Merge Failed",body:w(Ji,{wrap:"wrap",children:"There was an error merging your bank accounts. Please try again later."}),buttons:[{key:Zs,label:"OK"}]})})}var o,a,i},onSubmitInvalid:()=>{}})}(e,t);return E("form",{className:Yy,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),r.handleSubmit()},onKeyDown:aT,children:[w(eo,{children:"Merge Accounts"}),w("div",{className:Gy,children:w(r.Subscribe,{selector:e=>e.values.mergeDestination,children:t=>E(C,{children:[E("div",{className:Xy,children:[w("div",{className:rT,children:w(eo,{children:"Duplicate Account"})}),t===Hy?w(By,{accountName:e?.apiAccountName,accountNo:e?.apiAccountNo,institutionId:e?.apiInstitutionId}):w(r.AppField,{name:"selectedAccount",children:r=>w(zy,{selectedAccount:r.state.value,setSelectedAccount:r.handleChange,mergeDestination:t,excludedAccountId:e?.id})})]}),E("div",{className:Zy,children:[w("div",{className:nT,children:w(eo,{children:"Into"})}),w(r.AppField,{name:"mergeDestination",children:e=>w("div",{className:tT,children:w(Ki,{onClick:()=>e.handleChange(e.state.value===Hy?Wy:Hy),children:w(Qc,{Component:sa})})})})]}),E("div",{className:Jy,children:[w("div",{className:oT,children:w(eo,{children:"Destination Account"})}),t===Hy?w(r.AppField,{name:"selectedAccount",children:r=>w(zy,{selectedAccount:r.state.value,setSelectedAccount:r.handleChange,mergeDestination:t,excludedAccountId:e?.id})}):w(By,{accountName:e?.apiAccountName,accountNo:e?.apiAccountNo,institutionId:e?.apiInstitutionId})]})]})})}),E("div",{className:eT,children:[w(Ky,{showIcon:!1,onClick:()=>{t.setOpen(!1)}}),w(r.Subscribe,{selector:e=>e.values.selectedAccount,children:e=>w(Dg,{disabled:dr(e),showIcon:!1,textContent:"Merge"})})]})]})}function lT({bankAccount:e}){return w(pu,{children:E(pl,{placement:"right-start",modal:!0,children:[w(ml,{children:e=>E(vu,{...e,children:[w(Qc,{Component:Ny}),w(eo,{children:"Merge Accounts"})]})}),w(My,{children:w(Oy,{children:w(Ly,{children:w(iT,{account:e})})})})]})})}const sT={id:"",apiAccountName:"",apiAccountNo:"",apiAccountType:void 0};const cT=[{value:"DEPOSITORY",label:"Bank Account"},{value:"CREDIT",label:"Credit Card"}],dT=e=>{Vg(e),zg(e)};function uT({bankAccountId:e}){const t=Sc(e),[r,n]=m(t??sT),o=function(e,t){const{mutate:r}=Sy(),{mutateAsync:n}=Iy({mutationFn:Cy}),o=pr(String(e.id));return ov({defaultValues:e,validators:{onBlur:Ay},onSubmit:async e=>{if(o)r(Oh(e.value)),t(e.value),e.formApi.reset(e.value,{keepDefaultValues:!0});else{const r=await n((a=e.value,{apiAccountName:a.apiAccountName,apiAccountNo:a.apiAccountNo,apiAccountType:a.apiAccountType,duplicateBankAccountIds:[]}));t(r.dataObject||sT),e.formApi.reset(r.dataObject,{keepDefaultValues:!0})}var a},onSubmitInvalid:()=>{}})}(r,n),a="PLAID"===t?.apiName,i=Mh(r?.apiAccountName,r?.apiAccountNo),l=pr(i)?i:"New Bank Account",s=Le(e=>e.FEATUREFLAG_HAS_MERGE_ACCOUNTS);return w(Pv,{children:w(_v,{children:E("form",{onSubmit:e=>{e.preventDefault(),o.handleSubmit()},onKeyDown:dT,children:[E(Mb,{children:[E(Xb,{children:[w(zb,{}),w(eo,{children:l}),s&&w(Kb,{children:w(lT,{bankAccount:t})})]}),w(o.Subscribe,{selector:e=>e.isDefaultValue,children:e=>e?null:w(o.SaveButton,{})})]}),E(Ob,{children:[w(o.AppField,{name:"apiAccountName",children:e=>w(e.TextField,{label:"Name",disabled:a,placeholder:"Enter name..."})}),w(o.AppField,{name:"apiAccountNo",children:e=>w(e.TextField,{label:"Last 4 Digits (Mask)",type:"number",disabled:a,placeholder:"0000",maxLength:4})}),w(o.AppField,{name:"apiAccountType",children:e=>w(e.GenericSelectorField,{label:"Account Type",options:cT,disabled:a})})]})]})})})}function hT(){return E(Ig,{children:[w(Sg,{name:"BankTransactionFormRouter",Component:of}),w(Sg,{name:"Conversation",Component:pf}),w(Sg,{name:"MobileConversation",Component:yf}),w(Sg,{name:"FinancialSummary",Component:Qf}),w(Sg,{name:"BanksAndIntegrations",Component:ky}),w(Sg,{name:"BankAccountForm",Component:uT}),w(Sg,{name:"NewPlaidConnection",Component:Uf})]})}const pT=({environment:e,children:t})=>w(yr.Provider,{value:e,children:t}),gT=async e=>{const t=e.queryKey,r={path:"/sdk/introspect",accessToken:t[1].accessToken,environment:t[1].environment};return await Ra(r)};function mT({children:e}){const{query:{data:t}}=xr({queryKey:["sdk/introspect"],queryFn:gT}),r={userId:t?.userId,userRole:t?.userRole||"OWNER",userEmail:t?.email,companyId:t?.companyId?xi({id:t.companyId,prefix:"COMPANY"}):void 0,customerPartnerId:t?.customerPartnerId,apiPartnerName:t?.apiPartnerName};return w(Hl.Provider,{value:r,children:e})}const vT=Object.freeze({CACHE_BUST:"CACHE_BUST",CONNECTED:"CONNECTED",HEARTBEAT:"HEARTBEAT",ERROR:"ERROR"});const bT="SSE connection failed with status";function fT({companyId:e,customerPartnerId:t,sseTypes:r,enabled:n=!1}){const o=Tr();b(()=>{if(!n||!t)return;const a=new AbortController,i=function(e,t,r,n){const o=new URL(`${a=e,Tn[a]}/sse/v1/subscribe`);var a;return o.searchParams.append("customerPartnerId",r),t.forEach(e=>o.searchParams.append("events",e)),n&&o.searchParams.append("companyId",n),o.toString()}(o,r,t,e);let l=0;return ke(i,{onopen:async e=>async function(e){if(e.status>=400&&e.status<500)throw new Error(`${bT} ${e.status}`)}(e),onmessage:n=>function({event:e,data:t,env:r,sseTypes:n,customerPartnerId:o,companyId:a}){switch(e){case vT.CONNECTED:return void nn("SSE connection established",{env:r,customerPartnerId:o,companyId:a,sseTypes:JSON.stringify(Array.from(n))});case vT.ERROR:throw on({error:{name:"SSE error message from server",message:t},severity:"error"}),new Error("SSE error message from server");case vT.CACHE_BUST:return nn("cache bust event received",{sseTypes:JSON.stringify(Array.from(n))}),void function(e){try{const t=JSON.parse(e);Array.isArray(t)&&t.forEach(e=>{setTimeout(()=>{fr.invalidateQueries({predicate:t=>t.queryKey.includes(e)&&"fetching"!==t.state.fetchStatus}).catch(e=>on({error:e,severity:"error"}))},500*Math.random()),nn(`invalidated query key: ${e} due to cache bust event`)})}catch(t){return void on({error:t instanceof Error?t:new Error("JSON parse error"),severity:"error",extraData:{data:e}})}}(t)}}({event:n.event,data:n.data,env:o,sseTypes:r,customerPartnerId:t,companyId:e}),onclose:()=>function(){throw on({error:new Error("SSE connection closed by server"),severity:"warning"}),new Error("Connection closed unexpectedly")}(),onerror:e=>function(e,t){if(e.message.includes(bT))throw e;return 3e3*2**Math.min(t,3)}(e,l++),signal:a.signal}).catch(e=>on({error:e,severity:"error"})),()=>a.abort("Closing SSE connection")},[o,t,e,r,n])}const yT=[vT.CACHE_BUST];function TT({children:e}){const{companyId:t,customerPartnerId:r}=p(Hl),n=Le(e=>e.FEATUREFLAG_SERVER_SIDE_EVENTS);return fT({companyId:t,customerPartnerId:r,sseTypes:yT,enabled:n}),e}function xT({children:e,environment:t,accessToken:r}){const n={activeToken:r,accountantToken:void 0};return b(()=>{var e,n;e=r,n=t,Zr.setProperties(tn),en=n,Jr=e},[r,t]),w(pT,{environment:t,children:w(Tg,{children:w(gr.Provider,{value:n,children:w(mT,{children:E(TT,{children:[w(he.ConfirmationRoot,{}),e,w(hT,{})]})})})})})}export{bg as BusinessOwnerDashboard,xT as Tight,Ke as useOptions};
|
|
1
|
+
import{create as e}from"zustand";import{devtools as t,persist as n}from"zustand/middleware";import"zustand/react/shallow";import{cloneDeep as r,entries as a,mapValues as o,isEqual as i,differenceBy as l,isEmpty as s,debounce as c}from"lodash-es";import*as d from"zod";import{z as u}from"zod";import*as h from"react";import{useRef as p,useMemo as g,createContext as m,useContext as v,Component as b,useState as f,useCallback as y,useEffect as k,createElement as x,forwardRef as T,useReducer as C,useLayoutEffect as w,useImperativeHandle as A}from"react";import{jsx as E,Fragment as I,jsxs as S}from"react/jsx-runtime";import{QueryClient as N,useIsRestoring as P,useQuery as D,keepPreviousData as R,useMutation as M}from"@tanstack/react-query";import O from"yocto-queue";import L from"big.js";import{ResponsiveContainer as F,BarChart as B,Legend as U,CartesianGrid as V,XAxis as W,YAxis as H,Tooltip as q,Bar as j,ReferenceLine as z,Line as K}from"recharts";import{flexRender as Y,createColumnHelper as _,useReactTable as G,getCoreRowModel as Q,getExpandedRowModel as Z}from"@tanstack/react-table";import{useFloatingNodeId as X,useFloating as J,offset as $,flip as ee,shift as te,size as ne,autoUpdate as re,useClick as ae,useDismiss as oe,useRole as ie,useInteractions as le,useFloatingParentNodeId as se,FloatingTree as ce,FloatingNode as de,useMergeRefs as ue,FloatingOverlay as he,FloatingPortal as pe,FloatingFocusManager as ge}from"@floating-ui/react";import{ContextAwareConfirmation as me,confirmable as ve}from"react-confirm";import{createFormHookContexts as be,useStore as fe,createFormHook as ye}from"@tanstack/react-form";import{NumericFormat as ke}from"react-number-format";import xe from"fuse.js";import{v4 as Te}from"uuid";import{openDB as Ce}from"idb";import{PersistQueryClientProvider as we}from"@tanstack/react-query-persist-client";import{fetchEventSource as Ae}from"@microsoft/fetch-event-source";function Ee(e,t){return`${e.trim()}:${t.trim()}`}const Ie=e=>({FEATUREFLAG_BULK_SELECT:!1,FEATUREFLAG_ATTACH_TO_GLSOURCE:!1,FEATUREFLAG_FREQUENCY_SELECTOR:!1,FEATUREFLAG_SUGGESTED_CATEGORIES:!1,updateFlags:t=>e(e=>({...e,...t}),void 0,Ee("featureFlags","updateFlags"))});function Se(){return He(e=>e.FEATUREFLAG_FREQUENCY_SELECTOR)}function Ne(){return He(e=>e.FEATUREFLAG_SUGGESTED_CATEGORIES)}const Pe="drawerNavigation",De=e=>({drawerHistory:[],closingDrawerCount:0,openDrawer:(t,n={})=>e(e=>{const{replaceHistory:a,routeProps:o}=n,i={[t]:{routeProps:o}};if(a||0===e.drawerHistory.length)return{drawerHistory:[i],closingDrawerCount:0};{const t=r(e.drawerHistory);return t.push(i),{drawerHistory:t,closingDrawerCount:0}}},void 0,Ee(Pe,"openDrawer")),closeDrawer:()=>e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1),closingDrawerCount:0}},void 0,Ee(Pe,"closeDrawer")),closeAllDrawers:()=>e(()=>({drawerHistory:[],closingDrawerCount:0}),void 0,Ee(Pe,"closeAllDrawers")),requestCloseDrawer:()=>e(e=>0===e.drawerHistory.length?{}:{closingDrawerCount:1},void 0,Ee(Pe,"requestCloseDrawer")),requestCloseAllDrawers:()=>e(e=>({closingDrawerCount:e.drawerHistory.length}),void 0,Ee(Pe,"requestCloseAllDrawers")),confirmCloseDrawer:()=>e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1),closingDrawerCount:Math.max(0,e.closingDrawerCount-1)}},void 0,Ee(Pe,"confirmCloseDrawer")),confirmCloseAllDrawers:()=>e(()=>({drawerHistory:[],closingDrawerCount:0}),void 0,Ee(Pe,"confirmCloseAllDrawers"))}),Re=e=>({externalOptions:{},setOptions:(t,n=!1)=>e(e=>n?{externalOptions:{...t}}:{externalOptions:{...e.externalOptions,...t}},void 0,Ee("externalOptions","setOptions"))});function Me(e,t){return t>-1&&t<=e.length-1?[...e.slice(0,t),...e.slice(t+1)]:[...e]}function Oe(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const e={...n};if(delete e.children,t.push(e),n.children&&n.children.length>0){const e=Oe(n.children);t.push(...e)}}return t}function Le(e){return e[e.length-1]}const Fe="transactionsDashFilters",Be=e=>({transactionsDashFilters:[],addTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:[...e.transactionsDashFilters,...t]}),void 0,Ee(Fe,"addFilter")),removeTransactionsDashFilter:t=>e(e=>({...e,transactionsDashFilters:Me(e.transactionsDashFilters,t)}),void 0,Ee(Fe,"removeFilter")),setTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:t}),void 0,Ee(Fe,"setFilters"))}),Ue={label:"Connected Accounts",value:"connected"},Ve="banksAndIntegrationsState",We=e=>({banksAndIntegrationsSelectedTab:Ue,expandedPlaidItems:[],hasExpandedUpdated:!1,setBanksAndIntegrationsSelectedTab:t=>e({banksAndIntegrationsSelectedTab:t},void 0,Ee(Ve,"setBanksAndIntegrationsSelectedTab")),toggleExpandedIntegration:(t,n)=>e(e=>({expandedPlaidItems:e.expandedPlaidItems.includes(t)||n&&!e.hasExpandedUpdated?e.expandedPlaidItems.filter(e=>e!==t):[...e.expandedPlaidItems,t],hasExpandedUpdated:!0}),void 0,Ee(Ve,"toggleExpandedIntegration"))}),He=e()(t(n((...e)=>({...Ie(...e),...De(...e),...Re(...e),...Be(...e),...We(...e)}),{name:"tight-featureflag-storage",partialize:e=>{const t=Object.entries(e).filter(([e])=>e.startsWith("FEATUREFLAG"));return Object.fromEntries(t)}}),{name:"globalStore",store:"globalStore",enabled:!1})),qe={SELECT:"select",EXPAND:"expand"},je={...qe,DATE:"date",DESCRIPTION:"description",AMOUNT:"amount",CATEGORY:"category",CLASS_SEGMENT:"classSegment",REVIEW_STATUS:"reviewStatus",COMMENTS:"comments"},ze=[je.COMMENTS,je.DATE,je.DESCRIPTION,je.AMOUNT,je.CATEGORY,je.CLASS_SEGMENT,je.REVIEW_STATUS],Ke=d.object({pageSize:d.optional(d.int32().positive()),columns:d.optional(d.array(d.enum(ze)))}),Ye=d.optional(d.string().trim()),_e=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Ge=d.optional(d.array(d.string().trim())),Qe=d.object({integrations:d.optional(d.array(d.enum(["UNIT","STRIPE","GUSTO","SHOPIFY","SQUARE","RUTTER","UBER","MOOV","QUALPAY","MANUAL_ENTRY","PARTNER_IMPLEMENTATION","QBO","XERO","FRESHBOOKS"])))}),Ze={transactionsDashboard:e=>{const t=Ke.safeParse(e);return t.success?t.data:void 0},accessToken:e=>{const t=Ye.safeParse(e);return t.success?t.data:void 0},dataVisualizationColors:e=>{const t=Ge.safeParse(e);if(!t.success||void 0===t.data)return;const n=t.data.filter(e=>_e.test(e));return n.length>0?n:void 0},banksAndIntegrations:e=>{const t=Qe.safeParse(e);return t.success?t.data:void 0}},Xe=(e,t)=>{if(void 0!==Ze[e])return(0,Ze[e])(t)};function Je(e){const t=p(!1),n=He(e=>e.setOptions);if(e&&!t.current){n(function(e){let t={};for(const[n,r]of a(e)){const e=Xe(n,r);void 0!==e&&(t={...t,[n]:e})}return t}(e)),t.current=!0}const o=He(e=>e.externalOptions);return{options:g(()=>r(o),[o]),setOptions:n}}function $e(e){return"object"==typeof e&&null!=e&&!Array.isArray(e)}function et(e){return Object.fromEntries(Object.entries(e??{}).filter(([e,t])=>void 0!==t))}function tt(e){return String.fromCharCode(e+(e>25?39:97))}function nt(e){return function(e){let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=tt(t%52)+n;return tt(t%52)+n}(function(e,t){let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e}(5381,e)>>>0)}var rt=/\s*!(important)?/i;function at(e){return"string"==typeof e?e.replaceAll(" ","_"):e}var ot=e=>{const t=/* @__PURE__ */new Map;return(...n)=>{const r=JSON.stringify(n);if(t.has(r))return t.get(r);const a=e(...n);return t.set(r,a),a}},it=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]);function lt(...e){return e.reduce((e,t)=>t?(Object.keys(t).forEach(n=>{if(it.has(n))return;const r=e[n],a=t[n];$e(r)&&$e(a)?e[n]=lt(r,a):e[n]=a}),e):e,{})}var st=e=>null!=e;function ct(e,t,n={}){const{stop:r,getKey:a}=n;return function e(n,o=[]){if("object"==typeof(i=n)&&null!==i){const i={};for(const[l,s]of Object.entries(n)){const c=a?.(l,s)??l,d=[...o,c];if(r?.(n,d))return t(n,o);const u=e(s,d);st(u)&&(i[c]=u)}return i}var i;return t(n,o)}(e)}function dt(e,t,n=!0){const{utility:r,conditions:a}=t,{hasShorthand:o,resolveShorthand:i}=r;return ct(e,e=>{return Array.isArray(e)?(t=e,n=a.breakpoints.keys,t.reduce((e,t,r)=>{const a=n[r];return null!=t&&(e[a]=t),e},{})):e;var t,n},{stop:e=>Array.isArray(e),getKey:n?e=>o?i(e):e:void 0})}var ut={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},ht=/([A-Z])/g,pt=/^ms-/,gt=ot(e=>e.startsWith("--")?e:e.replace(ht,"-$1").replace(pt,"-ms-").toLowerCase()),mt=new RegExp(`^(${["min","max","clamp","calc"].join("|")})\\(.*\\)`),vt=`(?:${"cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%".split(",").join("|")})`,bt=new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${vt}$`),ft={map:function(e,t){return Array.isArray(e)?e.map(e=>t(e)):$e(e)?ct(e,e=>t(e)):t(e)},isCssFunction:e=>"string"==typeof e&&mt.test(e),isCssVar:e=>"string"==typeof e&&/^var\(--.+\)$/.test(e),isCssUnit:e=>"string"==typeof e&&bt.test(e)},yt=(e,t)=>{if(!e?.defaultValues)return t;const n="function"==typeof e.defaultValues?e.defaultValues(t):e.defaultValues;return Object.assign({},n,et(t))};const kt=new Set("_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_supportHover,_notDisabled,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,1.5xl,1.5xlOnly,1.5xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo1.5xl,smTo2xl,mdToLg,mdToXl,mdTo1.5xl,mdTo2xl,lgToXl,lgTo1.5xl,lgTo2xl,xlTo1.5xl,xlTo2xl,1.5xlTo2xl,base".split(",")),xt=/^@|&|&$/;function Tt(e){return kt.has(e)||xt.test(e)}const Ct=/^_/,wt=/&|@/,At=/* @__PURE__ */new Map;"aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos,top:top,left:left,inset:inset,insetInline:inset-x,insetBlock:inset-y,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e,insetInlineStart:inset-s,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p,paddingLeft:pl,paddingRight:pr,paddingTop:pt,paddingBottom:pb,paddingBlock:py,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px,paddingInlineEnd:pe,paddingInlineStart:ps,marginLeft:ml,marginRight:mr,marginTop:mt,marginBottom:mb,margin:m,marginBlock:my,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx,marginInlineEnd:me,marginInlineStart:ms,spaceX:sx,spaceY:sy,outlineWidth:ring-w,outlineColor:ring-c,outline:ring,outlineOffset:ring-o,focusRing:focus-ring,focusVisibleRing:focus-v-ring,focusRingColor:focus-ring-c,focusRingOffset:focus-ring-o,focusRingWidth:focus-ring-w,focusRingStyle:focus-ring-s,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w,inlineSize:w-is,minWidth:min-w,minInlineSize:min-w-is,maxWidth:max-w,maxInlineSize:max-w-is,height:h,blockSize:h-bs,minHeight:min-h,minBlockSize:min-h-bs,maxHeight:max-h,maxBlockSize:max-b,boxSize:size,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c,WebkitTextFillColor:wktf-c,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p,backgroundPositionX:bg-p-x,backgroundPositionY:bg-p-y,backgroundAttachment:bg-a,backgroundClip:bg-cp,background:bg,backgroundColor:bg-c,backgroundOrigin:bg-o,backgroundImage:bg-i,backgroundRepeat:bg-r,backgroundBlendMode:bg-bm,backgroundSize:bg-s,backgroundGradient:bg-grad,backgroundLinear:bg-linear,backgroundRadial:bg-radial,backgroundConic:bg-conic,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr,borderTopLeftRadius:bdr-tl,borderTopRightRadius:bdr-tr,borderBottomRightRadius:bdr-br,borderBottomLeftRadius:bdr-bl,borderTopRadius:bdr-t,borderRightRadius:bdr-r,borderBottomRadius:bdr-b,borderLeftRadius:bdr-l,borderStartStartRadius:bdr-ss,borderStartEndRadius:bdr-se,borderStartRadius:bdr-s,borderEndStartRadius:bdr-es,borderEndEndRadius:bdr-ee,borderEndRadius:bdr-e,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderBlockStartWidth:bd-bs-w,borderBlockEndWidth:bd-be-w,borderColor:bd-c,borderInline:bd-x,borderInlineWidth:bd-x-w,borderInlineColor:bd-x-c,borderBlock:bd-y,borderBlockWidth:bd-y-w,borderBlockColor:bd-y-c,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s,borderInlineStartWidth:bd-s-w,borderInlineStartColor:bd-s-c,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e,borderInlineEndWidth:bd-e-w,borderInlineEndColor:bd-e-c,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh,boxShadowColor:bx-sh-c,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x,translateY:translate-y,translateZ:translate-z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,cursor:cursor".split(",").forEach(e=>{const[t,n]=e.split(":");At.set(t,n)});const Et={conditions:{shift:function(e){return e.sort((e,t)=>{const n=Tt(e),r=Tt(t);return n&&!r?1:!n&&r?-1:0})},finalize:function(e){return e.map(e=>kt.has(e)?e.replace(Ct,""):wt.test(e)?`[${at(e.trim())}]`:e)},breakpoints:{keys:["base","sm","md","lg","xl","1.5xl","2xl"]}},utility:{prefix:"tsystem",transform:(e,t)=>({className:`${At.get(e)||gt(e)}_${at(t)}`}),toHash:(e,t)=>t(e.join(":")),resolveShorthand:e=>e}},It=function(e){const{utility:t,hash:n,conditions:r=ut}=e,a=e=>[t.prefix,e].filter(Boolean).join("-");return ot(({base:o,...i}={})=>{const l=dt(Object.assign(i,o),e),s=/* @__PURE__ */new Set;return ct(l,(e,o)=>{if(null==e)return;const i="string"==typeof(u=e)&&rt.test(u),[l,...c]=r.shift(o),d=c.slice().filter(e=>!/* @__PURE__ */(e=>"base"===e)(e));var u;const h=t.transform(l,function(e){return"string"==typeof e?e.replace(rt,"").trim():e}((e=>"string"==typeof e?e.replaceAll(/[\n\s]+/g," "):e)(e)));let p=((e,o)=>{let i;if(n){const n=[...r.finalize(e),o];i=a(t.toHash(n,nt))}else i=[...r.finalize(e),a(o)].join(":");return i})(d,h.className);i&&(p=`${p}!`),s.add(p)}),Array.from(s).join(" ")})}(Et),St=(...e)=>It(Nt(...e));St.raw=(...e)=>Nt(...e);const{mergeCss:Nt}=function(e){function t(t){const n=function(...e){return e.flat().filter(e=>$e(e)&&Object.keys(et(e)).length>0)}(...t);return 1===n.length?n:n.map(t=>dt(t,e))}return{mergeCss:ot(function(...e){return lt(...t(e))}),assignCss:function(...e){return Object.assign({},...t(e))}}}(Et);function Pt(){let e,t="",n=0;for(;n<arguments.length;)(e=arguments[n++])&&"string"==typeof e&&(t&&(t+=" "),t+=e);return t}const Dt=e=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function Rt(e){const{base:t,variants:n,defaultVariants:r,compoundVariants:a}=Dt(e),o=e=>({...r,...et(e)});function i(e={}){const r=o(e);let i={...t};for(const[t,a]of Object.entries(r))n[t]?.[a]&&(i=Nt(i,n[t][a]));const l=function(e,t){let n={};return e.forEach(e=>{Object.entries(e).every(([e,n])=>"css"===e||(Array.isArray(n)?n:[n]).some(n=>t[e]===n))&&(n=Nt(n,e.css))}),n}(a,r);return Nt(i,l)}const l=Object.keys(n),s=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,Object.keys(t)]));return Object.assign(ot(function(e){return St(i(e))}),{__cva__:!0,variantMap:s,variantKeys:l,raw:i,config:e,merge:function(e){const o=Dt(e.config),i=((...e)=>{const t=e.reduce((e,t)=>(t&&t.forEach(t=>e.add(t)),e),/* @__PURE__ */new Set([]));return Array.from(t)})(e.variantKeys,Object.keys(n));return Rt({base:Nt(t,o.base),variants:Object.fromEntries(i.map(e=>[e,Nt(n[e],o.variants[e])])),defaultVariants:lt(r,o.defaultVariants),compoundVariants:[...a,...o.compoundVariants]})},splitVariantProps:function(e){return function(e,...t){const n=Object.getOwnPropertyDescriptors(e),r=Object.keys(n),a=e=>{const t={};for(let r=0;r<e.length;r++){const a=e[r];n[a]&&(Object.defineProperty(t,a,n[a]),delete n[a])}return t};return t.map(e=>a(Array.isArray(e)?e:r.filter(e))).concat(a(r))}(e,l)},getVariantProps:o})}var Mt,Ot=((Mt=Ot||{}).component="component",Mt["dashboard-placeholder-table"]="dashboard-placeholder-table",Mt["dashboard-header"]="dashboard-header",Mt["dashboard-table"]="dashboard-table",Mt["dashboard-table-body"]="dashboard-table-body",Mt["dashboard-table-cell"]="dashboard-table-cell",Mt["dashboard-table-column-header"]="dashboard-table-column-header",Mt["dashboard-table-header"]="dashboard-table-header",Mt.label="label",Mt.popup="popup",Mt["popup-sort-row"]="popup-sort-row",Mt["progress-bar"]="progress-bar",Mt["progress-bar-fill"]="progress-bar-fill",Mt.summation="summation",Mt["table-parent-row"]="table-parent-row",Mt["table-row"]="table-row",Mt["table-sub-row"]="table-sub-row",Mt.tile="tile",Mt["tile-bar-label"]="tile-bar-label",Mt["tile-body"]="tile-body",Mt["tile-filter-button"]="tile-filter-button",Mt["tile-filter-list"]="tile-filter-list",Mt["tile-filter-row"]="tile-filter-row",Mt["tile-header"]="tile-header",Mt["tile-title"]="tile-title",Mt.title="title",Mt["business-owner-dashboard"]="business-owner-dashboard",Mt["business-owner-dashboard-header"]="business-owner-dashboard-header",Mt["business-owner-table"]="business-owner-table",Mt["transaction-type-label"]="transaction-type-label",Mt["selector-row"]="selector-row",Mt["popup-list"]="popup-list",Mt.badge="badge",Mt["date-cell"]="date-cell",Mt["expander-cell"]="expander-cell",Mt["vertical-divider"]="vertical-divider",Mt["horizontal-divider"]="horizontal-divider",Mt["table-cell-divider"]="table-cell-divider",Mt["checkbox-input"]="checkbox-input",Mt["bulk-select"]="bulk-select",Mt["button-base"]="button-base",Mt["button-discrete-small"]="button-discrete-small",Mt["button-primary"]="button-primary",Mt["button-secondary"]="button-secondary",Mt["button-tertiary"]="button-tertiary",Mt["button-danger"]="button-danger",Mt["button-warning"]="button-warning",Mt["button-action"]="button-action",Mt.text="text",Mt["cell-button"]="cell-button",Mt["month-picker-left-button"]="month-picker-left-button",Mt["month-picker-right-button"]="month-picker-right-button",Mt["filter-bar"]="filter-bar",Mt["filter-search-bar"]="filter-search-bar",Mt["filter-pill"]="filter-pill",Mt["discrete-form-input"]="discrete-form-input",Mt["editable-form-input"]="editable-form-input",Mt["category-text"]="category-text",Mt["amount-input-container"]="amount-input-container",Mt["amount-input"]="amount-input",Mt["modal-popup"]="modal-popup",Mt["drawer-header"]="drawer-header",Mt["drawer-header-border"]="drawer-header-border",Mt["form-body"]="form-body",Mt.body="body",Mt.heading="heading",Mt["sub-label"]="sub-label",Mt["strong-label"]="strong-label",Mt["strong-sub-label"]="strong-sub-label",Mt["metric-xl"]="metric-xl",Mt["metric-md"]="metric-md",Mt["large-icon"]="large-icon",Mt["medium-icon"]="medium-icon",Mt["small-icon"]="small-icon",Mt["tiny-icon"]="tiny-icon",Mt["neutral-badge"]="neutral-badge",Mt["highlight-badge"]="highlight-badge",Mt["success-badge"]="success-badge",Mt["warning-badge"]="warning-badge",Mt["critical-badge"]="critical-badge",Mt["button-group"]="button-group",Mt["alert-dialog"]="alert-dialog",Mt["alert-header"]="alert-header",Mt["emphasis-label"]="emphasis-label",Mt["profit-loss-graph"]="profit-loss-graph",Mt.banner="banner",Mt["banner-high"]="banner-high",Mt["banner-medium"]="banner-medium",Mt["banner-low"]="banner-low",Mt["banner-urgent"]="banner-urgent",Mt["banner-default"]="banner-default",Mt["banner-button"]="banner-button",Mt["banner-button-text"]="banner-button-text",Mt["banner-button-icon"]="banner-button-icon",Mt["empty-dashboard-layout"]="empty-dashboard-layout",Mt["zero-state-layout"]="zero-state-layout",Mt["emphasis-sub-label"]="emphasis-sub-label",Mt);const Lt="Tight-",Ft=e=>`${Lt}${e}`;function Bt(e){return e in Ot}function Ut(e){const t=e.indexOf("-"),n=e.slice(0,t+1),r=e.slice(t+1);return n===Lt&&r in Ot}function Vt(e){return!Bt(e)&&!Ut(e)}const Wt=(e,...t)=>{const n=[],r=[];return null!==e&&n.push(Ft(e)),t.forEach(e=>{void 0!==e&&(Vt(e)?r.push(e):Bt(e)&&n.push(Ft(e)))}),{className:Pt(...n,...r)}},Ht=Wt(Ot["business-owner-dashboard-header"],St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:80}));function qt({children:e}){return E("div",{...Ht,children:e})}function jt(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Ut(t)&&e.push(t),e),[])],[])}function zt(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Vt(t)&&e.push(t),e),[])],[])}function Kt(e){const t=Array.isArray(e)?e:[e];return{className:Pt(...jt(t),...zt(t))}}const Yt=Rt({base:{},variants:{body:{default:{fontWeight:"body",fontSize:{sm:"body",base:"lg"},fontFamily:"body",color:"typography.base",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"}},label:{default:{fontWeight:"label",fontSize:{sm:"label",base:"lg"},fontFamily:"label",color:"typography.label",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"},subLabel:{fontWeight:"label.sub",fontSize:{sm:"label.sub",base:"md"},fontFamily:"label",color:"typography.label.sub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.66px"},strongLabel:{fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"},strongSubLabel:{fontWeight:"label.strongSub",fontSize:{sm:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.strongSub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.84px"},emphasisSubLabel:{fontWeight:"label.emphasisSub",fontSize:{sm:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.emphasisSub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.84px"}},heading:{default:{fontWeight:"heading",fontSize:"heading",fontFamily:"heading",color:"typography.heading",lineHeight:"25px",letterSpacing:"2px"}},metric:{sm:{fontWeight:"metric.sm",fontSize:"metric.sm",fontFamily:"metric",color:"typography.metric.sm"},md:{fontWeight:"metric.md",fontSize:"metric.md",fontFamily:"metric",color:"typography.metric.md"},lg:{fontWeight:"metric.lg",fontSize:"metric.lg",fontFamily:"metric",color:"typography.metric.lg"},xl:{fontWeight:"metric.xl",fontSize:"metric.xl",fontFamily:"metric",color:"typography.metric.xl"}}}}),_t=Wt(Ot.heading,Yt({heading:"default"}));function Gt({children:e,stylists:t=[]}){const n=Kt([_t,...t]);return E("div",{...n,children:e})}function Qt(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Zt(e,t,n){return new Date(e,t,n)}function Xt(e,t){return Qt(Zt(t,e,1))}const Jt={THIS_YEAR:"THIS_YEAR",THIS_MONTH:"THIS_MONTH",LAST_YEAR:"LAST_YEAR",LAST_MONTH:"LAST_MONTH",PAST_YEAR:"PAST_YEAR"},$t=e=>{switch(e){case Jt.THIS_YEAR:return Qt(Zt(/* @__PURE__ */(new Date).getFullYear(),0,1));case Jt.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return Xt(e.getMonth(),e.getFullYear())}();case Jt.LAST_YEAR:return Qt(Zt(/* @__PURE__ */(new Date).getFullYear()-1,0,1));case Jt.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return Qt(Zt(e.getFullYear(),e.getMonth()-1,1))}();case Jt.PAST_YEAR:return function(){const e=/* @__PURE__ */new Date;return Qt(Zt(e.getFullYear()-1,e.getMonth(),1))}();default:return""}},en=e=>{switch(e){case Jt.THIS_YEAR:return Qt(Zt(/* @__PURE__ */(new Date).getFullYear()+1,0,0));case Jt.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return Qt(Zt(e.getFullYear(),e.getMonth()+1,0))}();case Jt.LAST_YEAR:return Qt(Zt(/* @__PURE__ */(new Date).getFullYear(),0,0));case Jt.PAST_YEAR:case Jt.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return Qt(Zt(e.getFullYear(),e.getMonth(),0))}();default:return""}},tn=e=>{return t=e,Object.values(Jt).includes(t)?{beginDate:$t(e),endDate:en(e)}:{beginDate:Qt((n=e).beginDate),endDate:Qt(n.endDate)};var t,n},nn=["SUN","MON","TUE","WED","THU","FRI","SAT"],rn=["January","February","March","April","May","June","July","August","September","October","November","December"];function an({yearsBack:e=10,startYear:t}){const n=t??/* @__PURE__ */(new Date).getFullYear(),r=[n];for(let a=n-1;a>=n-e;a--)r.push(a);return r}function on(e,t){return e.toDateString()===t.toDateString()}function ln(e){return on(e,/* @__PURE__ */new Date)}function sn(e,t){const n=Zt(e.getFullYear(),e.getMonth(),e.getDate()),r=Zt(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()>r.getTime()}function cn(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${String(e.getMonth()+1).padStart(2,"0")}/${String(e.getDate()).padStart(2,"0")}/${e.getFullYear()}`:""}function dn(e,t,n){if(e<1||e>12||t<1||t>31)return!1;const r=Zt(n,e-1,t);return!(r.getFullYear()!==n||r.getMonth()!==e-1||r.getDate()!==t)}function un(e){if(!e.trim())return null;const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/);if(!t)return null;const[,n,r,a]=t,o=parseInt(n,10),i=parseInt(r,10),l=parseInt(a,10);return dn(o,i,l)?Zt(l,o-1,i):null}function hn(e){if(!e.trim())return null;const t=e.match(/^(\d{1,4})-(\d{1,2})-(\d{1,2})/);if(!t)return null;const[,n,r,a]=t,o=parseInt(n,10),i=parseInt(r,10),l=parseInt(a,10);return dn(i,l,o)?Zt(o,i-1,l):null}function pn(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:null}function gn(e,t){return sn(e,t)?t:e}function mn(e,t){return sn(t,e)?t:e}const vn=(e,t)=>{const n={month:t.abbreviateMonth?"short":"long",year:t.abbreviateYear?"2-digit":"numeric"};return e.toLocaleString("default",n)},bn=e=>{const t=new Date(e||""),n=/* @__PURE__ */new Date;return ln(t)?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):t.getFullYear()===n.getFullYear()?(e=>e.toLocaleString("default",{month:"short"})+" "+e.getDate())(t):vn(t,{abbreviateMonth:!0,abbreviateYear:!1})},fn=e=>e?e.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}):null;function yn(e,t,n){return[...e,{accessToken:t,environment:n}]}function kn(e,t){return[...e,t]}const xn=e=>null==e,Tn=e=>!xn(e);function Cn(e){return""===e.trim()}function wn(e){return xn(e)||Cn(e)}function An(e){return!wn(e)}const En=m({activeToken:void 0,accountantToken:void 0});function In(){const{activeToken:e}=v(En);return e}const Sn=()=>{throw new Error("No access token provided")},Nn=72e5,Pn=new N({defaultOptions:{queries:{gcTime:Nn,staleTime:3e4,refetchInterval:6e4}}}),Dn=m("SANDBOX");function Rn(){return v(Dn)}function Mn({queryKey:e,queryFn:t,...n}){const r=In(),a=Rn(),o=An(r),i=yn(e,r??"",a),l=P(),s=D({...n,queryKey:i,queryFn:o?t:Sn,placeholderData:n.keepPreviousDataPlaceholder?R:void 0,...o?{}:{retry:!1,staleTime:1/0}},Pn);return{isRehydrating:l,isFilling:l||s.isLoading,query:s}}class On{constructor(e){this.client=e}async sendEvent({apiKey:e,events:t,notifier:n,payloadVersion:r}){const a=/* @__PURE__ */(new Date).toISOString(),o=JSON.stringify({apiKey:e,payloadVersion:r,notifier:n,events:t});await fetch(this.client.endpoints.notify,{method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"application/json","Bugsnag-Api-Key":e,"Bugsnag-Payload-Version":r,"Bugsnag-Sent-At":a},referrerPolicy:"no-referrer",body:o})}}const Ln=Symbol("Circular"),Fn=Symbol("AccessError");function Bn(e,t,n){return Un({key:"",value:e,replacer:t,seen:[],depth:0,depthLimit:n?.depthLimit,edgeIndex:0,edgesLimit:n?.edgesLimit})}function Un({key:e,value:t,replacer:n,seen:r,depthLimit:a=1/0,depth:o,edgeIndex:i,edgesLimit:l=1/0}){let s=t;if(r.includes(s)&&(s=Ln),n&&(s=n(e,s)),"object"==typeof(c=s)&&null!==c&&"toJSON"in c&&"function"==typeof c.toJSON&&(s=Vn(()=>s.toJSON(String(e)))),null===s||"object"!=typeof s)return s;var c;if(o>a||i+1>l)return"[...]";if(r.push(t),Array.isArray(s)){const e=[],t=Math.min(s.length,l);for(let i=0;i<t;i++){const t=Vn(()=>s[i]);e.push(Un({key:i,value:t,replacer:n,seen:r,depth:o,depthLimit:a,edgeIndex:i,edgesLimit:l}))}t<s.length&&e.push("[...]"),s=e}else{const e={},t=Object.keys(s);for(let i=0;i<t.length;i++){const c=t[i],d=Vn(()=>s[c]);e[c]=Un({key:c,value:d,replacer:n,seen:r,depth:o,depthLimit:a,edgeIndex:i,edgesLimit:l})}s=e}return r.pop(),s}function Vn(e){try{return e()}catch{return Fn}}const Wn=Object.prototype.toString,Hn=Object.getPrototypeOf;function qn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const jn=/^\s*at .*(\S+:\d+|\(native\))/m,zn=/^(eval@)?(\[native code])?$/;function Kn(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)return[e];const n=t[2]?parseInt(t[2],10):void 0,r=t[3]?parseInt(t[3],10):void 0;return[t[1],n,r]}function Yn(e,t){const n=_n(e,t);let r;"InvalidError"===n.name&&(r={[t]:{"non-error parameter":e}}),void 0!==n.metadata&&qn(n.metadata)&&(r={...r,[n.name]:n.metadata});const a=[Gn(n)];return a.push(...Xn(n).map(e=>Gn(e,{backtrace:!1}))),{exceptions:a,metadata:r}}function _n(e,t){if(function(e){if(e instanceof Error)return!0;let t=e;for(;t;){if("[object Error]"===Wn.call(t))return!0;t=Hn(t)}return!1}(e))return e;let n=function(e){if(!qn(e))return null;const t=t=>{const n=e[t];if("string"==typeof n&&e[t.length])return n},n=t("name")||t("errorClass"),r=t("message")||t("errorMessage");if(!n||!r)return null;const a=new Error(r);return a.name=n,a}(e);if(n)return n;switch(typeof n){case"string":case"number":case"boolean":return new Error(String(e));default:return n=new Error(`${t} received a non-error. See "${t}" tab for more detail.`),n.name="InvalidError",n}}function Gn(e,t={backtrace:!1}){return{errorClass:e.name,message:e.message,stacktrace:Qn(e,t),type:"object"==typeof self&&self.navigator?"browserjs":"nodejs"}}function Qn(e,{backtrace:t}){const n=function(e){let t=e.stack;return void 0===t&&(t=e.stacktrace),"string"==typeof t&&t.length&&t!==`${e.name}: ${e.message}`?t:void 0}(e);return n?function(e){return(e.match(jn)?e.split("\n").filter(e=>!!e.match(jn)).map(e=>{e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),a=Kn(n?n[1]:r.pop()||"(no location)"),o=r.join(" ")||void 0;return{file:["eval","<anonymous>"].indexOf(a[0])>-1?void 0:a[0],lineNumber:a[1],columnNumber:a[2],method:o}}):(t=e,t.split("\n").filter(e=>!e.match(zn)).map(e=>{if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return{method:e};{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,a=Kn(e.replace(t,""));return{file:a[0],lineNumber:a[1],columnNumber:a[2],method:r}}}))).reduce((e,t)=>{if("{}"===JSON.stringify(t))return e;let n=t.file||t.method||"number"!=typeof t.lineNumber?t.file||"(unknown file)":"global code";n=n.replace(/\?.*$/,"").replace(/#.*$/,"");let r=t.method||"(unknown function)";return r=/^global code$/i.test(r)?"global code":r,e.concat([{file:n,lineNumber:t.lineNumber,columnNumber:t.columnNumber,method:r}])},[]);var t}(n):t?function(){const e=[];let t;try{t=arguments.callee}catch{return[]}for(;t&&e.length<Zn;){t.name?e.push({method:t.name,file:"(unknown file)"}):/function(?:\s+([\w$]+))+\s*\(/.test(t.toString())&&e.push({method:RegExp.$1,file:"(unknown file)"});try{t=t.caller}catch{break}}return e}():[]}const Zn=20;function Xn(e){const t=e;if(t.cause){const e=_n(t.cause,"cause");return"InvalidError"===e.name?[]:[e].concat(Xn(e))}return[]}function Jn(...e){console.log}function $n(...e){console.error}const er={name:"errorBreadcrumbs",load(e){e.addOnPostError(t=>{e.leaveBreadcrumb(t.exceptions[0].errorClass,{errorClass:t.exceptions[0].errorClass,errorMessage:t.exceptions[0].message,severity:t.severity},"error")})}};let tr=Date.now();const nr=()=>{tr=Date.now()},rr={name:"appDuration",load:e=>(e.addOnError(e=>{const t=Date.now();return e.app=e.app||{},e.app.duration=t-tr,!0}),{reset:nr})},ar=[["Edge (EdgeHTML)",/Edge\/([0-9._]+)/],["Edge (iOS)",/EdgiOS\/([0-9._]+)/],["Yandex",/YaBrowser\/([0-9._]+)/],["KakaoTalk",/KAKAOTALK\s([0-9.]+)/],["Samsung",/SamsungBrowser\/([0-9.]+)/],["Silk",/\bSilk\/([0-9._-]+)\b/],["MIUI",/MiuiBrowser\/([0-9.]+)$/],["Beaker",/BeakerBrowser\/([0-9.]+)/],["Edge (Chromium)",/EdgA?\/([0-9.]+)/],["Chromium WebView",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/],["Chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/],["Chrome (iOS)",/CriOS\/([0-9.]+)(:?\s|$)/],["Firefox",/Firefox\/([0-9.]+)(?:\s|$)/],["Firefox (iOS)",/FxiOS\/([0-9.]+)/],["Opera Mini",/Opera Mini.*Version\/([0-9.]+)/],["Opera",/Opera\/([0-9.]+)(?:\s|$)/],["Opera",/OPR\/([0-9.]+)(:?\s|$)/],["Internet Explorer",/Trident\/7\.0.*rv:([0-9.]+).*\).*Gecko$/],["Internet Explorer",/MSIE\s([0-9.]+);.*Trident\/[4-7].0/],["Internet Explorer",/MSIE\s(7\.0)/],["Blackberry",/BB10;\sTouch.*Version\/([0-9.]+)/],["Android",/Android\s([0-9.]+)/],["Safari (iOS)",/Version\/([0-9._]+).*Mobile.*Safari.*/],["Safari",/Version\/([0-9._]+).*Safari/],["Facebook",/FB[AS]V\/([0-9.]+)/],["Instagram",/Instagram\s([0-9.]+)/],["iOS WebView",/AppleWebKit\/([0-9.]+).*Mobile/],["iOS WebView",/AppleWebKit\/([0-9.]+).*Gecko\)$/]],or=[["iOS",void 0,/iP(hone|od|ad)/],["Android",void 0,/Android/],["BlackBerry",void 0,/BlackBerry|BB10/],["Windows Mobile",void 0,/IEMobile/],["Kindle",void 0,/Kindle/],["Windows","3.11",/Win16/],["Windows","95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows","98",/(Windows 98)|(Win98)/],["Windows","2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows","XP",/(Windows NT 5.1)|(Windows XP)/],["Windows","Server 2003",/(Windows NT 5.2)/],["Windows","Vista",/(Windows NT 6.0)/],["Windows","7",/(Windows NT 6.1)/],["Windows","8",/(Windows NT 6.2)/],["Windows","8.1",/(Windows NT 6.3)/],["Windows","10+",/(Windows NT 10.0)/],["Windows","ME",/Windows ME/],["Open BSD",void 0,/OpenBSD/],["Sun OS",void 0,/SunOS/],["Chrome OS",void 0,/CrOS/],["Linux",void 0,/(Linux)|(X11)/],["Mac OS",void 0,/(Mac_PowerPC)|(Macintosh)/],["QNX",void 0,/QNX/],["BeOS",void 0,/BeOS/],["OS/2",void 0,/OS\/2/]],ir=(lr=function(e){const t=""!==(n=e)&&ar.reduce((e,[t,r])=>{if(e)return e;const a=r.exec(n);return!!a&&[t,a]},!1);var n;if(!t)return{};const[r,a]=t,o=function(e){for(const[t,n,r]of or)if(r.exec(e))return{osName:t,osVersion:n};return null}(e),i="iOS"===o?.osName?function(e){const t=/iPad|iPhone|iPod/.exec(e);return t?{manufacturer:"Apple",model:t[0]}:/MacIntel/.test(e)&&self.navigator&&self.navigator.maxTouchPoints&&self.navigator.maxTouchPoints>2?{manufacturer:"Apple",model:"iPad"}:null}(e):{};return{browserName:r,browserVersion:a[1],osName:o?.osName,osVersion:o?.osVersion,manufacturer:i?.manufacturer,model:i?.model}},{name:"browserContext",load(e){e.addOnError(e=>{e.request={...e.request,url:self.location.href},e.context=e.context||self.location.pathname,e.device={...e.device,...lr(self.navigator.userAgent),locale:self.navigator.language,userAgent:self.navigator.userAgent};let t=["n/a"];try{t=self.navigator.languages}catch{}return e.metaData={...e.metaData,language:{language:self.navigator.language,languages:t}},!0})}});var lr;class sr{limit;period;events;constructor(e,t){this.limit=e,this.period=t,this.events=new O}reset(){this.events.clear()}increment(){const e=/* @__PURE__ */(new Date).getTime();if(void 0!==this.period){let t=this.events.peek();for(;void 0!==t&&e-this.period>t;)this.events.dequeue(),t=this.events.peek()}const t=this.events.size+1<=this.limit;return t&&this.events.enqueue(e),t}get size(){return this.events.size}}class cr extends b{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}handleClearError(){this.setState({error:void 0,errorInfo:void 0})}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){const{exceptions:n,metadata:r}=Yn(e,"notify");t&&t.componentStack&&(t.componentStack=function(e){const t=e.split(/\s*\n\s*/g);let n="";for(let r=0,a=t.length;r<a;r++)t[r].length&&(n+=`${n.length?"\n":""}${t[r]}`);return n}(t.componentStack));const{onError:a,client:o}=this.props;o.notifyEvent({exceptions:n,unhandled:!0,severity:"error",severityReason:{type:"unhandledException"},metadata:{...r,react:t},onError:a},e),this.setState({errorInfo:t})}render(){const{error:e}=this.state;if(e){const{FallbackComponent:e}=this.props;if(e)return E(e,{error:this.state.error,errorInfo:this.state.errorInfo,clearError:()=>this.handleClearError()})}return E(I,{children:this.props.children})}}const dr={name:"react",load:e=>({BugsnagErrorBoundary:({onError:t,fallbackComponent:n,children:r})=>E(cr,{client:e,onError:t,FallbackComponent:n,children:r})})},ur=new class{breadcrumbs=[];config;delivery=new On(this);errorCallbacks=/* @__PURE__ */new Set;postErrorCallbacks=/* @__PURE__ */new Set;plugins=[];start(e){if(this.config)return $n(),this;let t;this.config=e,this.config.onError&&(t=Array.isArray(this.config.onError)?this.config.onError:[this.config.onError]),this.errorCallbacks=new Set(t);for(const n of this.config.plugins||[])this.plugins.push({name:n.name||"unknown",plugin:n.load(this)});return this}get endpoints(){return{notify:this.config?.endpoints?.notify||"https://notify.bugsnag.com/"}}notify(e,t={}){const{exceptions:n,metadata:r}=Yn(e,"notify");let a,o,i=r;return"function"==typeof t?a=t:(o=t.severity,t.metadata&&(i={...r,...t.metadata})),this.notifyEvent({exceptions:n,metadata:i,severity:o,onError:a},e)}leaveBreadcrumb(e,t,n){if(!this.config)return;if("string"!=typeof e)try{e=String(e)}catch{e="Unable to stringify breadcrumb message"}if(!e.length)return;this.breadcrumbs.push({name:e,metaData:t,type:n||"manual",timestamp:/* @__PURE__ */(new Date).toISOString()});const{maxBreadcrumbs:r=25}=this.config;this.breadcrumbs.length>r&&this.breadcrumbs.splice(0,this.breadcrumbs.length-r)}async notifyEvent({exceptions:e,unhandled:t,severity:n,severityReason:r,metadata:a,onError:o},i){if(!this.config)return;const l=this.config.releaseStage||"production";if(this.config.enabledReleaseStages&&!this.config.enabledReleaseStages.includes(l))return;const s={exceptions:e,breadcrumbs:this.breadcrumbs.length?this.breadcrumbs:void 0,originalError:i,unhandled:"boolean"==typeof t&&t,severity:n||"warning",severityReason:r,user:this.config.user||void 0,app:{releaseStage:l,version:this.config.appVersion,type:this.config.appType||("object"==typeof window?"browser":"node")},device:{time:/* @__PURE__ */(new Date).toISOString()},metaData:a||{}},c=[...this.errorCallbacks];o&&c.push(o);const d=["stringifyValues","redact"];c.sort((e,t)=>d.includes(e.name)&&d.includes(t.name)?0:d.includes(e.name)?1:d.includes(t.name)?-1:0);for(const m of c){const e=await m(s);if("boolean"==typeof e&&!e)return}const u=Bn(s,(e,t)=>{if("originalError"!==e)return t},{depthLimit:20,edgesLimit:500});let h;const p={apiKey:this.config.apiKey,payloadVersion:"5",notifier:{name:"Tight Components",version:"1",url:"https://github.com/Hurdlr/TraxComponents/tree/dev/src/bugsnag/README.md"},events:[u]};try{h=JSON.stringify(p)}catch{u.metaData={notifier:"Unable to serialize metadata"},h=JSON.stringify(p)}if(h.length>1e6&&(u.metaData={notifier:`Payload was ${h.length/1e6}Mb. Metadata removed.`},h=JSON.stringify(p),h.length>1e6))throw new Error("Payload exceeded 1Mb limit");for(const m of this.postErrorCallbacks)m(s);try{await this.delivery.sendEvent(p)}catch(g){$n()}}getUser(){return this.config?.user||{}}setUser(e,t,n){this.config&&(this.config.user={id:e,email:t,name:n})}setProperties(e){this.config&&(this.config.releaseStage=e)}addOnError(e){this.errorCallbacks.add(e)}removeOnError(e){this.errorCallbacks.delete(e)}addOnPostError(e){this.postErrorCallbacks.add(e)}removeOnPostError(e){this.postErrorCallbacks.delete(e)}getPlugin(e){return this.plugins.find(t=>t.name===e)?.plugin}setDelivery(e){this.delivery=e}};let hr="",pr="";const gr="prod",mr=ur.start({apiKey:"899aec02393ac236377b73b483800d2c",appVersion:"1.4.1",appType:"browser",releaseStage:gr,plugins:[rr,ir,er,(()=>{const e=new sr(15,1e3);return"undefined"!=typeof window&&window.addEventListener("popstate",e.reset),{name:"limitEvents",load:t=>(t.addOnError(function(){return e.increment()}),{reset:e.reset})}})(),dr]}),vr=(e,t)=>{try{ur.leaveBreadcrumb(e,t)}catch(n){n instanceof Error?br({error:n,severity:"error"}):br({error:new Error("Unknown error in logging.breadcrumb"),severity:"error",extraData:{originalError:n}})}},br=async e=>{try{await ur.notify(e.error,t=>(t.severity=e.severity,e.groupingHash&&(t.groupingHash=e.groupingHash),t.metaData={...t.metaData,custom:{...e.extraData,accessToken:hr,environment:pr}},!0)),e.error,e.error.message,e.extraData,console.warn}catch(t){t instanceof Error?await br({error:t,severity:"error"}):await br({error:new Error("Unknown error in logging.notify"),severity:"error",extraData:{originalError:t}})}},fr=mr.getPlugin("react"),yr=fr?.BugsnagErrorBoundary,kr=(e,t)=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`,xr=({extraHeaders:e,authorization:t})=>{const n={...e};return void 0!==t&&(n.Authorization=t),n},Tr=async e=>{const t=await e.json();return e.ok?t:Promise.reject(t)},Cr={"hurdlr-cache-session":!0,"hurdlr-auto-refresh-token":!0};function wr(e){const t=(({accessToken:e,extraHeaders:t})=>{const n={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};return void 0!==t?{...o(t,e=>`${e}`),...n}:n})({accessToken:e.accessToken,extraHeaders:{...e.extraHeaders,...e.pagination,..."v5"===e.endpointManager.apiVersion?Cr:{}}});return{url:(n=e.endpointManager.getUrl(e.path),r=e.pathParams,void 0!==r&&Object.entries(r).forEach(([e,t])=>{n=n.replace(`{${e}}`,t)}),n),headers:t};var n,r}async function Ar({authorization:e,extraHeaders:t,includeCredentials:n,method:r="POST",params:a,url:o}){const i=xr({extraHeaders:t,authorization:e});vr("HTTP POST Request",{url:o,accessToken:e});try{const e=await fetch(o,{method:r,headers:i,credentials:"include",body:JSON.stringify(a)});return vr("HTTP POST Response",{url:o,status:e.status,statusText:e.statusText}),Tr(e)}catch(l){return Promise.reject(l)}}async function Er(e){const{url:t,headers:n}=wr(e);return Ar({url:t,params:e.bodyParams,includeCredentials:!0,extraHeaders:n})}async function Ir(e){return Er(e)}async function Sr(e){return Er(e)}const Nr=(e,t)=>({getUrl:t=>((e,t)=>{let n=t;for(;n.length>0&&"/"===n.charAt(0);)n=n.slice(1);return`${e}/${n}`})(e,t),baseUrl:e,apiVersion:t}),Pr={DEVELOPMENT:"https://dev.hurdlr.com/rest",PRODUCTION:"https://prod.hurdlr.com/rest",SANDBOX:"https://sandbox.hurdlr.com/rest",LOCAL:"http://localhost:8081/TraxAngular/rest"},Dr={DEVELOPMENT:"https://dev.tight.com",PRODUCTION:"https://prod.tight.com",SANDBOX:"https://sandbox.tight.com",LOCAL:"http://localhost:8080"},Rr={...Dr,LOCAL:"http://localhost:8082"};function Mr(e){return Nr(`${t=e,Pr[t]}/v5`,"v5");var t}const Or=({filter:e,grouping:t})=>["reports/profitAndLoss",{filter:e,...t&&{grouping:t}}],Lr=async e=>{const t=e.queryKey,n=t[1],r=t[2].accessToken,a=t[2].environment,o={path:"/reports/profitAndLoss",bodyParams:{exportType:"JSON",...tn(n.filter),...n.grouping&&{grouping:n.grouping}},accessToken:r,endpointManager:Mr(a)};return await Sr(o)};function Fr({filter:e,grouping:t,select:n}){return Mn({queryKey:Or({filter:e,grouping:t}),queryFn:Lr,select:n})}const Br="noDataHeight";function Ur(e){const t=function(e){const t=hn(e??"");return null!==t?vn(t,{abbreviateMonth:!0,abbreviateYear:!0}):""}(e.period?.beginDate),n=e.netIncome??0,{profit:r,remainingIncome:a,loss:o,remainingExpenses:i}=function(e,t,n){const r=e>0?e:0,a=e<0?e:0;return{profit:r,remainingIncome:void 0!==t?L(t).minus(r).toNumber():0,loss:a,remainingExpenses:void 0!==n?L(n).plus(a).toNumber():0}}(n,e.income?.total,e.expenses?.total);return{month:{month:t,income:a,expenses:-i,profit:r,loss:o,netIncome:n,hasNoData:/* @__PURE__ */function(e,t,n){return 0===e&&0===t&&0===n}(n,a,i)},netIncome:n}}function Vr(e){const t={total:0,domain:[],months:[],hasAnyData:!1};if("FAILURE_NO_DATA"===e.result)return t;const n=e.json?.data;if(xn(n))return t;for(const i of n){const{month:e,netIncome:n}=Ur(i);t.total=L(n).plus(t.total).toNumber(),t.months.push(e)}const{domainMin:r,domainMax:a}=n.reduce((e,t)=>({domainMin:Math.min(e.domainMin,-(t.expenses?.total??0)),domainMax:Math.max(e.domainMax,t.income?.total??0)}),{domainMin:0,domainMax:0});t.domain=[r,a],t.hasAnyData=t.months.some(e=>!e.hasNoData);const o=function(e,t){const n=t-e;return n>0?.03*n:3}(r,a);return t.months=t.months.map(e=>e.hasNoData?{...e,noDataHeight:o}:e),t}const Wr=Wt(Ot["tile-header"],St({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderTopRadius:"lg",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"15px"}));function Hr({title:e}){return E("div",{...Wr,children:E(Gt,{children:e})})}const qr=Wt(Ot["tile-body"],St({display:"flex",justifyContent:"start",alignItems:"start",flexDirection:"column",gap:"20px",height:"100%",padding:"20px 15px",backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderBottomRadius:"lg",borderTop:"hidden"}));function jr({children:e}){return E("div",{...qr,children:e})}const zr=Rt({base:{display:"flex",flexDirection:"column",boxShadow:"box-shadow",transition:"height 0.5s, width 0.5s",position:"relative"},variants:{type:{default:{width:"400px",flexShrink:0,height:"300px"},chart:{minWidth:"900px",maxWidth:"1440px",height:"481px"}},isSample:{true:{pointerEvents:"none"},false:{}}},defaultVariants:{type:"default"}});function Kr({children:e,type:t,isSample:n=!1}){const r=Wt(Ot.tile,zr({type:t,isSample:n}));return E("div",{...r,children:e})}const Yr=St({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),_r=St.raw({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"}),Gr=St({fontSize:"sm",fontStyle:"normal",fontWeight:"sm",lineHeight:"12px",letterSpacing:"0.66px"}),Qr=Wt(Ot.text,St({fontSize:"md",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr);function Zr({children:e}){return E("div",{...Qr,children:e})}const Xr=Wt(Ot["metric-xl"],Yt({metric:"xl"}));function Jr(e){return E("div",{...Xr,children:e.children})}const $r=Wt(Ot.summation,St({display:"flex",flexDirection:"column",flexShrink:1,alignItems:"flex-start",justifyContent:"space-between"}));function ea({title:e,label:t}){return S("div",{...$r,children:[E(Jr,{children:e}),E(Zr,{children:t})]})}const ta=Wt(null,St({display:"flex",flexDirection:"column",justifyContent:"space-evenly",alignItems:"start",height:"100%",width:"100%"}));function na({children:e}){return E("div",{...ta,children:e})}const ra=(e,t=0)=>{const n=Math.abs(e);let r;if(t<=0)r=Math.round(n);else{const e=n.toFixed(t);r=parseFloat(e)}return Math.sign(e)*r},aa=(e,t=0,n=2)=>e.toLocaleString(void 0,{useGrouping:!0,minimumFractionDigits:t,maximumFractionDigits:n}),oa=1e9;function ia(e,{cents:t="default",condense:n=!1,dollarSign:r=!1,signage:a="default"}={}){const o="string"==typeof e?parseFloat(e):e;if(Number.isNaN(o))return"";let i;const l=Math.abs(o);let s;if(n&&l>99999){s=Math.sign(o)<0;const e=Math.floor((d=l,Math.log(d)/Math.log(1e3)))-1,t=Math.pow(1e3,e),n=Math.round(l/t),r=n*t;let a,c=n/1e3;l<oa&&c>=1e3&&(c/=1e3),r>=oa?a="B":r>=1e6?a="M":(c=Math.round(c),a="K"),i=`${aa(c,0,1)}${a}`}else{let e;const n=2,r=0;let a,l;"floor"===t?(a=r,l=r,c=o,e=Math.sign(c)*Math.floor(Math.abs(c))):"round"===t?(a=r,l=r,e=ra(o,a)):"always"===t?(a=n,l=n,e=ra(o,a)):"default"===t&&Math.abs(o)>=1e3?(a=r,l=r,e=ra(o,a)):(a=n,e=ra(o,a),l=e%1==0?r:n),s=Math.sign(e)<0;const d=Math.abs(e);i=aa(d,l,a)}var c,d;let u=i;const h=r?"$":"";return void 0===a||"off"===a?u=i:"parens"===a?u=`${h}${s?`(${i})`:i}`:"always"===a?u=`${s?"-":"+"}${h}${i}`:"default"===a&&(u=`${s?"-":""}${h}${i}`),u}function la(e){return ia(e,{condense:!0,dollarSign:!0})}function sa(e){return ia(e,{cents:"always",condense:!1,dollarSign:!0,signage:"always"})}const ca={"sm-sm":Wt(Ot.text,St({fontSize:{sm:"sm",base:"md"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr),"sm-med":Wt(Ot.text,St({fontSize:{sm:"sm",base:"md"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr),"sm-lg":Wt(Ot.text,St({fontSize:"sm",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr),"med-sm":Wt(Ot.text,St({fontSize:{sm:"md",base:"lg"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr),"med-med":Wt(Ot.text,St({fontSize:{sm:"md",base:"lg"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr),"med-lg":Wt(Ot.text,St({fontSize:{sm:"md",base:"lg"},fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr)};function da({children:e,size:t,weight:n,stylists:r=[]}){const a=Kt([ca[`${t}-${n}`],...r]);return E("div",{title:e,...a,children:e})}const ua=Rt({variants:{wrap:{ellipsis:_r,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},textAlign:{start:{textAlign:"start"},center:{textAlign:"center"}}}});function ha({wrap:e="ellipsis",textAlign:t="start",children:n,stylists:r=[]}){if(wn(n))return null;const a=Wt(Ot["strong-label"],Yt({label:"strongLabel"}),ua({wrap:e,textAlign:t}));return E(da,{size:"med",weight:"med",stylists:[a,...r],children:n})}const pa=Rt({base:{fontWeight:"label.sub",fontSize:{sm:"label.sub",base:"md"},fontFamily:"label",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.66px",fontStyle:"normal"},variants:{intent:{normal:{color:"typography.label.sub"},action:{color:"typography.intent.action"},primary:{color:"typography.intent.primary"},danger:{color:"typography.accent.danger"}},accent:{action:{_supportHover:{color:"typography.accent.action",transition:"color 100ms ease-out"},transition:"color 300ms ease-out"},active:{color:"typography.accent.action"}},wrap:{ellipsis:_r,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}}}});function ga({intent:e,wrap:t="ellipsis",children:n,accent:r}){const a=void 0===e&&void 0===r?"normal":e,o=Wt(Ot["sub-label"],pa({intent:a,wrap:t,accent:r}),Yr);return wn(n)?null:E("div",{...o,children:n})}const ma=Wt(null,St({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",border:"1px solid {colors.border.layout}",borderRadius:"sm",backgroundColor:"surface.background",boxShadow:"box-shadow",padding:"10px",width:"fit-content",height:"fit-content"}));function va({active:e,payload:t}){if(t.length<=0||!e||t[0].dataKey===Br)return null;let n=t[0].value??0;return"expenses"===t[0].dataKey?n+=t[0].payload.loss:"income"===t[0].dataKey&&(n+=t[0].payload.profit),S("div",{...ma,children:[E(ha,{children:t[0].name??""}),E(ga,{children:la(Number(n))})]})}const ba={"colors.white100":{value:"#FFFFFF",variable:"var(--Tight-colors-white100)"},"colors.white200":{value:"#F9F9F9",variable:"var(--Tight-colors-white200)"},"colors.white300":{value:"#EDEDED",variable:"var(--Tight-colors-white300)"},"colors.white600":{value:"#E7E8E9",variable:"var(--Tight-colors-white600)"},"colors.black100":{value:"#CED1D2",variable:"var(--Tight-colors-black100)"},"colors.black400":{value:"#6F7576",variable:"var(--Tight-colors-black400)"},"colors.black600":{value:"#50595C",variable:"var(--Tight-colors-black600)"},"colors.black700":{value:"#182428",variable:"var(--Tight-colors-black700)"},"colors.blue300":{value:"#DAF4FA",variable:"var(--Tight-colors-blue300)"},"colors.blue400":{value:"#CAECF3",variable:"var(--Tight-colors-blue400)"},"colors.blue500":{value:"#94D8E8",variable:"var(--Tight-colors-blue500)"},"colors.blue700":{value:"#2AB2D1",variable:"var(--Tight-colors-blue700)"},"colors.blue900":{value:"#177F96",variable:"var(--Tight-colors-blue900)"},"colors.green300":{value:"#B8F3D5",variable:"var(--Tight-colors-green300)"},"colors.green400":{value:"#94E8BD",variable:"var(--Tight-colors-green400)"},"colors.green500":{value:"#5FDD9C",variable:"var(--Tight-colors-green500)"},"colors.green700":{value:"#009C75",variable:"var(--Tight-colors-green700)"},"colors.yellow300":{value:"#FFE787",variable:"var(--Tight-colors-yellow300)"},"colors.yellow400":{value:"#FCD34D",variable:"var(--Tight-colors-yellow400)"},"colors.yellow500":{value:"#FBBF24",variable:"var(--Tight-colors-yellow500)"},"colors.red300":{value:"#FF9797",variable:"var(--Tight-colors-red300)"},"colors.red400":{value:"#F45C5C",variable:"var(--Tight-colors-red400)"},"colors.red500":{value:"#E84747",variable:"var(--Tight-colors-red500)"},"colors.red700":{value:"#E42525",variable:"var(--Tight-colors-red700)"},"fonts.base":{value:"Duplet Regular, sans-serif",variable:"var(--Tight-fonts-base)"},"fontSizes.sm":{value:"11px",variable:"var(--Tight-fontSizes-sm)"},"fontSizes.md":{value:"14px",variable:"var(--Tight-fontSizes-md)"},"fontSizes.lg":{value:"16px",variable:"var(--Tight-fontSizes-lg)"},"fontSizes.xl":{value:"20px",variable:"var(--Tight-fontSizes-xl)"},"fontSizes.2xl":{value:"36px",variable:"var(--Tight-fontSizes-2xl)"},"fontWeights.sm":{value:"400",variable:"var(--Tight-fontWeights-sm)"},"fontWeights.md":{value:"600",variable:"var(--Tight-fontWeights-md)"},"fontWeights.lg":{value:"900",variable:"var(--Tight-fontWeights-lg)"},"radii.zero":{value:"0",variable:"var(--Tight-radii-zero)"},"radii.sm":{value:"1px",variable:"var(--Tight-radii-sm)"},"radii.md":{value:"2px",variable:"var(--Tight-radii-md)"},"radii.lg":{value:"4px",variable:"var(--Tight-radii-lg)"},"borderWidths.sm":{value:"0.5px",variable:"var(--Tight-borderWidths-sm)"},"borderWidths.md":{value:"1px",variable:"var(--Tight-borderWidths-md)"},"borderWidths.lg":{value:"1px",variable:"var(--Tight-borderWidths-lg)"},"borderWidths.xl":{value:"2px",variable:"var(--Tight-borderWidths-xl)"},"animations.appear.instant":{value:"0.25s linear fade-in",variable:"var(--Tight-animations-appear-instant)"},"animations.appear.delay":{value:"0.25s linear both 1.5s fade-in",variable:"var(--Tight-animations-appear-delay)"},"animations.shimmer":{value:"2s ease-in-out infinite shimmer",variable:"var(--Tight-animations-shimmer)"},"animations.spin":{value:"1.5s ease-in-out 0.1s spin infinite",variable:"var(--Tight-animations-spin)"},"animations.slideIn.right":{value:"0.3s ease-out both slide-in-right",variable:"var(--Tight-animations-slideIn-right)"},"animations.slideIn.up":{value:"0.3s ease-out both slide-in-up",variable:"var(--Tight-animations-slideIn-up)"},"animations.slideOut.right":{value:"0.3s ease-in both slide-out-right",variable:"var(--Tight-animations-slideOut-right)"},"animations.slideOut.down":{value:"0.3s ease-in both slide-out-down",variable:"var(--Tight-animations-slideOut-down)"},"shadows.box-shadow":{value:"0px 10px 30px 0px rgba(24, 36, 40, 0.10)",variable:"var(--Tight-shadows-box-shadow)"},"breakpoints.sm":{value:"640px",variable:"var(--Tight-breakpoints-sm)"},"breakpoints.md":{value:"850px",variable:"var(--Tight-breakpoints-md)"},"breakpoints.lg":{value:"1024px",variable:"var(--Tight-breakpoints-lg)"},"breakpoints.xl":{value:"1280px",variable:"var(--Tight-breakpoints-xl)"},"breakpoints.1.5xl":{value:"1400px",variable:"var(--Tight-breakpoints-1.5xl)"},"breakpoints.2xl":{value:"1536px",variable:"var(--Tight-breakpoints-2xl)"},"sizes.breakpoint-sm":{value:"640px",variable:"var(--Tight-sizes-breakpoint-sm)"},"sizes.breakpoint-md":{value:"850px",variable:"var(--Tight-sizes-breakpoint-md)"},"sizes.breakpoint-lg":{value:"1024px",variable:"var(--Tight-sizes-breakpoint-lg)"},"sizes.breakpoint-xl":{value:"1280px",variable:"var(--Tight-sizes-breakpoint-xl)"},"sizes.breakpoint-1.5xl":{value:"1400px",variable:"var(--Tight-sizes-breakpoint-1.5xl)"},"sizes.breakpoint-2xl":{value:"1536px",variable:"var(--Tight-sizes-breakpoint-2xl)"},"colors.brand.primary.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-brand-primary-weak)"},"colors.brand.primary":{value:"var(--Tight-colors-black600)",variable:"var(--Tight-colors-brand-primary)"},"colors.brand.primary.strong":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-brand-primary-strong)"},"colors.brand.secondary.weak":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-brand-secondary-weak)"},"colors.brand.secondary":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-brand-secondary)"},"colors.brand.secondary.strong":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-brand-secondary-strong)"},"colors.brand.action.weak":{value:"var(--Tight-colors-blue300)",variable:"var(--Tight-colors-brand-action-weak)"},"colors.brand.action":{value:"var(--Tight-colors-blue400)",variable:"var(--Tight-colors-brand-action)"},"colors.brand.action.strong":{value:"var(--Tight-colors-blue500)",variable:"var(--Tight-colors-brand-action-strong)"},"colors.brand.action.stronger":{value:"var(--Tight-colors-blue700)",variable:"var(--Tight-colors-brand-action-stronger)"},"colors.brand.action.strongest":{value:"var(--Tight-colors-blue900)",variable:"var(--Tight-colors-brand-action-strongest)"},"colors.brand.success.weak":{value:"var(--Tight-colors-green300)",variable:"var(--Tight-colors-brand-success-weak)"},"colors.brand.success":{value:"var(--Tight-colors-green400)",variable:"var(--Tight-colors-brand-success)"},"colors.brand.success.strong":{value:"var(--Tight-colors-green500)",variable:"var(--Tight-colors-brand-success-strong)"},"colors.brand.warning.weak":{value:"var(--Tight-colors-yellow300)",variable:"var(--Tight-colors-brand-warning-weak)"},"colors.brand.warning":{value:"var(--Tight-colors-yellow400)",variable:"var(--Tight-colors-brand-warning)"},"colors.brand.warning.strong":{value:"var(--Tight-colors-yellow500)",variable:"var(--Tight-colors-brand-warning-strong)"},"colors.brand.danger.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-brand-danger-weak)"},"colors.brand.danger":{value:"var(--Tight-colors-red400)",variable:"var(--Tight-colors-brand-danger)"},"colors.brand.danger.strong":{value:"var(--Tight-colors-red500)",variable:"var(--Tight-colors-brand-danger-strong)"},"colors.surface.background":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-background)"},"colors.surface.background.hover":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-background-hover)"},"colors.surface.foreground":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-surface-foreground)"},"colors.surface.foreground.hover":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-foreground-hover)"},"colors.surface.foreground.disabled":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-foreground-disabled)"},"colors.surface.elevated":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-elevated)"},"colors.surface.elevated.hover":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-elevated-hover)"},"colors.surface.intent.primary":{value:"var(--Tight-colors-brand-primary-weak)",variable:"var(--Tight-colors-surface-intent-primary)"},"colors.surface.intent.primary.hover":{value:"var(--Tight-colors-brand-primary)",variable:"var(--Tight-colors-surface-intent-primary-hover)"},"colors.surface.intent.primary.active":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-surface-intent-primary-active)"},"colors.surface.intent.primary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-primary-disabled)"},"colors.surface.intent.secondary":{value:"var(--Tight-colors-brand-secondary-weak)",variable:"var(--Tight-colors-surface-intent-secondary)"},"colors.surface.intent.secondary.hover":{value:"var(--Tight-colors-brand-secondary)",variable:"var(--Tight-colors-surface-intent-secondary-hover)"},"colors.surface.intent.secondary.active":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-surface-intent-secondary-active)"},"colors.surface.intent.secondary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-secondary-disabled)"},"colors.surface.intent.action":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action)"},"colors.surface.intent.action.hover":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-hover)"},"colors.surface.intent.action.active":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-surface-intent-action-active)"},"colors.surface.intent.action.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-action-disabled)"},"colors.surface.intent.action.discrete":{value:"transparent",variable:"var(--Tight-colors-surface-intent-action-discrete)"},"colors.surface.intent.action.discrete.hover":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action-discrete-hover)"},"colors.surface.intent.action.discrete.active":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-discrete-active)"},"colors.surface.intent.success":{value:"var(--Tight-colors-brand-success-weak)",variable:"var(--Tight-colors-surface-intent-success)"},"colors.surface.intent.success.hover":{value:"var(--Tight-colors-brand-success)",variable:"var(--Tight-colors-surface-intent-success-hover)"},"colors.surface.intent.success.active":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-surface-intent-success-active)"},"colors.surface.intent.success.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-success-disabled)"},"colors.surface.intent.warning":{value:"var(--Tight-colors-brand-warning-weak)",variable:"var(--Tight-colors-surface-intent-warning)"},"colors.surface.intent.warning.hover":{value:"var(--Tight-colors-brand-warning)",variable:"var(--Tight-colors-surface-intent-warning-hover)"},"colors.surface.intent.warning.active":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-surface-intent-warning-active)"},"colors.surface.intent.warning.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-warning-disabled)"},"colors.surface.intent.danger":{value:"var(--Tight-colors-brand-danger-weak)",variable:"var(--Tight-colors-surface-intent-danger)"},"colors.surface.intent.danger.hover":{value:"var(--Tight-colors-brand-danger)",variable:"var(--Tight-colors-surface-intent-danger-hover)"},"colors.surface.intent.danger.active":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-surface-intent-danger-active)"},"colors.surface.intent.danger.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-danger-disabled)"},"colors.typography.base":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-typography-base)"},"colors.typography.base.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-typography-base-weak)"},"colors.typography.contrast":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-contrast)"},"colors.typography.contrast.weak":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-typography-contrast-weak)"},"colors.typography.intent.primary":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary)"},"colors.typography.intent.primary.hover":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-hover)"},"colors.typography.intent.primary.active":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-active)"},"colors.typography.intent.secondary":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary)"},"colors.typography.intent.secondary.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-hover)"},"colors.typography.intent.secondary.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-active)"},"colors.typography.intent.action":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action)"},"colors.typography.intent.action.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action-hover)"},"colors.typography.intent.action.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action-active)"},"colors.typography.intent.success":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success)"},"colors.typography.intent.success.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success-hover)"},"colors.typography.intent.success.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success-active)"},"colors.typography.intent.warning":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning)"},"colors.typography.intent.warning.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning-hover)"},"colors.typography.intent.warning.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning-active)"},"colors.typography.intent.danger":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger)"},"colors.typography.intent.danger.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger-hover)"},"colors.typography.intent.danger.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger-active)"},"colors.typography.accent.success":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-typography-accent-success)"},"colors.typography.accent.warning":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-typography-accent-warning)"},"colors.typography.accent.danger":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-typography-accent-danger)"},"colors.typography.accent.action":{value:"var(--Tight-colors-brand-action-strongest)",variable:"var(--Tight-colors-typography-accent-action)"},"colors.typography.body":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-body)"},"colors.typography.label":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label)"},"colors.typography.label.sub":{value:"var(--Tight-colors-typography-base-weak)",variable:"var(--Tight-colors-typography-label-sub)"},"colors.typography.label.strong":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-strong)"},"colors.typography.label.strongSub":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-strongSub)"},"colors.typography.label.emphasisSub":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-emphasisSub)"},"colors.typography.heading":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-heading)"},"colors.typography.metric.sm":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-sm)"},"colors.typography.metric.md":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-md)"},"colors.typography.metric.lg":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-lg)"},"colors.typography.metric.xl":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-xl)"},"colors.icon.base":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-icon-base)"},"colors.icon.base.weak":{value:"var(--Tight-colors-typography-base-weak)",variable:"var(--Tight-colors-icon-base-weak)"},"colors.icon.contrast":{value:"var(--Tight-colors-typography-contrast)",variable:"var(--Tight-colors-icon-contrast)"},"colors.icon.contrast.weak":{value:"var(--Tight-colors-typography-contrast-weak)",variable:"var(--Tight-colors-icon-contrast-weak)"},"colors.icon.intent.primary":{value:"var(--Tight-colors-typography-intent-primary)",variable:"var(--Tight-colors-icon-intent-primary)"},"colors.icon.intent.primary.hover":{value:"var(--Tight-colors-typography-intent-primary-hover)",variable:"var(--Tight-colors-icon-intent-primary-hover)"},"colors.icon.intent.primary.active":{value:"var(--Tight-colors-typography-intent-primary-active)",variable:"var(--Tight-colors-icon-intent-primary-active)"},"colors.icon.intent.secondary":{value:"var(--Tight-colors-typography-intent-secondary)",variable:"var(--Tight-colors-icon-intent-secondary)"},"colors.icon.intent.secondary.hover":{value:"var(--Tight-colors-typography-intent-secondary-hover)",variable:"var(--Tight-colors-icon-intent-secondary-hover)"},"colors.icon.intent.secondary.active":{value:"var(--Tight-colors-typography-intent-secondary-active)",variable:"var(--Tight-colors-icon-intent-secondary-active)"},"colors.icon.intent.action":{value:"var(--Tight-colors-typography-intent-action)",variable:"var(--Tight-colors-icon-intent-action)"},"colors.icon.intent.action.hover":{value:"var(--Tight-colors-typography-intent-action-hover)",variable:"var(--Tight-colors-icon-intent-action-hover)"},"colors.icon.intent.action.active":{value:"var(--Tight-colors-typography-intent-action-active)",variable:"var(--Tight-colors-icon-intent-action-active)"},"colors.icon.intent.success":{value:"var(--Tight-colors-typography-intent-success)",variable:"var(--Tight-colors-icon-intent-success)"},"colors.icon.intent.success.hover":{value:"var(--Tight-colors-typography-intent-success-hover)",variable:"var(--Tight-colors-icon-intent-success-hover)"},"colors.icon.intent.success.active":{value:"var(--Tight-colors-typography-intent-success-active)",variable:"var(--Tight-colors-icon-intent-success-active)"},"colors.icon.intent.warning":{value:"var(--Tight-colors-typography-intent-warning)",variable:"var(--Tight-colors-icon-intent-warning)"},"colors.icon.intent.warning.hover":{value:"var(--Tight-colors-typography-intent-warning-hover)",variable:"var(--Tight-colors-icon-intent-warning-hover)"},"colors.icon.intent.warning.active":{value:"var(--Tight-colors-typography-intent-warning-active)",variable:"var(--Tight-colors-icon-intent-warning-active)"},"colors.icon.intent.danger":{value:"var(--Tight-colors-typography-intent-danger)",variable:"var(--Tight-colors-icon-intent-danger)"},"colors.icon.intent.danger.hover":{value:"var(--Tight-colors-typography-intent-danger-hover)",variable:"var(--Tight-colors-icon-intent-danger-hover)"},"colors.icon.intent.danger.active":{value:"var(--Tight-colors-typography-intent-danger-active)",variable:"var(--Tight-colors-icon-intent-danger-active)"},"colors.icon.accent.success":{value:"var(--Tight-colors-typography-accent-success)",variable:"var(--Tight-colors-icon-accent-success)"},"colors.icon.accent.warning":{value:"var(--Tight-colors-typography-accent-warning)",variable:"var(--Tight-colors-icon-accent-warning)"},"colors.icon.accent.danger":{value:"var(--Tight-colors-typography-accent-danger)",variable:"var(--Tight-colors-icon-accent-danger)"},"colors.border.layout.weak":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-border-layout-weak)"},"colors.border.layout":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-border-layout)"},"colors.border.layout.strong":{value:"var(--Tight-colors-black600)",variable:"var(--Tight-colors-border-layout-strong)"},"colors.border.intent.primary.hover":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary-hover)"},"colors.border.intent.primary":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary)"},"colors.border.intent.primary.active":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary-active)"},"colors.border.intent.primary.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-primary-disabled)"},"colors.border.intent.secondary.hover":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary-hover)"},"colors.border.intent.secondary":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary)"},"colors.border.intent.secondary.active":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary-active)"},"colors.border.intent.secondary.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-secondary-disabled)"},"colors.border.intent.danger.hover":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger-hover)"},"colors.border.intent.danger":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger)"},"colors.border.intent.danger.active":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger-active)"},"colors.border.intent.danger.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-danger-disabled)"},"colors.border.intent.warning.hover":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning-hover)"},"colors.border.intent.warning":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning)"},"colors.border.intent.warning.active":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning-active)"},"colors.border.intent.warning.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-warning-disabled)"},"colors.border.intent.success.hover":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success-hover)"},"colors.border.intent.success":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success)"},"colors.border.intent.success.active":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success-active)"},"colors.border.intent.success.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-success-disabled)"},"colors.border.intent.action.hover":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action-hover)"},"colors.border.intent.action":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action)"},"colors.border.intent.action.active":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action-active)"},"colors.border.intent.action.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-action-disabled)"},"colors.money":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-money)"},"colors.money.positive":{value:"var(--Tight-colors-green700)",variable:"var(--Tight-colors-money-positive)"},"colors.money.positive.weak":{value:"var(--Tight-colors-green500)",variable:"var(--Tight-colors-money-positive-weak)"},"colors.money.negative":{value:"var(--Tight-colors-red700)",variable:"var(--Tight-colors-money-negative)"},"colors.money.negative.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-money-negative-weak)"},"colors.overlay":{value:"rgba(0, 0, 0, 0.5)",variable:"var(--Tight-colors-overlay)"},"colors.transparent":{value:"transparent",variable:"var(--Tight-colors-transparent)"},"colors.none":{value:"none",variable:"var(--Tight-colors-none)"},"colors.inherit":{value:"inherit",variable:"var(--Tight-colors-inherit)"},"colors.currentColor":{value:"currentColor",variable:"var(--Tight-colors-currentColor)"},"fonts.body":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-body)"},"fonts.label":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-label)"},"fonts.heading":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-heading)"},"fonts.metric":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-metric)"},"fontWeights.global":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-global)"},"fontWeights.body":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-body)"},"fontWeights.label":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label)"},"fontWeights.label.strong":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strong)"},"fontWeights.label.sub":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label-sub)"},"fontWeights.label.strongSub":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strongSub)"},"fontWeights.label.emphasisSub":{value:"var(--Tight-fontWeights-lg)",variable:"var(--Tight-fontWeights-label-emphasisSub)"},"fontWeights.heading":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-heading)"},"fontWeights.title":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-title)"},"fontWeights.metric.sm":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-sm)"},"fontWeights.metric.md":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-md)"},"fontWeights.metric.lg":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-lg)"},"fontWeights.metric.xl":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-xl)"},"fontSizes.title":{value:"var(--Tight-fontSizes-2xl)",variable:"var(--Tight-fontSizes-title)"},"fontSizes.body":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-body)"},"fontSizes.label":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-label)"},"fontSizes.label.strong":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-label-strong)"},"fontSizes.label.sub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-sub)"},"fontSizes.label.strongSub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-strongSub)"},"fontSizes.label.emphasisSub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-emphasisSub)"},"fontSizes.heading":{value:"var(--Tight-fontSizes-xl)",variable:"var(--Tight-fontSizes-heading)"},"fontSizes.metric.sm":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-metric-sm)"},"fontSizes.metric.md":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-metric-md)"},"fontSizes.metric.lg":{value:"var(--Tight-fontSizes-xl)",variable:"var(--Tight-fontSizes-metric-lg)"},"fontSizes.metric.xl":{value:"var(--Tight-fontSizes-2xl)",variable:"var(--Tight-fontSizes-metric-xl)"},"colors.colorPalette":{value:"var(--Tight-colors-colorPalette)",variable:"var(--Tight-colors-colorPalette)"},"colors.colorPalette.primary.weak":{value:"var(--Tight-colors-colorPalette-primary-weak)",variable:"var(--Tight-colors-colorPalette-primary-weak)"},"colors.colorPalette.weak":{value:"var(--Tight-colors-colorPalette-weak)",variable:"var(--Tight-colors-colorPalette-weak)"},"colors.colorPalette.primary":{value:"var(--Tight-colors-colorPalette-primary)",variable:"var(--Tight-colors-colorPalette-primary)"},"colors.colorPalette.primary.strong":{value:"var(--Tight-colors-colorPalette-primary-strong)",variable:"var(--Tight-colors-colorPalette-primary-strong)"},"colors.colorPalette.strong":{value:"var(--Tight-colors-colorPalette-strong)",variable:"var(--Tight-colors-colorPalette-strong)"},"colors.colorPalette.secondary.weak":{value:"var(--Tight-colors-colorPalette-secondary-weak)",variable:"var(--Tight-colors-colorPalette-secondary-weak)"},"colors.colorPalette.secondary":{value:"var(--Tight-colors-colorPalette-secondary)",variable:"var(--Tight-colors-colorPalette-secondary)"},"colors.colorPalette.secondary.strong":{value:"var(--Tight-colors-colorPalette-secondary-strong)",variable:"var(--Tight-colors-colorPalette-secondary-strong)"},"colors.colorPalette.action.weak":{value:"var(--Tight-colors-colorPalette-action-weak)",variable:"var(--Tight-colors-colorPalette-action-weak)"},"colors.colorPalette.action":{value:"var(--Tight-colors-colorPalette-action)",variable:"var(--Tight-colors-colorPalette-action)"},"colors.colorPalette.action.strong":{value:"var(--Tight-colors-colorPalette-action-strong)",variable:"var(--Tight-colors-colorPalette-action-strong)"},"colors.colorPalette.action.stronger":{value:"var(--Tight-colors-colorPalette-action-stronger)",variable:"var(--Tight-colors-colorPalette-action-stronger)"},"colors.colorPalette.stronger":{value:"var(--Tight-colors-colorPalette-stronger)",variable:"var(--Tight-colors-colorPalette-stronger)"},"colors.colorPalette.action.strongest":{value:"var(--Tight-colors-colorPalette-action-strongest)",variable:"var(--Tight-colors-colorPalette-action-strongest)"},"colors.colorPalette.strongest":{value:"var(--Tight-colors-colorPalette-strongest)",variable:"var(--Tight-colors-colorPalette-strongest)"},"colors.colorPalette.success.weak":{value:"var(--Tight-colors-colorPalette-success-weak)",variable:"var(--Tight-colors-colorPalette-success-weak)"},"colors.colorPalette.success":{value:"var(--Tight-colors-colorPalette-success)",variable:"var(--Tight-colors-colorPalette-success)"},"colors.colorPalette.success.strong":{value:"var(--Tight-colors-colorPalette-success-strong)",variable:"var(--Tight-colors-colorPalette-success-strong)"},"colors.colorPalette.warning.weak":{value:"var(--Tight-colors-colorPalette-warning-weak)",variable:"var(--Tight-colors-colorPalette-warning-weak)"},"colors.colorPalette.warning":{value:"var(--Tight-colors-colorPalette-warning)",variable:"var(--Tight-colors-colorPalette-warning)"},"colors.colorPalette.warning.strong":{value:"var(--Tight-colors-colorPalette-warning-strong)",variable:"var(--Tight-colors-colorPalette-warning-strong)"},"colors.colorPalette.danger.weak":{value:"var(--Tight-colors-colorPalette-danger-weak)",variable:"var(--Tight-colors-colorPalette-danger-weak)"},"colors.colorPalette.danger":{value:"var(--Tight-colors-colorPalette-danger)",variable:"var(--Tight-colors-colorPalette-danger)"},"colors.colorPalette.danger.strong":{value:"var(--Tight-colors-colorPalette-danger-strong)",variable:"var(--Tight-colors-colorPalette-danger-strong)"},"colors.colorPalette.background":{value:"var(--Tight-colors-colorPalette-background)",variable:"var(--Tight-colors-colorPalette-background)"},"colors.colorPalette.background.hover":{value:"var(--Tight-colors-colorPalette-background-hover)",variable:"var(--Tight-colors-colorPalette-background-hover)"},"colors.colorPalette.hover":{value:"var(--Tight-colors-colorPalette-hover)",variable:"var(--Tight-colors-colorPalette-hover)"},"colors.colorPalette.foreground":{value:"var(--Tight-colors-colorPalette-foreground)",variable:"var(--Tight-colors-colorPalette-foreground)"},"colors.colorPalette.foreground.hover":{value:"var(--Tight-colors-colorPalette-foreground-hover)",variable:"var(--Tight-colors-colorPalette-foreground-hover)"},"colors.colorPalette.foreground.disabled":{value:"var(--Tight-colors-colorPalette-foreground-disabled)",variable:"var(--Tight-colors-colorPalette-foreground-disabled)"},"colors.colorPalette.disabled":{value:"var(--Tight-colors-colorPalette-disabled)",variable:"var(--Tight-colors-colorPalette-disabled)"},"colors.colorPalette.elevated":{value:"var(--Tight-colors-colorPalette-elevated)",variable:"var(--Tight-colors-colorPalette-elevated)"},"colors.colorPalette.elevated.hover":{value:"var(--Tight-colors-colorPalette-elevated-hover)",variable:"var(--Tight-colors-colorPalette-elevated-hover)"},"colors.colorPalette.intent.primary":{value:"var(--Tight-colors-colorPalette-intent-primary)",variable:"var(--Tight-colors-colorPalette-intent-primary)"},"colors.colorPalette.intent.primary.hover":{value:"var(--Tight-colors-colorPalette-intent-primary-hover)",variable:"var(--Tight-colors-colorPalette-intent-primary-hover)"},"colors.colorPalette.primary.hover":{value:"var(--Tight-colors-colorPalette-primary-hover)",variable:"var(--Tight-colors-colorPalette-primary-hover)"},"colors.colorPalette.intent.primary.active":{value:"var(--Tight-colors-colorPalette-intent-primary-active)",variable:"var(--Tight-colors-colorPalette-intent-primary-active)"},"colors.colorPalette.primary.active":{value:"var(--Tight-colors-colorPalette-primary-active)",variable:"var(--Tight-colors-colorPalette-primary-active)"},"colors.colorPalette.active":{value:"var(--Tight-colors-colorPalette-active)",variable:"var(--Tight-colors-colorPalette-active)"},"colors.colorPalette.intent.primary.disabled":{value:"var(--Tight-colors-colorPalette-intent-primary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-primary-disabled)"},"colors.colorPalette.primary.disabled":{value:"var(--Tight-colors-colorPalette-primary-disabled)",variable:"var(--Tight-colors-colorPalette-primary-disabled)"},"colors.colorPalette.intent.secondary":{value:"var(--Tight-colors-colorPalette-intent-secondary)",variable:"var(--Tight-colors-colorPalette-intent-secondary)"},"colors.colorPalette.intent.secondary.hover":{value:"var(--Tight-colors-colorPalette-intent-secondary-hover)",variable:"var(--Tight-colors-colorPalette-intent-secondary-hover)"},"colors.colorPalette.secondary.hover":{value:"var(--Tight-colors-colorPalette-secondary-hover)",variable:"var(--Tight-colors-colorPalette-secondary-hover)"},"colors.colorPalette.intent.secondary.active":{value:"var(--Tight-colors-colorPalette-intent-secondary-active)",variable:"var(--Tight-colors-colorPalette-intent-secondary-active)"},"colors.colorPalette.secondary.active":{value:"var(--Tight-colors-colorPalette-secondary-active)",variable:"var(--Tight-colors-colorPalette-secondary-active)"},"colors.colorPalette.intent.secondary.disabled":{value:"var(--Tight-colors-colorPalette-intent-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-secondary-disabled)"},"colors.colorPalette.secondary.disabled":{value:"var(--Tight-colors-colorPalette-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-secondary-disabled)"},"colors.colorPalette.intent.action":{value:"var(--Tight-colors-colorPalette-intent-action)",variable:"var(--Tight-colors-colorPalette-intent-action)"},"colors.colorPalette.intent.action.hover":{value:"var(--Tight-colors-colorPalette-intent-action-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-hover)"},"colors.colorPalette.action.hover":{value:"var(--Tight-colors-colorPalette-action-hover)",variable:"var(--Tight-colors-colorPalette-action-hover)"},"colors.colorPalette.intent.action.active":{value:"var(--Tight-colors-colorPalette-intent-action-active)",variable:"var(--Tight-colors-colorPalette-intent-action-active)"},"colors.colorPalette.action.active":{value:"var(--Tight-colors-colorPalette-action-active)",variable:"var(--Tight-colors-colorPalette-action-active)"},"colors.colorPalette.intent.action.disabled":{value:"var(--Tight-colors-colorPalette-intent-action-disabled)",variable:"var(--Tight-colors-colorPalette-intent-action-disabled)"},"colors.colorPalette.action.disabled":{value:"var(--Tight-colors-colorPalette-action-disabled)",variable:"var(--Tight-colors-colorPalette-action-disabled)"},"colors.colorPalette.intent.action.discrete":{value:"var(--Tight-colors-colorPalette-intent-action-discrete)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete)"},"colors.colorPalette.action.discrete":{value:"var(--Tight-colors-colorPalette-action-discrete)",variable:"var(--Tight-colors-colorPalette-action-discrete)"},"colors.colorPalette.discrete":{value:"var(--Tight-colors-colorPalette-discrete)",variable:"var(--Tight-colors-colorPalette-discrete)"},"colors.colorPalette.intent.action.discrete.hover":{value:"var(--Tight-colors-colorPalette-intent-action-discrete-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete-hover)"},"colors.colorPalette.action.discrete.hover":{value:"var(--Tight-colors-colorPalette-action-discrete-hover)",variable:"var(--Tight-colors-colorPalette-action-discrete-hover)"},"colors.colorPalette.discrete.hover":{value:"var(--Tight-colors-colorPalette-discrete-hover)",variable:"var(--Tight-colors-colorPalette-discrete-hover)"},"colors.colorPalette.intent.action.discrete.active":{value:"var(--Tight-colors-colorPalette-intent-action-discrete-active)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete-active)"},"colors.colorPalette.action.discrete.active":{value:"var(--Tight-colors-colorPalette-action-discrete-active)",variable:"var(--Tight-colors-colorPalette-action-discrete-active)"},"colors.colorPalette.discrete.active":{value:"var(--Tight-colors-colorPalette-discrete-active)",variable:"var(--Tight-colors-colorPalette-discrete-active)"},"colors.colorPalette.intent.success":{value:"var(--Tight-colors-colorPalette-intent-success)",variable:"var(--Tight-colors-colorPalette-intent-success)"},"colors.colorPalette.intent.success.hover":{value:"var(--Tight-colors-colorPalette-intent-success-hover)",variable:"var(--Tight-colors-colorPalette-intent-success-hover)"},"colors.colorPalette.success.hover":{value:"var(--Tight-colors-colorPalette-success-hover)",variable:"var(--Tight-colors-colorPalette-success-hover)"},"colors.colorPalette.intent.success.active":{value:"var(--Tight-colors-colorPalette-intent-success-active)",variable:"var(--Tight-colors-colorPalette-intent-success-active)"},"colors.colorPalette.success.active":{value:"var(--Tight-colors-colorPalette-success-active)",variable:"var(--Tight-colors-colorPalette-success-active)"},"colors.colorPalette.intent.success.disabled":{value:"var(--Tight-colors-colorPalette-intent-success-disabled)",variable:"var(--Tight-colors-colorPalette-intent-success-disabled)"},"colors.colorPalette.success.disabled":{value:"var(--Tight-colors-colorPalette-success-disabled)",variable:"var(--Tight-colors-colorPalette-success-disabled)"},"colors.colorPalette.intent.warning":{value:"var(--Tight-colors-colorPalette-intent-warning)",variable:"var(--Tight-colors-colorPalette-intent-warning)"},"colors.colorPalette.intent.warning.hover":{value:"var(--Tight-colors-colorPalette-intent-warning-hover)",variable:"var(--Tight-colors-colorPalette-intent-warning-hover)"},"colors.colorPalette.warning.hover":{value:"var(--Tight-colors-colorPalette-warning-hover)",variable:"var(--Tight-colors-colorPalette-warning-hover)"},"colors.colorPalette.intent.warning.active":{value:"var(--Tight-colors-colorPalette-intent-warning-active)",variable:"var(--Tight-colors-colorPalette-intent-warning-active)"},"colors.colorPalette.warning.active":{value:"var(--Tight-colors-colorPalette-warning-active)",variable:"var(--Tight-colors-colorPalette-warning-active)"},"colors.colorPalette.intent.warning.disabled":{value:"var(--Tight-colors-colorPalette-intent-warning-disabled)",variable:"var(--Tight-colors-colorPalette-intent-warning-disabled)"},"colors.colorPalette.warning.disabled":{value:"var(--Tight-colors-colorPalette-warning-disabled)",variable:"var(--Tight-colors-colorPalette-warning-disabled)"},"colors.colorPalette.intent.danger":{value:"var(--Tight-colors-colorPalette-intent-danger)",variable:"var(--Tight-colors-colorPalette-intent-danger)"},"colors.colorPalette.intent.danger.hover":{value:"var(--Tight-colors-colorPalette-intent-danger-hover)",variable:"var(--Tight-colors-colorPalette-intent-danger-hover)"},"colors.colorPalette.danger.hover":{value:"var(--Tight-colors-colorPalette-danger-hover)",variable:"var(--Tight-colors-colorPalette-danger-hover)"},"colors.colorPalette.intent.danger.active":{value:"var(--Tight-colors-colorPalette-intent-danger-active)",variable:"var(--Tight-colors-colorPalette-intent-danger-active)"},"colors.colorPalette.danger.active":{value:"var(--Tight-colors-colorPalette-danger-active)",variable:"var(--Tight-colors-colorPalette-danger-active)"},"colors.colorPalette.intent.danger.disabled":{value:"var(--Tight-colors-colorPalette-intent-danger-disabled)",variable:"var(--Tight-colors-colorPalette-intent-danger-disabled)"},"colors.colorPalette.danger.disabled":{value:"var(--Tight-colors-colorPalette-danger-disabled)",variable:"var(--Tight-colors-colorPalette-danger-disabled)"},"colors.colorPalette.base":{value:"var(--Tight-colors-colorPalette-base)",variable:"var(--Tight-colors-colorPalette-base)"},"colors.colorPalette.base.weak":{value:"var(--Tight-colors-colorPalette-base-weak)",variable:"var(--Tight-colors-colorPalette-base-weak)"},"colors.colorPalette.contrast":{value:"var(--Tight-colors-colorPalette-contrast)",variable:"var(--Tight-colors-colorPalette-contrast)"},"colors.colorPalette.contrast.weak":{value:"var(--Tight-colors-colorPalette-contrast-weak)",variable:"var(--Tight-colors-colorPalette-contrast-weak)"},"colors.colorPalette.accent.success":{value:"var(--Tight-colors-colorPalette-accent-success)",variable:"var(--Tight-colors-colorPalette-accent-success)"},"colors.colorPalette.accent.warning":{value:"var(--Tight-colors-colorPalette-accent-warning)",variable:"var(--Tight-colors-colorPalette-accent-warning)"},"colors.colorPalette.accent.danger":{value:"var(--Tight-colors-colorPalette-accent-danger)",variable:"var(--Tight-colors-colorPalette-accent-danger)"},"colors.colorPalette.accent.action":{value:"var(--Tight-colors-colorPalette-accent-action)",variable:"var(--Tight-colors-colorPalette-accent-action)"},"colors.colorPalette.body":{value:"var(--Tight-colors-colorPalette-body)",variable:"var(--Tight-colors-colorPalette-body)"},"colors.colorPalette.label":{value:"var(--Tight-colors-colorPalette-label)",variable:"var(--Tight-colors-colorPalette-label)"},"colors.colorPalette.label.sub":{value:"var(--Tight-colors-colorPalette-label-sub)",variable:"var(--Tight-colors-colorPalette-label-sub)"},"colors.colorPalette.sub":{value:"var(--Tight-colors-colorPalette-sub)",variable:"var(--Tight-colors-colorPalette-sub)"},"colors.colorPalette.label.strong":{value:"var(--Tight-colors-colorPalette-label-strong)",variable:"var(--Tight-colors-colorPalette-label-strong)"},"colors.colorPalette.label.strongSub":{value:"var(--Tight-colors-colorPalette-label-strongSub)",variable:"var(--Tight-colors-colorPalette-label-strongSub)"},"colors.colorPalette.strongSub":{value:"var(--Tight-colors-colorPalette-strongSub)",variable:"var(--Tight-colors-colorPalette-strongSub)"},"colors.colorPalette.label.emphasisSub":{value:"var(--Tight-colors-colorPalette-label-emphasisSub)",variable:"var(--Tight-colors-colorPalette-label-emphasisSub)"},"colors.colorPalette.emphasisSub":{value:"var(--Tight-colors-colorPalette-emphasisSub)",variable:"var(--Tight-colors-colorPalette-emphasisSub)"},"colors.colorPalette.heading":{value:"var(--Tight-colors-colorPalette-heading)",variable:"var(--Tight-colors-colorPalette-heading)"},"colors.colorPalette.metric.sm":{value:"var(--Tight-colors-colorPalette-metric-sm)",variable:"var(--Tight-colors-colorPalette-metric-sm)"},"colors.colorPalette.sm":{value:"var(--Tight-colors-colorPalette-sm)",variable:"var(--Tight-colors-colorPalette-sm)"},"colors.colorPalette.metric.md":{value:"var(--Tight-colors-colorPalette-metric-md)",variable:"var(--Tight-colors-colorPalette-metric-md)"},"colors.colorPalette.md":{value:"var(--Tight-colors-colorPalette-md)",variable:"var(--Tight-colors-colorPalette-md)"},"colors.colorPalette.metric.lg":{value:"var(--Tight-colors-colorPalette-metric-lg)",variable:"var(--Tight-colors-colorPalette-metric-lg)"},"colors.colorPalette.lg":{value:"var(--Tight-colors-colorPalette-lg)",variable:"var(--Tight-colors-colorPalette-lg)"},"colors.colorPalette.metric.xl":{value:"var(--Tight-colors-colorPalette-metric-xl)",variable:"var(--Tight-colors-colorPalette-metric-xl)"},"colors.colorPalette.xl":{value:"var(--Tight-colors-colorPalette-xl)",variable:"var(--Tight-colors-colorPalette-xl)"},"colors.colorPalette.layout.weak":{value:"var(--Tight-colors-colorPalette-layout-weak)",variable:"var(--Tight-colors-colorPalette-layout-weak)"},"colors.colorPalette.layout":{value:"var(--Tight-colors-colorPalette-layout)",variable:"var(--Tight-colors-colorPalette-layout)"},"colors.colorPalette.layout.strong":{value:"var(--Tight-colors-colorPalette-layout-strong)",variable:"var(--Tight-colors-colorPalette-layout-strong)"},"colors.colorPalette.positive":{value:"var(--Tight-colors-colorPalette-positive)",variable:"var(--Tight-colors-colorPalette-positive)"},"colors.colorPalette.positive.weak":{value:"var(--Tight-colors-colorPalette-positive-weak)",variable:"var(--Tight-colors-colorPalette-positive-weak)"},"colors.colorPalette.negative":{value:"var(--Tight-colors-colorPalette-negative)",variable:"var(--Tight-colors-colorPalette-negative)"},"colors.colorPalette.negative.weak":{value:"var(--Tight-colors-colorPalette-negative-weak)",variable:"var(--Tight-colors-colorPalette-negative-weak)"}};function fa(e,t){return ba[e]?.value||t}fa.var=function(e,t){return ba[e]?.variable||t};const ya=Wt(null,St({borderRadius:"50%",flexShrink:0})),ka=Wt(null,St({display:"flex",flexDirection:"row",gap:"10px",alignItems:"center",minWidth:0})),xa=fa.var("colors.surface.foreground.disabled");function Ta({color:e=xa,diameter:t=17,label:n}){return S("div",{...ka,"data-testid":"bullet-row",children:[E("div",{...ya,style:{backgroundColor:e,width:`${t}px`,height:`${t}px`},"data-testid":"bullet"}),n&&E(ga,{children:n})]})}const Ca=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",gap:"30px"}));function wa({payload:e}){return void 0===e?null:E("div",{...Ca,children:e.map((e,t)=>"none"!==e.type&&E(Ta,{color:e.color,label:e.value,diameter:17},t))})}const Aa={right:20,left:20},Ea=["income","profit","expenses","loss"],Ia=e=>Ea.findIndex(t=>t===e.dataKey),Sa={paddingBottom:"20px",marginLeft:"-20px"},Na={stackId:"stack",isAnimationActive:!1},Pa=Wt(Ot["profit-loss-graph"],St({"& .recharts-surface":{outline:"none"}})),Da=fa.var("colors.money"),Ra=fa.var("colors.border.layout"),Ma=fa.var("colors.border.layout.strong"),Oa={fill:fa.var("colors.typography.base"),fontSize:fa.var("fontSizes.metric.sm")},La={profit:fa.var("colors.money.positive"),income:fa.var("colors.money.positive.weak"),loss:fa.var("colors.money.negative"),expenses:fa.var("colors.money.negative.weak")},Fa=[0,100],Ba=["auto","auto"];function Ua({data:e}){const[t,n]=f(!0);if(void 0===e)return null;const r=e.hasAnyData?Ba:Fa;return E(F,{width:"100%",height:"100%",...Pa,children:S(B,{data:e.months,stackOffset:"sign",accessibilityLayer:!0,barSize:35,margin:Aa,children:[E(U,{verticalAlign:"top",itemSorter:Ia,wrapperStyle:Sa,content:({payload:e})=>E(wa,{payload:e})}),E(V,{strokeDasharray:"0",vertical:!1,stroke:Ra}),E(W,{dataKey:"month",interval:0,tickLine:!1,stroke:Ra,tick:Oa}),E(H,{type:"number",tickCount:7,domain:r,axisLine:!1,tickLine:!1,stroke:Ra,tick:Oa,tickFormatter:e=>la(e)}),E(q,{content:({active:e,payload:t})=>E(va,{active:e,payload:t}),isAnimationActive:!1,shared:!1}),E(j,{name:"Profit",dataKey:"profit",fill:La.profit,...Na}),E(j,{name:"Income",dataKey:"income",fill:La.income,...Na}),E(j,{name:"Loss",dataKey:"loss",fill:La.loss,...Na}),E(j,{name:"Expenses",dataKey:"expenses",fill:La.expenses,...Na}),E(j,{dataKey:Br,fill:Ra,legendType:"none",...Na}),E(z,{y:0,stroke:Ma}),E(K,{dataKey:"netIncome",fill:Da,stroke:Da,strokeWidth:1,legendType:"none",activeDot:!1,isAnimationActive:t,onAnimationStart:()=>n(!0),onAnimationEnd:()=>n(!1)})]})})}const Va=St({backgroundColor:"surface.elevated",borderRadius:"sm",backgroundImage:"linear-gradient(90deg, {colors.surface.elevated} 30%, {colors.surface.foreground} 50%, {colors.surface.elevated} 70%)",backgroundSize:"400%",backgroundPosition:"100% 0",animation:"shimmer"});function Wa({styles:e}){const t=Pt(Va,e);return E("div",{className:t,"data-testid":"shimmer-block"})}const Ha=St({width:"40%",minHeight:65});function qa({children:e}){return S(I,{children:[E(Wa,{styles:Ha}),E(na,{children:e})]})}const ja=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",gap:16})),za=St({width:"80px",height:"17px",marginBottom:"10px"}),Ka=St({width:"100%",height:"100%"});function Ya(){return S(I,{children:[S("div",{...ja,children:[E(Wa,{styles:za}),E(Wa,{styles:za}),E(Wa,{styles:za}),E(Wa,{styles:za})]}),E(Wa,{styles:Ka})]})}const _a=Rt({base:{color:"typography.base.weak",boxSizing:"border-box",position:"absolute",bottom:"0",left:"0",right:"0",top:"0",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",margin:"0 auto",transform:"rotate(-20deg)",opacity:"80%"},variants:{size:{sm:{fontSize:"4em"},lg:{fontSize:"7em"},xl:{fontSize:"10em"}}}});function Ga({size:e}){const t=_a({size:e});return E("div",{className:t,children:"Sample"})}const Qa=20200,Za=5043,Xa=Object.freeze({income:Qa,expenses:Za,netIncome:15157,absoluteSum:Math.abs(Qa)+Math.abs(Za)}),Ja=Object.freeze({total:Za,children:[{name:"Plane/Train/Bus",total:2500},{name:"Business Meals",total:1800},{name:"Employee Entertainment",total:743}]}),$a=Object.freeze({moneyIn:25300,moneyOut:8150,netMoneyIn:17150}),eo=[{income:1247,expenses:7434},{income:2103,expenses:8672},{income:1876,expenses:7656},{income:3291,expenses:6623},{income:5647,expenses:7034},{income:8923,expenses:6456},{income:11547,expenses:5892},{income:9834,expenses:6721},{income:15283,expenses:5347},{income:18467,expenses:4923},{income:17924,expenses:4534},{income:20200,expenses:5043}];function to({filter:e=Jt.PAST_YEAR,isSample:t=!1}){const{query:{data:n},isFilling:r}=function({filter:e,grouping:t}){return Fr({filter:e,grouping:t,select:Vr})}({filter:e,grouping:"MONTHLY"}),a=t?function(){const e=[],t=/* @__PURE__ */new Date;let n=0,r=0,a=0;for(let o=11;o>=0;o--){const i=new Date(t.getFullYear(),t.getMonth()-o,1),l=vn(i,{abbreviateMonth:!0,abbreviateYear:!0}),s=eo[11-o],c=s.income-s.expenses,d=c>0?c:0,u=c<0?c:0,h=s.income-d,p=s.expenses+u;e.push({month:l,income:h,expenses:-p,profit:d,loss:u,netIncome:c,hasNoData:!1}),n+=c,r=Math.max(r,s.income),a=Math.max(a,s.expenses)}return{total:n,domain:[-a,r],months:e,hasAnyData:!0}}():n;return S(Kr,{type:"chart",children:[E(Hr,{title:"Profit + Loss"}),E(jr,{children:r?E(qa,{children:E(Ya,{})}):S(I,{children:[E(ea,{title:la(a?.total??0),label:"Profit"}),E(na,{children:E(Ua,{data:a})})]})}),t&&E(Ga,{size:"xl"})]})}const no=Wt(null,St({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",alignSelf:"stretch"}));function ro({children:e}){return E("div",{...no,children:e})}const ao="conversations-section",oo="transactions-section",io={MESSAGE_REVIEW:ao,TRANSACTION_REVIEW:oo,RULE_REVIEW:"",CSV_IMPORT_REVIEW:""},lo={reviewStatus:{in:["USER_REVIEW_REQUIRED"]},status:{in:["ACTIVE"]},category:{expand:!0},glAccount:{expand:!0},bankAccount:{expand:!0}},so={resolutionStatus:{in:["OPEN"]}},co=[],uo=[];function ho(e){return Nr(`${t=e,Dr[t]}`,"v6");var t}const po={LINK_BANK:"LINK_BANK",RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT",MESSAGE_REVIEW:"MESSAGE_REVIEW",TRANSACTION_REVIEW:"TRANSACTION_REVIEW",BANK_ERROR:"BANK_ERROR",RULE_REVIEW:"RULE_REVIEW",CSV_IMPORT_REVIEW:"CSV_IMPORT_REVIEW",ONBOARDING_FORM:"ONBOARDING_FORM"},go=e=>["tasks",e??{}],mo={URGENT:0,HIGH:1,MEDIUM:2,LOW:3},vo=async e=>{const t=e.queryKey,n=t[1],r={path:"/v6/tasks/query",accessToken:t[2].accessToken,bodyParams:{...n},endpointManager:ho(t[2].environment)},a=await Ir(r);return"SUCCESS"===a.result&&void 0!==a.data?{data:a.data}:{data:void 0}},bo=Rt({base:{stroke:"currentColor"},variants:{primary:{DEFAULT:{stroke:"icon.intent.primary"},hover:{stroke:"icon.intent.primary.hover"},active:{stroke:"icon.intent.primary.active"}},secondary:{DEFAULT:{stroke:"icon.intent.secondary"},hover:{stroke:"icon.intent.secondary.hover"},active:{stroke:"icon.intent.secondary.active"}},success:{DEFAULT:{stroke:"icon.intent.success"},hover:{stroke:"icon.intent.success.hover"},active:{stroke:"icon.intent.success.active"}},warning:{DEFAULT:{stroke:"icon.intent.warning"},hover:{stroke:"icon.intent.warning.hover"},active:{stroke:"icon.intent.warning.active"}},danger:{DEFAULT:{stroke:"icon.intent.danger"},hover:{stroke:"icon.intent.danger.hover"},active:{stroke:"icon.intent.danger.active"}},action:{DEFAULT:{stroke:"icon.intent.action"},hover:{stroke:"icon.intent.action.hover"},active:{stroke:"icon.intent.action.active"}}}});function fo(e,t){const n=({size:t=24,fill:n="transparent",stylists:r})=>{const a=Kt([Wt(null,bo()),...r]);return E(e,{...a,style:{minHeight:t,minWidth:t},width:t,height:t,fill:n})};return n.displayName=t,n}const yo=fo(e=>h.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M8.31473 0.399963L2.71472 5.99997L8.31473 11.6",stroke:"#182428",strokeMiterlimit:10})),"ArrowLeft"),ko=fo(e=>h.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"currentColor",strokeMiterlimit:10})),"ArrowRight"),xo=St({transition:"background 300ms ease-out, background-color 300ms ease-out, border-color 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, background-color 100ms ease-out, border-color 100ms ease-out, box-shadow 0ms"}}),To=St({transition:"background 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, box-shadow 0ms"}}),Co=St({transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}});St({"& > .Tight-text":{transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}}});const wo=St({"& path":{transition:"stroke 300ms ease-out",_supportHover:{transition:"stroke 100ms ease-out"}}}),Ao=m({hasNextPage:!1,hasPreviousPage:!1,getFirstPage:()=>{},getLastPage:()=>{},pageBackwards:()=>{},pageForwards:()=>{}});function Eo({Component:e,stylists:t}){return E(e,{stylists:[Wt(Ot["small-icon"]),...t??[]],size:12})}const Io=Wt(null,St({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout",color:"typography.base",display:"inline-flex",alignItems:"center",justifyContent:"center",height:{sm:"35px",base:"50px"},gap:{sm:0,base:20}})),So=Wt(null,St({border:"none",borderRadius:"sm",backgroundColor:"surface.intent.action.discrete",padding:{sm:"4px",base:"12px"},margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none",boxShadow:"0 0 0 0 transparent","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:disabled":{opacity:.6,pointerEvents:"none"},_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}}),To),No=Wt(null,St({display:"flex",gap:"9px",padding:"10px",justifyContent:"center",alignItems:"center"})),Po=Wt(null,St({height:{sm:"12px",base:"20px"},width:{sm:"12px",base:"20px"}}));function Do(){const{hasNextPage:e,hasPreviousPage:t,pageForwards:n,pageBackwards:r}=function(){const e=v(Ao);if(void 0===e)throw new Error("usePaginationContext must be used within a PaginationProvider");return e}();return S("div",{...Io,children:[E("div",{...No,children:E("button",{...So,onClick:r,disabled:!t,children:E(Eo,{Component:yo,stylists:[Po]})})}),E("div",{...No,children:E("button",{...So,onClick:n,disabled:!e,children:E(Eo,{Component:ko,stylists:[Po]})})})]})}const Ro=St({width:"100%",height:"50px"});function Mo(){return E(Wa,{styles:Ro})}const Oo=Wt(Ot["dashboard-placeholder-table"],St({display:"flex",flexDirection:"column",gap:"4px"})),Lo=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"52px",paddingLeft:"64px",paddingRight:"64px"})),Fo=St({width:"100px",height:"20px"});function Bo({numColumns:e=6}){return S("div",{...Oo,children:[E("div",{...Lo,children:Array.from({length:e},(e,t)=>E(Wa,{styles:Fo},t))}),E(Mo,{}),E(Mo,{}),E(Mo,{}),E(Mo,{}),E(Mo,{}),E(Mo,{})]})}function Uo(e,t){const n=In(),r=Rn();return y(a=>{const o=An(n),i=o?{}:{retry:!1,staleTime:1/0};return Pn.prefetchQuery({queryKey:yn(e(a),n??"",r),queryFn:o?t:Sn,...i})},[e,t,n,r])}const Vo=Object.freeze({}),Wo=Object.freeze({cursor:"FINAL_PAGE"});function Ho({queryKey:e,queryFn:t,...n}){const[r,a]=f(Vo),o=p(e);i(o.current,e)||(o.current=e,a(Vo));const l=n.select,s=Tn(l)?e=>({...l(e),cursor:e.cursor}):void 0,c=kn(e,r),d=Mn({...n,queryKey:c,queryFn:t,keepPreviousDataPlaceholder:!0,select:s}),u=g(()=>{return e=d.query.data?.cursor,t=a,{getFirstPage:()=>t(Vo),getLastPage:()=>t(Wo),hasNextPage:Tn(e?.after),hasPreviousPage:Tn(e?.before),pageForwards:()=>{e?.after&&t({cursor:e.after})},pageBackwards:()=>{e?.before&&t({cursor:e.before})}};var e,t},[d.query.data?.cursor]),h=Uo(y(t=>kn(e,t),[e]),t),m=Uo(y(t=>kn(e,t),[e]),t);return k(()=>{const e=d.query.data?.cursor;!d.query.isFetching&&e&&(e.after&&h({cursor:e.after}).catch(e=>{br({error:e,severity:"error"})}),e.before&&m({cursor:e.before}).catch(e=>{br({error:e,severity:"error"})}))},[d.query.data?.cursor,d.query.isFetching,h,m]),{...d,paginationControls:u}}async function qo({authorization:e,extraHeaders:t,includeCredentials:n,params:r,url:a,cache:o}){const i=xr({extraHeaders:t,authorization:e}),l=(({url:e,params:t})=>{let n=e;const r=null==(a=t)?"":Object.entries(a).map(([e,t])=>{let n;return n=Array.isArray(t)?t.map(t=>kr(e,t)).join("&"):kr(e,t),n}).join("&");var a;return""!==r&&(n+=`?${r}`),n})({url:a,params:r});vr("HTTP GET Request",{url:a,accessToken:e});try{const e=await fetch(l,{method:"GET",headers:i,credentials:"include",cache:o});return vr("HTTP GET Response",{url:a,status:e.status,statusText:e.statusText}),Tr(e)}catch(s){return Promise.reject(s)}}async function jo(e){const{url:t,headers:n}=wr(e);return qo({url:t,params:e.params,includeCredentials:!0,extraHeaders:n})}async function zo(e){return jo({...e,endpointManager:ho(e.environment)})}async function Ko(e){return jo({...e,endpointManager:Mr(e.environment)})}function Yo({delay:e,callback:t}){const n=g(()=>function({delay:e,callback:t}){let n;const r=()=>{n&&(clearTimeout(n),n=void 0)};return{startCallback:a=>{r(),n=setTimeout(()=>{t(a)},e)},cancelCallback:()=>r()}}({delay:e,callback:t}),[e,t]);return k(()=>()=>{n.cancelCallback()},[n]),{startCallback:y(e=>{n.startCallback(e)},[n]),cancelCallback:y(()=>{n.cancelCallback()},[n])}}function _o({prefetchFn:e}){const{startCallback:t,cancelCallback:n}=Yo({delay:250,callback:e});return{startPrefetch:t,cancelPrefetch:n}}const Go={CREATED_DATE_TIME:"CREATED_DATE_TIME",SUBJECT:"SUBJECT",EMAIL:"EMAIL",LAST_MESSAGE_CREATED_DATE_TIME:"LAST_MESSAGE_CREATED_DATE_TIME",LAST_MESSAGE_TEXT:"LAST_MESSAGE_TEXT"},Qo={ASC:"ASC",DESC:"DESC"},Zo=e=>["conversations",e??{}],Xo=e=>["conversations","conversation",e],Jo=async e=>{const t=e.queryKey,n={path:"/v6/conversations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ho(t[3].environment)},r=await Ir(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function $o(e){return Ho({queryKey:e?Zo(e):["conversations",{}],queryFn:Jo})}const ei=async e=>{const t=e.queryKey,{id:n}=t[2],r={path:"/v6/conversations/{id}",pathParams:{id:n},accessToken:t[3].accessToken,environment:t[3].environment},a=await zo(r);return"SUCCESS"===a.result&&void 0!==a.data?a.data:null};function ti(e){const t=Tn(e);return Mn({queryKey:Xo({id:e??""}),queryFn:ei,enabled:t})}const ni=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/conversations",bodyParams:e,accessToken:t,endpointManager:ho(n)};return await Ir(r)};function ri(){return _o({prefetchFn:Uo(Xo,ei)})}function ai(e){const t=e.getSize(),n=e.columnDef.maxSize;return{flex:`${t} 0 auto`,width:t,maxWidth:void 0!==n?`${n}px`:"auto"}}function oi({header:e}){const t=ai(e.column);return E("div",{...Wt(Ot["dashboard-table-column-header"]),style:t,children:e.isPlaceholder?null:Y(e.column.columnDef.header,e.getContext())})}const ii=Wt(Ot["dashboard-table-header"],St({display:"flex",flexDirection:"row",alignItems:"center",paddingBlock:"10px"}));function li({headerGroups:e}){return E("div",{children:e.map(e=>x("div",{...ii,key:e.id},e.headers.map(e=>E(oi,{header:e},e.id))))})}const si=Wt(Ot["dashboard-table-body"],St({display:"flex",flexDirection:"column"}));function ci({children:e}){return E("div",{...si,children:e})}const di=Rt({base:{},variants:{alignment:{vertical:{width:"{borderWidths.md}",minWidth:"{borderWidths.md}",height:"100%"},horizontal:{width:"100%",height:"{borderWidths.md}",minHeight:"{borderWidths.md}"}},color:{normal:{backgroundColor:"border.layout"},strong:{backgroundColor:"border.layout.strong"}}}});function ui({alignment:e="vertical",color:t="normal",additionalClassName:n}){const r=Wt("vertical"===e?Ot["vertical-divider"]:Ot["horizontal-divider"],n,di({alignment:e,color:t}));return E("div",{...r})}function hi(){return E(ui,{additionalClassName:Ot["table-cell-divider"]})}function pi({cell:e,index:t,onCellClick:n,shouldDisplayDivider:r}){const a=ai(e.column),o=Wt(Ot["dashboard-table-cell"],St({height:"100%",display:"flex",justifyContent:"center",flexDirection:"column"})),i=Wt(null,St({display:"flex",flexDirection:"row",height:"100%"})),l=r(t);return S("div",{...i,style:a,onClick:()=>{n&&n(e)},children:[l&&E(hi,{}),E("div",{style:a,...o,children:Y(e.column.columnDef.cell,e.getContext())})]})}const gi=Wt(Ot["table-sub-row"],St({display:"flex",alignItems:"center",justifyContent:"flex-start",height:"60px",overflow:"hidden",minWidth:"fit-content",borderRadius:"zero"}));function mi({rowData:e,onCellClick:t,shouldDisplayDivider:n}){const r=e.getVisibleCells();return E("div",{...gi,children:r.map((e,r)=>E(pi,{cell:e,index:r,onCellClick:t,shouldDisplayDivider:n,isChild:!0},e.id))})}const vi=St({display:"flex",flexDirection:"column",borderRadius:"zero",cursor:"pointer",minWidth:"fit-content"}),bi=St({background:"surface.background"}),fi=Wt(Ot["table-row"],St({display:"flex",alignItems:"center",justifyContent:"flex-start",height:{sm:"60px",base:"85px"},minWidth:"fit-content"}));function yi({rowData:e,onMouseEnter:t,onMouseLeave:n,onCellClick:r,shouldDisplayDivider:a}){const o=e.getIsExpanded(),i=Wt(Ot["table-parent-row"],vi,e.index%2==0?bi:void 0),l=e.getVisibleCells();return S("div",{...i,onMouseEnter:t,onMouseLeave:n,children:[E("div",{...fi,children:l.map((e,t)=>E(pi,{cell:e,index:t,onCellClick:r,shouldDisplayDivider:a},e.id))}),o&&E("div",{children:e.subRows.map(e=>E(mi,{rowData:e,onCellClick:r,shouldDisplayDivider:a},e.id))})]})}const ki=(e,t={})=>{He.getState().openDrawer(e,t)},xi=()=>{He.getState().requestCloseDrawer()};function Ti({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const a=yn(e,n,r);return Pn.fetchQuery({queryKey:a,queryFn:t})}function Ci({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const a=yn(e,n,r);return Pn.prefetchQuery({queryKey:a,queryFn:t})}const wi=[{name:"One-Time Expense",value:"ONE_TIME"},{name:"Weekly Recurring Expense",value:"WEEKLY"},{name:"Monthly Recurring Expense",value:"MONTHLY"},{name:"Yearly Recurring Expense",value:"YEARLY"}],Ai={DATE:"DATE",DESCRIPTION:"DESCRIPTION",AMOUNT:"AMOUNT",STATUS:"STATUS",REVIEW_STATUS:"REVIEW_STATUS"},Ei={ASC:"ASC",DESC:"DESC"},Ii=e=>["banks/transactions",e??{}],Si=e=>["banks/transactions",e.id],Ni=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ho(t[3].environment)},r=await Ir(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Pi(e){return Ho({queryKey:Ii(e),queryFn:Ni})}const Di=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},r=await zo(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function Ri({id:e}){return Mn({queryKey:Si({id:e}),queryFn:Di})}function Mi(){return _o({prefetchFn:Uo(Si,Di)})}const Oi={COMPANY:"co",EMPLOYEE:"emp",CLASS_SEGMENT:"cls",CLASS_LABEL:"cll",CUSTOMER:"cus",BANK_ACCOUNT:"bka",GL_ACCOUNT:"gla",TRANSACTION_CATEGORY:"ctg",BANK_TRANSACTION:"btxn",PROCESSOR_TRANSACTION:"ptxn",TRANSACTION_LINE_ITEM:"tli",VENDOR:"vnd",TRANSACTION_RULE:"trl",INVOICE:"inv",INVOICE_LINE_ITEM:"ili",BILL:"bll",BILL_LINE_ITEM:"bli",PAYROLL:"prl",PAYROLL_LINE_ITEM:"pli",FINANCIAL_SUMMARY:"fsm",TASK:"tsk",CONVERSATION:"cnv",MESSAGE:"msg",REACTION:"rct",BUSINESS_TYPE:"bzt",TEMPLATE_CLASS_LABEL:"tcll",TEMPLATE_COA:"tcoa",TEMPLATE_GL_ACCOUNT:"tgla",TEMPLATE_TRANSACTION_RULES:"ttrl",MANUAL_JOURNAL_ENTRY:"mje",ASSET:"ast",ASSET_DEPRECIATION:"asd",EXPENSE_AMORTIZATION:"exa",REVENUE_RECOGNITION:"rvr",GL_TRANSACTION:"glt",ATTACHMENT:"att",CAR:"car",MILEAGE:"mlg",INTEGRATION:"int",TIME:"tme",TIME_TYPE:"tmt",TAX_RETURN:"txr"};function Li(e,t){return!wn(e)&&e.startsWith(t)}function Fi({id:e,prefix:t}){return void 0!==e?`${Oi[t]}_${e}`:""}function Bi(e){let t=e;return"string"==typeof e&&e.includes("_")&&(t=e.split("_")[1]),Number(t)}const Ui=e=>["conversations/messages",e];function Vi(e){if(xn(e)||0===e.length)return null;const t=[[e[0]]];for(let n=1;n<e.length;n++){const r=e[n],a=t[t.length-1],o=a[0].author.userId;r.author.userId===o?a.push(r):t.push([r])}return t}const Wi=async e=>{const t=e.queryKey,{id:n}=t[1],r={path:"/v6/conversations/{id}/messages",pathParams:{id:n},accessToken:t[2].accessToken,environment:t[2].environment},a=await zo(r);return"SUCCESS"===a.result&&void 0!==a.data?a.data:null},Hi=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/messages",bodyParams:{data:[e]},endpointManager:ho(n),accessToken:t};return await Ir(r)};function qi(){return _o({prefetchFn:Uo(Ui,Wi)})}const ji=e=>["summaries",e??{}],zi=e=>["summaries",e.id],Ki=async e=>{const t=e.queryKey,n={path:"/v6/summaries/query",bodyParams:{...t[1]},accessToken:t[2].accessToken,endpointManager:ho(t[2].environment)},r=await Ir(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data}:{data:void 0}};const Yi=async e=>{const t=e.queryKey,n={path:"/v6/summaries/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},r=await zo(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function _i({rowData:e,isMobile:t}){const{startPrefetch:n,cancelPrefetch:r}=ri(),{startPrefetch:a,cancelPrefetch:o}=qi(),{startPrefetch:i,cancelPrefetch:l}=Mi(),{startPrefetch:s,cancelPrefetch:c}=_o({prefetchFn:Uo(zi,Yi)}),d=y(()=>{Tn(e.original.attachedEntityId)&&Li(e.original.attachedEntityId,Oi.BANK_TRANSACTION)?i({id:e.original.attachedEntityId}):Tn(e.original.attachedEntityId)&&Li(e.original.attachedEntityId,Oi.FINANCIAL_SUMMARY)&&s({id:e.original.attachedEntityId}),a({id:e.original.id}),n({id:e.original.id})},[e.original.attachedEntityId,e.original.id,a,n,i,s]),u=y(()=>{Tn(e.original.attachedEntityId)&&Li(e.original.attachedEntityId,Oi.BANK_TRANSACTION)?l():Tn(e.original.attachedEntityId)&&Li(e.original.attachedEntityId,Oi.FINANCIAL_SUMMARY)&&c(),o(),r()},[l,c,r,o,e.original.attachedEntityId]);return E(yi,{rowData:e,onMouseEnter:d,onMouseLeave:u,shouldDisplayDivider:e=>0!==e,onCellClick:()=>((e,t,n)=>{n?ki("MobileConversation",{routeProps:{conversationId:e,transactionId:t}}):Tn(t)?Li(t,Oi.BANK_TRANSACTION)?ki("BankTransactionFormRouter",{routeProps:{transactionId:t,initialTab:"conversation"}}):Li(t,Oi.FINANCIAL_SUMMARY)&&(r=e,a=t,ki("FinancialSummary",{routeProps:{conversationId:r,summaryId:a}})):function(e){ki("Conversation",{routeProps:{conversationId:e}})}(e);var r,a})(e.original.id,e.original.attachedEntityId,t)})}const Gi=fo(e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},h.createElement("path",{d:"M0.328064 7.5H14.6719",strokeMiterlimit:10}),h.createElement("path",{d:"M7.5 0.328064V14.6719",strokeMiterlimit:10})),"Plus"),Qi=St({display:"flex",alignItems:"center",justifyContent:"center",outline:"none",cursor:"pointer",borderRadius:"md","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout",outlineOffset:"-1px"},"&:disabled":{cursor:"not-allowed",opacity:.6}}),Zi=St({color:"typography.intent.secondary",border:"{borderWidths.md} solid",borderColor:"border.layout",backgroundColor:"surface.intent.action.discrete",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.discrete.hover",borderColor:"border.layout","& .Tight-text":{color:"typography.intent.secondary.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discrete.active","& .Tight-text":{color:"typography.intent.secondary.active"}},"& .Tight-text":{color:"typography.intent.secondary"}}),Xi=St({padding:"10px",fontSize:"md",fontWeight:"md",gap:"9px"}),Ji=St({padding:"6px",fontSize:"sm",fontWeight:"sm",gap:"5px"}),$i=St.raw({display:"flex",alignItems:"center",gap:"5px",backgroundColor:"surface.intent.action.discrete",borderRadius:"md",border:"{borderWidths.md} solid transparent",outline:"none",boxShadow:"0 0 0 0 transparent",position:"relative",cursor:"pointer",color:"icon.base","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:disabled":{cursor:"default"},_supportHover:{_enabled:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discrete.hover",color:"icon.intent.action.hover",fill:"icon.intent.action.hover"}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discrete.active",borderColor:"transparent",color:"icon.intent.action.active",fill:"icon.intent.action.active"}}),el=Rt({variants:{width:{default:{width:"fit-content"},"fill-parent":{width:"100%"}}}}),tl={default:Xi,small:Ji},nl=e=>{const t=tl[e];return Wt(Ot["button-base"],t,Qi,xo)},rl=["default","small"],al={default:{className:""},small:{className:""}};for(const jE of rl)al[jE]=nl(jE);const ol=T(function({children:e,stylists:t=[],type:n="button",onClick:r,disabled:a,size:o="default",width:i="default",active:l=!1,onMouseEnter:s,onMouseLeave:c,popupTriggerProps:d},u){const h=Kt([al[o],Wt(null,el({width:i})),...t]);return E("button",{ref:u,...h,type:n,onClick:r,disabled:a,"data-active":l,onMouseEnter:s,onMouseLeave:c,...d,children:e})}),il=Wt(Ot["button-primary"],Zi),ll=T(function({children:e,active:t,stylists:n=[],width:r,...a},o){return E(ol,{ref:o,stylists:[il,...n],active:t,width:r,...a,children:e})}),sl=()=>{ki("Conversation",{routeProps:{conversationId:null}})};function cl(){return E(ll,{onClick:sl,children:E(Eo,{Component:Gi})})}const dl=Rt({base:{display:"flex",flexDirection:"column",flexGrow:1,animation:"appear.instant",overflow:"hidden"},variants:{dashboard:{transactionDashboard:{border:"none"},businessOwnerDashboard:{marginTop:"10px",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderRadius:"lg"}}}});function ul({children:e,dashboard:t}){const n=Wt(Ot["dashboard-table"],dl({dashboard:t}));return E("div",{...n,children:e})}const hl=m(null),pl="mobile",gl=Rt({base:{fontWeight:"label",fontSize:{sm:"label",base:"lg"},fontFamily:"label",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px",maxWidth:"100%"},variants:{intent:{default:{color:"typography.label"},primary:{color:"typography.intent.primary"},contrast:{color:"typography.contrast"}},wrap:{ellipsis:_r,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},alignment:{left:{textAlign:"left"},center:{textAlign:"center"}}}});function ml({children:e,intent:t="default",wrap:n="ellipsis",alignment:r="left"}){const a=Wt(Ot.label,gl({intent:t,wrap:n,alignment:r}));return wn(e)?null:E("div",{title:"ellipsis"===n?e:void 0,...a,children:e})}const vl=Wt(Ot["emphasis-label"],St({lineHeight:"16px"}));function bl({children:e}){return E(da,{size:"med",weight:"lg",stylists:[vl],children:e})}function fl({text:e,isRead:t}){return E(t?ml:bl,{children:e})}const yl=Rt({base:{padding:"0 25px",height:"100%",display:"flex",justifyContent:"center",flexDirection:"column",width:"100%"},variants:{alignVariant:{flexStart:{alignItems:"flex-start"},center:{alignItems:"center"}}},defaultVariants:{alignVariant:"flexStart"}});function kl({children:e,alignVariant:t="flexStart"}){const n=Wt(null,yl({alignVariant:t}));return E("div",{...n,children:e})}function xl({date:e,isRead:t=!1}){const n=bn(e);return E(fl,{text:n,isRead:t})}const Tl=Wt(Ot["strong-sub-label"],Yt({label:"strongSubLabel"}));function Cl({children:e,stylists:t=[]}){return wn(e)?null:E(da,{size:"sm",weight:"med",stylists:[Tl,...t],children:e})}const wl=m(null),Al=St({overflow:"auto",display:"flex",flexDirection:"column",width:"325px",maxHeight:"314px",minWidth:"325px","&:focus, &:focus-within":{outline:"none"},scrollbar:"hidden"}),El=St({display:"flex",alignItems:"center",gap:"9px",cursor:"pointer",borderRadius:"zero",width:"100%",padding:{sm:"10px",base:"16px"},border:{sm:"{borderWidths.md} solid {colors.border.layout}",base:"{borderWidths.sm} solid {colors.border.layout}"},backgroundColor:{sm:"surface.intent.action.discrete",base:"surface.foreground"},minWidth:{base:"100%"},boxShadow:{sm:"none"},minHeight:{sm:"35px"},height:{sm:"fit-content"},flexShrink:{sm:0},textAlign:{sm:"start"},"&[data-focused='true']":{boxShadow:"none",outline:"none",backgroundColor:"surface.intent.action.discrete.hover"}}),Il=Wt(Ot["selector-row"],El);function Sl(e,t,n){const[r,a]=f(e);return[t??r,n??a]}function Nl({children:e}){return null===se()?E(ce,{children:e}):e}function Pl({children:e,modal:t=!1,initialOpen:n,placement:r,offsetPx:a,open:o,onOpenChange:i,blockInteraction:l=!0,enableClickMiddleware:s=!0}){const c=function({initialOpen:e=!1,placement:t="bottom",offsetPx:n=0,modal:r,open:a,onOpenChange:o,enableClickMiddleware:i=!0}={}){const[l,s]=f(),[c,d]=f(),[u,h]=Sl(e,a,o),p=X(),m=J({placement:t,open:u,nodeId:p,onOpenChange:(e,t)=>{!e&&t instanceof MouseEvent&&(t.clientX<0||t.clientY<0||t.clientX>window.innerWidth||t.clientY>window.innerHeight)||h(e)},whileElementsMounted:re,middleware:[$(n),ee({crossAxis:t.includes("-"),fallbackStrategy:"bestFit",fallbackAxisSideDirection:"none",padding:8}),te({padding:8}),ne({apply({availableHeight:e,elements:t}){let n=e;if(e<314){const t=37*Math.floor(e/37)-18.5;n=Math.max(t,55.5)}Object.assign(t.floating.style,{maxHeight:`${n}px`,overflowY:"auto"})},padding:8})]}),v=m.context,b=ae(v,{enabled:i}),y=oe(v,{bubbles:{escapeKey:!0}}),k=ie(v),x=le([b,y,k]);return g(()=>({open:u,setOpen:h,...x,...m,modal:r,labelId:l,descriptionId:c,setLabelId:s,setDescriptionId:d,nodeId:p}),[u,h,x,m,r,l,c,p])}({modal:t,initialOpen:n,placement:r,offsetPx:a,open:o,onOpenChange:i,enableClickMiddleware:s}),d=se(),u=l&&null===d,h=c.nodeId;return E(Nl,{children:E(de,{id:h,children:E(wl.Provider,{value:{...c,popupParentNodeId:d,blockInteraction:u},children:e})})})}function Dl(){const e=v(wl);if(null==e)throw new Error("Popup components must be wrapped in <PopupManager />");return e}function Rl({children:e}){const t=Dl(),n=t.refs.setReference,r=t.open?"open":"closed",a={...t.getReferenceProps(),ref:n,"data-state":r};return E(I,{children:e(a)})}const Ml=fo(e=>h.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M1.23712 1.23718L8.76283 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10}),h.createElement("path",{d:"M8.76288 1.23718L1.23717 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10})),"Cross");function Ol({Component:e,stylists:t}){return E(e,{stylists:[Wt(Ot["tiny-icon"]),...t??[]],size:9})}const Ll=fo(e=>h.createElement("svg",{width:11,height:10,viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M1.03625 2.20312H9.96378",stroke:"#182428"}),h.createElement("path",{d:"M1.03625 5H9.96378",stroke:"#182428"}),h.createElement("path",{d:"M1.03625 7.79688H7.24223",stroke:"#182428"})),"Sort"),Fl=Wt(null,St({display:"flex",alignItems:"center",borderRadius:"md",border:"{borderWidths.lg} solid transparent",maxWidth:"fit-content",justifyContent:"center",_supportHover:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discrete.hover"},"&[data-active='true']":{backgroundColor:"surface.intent.action.discrete.active",borderColor:"border.intent.action.active"},"&:has(button:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),xo),Bl=Wt(null,St({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",backgroundColor:"transparent",padding:"6px 0 6px 6px",border:"none",outline:"none",cursor:"pointer"})),Ul=Wt(null,St({display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",padding:0,margin:"6px 6px 6px 5px",border:"none",outline:"none",position:"relative",cursor:"pointer","&::before":{content:"''",position:"absolute",top:"-9px",right:"-7px",bottom:"-9px",left:"-5px"},_focusVisible:{borderRadius:"sm",outline:"4px solid",outlineColor:"border.layout"}})),Vl=Wt(null,St({padding:"0 6px 0 0",display:"flex",alignItems:"center"}));function Wl({onClearClick:e,columnName:t,active:n,popupTriggerProps:r}){const a=n||"open"===r?.["data-state"];return S("div",{...Fl,"data-active":a,children:[S("button",{...Bl,...r,children:[E(Cl,{children:t}),!a&&E("div",{...Vl,children:E(Ol,{Component:Ll})})]}),a&&E("button",{...Ul,onClick:e,children:E(Ol,{Component:Ml})})]})}const Hl=Rt({base:{border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background",borderRadius:"zero",boxShadow:"box-shadow",animation:"appear.instant",display:"flex",flexShrink:1,width:"max-content",position:"absolute",top:0,left:0,"& *":{boxSizing:"border-box"}},variants:{type:{reaction:{borderRadius:"sm"}}}});function ql({initialFocus:e=!0,style:t,ref:n,type:r,...a}){const{context:o,blockInteraction:i,...l}=Dl(),s=ue([l.refs.setFloating,n]),c=Wt(Ot.popup,Hl({type:r}));return o.open?S(I,{children:[i&&E(he,{lockScroll:!0}),E(pe,{children:E(ge,{context:o,modal:l.modal,initialFocus:e?void 0:-1,children:E("div",{ref:s,...c,style:{...l.floatingStyles,...t},...l.getFloatingProps(a),"aria-labelledby":l.labelId,"aria-describedby":l.descriptionId,children:a.children})})})]}):null}const jl=Wt(Ot["popup-sort-row"],St({border:"none",background:"none",paddingLeft:"10px",paddingRight:"10px",paddingTop:"4px",paddingBottom:"4px",margin:0,cursor:"pointer",display:"flex",alignItems:"center",width:"100%",outline:"none",_focusVisible:{outline:"4px solid",outlineOffset:"-2px",outlineColor:"border.layout"}}));function zl({onClick:e,children:t,active:n}){return E("button",{onClick:e,...jl,children:E(ga,{accent:n?"active":"action",children:t})})}const Kl=Wt(null,St({display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"})),Yl=Wt(null,St({paddingTop:"10px",paddingLeft:"10px",paddingRight:"10px",paddingBottom:"8px",color:"typography.base.weak"}));function _l({sortDef:e,sortAscDisplay:t,sortDescDisplay:n,handleSortClick:r,sortInstance:a}){const o=Dl(),i=e=>{r(e),o?.setOpen(!1)},l=a?.orderBy===e&&"ASC"===a?.direction,s=a?.orderBy===e&&"DESC"===a?.direction;return S("div",{...Kl,children:[E(Cl,{stylists:[Yl],children:"Sort by:"}),E(zl,{onClick:()=>i({orderBy:e,direction:"ASC"}),active:l,children:t}),E(zl,{onClick:()=>i({orderBy:e,direction:"DESC"}),active:s,children:n})]})}const Gl=St($i,{width:"fit-content",padding:"6px","&::before":{content:"''",position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}}),Ql=Wt(Ot["button-discrete-small"],Gl,xo);function Zl({children:e,active:t,disabled:n,onClick:r,popupTriggerProps:a,ariaLabel:o,ariaExpanded:i}){const[l,s]=f(!1),c=t??function(e){switch(e){case"open":return!0;case"closed":return!1;case void 0:return}}(a?.["data-state"]);return E("button",{type:"button",...Ql,onClick:e=>{void 0===c&&s(!l),r&&r(e)},"data-active":c??l,disabled:n,...a,"aria-label":o,"aria-expanded":i,children:e})}const Xl={minWidth:"140px"};function Jl({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r}){const a=v(hl);if(!a)return null;const{sortInstance:o,setSortInstance:i}=a,l=o?.orderBy===t,s=()=>{i(void 0)};return t&&n&&r?S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>E(Wl,{active:l,onClearClick:s,columnName:e,popupTriggerProps:t})}),E(ql,{style:Xl,children:E(_l,{sortDef:t,sortAscDisplay:n,sortDescDisplay:r,handleSortClick:e=>{i(e)},sortInstance:o})})]}):E(Zl,{disabled:!0,children:E(Cl,{children:e})})}const $l=Wt(null,St({paddingLeft:"19px"}));function es({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r}){return E("div",{...$l,children:E(Jl,{columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r})})}const ts="Oldest to Newest",ns="Newest to Oldest";const rs=m({userId:void 0,userRole:void 0,userEmail:void 0,companyId:void 0,customerPartnerId:void 0,apiPartnerName:void 0,clientId:void 0,useStripeInvoicePaymentProcessing:void 0,hasPayroll:void 0,hasShopify:void 0,hasSquare:void 0,unitIntegrationBankName:null});function as({authorUserId:e,isRead:t}){const{userRole:n,userId:r}=v(rs);let a="";return e===r?a="Me":"OWNER"===n?a="Bookkeeper":"ACCOUNTANT"===n&&(a="User"),E(fl,{text:a,isRead:t})}const os=Wt(Ot.text,St({fontSize:"md",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",lineHeight:"16px",maxWidth:"100%",fontFamily:"label"}),Yr);function is({children:e,stylists:t=[]}){const n=Kt([os,...t]);return E("div",{...n,children:e})}const ls=Wt(Ot["emphasis-sub-label"],Yt({label:"emphasisSubLabel"}));function ss({children:e}){return wn(e)?null:E(da,{size:"sm",weight:"lg",stylists:[ls],children:e})}const cs=St({display:"grid",gridTemplateColumns:"3fr 1fr",border:"none",borderRadius:0,padding:"10px",width:"100%",cursor:"pointer",backgroundColor:"transparent",alignItems:"start"}),ds=Pt(St({display:"flex",flexDirection:"column",alignItems:"start",gap:"2px",maxWidth:"100%"}),Yr),us=St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"end",gap:"2px"});function hs({sender:e,subject:t,date:n,message:r,isRead:a,handleFormOpen:o}){return S("button",{className:cs,onTouchEnd:o,children:[S("div",{className:ds,children:[E(as,{authorUserId:e,isRead:a}),E(a?ga:ss,{children:t}),E(ga,{children:r})]}),S("div",{className:us,children:[E(xl,{date:n,isRead:a}),a?E(Eo,{Component:ko}):E(is,{children:E(Eo,{Component:ko})})]})]})}const ps=_(),gs=Wt(null,St({paddingLeft:"25px"})),ms=[ps.accessor("latestMessage.author.userId",{id:"from",cell:({row:e})=>E(kl,{children:E(as,{authorUserId:e.original.latestMessage.author.userId,isRead:"READ"===e.original.readStatus})}),header:()=>E(Cl,{stylists:[gs],children:"From"}),size:150,maxSize:150}),ps.accessor("subject",{id:"subject",cell:({row:e})=>E(kl,{children:E(fl,{text:e.original.subject,isRead:"READ"===e.original.readStatus})}),header:()=>E(Cl,{stylists:[gs],children:"Subject"}),size:150}),ps.accessor("latestMessage.text",{id:"message",cell:({row:e})=>E(kl,{children:E(fl,{text:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus})}),header:()=>E(Cl,{stylists:[gs],children:"Message"}),size:200}),ps.accessor("lastUpdatedDateTime",{id:"date",cell:({row:e})=>E(kl,{children:E(xl,{date:e.original.lastUpdatedDateTime,isRead:"READ"===e.original.readStatus})}),header:()=>E(es,{columnName:"Date",sortDef:"LAST_MESSAGE_CREATED_DATE_TIME",sortDescDisplay:ns,sortAscDisplay:ts}),size:130,maxSize:130}),ps.display({id:pl,cell:({row:e})=>E(hs,{sender:e.original.latestMessage.author.userId,subject:e.original.subject,date:e.original.lastUpdatedDateTime,message:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus,handleFormOpen:()=>{}})})];function vs(e){return e?ms.filter(e=>e.id===pl):ms.filter(e=>e.id!==pl)}const bs=[],fs=St({display:"flex",flexDirection:"column",height:"250px",width:"100%",paddingBottom:"20px",alignItems:"center",justifyContent:"center",boxSizing:"border-box",textAlign:"center",backgroundColor:"surface.background",gap:"10px"}),ys=Wt(Ot["empty-dashboard-layout"],fs);function ks({children:e}){return E("div",{...ys,"data-testid":"empty-dashboard-layout",children:e})}function xs({Component:e,stylists:t}){return E(e,{stylists:[Wt(Ot["large-icon"]),...t??[]],size:25})}const Ts=fo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M14.0625 2.14374L1.5625 6.90624L11.6813 12.8562L14.0625 2.14374Z",strokeWidth:.9375,strokeMiterlimit:10}),h.createElement("path",{d:"M8.25624 10.8375L5.73124 12.8562L5.33749 9.12499L13.4687 2.73749",strokeWidth:.9375,strokeMiterlimit:10})),"Paperplane"),Cs=()=>{ki("Conversation",{routeProps:{conversationId:null}})};function ws(){return S(I,{children:[E(xs,{Component:Ts}),E(ha,{wrap:"wrap",children:"Need help with your financials?"}),E(ll,{onClick:Cs,children:E(ha,{children:"Talk to a bookkeeper"})})]})}function As(){return S(I,{children:[E(xs,{Component:Ts}),E(ha,{wrap:"wrap",children:"All caught up"}),E(ga,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const Es=Wt(null,St({display:"flex",flexDirection:"row",gap:"5px"}));function Is({children:e}){return E("div",{...Es,children:e})}const Ss=Rt({variants:{isMobile:{true:{},false:{minWidth:"900px"}}}});function Ns(e){return E(e?As:ws,{})}function Ps({sortInstance:e,setSortInstance:t,conversations:n,paginationControls:r,isFilling:a,isMobile:o}){const i=function({conversations:e,isMobile:t}){return G({data:e??bs,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??bs.length,columns:vs(t),getCoreRowModel:Q(),getRowId:e=>e.id})}({conversations:n,isMobile:o}),{query:{data:l},isFilling:s}=$o({limit:1,filter:{resolutionStatus:{in:["OPEN","CLOSED"]}}}),c=!xn(l?.data?.[0])&&!s;return S("div",{className:Ss({isMobile:o}),children:[E("div",{id:ao}),S(Ao.Provider,{value:r,children:[S(qt,{children:[E(Gt,{children:"Conversations"}),S(Is,{children:[E(Do,{}),E(cl,{})]})]}),E(ul,{dashboard:"businessOwnerDashboard",children:a?E(Bo,{numColumns:4}):S(I,{children:[!o&&E(hl.Provider,{value:{sortInstance:e,setSortInstance:t},children:E(li,{headerGroups:i.getHeaderGroups()})}),n.length>0?E(ci,{children:i.getRowModel().rows.map(e=>E(_i,{rowData:e,isMobile:o},e.id))}):E(ks,{children:Ns(c)})]})})]})]})}const Ds=Wt(Ot.body,Yt({body:"default"}));function Rs({children:e,stylists:t=[]}){if(wn(e))return null;const n=Kt([Ds,...t]);return E("div",{...n,children:e})}const Ms=Wt(null,St({display:"flex",flexDirection:"column",gap:"6px",width:"100%",padding:"10px"})),Os=Rt({base:{height:16},variants:{width:{w92:{width:"92%"},w90:{width:"90%"},w88:{width:"88%"},w87:{width:"87%"},w85:{width:"85%"},w70:{width:"70%"}}}}),Ls=[{width:"w85"},{width:"w90"},{width:"w88"},{width:"w85"},{width:"w92"},{width:"w87"},{width:"w90"},{width:"w85"},{width:"w88"}];function Fs(){return E("div",{...Ms,children:Ls.map((e,t)=>E(Wa,{styles:Os({width:e?.width})},t))})}const Bs=fo(e=>h.createElement("svg",{width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M12 1.47998C6.2 1.47998 1.5 5.74998 1.5 11C1.52866 13.0153 2.23294 14.9626 3.5 16.53L2.5 21.53L9.16 20.2C10.1031 20.4499 11.0744 20.5776 12.05 20.58C17.85 20.58 22.55 16.3 22.55 11.03C22.55 5.75998 17.8 1.47998 12 1.47998Z",strokeWidth:1.5,strokeMiterlimit:10}),h.createElement("path",{d:"M11.05 11.02H12.95",strokeWidth:1.5,strokeMiterlimit:10}),h.createElement("path",{d:"M15.82 11.02H17.73",strokeWidth:1.5,strokeMiterlimit:10}),h.createElement("path",{d:"M6.27 11.02H8.18",strokeWidth:1.5,strokeMiterlimit:10})),"Comment"),Us=St({position:"absolute",top:"-1",right:"-1",width:"10",height:"10",borderRadius:"999px",backgroundColor:"surface.intent.warning",boxShadow:"0 0 0 1px {colors.border.intent.warning}"}),Vs=St({position:"relative",width:"25px",height:"25px"});function Ws({hasUnread:e}){return S("div",{className:Vs,children:[E(xs,{Component:Bs}),e&&E("div",{"data-testid":"unread-comment-badge",className:Us,"aria-hidden":"true"})]})}const Hs=St({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"5px",padding:"10px",width:"100%",borderBottom:"{borderWidths.lg} solid {colors.border.layout.strong}",boxSizing:"border-box"});function qs({hasUnreadMessages:e=!1,showMessageIndicator:t}){return S("div",{className:Hs,children:[E(ha,{children:"Message Bookkeeper"}),t&&E(Ws,{hasUnread:e})]})}const js=St({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",textAlign:"center"});function zs(){return S("div",{className:js,children:[E(xs,{Component:Ts}),E(ha,{wrap:"wrap",textAlign:"center",children:"Your financial summary will be ready soon"}),E(ga,{wrap:"wrap",children:"In the meantime, you can start a conversation with your bookkeeper."}),E(ll,{onClick:()=>ki("Conversation"),children:E(ha,{children:"Talk to a bookkeeper"})})]})}const Ks=St({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Ys({summaryId:e,conversationId:t}){const{startPrefetch:n,cancelPrefetch:r}=ri(),{startPrefetch:a,cancelPrefetch:o}=qi(),i=y(()=>{a({id:t}),n({id:t})},[t,a,n]),l=y(()=>{o(),r()},[o,r]);return S("div",{className:Ks,children:[E(xs,{Component:Ts}),E(ha,{wrap:"wrap",textAlign:"center",children:"Continue conversation with your bookkeeper"}),E(ga,{wrap:"wrap",children:"Pick up where you left off."}),E(ll,{onClick:()=>ki("FinancialSummary",{routeProps:{summaryId:e,conversationId:t}}),onMouseEnter:i,onMouseLeave:l,children:E(ha,{children:"Continue conversation"})})]})}const _s=St({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Gs({summaryId:e}){return S("div",{className:_s,children:[E(xs,{Component:Ts}),E(ha,{wrap:"wrap",textAlign:"center",children:"Ask questions about your financial summary"}),E(ga,{wrap:"wrap",children:"Your bookkeeper will respond here."}),E(ll,{onClick:()=>ki("FinancialSummary",{routeProps:{summaryId:e}}),children:E(ha,{children:"Talk to a bookkeeper"})})]})}function Qs({summaryId:e,conversationId:t}){const n=Tn(t);return xn(e)?E(zs,{}):n?E(Ys,{conversationId:t,summaryId:e}):E(Gs,{summaryId:e})}const Zs=St({display:"flex",flexDirection:"column",flex:{base:"1 1 100%",md:"0 0 342px"},maxHeight:"247px",minHeight:"247px",width:"342px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderRadius:"lg",alignItems:"center",overflow:"hidden",boxSizing:"border-box"}),Xs=St({display:"flex",flexDirection:"column",flex:"1 1 0",minHeight:0,width:"100%",backgroundColor:"surface.background",padding:"10px",gap:"10px",alignItems:"flex-start",boxSizing:"border-box"});function Js({summaryData:e}){const t=Tn(e?.summary),n=Tn(e?.conversation);return S("div",{className:Zs,children:[E(qs,{showMessageIndicator:t&&n,hasUnreadMessages:"UNREAD"===e?.conversation?.readStatus}),E("div",{className:Xs,children:E(Qs,{summaryId:e?.id,conversationId:e?.conversation?.id})})]})}const $s=St({borderRadius:"lg",overflow:"auto",height:"100%",width:"100%",padding:"10px"}),ec=Rt({base:{display:"flex",flex:{base:"1 1 100%",md:"1 1 0"},maxHeight:"247px",minHeight:"247px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderRadius:"lg",gap:"10px",alignItems:"flex-start",boxSizing:"border-box",position:"relative",marginBottom:10,overflow:"auto"},variants:{isSample:{true:{pointerEvents:"none",overflow:"hidden"},false:{}}}}),tc=Wt(null,St({whiteSpace:"pre-wrap",display:"flex",alignItems:"start",gap:"10px",height:"fit-content"})),nc=St({display:"flex",flexWrap:"wrap",gap:"10px",maxWidth:"1440px",alignItems:"flex-start"});function rc({isSample:e,period:t}){const{query:{data:n},isFilling:r}=function(e){return n={select:e=>e?.data?.[0]},Mn({queryKey:(t={limit:1,filter:{date:{equal:Xt(e.month,e.year)},status:{in:["ACTIVE"]}},sort:{direction:"DESC",orderBy:"DATE"}})?ji(t):["summaries",{}],queryFn:Ki,...n});var t,n}(t),a=e?function(){const e=/* @__PURE__ */new Date;return`In ${e.toLocaleString("en-US",{month:"long"})} ${e.getFullYear()}, your total income increased significantly to $${Qa.toLocaleString()}, up from $${17924..toLocaleString()} the previous month, reflecting strong revenue growth. However, expenses also rose slightly to $${Za.toLocaleString()}, compared to $${4534..toLocaleString()} last month, which slightly narrowed your net profit margin despite a healthy $${15157..toLocaleString()} net profit. \n\nA key area for improvement is transaction categorization; with one transaction remaining uncategorized and only two user-categorized, enhancing categorization accuracy will improve financial tracking and insights. To maintain positive momentum, consider reviewing variable expenses to identify any controllable cost increases.\n\nGoing forward, continue focusing on revenue growth while keeping a close eye on expense management, and aim to fully categorize all transactions to gain more precise financial visibility.`}():n?.summary??"A summary of this month's financials will appear here once more data is available.";return S("div",{className:nc,children:[E("div",{"data-testid":"financial-summary-layout",className:ec({isSample:e}),children:!e&&r?E(Fs,{}):S("div",{className:$s,children:[E(Rs,{stylists:[tc],children:a}),e&&E(Ga,{size:"lg"})]})}),E(Js,{summaryData:n})]})}const ac={RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT"},oc={short:{credentialsChanged:e=>`${e} Credentials Changed`,accountLocked:e=>`${e} Account Locked`,supportChanged:e=>`${e} Support Changed`,updateNeeded:e=>`${e} Update Needed`,noAccountsAvailable:e=>`No ${e} Accounts Available`,connectionError:e=>`${e} Connection Error`,serverError:e=>`${e} Server Error`,temporarilyDown:e=>`${e} Temporarily Down`,serverDown:e=>`${e} Server Down`,requestError:e=>`${e} Request Error`,inputError:e=>`${e} Input Error`,volumeDown:e=>`${e} Down Due to Volume`,credentialsExpiring:e=>`${e} Credentials Expiring`,relinkNeeded:e=>`${e} Relink Needed`,generic:()=>"Bank Connection Error"},long:{relinkCredentials:()=>"Please relink your account using your latest credentials.",invalidUpdatedUsername:({isMobile:e})=>`Your bank account has an updated username and needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,accountLocked:({isMobile:e})=>`Your bank account has been locked. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" and ask your financial institution to unlock your account. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,supportChanged:({apiPartnerName:e})=>`Unfortunately, your bank has added restrictions that block services like ${e||"ours"} from linking with it. Please chat with support to resolve this issue.`,updateNeeded:({isMobile:e})=>`Your bank requires you to take some action. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to log in and perform the requested action. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,mfaUpdateNeeded:({isMobile:e})=>`You have an unsupported "Multi-Factor Authentication" enabled. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to disable it on your banking site. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,noAccountsUnlink:()=>"It seems that you have no active accounts with this bank. Please unlink this bank.",connectionError:()=>"Your bank connection encountered an error. Please chat with support to resolve the issue.",productNotReady:()=>"Your institution was not ready for transactions to be pulled. Please chat with support to resolve the issue.",permissionRevoked:({apiInstitutionName:e})=>`Access to your accounts with ${e} has been revoked. Please unlink and relink your account using your latest credentials.`,bankMaintenance:()=>"Your bank's server is down for maintenance, so it may take a little longer than normal to receive new transactions.",serverDown:()=>"Your bank's server is unexpectedly down. Please chat with support to resolve the issue.",bankConnectionMaintenance:()=>"Your bank connection is down for maintenance, so it may take a little longer than normal to receive new transactions.",partnerCredsChange:({isMobile:e})=>`Your bank account needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,credentialsExpiring:({apiInstitutionName:e})=>`Your authorization for ${e} will expire soon. Please relink your bank with your latest credentials.`,relinkForStatements:()=>"Please relink your account using your latest credentials to enable automatic retrieval of bank statements.",generic:()=>"There was an error with your bank connection. Please chat with our team so they can resolve it."}},ic={ITEM_ERROR:{INVALID_CREDENTIALS:{shortMessage:oc.short.credentialsChanged,longMessage:oc.long.relinkCredentials,buttonType:ac.RELINK},INSUFFICIENT_CREDENTIALS:{shortMessage:oc.short.credentialsChanged,longMessage:oc.long.relinkCredentials,buttonType:ac.RELINK},INVALID_MFA:{shortMessage:oc.short.credentialsChanged,longMessage:oc.long.relinkCredentials,buttonType:ac.RELINK},INVALID_UPDATED_USERNAME:{shortMessage:oc.short.credentialsChanged,longMessage:oc.long.invalidUpdatedUsername,buttonType:ac.UNLINK_RELINK},ITEM_LOCKED:{shortMessage:oc.short.accountLocked,longMessage:oc.long.accountLocked,buttonType:ac.OPEN_BANK},ITEM_LOGIN_REQUIRED:{shortMessage:oc.short.credentialsChanged,longMessage:oc.long.relinkCredentials,buttonType:ac.DELETE_OR_RELINK},ITEM_NOT_SUPPORTED:{shortMessage:oc.short.supportChanged,longMessage:oc.long.supportChanged,buttonType:ac.CHAT},USER_SETUP_REQUIRED:{shortMessage:oc.short.updateNeeded,longMessage:oc.long.updateNeeded,buttonType:ac.OPEN_BANK},MFA_NOT_SUPPORTED:{shortMessage:oc.short.supportChanged,longMessage:oc.long.mfaUpdateNeeded,buttonType:ac.OPEN_BANK},NO_ACCOUNTS:{shortMessage:oc.short.noAccountsAvailable,longMessage:oc.long.noAccountsUnlink,buttonType:ac.UNLINK_ONLY},NO_AUTH_ACCOUNTS:{shortMessage:oc.short.noAccountsAvailable,longMessage:oc.long.noAccountsUnlink,buttonType:ac.UNLINK_ONLY},INVALID_SEND_METHOD:{shortMessage:oc.short.connectionError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},NO_INVESTMENT_ACCOUNTS:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},NO_INVESTMENT_AUTH_ACCOUNTS:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},NO_LIABILITY_ACCOUNTS:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},PRODUCTS_NOT_SUPPORTED:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},ITEM_NOT_FOUND:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},PRODUCT_NOT_READY:{shortMessage:oc.short.serverError,longMessage:oc.long.productNotReady,buttonType:ac.CHAT},USER_PERMISSION_REVOKED:{shortMessage:oc.short.connectionError,longMessage:oc.long.permissionRevoked,buttonType:ac.UNLINK_RELINK}},INSTITUTION_ERROR:{INSTITUTION_DOWN:{shortMessage:oc.short.temporarilyDown,longMessage:oc.long.bankMaintenance,buttonType:ac.CHAT},INSTITUTION_NOT_RESPONDING:{shortMessage:oc.short.serverDown,longMessage:oc.long.serverDown,buttonType:ac.CHAT},INSTITUTION_NOT_AVAILABLE:{shortMessage:oc.short.temporarilyDown,longMessage:oc.long.bankMaintenance,buttonType:ac.CHAT},INSTITUTION_NO_LONGER_SUPPORTED:{shortMessage:oc.short.supportChanged,longMessage:oc.long.supportChanged,buttonType:ac.CHAT}},API_ERROR:{INTERNAL_SERVER_ERROR:{shortMessage:oc.short.connectionError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},PLANNED_MAINTENANCE:{shortMessage:oc.short.temporarilyDown,longMessage:oc.long.bankConnectionMaintenance,buttonType:ac.CHAT}},INVALID_REQUEST:{DEFAULT:{shortMessage:oc.short.requestError,longMessage:oc.long.connectionError,buttonType:ac.CHAT}},INVALID_INPUT:{DEFAULT:{shortMessage:oc.short.inputError,longMessage:oc.long.connectionError,buttonType:ac.CHAT}},INVALID_RESULT:{DEFAULT:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.CHAT}},RATE_LIMIT_EXCEEDED:{DEFAULT:{shortMessage:oc.short.volumeDown,longMessage:oc.long.bankMaintenance,buttonType:ac.CHAT}},OAUTH_ERROR:{DEFAULT:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.RELINK}},CHANGE_TO_PARTNER_CREDS:{DEFAULT:{shortMessage:oc.short.updateNeeded,longMessage:oc.long.partnerCredsChange,buttonType:ac.UNLINK_RELINK}},PENDING_DISCONNECT:{DEFAULT:{shortMessage:oc.short.credentialsExpiring,longMessage:oc.long.credentialsExpiring,buttonType:ac.RELINK}},ADDITIONAL_CONSENT_REQUIRED:{DEFAULT:{shortMessage:oc.short.relinkNeeded,longMessage:oc.long.relinkForStatements,buttonType:ac.RELINK}},DEFAULT:{DEFAULT:{shortMessage:oc.short.connectionError,longMessage:oc.long.connectionError,buttonType:ac.CHAT}},UNKNOWN:{UNKNOWN:{shortMessage:oc.short.generic,longMessage:oc.long.generic,buttonType:ac.CHAT}}};function lc({apiErrorType:e,apiErrorCode:t}){if(!e||!t)return br({error:new Error("No bank error provided. Should not get here"),severity:"error"}),ic.DEFAULT.DEFAULT;const n=ic[e];if(!n)return br({error:new Error(`Unknown bank error type: ${e}`),severity:"error"}),ic.DEFAULT.DEFAULT;return(n[t]??n.DEFAULT)||(br({error:new Error(`Unknown bank error code: ${t} for type: ${e}`),severity:"error"}),ic.DEFAULT.DEFAULT)}const sc={id:"mock_task_link_bank",priority:"HIGH",name:"Link your bank account",description:"Effortlessly track every dollar by linking your bank account",shortDescription:"Link your bank to track every dollar",type:"LINK_BANK",dismissable:"DISMISSABLE",status:"ACTIVE"};function cc(e,t=!0){const n=lc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode});return{id:`${e.apiInstitutionName??"unknown"}_${e.id}_${e.apiErrorCode}_bank_error_task`,priority:"URGENT",name:n?.shortMessage(e.apiInstitutionName??"your bank")||"",description:t&&"RELINK"===n?.buttonType&&n?.longMessage({apiInstitutionName:e.apiInstitutionName??"your bank",isMobile:!1,apiPartnerName:""})||"",shortDescription:t&&"RELINK"===n?.buttonType&&n?.longMessage({apiInstitutionName:e.apiInstitutionName??"your bank",isMobile:!0,apiPartnerName:""})||"",type:n?.buttonType||"CHAT",dismissable:"DISMISSABLE",status:"ACTIVE",meta:{plaidItem:e}}}const dc=Wt(null,St({display:"flex",alignItems:"center",gap:"15px",borderRadius:"md",border:"1px solid {colors.border.layout}",background:"surface.foreground",width:"fit-content"})),uc=Wt(Ot["month-picker-left-button"],St({border:"none",borderRight:"1px solid {colors.border.layout}",borderRightRadius:0,_disabled:{cursor:"default"}})),hc=Wt(Ot["month-picker-right-button"],St({border:"none",borderLeft:"1px solid {colors.border.layout}",borderLeftRadius:0,_disabled:{cursor:"default"}})),pc=Wt(null,St({cursor:"default",display:"flex",justifyContent:"center",width:"75px"}));function gc({period:e,setPeriod:t,disableNext:n=!1,disablePrev:r=!1}){const a=Zt(e.year,e.month,1),o=vn(a,{abbreviateMonth:!0});return S("div",{...dc,children:[E(ll,{stylists:[uc],onClick:()=>{return t(0===(n=e).month?{month:11,year:n.year-1}:{month:n.month-1,year:n.year});var n},disabled:r,children:E(Eo,{Component:yo})}),E("div",{...pc,children:E(ha,{children:o})}),E(ll,{stylists:[hc],onClick:()=>{return t(11===(n=e).month?{month:0,year:n.year+1}:{month:n.month+1,year:n.year});var n},disabled:n,children:E(Eo,{Component:ko})})]})}const mc=St({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",gap:"10px",maxWidth:"1440px"});function vc({children:e}){return E("div",{className:mc,children:e})}const bc=Wt(Ot["progress-bar"],St({height:"32px",backgroundColor:"surface.intent.secondary",display:"flex",flexDirection:"row",alignItems:"center",border:"{borderWidths.lg} solid {colors.border.layout.weak}",borderRadius:"sm"})),fc=Wt(Ot["progress-bar-fill"],St({borderRadius:"sm",height:"100%",display:"flex",alignItems:"center"})),yc=Wt(Ot["tile-bar-label"],St({paddingLeft:"10px"}));function kc({label:e="",percentage:t,color:n,width:r}){const a=void 0===r?"100%":`${r}px`,o=t>=50,i=Kt([fc,Wt(null,n)]);return S("div",{...bc,style:{width:a},children:[E("div",{...i,style:{width:`${t}%`},children:o&&E("div",{...yc,children:E(ml,{children:e})})}),!o&&E("div",{...yc,children:E(ml,{children:e})})]})}const xc=Wt(Ot["metric-md"],Yt({metric:"md"}));function Tc(e){return E("div",{...xc,children:e.children})}const Cc=Wt(null,St({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"45px",width:"100%"})),wc=Wt(null,St({overflow:"visible",width:"80px",display:"flex",justifyContent:"end"})),Ac=({label:e,amount:t,total:n,colorCss:r})=>{const a=n>0?function(e,t,n,r=0,a=100){return r+(e-t)*(a-r)/(n-t)}(t,0,n):0;return S("div",{...Cc,children:[E(kc,{label:e,percentage:a,color:r}),E("div",{...wc,children:E(Tc,{children:la(t)})})]})},Ec={netIncome:0,income:0,expenses:0,absoluteSum:0},Ic=e=>{if(void 0===e.result||"FAILURE_NO_DATA"===e.result)return Ec;const t=e.json?.data?.[0];if(xn(t))return Ec;const n=t.income?.total??0,r=t.expenses?.total??0,a=L(n).plus(r).toNumber();return{netIncome:t.netIncome??0,income:n,expenses:r,absoluteSum:a}},Sc=fo(e=>h.createElement("svg",{stroke:"#000000",width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M13.3131 0.489685V4.15097H9.65182",strokeMiterlimit:10}),h.createElement("path",{d:"M2.32925 15.1348V11.4735H5.99054",strokeMiterlimit:10}),h.createElement("path",{d:"M1.34228 9.57602C1.18256 9.00181 1.10327 8.40823 1.10669 7.81223C1.1074 6.38654 1.56211 4.99811 2.4049 3.8482C3.2477 2.69828 4.4348 1.84664 5.79412 1.41671C7.15345 0.986775 8.61437 1.00089 9.96513 1.45702C11.3159 1.91314 12.4863 2.78757 13.3067 3.95356",strokeMiterlimit:10}),h.createElement("path",{d:"M14.2937 6.04849C14.4534 6.6227 14.5327 7.21628 14.5293 7.81228C14.5286 9.23797 14.0739 10.6264 13.2311 11.7763C12.3883 12.9262 11.2012 13.7779 9.84185 14.2078C8.48253 14.6377 7.02161 14.6236 5.67085 14.1675C4.32008 13.7114 3.14967 12.8369 2.32925 11.671",strokeMiterlimit:10})),"Sync");function Nc({Component:e,stylists:t}){return E(e,{stylists:[Wt(Ot["medium-icon"]),...t??[]],size:15})}const Pc={},Dc=e=>{const t=document.querySelector(`script[src="${e}"]`);if(t)return Pc[e]={loading:!1,error:null,scriptEl:t}},Rc="undefined"!=typeof window&&void 0!==window.document;function Mc({src:e,checkForExisting:t=!1,...n}){let r=Pc[e];!r&&t&&e&&Rc&&(r=Dc(e));const[a,o]=f(r?r.loading:Boolean(e)),[i,l]=f(r?r.error:null),[s,c]=f(!1);return k(()=>{if(!Rc||!e||s||i)return;let a;r=Pc[e],!r&&t&&(r=Dc(e)),r?a=r.scriptEl:(a=document.createElement("script"),a.src=e,Object.keys(n).forEach(e=>{void 0===a[e]?a.setAttribute(e,n[e]):a[e]=n[e]}),r=Pc[e]={loading:!0,error:null,scriptEl:a});const d=()=>{r&&(r.loading=!1),o(!1),c(!0)},u=e=>{r&&(r.error=e),l(e)};return a.addEventListener("load",d),a.addEventListener("error",u),document.body.appendChild(a),()=>{a.removeEventListener("load",d),a.removeEventListener("error",u),r&&r.loading&&(a.remove(),delete Pc[e])}},[e]),[a,i]}const Oc=e=>["integrations",e??{}],Lc=async e=>{const t=e.queryKey,n={path:"/v6/integrations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ho(t[3].environment)},r=await Ir(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Fc(e,t){return Ho({...t,queryKey:Oc(e),queryFn:Lc})}function Bc(e){return Fc({filter:{apiName:{equal:"PLAID"}}},e)}function Uc(e){return Nr(`${t=e,Pr[t]}/v1`,"v1");var t}const Vc=[{displayName:"Chase",institutionName:"ins_56"},{displayName:"Bank of America",institutionName:"ins_127989"},{displayName:"Capital One",institutionName:"ins_128026"},{displayName:"Wells Fargo",institutionName:"ins_127991"}];async function Wc({institutionId:e,accessToken:t,environment:n}){if(!t)throw new Error("Access token is required to get Plaid item institution");const r={path:"/banks2/bankUrl",accessToken:t,endpointManager:Uc(n)},{url:a,headers:o}=wr(r);return await qo({url:a,includeCredentials:!0,extraHeaders:o,params:e?{institutionId:e}:void 0})}const Hc=Wt(Ot["button-danger"],St({color:"typography.intent.danger",border:"{borderWidths.md} solid",borderColor:"border.intent.danger",backgroundColor:"surface.intent.danger",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-text":{color:"typography.intent.danger.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.danger.active",borderColor:"border.intent.danger.active","& .Tight-text":{color:"typography.intent.danger.active"}},"& .Tight-text":{color:"typography.intent.danger"}}));function qc({children:e,stylists:t=[],...n}){return E(ol,{stylists:[Hc,...t],...n,children:e})}const jc=Wt(Ot["button-tertiary"],St({color:"typography.intent.success",border:"{borderWidths.md} solid",borderColor:"border.intent.success",backgroundColor:"surface.intent.success","& .Tight-text":{color:"typography.intent.success"},"& path":{stroke:"icon.intent.success"},_supportHover:{_notDisabled:{backgroundColor:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-text":{color:"typography.intent.success.hover"},"& path":{stroke:"icon.intent.success.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.success.active",borderColor:"border.intent.success.active","& .Tight-text":{color:"typography.intent.success.active"},"& path":{stroke:"icon.intent.success.active"}}}));function zc({children:e,stylists:t=[],...n}){return E(ol,{stylists:[jc,...t],...n,children:e})}const Kc="cancel",Yc="danger",_c="success",Gc=Rt({base:{position:"fixed",inset:0,minHeight:"100dvh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"overlay"}}),Qc=Rt({base:{background:"surface.background",borderRadius:"md",display:"flex",flexDirection:"column",gap:"16px"},variants:{size:{sm:{maxWidth:"360px",minWidth:"0",margin:"32px"},md:{maxWidth:"600px",minWidth:"400px",margin:"32px"},lg:{minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"},margin:{sm:"32px",base:"0"},height:{sm:"auto",base:"100dvh"}}},padding:{none:{padding:"0"},sm:{padding:"8px"},md:{padding:"16px"},lg:{padding:"24px"}}},defaultVariants:{size:"sm",padding:"md"}}),Zc={transform:"none",willChange:"auto"};function Xc({show:e,role:t="dialog",children:n,size:r="sm",padding:a="md",outsidePress:o=!1,escapeKey:i=!0,className:l}){const{context:s}=J({open:e,strategy:"fixed"}),c=oe(s,{outsidePress:o,escapeKey:i}),d=ie(s,{role:t}),{getFloatingProps:u}=le([c,d]),h=[Qc({size:r,padding:a}),l].filter(Boolean).join(" ");return e?E(pe,{children:E(he,{lockScroll:!0,className:Gc(),children:E(ge,{context:s,modal:!0,returnFocus:!0,children:E("div",{...u(),className:h,style:Zc,children:n})})})}):null}const Jc=St({display:"flex",justifyContent:"flex-end",gap:"8px"}),$c="success",ed="danger",td=me.createConfirmation(ve(function({show:e,proceed:t,title:n,body:r,buttons:a=[{key:"ok",type:"default",label:"OK"}]}){return S(Xc,{show:e,role:"alertdialog",size:"sm",padding:"md",outsidePress:!1,escapeKey:!0,className:Ot["alert-dialog"],children:[E(ha,{wrap:"wrap",stylists:[Wt(Ot["alert-header"])],children:n}),r&&"string"==typeof r?E(ml,{wrap:"wrap",children:r}):E(I,{children:r}),E("div",{className:Jc,children:a.map(e=>{const n=(e=>{switch(e){case ed:return qc;case $c:return zc;default:return ll}})(e.type);return E(n,{onClick:()=>e.onClick?t(e.onClick()):t(e.key),children:E(ha,{children:e.label})},e.key)})})]})}));function nd(e,t,n,r){const a=1===n?e:t;return r?`${n} ${a}`:a}function rd(e){const t=Math.max(4-e.length,0);return`*${e+"*".repeat(t)}`}function ad(e,t){return t?e?`${e} ${rd(t)}`:rd(t):e??""}const od=e=>ki("Conversation",{routeProps:{conversationId:null,defaultValues:e}}),id=St({display:"flex",flexDirection:"column",gap:"12px"});async function ld(e){await td({title:"Uh Oh!",body:"Something went wrong trying to link your bank, please try again.",buttons:[{key:Kc,label:"Cancel"},{key:_c,label:"Chat",type:$c}]})===_c&&od({message:{text:`Please help me with my bank issue (code: ${e}). Thanks!`,attachments:[]}})}const sd=e=>["banks/accounts",e??{}],cd=async e=>{const t=e.queryKey,n={path:"/v6/banks/accounts/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ho(t[3].environment)},r=await Ir(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function dd(e){const t=e?.params;return Ho({queryKey:t?sd(t):["banks/accounts",{}],queryFn:cd,enabled:e?.enabled,select:e?.select})}function ud(e,t){return Ti({queryKey:kn(["banks/accounts",{}],{}),queryFn:cd,accessToken:e,environment:t})}const hd=e=>{const t=e?.status?"DELETED"===e.status?"REMOVED":e.status:"ACTIVE",n="MORTGAGE"!==e?.apiType&&"BROKERAGE"!==e?.apiType&&e?.apiType?e.apiType:"OTHER";return{...e,id:e.id??"",status:"DELETED"===e.status?"REMOVED":t,name:e.apiName??"",apiName:"PLAID",glAccountId:Fi({id:e.glAccountId,prefix:"GL_ACCOUNT"}),type:n,lastSyncedDate:e.lastApiSyncedDate??null,syncTransactions:e.syncRevenueBoolean||e.syncExpenseBoolean||!1,integration:{id:Fi({id:e.plaidItemId||e.oauthAccountId,prefix:"INTEGRATION"}),apiInstitutionId:e.apiInstitutionId??null},mask:e.apiMask??"",beginningBalanceData:{},isSupported:e.isSupported||!1,tranStartDate:e.tranStartDate||null,tranMinStartDate:e.tranMinStartDate||null,latestTransactionDate:e.latestTransactionDate||null}},pd=Wt(Ot["button-secondary"],St({color:"typography.intent.primary",border:"{borderWidths.md} solid",borderColor:"border.intent.primary",backgroundColor:"surface.intent.primary","& .Tight-text":{color:"typography.intent.primary"},"& path":{stroke:"icon.intent.primary"},_supportHover:{_notDisabled:{backgroundColor:"surface.intent.primary.hover",borderColor:"border.intent.primary.hover","& .Tight-text":{color:"typography.intent.primary.hover"},"& path":{stroke:"icon.intent.primary.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.primary.active",borderColor:"border.intent.primary.active","& .Tight-text":{color:"typography.intent.primary.active"},"& path":{stroke:"icon.intent.primary.active"}}}));function gd({children:e,stylists:t=[],...n}){return E(ol,{stylists:[pd,...t],...n,children:e})}function md({mutationFn:e,onMutateFn:t,...n}){const r=In(),a=Rn(),o=!wn(r);return M({...n,mutationFn:o?t=>e({data:t,accessToken:r,environment:a}):Sn,onMutate:o&&Tn(t)?e=>t({data:e,accessToken:r,environment:a}):void 0},Pn)}const vd=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/account",bodyParams:{account:e},accessToken:t,endpointManager:Mr(n)};return await Sr(r)},bd=async({data:e,accessToken:t,environment:n})=>vd({data:e,accessToken:t,environment:n}),fd=async({data:e,accessToken:t,environment:n})=>vd({data:e,accessToken:t,environment:n}),yd=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/accounts",bodyParams:{accounts:e.accounts},accessToken:t,endpointManager:Mr(n)};return await Sr(r)})({data:{accounts:e},accessToken:t,environment:n});function kd(e){return md({onSuccess:async()=>{vr("mutation successful, invalidating bank account queries");try{return Pn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&br({error:e,severity:"error"})}},...e})}function xd(){return kd({mutationFn:fd})}function Td(){return md({onSuccess:async()=>{vr("mutation successful, invalidating bank account queries");try{return Pn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&br({error:e,severity:"error"})}},mutationFn:yd})}const Cd=e=>"CSV_IMPORT"===e||"MANUAL_ENTRY"===e,wd=e=>"PLAID"===e,Ad=e=>e>0?"Deposited to":"Withdrawn from",Ed=e=>({id:Bi(e.id),apiAccountName:e.name,apiAccountNo:e.mask,apiAccountType:["DEPOSITORY","CREDIT"].includes(e.type??"")?e.type:void 0,tranStartDate:void 0,duplicateBankAccountIds:[]}),Id=St({display:"flex",flexDirection:"column",gap:"16px"}),Sd=async()=>td({title:"Merge Accounts",body:S("div",{className:Id,children:[E(ml,{wrap:"wrap",children:"The selected accounts and their transactions will be merged into your linked accounts."}),E(ml,{wrap:"wrap",children:"This action can't be undone."}),E(ml,{wrap:"wrap",children:"It may take a few minutes for this process to complete."})]}),buttons:[{key:Kc,label:"Cancel"},{key:Yc,label:"Continue",type:ed}]}),Nd=()=>td({title:"Merge Failed",body:E(ml,{wrap:"wrap",children:"There was an error merging your bank accounts. Please try again later."}),buttons:[{key:Kc,label:"OK"}]}),{formContext:Pd,fieldContext:Dd,useFieldContext:Rd,useFormContext:Md}=be(),Od=fo(e=>h.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{id:"icon/check"},h.createElement("path",{id:"Vector",d:"M0.986511 5L3.66217 7.67566L9.01349 2.32434",stroke:"white",strokeWidth:1.25,strokeMiterlimit:10}))),"Check");function Ld({showIcon:e=!0,textContent:t="Save",disabled:n=!1}){return S(zc,{type:"submit",disabled:n,children:[e&&E(Eo,{Component:Od}),E(ha,{children:t})]})}const Fd=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M8.54708 2.09833H8.37602C8.21004 2.09808 8.04676 2.14026 7.90167 2.22087C7.75657 2.30147 7.6345 2.41783 7.54702 2.55888L1.70458 11.9081C1.60602 12.0636 1.55355 12.2438 1.55325 12.4279C1.55324 12.5569 1.57886 12.6846 1.62861 12.8036C1.67837 12.9226 1.75127 13.0305 1.84309 13.1211C1.93491 13.2117 2.04381 13.2832 2.16348 13.3313C2.28314 13.3795 2.41118 13.4034 2.54015 13.4016H14.3829C14.6412 13.4016 14.8889 13.299 15.0715 13.1164C15.2541 12.9338 15.3567 12.6861 15.3567 12.4279C15.3564 12.2438 15.3039 12.0636 15.2054 11.9081L9.37608 2.55888C9.2886 2.41783 9.16652 2.30147 9.02143 2.22087C8.87634 2.14026 8.71306 2.09808 8.54708 2.09833Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M8.46158 5.23663V9.00659",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M8.46158 10.2632V11.5199",stroke:"#182428",strokeMiterlimit:10})),"Attention"),Bd=[Wt(null,St({color:"icon.accent.danger","& path":{stroke:"icon.accent.danger"}}))],Ud=Wt(null,St({display:"flex",alignItems:"center",gap:"4px"}));function Vd({errorMessage:e}){return S("div",{...Ud,children:[E(Nc,{Component:Fd,stylists:Bd}),E(ga,{intent:"danger",wrap:"wrap",children:e})]})}const Wd=St({display:"flex",flexDirection:"column",padding:"12px 16px",cursor:"pointer",outline:"none",gap:"8px",borderRadius:"md",backgroundColor:"surface.intent.action.discrete","&[data-state='closed'][data-disablehover='false']":{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}},"&:not([data-state])[data-disablehover='false']:not(:focus-within)":{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}},"&[data-state='open']":{backgroundColor:"surface.intent.action.discrete.active"},"&[data-clicked='false']:has(:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),Hd=St({"&[data-haserror='true']":{border:"{borderWidths.lg} solid",borderColor:"border.intent.danger"}}),qd=St({display:"flex",justifyContent:"space-between",alignItems:"center"});function jd({children:e,inputRef:t,popupTriggerProps:n,label:r,isDefaultValue:a,isTouched:o,className:i,additionalStyles:l,onClick:s,onBlur:c,errorMessage:d,disableHover:u=!1,type:h,remainingChars:p}){const g=Wt(i||null,Wd,l,Hd,To),[m,v]=f(!0);return S(I,{children:[S("div",{...g,onClick:s,...n,onMouseDown:e=>{v(!0),t&&t.current&&e.target!==t.current&&(e.preventDefault(),t.current.focus())},onFocus:()=>{t&&t.current&&function(e,t){if("setSelectionRange"in e&&"number"!==t){const t=e.value.length;e.setSelectionRange(t,t)}}(t.current,h)},onBlur:()=>{v(!1),c?.()},"data-clicked":m,"data-isdefaultvalue":a,"data-haserror":o&&void 0!==d,"data-disablehover":u,children:[S("div",{className:qd,children:[void 0!==r&&E(ga,{children:r}),Tn(p)&&E(ga,{intent:p&&p<0?"danger":"normal",children:`${p}`})]}),e]}),o&&d&&E(Vd,{errorMessage:d})]})}const zd=St({border:"{borderWidths.lg} solid transparent","&:focus-within, &[data-isdefaultvalue='false']":{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},"&:focus-within":{cursor:"text"}});function Kd({children:e,inputRef:t,popupTriggerProps:n,label:r,onClick:a}){const o=Rd(),i=fe(o.store,e=>e.meta.errors[0]?.message),l=fe(o.store,e=>e.meta.isDefaultValue),s=fe(o.store,e=>e.meta.isTouched);return E(jd,{label:r,inputRef:t,popupTriggerProps:n,isDefaultValue:l,isTouched:s,className:Ot["discrete-form-input"],additionalStyles:zd,errorMessage:i,onClick:a,onBlur:o.handleBlur,children:e})}function Yd(e){((navigator.userAgent?navigator.userAgent.toLowerCase().includes("mac"):navigator.platform.toLowerCase().includes("mac"))?e.metaKey:e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),e.currentTarget.requestSubmit())}function _d(e){"Escape"===e.key&&e.target instanceof HTMLElement&&e.target.blur()}function Gd(e){"Enter"===e.key&&e.currentTarget.blur()}const Qd=Wt(Ot["amount-input"],Yt({body:"default"}),St({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer",width:"100%",_focus:{cursor:"text"}})),Zd=Wt(null,St({display:"flex",alignItems:"center",gap:"2px"}));function Xd({value:e,onChange:t,inputRef:n,onClick:r,onBlur:a,autofocus:o=!1}){return S("div",{...Zd,children:[E(Rs,{children:"$"}),E(ke,{...Qd,getInputRef:n,thousandSeparator:!0,decimalScale:2,value:e,onValueChange:e=>{t(void 0===e.floatValue?null:e.floatValue)},fixedDecimalScale:!0,onClick:r,onBlur:a,onKeyDown:Gd,autoFocus:o})]})}const Jd=St({backgroundColor:"surface.foreground.disabled",pointerEvents:"none",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"}),$d=Rt({base:{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},variants:{kind:{text:{cursor:"text"},button:{cursor:"pointer"},container:{cursor:"default"}}}});function eu({kind:e,label:t,children:n,inputRef:r,disabled:a,popupTriggerProps:o,onClick:i,disableHover:l=!1,type:s,maxLength:c}){const d=Rd(),u=fe(d.store,e=>e.meta.errors[0]?.message),h=fe(d.store,e=>e.meta.isTouched),p="string"==typeof d.state.value?d.state.value.length:0,g=Tn(c)?c-p:void 0,m=a?Jd:$d({kind:e});return E(jd,{label:t,inputRef:r,popupTriggerProps:o,className:Ot["editable-form-input"],additionalStyles:m,errorMessage:u,onBlur:d.handleBlur,disableHover:l,onClick:i,type:s,isTouched:h,remainingChars:g,children:n})}const tu=m(Object.freeze({map:/* @__PURE__ */new Map,register:()=>{},unregister:()=>{},focusedIndex:null,isMousing:!0,isScrolling:!1,listRef:void 0,popupNodeId:void 0}));function nu(e,t){switch(t.type){case"increment":return((e,t)=>{let n;if(null===e.focusedIndex)n=0;else{const r=e.focusedIndex+1;n=!t.repeat&&r>e.maxIndex?0:Math.min(r,e.maxIndex)}return{...e,focusedIndex:n}})(e,t);case"decrement":return((e,t)=>{let n;if(null===e.focusedIndex)n=e.maxIndex;else{const r=e.focusedIndex-1;n=!t.repeat&&r<0?e.maxIndex:Math.max(r,0)}return{...e,focusedIndex:n}})(e,t);case"set":return{...e,focusedIndex:Math.min(t.focusedIndex,e.maxIndex)};case"max":return{...e,maxIndex:t.max}}}function ru(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function au(e,t){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return r.top>=n.top&&r.bottom<=n.bottom&&r.left>=n.left&&r.right<=n.right}function ou(e,t,n){if(null===e)return{node:void 0,metadata:void 0};const r=t[e];return{node:r,metadata:n.get(r)}}function iu(e){const[t,n]=f(()=>/* @__PURE__ */new Map),{listRef:r,focusedState:a,isMousing:o,isScrolling:i}=function(e,t){const n=p(null),[r,a]=f(!0),[o,i]=f(!1),l=v(tu),[s,c]=C(nu,{focusedIndex:null,maxIndex:e});k(()=>{const e=n.current,t=()=>{null==s.focusedIndex&&void 0!==l?.popupNodeId&&c({type:"set",focusedIndex:0})};return e?.addEventListener("focus",t),()=>{e?.removeEventListener("focus",t)}},[n,s.focusedIndex,c,l?.popupNodeId]);const d=p(null);return k(()=>{c({type:"max",max:e})},[e]),k(()=>{const e=n.current;if(null!==e){const n=e=>{i(!1);const n=e.target instanceof HTMLElement&&e.target.getAttribute("data-listitem");if(!n)return;const r=Number(e.target.getAttribute("data-index"));s.focusedIndex===r&&d.current===e.target||(0!==e.movementX||0!==e.movementY)&&n&&(a(!0),d.current=e.target,c({type:"set",focusedIndex:r}),t.setCascadeState(!0,r))},r=e=>{const t="ArrowDown"===e.key||"Tab"===e.key&&!e.shiftKey,n="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey;a(!1),i(!1),t?(e.preventDefault(),c({type:"increment",repeat:e.repeat})):n&&(e.preventDefault(),c({type:"decrement",repeat:e.repeat}))},o=()=>i(!0);return e.addEventListener("mousemove",n),e.addEventListener("keydown",r),e.addEventListener("scroll",o),()=>{e.removeEventListener("mousemove",n),e.removeEventListener("keydown",r),e.removeEventListener("scroll",o)}}},[t,s.focusedIndex]),{listRef:n,focusedState:s,isMousing:r,isScrolling:o}}(t.size-1,e),l=Dl(),s=y((e,t)=>{n(n=>new Map(n).set(e,t??null))},[]),c=y(e=>{n(t=>{const n=new Map(t);return n.delete(e),n})},[]),{sortedNodes:d,sortedMap:u}=function(e,t){const n=g(()=>{let n=[];return null!==t.current&&(n=Array.from(e.keys()).sort(ru)),n},[e,t]),r=g(()=>{const t=/* @__PURE__ */new Map;return n.forEach((n,r)=>{const a=e.get(n)??{};t.set(n,{...a,index:r})}),t},[n,e]);return{sortedNodes:n,sortedMap:r}}(t,r);!function(e,t,n,r,a,o){k(()=>{const i=e.current;if(!i)return;const l=e=>{const{node:l,metadata:s}=ou(r,t,n),{shouldOpenCascade:c,shouldCloseCascade:d}=function(e,t,n){const r=e.placement.includes("left"),a=e?.popupParentNodeId,o=a&&n?.hasCascading&&r?"ArrowLeft":"ArrowRight",i=r?"ArrowRight":"ArrowLeft";return{shouldOpenCascade:n?.hasCascading&&t.key===o,shouldCloseCascade:a&&t.key===i}}(a,e,s),u=!(e.target instanceof HTMLInputElement&&""!==e.target.value)&&" "===e.key;var h,p,g,m,v;c||"Enter"===e.key||u?(p=r,g=l,m=i,v=o,!(!(h=s)||!h.hasCascading||null===p||g&&m&&au(g,m)&&(v.setCascadeState(!0,p),v.setFocus(!0),0))||function(e){const t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e?.dispatchEvent(t)}(l),e.preventDefault()):d&&(e.preventDefault(),a.setOpen(!1))};return i.addEventListener("keydown",l),()=>{i.removeEventListener("keydown",l)}},[e,t,r,n,a,o])}(r,d,u,a.focusedIndex,l,e);const{startCallback:h,cancelCallback:m}=Yo({delay:200,callback:({focusedIndex:t,node:n,listElement:r})=>{n&&r&&au(n,r)?e.setCascadeState(!0,t):e.closeCurrentCascade()}});return b=a.focusedIndex,k(()=>{const e=A.current;if(null===b||x)return;const{node:t,metadata:n}=ou(b,T,w);return E.lastOpenedIndex!==b&&n?.hasCascading&&(E.closeCurrentCascade(),I({focusedIndex:b,node:t,listElement:e})),()=>S()},[b,x=o,A=r,E=e,S=m,T=d,w=u,I=h]),function(e,t,n,r){k(()=>{const{metadata:a}=ou(e,t,n);null===e||a?.hasCascading||r.closeCurrentCascade()},[r,e,n,t])}(a.focusedIndex,d,u,e),g(()=>({register:s,unregister:c,map:u,focusedIndex:a.focusedIndex,listRef:r,isMousing:o,isScrolling:i,popupNodeId:l?.nodeId}),[s,c,u,a.focusedIndex,r,o,i,l?.nodeId]);var b,x,T,w,A,E,I,S}const lu=m(Object.freeze({cascadeIndex:null,setCascadeState:()=>{},onScroll:()=>{},focus:!1,setFocus:()=>{},lastOpenedIndex:null,closeCurrentCascade:()=>{}}));function su({style:e,children:t}){const n=Wt(Ot["popup-list"],Al,e),r=function(){const[e,t]=f(null),[n,r]=f(!1),[a,o]=f(null),i=y((n,a)=>{n&&e!==a?(o(a),t(a)):n||e!==a||(r(!1),t(null))},[e,r]),l=y(()=>{t(null),o(null),r(!1)},[t,o,r]),s=y(()=>{t(null),o(null),r(!1)},[]);return{cascadeIndex:e,setCascadeState:i,onScroll:l,focus:n,setFocus:r,lastOpenedIndex:a,closeCurrentCascade:s}}(),a=iu(r);return E("div",{...n,onScroll:r.onScroll,ref:a.listRef,tabIndex:0,children:E(tu.Provider,{value:a,children:E(lu.Provider,{value:r,children:t})})})}function cu({searchTerm:e,setSearchTerm:t,onClick:n,placeholder:r,SearchInput:a,SearchList:o,DefaultList:i,extraProps:l,listLength:s,forceSearchVisible:c}){const d=c||s>=5,u=An(e),h=e=>{n?.(e)};return S(I,{children:[d&&E(a,{searchTerm:e,setSearchTerm:t,placeholder:r}),d&&u?E(o,{...l??{},onClick:h,searchTerm:e}):E(i,{...l??{},onClick:h})]})}const du=Pt(Yt({body:"default"}),St({display:"flex",alignItems:"center",padding:"10px",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}}));function uu({searchTerm:e,setSearchTerm:t,placeholder:n}){const r=p(null);return k(()=>{r.current?.focus({preventScroll:!0});const e=e=>{const t=document.activeElement,n=t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement;!r.current||document.activeElement===r.current||n||(1!==e.key.length||e.ctrlKey||e.altKey||e.metaKey)&&"Backspace"!==e.key||r.current.focus()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),E("input",{ref:r,type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:du})}function hu({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:a,listLength:o,forceSearchVisible:i,getSearchActiveStyles:l}){const s=Dl(),[c,d]=f(""),u=An(c),h=l?.(u);return E(ql,{children:E(su,{style:h,children:E(cu,{searchTerm:c,setSearchTerm:d,onClick:t=>{e?.(t),s?.setOpen(!1)},placeholder:t,SearchInput:uu,SearchList:n,DefaultList:r,extraProps:a,listLength:o,forceSearchVisible:i})})})}const pu=()=>["expenses/categories"],gu=async e=>{const t=e.queryKey,n={path:"/expenses/categories",accessToken:t[1].accessToken,environment:t[1].environment},r=await Ko(n);return{...r,data:r.data?(a=r.data,a.map(e=>({...e,id:Fi({id:e.id,prefix:"TRANSACTION_CATEGORY"}),parentCategoryId:e.parentCategoryId?Fi({id:e.parentCategoryId,prefix:"TRANSACTION_CATEGORY"}):void 0}))):void 0};var a};function mu(e){return Mn({...e,queryKey:["expenses/categories"],queryFn:gu})}function vu(){return mu({select:e=>({...e,data:e.data?yu(e.data):void 0})})}function bu(e){const t=/* @__PURE__ */new Map;for(const n of e)if(n.parentCategoryId){const e=t.get(n.parentCategoryId)??[];e.push(n),t.set(n.parentCategoryId,e)}return t}function fu(e){if(0===e.length)return[];const t=bu(e);return e.map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function yu(e){if(0===e.length)return[];const t=bu(e);return e.filter(e=>!e.parentCategoryId).map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function ku({hasCascading:e=!1}={}){const t=p(null),{register:n,unregister:r,map:a,focusedIndex:o,isMousing:i,listRef:l}=v(tu);w(()=>{const a=t.current;if(a)return n(a,{index:0,hasCascading:e}),()=>{r(a)}},[n,r,e]);const s=g(()=>void 0!==a&&null!==t.current?a.get(t.current)?.index??-1:-1,[a]),c=s===o;w(()=>{c&&(i||t.current?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}))},[c,i]);const d=y(()=>{l?.current?.focus()},[l]),u=g(()=>({onFocus:d,"data-focused":c}),[d,c]);return{itemRef:t,isActive:c,index:s,itemProps:u}}const xu=T(function({onClick:e,index:t,children:n,itemProps:r,popupTriggerProps:a},o){return E("button",{...Il,onClick:e,"data-listitem":!0,"data-index":t,...a,...r,ref:o,children:n})}),Tu=T(function({onClick:e,children:t,popupTriggerProps:n},r){const{index:a,itemProps:o,itemRef:i}=ku(),l=ue([i,r]);return E(xu,{...Il,onClick:e,index:a,...n,itemProps:o,ref:l,children:t})}),Cu=e=>({id:e.id,name:e.name});function wu({text:e}){return E("div",{...Il,children:e?E(ha,{children:e}):E(Wa,{styles:St({width:"100%",height:"16px"})})})}const Au=Wt(Ot["popup-list"],Al),Eu=()=>S("div",{...Au,children:[E(wu,{}),E(wu,{}),E(wu,{}),E(wu,{}),E(wu,{})]}),Iu=Wt(Ot.text,Yt({label:"strongLabel"}),St({maxWidth:"100%"}),Yr);function Su({children:e,stylists:t=[]}){const n=Kt([Iu,...t]);return E("div",{...n,children:e})}const Nu={keys:[{name:"name"}],threshold:.1};function Pu(e,t,n){var r;r=t,n.some(e=>e.child.id===r.id)||n.push({parent:e,child:t})}function Du(e,t){const n=[];return e.forEach(e=>{const r=e.item,a=(l=r,t.find(e=>e.children?.some(e=>e.id===l.id))),o=!(a||0!==r?.children?.length&&r.children),i=!a&&r.children&&r.children.length>0;var l;a?Pu(a,r,n):o?Pu(r,r,n):i&&function(e,t){e.children&&e.children.forEach(n=>{Pu(e,n,t)})}(r,n)}),n}const Ru=Wt(null,St({whiteSpace:"normal"})),Mu=[Wt(null,St({marginLeft:"6px",marginRight:"6px"}))];function Ou({searchTerm:e,onClick:t}){const{query:{data:n,isFetched:r},isFilling:a}=mu({select:e=>({...e,data:e.data?fu(e.data):void 0})}),o=n?.data,i=!a&&r&&(void 0===o||0===o.length),l=g(()=>new xe(o??[],Nu),[o]),s=g(()=>o?Du(l.search(e),o):[],[o,e,l]);return a?E(Eu,{}):i?E(wu,{text:"No data"}):0===s.length?E(wu,{text:"No results found"}):E(I,{children:s.map(({parent:e,child:n})=>{const r=e.id===n.id;return E(Tu,{onClick:()=>t(Cu(n)),children:E(Su,{stylists:[Ru],children:r?n.name:S(I,{children:[e.name,E(Eo,{Component:ko,stylists:Mu}),n.name]})})},`${e.id}_${n.id}`)})})}const Lu=T(function({index:e,popupTriggerProps:t,children:n,itemProps:r},a){const o=ue([a,t?.ref]);return E(xu,{index:e,ref:o,itemProps:r,popupTriggerProps:t,children:n})});function Fu({triggerChildren:e,popupChildren:t}){const{cascadeIndex:n,setCascadeState:r,focus:a}=v(lu),{itemRef:o,index:i,itemProps:l}=ku({hasCascading:!0}),{isScrolling:s}=v(tu);return S(Pl,{open:n===i,onOpenChange:e=>{s||r(e,i)},placement:"right-start",children:[E(Rl,{children:t=>E(Lu,{itemProps:l,index:i,ref:o,popupTriggerProps:t,children:e})}),E(ql,{initialFocus:a,children:t})]})}const Bu=Wt(null,St({display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}));function Uu({icon:e,displayLabel:t}){return S("div",{...Bu,children:[e,E(ha,{wrap:"wrap",children:t}),E(Eo,{Component:ko})]})}function Vu({category:e,handleCategoryChange:t}){return E(su,{children:e.children?.map(e=>E(Tu,{onClick:()=>t(Cu(e)),children:E(ha,{wrap:"wrap",children:e.name})},e.id))})}function Wu({onClick:e}){const{query:{data:t,isFetched:n},isFilling:r}=vu(),a=t?.data,o=!r&&n&&void 0===a;return r?E(Eu,{}):o?E(wu,{text:"No data"}):E(I,{children:a?.map(t=>t.hasChilds?E(Fu,{triggerChildren:E(Uu,{displayLabel:t.name}),popupChildren:E(Vu,{category:t,handleCategoryChange:e})},t.id):E(Tu,{onClick:()=>e(Cu(t)),children:E(ha,{wrap:"wrap",children:t.name})},t?.id))})}const Hu=({onClick:e})=>{const{query:{data:t}}=vu();return E(hu,{onClick:e,placeholder:"Search expense categories...",SearchList:Ou,DefaultList:Wu,listLength:(t?.data??[]).length})},qu=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M12.6809 12.4781H12.0645L6.49121 9.38327V4.42636L12.0645 1.33154H12.6809V12.4781Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M4.01263 4.42627H6.49108V9.38317H4.01263C3.35531 9.38317 2.7249 9.12205 2.2601 8.65725C1.7953 8.19245 1.53418 7.56205 1.53418 6.90472C1.53418 6.2474 1.7953 5.61699 2.2601 5.15219C2.7249 4.68739 3.35531 4.42627 4.01263 4.42627Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M4.0127 9.3833H6.49115L7.72389 14.9566H5.25192L4.0127 9.3833Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.6807 5.66553H13.9199C14.2486 5.66553 14.5638 5.79609 14.7962 6.02849C15.0286 6.26089 15.1591 6.57609 15.1591 6.90475C15.1591 7.06749 15.1271 7.22864 15.0648 7.37898C15.0025 7.52933 14.9112 7.66595 14.7962 7.78102C14.6811 7.89609 14.5445 7.98737 14.3941 8.04965C14.2438 8.11193 14.0826 8.14398 13.9199 8.14398H12.6807V5.66553Z",stroke:"#182428",strokeMiterlimit:10})),"Advertising"),ju=fo(e=>h.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M7.84644 15.0764C11.6751 15.0764 14.7788 11.9727 14.7788 8.14405C14.7788 4.3154 11.6751 1.21167 7.84644 1.21167C4.0178 1.21167 0.914062 4.3154 0.914062 8.14405C0.914062 11.9727 4.0178 15.0764 7.84644 15.0764Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M7.79217 9.6784V8.95116C7.79192 8.79114 7.82335 8.63265 7.88467 8.48484C7.94598 8.33703 8.03596 8.20282 8.14941 8.08996L8.65337 7.586C8.88132 7.35726 9.00972 7.04774 9.01061 6.7248V6.61636C9.00892 6.29431 8.8798 5.98603 8.65149 5.75891C8.42317 5.53179 8.11422 5.40429 7.79217 5.4043C7.47012 5.40429 7.16117 5.53179 6.93285 5.75891C6.70453 5.98603 6.57542 6.29431 6.57373 6.61636",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M7.18604 10.8838H8.39809",stroke:"#182428",strokeMiterlimit:10})),"Uncategorized"),zu=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M7.71472 0.800293V4.79785C7.71535 5.25195 7.58889 5.69716 7.34964 6.08313C7.11039 6.46909 6.7679 6.78039 6.36091 6.98182C6.02094 7.15207 5.64596 7.24072 5.26574 7.24072C4.88552 7.24072 4.51053 7.15207 4.17056 6.98182C3.76928 6.77569 3.43283 6.4626 3.19841 6.07716C2.964 5.69173 2.84075 5.24897 2.8423 4.79785V0.800293",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M5.29443 0.800293V15.4878",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M10.1861 15.4879V1.43896C10.668 1.43896 11.1451 1.53399 11.5903 1.71859C12.0354 1.9032 12.4398 2.17377 12.7802 2.51482C13.1207 2.85587 13.3905 3.2607 13.5744 3.70616C13.7582 4.15161 13.8524 4.62894 13.8516 5.11084V8.78271L10.1797 10.6155",stroke:"#182428",strokeMiterlimit:10})),"Meals"),Ku=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M14.9092 4.60259V6.39635H1.78418V4.60259L8.34669 1.62134L14.9092 4.60259Z",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M14.9092 12.3589H1.78418V14.7464H14.9092V12.3589Z",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M2.97803 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M6.55908 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M10.1343 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M13.7153 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"})),"Bank"),Yu=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M13.7665 10.8572H2.9268C2.60718 10.8572 2.30065 10.7302 2.07465 10.5042C1.84865 10.2782 1.72168 9.9717 1.72168 9.65208V4.97673C1.72168 4.87842 1.74114 4.78109 1.77895 4.69035C1.81676 4.5996 1.87217 4.51725 1.94197 4.44803C2.01178 4.37881 2.0946 4.3241 2.18566 4.28706C2.27672 4.25001 2.37421 4.23137 2.47251 4.2322C2.598 4.23423 2.7211 4.2669 2.83107 4.32739C2.94104 4.38787 3.03455 4.47433 3.10346 4.57923C4.03096 5.93577 7.14155 5.34899 7.14155 4.2322L13.3312 7.08411C13.8209 7.31135 14.2355 7.67379 14.5261 8.12874C14.8167 8.5837 14.9713 9.11222 14.9717 9.65208C14.9717 9.9717 14.8447 10.2782 14.6187 10.5042C14.3927 10.7302 14.0862 10.8572 13.7665 10.8572Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M14.9717 9.6521V10.8572C14.97 11.4954 14.7153 12.1068 14.2635 12.5574C13.8117 13.0081 13.1996 13.2611 12.5614 13.2611H2.92681C2.76832 13.262 2.61124 13.2314 2.46465 13.1711C2.31806 13.1108 2.18487 13.0221 2.0728 12.91C1.96073 12.798 1.87199 12.6648 1.81173 12.5182C1.75146 12.3716 1.72086 12.2145 1.7217 12.056V9.6521",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M6.54199 3.0271L7.1414 4.23222",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M8.34668 7.24174L9.5518 5.43091",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M10.1514 8.44706L11.3565 6.63623",stroke:"#182428",strokeMiterlimit:10})),"Sports"),_u=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M2.64551 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M14.6148 10.5042H2.07861V13.3517H14.6148V10.5042Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M5.07515 7.62671H11.6417C12.2861 7.62671 12.9041 7.88269 13.3598 8.33833C13.8154 8.79398 14.0714 9.41197 14.0714 10.0563V10.4742H2.64551V10.0563C2.64551 9.41197 2.90149 8.79398 3.35713 8.33833C3.81278 7.88269 4.43077 7.62671 5.07515 7.62671Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M5.49942 5.37623H6.63962C6.86383 5.37623 7.08584 5.42039 7.29298 5.50619C7.50012 5.59199 7.68833 5.71775 7.84687 5.87629C8.00541 6.03483 8.13117 6.22304 8.21697 6.43018C8.30277 6.63733 8.34693 6.85934 8.34693 7.08355V7.68051H3.78613V7.08355C3.78613 6.85884 3.83049 6.63633 3.91666 6.4288C4.00284 6.22127 4.12913 6.03279 4.2883 5.87418C4.44747 5.71556 4.63639 5.58992 4.84422 5.50448C5.05205 5.41903 5.27471 5.37545 5.49942 5.37623Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M10.054 5.37622H11.1942C11.647 5.37622 12.0813 5.5561 12.4014 5.87628C12.7216 6.19647 12.9015 6.63073 12.9015 7.08354V7.6805H8.34668V7.08354C8.34668 6.63073 8.52656 6.19647 8.84674 5.87628C9.16692 5.5561 9.60119 5.37622 10.054 5.37622Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9018 3.0957H3.78613V7.6565H12.9018V3.0957Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M14.0479 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M3.78613 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9077 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10})),"Bedding"),Gu=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M3.58312 11.8285C3.40778 11.6564 3.29681 11.4294 3.26874 11.1854C3.24068 10.9414 3.29723 10.6951 3.42894 10.4878L6.01648 6.34502L10.8698 1.4917C11.2763 1.0884 11.8256 0.861929 12.3982 0.861572C12.6808 0.861572 12.9606 0.917231 13.2217 1.02537C13.4827 1.13351 13.7199 1.29201 13.9198 1.49183C14.1196 1.69164 14.2781 1.92885 14.3862 2.18992C14.4944 2.451 14.55 2.73081 14.55 3.01339C14.5497 3.586 14.3232 4.1353 13.9199 4.54178L9.06657 9.3951L4.92381 11.9826C4.71647 12.1144 4.47021 12.1709 4.22618 12.1428C3.98215 12.1148 3.75515 12.0038 3.58312 11.8285Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.1101 6.34497L9.67676 8.78504L12.7201 14.2685L14.5502 13.0485L12.1101 6.34497Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M9.06658 3.30164L6.62651 5.735L1.14307 2.69162L2.3631 0.861572L9.06658 3.30164Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M4.49481 8.78516H1.75308L1.14307 10.6152L3.58313 11.8285L4.80317 14.2686L6.62651 13.6586V10.9169",stroke:"#182428",strokeMiterlimit:10})),"Airplane"),Qu=fo(e=>h.createElement("svg",{width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M8.58591 0.969731H4.86823C4.67602 0.970222 4.4865 1.01495 4.31436 1.10046C4.14222 1.18597 3.99207 1.30996 3.87555 1.46283L2.38978 3.44818L0.53418 4.06455V8.3986H2.38978C2.38978 8.06994 2.52034 7.75473 2.75274 7.52233C2.98514 7.28993 3.30034 7.15937 3.629 7.15937C3.95766 7.15937 4.27287 7.28993 4.50527 7.52233C4.73767 7.75473 4.86823 8.06994 4.86823 8.3986H9.20228C9.20228 8.06994 9.33284 7.75473 9.56524 7.52233C9.79764 7.28993 10.1128 7.15937 10.4415 7.15937C10.7702 7.15937 11.0854 7.28993 11.3178 7.52233C11.5502 7.75473 11.6807 8.06994 11.6807 8.3986H14.1592V5.52437C14.1588 5.27713 14.0844 5.03565 13.9457 4.831C13.8069 4.62636 13.6101 4.46789 13.3806 4.37598L11.0644 3.44818L9.57858 1.46283C9.46275 1.30922 9.31275 1.18469 9.14045 1.09911C8.96815 1.01352 8.77829 0.969227 8.58591 0.969731Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M10.4414 9.63788C11.1258 9.63788 11.6806 9.08306 11.6806 8.39865C11.6806 7.71424 11.1258 7.15942 10.4414 7.15942C9.75697 7.15942 9.20215 7.71424 9.20215 8.39865C9.20215 9.08306 9.75697 9.63788 10.4414 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M3.62887 9.63788C4.31328 9.63788 4.8681 9.08306 4.8681 8.39865C4.8681 7.71424 4.31328 7.15942 3.62887 7.15942C2.94447 7.15942 2.38965 7.71424 2.38965 8.39865C2.38965 9.08306 2.94447 9.63788 3.62887 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.6021 4.06445H4.25195",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9199 6.54297H14.1591",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M7.34668 2.20898V4.06458",stroke:"#182428",strokeMiterlimit:10})),"Vehicle");function Zu(e){switch(e){case"Advertising":case"Advertising and Marketing":return qu;case"Bank Fees":case"Bank Charges & Fees":case"College Loans":case"Merchant Processing Fees":return Ku;case"Health & Fitness":case"Sports":case"Sporting Goods":return Yu;case"Linen/Key Service":case"Linens (sheets, towels, etc.)":case"Hotel":case"Hotels":return _u;case"Plane / Train / Bus":case"Airlines":case"Airfare":return Gu;case"Vehicle":case"Taxi":case"Rental Car":case"Rental Cars":case"Car Payment":case"Auto Insurance":case"Other Vehicle Expenses":case"Parking and Tolls":case"Parking & Tolls":case"Transportation (Taxi, Rideshare, Train)":return Qu;case"Meals & Entertainment":case"Meals":case"Business Meals":case"Food & Dining":case"Groceries":case"Restaurants":case"Other Food & Dining":case"Lead Gen - Meals":case"PAX Food & Drink":return zu;default:return ju}}const Xu=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M4.31676 1.37476L1.67926 4.01226L4.31676 6.64976",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.2292 6.64976L14.8667 4.01226L12.2292 1.37476",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M8.27301 14.5623V7.96852C8.27301 6.91926 7.85619 5.91297 7.11425 5.17103C6.37231 4.42909 5.36602 4.01227 4.31676 4.01227H1.67926",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M8.27301 14.5623V7.96852C8.27301 6.91926 8.68983 5.91297 9.43177 5.17103C10.1737 4.42909 11.18 4.01227 12.2293 4.01227H14.8668",stroke:"#182428",strokeMiterlimit:10})),"Split"),Ju=[Wt(null,St({"& path":{stroke:"surface.foreground"}}))];function $u({onClick:e}){return S(gd,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),e()},children:[E(Eo,{stylists:Ju,Component:Xu}),E(ga,{intent:"primary",children:"Add Split"})]})}const eh=m({dimensions:{width:null,height:null}});function th(){const{dimensions:e}=v(eh);return Tn(e.width)&&e.width<parseInt(fa("sizes.breakpoint-sm"))}const nh={transform:"none",willChange:"auto"};function rh({children:e}){return E(ql,{style:nh,children:e})}const ah=Pt(St({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px",flexShrink:1}),Yr);function oh({children:e}){return E("div",{className:ah,children:e})}const ih=Wt(Ot["drawer-header"],St({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"10px 25px 10px 15px",backgroundColor:"surface.foreground",height:"55px",minHeight:"55px"}));function lh({hideDivider:e=!1,children:t}){return S(I,{children:[E("div",{...ih,children:t}),!e&&E(ui,{alignment:"horizontal",color:"strong"})]})}const sh=Wt(null,St({display:"flex",backgroundColor:"surface.intent.action.discrete",border:"none",padding:"6px",margin:0,borderRadius:"sm",outline:"none",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"},"&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"}}),To),ch=()=>xi();function dh({Icon:e=Ml,handleClose:t=ch}={}){return E("button",{...sh,onClick:t,type:"button",children:E(Nc,{Component:e,...sh})})}const uh=St({display:"flex",flexDirection:"column",position:"fixed",inset:0,backgroundColor:"surface.background"}),hh=St({display:"flex",padding:"16px 16px 45px 16px",flexDirection:"column",alignItems:"center",gap:"16px",flex:"1 1 0",alignSelf:"stretch",overflowY:"auto",width:"100%"});function ph({children:e,title:t}){const n=Dl();return E(rh,{children:S("div",{className:uh,children:[E(lh,{children:S(oh,{children:[E(dh,{Icon:yo,handleClose:()=>n.setOpen(!1)}),E(ha,{children:t})]})}),E("div",{className:hh,children:e})]})})}const gh=St({display:"flex",alignItems:"center",gap:"9px",flex:"1 0 0"});function mh({text:e,handleClick:t,LeftIcon:n,RightIcon:r,popupTriggerChildrenProps:a}){return E(ll,{onClick:t,stylists:[Il],popupTriggerProps:a,children:S("div",{className:gh,children:[S("div",{className:gh,children:[n&&E(Nc,{Component:n}),E(ha,{children:e})]}),r&&E(Nc,{Component:r})]})})}const vh=St({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function bh({children:e}){return E("div",{className:vh,children:e})}const fh=St({padding:"0",height:{sm:"35px",base:"51px"},cursor:"default",border:0});function yh(){return E(Wa,{styles:Pt(El,fh)})}const kh=St({width:"70px",height:"24px"}),xh=St({display:"flex",flexDirection:"column",justifyContent:"flex-start",width:"100%",gap:"16px"});function Th(){return S("div",{className:xh,children:[E(Wa,{styles:kh}),S(bh,{children:[E(yh,{}),E(yh,{}),E(yh,{})]}),E(Wa,{styles:kh}),S(bh,{children:[E(yh,{}),E(yh,{}),E(yh,{})]})]})}function Ch({title:e,category:t,onClick:n}){return S(Pl,{children:[E(Rl,{children:e=>E(mh,{text:t.name??"",LeftIcon:Zu(t.name),RightIcon:ko,popupTriggerChildrenProps:e},t.id)}),E(Wh,{headerLabel:e,categoriesLabel:t.name??"",onClick:n,categories:t.children??[]})]})}function wh({onClick:e,showSuggestedCategories:t,categoriesLabel:n,categories:r,isFilling:a}){const o=Ne();return a?E(Th,{}):S(bh,{children:[o&&t&&E(ha,{children:"Suggested"}),E(ha,{children:n}),E("div",{children:r?.map(t=>t.hasChilds?E(Ch,{title:"All Categories",category:t,onClick:e},t.id):E(mh,{text:t.name??"",handleClick:()=>e(t),LeftIcon:Zu(t.name)},t.id))})]})}function Ah(e){const t={};for(const{parent:n,child:r}of e){const e=n.id;n.id===r.id?t[e]={parent:n,children:[]}:t[e]?t[e].children.push(r):t[e]={parent:n,children:[r]}}return t}const Eh=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{clipPath:"url(#clip0_9779_2768)"},h.createElement("path",{d:"M2.70654 9.12132C3.60197 9.12132 4.32787 8.39543 4.32787 7.49999C4.32787 6.60456 3.60197 5.87866 2.70654 5.87866C1.8111 5.87866 1.08521 6.60456 1.08521 7.49999C1.08521 8.39543 1.8111 9.12132 2.70654 9.12132Z",fill:"currentColor"}),h.createElement("path",{d:"M8.32496 9.12132C9.22039 9.12132 9.94629 8.39543 9.94629 7.49999C9.94629 6.60456 9.22039 5.87866 8.32496 5.87866C7.42952 5.87866 6.70363 6.60456 6.70363 7.49999C6.70363 8.39543 7.42952 9.12132 8.32496 9.12132Z",fill:"currentColor"}),h.createElement("path",{d:"M13.9434 9.12132C14.8388 9.12132 15.5647 8.39543 15.5647 7.49999C15.5647 6.60456 14.8388 5.87866 13.9434 5.87866C13.048 5.87866 12.3221 6.60456 12.3221 7.49999C12.3221 8.39543 13.048 9.12132 13.9434 9.12132Z",fill:"currentColor"}))),"Dots"),Ih=St({paddingTop:"50px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px"});function Sh({itemType:e,itemTypePlural:t,showSearchCTA:n}){return S("div",{className:Ih,children:[E(Nc,{Component:Eh}),E(ha,{wrap:"wrap",children:`No ${t} found`}),n&&E(ga,{wrap:"wrap",children:`Try searching for a different ${e}`})]})}const Nh=St({display:"flex",flexDirection:"column",gap:"16px"}),Ph=St({display:"flex",flexDirection:"column",gap:"8px"});function Dh({searchTerm:e,onClick:t,categories:n,isFilling:r}){const a=g(()=>Oe(n),[n]),o=g(()=>fu(a),[a]),i=g(()=>new xe(o??[],Nu),[o]),l=g(()=>o?Ah(Du(i.search(e),o)):{},[o,e,i]);return r?E(Th,{}):0===Object.keys(l).length?E(Sh,{itemType:"category",itemTypePlural:"categories",showSearchCTA:!0}):E(bh,{children:E("div",{className:Nh,children:Object.entries(l).map(([e,{parent:n,children:r}])=>{const a=r.length>0;return S("div",{className:Ph,children:[a&&E(ha,{children:n.name}),E("div",{children:a?r.map(e=>E(mh,{text:e.name??"",handleClick:()=>t(e),LeftIcon:Zu(e.name)},e.id)):E(mh,{text:n.name??"",handleClick:()=>t(n),LeftIcon:Zu(n.name)},e)})]},e)})})})}const Rh=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M6.19899 11.5105C8.9944 11.5105 11.2605 9.2444 11.2605 6.44899C11.2605 3.65358 8.9944 1.38745 6.19899 1.38745C3.40358 1.38745 1.13745 3.65358 1.13745 6.44899C1.13745 9.2444 3.40358 11.5105 6.19899 11.5105Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M15.05 15.3L9.67714 9.92712",stroke:"#182428",strokeMiterlimit:10})),"Search"),Mh=St({display:"flex",flexDirection:"column",justifyContent:"start",gap:"8px",width:"100%"}),Oh=St({display:"flex",padding:"16px",flexDirection:"row",alignItems:"center",gap:"8px",flex:"1 0 0",borderRadius:"sm",border:"1px solid {colors.border.layout}",backgroundColor:"surface.foreground",maxHeight:"49px",minWidth:"fit-content"}),Lh=Pt(St({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"8px",flex:"1 0 0",border:"none",outline:"none",_placeholder:{color:"typography.label.sub"}}),Yt({label:"strongLabel"})),Fh=Wt(null,St({padding:0,outline:"none",border:"none",backgroundColor:"transparent"}));function Bh({searchTerm:e,setSearchTerm:t,placeholder:n}){return S("div",{className:Mh,children:[E(ha,{children:"Search"}),S("div",{className:Oh,children:[E(Nc,{Component:Rh}),E("input",{type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:Lh}),An(e)&&E(ll,{stylists:[Fh],onClick:()=>t(""),children:E(Nc,{Component:Ml})})]})]})}function Uh({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:a,listLength:o}){const[i,l]=f("");return E(cu,{searchTerm:i,setSearchTerm:l,onClick:t=>{e?.(t)},placeholder:t,SearchInput:Bh,SearchList:n,DefaultList:r,extraProps:a,listLength:o})}const Vh="Search expense categories...";function Wh({headerLabel:e="Back",categoriesLabel:t="All Categories",onClick:n,categories:r,isFetched:a=!1,isFilling:o=!1}){const i=Dl();return E(ph,{title:e,children:E(Uh,{placeholder:Vh,onClick:e=>{n(e),i.setOpen(!1)},SearchList:Dh,DefaultList:wh,listLength:r.length,extraProps:{categories:r,categoriesLabel:t,isFetched:a,isFilling:o}})})}const Hh=St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),qh=St({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}),jh=[],zh=Wt(null,St({display:"flex",flexDirection:"column",maxHeight:"200px",overflowY:"auto",minWidth:"120px"}));function Kh({options:e,onSelect:t,selectedLabel:n}){const r=Dl();return E("div",{...zh,children:e.map(e=>E(zl,{onClick:()=>{return n=Number(e.value),r?.setOpen(!1),void t(n);var n},active:n===e.label,children:e.label},e.value))})}const Yh=fo(e=>h.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{clipPath:"url(#clip0_9779_2922)"},h.createElement("path",{d:"M0.714706 3.99996L6.31472 9.59998L11.9147 3.99996",stroke:"#182428",strokeMiterlimit:10})),h.createElement("defs",null,h.createElement("clipPath",{id:"clip0_9779_2922"},h.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowDown"),_h=Wt(null,St({cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px",borderRadius:"sm",gap:"7px",backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}}),xo);function Gh({selectedLabel:e,options:t,onSelect:n}){return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>S("div",{..._h,...t,children:[E(ha,{children:e}),E(Ol,{Component:Yh})]})}),E(ql,{children:E(Kh,{options:t,onSelect:n,selectedLabel:e})})]})}const Qh=Wt(null,St({display:"flex",alignItems:"center",gap:"15px"})),Zh=rn.map((e,t)=>({value:t,label:e})),Xh=an({}).map(e=>({value:e,label:String(e)}));function Jh({currentMonthYear:e,onMonthYearChange:t}){const n=e.getFullYear(),r=e.getMonth(),a=(e,n)=>{const r=new Date(e,n,1);t(r)};return S("div",{...Qh,children:[E(Gh,{selectedLabel:rn[r],options:Zh,onSelect:e=>a(n,e)}),E(Gh,{selectedLabel:String(n),options:Xh,onSelect:e=>a(e,r)})]})}const $h=Wt(null,St({background:"surface.foreground",padding:"25px",gap:"15px"})),ep=Wt(null,St({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",alignSelf:"stretch",marginBottom:"30px"})),tp=Wt(null,St({backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",padding:"8px",borderRadius:"sm",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"},"&:disabled":{opacity:.6,pointerEvents:"none"}}),xo),np=Wt(null,St({display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px 2px"})),rp=Wt(null,St({padding:"8px",textAlign:"center"})),ap=Wt(null,St({backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",padding:"6px",width:"36px",height:"36px",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"sm",cursor:"pointer",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}},"&[data-selected='true']":{backgroundColor:"surface.intent.action.discrete.active",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.active"},"&[data-today='true']::after":{content:"''",position:"absolute",bottom:"3px",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:"brand.primary"},"&:disabled":{cursor:"default"}}),xo),op=Wt(null,St({color:"typography.base"}));function ip({date:e,selectedDate:t,currentMonth:n,onClick:r,maxDate:a,minDate:o}){const i=t&&on(e,t),l=ln(e),s=e.getMonth()!==n,c=!!a&&sn(e,a),d=!!o&&sn(o,e);return E("button",{...ap,onClick:()=>r(e),"data-selected":i,"data-today":l,disabled:c||d,children:E(ha,{stylists:s||c||d?[op]:[],children:e.getDate().toString()})})}function lp({selectedDate:e,onDateSelect:t,viewDate:n,onViewDateChange:r,maxDate:a,minDate:o}){const i=Dl(),l=n||/* @__PURE__ */new Date,s=l.getFullYear(),c=l.getMonth(),d=function(e,t){const n=Zt(e,t,1),r=new Date(n);return r.setDate(r.getDate()-n.getDay()),Array.from({length:42},(e,t)=>{const n=new Date(r);return n.setDate(r.getDate()+t),n})}(s,c),u=Le(d),h=void 0===a||u&&sn(a,u),p=xn(o)||d.length>0&&sn(d[0],o),g=e=>{t(e),i.setOpen(!1)},m=e=>{const t=new Date(l);t.setMonth(l.getMonth()+e),r(t)};return S("div",{...$h,children:[S("div",{...ep,children:[E("button",{...tp,onClick:()=>m(-1),disabled:!p,children:E(Eo,{Component:yo})}),E(Jh,{currentMonthYear:l,onMonthYearChange:r}),E("button",{...tp,onClick:()=>m(1),disabled:!h,children:E(Eo,{Component:ko})})]}),S("div",{...np,children:[nn.map(e=>E("div",{...rp,children:E(ga,{children:e})},e)),d.map(t=>E(ip,{date:t,selectedDate:e,currentMonth:c,onClick:g,maxDate:a,minDate:o},t.toISOString()))]})]})}const sp=Wt(null,Yt({body:"default"}),St({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer","&:focus":{cursor:"text"}})),cp=Wt(null,Yt({body:"default"}),St({outline:"none",border:"none",padding:0,backgroundColor:"transparent",cursor:"text",overflowWrap:"break-word",minWidth:"100%",maxWidth:"100%","&::placeholder":{color:"typography.base.weak"},"&:focus":{outline:"none"}})),dp=u.object({localId:u.string(),id:u.number().nullable(),name:u.string(),size:u.number(),isPending:u.boolean()}),up=u.object({message:u.object({text:u.string(),attachments:u.array(dp)}).refine(e=>e.text.trim().length>0||e.attachments.some(e=>null!==e.id),{message:"Either message text or attachments are required"})});function hp(e){null!==e.current&&(e.current.scrollIntoView({behavior:"instant"}),e.current.setAttribute("data-hasscrolled","true"))}const pp=fo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M8.94389 13.9144L13.4056 8.12309C14.1306 7.18143 14.4519 5.9904 14.299 4.81186C14.1461 3.63332 13.5313 2.56376 12.59 1.83834C12.1329 1.45727 11.602 1.17479 11.0306 1.00865C10.4592 0.842499 9.85956 0.796265 9.26942 0.872849C8.67928 0.949432 8.11133 1.14718 7.60124 1.45368C7.09115 1.76017 6.64993 2.16881 6.30526 2.65392L1.26787 9.15798C-0.0274639 10.7069 0.993722 12.5848 2.14513 13.4895C2.76204 13.9899 3.55149 14.2266 4.34198 14.1484C5.13247 14.0701 5.86015 13.6831 6.36694 13.0714L11.3769 6.56732C11.531 6.3676 11.6442 6.13944 11.7101 5.89592C11.7759 5.6524 11.7931 5.39829 11.7606 5.14812C11.7282 4.89795 11.6467 4.65664 11.5209 4.43799C11.395 4.21934 11.2274 4.02764 11.0274 3.87386C10.6233 3.56441 10.1132 3.42748 9.60854 3.49297C9.10385 3.55846 8.6456 3.82107 8.33392 4.22339L4.10525 9.70627",strokeMiterlimit:10})),"Attachment"),gp=async({data:e,accessToken:t,environment:n})=>{const{file:r,entity:a,caption:o,entityId:i}=e,l=Mr(n).getUrl(`/files/upload/${a}`),s=wn(o)?"att_"+i:o,c=new FormData;return c.append("file",r),c.append("caption",s),c.append("entityId",String(i)),(await fetch(l,{method:"POST",headers:{Authorization:`Bearer ${t}`},credentials:"include",body:c})).json()},mp=async({data:e,accessToken:t,environment:n})=>{const r=Mr(n).getUrl("/files/attachment");return(await fetch(r,{method:"DELETE",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({id:e.id})})).json()};const vp=St({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),bp=({onFileSelect:e,onUploadComplete:t})=>{const n=p(null),{mutateAsync:r,isPending:a}=md({mutationFn:gp,onSuccess:async()=>Pn.invalidateQueries({queryKey:["files/attachments"]})});return S("div",{children:[E("input",{type:"file",multiple:!0,ref:n,onChange:async a=>{const o=Array.from(a.target.files??[]);if(0===o.length)return;const i=o.map(e=>({localId:crypto.randomUUID(),file:e,name:e.name,size:e.size})),l=i.map(({localId:e,name:t,size:n})=>({localId:e,name:t,size:n,id:null,isPending:!0}));e?.(l);try{const e=i.map(async({localId:e,file:t})=>({localId:e,result:await r({file:t,entity:"message",caption:t.name,entityId:null})})),n=(s=l,c=await Promise.allSettled(e),s.map(({localId:e,name:t,size:n})=>{const r=c.find(t=>"fulfilled"===t.status&&t.value.localId===e);if(r&&"fulfilled"===r.status){const a=r.value.result?.attachment?.id??null;return{localId:e,name:t,size:n,id:a,isPending:!1}}return{localId:e,name:t,size:n,id:null,isPending:!1}}));t?.(n)}finally{n.current&&(n.current.value="")}var s,c},style:{display:"none"}}),E(ll,{type:"button",onClick:()=>{n.current?.click()},disabled:a,children:E("span",{className:vp,children:E(Nc,{Component:pp})})})]})},fp=St.raw({maxHeight:150,maxWidth:"100%",whiteSpace:"pre-wrap",overflowWrap:"break-word",width:"100%",boxSizing:"border-box",margin:0,padding:0,fontFamily:"body"}),yp=St.raw({visibility:"hidden",fontSizeAdjust:"none",fontSize:"100%",fontStyle:"normal",letterSpacing:"normal",fontStretch:"normal",fontVariant:"normal",fontWeight:"normal",textAlign:"left",textAlignLast:"initial",textDecoration:"none",textEmphasis:"none",textIndent:"0px",textJustify:"auto",textShadow:"none",textTransform:"none"}),kp=St(yp,fp),xp=St.raw({resize:"none",inset:0,outline:"none",overflow:"auto",position:"absolute",appearance:"none",border:"none",backgroundColor:"transparent",fontSize:"16px"}),Tp=St(xp,fp,Yt.raw({body:"default"})),Cp=St({display:"block",width:"100%"}),wp=St({position:"relative"}),Ap=St({display:"flex",justifyContent:"flex-end",gap:"15px"}),Ep=St({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),Ip=T(function({blockSubmit:e=!1,scrollRef:t,setActiveKeyboard:n,onFileSelect:r,onUploadComplete:a,hideFileUpload:o},i){const l=Rd(),s=p(null),{startCallback:c}=Yo({delay:50,callback:e=>n(e)});A(i,()=>s.current);const d=!e&&up.safeParse(l.form.state.values).success;return E(eu,{kind:"text",inputRef:s,disableHover:!0,onClick:()=>(hp(t),void c(!0)),children:S("div",{className:Cp,children:[S("div",{className:wp,children:[S("pre",{className:kp,children:[l.state.value.text,E("br",{})]}),E("textarea",{ref:s,placeholder:"Message...",value:l.state.value.text,className:Tp,onChange:e=>l.handleChange({...l.state.value,text:e.target.value})})]}),S("div",{className:Ap,children:[!o&&E(bp,{onFileSelect:r,onUploadComplete:a}),E(ll,{disabled:!d,type:"submit",children:E("span",{className:Ep,children:E(Nc,{Component:Ts})})})]})]})})});function Sp(e){return new L(e).div(100).toNumber()}function Np(e){return new L(e).times(100).toNumber()}const Pp=e=>"MANUAL_ENTRY"===e.apiName||"CSV_IMPORT"===e.apiName,Dp=e=>{const t=e?.description;return`${t} | ${sa(Sp(Number(e?.amount)))} | ${cn(hn(e?.date||""))}`};function Rp({promptText:e}){return S(I,{children:[E(Eo,{Component:Gi}),E(ml,{children:e})]})}function Mp({bankAccounts:e,onClick:t,isFilling:n,showAddButton:r=!1}){return n?E(Eu,{}):S(I,{children:[r&&E(Tu,{onClick:()=>ki("BankAccountForm"),children:E(Rp,{promptText:"Add bank account"})}),e?.map(e=>E(Tu,{onClick:()=>t(e),children:E(ha,{wrap:"wrap",children:ad(e?.name,e?.mask)})},e?.id))]})}const Op={keys:[{name:"apiAccountName",weight:2},{name:"apiAccountNo",weight:1}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Lp({bankAccounts:e,searchTerm:t,onClick:n,isFilling:r,showAddButton:a=!1}){const o=g(()=>new xe(e??[],Op),[e]),i=g(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?E(Eu,{}):S(I,{children:[a&&E(Tu,{onClick:()=>ki("BanksAndIntegrations"),children:E(Rp,{promptText:"Add bank account"})}),0===i.length?E(wu,{text:"No results found"}):i.map(e=>E(Tu,{onClick:()=>n(e),children:E(ha,{wrap:"wrap",children:ad(e?.name,e?.mask)})},e?.id))]})}function Fp({onClick:e,bankAccounts:t,isFilling:n,showAddButton:r=!1}){return E(hu,{onClick:e,placeholder:"Search bank accounts...",SearchList:Lp,DefaultList:Mp,extraProps:{bankAccounts:t,isFilling:n,showAddButton:r},listLength:t?.length??0})}const Bp=St({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"});function Up({label:e,disabled:t,bankAccount:n,bankAccountOptions:r,isFilling:a,onClick:o}){return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:r=>E(eu,{label:e,popupTriggerProps:r,disabled:t,children:E("button",{className:Bp,type:"button",disabled:t,children:E(ha,{children:ad(n?.name??"",n?.mask??"")})})})}),E(Fp,{bankAccounts:r,isFilling:a,onClick:o,showAddButton:!0})]})}const Vp=(e,t)=>e?.find(e=>e.glAccountId===t),Wp=e=>{const{query:t}=dd({select:t=>{return{...t,data:(n=t?.data,r=e,n?.find(e=>e.id===r))};var n,r}});return t.data?.data},Hp=e=>{if(xn(e))return!1;const t=e.filter(e=>wd(e.apiName)&&"ACTIVE"===e.status&&!0===e.isSupported);return void 0!==t&&t.length>0&&!t.some(e=>!e.syncTransactions||Tn(e.lastSyncedDate))},qp=()=>{const e=dd({select:e=>({...e,hasPlaidLinkedBankAccount:(e?.data?.filter(e=>"PLAID"===e.apiName)??[]).length>0})});return{...e,hasPlaidLinkedBankAccount:!!e.query.data&&e.query.data.hasPlaidLinkedBankAccount}};function jp(e){return e?.filter(e=>Cd(e.apiName)&&"ACTIVE"===e.status)}function zp(e,t){return e?.filter(e=>e.integration?.id===t)||[]}function Kp(e){return dd({select:t=>({...t,data:zp(t?.data,e)})})}const Yp=Wt(Ot["category-text"],St({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",padding:0,outline:"none",border:"none",background:"none",borderRadius:"md",color:"typography.intent.action",flex:"1 1 0",minWidth:0,cursor:"pointer",_supportHover:{color:"typography.intent.action.hover"},"&:focus-visible":{outline:"4px solid",outlineOffset:"2px",outlineColor:"border.layout"},"& .Tight-medium-icon > path":{_supportHover:{stroke:"typography.intent.action.hover"}}}),Co),_p=Wt(null,St({color:"inherit"})),Gp=Wt(Ot["amount-input-container"],St({borderRadius:"md",border:"none",background:"transparent",color:"typography.intent.action",maxWidth:"120px","&:not(:focus-within)":{_supportHover:{color:"typography.intent.action.hover"}},"& .Tight-amount-input, & .Tight-text":{color:"inherit"},"&[data-clicked='true']:focus-within":{outline:"1px solid",outlineOffset:"2px",outlineColor:"border.layout.strong"},"&[data-clicked='false']:has(:focus-visible)":{outline:"4px solid",outlineOffset:"2px",outlineColor:"border.layout"}}),Co),Qp=()=>["accounting/glAccounts"],Zp=async e=>{const t=e.queryKey,n={path:"/accounting/glAccounts",params:{leavesOnly:"false"},accessToken:t[1].accessToken,environment:t[1].environment},r=await Ko(n);return eg(r)};function Xp(e){return Mn({...e,queryKey:["accounting/glAccounts"],queryFn:Zp})}function Jp(){return Xp({select:rg})}function $p(){return Xp({select:ag})}const eg=e=>e.map(e=>({...e,id:Fi({id:e.id,prefix:"GL_ACCOUNT"})}));function tg(e,t){const n=t.get(e.accountNo)??[];return 0===n.length?[{...e,children:[]}]:n.flatMap(e=>tg(e,t))}const ng=e=>!e.parentAccountNo;function rg(e){const t=function(e){const t=/* @__PURE__ */new Map;for(const n of e)if(n.parentAccountNo){const e=t.get(n.parentAccountNo)??[];e.push(n),t.set(n.parentAccountNo,e)}return t}(e);return e.filter(ng).map(e=>({...e,children:tg(e,t)}))}function ag(e){return rg(e).flatMap(e=>[e,...e.children])}const og=["LIABILITY","EQUITY","INCOME","OTHER_INCOME"];function ig(e,t){return g(()=>e?.filter(e=>t.includes(e.type))??[],[e,t])}const lg=e=>({id:e.id||"",name:e.name,accountNo:e.accountNo});function sg(e,t){return`${e?`#${e}`:""} ${t??""}`.trim()}const cg={keys:[{name:"name"},{name:"accountNo"}],threshold:.1};function dg(e,t,n){var r;r=t,n.some(({child:e})=>e.accountNo===r.accountNo)||n.push({parent:e,child:t})}function ug(e,t){const n=[];return e.forEach(e=>{const r=e.item,a=(o=r,t.find(e=>e.children.some(e=>e.accountNo===o.accountNo)));var o;!a&&r.children.length>0?function(e,t){e.children.forEach(n=>{dg(e,n,t)})}(r,n):a&&dg(a,r,n)}),n}const hg=[Wt(null,St({marginLeft:"6px",marginRight:"6px"}))],pg=Wt(null,St({whiteSpace:"normal"}));function gg({types:e,onClick:t,searchTerm:n}){const{query:{data:r},isFilling:a}=$p(),o=ig(r,e),i=g(()=>new xe(o,cg),[o]),l=g(()=>ug(i.search(n),o),[o,n,i]);return a?E(Eu,{}):l.map(({parent:e,child:n})=>E(Tu,{onClick:()=>t(n),children:S(Su,{stylists:[pg],children:[sg(e.accountNo,e.name),E(Eo,{Component:ko,stylists:hg}),sg(n.accountNo,n.name)]})},`${n.accountNo}`))}function mg({types:e,onClick:t}){const{query:{data:n,isFetching:r},isFilling:a}=Jp(),o=ig(n,e);return a?E(Eu,{}):a||r||void 0!==n?o.map(e=>{const n=sg(e.accountNo,e.name);return E(Fu,{triggerChildren:E(Uu,{displayLabel:n}),popupChildren:E(vg,{glAccount:e,onClick:t})},e.accountNo)}):E(wu,{text:"No data"})}function vg({glAccount:e,onClick:t}){return E(su,{children:e.children.map(e=>E(Tu,{onClick:()=>t(e),children:E(ha,{children:sg(e.accountNo,e.name)})},e.accountNo))})}const bg=St({maxWidth:"420px",width:"fit-content"});function fg({onClick:e,types:t}){const{query:{data:n}}=Jp(),r=ig(n,t);return E(hu,{onClick:e,placeholder:"Search revenue accounts...",getSearchActiveStyles:e=>e?bg:void 0,SearchList:gg,DefaultList:mg,extraProps:{types:t},listLength:r.length,forceSearchVisible:!0})}function yg({title:e,glAccount:t,onClick:n}){return S(Pl,{children:[E(Rl,{children:e=>E(mh,{text:sg(t.accountNo,t.name),RightIcon:ko,popupTriggerChildrenProps:e},t.id)}),E(Ag,{headerLabel:e,glAccountsLabel:t.name,glAccounts:t.children,onClick:n})]})}function kg({onClick:e,showSuggestedCategories:t,glAccounts:n,glAccountsLabel:r,isFilling:a}){const o=Ne(),i=ig(n,og);return a?E(Th,{}):S(bh,{children:[o&&t&&E(ha,{children:"Suggested"}),E(ha,{children:r}),E("div",{children:i?.map(t=>t.hasChilds?E(yg,{glAccount:t,title:"All Income Categories",onClick:e},t.id):E(mh,{text:sg(t.accountNo,t.name),handleClick:()=>e(t)},t.id))})]})}const xg=St({display:"flex",flexDirection:"column",gap:"16px"}),Tg=St({display:"flex",flexDirection:"column",gap:"8px"});function Cg({searchTerm:e,onClick:t,glAccounts:n,isFilling:r}){const a=ig(n.flatMap(e=>[e,...e.children]),og),o=g(()=>new xe(a,cg),[a]),i=g(()=>Ah(ug(o.search(e),a)),[a,e,o]);return r?E(Th,{}):0===Object.keys(i).length?E(Sh,{itemType:"income category",itemTypePlural:"ncome categories",showSearchCTA:!0}):E(bh,{children:E("div",{className:xg,children:Object.entries(i).map(([e,{parent:n,children:r}])=>{const a=r.length>0;return S("div",{className:Tg,children:[a&&E(ha,{children:sg(n.accountNo,n.name)}),E("div",{children:a?r.map(e=>E(mh,{text:sg(e.accountNo,e.name),handleClick:()=>t(e)},e.id)):E(mh,{text:sg(n.accountNo,n.name),handleClick:()=>t(n)},e)})]},e)})})})}const wg="Search Income Categories...";function Ag({headerLabel:e="Back",glAccountsLabel:t="All General Ledger Accounts",onClick:n,glAccounts:r,isFetched:a=!1,isFilling:o=!1}){const i=Dl();return E(ph,{title:e,children:E(Uh,{placeholder:wg,onClick:e=>{n(e),i.setOpen(!1)},SearchList:Cg,DefaultList:kg,listLength:r.length,extraProps:{glAccounts:r,glAccountsLabel:t,isFetched:a,isFilling:o}})})}const Eg=St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),Ig={filter:{type:{in:["BANK_TRANSFER"]}}},Sg={keys:[{name:"description"}],threshold:.2,includeScore:!0,minMatchCharLength:1};function Ng(e){return e.map(e=>e.item)}const Pg=Wt(null,St({whiteSpace:"normal"}));function Dg({onClick:e,transactionId:t,amount:n}){const{query:{data:r},isFilling:a}=Pi(Ig),o=r?.data?.filter(e=>e.id!==t&&"ACTIVE"===e.status&&e.amount===n);return a?E(Eu,{}):o?.map(t=>E(Tu,{onClick:()=>e(t),children:E(ha,{stylists:[Pg],children:Dp(t)})},t.id))}const Rg=Wt(null,St({whiteSpace:"normal"}));function Mg({searchTerm:e,onClick:t,transactionId:n,amount:r}){const{query:{data:a,isFetched:o},isFilling:i}=Pi(Ig),l=a?.data?.filter(e=>e.id!==n&&"ACTIVE"===e.status&&e.amount===r),s=!i&&o&&(void 0===l||0===l.length),c=g(()=>new xe(l??[],Sg),[l]),d=g(()=>l?Ng(c.search(e)):[],[l,e,c]);return i?E(Eu,{}):s?E(wu,{text:"No data"}):0===d.length?E(wu,{text:"No results found"}):E(I,{children:d.map(e=>E(Tu,{onClick:()=>t(e),children:E(ha,{stylists:[Rg],children:Dp(e)})},e.id))})}function Og({onClick:e,transactionId:t,amount:n,noMatches:r}){const{query:{data:a}}=Pi(Ig),o=a?.data?.filter(e=>e.id!==t&&"ACTIVE"===e.status&&e.amount===n);return r?E(ql,{children:E(su,{children:E(wu,{text:"No match found"})})}):E(hu,{onClick:e,placeholder:"Search bank transfer categories...",SearchList:Mg,DefaultList:Dg,listLength:o?.length??0,extraProps:{transactionId:t,amount:n}})}function Lg({onClick:e,showSuggestedCategories:t,bankTransfers:n,bankTransfersLabel:r,isFetched:a,isFilling:o}){const i=Ne(),l=!o&&a&&void 0===n;return o?E("p",{children:"isFilling"}):l?E("p",{children:"isEmpty"}):S(bh,{children:[i&&t&&E(ha,{children:"Suggested"}),E(ha,{children:r}),E("div",{children:n?.map(t=>E(mh,{text:Dp(t),handleClick:()=>e(t)},t.id))})]})}function Fg({searchTerm:e,onClick:t,bankTransfers:n,isFetched:r,isFilling:a}){const o=!a&&r&&0===n.length,i=g(()=>new xe(n??[],Sg),[n]),l=g(()=>n?Ng(i.search(e)):[],[n,e,i]);return a?E("p",{children:"isFilling"}):o?E("p",{children:"isEmpty"}):0===l.length?E("p",{children:"No results"}):E(bh,{children:E("div",{children:l.map(e=>E(mh,{text:Dp(e),handleClick:()=>t(e)},e.id))})})}function Bg({title:e="Back",bankTransfersLabel:t="All Matching Bank Transfers",onClick:n,bankTransfers:r,isFetched:a=!1,isFilling:o=!1}){const i=Dl();return E(ph,{title:e,children:E(Uh,{placeholder:"Search bank transfer categories...",onClick:e=>{n(e),i.setOpen(!1)},SearchList:Fg,DefaultList:Lg,listLength:r.length,extraProps:{bankTransfersLabel:t,bankTransfers:r,isFetched:a,isFilling:o}})})}const Ug=St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),Vg=Wt(null,St({color:"typography.base.weak"})),Wg=Wt(null,St({display:"grid",textWrap:"nowrap"}));function Hg({children:e,rows:t,cols:n}){return E("div",{...Wg,style:{gridTemplateColumns:`repeat(${n}, 1fr)`,gridTemplateRows:`repeat(${t}, 1fr)`},children:e})}const qg=Rt({base:{minWidth:0,borderRadius:"zero",_focus:{zIndex:1}},variants:{width:{full:{width:"100%"}},backgroundColor:{foreground:{backgroundColor:"surface.foreground"}}}});function jg({option:e,handleClick:t,selected:n,width:r,backgroundColor:a}){const o=Pt(qg({width:r,backgroundColor:a}),Xi,Qi,Zi,xo);return void 0===e?null:E("button",{type:"button",className:o,onClick:()=>t(e),"data-active":n?.value===e.value,children:E(ml,{wrap:"wrap",alignment:"center",children:e.label})})}function zg({options:e,handleClick:t,selected:n,rows:r,cols:a}){return E(Hg,{rows:r,cols:a,children:e?.map(e=>E(jg,{option:e,handleClick:t,selected:n},e.value))})}function Kg({options:e}){const t=Dl(),n=Rd();return E(ql,{children:E(su,{children:e.map(e=>E(Tu,{onClick:()=>{n.handleChange(e.value),n.handleBlur(),t.setOpen(!1)},children:E(ml,{children:e.label})},e.value))})})}const Yg=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),_g=Wt(null,St({color:"typography.base.weak"})),Gg=(e,t)=>{const n=e.find(e=>e.value===t);return n?.label},Qg=St({border:"none",outline:"none",backgroundColor:"transparent",fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"}),Zg=St({display:"flex",flexDirection:{base:"row",md:"column"},alignItems:{base:"center",md:"start"},justifyContent:"flex-start",textAlign:"start",gap:"5px",maxWidth:"100%",flexWrap:"wrap"});function Xg({accountName:e,accountNo:t,syncText:n,active:r=!0}){return S("div",{className:Zg,children:[n&&E(ga,{intent:r?"normal":"danger",children:n}),E(ha,{wrap:"wrap",children:e}),t&&E(ha,{children:rd(t)})]})}const Jg=e=>["plaidInstitutionLogo",e??{}];function $g(e){const t=In(),n=Rn();return D({queryKey:Jg({institutionId:e,accessToken:t,environment:n}),queryFn:async()=>await Wc({institutionId:e,accessToken:t,environment:n}),staleTime:864e5}).data?.map?.logo}const em=St({display:"flex",gap:"10px",maxWidth:"100%"});function tm({accountName:e,accountNo:t,institutionId:n,syncText:r,active:a=!0,showIcon:o=!0}){const i=$g(n);return S("div",{className:em,children:[i&&o?E("img",{src:i,alt:"Bank Logo",width:"25px",height:"25px"}):E(xs,{Component:Ku}),E(Xg,{accountName:e,accountNo:t,active:a,syncText:r})]})}const nm=St({maxWidth:"100%",display:"flex",gap:"10px",alignItems:"center"});function rm({selectedAccount:e,placeholderText:t,disabled:n=!1,popupTriggerProps:r}){return E(ll,{...r,disabled:n,width:"fill-parent",children:E(Su,{children:e?ad(e.name,e.mask):S("div",{className:nm,children:[E(ml,{children:t}),E(Eo,{Component:Gi})]})})})}const am="TRIGGER_ACCOUNT",om="FORM_SELECTABLE_ACCOUNT",im=St({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function lm({selectedAccount:e,setSelectedAccount:t,mergeDestination:n,bankAccounts:r,isFilling:a,warningMessage:o}){return S("div",{className:im,children:[S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>E(rm,{popupTriggerProps:t,selectedAccount:e,placeholderText:n===am?"Select Duplicate Bank Account":"Select Destination Bank Account"})}),E(Fp,{bankAccounts:r,isFilling:a,onClick:t})]}),o&&E(Vd,{errorMessage:o})]})}const sm=(e,t,n)=>{if(!n)return;const r=e===om?t:n,a=e===om?n:t,o=(i=r?.mask,l=a?.mask,!i||!l||i!==l);var i,l;const s=(c=r?.apiName,d=a?.apiName,wd(c)&&Cd(d));var c,d;const u=(h=r?.status,p=a?.status,"ACTIVE"===h&&"INACTIVE"===p);var h,p;return o?"Selected account number does not match destination account number":s?"Merging a linked account into a manually tracked account may result in duplicate transactions":u?"You selected an active account to be merged into an archived account":void 0},cm=St({display:"flex",flexDirection:"column",gap:{base:"15px",sm:"0"}}),dm=St({display:{base:"block",sm:"none"}}),um=St({display:"grid",gridTemplateColumns:{sm:"300px auto 175px",base:"1fr"},gap:"10px",alignItems:"center"}),hm=St({display:"flex",justifyContent:"center",alignItems:"center"}),pm=St({display:{base:"none",sm:"block"}}),gm=St({display:{base:"block",sm:"none"}});function mm({destinationAccount:e,selectedDuplicate:t,availableAccounts:n,isFilling:r,onSelectionChange:a}){const o=n&&n.length>0;return S("div",{className:cm,children:[S("div",{className:um,children:[o?E(lm,{selectedAccount:t,setSelectedAccount:a,mergeDestination:am,bankAccounts:n,isFilling:r,warningMessage:sm(am,e,t??null)}):E(rm,{disabled:!0,selectedAccount:t,placeholderText:"No Duplicate Accounts Available"}),S("div",{className:hm,children:[E("div",{className:pm,children:E(Nc,{Component:ko})}),E("div",{className:gm,children:E(Nc,{Component:Yh})})]}),E(tm,{accountName:e.name,accountNo:e.mask,institutionId:e.integration.apiInstitutionId??""})]}),E("div",{className:dm,children:E(ui,{alignment:"horizontal"})})]})}const vm=async e=>{const t=e.queryKey,n={path:"/expenses/vendors",accessToken:t[1].accessToken,environment:t[1].environment},r=await Ko(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Fi({id:e.id,prefix:"VENDOR"})})):[];return{...r,data:a}};function bm(){return Mn({queryKey:["expenses/vendors"],queryFn:vm})}const fm=async({data:e,accessToken:t,environment:n})=>{const r={path:"/expenses/vendor",bodyParams:{vendor:{name:e}},accessToken:t,endpointManager:Mr(n)};return await Sr(r)},ym=Pt(Yt({body:"default"}),St({display:"flex",alignItems:"center",justifyContent:"center",padding:"0",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}})),km=St({display:"flex",alignItems:"center",width:"100%",gap:"8px"}),xm=St({display:"flex",alignItems:"center",justifyContent:"center",background:"brand.success",color:"typography.contrast",border:"none",cursor:"pointer",padding:"2px 6px",borderRadius:"sm",outline:"none"});function Tm({placeholder:e,value:t,onChange:n,onSubmit:r,onCancel:a,inputRef:o}){return S("div",{className:km,children:[E("input",{ref:o,type:"text",placeholder:e,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r()):"Escape"===e.key&&(e.preventDefault(),a())},onFocus:e=>{e.stopPropagation()},className:ym}),E("button",{type:"button",onClick:r,className:xm,children:E(ga,{children:"Add"})})]})}function Cm({promptText:e,placeholderText:t,onSubmit:n}){const[r,a]=f(!1),[o,i]=f(""),l=p(null);return k(()=>{r&&l.current&&l.current.focus({preventScroll:!0})},[r]),E(Tu,{onClick:r?void 0:()=>{a(!0)},children:r?E(Tm,{placeholder:t,value:o,onChange:i,onSubmit:()=>{o.trim()&&(n(o.trim()),i(""),a(!1))},onCancel:()=>{i(""),a(!1)},inputRef:l}):E(Rp,{promptText:e})})}const wm={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Am({vendors:e,searchTerm:t,onClick:n,isLoading:r,onCreateVendor:a}){const o=g(()=>new xe(e??[],wm),[e]),i=g(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?E(Eu,{}):S(I,{children:[E(Cm,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:a}),0===i.length?E(wu,{text:"No results found"}):i.map(e=>E(Tu,{onClick:()=>n(e),children:E(ml,{children:e.name})},e.id))]})}function Em({vendors:e,onClick:t,isLoading:n,onCreateVendor:r}){return n?E(Eu,{}):S(I,{children:[E(Cm,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:r}),e.map(e=>E(Tu,{onClick:()=>t(e),children:E(ml,{children:e.name})},e.id))]})}function Im({onClick:e}){const{query:{data:t,isLoading:n}}=bm(),{mutate:r}=md({mutationFn:fm,onSuccess:async()=>Pn.invalidateQueries({queryKey:["expenses/vendors"]})}),a=t?.data??[];return E(hu,{onClick:e,placeholder:"Search vendors...",SearchList:Am,DefaultList:Em,extraProps:{vendors:a,isLoading:n,onCreateVendor:e=>{r(e)}},listLength:a.length})}const Sm=async e=>{const t=e.queryKey,n={path:"/clientMgmt/clients",accessToken:t[1].accessToken,environment:t[1].environment},r=await Ko(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Fi({id:e.id,prefix:"CUSTOMER"})})):[];return{...r,data:a}};function Nm(){return Mn({queryKey:["clientMgmt/clients"],queryFn:Sm})}const Pm=async({data:e,accessToken:t,environment:n})=>{const r={path:"/clientMgmt/client",bodyParams:{client:{name:e}},accessToken:t,endpointManager:Mr(n)};return await Sr(r)},Dm={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Rm({customers:e,searchTerm:t,onClick:n,isLoading:r,onCreateCustomer:a}){const o=g(()=>new xe(e??[],Dm),[e]),i=g(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?E(Eu,{}):S(I,{children:[E(Cm,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:a}),0===i.length?E(wu,{text:"No results found"}):i.map(e=>E(Tu,{onClick:()=>n(e),children:E(ml,{children:e.name})},e.id))]})}function Mm({customers:e,onClick:t,isLoading:n,onCreateCustomer:r}){return n?E(Eu,{}):S(I,{children:[E(Cm,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:r}),e.map(e=>E(Tu,{onClick:()=>t(e),children:E(ml,{children:e.name})},e.id))]})}function Om({onClick:e}){const{query:{data:t,isLoading:n}}=Nm(),{mutate:r}=md({mutationFn:Pm,onSuccess:async()=>Pn.invalidateQueries({queryKey:["clientMgmt/clients"]})}),a=t?.data??[];return E(hu,{onClick:e,placeholder:"Search customers...",SearchList:Rm,DefaultList:Mm,extraProps:{customers:a,isLoading:n,onCreateCustomer:e=>{r(e)}},listLength:a.length})}function Lm({frequencies:e,onClick:t}){const n=Dl();return E(ql,{children:E(su,{children:e.map(e=>E(Tu,{onClick:()=>(t(e),void n.setOpen(!1)),children:E(ha,{children:e.name})},e.value))})})}const Fm=[{value:"Q1",label:"Q1"},{value:"Q2",label:"Q2"},{value:"Q3",label:"Q3"},{value:"Q4",label:"Q4"}],Bm=["FEDERAL","STATE","SALES"],Um=["Q1","Q2","Q3","Q4"],Vm=[{value:"FEDERAL",label:"Federal/Self-Employed Income Tax"},{value:"STATE",label:"State Income Tax"},{value:"SALES",label:"Sales Tax"}];function Wm({onClick:e}){const t=Dl();return E(ql,{children:E(su,{children:Vm.map(n=>E(Tu,{onClick:()=>{return r=n.value,e(r),void t.setOpen(!1);var r},children:E(ha,{children:n.label})},n.label))})})}function Hm({headerLabel:e="Back",onClick:t}){const n=Dl();return E(ph,{title:e,children:S(bh,{children:[E(ha,{children:"Tax Categories"}),E("div",{children:Vm.map(e=>E(mh,{text:e.label,handleClick:()=>(t(e.value),void n.setOpen(!1))},e.value))})]})})}const qm=St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),{useAppForm:jm,withForm:zm}=ye({formContext:Pd,fieldContext:Dd,formComponents:{SaveButton:Ld},fieldComponents:{DiscreteAmountField:function({label:e}){const t=p(null),n=Rd();return E(Kd,{inputRef:t,label:e,children:E(Xd,{value:n.state.value,onChange:n.handleChange,inputRef:t})})},EditableAmountField:function({label:e,autofocus:t=!1}){const n=p(null),r=Rd();return E(eu,{inputRef:n,label:e,children:E(Xd,{value:r.state.value,onChange:r.handleChange,inputRef:n,autofocus:t})})},ExpenseCategoryField:function({category:e,onClick:t,childrenField:n,totalAmount:r,glAccount:a}){const{query:{data:o,isFetched:i},isFilling:l}=vu(),s=o?.data??jh,c=th(),d=()=>{const t=Math.floor(r/2*100)/100,o=r-t;n?.pushValue({amount:t,category:e,classSegments:[],glAccount:a}),n?.pushValue({amount:o,category:e,classSegments:[],glAccount:a})};return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>S(eu,{label:"Category",popupTriggerProps:t,children:[S("button",{className:Hh,type:"button",children:[S("div",{className:qh,children:[E(Nc,{Component:Zu(e?.name)}),E(ha,{children:e?.name||"Uncategorized"})]}),E(Nc,{Component:ko})]}),n&&E($u,{onClick:d})]})}),c?E(Wh,{onClick:t,categories:s,isFetched:i,isFilling:l}):E(Hu,{onClick:t})]})},DateInput:function({label:e,maxDate:t,minDate:n,autofocus:r=!1,editable:a=!1}){const o=Rd(),i=fe(o.store,e=>e.meta.isDefaultValue),l=p(null),[s,c]=f(()=>o.state.value?hn(o.state.value):/* @__PURE__ */new Date),d=o.state.value?hn(o.state.value):null,[u,h]=f(""),g=e=>{const r=function(e){const t=e.replace(/\D/g,"");return t.length<=2?t:t.length<=4?`${t.slice(0,2)}/${t.slice(2)}`:`${t.slice(0,2)}/${t.slice(2,4)}/${t.slice(4,8)}`}(e.target.value);h(r);const a=un(r);if(a){let e=a;t&&n?e=mn(gn(a,t),n):t?e=gn(a,t):n&&(e=mn(a,n)),o.handleChange(pn(e)),c(e)}else o.handleChange("")},m=u||(d?cn(d):""),[v,b]=f(!1),y=e=>{v&&(()=>{if(d&&!i){const e=un(u);(t&&e&&sn(e,t)||n&&e&&sn(n,e))&&h(cn(d))}})(),b(e)},k=e=>{"Enter"===e.key&&(e.preventDefault(),y(!v))},x=a?eu:Kd;return S(Pl,{placement:"bottom-start",onOpenChange:y,open:v,children:[E(Rl,{children:t=>E(x,{label:e,inputRef:l,popupTriggerProps:t,onClick:()=>b(!0),children:E("input",{...sp,ref:l,type:"text",id:o.name,value:m,onChange:g,placeholder:"MM/DD/YYYY",maxLength:10,autoFocus:r,onKeyDown:k,autoComplete:"off"})})}),E(ql,{initialFocus:!1,children:E(lp,{selectedDate:d,onDateSelect:e=>{o.handleChange(pn(e)),h(cn(e)),c(e)},viewDate:s,onViewDateChange:c,maxDate:t,minDate:n})})]})},TextAreaInput:function({label:e,placeholder:t,autofocus:n=!1,resizeable:r=!0}){const a=Rd(),o=p(null);return E(eu,{label:e,inputRef:o,children:E("textarea",{...cp,ref:o,value:a.state.value||"",onChange:e=>a.handleChange(e.target.value),placeholder:t??"Add note...",rows:4,style:{resize:r?"both":"none"},autoFocus:n})})},MessageAreaInput:Ip,SplitExpenseCategoryField:function({value:e,onChange:t}){return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>S("button",{...Yp,...t,type:"button",children:[E(Nc,{Component:Zu(e?.name)}),E(ha,{stylists:[_p],children:e?.name||"Uncategorized"})]})}),E(Hu,{onClick:t})]})},SplitExpenseAmountField:function({value:e,onChange:t,onBlur:n}){const[r,a]=f(!1);return E("div",{...Gp,"data-clicked":r,children:E(Xd,{value:e,onChange:t,onClick:()=>a(!0),onBlur:()=>(a(!1),void n())})})},ManualBankAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=Rd(),r=Wp(t.id),{query:{data:a},isFilling:o}=dd({select:e=>({...e,data:jp(e?.data)})}),i=a?.data,l=xn(e)||!Pp(e);return E(Up,{label:"Bank Account",disabled:l,onClick:e=>{var t;n({id:(t=e).id,name:t.name})},bankAccount:r,bankAccountOptions:i,isFilling:o})},GlAccountField:function(){const e=th(),{query:{data:t,isFetched:n},isFilling:r}=Jp(),a=Rd(),o=a.state.value,i=e=>{const t=lg(e);a.handleChange(t)};return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:e=>E(eu,{label:"Category",popupTriggerProps:e,children:S("button",{className:Eg,type:"button",children:[E(ha,{children:sg(o.accountNo,o.name)}),E(Nc,{Component:ko})]})})}),e?E(Ag,{onClick:i,glAccounts:t??[],isFetched:n,isFilling:r}):E(fg,{onClick:i,types:og})]})},BankGlAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=Rd(),{query:{data:r}}=$p(),a=function(e){const{query:t}=dd({select:t=>({...t,data:Vp(t.data,e)})});return t.data?.data}(t?.id),{query:{data:o},isFilling:i}=dd({select:e=>{return{...e,data:(t=e?.data,t?.filter(e=>"ACTIVE"===e.status&&e.isSupported&&e.glAccountId))};var t}}),l=o?.data,s=e?Ad(e.amount):"";return E(Up,{label:s,onClick:e=>{const t=(a=r,o=e,a?.flatMap(e=>[e,...e.children??[]]).find(e=>e.id===o.glAccountId?.split("_")[1]));var a,o;t&&n(lg(t))},bankAccount:a,bankAccountOptions:l,isFilling:i})},MatchingBankTransferField:function({transaction:e}){const t=th(),n=Rd(),{query:{data:r,isFetched:a},isFilling:o}=Pi(Ig),i=r?.data?.filter(t=>t.id!==e?.id&&"ACTIVE"===t.status&&t.amount===e?.amount),l=Tn(i)&&i.length>0,s=e=>{const t={id:(r=e).id,description:r?.description,amount:r?.amount,date:r?.date,bankAccountId:r?.bankAccount?.id,apiName:r?.apiName};var r;n.handleChange(t),n.handleBlur()},c=n.state.value,d=c?Dp(c):"Select",u=c?[]:[Vg];return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:e=>E(eu,{label:"Matching Bank Transfer",popupTriggerProps:e,children:S("button",{className:Ug,children:[E(ha,{stylists:u,children:d}),E(Nc,{Component:ko,stylists:u})]})})}),t?E(Bg,{bankTransfers:i??[],isFetched:a,isFilling:o,onClick:s}):E(Og,{onClick:s,transactionId:e?.id??"",amount:e?.amount??0,noMatches:!l})]})},ButtonGroupField:function({label:e,options:t}){const n=Rd(),r=t.find(e=>e.value===n.state.value);return E(eu,{label:e,disableHover:!0,children:E(zg,{options:t,selected:r,handleClick:e=>{n.handleChange(e.value.toString())},rows:1,cols:t.length})})},ButtonGrid:zg,GenericSelectorField:function({options:e,label:t,disabled:n}){const r=Rd();return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:a=>E(eu,{label:t,popupTriggerProps:a,disabled:n,children:E("button",{...Yg,type:"button",children:r.state.value?E(ha,{children:Gg(e,r.state.value)}):E(ha,{stylists:[_g],children:`Select ${t}...`})})})}),E(Kg,{options:e})]})},TextField:function({label:e,type:t="text",maxLength:n,disabled:r,placeholder:a="Enter value..."}){const o=Rd(),i=p(null);return E(eu,{label:e,disabled:r,inputRef:i,kind:"text",type:t,maxLength:n,children:E("input",{className:Qg,value:o.state.value,onChange:e=>o.handleChange(e.target.value),type:t,maxLength:n,ref:i,placeholder:a})})},BulkMergeAccountRowField:mm,VendorFieldInput:function({label:e,onClick:t,vendor:n,editable:r=!1}){const a=p(null),o=r?eu:Kd;return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>E(o,{inputRef:a,label:e,popupTriggerProps:t,children:E(ha,{children:n?.name??"Select a vendor..."})})}),E(Im,{onClick:t})]})},CustomerFieldInput:function({label:e,onClick:t,customer:n,editable:r=!1}){const a=p(null),o=r?eu:Kd;return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>E(o,{inputRef:a,label:e,popupTriggerProps:t,children:E(ha,{children:n?.name??"Select a customer..."})})}),E(Om,{onClick:t})]})},FrequencyFieldInput:function({label:e,onClick:t,frequency:n}){const r=p(null),a=`${n?.name??wi[0].name}`;return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>E(eu,{inputRef:r,label:e,popupTriggerProps:t,children:E(ha,{children:a})})}),E(Lm,{frequencies:wi,onClick:t})]})},TaxCategoryField:function({region:e,onClick:t}){const n=th(),r=function(e){if(!xn(e))return Vm.find(t=>t.value===e)?.label}(e)??"Select tax category...";return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:e=>E(eu,{label:"Category",popupTriggerProps:e,children:S("button",{className:qm,type:"button",children:[E(ha,{children:r}),n&&E(Nc,{Component:ko})]})})}),E(n?Hm:Wm,{onClick:t})]})}}});const Km=[Wt(null,St({"& path":{stroke:"icon.base"}}))];function Ym({showIcon:e=!0,textContent:t="Cancel",onClick:n}){return S(ll,{type:"button",onClick:n,children:[e&&E(Eo,{Component:Ml,stylists:Km}),E(ha,{children:t})]})}const _m=St({display:"flex",flexDirection:"column",gap:"20px",padding:"20px",width:"100%",maxWidth:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",minWidth:{md:"800px",base:"100%"}}),Gm=St({display:"flex",flexDirection:"column",gap:"10px",flexShrink:0}),Qm=St({maxWidth:"600px"}),Zm=St({display:"flex",flexDirection:"column",gap:"15px",flexGrow:1,flexShrink:1,minHeight:0,overflowY:"auto"}),Xm=St({display:{base:"none",md:"grid"},gridTemplateColumns:"300px auto 175px",gap:"10px",alignItems:"center"}),Jm=St({display:"flex",justifyContent:"flex-start",alignItems:"center"}),$m=St({display:"flex",justifyContent:{md:"center",base:"flex-start"},alignItems:"center"}),ev=St({display:"flex",justifyContent:{md:"flex-end",base:"flex-start"},alignItems:"center"}),tv=St({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"15px",justifyContent:"flex-end",paddingTop:"10px",borderTop:"1px solid",borderColor:"border.layout",flexShrink:0}),nv=e=>{Yd(e),_d(e)};function rv({destinationAccounts:e,matchingAccountPairs:t,handleClose:n}){const{query:{data:r},isFilling:a}=dd(),o={selectedAccounts:e.filter(e=>e.glAccountId&&e.isSupported).map(e=>({duplicateAccount:void 0,destinationAccount:e}))},i=function(e,t,n){const{mutateAsync:r}=Td(),a=In(),o=Rn(),i=Tn(n),l=i?{selectedAccounts:n}:e;return i&&a&&n.forEach(({duplicateAccount:e})=>{var t,n,r;e&&(t=e.id,n=a,r=o,Ci({queryKey:kn(Ii({filter:{bankAccount:{id:{in:[t]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),queryFn:Ni,accessToken:n,environment:r}))}),jm({defaultValues:l,onSubmit:async e=>{if(await Sd()===Yc){const n=e.value.selectedAccounts.filter(e=>void 0!==e.duplicateAccount);if(!a)return void(await Nd());const l=i?await Promise.all(n.map(async({destinationAccount:e,duplicateAccount:t})=>{const n=await async function(e,t,n){const r=kn(Ii({filter:{bankAccount:{id:{in:[e]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),a=await Ti({queryKey:r,queryFn:Ni,accessToken:t,environment:n});return a?.data?.[0]?.date}(t.id,a,o);var r,i,l;return pn((r=hn(e.tranStartDate||""),i=hn(n||""),l=hn(e.tranMinStartDate||""),xn(i)?r:Tn(l)?mn(i,l):(Tn(r)&&mn(i,r),r)))})):[],s=n.map(({duplicateAccount:e,destinationAccount:t},n)=>{const r=l[n];return{...Ed(t),duplicateBankAccountIds:[Bi(e.id)],...r&&{tranStartDate:r}}});try{await r(s),t()}catch{await Nd()}}},onSubmitInvalid:()=>{}})}(o,n,t),l=i.state.values.selectedAccounts.map(e=>e.destinationAccount);return S("form",{className:_m,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),i.handleSubmit()},onKeyDown:nv,children:[S("div",{className:Gm,children:[E(ha,{children:"Merge Accounts"}),E("div",{className:Qm,children:E(ml,{wrap:"wrap",children:"If you have historical transactions from imported accounts, you can merge them into your linked accounts."})})]}),S("div",{className:Zm,children:[S("div",{className:Xm,children:[E("div",{className:Jm,children:E(ha,{children:"Duplicate Account"})}),E("div",{className:$m,children:E(ha,{children:"Into"})}),E("div",{className:ev,children:E(ha,{children:"Destination Account"})})]}),E(i.AppField,{mode:"array",name:"selectedAccounts",children:e=>e.state.value.map((t,n)=>E(i.AppField,{name:`selectedAccounts[${n}]`,children:t=>{const n=t.state.value.duplicateAccount?.id,o=function(e,t,n,r){const a=function(e,t,n){const r=new Set(e.map(e=>e.id));return t.forEach(({duplicateAccount:e})=>{e&&e.id!==n&&r.add(e.id)}),Array.from(r)}(e,t,n);return r?.filter(e=>!a.includes(e.id)&&Cd(e.apiName)&&"REMOVED"!==e.status)}(l,e.state.value,n,r?.data);return E(mm,{destinationAccount:t.state.value.destinationAccount,selectedDuplicate:t.state.value.duplicateAccount,availableAccounts:o,isFilling:a,onSelectionChange:e=>{const n={duplicateAccount:e,destinationAccount:t.state.value.destinationAccount};t.handleChange(n)}},t.state.value.destinationAccount.id)}},n))})]}),E("div",{className:tv,children:E(i.Subscribe,{selector:e=>e.values.selectedAccounts,children:e=>{const t=e.some(e=>void 0!==e.duplicateAccount);return S(I,{children:[E(Ym,{showIcon:!1,onClick:()=>n()}),E(gd,{onClick:()=>i.reset(o),disabled:!t,children:E(ha,{children:"Clear Selections"})}),E(Ld,{showIcon:!1,disabled:!t,textContent:"Merge"})]})}})})]})}const av=St({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:"200px",height:"fit-content",width:"100%",maxWidth:"100%",backgroundColor:"surface.background",borderRadius:"md",padding:"16px",position:"relative",overflow:"hidden",boxSizing:"border-box"}),ov=me.createConfirmation(ve(function({show:e,dismiss:t,matchingAccountPairs:n,plaidItemAccounts:r}){const a=n?n.map(e=>e.destinationAccount):r;return E(Xc,{show:e,role:"dialog",size:"lg",padding:"none",outsidePress:!1,escapeKey:!0,children:E("div",{className:av,children:E(rv,{destinationAccounts:a,matchingAccountPairs:n,handleClose:()=>t()})})})}));async function iv({plaidItemAccounts:e,matchingAccountPairs:t}){await ov({matchingAccountPairs:t,plaidItemAccounts:e})}const lv=St({display:"flex",flexDirection:"column",gap:"12px"}),sv=async(e,t,n)=>{try{const r=await async function({accessToken:e,plaidItemId:t,environment:n}){if(!e)throw new Error("Access token is required to create Plaid link token");const r={path:"/banks2/createPlaidLinkToken",accessToken:e,endpointManager:Uc(n)},{url:a,headers:o}=wr(r);return qo({url:a,includeCredentials:!0,extraHeaders:o,params:t?{plaidItemId:t}:void 0})}({plaidItemId:e,accessToken:t,environment:n});return r.link_token?(vr("Plaid Link Token created successfully",{accessToken:t,plaidItemId:e,link_token:r.link_token}),r.link_token):(br({error:new Error("Plaid Link Token missing in response"),severity:"error",extraData:{accessToken:t,plaidItemId:e,res:r}}),ld("NO_LINK_TOKEN"))}catch(r){return br({error:new Error("Plaid Link Token creation failed"),severity:"error",extraData:{accessToken:t,plaidItemId:e,error:r}}),ld("LINK_TOKEN_FAILED")}};async function cv(e,t,n){const r=await async function(e,t){const n=kn(Oc({filter:{apiName:{equal:"PLAID"}}}),{cursor:void 0}),r=await Ti({queryKey:n,queryFn:Lc,accessToken:e,environment:t});return r?.data??[]}(t,n);return r?.find(t=>t.apiInstitutionId===e&&"ACTIVE"===t.status)}async function dv(e,t,n,r){vr("savePlaidItemPublicToken",{publicToken:e,metadata:t,accessToken:n,environment:r});try{t.institution&&t.institution.institution_id&&t.institution.name||vr("Plaid metadata missing institution info",{metadata:t,publicToken:e});const a=await async function(e,t,n){if(e){r=t,a=n,Ci({queryKey:kn(["banks/accounts",{}],{}),queryFn:cd,accessToken:r,environment:a});const o=await cv(e,t,n);if(o){const e=await ud(t,n);return e?.data?.filter(e=>e.integration.id===o.id)||[]}}var r,a;return[]}(t?.institution?.institution_id,n,r),{plaidItem:o}=await async function({publicToken:e,metadata:t,accessToken:n,environment:r}){if(!n)throw new Error("Access token is required to create Plaid link token");const a={path:"/banks2/webPlaidPublicToken",accessToken:n,endpointManager:Uc(r)},{url:o,headers:i}=wr(a);return await Ar({url:o,params:{publicToken:e,plaidMetadata:t},includeCredentials:!0,extraHeaders:i})}({publicToken:e,metadata:t,accessToken:n,environment:r});if(vr("Plaid Public Token exchanged successfully",{metadata:t,publicToken:e}),await async function(){await Promise.all([Pn.invalidateQueries({queryKey:["integrations"]}),Pn.invalidateQueries({queryKey:["banks/accounts",{}]}),Pn.invalidateQueries({queryKey:["banks/transactions",{}]})])}(),function(e){const t=Tn(e.apiErrorType)&&Tn(e.apiErrorCode),n="RELINK"===lc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}).buttonType;return t&&n}(o))return br({error:new Error("Plaid Item requires relink, plaid reopened automatically"),severity:"error",extraData:{metadata:t,publicToken:e,plaidItem:o}}),{relinkPlaidItemId:o.id};const i=await ud(n,r),s=i?.data?.filter(e=>Cd(e.apiName)&&"ACTIVE"===e.status)||[];return await async function(e,t,n,r,a){const o=n.institution?.name,i=l(e.plaidItemAccounts,t,"id");if(0===i.length)return 0===(e.plaidItemAccounts??[]).length?(br({error:new Error("No accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),async function(e){await td({title:"Uh Oh!",body:"It appears something went wrong fetching the accounts from your bank. Please chat with the support or try again later.",buttons:[{key:Kc,label:"Cancel"},{key:_c,label:"Chat",type:$c}]})===_c&&od({message:{text:`I tried to link with ${e} and no accounts were returned (CODE: BANK_NO_ACCOUNTS).`,attachments:[]}})}(o||"my bank")):void br({error:new Error("No new accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}});if(!i.some(e=>"ACTIVE"===e.status))return br({error:new Error("No new valid accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),td({title:"Uh Oh!",body:`There are no new/valid income or expense accounts in your ${o} account.`,buttons:[{key:Kc,label:"OK"}]});const s=i.filter(e=>!e.isSupported);if(e.plaidItemAccounts&&s&&s.length>0)return br({error:new Error("Accounts saved successfully with unsupported accounts"),severity:"info",extraData:{metadata:n,publicToken:r,plaidItem:e}}),function(e,t,n){const r=e.length;return td({title:"All set! Ready to track your transactions?",body:S("div",{className:id,children:[E(ml,{wrap:"wrap",children:`Your ${n} ${t} ${nd("account","accounts",n)} are now linked. All transactions will be organized into easy-to-understand categories.`}),E(ml,{wrap:"wrap",children:`The following linked ${r>1?"accounts are":"account is"} not supported at this time, so ${r>1?"they":"it"} will remain unsynced.`}),E("ul",{children:e.map(e=>E("li",{children:E(ml,{wrap:"wrap",children:ad(e.apiAccountName??"",e.apiMask??"")})},e.apiMask))})]}),buttons:[{key:_c,label:"Get Started",type:$c}]})}(s,o,e.plaidItemAccounts.length);const c=function(e,t){const n=[];for(const r of e){if(!r.apiMask)continue;const e=t.find(e=>e.mask===r.apiMask&&r.isSupported);e&&n.push({destinationAccount:hd(r),duplicateAccount:e})}return n}(i,a);return c.length>0?async function({institutionName:e,matchingAccountPairs:t,plaidItemAccounts:n}){const r=t.slice(0,3),a=t.length>3;await td({title:"Your transactions are being categorized",body:S("div",{className:lv,children:[E(ml,{wrap:"wrap",children:`Your ${e} account(s) are now linked.`}),E(ml,{wrap:"wrap",children:"Hurdlr has detected that the following accounts may be duplicates of the newly linked accounts."}),S("ul",{children:[r.map(({duplicateAccount:e})=>E("li",{children:E(ml,{wrap:"wrap",children:ad(e?.name??"",e?.mask??"")})},e?.id)),a&&E("li",{children:E(ml,{wrap:"wrap",children:"and more..."})})]}),E(ml,{wrap:"wrap",children:"We suggest you merge these accounts into your newly linked accounts. Would you like to review suggestions?"})]}),buttons:[{key:Kc,label:"No thanks"},{key:_c,label:"Review",type:$c}]})===_c&&await iv({matchingAccountPairs:t,plaidItemAccounts:n})}({institutionName:o??"your bank",matchingAccountPairs:c,plaidItemAccounts:c.map(e=>e.destinationAccount)}):e.plaidItemAccounts?(br({error:new Error("Accounts saved successfully"),severity:"info",extraData:{metadata:n,publicToken:r,plaidItem:e}}),d=o,u=e.plaidItemAccounts.length,td({title:"All set! Ready to track your transactions?",body:`Your ${u} ${d} ${nd("account","accounts",u)} are now linked. All transactions will be organized into easy-to-understand categories.`,buttons:[{key:_c,label:"Get started",type:$c}]})):void 0;var d,u}(o,a,t,e,s),{}}catch(a){return br({error:new Error("Plaid Public Token exchange failed"),severity:"error",extraData:{metadata:t,publicToken:e,error:a}}),await async function(e){await td({title:"Uh Oh!",body:"It appears something went wrong with your connection while linking your bank. Please try again.",buttons:[{key:Kc,label:"Cancel"},{key:_c,label:"Chat",type:$c}]})===_c&&od({message:{text:`I tried to link with ${e} and it failed (CODE: BANK_POST_FAILURE).`,attachments:[]}})}(t.institution?.name||"my bank"),{}}}async function uv(e,t,n){return xn(e)?(vr("Plaid Link exited by user with error",{metadata:t,error:e,linkToken:n}),!1):(vr("Plaid Link exited by user without error",{metadata:t,linkToken:n}),"ITEM_NO_ERROR"===e.error_code||"item-no-error"===e.error_code?(br({error:new Error("Plaid Item sync failed, refreshing Plaid Items"),severity:"error",extraData:{metadata:t,error:e,linkToken:n}}),!0):("INVALID_UPDATED_USERNAME"===e.error_code&&(br({error:new Error("Plaid Item sync failed due to invalid updated username"),severity:"error",extraData:{metadata:t,error:e,linkToken:n}}),await async function(e){const t=await td({title:e||"Invalid Updated Username",body:'Your bank account has an updated username. To fix it, tap "Banks & Integrations", and unlink your old account, so you can relink it with your new username. If you need any assistance, tap "Chat" to chat with a member of our team.',buttons:[{key:Kc,label:"Cancel"},{key:"chat",label:"Chat"},{key:_c,label:"Banks & Integrations",type:$c}]});"chat"===t?od({message:{text:"Please help me with my bank issue (code: INVALID_UPDATED_USERNAME). Thanks!",attachments:[]}}):t!==_c||(e=>{const t=He.getState().drawerHistory;return Object.keys(t).includes(e)})("BanksAndIntegrations")||ki("BanksAndIntegrations")}(t.institution?.name||"Invalid Updated Username")),!1))}const hv="PLAID_LINK_NEW",pv="PLAID_LINK_UPDATE",gv="PLAID_LINK_UNLINK";function mv({plaidEvent:e,plaidItemId:t,apiAccessToken:n,apiErrorCode:r,message:a}){return{eventType:"onPlaidLink",message:a,defaultPrevented:!0,data:{plaidEvent:e,integrationId:t,apiAccessToken:n,apiErrorCode:r}}}const vv=m({});function bv({onPlaidLink:e,children:t}){return E(vv.Provider,{value:{onPlaidLink:e},children:t})}function fv(){return v(vv)}async function yv(e){const{url:t,headers:n}=wr(e);return async function(e){const{authorization:t,extraHeaders:n,params:r,url:a}=e,o=xr({extraHeaders:n,authorization:t});vr("HTTP DELETE Request",{url:a,accessToken:t});try{const e=await fetch(a,{method:"DELETE",headers:o,credentials:"include",body:JSON.stringify(r)});return vr("HTTP DELETE Response",{url:a,status:e.status,statusText:e.statusText}),Tr(e)}catch(i){return Promise.reject(i)}}({url:t,params:e.bodyParams,extraHeaders:n})}const kv=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:e,accessToken:t,endpointManager:Mr(n)};return await Sr(r)};function xv(){return md({mutationFn:kv,onSuccess:()=>{const e=["integrations"];return Pn.invalidateQueries({queryKey:e})}})}const Tv=async({accessToken:e,environment:t})=>{const n={path:"/banks/refresh",accessToken:e,endpointManager:Mr(t)};return await Sr(n)};function Cv(){return md({mutationFn:Tv,onSuccess:()=>{const e=["integrations"];return Pn.invalidateQueries({queryKey:e})}})}const wv=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:{id:String(Bi(e.id)),removeFromApi:!0},accessToken:t,endpointManager:Mr(n)};return await async function(e){return yv(e)}(r)};function Av(){const{mutate:e}=Cv();return md({mutationFn:wv,onSuccess:()=>{const e=["integrations"];return Pn.invalidateQueries({queryKey:e})},onError:async t=>{br({error:new Error("error while deleting Plaid Item"),severity:"error",extraData:{error:t}}),await td({title:"Uh Oh!",body:"It appears something went wrong with your connection while unlinking your bank. Please try again.",buttons:[{key:Kc,label:"Cancel"},{key:_c,label:"Try Again",type:$c}]})===_c&&e()}})}function Ev(e){return new Promise(t=>{window.Plaid.create({token:e,onSuccess:(e,n)=>t({status:"success",public_token:e,metadata:n}),onExit:(e,n)=>t({status:"exit",metadata:n,error:e}),onEvent:(e,t)=>{vr(`Plaid event: ${e}`,{metadata:t,eventName:e})}}).open()})}async function Iv(e,t,n,r){const a=await sv(e,t,n);if(!a)return;const o=await Ev(a);if("success"===o?.status){const{public_token:e,metadata:a}=o;vr("Plaid link successful",{public_token:e,metadata:a});const i=await dv(e,a,t,n);if(i.relinkPlaidItemId)return Iv(i.relinkPlaidItemId,t,n,r)}else if("exit"===o?.status){const{metadata:e,error:t}=o;vr("Plaid link exited",{metadata:e,error:t}),await uv(t,e,a)&&r()}else br({error:new Error("Plaid Link did not return a status and failed to open"),severity:"error",extraData:{plaidItemId:e,plaidLinkStatus:o,token:a}})}function Sv(){const[e,t]=Mc({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=In(),r=Rn(),{mutate:a}=Cv(),{onPlaidLink:o}=fv();return{linkPlaid:e=>{if(Tn(o)){const t=mv(e);o(t)}else Iv(e.plaidItemId?Bi(e.plaidItemId):void 0,n,r,a)},loading:e||Tn(t),hasOnPlaidLinkOverride:Tn(o)}}function Nv(){const[e,t]=Mc({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=In(),r=Rn(),{mutate:a}=Cv(),{apiPartnerName:o}=v(rs),{onPlaidLink:i}=fv();return{linkPlaid:e=>{if(Tn(i)){const t=mv(e);i(t)}else!async function(e,t,n,r,a){const o=await sv(e,t,n);if(!o)return;const i=await Ev(o);if("success"===i?.status){const{public_token:e,metadata:o}=i;vr("Plaid link from search successful",{public_token:e,metadata:o});const l=await async function(e,t,n,r,a){if(t?.institution?.institution_id){const i=await cv(t.institution.institution_id,n,r);if(i)return br({error:new Error("Plaid Item already linked for institution"),severity:"error",extraData:{metadata:t,publicToken:e,plaidItem:i}}),await(o=a,td({title:"Already Linked",body:`It seems that this bank is already linked${o?` with ${o}`:""}. Please tap "Relink" to update the existing linked institution.`,buttons:[{key:Kc,label:"Cancel"},{key:_c,label:"Relink",type:$c}]}))===_c?{relinkPlaidItemId:Bi(i.id)}:{}}var o;return vr("Saving Plaid Public Token from search",{metadata:t,publicToken:e}),dv(e,t,n,r)}(e,o,t,n,r);l.relinkPlaidItemId&&Iv(l.relinkPlaidItemId,t,n,a)}else if("exit"===i?.status){const{metadata:e,error:t}=i;vr("Plaid link from search exited",{metadata:e,error:t}),await uv(t,e,o)&&a()}}(e.plaidItemId?Bi(e.plaidItemId):void 0,n,r,o,a)},loading:e||Tn(t),hasOnPlaidLinkOverride:Tn(i)}}const Pv=Wt(null,Qi,St({position:"absolute",left:1,right:1,bottom:1,width:"calc(100% - 2)",height:"44px",background:"surface.intent.primary",border:"none",borderRadius:0,gap:9,color:"icon.intent.primary",pointerEvents:"all",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.primary.hover",borderColor:"border.intent.primary.hover","& .Tight-text":{color:"typography.intent.primary.hover"}}}}),xo);function Dv(){const{linkPlaid:e,loading:t}=Sv();return S("button",{onClick:()=>e({plaidEvent:hv,message:"Tile Plaid Link button pressed"}),...Pv,disabled:t,children:[E(Nc,{Component:Sc}),E(ml,{intent:"primary",children:"Link Account"})]})}const Rv=St({width:266,minHeight:32});function Mv(){return E(Wa,{styles:Rv})}const Ov=St({backgroundColor:"money.positive.weak"}),Lv=St({backgroundColor:"money.negative.weak"}),Fv=Object.freeze({income:0,expenses:0,netIncome:0,absoluteSum:0}),Bv=({defaultRange:e=Jt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r},isFilling:a}=function({filter:e}){return Fr({filter:e,select:Ic})}({filter:e});let o;return o=t?Xa:r??Fv,S(Kr,{isSample:t,children:[E(Hr,{title:"Profit + Loss"}),E(jr,{children:a?S(qa,{children:[E(Mv,{}),E(Mv,{})]}):S(I,{children:[E(ea,{title:la(o.netIncome),label:"Profit"}),S(na,{children:[E(Ac,{amount:o.income,total:o.absoluteSum,colorCss:Ov,label:"Income"}),E(Ac,{amount:o.expenses,total:o.absoluteSum,colorCss:Lv,label:"Expenses"})]})]})}),t&&E(Ga,{size:"sm"}),n&&E(Dv,{})]})},Uv=({filter:e})=>["reports/cashFlowStatementDirect","reports",{filter:e}],Vv={moneyIn:0,moneyOut:0,netMoneyIn:0};const Wv=async e=>{const t=e.queryKey,n=t[2],r=t[3].accessToken,a=t[3].environment,o={path:"/reports/cashFlowStatementDirect",bodyParams:{exportType:"JSON",...tn(n.filter)},accessToken:r,endpointManager:Mr(a)};return function(e){const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data[0];return t||xn(n)||xn(n.operatingActivities)||!n.operatingActivities.children?Vv:function(e){let t=new L(0),n=new L(0);for(const r of e.children)r.total<0?n=n.plus(L(r.total).abs()):t=t.plus(r.total);return{moneyIn:t.toNumber(),moneyOut:n.toNumber(),netMoneyIn:e.total}}(n.operatingActivities)}(await Sr(o))},Hv=St({backgroundColor:"money.positive.weak"}),qv=St({backgroundColor:"money.negative.weak"}),jv=Object.freeze({moneyIn:0,moneyOut:0,netMoneyIn:0}),zv=({defaultRange:e=Jt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r,isFetched:a},isFilling:o}=function({filter:e}){return Mn({queryKey:Uv({filter:e}),queryFn:Wv})}({filter:e});let i;i=t?$a:r??jv;let l=0;return(t||a)&&(l=Math.abs(i.moneyIn)+Math.abs(i.moneyOut)),S(Kr,{isSample:t,children:[E(Hr,{title:"Cash Flow"}),E(jr,{children:o?S(qa,{children:[E(Mv,{}),E(Mv,{})]}):S(I,{children:[E(ea,{title:la(i.netMoneyIn),label:"Change in Cash"}),S(na,{children:[E(Ac,{amount:i.moneyIn,total:l,colorCss:Hv,label:"Money In"}),E(Ac,{amount:i.moneyOut,total:l,colorCss:qv,label:"Money Out"})]})]})}),t&&E(Ga,{size:"sm"}),n&&E(Dv,{})]})},Kv=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",width:"100%"})),Yv=Wt(null,St({display:"flex",justifyContent:"end"}));function _v({color:e,bulletLabel:t,moneySummary:n}){return S("div",{...Kv,children:[E(Ta,{color:e,label:t}),E("div",{...Yv,children:E(ml,{children:n})})]})}const Gv={total:0,children:[]},Qv=e=>{const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data?.[0];return t||xn(n)||xn(n.expenses)||!n.expenses.children?Gv:{total:n.expenses.total??0,children:(r=n.expenses.children,r.sort((e,t)=>(t.total??0)-(e.total??0)).slice(0,3).map(e=>({name:e.name??"",total:e.total??0})))};var r},Zv=Wt(null,St({display:"flex",gap:"10px",alignItems:"center"})),Xv=St({width:"200px",height:"16px",backgroundColor:"brand.secondary"}),Jv=Wt(null,Xv);function $v({bulletAmount:e=3,shimmer:t=!1}){return E(I,{children:Array.from({length:e},(e,n)=>S("div",{...Zv,children:[E(Ta,{color:fa.var("colors.brand.secondary")}),t?E(Wa,{styles:Xv}):E("div",{...Jv})]},n))})}const eb=Wt(null,St({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"})),tb=[fa.var("colors.brand.primary"),fa.var("colors.brand.success"),fa.var("colors.brand.action")],nb=Object.freeze({total:0,children:[]});function rb({defaultRange:e=Jt.THIS_YEAR,monthIndex:t,isSample:n=!1,showLinkAccountButton:r}){const a=He(e=>e.externalOptions).dataVisualizationColors??tb,{query:{data:o},isFilling:i}=function({filter:e}){return Fr({filter:e,select:Qv})}({filter:e});let l;l=n?Ja:o??nb;const s=void 0===t?"Total Expenses":`${rn[t]} Total`,c=l.children.length>0;return S(Kr,{isSample:n,children:[E(Hr,{title:"Expenses"}),E(jr,{children:i?E(qa,{children:E($v,{shimmer:!0})}):S(I,{children:[E("div",{...eb,children:E(ea,{title:la(l.total),label:s})}),E(na,{children:c?l.children.map((e,t)=>E(_v,{color:a[t],bulletLabel:e.name,moneySummary:la(e.total)},t)):E($v,{})})]})}),n&&E(Ga,{size:"sm"}),r&&E(Dv,{})]})}const ab=Wt(null,St({display:"flex",flexDirection:"column",gap:"10px",maxWidth:"1440px"}));function ob({period:e,handleDateChange:t,todayPeriod:n,showSamples:r,showLinkAccountButton:a}){const o=(i=e.month,{beginDate:Zt(l=e.year,i,1),endDate:Zt(l,i+1,0)});var i,l,s,c,d,u,h,p;return S("div",{...ab,children:[S(qt,{children:[E(Gt,{children:"Monthly Review"}),E(gc,{period:e,setPeriod:t,disableNext:r||(s=e,c=n,h=s.month,p=c.month,h===p&&(d=s.year,u=c.year,d===u)),disablePrev:r})]}),S(vc,{children:[E(Bv,{defaultRange:o,isSample:r,showLinkAccountButton:a}),E(zv,{defaultRange:o,isSample:r,showLinkAccountButton:a}),E(rb,{defaultRange:o,monthIndex:e.month,isSample:r,showLinkAccountButton:a})]})]})}const ib="Oldest to Newest",lb="Newest to Oldest",sb="A-Z",cb="Z-A",db="Lowest to Highest",ub="Highest to Lowest",hb="A-Z",pb="Z-A";function gb(){const[e,t]=f(void 0),n=g(()=>{if(e&&(e.orderBy||e.direction))return e},[e]);return{sortInstance:e,setSortInstance:e=>{(function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in Ai)??!1,n=(e.direction&&e.direction in Ei)??!1;return t&&n})(e)&&t(e)},apiSort:n}}const mb=St({width:"15px",height:"15px",borderRadius:"sm",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,margin:0,position:"relative","&::before":{content:"''",position:"absolute",top:"-10px",left:"-10px",right:"-10px",bottom:"-10px"},_supportHover:{"&[data-is-checked='false']":{backgroundColor:"surface.background.hover"}}}),vb=St({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",background:"surface.foreground"}),bb=St({background:"brand.primary.strong",border:"none"});function fb({checked:e,onClick:t}){const[n,r]=f(e??!1),a=void 0===e?n:e;return E("button",{...Wt(Ot["checkbox-input"],mb,a?bb:vb,To),type:"button",onClick:a=>{void 0===e&&r(!n),t&&t(a)},"data-is-checked":a,children:a&&E(Ol,{Component:Od})})}const yb=Wt(null,St({paddingLeft:"20px",paddingRight:"5px"}));function kb({checked:e,onClick:t}){return E("div",{...yb,children:E(fb,{checked:e,onClick:t})})}const xb=Wt(Ot.text,St({fontSize:"sm",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.66px",maxWidth:"100%"}),Yr);function Tb({children:e}){return E("div",{...xb,children:e})}const Cb=Wt(Ot["date-cell"],St({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"}));function wb({date:e,annotation:t}){return S("div",{...Cb,children:[t&&E(Tb,{children:t}),E(ml,{children:e})]})}const Ab=St({color:"money.negative"}),Eb=St({color:"money.positive"}),Ib=e=>e.replaceAll("_"," ").toLowerCase().split(" ").map(e=>Cn(e)?e:e[0].toUpperCase()+e.slice(1)).join(" ");function Sb({transaction:e}){const t=(e=>{let t;switch(e.type){case"EXPENSE":t=(e=>{const t=e.amount>0;let n;return n=t?"Expense Refund":e.children?.length>0?"Split Expense":"Expense",{type:"EXPENSE",displayName:n,css:t?Eb:Ab}})(e);break;case"REVENUE":t=(e=>{const t=e.amount<0;return{type:"REVENUE",displayName:t?"Income Refund":"Income",css:t?Ab:Eb}})(e);break;case"BANK_TRANSFER":t={type:"BANK_TRANSFER",displayName:"Bank Transfer",css:e.amount<0?Ab:Eb};break;case"PAYOUT":t={type:"PAYOUT",displayName:"Payout",css:e.amount<0?Ab:Eb};break;case"TAX_PAYMENT":t={type:"TAX_PAYMENT",displayName:"Tax Payment",css:Ab};break;case"INVOICE_PAYMENT":t=(e=>{let t="Invoice Payment",n=Eb;return e.amount<0&&(t="Invoice Payment Refund",n=Ab),{type:"INVOICE_PAYMENT",displayName:t,css:n}})(e);break;default:t=(e=>({type:e.type,displayName:Ib(e.type),css:e.amount<0?Ab:Eb}))(e)}return t})(e),n=Wt(Ot["transaction-type-label"],t.css),r=E("span",{...n,children:t.displayName});return E(wb,{date:e.date,annotation:r})}function Nb({label:e,subLabel:t}){return S(I,{children:[E(ha,{children:e}),E(ga,{children:t})]})}function Pb({bankTransaction:e}){return E(Nb,{label:e.description,subLabel:e.bankAccount?.name})}function Db(e){return sa(Sp(e.amount))}function Rb({transaction:e}){return E(ml,{children:Db(e)})}const Mb=Wt(null,St({padding:"0 25px",height:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"}));function Ob({annotation:e,accountName:t}){return S("div",{...Mb,children:[e&&E(ga,{children:e}),t&&E(ha,{children:t})]})}const Lb=Wt(Ot["cell-button"],St({border:"none",backgroundColor:"transparent",padding:"0 25px",gap:"10px",margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",flexDirection:"row",flex:1,outline:"none",borderRadius:"md",boxShadow:"0 0 0 0 transparent","&:focus-visible":{transition:"none",position:"relative"},"&:focus-visible::before":{content:"''",position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:"md",outline:"4px solid",outlineColor:"border.layout",pointerEvents:"none"},_supportHover:{backgroundColor:"surface.intent.action.hover"},"&[data-state='open']":{backgroundColor:"surface.intent.action.active"},"& .Tight-text":{position:"relative"},"& .Tight-text::after":{content:"''",position:"absolute",bottom:0,left:0,width:0,height:"1px",backgroundColor:"currentColor",transition:"width 100ms ease-out",_supportHover:{width:"100%",transition:"width 300ms ease-out"}},"&[data-state='open'] > .Tight-text::after":{width:"100%",transition:"width 300ms ease-out"}}),To),Fb=T(function({children:e,...t},n){return E("button",{ref:n,...Lb,...t,children:e})}),Bb=async({data:e,accessToken:t,environment:n})=>Vb({data:{data:e},accessToken:t,environment:n}),Ub=async({data:e,accessToken:t,environment:n})=>Bb({data:[e],accessToken:t,environment:n}),Vb=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/banks/transactions",bodyParams:e,accessToken:t,endpointManager:ho(n)};return await Ir(r)};function Wb(){return md({onSuccess:async()=>{const e=["banks/transactions"];return vr("mutation successful, invalidating BT queries"),Pn.invalidateQueries({queryKey:e}).catch(e=>br({error:e,severity:"error"}))},mutationFn:Bb})}function Hb(){return md({onSuccess:async()=>(vr("mutation successful, invalidating BT queries"),Pn.invalidateQueries({predicate:e=>e.queryKey.includes("tasks")||e.queryKey.includes("banks/transactions")||e.queryKey.includes("reports")}).catch(e=>br({error:e,severity:"error"}))),mutationFn:Ub})}function qb({transaction:e,parentTransaction:t,accountNo:n,accountName:r}){const{startPrefetch:a,cancelPrefetch:o}=_o({prefetchFn:Uo(Qp,Zp)}),{mutate:i}=Hb(),l=void 0!==t;return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:e=>E(Fb,{...e,onMouseEnter:a,onMouseLeave:o,children:E(ha,{children:sg(n,r)})})}),E(fg,{onClick:l?n=>{if(n?.id&&l){const{id:r,children:a}=t,{id:o}=e,l=a.map(e=>e.id===o?{...e,glAccountId:n.id.toString()}:e);i({id:r,children:l})}}:t=>{i({id:e.id,glAccountId:t.id})},types:og})]})}function jb({transaction:e,parentTransaction:t}){const{startPrefetch:n,cancelPrefetch:r}=_o({prefetchFn:Uo(pu,gu)}),a=e.category?.name??"Uncategorized",{mutate:o}=Hb(),i=void 0!==t;return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:e=>S(Fb,{...e,onMouseEnter:n,onMouseLeave:r,children:[E(Nc,{Component:Zu(a)}),E(ha,{children:a})]})}),E(Hu,{onClick:i?n=>{if(n?.id&&i){const{id:r,children:a}=t,{id:i}=e,l=a.map(e=>e.id===i?{...e,categoryId:n.id.toString()}:e);o({id:r,children:l})}}:t=>{t?.id&&o({id:e.id,categoryId:t.id.toString()})}})]})}const zb=Wt(null,St({flexDirection:"column",textAlign:"start",width:"100%",overflow:"hidden"})),Kb=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",width:"100%",gap:"10px"}));function Yb({transaction:e}){const t=e.children.map(e=>e?.category?.name).filter(e=>void 0!==e),n=new Set(t),r=[...n].join(", "),a=nd("Category","Categories",n.size,!0);return E(kl,{children:S("div",{...Kb,children:[E(Nc,{Component:Xu}),S("div",{...zb,children:[E(ha,{children:a}),E(ga,{children:r})]})]})})}function _b({transaction:e,parentTransaction:t}){return e.children?.length>0?E(Yb,{transaction:e}):E(jb,{transaction:e,parentTransaction:t})}function Gb({transaction:e,parentTransaction:t}){switch(e.type){case"EXPENSE":return E(_b,{transaction:e,parentTransaction:t});case"BANK_TRANSFER":return E(Ob,{annotation:Ad(e.amount),accountName:e.bankAccount?.name});default:return E(qb,{transaction:e,parentTransaction:t,accountNo:e.glAccount?.accountNo,accountName:e.glAccount?.name})}}function Qb({name:e}){return E(I,{children:e&&E(ml,{children:e})})}const Zb={PARTNER_REVIEW_REQUIRED:"PARTNER_REVIEW_REQUIRED",USER_REVIEW_REQUIRED:"USER_REVIEW_REQUIRED",ACCOUNTANT_REVIEW_REQUIRED:"ACCOUNTANT_REVIEW_REQUIRED",RECONCILIATION_STAGED:"RECONCILIATION_STAGED",RECONCILED:"RECONCILED",RECONCILIATION_DISCREPANCY:"RECONCILIATION_DISCREPANCY"},Xb=[{name:"Partner Review Required",value:Zb.PARTNER_REVIEW_REQUIRED},{name:"User Review Required",value:Zb.USER_REVIEW_REQUIRED},{name:"Accountant Review Required",value:Zb.ACCOUNTANT_REVIEW_REQUIRED},{name:"Reconciliation Staged",value:Zb.RECONCILIATION_STAGED},{name:"Reconciled",value:Zb.RECONCILED},{name:"Reconciliation Discrepancy",value:Zb.RECONCILIATION_DISCREPANCY}],Jb=fo(e=>h.createElement("svg",{width:13,height:15,viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M0.743464 14.9687V0.96875H11.6465L9.22218 4.59886L11.6465 8.24166H0.743464",stroke:"#182428",strokeMiterlimit:10})),"Flag"),$b=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M8.32497 15.1744C12.1492 15.1744 15.2494 12.0742 15.2494 8.24998C15.2494 4.42573 12.1492 1.32556 8.32497 1.32556C4.50071 1.32556 1.40054 4.42573 1.40054 8.24998C1.40054 12.0742 4.50071 15.1744 8.32497 15.1744Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M4.54623 8.25001L7.06541 10.7692L12.1037 5.73083",stroke:"#182428",strokeMiterlimit:10})),"CircleCheck"),ef=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M7.81985 0.464722V3.49919",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M7.81985 12.0008V15.0353",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M15.1051 7.75H12.0706",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M3.56907 7.75H0.534607",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9702 2.59967L10.8227 4.74724",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M4.81706 10.7528L2.66949 12.9004",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9702 12.9004L10.8227 10.7528",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M4.81706 4.74724L2.66949 2.59967",stroke:"black",strokeMiterlimit:10})),"Processing"),tf=St({maxWidth:"100%",width:"fit-content",display:"inline-flex",padding:"4px 5px",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background",cursor:"pointer","&:focus":{outline:"none"},"&[data-state='closed']":{},"& .Tight-sub-label":{color:"typography.base"},"& .Tight-medium-icon > path":{stroke:"icon.base"}}),nf=St({background:"surface.intent.secondary",border:"{borderWidths.sm} solid",borderColor:"border.intent.secondary","& .Tight-sub-label":{color:"typography.intent.secondary"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary"},_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary.hover"}}}),rf=St({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.action",background:"surface.intent.action","& .Tight-sub-label":{color:"typography.intent.action"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action"},_supportHover:{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action.hover"}}}),af=St({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.success",background:"surface.intent.success","& .Tight-sub-label":{color:"typography.intent.success"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success"},_supportHover:{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success.hover"}}}),of=St({background:"surface.intent.warning",border:"{borderWidths.sm} solid",borderColor:"border.intent.warning","& .Tight-sub-label":{color:"typography.intent.warning"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning"},_supportHover:{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning.hover"}}}),lf=St({background:"surface.intent.danger",border:"{borderWidths.sm} solid",borderColor:"border.intent.danger","& .Tight-sub-label":{color:"typography.intent.danger"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger"},_supportHover:{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger.hover"}}}),sf=Wt(Ot.badge,tf),cf=Wt(null,Gr),df=Wt(null,To),uf=Wt(Ot["neutral-badge"],nf),hf=Wt(Ot["highlight-badge"],rf),pf=Wt(Ot["success-badge"],af),gf=Wt(Ot["warning-badge"],of),mf=Wt(Ot["critical-badge"],lf);function vf({type:e,children:t,onClick:n,disabled:r,popupTriggerProps:a}){let o;switch(e){case"critical":o=mf;break;case"warning":o=gf;break;case"neutral":o=uf;break;case"success":o=pf;break;case"highlight":o=hf}const i=Kt([sf,cf,o,df]);return E("button",{...i,onClick:n,disabled:r,...a,children:t})}const bf=[{status:"USER_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Flag to Accountant"},{status:"RECONCILED",displayName:"Reconciled"}],ff=[{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"RECONCILIATION_DISCREPANCY",displayName:"Discrepancy"},{status:"USER_REVIEW_REQUIRED",displayName:"Flag to User"},{status:"RECONCILED",displayName:"Reconciled"}];function yf({onClick:e}){const t=Dl(),{userRole:n}=v(rs),r=(e=>{switch(e){case"OWNER":default:return bf;case"ACCOUNTANT":return ff}})(n)||[];return E(ql,{children:E(su,{children:r.map(({status:n,displayName:r})=>E(Tu,{onClick:()=>(e(n),void t.setOpen(!1)),children:r},n))})})}function kf({status:e,transactionId:t}){const[n,r]=f(!1),{mutate:a}=Hb(),o=()=>{r(!1)},i=()=>{r(!n)},{userRole:l}=v(rs),{text:s,type:c,Icon:d}=((e,t)=>{const n=((e,t)=>{switch(t){case"ACCOUNTANT":return e===Zb.ACCOUNTANT_REVIEW_REQUIRED;case"OWNER":return e===Zb.USER_REVIEW_REQUIRED}})(e,t),r=(l=e,"OWNER"===t&&l===Zb.ACCOUNTANT_REVIEW_REQUIRED),a=((e,t)=>"ACCOUNTANT"===t&&e===Zb.USER_REVIEW_REQUIRED)(e,t),o=/* @__PURE__ */(e=>"RECONCILIATION_DISCREPANCY"===e)(e),i=/* @__PURE__ */(e=>"RECONCILED"===e)(e);var l;let s,c,d;return r?(s="Pending Review",c=E(Nc,{Component:ef}),d="neutral"):a?(s="Pending User Review",c=E(Nc,{Component:ef}),d="neutral"):n?(s="Needs Review",c=E(Nc,{Component:Jb}),d="warning"):o?(s="Discrepancy",c=E(Nc,{Component:Fd}),d="critical"):i?(s="Reconciled",c=E(Nc,{Component:$b}),d="success"):(s="Processing",c=E(Nc,{Component:ef}),d="neutral"),{text:s,type:d,Icon:c}})(e,l);return!t||((u=t).startsWith(Oi.TRANSACTION_LINE_ITEM)||u.startsWith(Oi.PROCESSOR_TRANSACTION))?null:S(Pl,{open:n,blockInteraction:!1,onOpenChange:o,enableClickMiddleware:!1,children:[E(Rl,{children:e=>S(vf,{type:c,popupTriggerProps:e,onClick:i,children:[d,E(ga,{children:s})]})}),E(yf,{onClick:e=>{a({id:t,reviewStatus:e}),o()}})]});var u}function xf({status:e,transactionId:t}){return E(kf,{status:e,transactionId:t},t)}const Tf=fo(e=>h.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{clipPath:"url(#clip0_9779_2940)"},h.createElement("path",{d:"M11.9147 7.99997L6.31472 2.39996L0.714716 7.99997",stroke:"#182428",strokeMiterlimit:10})),h.createElement("defs",null,h.createElement("clipPath",{id:"clip0_9779_2940"},h.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowUp");function Cf({row:e}){const t=e.getIsExpanded();return e.getCanExpand()?E(Zl,{"aria-label":t?"Collapse row":"Expand row","aria-expanded":t,children:E(Eo,{Component:t?Tf:Yh})}):E(Zl,{active:!1,children:E(Eo,{Component:ko})})}function wf({row:e}){return E(Cf,{row:e})}const Af=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M0.495239 8.15601H14.7767",strokeMiterlimit:10})),"Dash"),Ef=Wt(null,St({stroke:"icon.base.weak"}));function If({hasConversation:e,hasUnread:t=!1}){return E(I,{children:e?E(Ws,{hasUnread:t}):E("div",{"data-testid":"no-conversations-dash",children:E(Ol,{Component:Af,stylists:[Ef]})})})}function Sf({conversationId:e}){const{query:{data:t}}=ti(e??null),{startPrefetch:n,cancelPrefetch:r}=ri(),{startPrefetch:a,cancelPrefetch:o}=qi(),i=Tn(t),l=i&&"READ"==t?.readStatus,s=y(()=>{Tn(e)&&(n({id:e}),a({id:e}))},[e,n,a]),c=y(()=>{Tn(e)&&(r(),o())},[e,r,o]);return E("div",{onMouseEnter:s,onMouseLeave:c,children:E(If,{hasConversation:i,hasUnread:!l})})}const Nf=_(),Pf=[Nf.display({id:je.SELECT,header:()=>null,cell:({row:e})=>void 0===e.getParentRow()?E(kb,{checked:e.getIsSelected(),onClick:e.getToggleSelectedHandler()},e.original.id):null,maxSize:35,meta:{clickable:!0}}),Nf.accessor("date",{id:je.DATE,cell:e=>E(kl,{children:E(Sb,{transaction:e.row.original})}),header:()=>E(es,{columnName:"Date",sortDef:"DATE",sortAscDisplay:ib,sortDescDisplay:lb}),size:130,maxSize:144}),Nf.accessor("description",{id:je.DESCRIPTION,cell:e=>E(kl,{children:E(Pb,{bankTransaction:e.row.original})}),header:()=>E(es,{columnName:"Source",sortDef:"DESCRIPTION",sortAscDisplay:sb,sortDescDisplay:cb}),size:180}),Nf.accessor("amount",{id:je.AMOUNT,cell:e=>E(kl,{children:E(Rb,{transaction:e.row.original})}),header:()=>E(es,{columnName:"Amount",sortDef:"AMOUNT",sortAscDisplay:db,sortDescDisplay:ub}),size:130,maxSize:180}),Nf.accessor("category.id",{id:je.CATEGORY,cell:({row:e})=>E(Gb,{transaction:e.original,parentTransaction:e.getParentRow()?.original}),header:()=>E(es,{columnName:"Category"}),size:130,meta:{clickable:!0}}),Nf.accessor(e=>e.classSegments[0]?.id,{id:je.CLASS_SEGMENT,cell:e=>E(kl,{children:E(Qb,{name:e.row.original.classSegments[0]?.name})}),header:()=>E(es,{columnName:"Business"}),size:130}),Nf.accessor("reviewStatus",{id:je.REVIEW_STATUS,cell:e=>E(kl,{children:E(xf,{status:e.getValue(),transactionId:e.row.original.id})}),header:()=>E(es,{columnName:"Reviewed",sortDef:"REVIEW_STATUS",sortAscDisplay:hb,sortDescDisplay:pb}),size:130,maxSize:160,meta:{clickable:!0}}),Nf.display({id:je.COMMENTS,cell:e=>{const t=e.row.original;return E(kl,{alignVariant:"center",children:E(Sf,{conversationId:t.conversation?.id})})},header:()=>E(es,{columnName:"Comments"}),size:110,maxSize:110,meta:{clickable:!0}}),Nf.display({id:je.EXPAND,cell:e=>E(wf,{row:e.row}),size:40,maxSize:60})];function Df(e){return e?Pf.filter(t=>e.includes(t.id)):Pf}function Rf(e){if(e)return Object.values(je).reduce((t,n)=>(t[n]=e.includes(n),t),{})}const Mf=[];function Of({transactions:e,columns:t}){return G({data:e??Mf,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??Mf.length,columns:Df(t),getCoreRowModel:Q(),getRowCanExpand:e=>e.original.children.length>0,getSubRows:e=>e.children.map(e=>{return t=e,{...t,matchingBankTransaction:null,rule:null,tax:{paymentInfo:null},customData:null,children:[],conversation:null};var t}),getExpandedRowModel:Z(),paginateExpandedRows:!1,getRowId:e=>e.id,state:{columnOrder:t,columnVisibility:Rf(t)}})}const Lf=[je.COMMENTS,je.DATE,je.DESCRIPTION,je.AMOUNT,je.CATEGORY,je.REVIEW_STATUS];function Ff(e,t){return ki("BankTransactionFormRouter",{routeProps:{transactionId:e,initialTab:t}})}function Bf(e){const t=e.row,n=e.column.columnDef.meta?.clickable,r=t.getCanExpand(),a="BANK_TRANSFER"===t.original.type,o="category"===e.column.id&&(r||a);if("comments"===e.column.id){const e=t.getParentRow();Ff(e?.original.id??t.original.id,"conversation")}else if(!n||o)if(r)t.toggleExpanded();else{const e=t.getParentRow();Ff(e?.original.id??t.original.id)}}function Uf({rowData:e,hasSelect:t=!0}){const{startPrefetch:n,cancelPrefetch:r}=Mi(),a=y(()=>n({id:e.original.id}),[n,e.original]);return E(yi,{rowData:e,onMouseEnter:a,onMouseLeave:r,onCellClick:Bf,shouldDisplayDivider:n=>{return r=n,a=t,o=e.getVisibleCells().length,!(0===r||a&&1===r||r===o-1||a||1===r);var r,a,o}})}function Vf(){return S(I,{children:[E(xs,{Component:$b}),E(ha,{wrap:"wrap",children:"All caught up"}),E(ga,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const Wf=Wt(Ot["button-warning"],St({color:"typography.intent.warning",border:"1px solid {colors.border.intent.warning}",backgroundColor:"surface.intent.warning",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-text":{color:"typography.intent.warning.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.warning.active",borderColor:"border.intent.warning.active","& .Tight-text":{color:"typography.intent.warning.active"}},"& .Tight-text":{color:"typography.intent.warning"}}));function Hf({children:e,stylists:t=[],...n}){return E(ol,{stylists:[Wf,...t],...n,children:e})}function qf(){const{linkPlaid:e,loading:t}=Sv();return E(Hf,{onClick:()=>e({plaidEvent:hv,message:"Plaid Link button pressed"}),disabled:t,children:E(ha,{children:"Link your bank"})})}const jf=Wt(null,St({whiteSpace:"wrap"}));function zf(){return S(I,{children:[E(xs,{Component:Ku}),E(ha,{stylists:[jf],children:"Your bank transactions will be categorized for you"}),E(ga,{wrap:"wrap",children:"If any require your review, they'll be flagged here."}),E(qf,{})]})}const Kf=St({animation:"spin",display:"flex",alignItems:"center",justifyContent:"center",width:"15px",height:"15px"});function Yf(){return S(I,{children:[E("div",{className:Kf,children:E(Nc,{Component:ef})}),E(ha,{children:"Transactions are being processed"}),E(ga,{children:"Any transactions that require review will show up here."})]})}const _f=St({minWidth:"900px"});function Gf({hasLinkedAccount:e,sortInstance:t,setSortInstance:n,isFilling:r,paginationControls:a,transactions:o}){const i=function({transactions:e}){return function({transactions:e,columns:t}){return Of({transactions:e,columns:t?[...t,je.EXPAND]:void 0})}({transactions:e,columns:Lf})}({transactions:o}),{query:{data:l},isFilling:s}=Pi({limit:1,filter:{status:{in:["ACTIVE","INACTIVE","REMOVED"]}}}),c=!xn(l?.data?.[0])&&!s,d=function(e,t,n){let r;return e||t?!e||n||t?e&&n&&!t&&(r=E(Vf,{})):r=E(Yf,{}):r=E(zf,{}),r}(e??!1,o.length>0,c);return S("div",{className:_f,children:[E("div",{id:oo}),S(Ao.Provider,{value:a,children:[S(qt,{children:[E(Gt,{children:"Transactions For Your Review"}),E(Is,{children:E(Do,{})})]}),E(ul,{dashboard:"businessOwnerDashboard",children:r?E(Bo,{}):S(I,{children:[E(hl.Provider,{value:{sortInstance:t,setSortInstance:n},children:E(li,{headerGroups:i.getHeaderGroups()})}),xn(d)?E(ci,{children:i.getRowModel().rows.map(e=>E(Uf,{rowData:e,hasSelect:!1},e.id))}):E(ks,{children:d})]})})]})]})}function Qf(){const{sortInstance:e,setSortInstance:t,apiSort:n}=gb(),{query:{data:r},isFilling:a,paginationControls:o}=Pi({filter:lo,sort:n,limit:10}),i=r?.data??co,{hasPlaidLinkedBankAccount:l,isFilling:s}=qp();return E(Gf,{sortInstance:e,setSortInstance:t,isFilling:a||s,paginationControls:o,transactions:i,hasLinkedAccount:l??!1})}const Zf=Wt(Ot["button-action"],St({color:"typography.intent.action",border:"1px solid {colors.border.intent.action}",backgroundColor:"surface.intent.action",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-text":{color:"typography.intent.action.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.active",borderColor:"border.intent.action.active","& .Tight-text":{color:"typography.intent.action.active"}},"& .Tight-text":{color:"typography.intent.action"}}));function Xf({children:e,stylists:t=[],...n}){return E(ol,{stylists:[Zf,...t],...n,children:e})}const Jf=fo(e=>h.createElement("svg",{stroke:"currentColor",width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M4.66504 7.91458H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M4.66504 10.6418H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M12.8125 3.95627V13.9937H2.1875V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10}),h.createElement("path",{d:"M12.8125 3.95627V4.54998H9.26877V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10})),"Doc"),$f=e=>{switch(e){case"MESSAGE_REVIEW":return{Icon:Bs,buttonText:"Respond"};case"TRANSACTION_REVIEW":return{Icon:Jb,buttonText:"Review"};case"LINK_BANK":return{Icon:Ku,buttonText:"Link"};case"DELETE_OR_RELINK":case"UNLINK_RELINK":case"OPEN_BANK":return{Icon:Ku,buttonText:"Fix"};case"RELINK":return{Icon:Ku,buttonText:"Relink"};case"CHAT":return{Icon:Fd,buttonText:"Learn more"};case"ONBOARDING_FORM":return{Icon:Jf,buttonText:"Complete"};case"ALL_CAUGHT_UP":case"NO_ACTION_ITEMS":return{Icon:$b,buttonText:""};default:return{Icon:Fd,buttonText:""}}},ey=Wt(null,St({display:"flex",alignItems:"center",gap:"15px"})),ty=Wt(null,St({width:"20px",height:"20px"}));function ny({title:e,type:t}){const{Icon:n}=$f(t);return S("div",{...ey,children:[E(Nc,{Component:n,stylists:[ty]}),E(ha,{wrap:"wrap",children:e})]})}const ry=Wt(null,St({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"5px",flex:"1 1 0",minWidth:"200px",width:"100%"}));function ay({title:e,description:t,type:n}){return S("div",{...ry,children:[E(ny,{title:e,type:n}),E(ga,{wrap:"wrap",children:t})]})}const oy=Wt(Ot["banner-button"],St({display:"flex",width:"202px",justifyContent:"flex-end",alignItems:"center",gap:"15px",flexShrink:"0"})),iy=Wt(Ot["banner-button-text"]),ly=Wt(Ot["banner-button-icon"]);function sy({priority:e,type:t,handleClick:n}){const{buttonText:r}=$f(t),{Button:a}=(e=>{switch(e){case"URGENT":return{Button:qc};case"HIGH":return{Button:Hf};case"MEDIUM":return{Button:Xf};default:return{Button:ol}}})(e);return S(a,{onClick:n,stylists:[oy],children:[E(ha,{stylists:[iy],children:r}),E(Eo,{stylists:[ly],Component:ko})]})}const cy=Rt({base:{display:"flex",flexDirection:"row",padding:"15px",justifyContent:"space-between",alignItems:"center",alignSelf:"stretch",minWidth:"350px",borderRadius:"lg",border:"1px solid",backgroundColor:"surface.foreground"},variants:{priority:{HIGH:{borderColor:"border.intent.warning"},MEDIUM:{borderColor:"border.intent.action"},LOW:{borderColor:"border.intent.success"},URGENT:{borderColor:"border.intent.danger"},DEFAULT:{borderColor:"border.intent.secondary"}}}}),dy={HIGH:Ot["banner-high"],MEDIUM:Ot["banner-medium"],LOW:Ot["banner-low"],URGENT:Ot["banner-urgent"]};function uy({task:e,handleClick:t}){const{name:n,description:r,shortDescription:a,type:o,priority:i}=e,l=th()?a:r,s=Wt(Ot.banner,dy[i],cy({priority:i}));return S("div",{...s,children:[E(ay,{title:n,description:l,type:o}),E(sy,{priority:i,type:o,handleClick:t})]})}function hy(e,t){od({message:{text:`Please help me with my ${e} bank issue: (code: ${t}). Thanks!`,attachments:[]}})}function py(e,t,n,r,a){return()=>td({title:e?.shortMessage(t??"your bank")||"Bank Error",body:e?.longMessage({apiInstitutionName:t??"your bank",apiPartnerName:n,isMobile:r}),buttons:a})}function gy(e,t,n,r,a,o){return{alert:py(e,t,a,o,[{key:Kc,label:"Cancel"},{key:ac.CHAT,label:"Chat",type:$c}]),actions:{[ac.CHAT]:()=>hy(t,r)}}}function my(e){const{mutateAsync:t}=Av(),n=In(),r=Rn(),{apiPartnerName:a}=v(rs),o=th(),{linkPlaid:i,loading:l,hasOnPlaidLinkOverride:s}=Sv(),{linkPlaid:c,loading:d}=Sv();if(xn(e))return gy(lc({apiErrorType:"UNKNOWN",apiErrorCode:"UNKNOWN"}),"UNKNOWN",0,"UNKNOWN","",!1);const u=lc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}),h="ITEM_LOCKED"===e.apiErrorCode;switch(u.buttonType){case ac.DELETE_OR_RELINK:case ac.RELINK:return l?null:(g=i,m=a,b=o,{alert:py(u,(p=e).apiInstitutionName,m,b,[{key:Kc,label:"Cancel"},{key:_c,label:"Relink",type:$c}]),actions:{success:()=>{g({plaidEvent:pv,plaidItemId:p.id,apiAccessToken:p.apiAccessToken,apiErrorCode:p.apiErrorCode,message:"Relink Bank Error button pressed"})}}});case ac.UNLINK_RELINK:return d?null:function(e,t,n,r,a,o,i){return{alert:py(e,t.apiInstitutionName,a,o,[{key:Kc,label:"Cancel"},{key:ac.CHAT,label:"Chat"},{key:_c,label:"Unlink and Relink",type:$c}]),actions:{success:async()=>{i||await n({id:String(t.id)}),r({plaidEvent:"PLAID_LINK_UNLINK_RELINK",plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Unlink and Relink Bank Error button pressed"})},[ac.CHAT]:()=>hy(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,t,c,a,o,s);case ac.OPEN_BANK:return l?null:function(e,t,n,r,a,o,i,l){return{alert:py(e,t.apiInstitutionName,i,l,[{key:Kc,label:"Cancel"},{key:ac.CHAT,label:"Chat"},{key:ac.RELINK,label:"Relink"},{key:_c,label:"Go To Bank",type:$c}]),actions:{success:async()=>{const e=await Wc({institutionId:t.apiInstitutionId??void 0,accessToken:r,environment:a}),o=n?e.map.accountLockedUrl:e.map.accountSetupUrl;window.open(o,"_blank")},[ac.RELINK]:()=>{o({plaidEvent:pv,plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Relink button pressed from Bank Error alert"})},[ac.CHAT]:()=>hy(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,h,n,r,i,a,o);case ac.UNLINK_ONLY:return function(e,t,n,r,a,o,i){return{alert:py(e,t.apiInstitutionName,a,o,[{key:Kc,label:"Cancel"},{key:_c,label:"Unlink",type:$c}]),actions:{success:()=>{i?r({plaidEvent:gv,plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Unlink Bank Error button pressed"}):n({id:String(t.id)})}}}}(u,e,t,c,a,o,s);default:return gy(u,e.apiInstitutionName,e.apiErrorType,e.apiErrorCode,a,o)}var p,g,m,b}const vy=async({alert:e,actions:t})=>{const n=await e();if("string"==typeof n&&t[n])try{await t[n]()}catch(r){br({error:new Error("error while handling bank error alert action"),severity:"error",extraData:{error:r}})}};function by({task:e}){const{linkPlaid:t,loading:n}=Sv(),{loading:r}=Nv(),a=my(e?.meta?.plaidItem),o=n&&"RELINK"===e.type,i=r&&"LINK_BANK"===e.type&&!1,l="RELINK"!==e.type&&"LINK_BANK"!==e.type&&xn(a);return o||i||l?null:E(uy,{task:e,handleClick:()=>{"RELINK"===e.type?t({plaidEvent:pv,plaidItemId:e?.meta?.plaidItem?.id,apiAccessToken:e?.meta?.plaidItem?.apiAccessToken,apiErrorCode:e?.meta?.plaidItem?.apiErrorCode,message:"Fix Relink Bank Error button pressed"}):"LINK_BANK"===e.type?ki("NewConnection"):Tn(a)&&(vr("Plaid Banner Bank Error clicked",{plaidItem:e?.meta?.plaidItem}),vy(a))}})}const fy=Wt(Ot.banner,Ot["banner-default"],cy({priority:"DEFAULT"}));function yy(){const e=th()?"We'll let you know of new items":"We'll let you know if a new action item comes up";return E("div",{...fy,children:E(ay,{title:"All Caught Up",description:e,type:"ALL_CAUGHT_UP"})})}const ky=Wt(Ot.banner,Ot["banner-default"],cy({priority:"DEFAULT"}));function xy(){const e=th()?"No action items yet":"No action items yet as your bookkeeper is setting up your books";return E("div",{...ky,children:E(ay,{title:"Onboarding In Progress",description:e,type:"NO_ACTION_ITEMS"})})}const Ty=St({width:"100%",height:72,minWidth:"300px"});function Cy(){return S(I,{children:[E(Wa,{styles:Ty}),E(Wa,{styles:Ty}),E(Wa,{styles:Ty})]})}function wy({taskBanners:e,handleScrollAction:t,isWaitingForPlaidItemAccountsSync:n,isFilling:r}){const a=e.length>0;return r?E(Cy,{}):a?e.map(e=>{if(void 0===po[e.type]||"ONBOARDING_FORM"===e.type&&xn(e.actionLink))return null;if("LINK_BANK"===e.type||"BANK_ERROR"===e.type||Object.values(ac).includes(e.type))return E(by,{task:e},e.id);const n=e.actionLink,r=Tn(n)?()=>window.open(n,"_blank"):()=>t(e.type);return E(uy,{task:e,handleClick:r},e.id)}):E(n?xy:yy,{})}function Ay(){const e=dd({params:{filter:{status:{equal:"ACTIVE"}}},select:e=>({...e,hasActiveBankAccount:e?.data??!1})});return S(ll,{onClick:()=>{ki(e?"BanksAndIntegrations":"NewConnection")},children:[E(Eo,{Component:Sc}),E(Cl,{children:"Banks & Integrations"})]})}function Ey(){return Fc({filter:{status:{equal:"ACTIVE"}}},{select:e=>({multiAccountIntegrations:e.data?.filter(e=>["PLAID","UNIT"].includes(e.apiName))||[],integrations:e.data?.filter(e=>!["PLAID","UNIT"].includes(e.apiName))||[],cursor:e.cursor})})}const Iy=Wt(Ot["business-owner-dashboard"],St({gap:10,display:"flex",flexDirection:"column",width:"100%",maxWidth:1440})),Sy=St({display:"flex",width:"100%",justifyContent:"center"}),Ny=e=>{const t=io[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}},Py={status:{in:["ACTIVE","INACTIVE"]}},Dy={filter:{status:{in:["ACTIVE"]}}};function Ry({period:e,onChangePeriod:t}){const{sortInstance:n,setSortInstance:r,apiSort:a}=function(){const[e,t]=f(void 0);return{sortInstance:e,setSortInstance:y(e=>{!function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in Go)??!1,n=(e.direction&&e.direction in Qo)??!1;return t&&n}(e)?t(void 0):t(e)},[t]),apiSort:e}}(),{query:{data:o},isFilling:i,paginationControls:l}=$o({limit:10,sort:a,filter:so}),s=o?.data??uo,c=th(),{query:{data:d},isFilling:u}=(h={select:e=>((e,t)=>{const n=xn(r=e)||xn(r.data)?[]:[...r.data].sort((e,t)=>mo[e.priority]-mo[t.priority]);var r;return t?n.filter(e=>"MESSAGE_REVIEW"===e.type||"BANK_ERROR"===e.type):n})(e,c)},p=Dy,Mn({...h,queryKey:p?go(p):["tasks",{}],queryFn:vo}));var h,p;const{query:{data:m}}=dd({select:e=>{return{...e,plaidItemAccountsReadyToSync:Hp(e.data),hasPlaidLinkedBankAccount:(t=e.data,void 0!==t?.find(e=>wd(e.apiName)))};var t}}),{query:{data:v}}=Bc({select:e=>({...e,data:e?.data?.filter(({status:e,apiErrorType:t,apiErrorCode:n})=>"ACTIVE"===e&&t&&n)})}),b=th(),k=g(()=>{let e=[];const t=v?.data;t&&(e=t.map(e=>cc(e)));let n=[];!1===m?.hasPlaidLinkedBankAccount&&(n=[sc]);const r=d??[];return[...e,...n,...r]},[d,m,v]),x=function(){const{query:{data:e}}=Pi({filter:Py,limit:1});return(e?.data?.length??0)>0}(),T=function(e,t){const n=!(void 0===t||t.hasPlaidLinkedBankAccount&&!t.plaidItemAccountsReadyToSync);return!e&&n}(x,m),C=/* @__PURE__ */new Date,w={month:C.getMonth(),year:C.getFullYear()};const[A,N]=Sl(w,e,t),P=(D=A.month,{beginDate:Zt((R=A.year)-1,D+1,1),endDate:Zt(R,D+1,0)});var D,R;return E("div",{className:Sy,children:S("div",{...Iy,children:[S(qt,{children:[E(Gt,{children:"Action Items"}),E(Ay,{})]}),E(ro,{children:E(wy,{taskBanners:k,handleScrollAction:Ny,isWaitingForPlaidItemAccountsSync:!x&&!0===m?.plaidItemAccountsReadyToSync,isFilling:u})}),!b&&S(I,{children:[E(ob,{period:A,handleDateChange:e=>{var t,n;(t=w).year===(n=e).year&&n.month>t.month||n.year>t.year||N(e)},todayPeriod:w,showSamples:T,showLinkAccountButton:T&&!m?.plaidItemAccountsReadyToSync}),E(qt,{children:E(Gt,{children:"Financial Summary"})}),E(rc,{isSample:T,period:A}),E(to,{filter:P,isSample:T})]}),E(Ps,{sortInstance:n,setSortInstance:r,conversations:s,paginationControls:l,isFilling:i,isMobile:b}),!b&&E(Qf,{})]})})}function My(e){return E(yr||I,{children:e.children})}function Oy({children:e}){return E(My,{children:E("div",{className:Ft(Ot.component),children:e})})}function Ly(e){return E(Oy,{children:E(Ry,{...e})})}function Fy(e){const t={...e,selectedValues:e=>e.filter(e=>e.modelKey===t.key),createFilter:e=>({...e,modelKey:t.key,id:Te()}),searchFunc:e.searchFunc?e.searchFunc:e=>{return n=e,t.name.toLowerCase().includes(n.toLowerCase());var n}};return t}function By(e,t){return e?{...e,...t}:t}function Uy(e){return Fy({key:"category",name:"Category",possibleValues:e})}function Vy(){const e="in";return{values:[...Xb].map(t=>({name:t.name,value:{reviewStatus:{name:t.name,value:{[e]:[t.value]}}}}))}}const Wy=({displayInput:e,parsedInput:t,operator:n,model:r,handleFilterClick:a})=>{if(void 0===r.operators)return;const{label:o,value:i}=n;a(r.createFilter({name:`${o} ${e}`,value:{[r.key]:{name:"",value:{[i]:t}}}}))},Hy=u.object({amount:u.number({message:"Required"}),amountOperator:u.object({value:u.enum(["equal","notEqual","greaterThan","lessThan","greaterThanEqual","lessThanEqual"]),label:u.enum(["Equals","Does not equal","Greater than","Less than","Greater than or equal to","Less than or equal to"])})}),qy=Wt(null,St({display:"flex",flexDirection:"column",gap:"15px",marginInline:"40px",marginTop:"35px"})),jy=Wt(null,St({display:"flex",flexDirection:"row",gap:"16px",justifyContent:"right",marginBottom:"20px"}));function zy({children:e,title:t,onCancelClick:n,onSubmit:r}){return S("form",{onSubmit:e=>{e.preventDefault(),r()},...qy,children:[E(ha,{children:t}),e,S("div",{...jy,children:[E(Ym,{showIcon:!1,onClick:n}),E(Ld,{showIcon:!1,textContent:"Apply"})]})]})}function Ky({model:e,handleFilterClick:t}){const n=Dl(),r=function({model:e,handleFilterClick:t}){return jm({defaultValues:(n=e?.operators?.[0],{amount:null,amountOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:Hy},onSubmit:n=>{if(null===n.value.amount)return;const r={displayInput:ia(n.value.amount,{cents:"always",dollarSign:!0,signage:"default"}),parsedInput:Np(n.value.amount),operator:n.value.amountOperator,model:e,handleFilterClick:t};Wy(r)}});var n}({model:e,handleFilterClick:t});return S(zy,{title:"Amount...",onCancelClick:()=>n.setOpen(!1),onSubmit:r.handleSubmit,children:[E(r.AppField,{name:"amountOperator",children:t=>E(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:2,cols:3})}),E(r.AppField,{name:"amount",children:e=>E(e.EditableAmountField,{label:"Total",autofocus:!0})})]})}const Yy=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"greaterThan",label:"Greater than"},{value:"greaterThanEqual",label:"Greater than or equal to"},{value:"lessThan",label:"Less than"},{value:"lessThanEqual",label:"Less than or equal to"}],_y=u.object({date:u.string().refine(e=>""!==e,{message:"Required"}),dateOperator:u.object({value:u.enum(["equal","notEqual","greaterThan","lessThan","greaterThanEqual","lessThanEqual"]),label:u.enum(["On","Not on","After","Before","On or after","On or before"])})});function Gy({model:e,handleFilterClick:t}){const n=Dl(),r=function({model:e,handleFilterClick:t}){return jm({defaultValues:(n=e?.operators?.[0],{date:"",dateOperator:n||{value:"equal",label:"On"}}),validators:{onSubmit:_y},onSubmit:n=>{const r={displayInput:cn(hn(n.value.date)),parsedInput:n.value.date,operator:n.value.dateOperator,model:e,handleFilterClick:t};Wy(r)}});var n}({model:e,handleFilterClick:t});return S(zy,{title:"Date...",onCancelClick:()=>n.setOpen(!1),onSubmit:r.handleSubmit,children:[E(r.AppField,{name:"dateOperator",children:t=>E(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:2,cols:3})}),E(r.AppField,{name:"date",children:e=>E(e.DateInput,{label:"Date",autofocus:!0,editable:!0})})]})}const Qy=[{value:"equal",label:"On"},{value:"notEqual",label:"Not on"},{value:"greaterThan",label:"After"},{value:"greaterThanEqual",label:"On or after"},{value:"lessThan",label:"Before"},{value:"lessThanEqual",label:"On or before"}],Zy=u.object({description:u.string().refine(e=>""!==e,{message:"Required"}),descriptionOperator:u.object({value:u.enum(["equal","notEqual","contain"]),label:u.enum(["Equals","Does not equal","Contains"])})});function Xy({model:e,handleFilterClick:t}){const n=Dl(),r=function({model:e,handleFilterClick:t}){return jm({defaultValues:(n=e?.operators?.[0],{description:"",descriptionOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:Zy},onSubmit:n=>{const r={displayInput:`"${n.value.description}"`,parsedInput:n.value.description,operator:n.value.descriptionOperator,model:e,handleFilterClick:t};Wy(r)}});var n}({model:e,handleFilterClick:t});return S(zy,{title:"Description...",onCancelClick:()=>n.setOpen(!1),onSubmit:r.handleSubmit,children:[E(r.AppField,{name:"descriptionOperator",children:t=>E(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:1,cols:3})}),E(r.AppField,{name:"description",children:e=>E(e.TextAreaInput,{label:"Description",placeholder:"Search by keywords or phrases...",autofocus:!0,resizeable:!1})})]})}const Jy=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}];function $y(e){return Fy({key:"bankAccount",name:"Bank Account",possibleValues:e})}const ek=async e=>{const t=e.queryKey,n={path:"/clientMgmt/businesses",accessToken:t[2].accessToken,environment:t[2].environment},r=await Ko(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Fi({id:e.id,prefix:"CLASS_SEGMENT"})})):[];return{...r,data:a}};function tk(e){return Fy({key:"classSegments",name:"Business",possibleValues:e})}function nk(e){return Fy({key:"customer",name:"Customer",possibleValues:e})}function rk(e){return Fy({key:"vendor",name:"Vendor",possibleValues:e})}const ak={EXPENSE:"EXPENSE",REVENUE:"REVENUE",BANK_TRANSFER:"BANK_TRANSFER",TAX_PAYMENT:"TAX_PAYMENT",INVOICE_PAYMENT:"INVOICE_PAYMENT",PAYOUT:"PAYOUT",PAYROLL_PAYMENT:"PAYROLL_PAYMENT",BILL_PAYMENT:"BILL_PAYMENT",LOAN_PAYMENT:"LOAN_PAYMENT"},ok=[{name:"Expense",value:ak.EXPENSE},{name:"Income",value:ak.REVENUE},{name:"Bank Transfer",value:ak.BANK_TRANSFER},{name:"Tax Payment",value:ak.TAX_PAYMENT},{name:"Invoice Payment",value:ak.INVOICE_PAYMENT},{name:"Payout",value:ak.PAYOUT},{name:"Payroll Payment",value:ak.PAYROLL_PAYMENT},{name:"Bill Payment",value:ak.BILL_PAYMENT},{name:"Loan Payment",value:ak.LOAN_PAYMENT}];function ik(){return{values:[...ok].map(e=>function(e){const t="in";return{name:e.name,value:{type:{name:e.name,value:{[t]:[e.value]}}}}}(e))}}const lk={ACTIVE:"ACTIVE",INACTIVE:"INACTIVE",REMOVED:"REMOVED"},sk=[{name:"Active",value:lk.ACTIVE},{name:"Inactive",value:lk.INACTIVE},{name:"Removed",value:lk.REMOVED}],ck=e=>e.map(e=>({id:e.id,status:lk.INACTIVE}));function dk(){const e="in";return{values:[...sk].map(t=>({name:t.name,value:{status:{name:t.name,value:{[e]:[t.value]}}}}))}}const uk=u.object({notes:u.string().refine(e=>""!==e,{message:"Required"}),notesOperator:u.object({value:u.enum(["equal","notEqual","contain"]),label:u.enum(["Equals","Does not equal","Contains"])})});function hk({model:e,handleFilterClick:t}){const n=Dl(),r=function({model:e,handleFilterClick:t}){return jm({defaultValues:(n=e?.operators?.[0],{notes:"",notesOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:uk},onSubmit:n=>{const r={displayInput:`"${n.value.notes}"`,parsedInput:n.value.notes,operator:n.value.notesOperator,model:e,handleFilterClick:t};Wy(r)}});var n}({model:e,handleFilterClick:t});return S(zy,{title:"Notes...",onCancelClick:()=>n.setOpen(!1),onSubmit:r.handleSubmit,children:[E(r.AppField,{name:"notesOperator",children:t=>E(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:1,cols:3})}),E(r.AppField,{name:"notes",children:e=>E(e.TextAreaInput,{label:"Note",placeholder:"Search by keywords or phrases...",autofocus:!0,resizeable:!1})})]})}const pk=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}],gk=(mk={bankAccount:!0,vendor:!0,classSegments:!0,customer:!0,category:!0,glAccount:!0,rule:!0,matchingBankTransaction:!0,invoiceItem:!0,bill:!0,payroll:!0,conversation:!0},Object.keys(mk));var mk;function vk(e){return Fy({key:"glAccount",name:"GL Account",possibleValues:e})}function bk(){const{filters:e,addFilters:t,removeFilter:n}={filters:He(e=>e.transactionsDashFilters),addFilters:He(e=>e.addTransactionsDashFilters),removeFilter:He(e=>e.removeTransactionsDashFilter)},{getCategories:r,getBankAccounts:a,getClassSegments:o,getVendors:i,getCustomers:l,getGlAccounts:c}=function(){const e=function(){const{query:{data:e},isFilling:t}=mu(),n=e?.data,r=g(()=>n?.map(e=>{const t=e.name??"Uncategorized";var n;return{name:t,value:{category:{name:t,value:{id:{in:[(n=e).id?n.id.toString():""]}}}}}}),[n]);return y(()=>({values:r??[],isFilling:t}),[r,t])}(),t=function(){const{query:{data:e},isFilling:t}=dd(),n=e?.data,r=g(()=>n?.map(e=>{const t=e?.name,n=e?.mask,r=ad(t,n);return{name:r,value:{bankAccount:{name:r,value:{id:{in:[e.id]}}}}}}),[n]);return y(()=>({values:r??[],isFilling:t}),[r,t])}(),n=function(){const{query:{data:e},isFilling:t}=Nm(),n=e?.data,r=g(()=>n?.map(e=>{const t=e.name??"Unknown Customer";return{name:t,value:{customer:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return y(()=>({values:r??[],isFilling:t}),[r,t])}(),r=function(){const{query:{data:e},isFilling:t}=bm(),n=e?.data,r=g(()=>n?.map(e=>{const t=e.name??"Unknown Vendor";return{name:t,value:{vendor:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return y(()=>({values:r??[],isFilling:t}),[t,r])}(),a=function(){const{query:{data:e},isFilling:t}=Mn({queryKey:["clientMgmt/businesses","classSegments"],queryFn:ek}),n=e?.data,r=g(()=>n?.map(e=>{const t=e.name??"Unknown Class Segment";return{name:t,value:{classSegments:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return y(()=>({values:r??[],isFilling:t}),[r,t])}();return{getCategories:e,getBankAccounts:t,getCustomers:n,getVendors:r,getClassSegments:a,getGlAccounts:function(){const{query:{data:e},isFilling:t}=$p(),n=g(()=>e?.map(e=>{const t=e.name;return{name:t,value:{glAccount:{name:t,value:{id:{in:[e.id]}}}}}}),[e]);return y(()=>({values:n??[],isFilling:t}),[n,t])}()}}(),d=g(()=>({reviewStatus:Fy({key:"reviewStatus",name:"Review Status",possibleValues:Vy}),amount:Fy({key:"amount",name:"Amount",operators:Yy,ModalComponent:Ky}),bankAccount:$y(a),category:Uy(r),classSegments:tk(o),customer:nk(l),date:Fy({key:"date",name:"Date",operators:Qy,ModalComponent:Gy}),description:Fy({key:"description",name:"Description",operators:Jy,ModalComponent:Xy}),glAccount:vk(c),notes:Fy({key:"notes",name:"Notes",operators:pk,ModalComponent:hk}),status:Fy({key:"status",name:"Status",possibleValues:dk}),vendor:rk(i),type:Fy({key:"type",name:"Type",possibleValues:ik})}),[a,o,r,i,l,c]),u=g(()=>[d.reviewStatus,d.amount,d.bankAccount,d.category,d.classSegments,d.customer,d.date,d.description,d.glAccount,d.notes,d.status,d.type,d.vendor],[d.reviewStatus,d.amount,d.bankAccount,d.category,d.classSegments,d.customer,d.date,d.description,d.glAccount,d.notes,d.status,d.type,d.vendor]),h=g(()=>function(e){const t={...e};return gk.forEach(e=>{const n=t[e];t[e]=s(n)?{expand:!0}:{...n,expand:!0}}),t}(e.reduce(fk,{})),[e]),p=y(e=>d[e],[d]);return{filters:e,filterModels:u,addFilters:t,removeFilter:n,apiFilters:h,getModel:p}}function fk(e,t){const n={},r=t.value;var a,o,i,l;return r.date&&(n.date=(a=e.date,o=r.date.value,a?{...a,...o}:o)),r.amount&&(n.amount=(i=e.amount,l=r.amount.value,i?{...i,...l}:l)),r.description&&(n.description=r.description.value),r.category&&(n.category=function(e,t){return By(e,t)}(e.category,r.category.value)),r.reviewStatus&&(n.reviewStatus=function(e,t){return e?{...e,...t}:t}(e.reviewStatus,r.reviewStatus.value)),r.bankAccount&&(n.bankAccount=function(e,t){return By(e,t)}(e.bankAccount,r.bankAccount.value)),r.classSegments&&(n.classSegments=function(e,t){return By(e,t)}(e.classSegments,r.classSegments.value)),r.glAccount&&(n.glAccount=function(e,t){return By(e,t)}(e.glAccount,r.glAccount.value)),r.type&&(n.type=function(e,t){return e?{...e,...t}:t}(e.type,r.type.value)),r.status&&(n.status=function(e,t){return e?{...e,...t}:t}(e.status,r.status.value)),r.vendor&&(n.vendor=function(e,t){return By(e,t)}(e.vendor,r.vendor.value)),r.customer&&(n.customer=function(e,t){return By(e,t)}(e.customer,r.customer.value)),r.notes&&(n.notes=r.notes.value),{...e,...n}}const yk=Wt(Ot["filter-search-bar"],St({display:"flex",flexDirection:"row",alignItems:"center",width:"100%",height:"100%",paddingLeft:"5px"})),kk=Wt(null,St({stroke:"icon.base",flexShrink:0,marginRight:"15px"})),xk=Wt(null,St({display:"flex",flex:"1 0 0",flexDirection:"column",justifyContent:"center",border:"none",outline:"none",background:"transparent",height:"100%",fontSize:"sm",fontWeight:"sm"}));function Tk({search:e,setSearch:t}){return S("div",{...yk,children:[E(Eo,{stylists:[kk],Component:Rh}),E("input",{...xk,value:e,onChange:e=>t(e.target.value),placeholder:"Filter and Search",onKeyDown:_d})]})}const Ck=St({backgroundColor:"overlay",display:"flex",justifyContent:"center",alignItems:"center"}),wk=Wt(null,Ck);function Ak({children:e,clickHandler:t}){const n=Dl();return t||(t=()=>{n.setOpen(!1)}),E(he,{lockScroll:!0,...wk,onClick:t,children:e})}const Ek=Rt({base:{display:"flex",justifyContent:"center",flexDirection:"column",minHeight:"200px",height:"fit-content",backgroundColor:"surface.background",borderRadius:"md",padding:"16px",position:"relative"},variants:{width:{lg:{minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"}},sm:{minWidth:{sm:"360px",base:"100dvw"},maxWidth:{sm:"392px",base:"100dvw"}}}}});function Ik({width:e="lg",children:t}){const n=Wt(Ot["modal-popup"],Ek({width:e}));return E("div",{...n,onClick:e=>{e.stopPropagation()},children:t})}function Sk({model:e,handleFilterClick:t}){return S(Pl,{placement:"right-start",modal:!0,children:[E(Rl,{children:t=>E(Tu,{...t,children:E(ha,{children:e.name})})}),E(rh,{children:E(Ak,{children:E(Ik,{children:e.ModalComponent&&E(e.ModalComponent,{model:e,handleFilterClick:t})})})})]})}function Nk({filterModels:e,addFilters:t}){const n=Dl(),r=e=>{t([e]),n.setOpen(!1)};return E(ql,{children:E(su,{children:e.map(e=>{const t=e.possibleValues?e.possibleValues():null;return xn(t)?E(Sk,{model:e,handleFilterClick:r},e.key):E(Pk,{model:e,handleFilterClick:r},e.key)})})})}function Pk({model:e,handleFilterClick:t}){if(void 0===e.possibleValues)return;const{values:n,isFilling:r}=e.possibleValues();return E(Fu,{triggerChildren:E(Uu,{icon:e.icon,displayLabel:e.name}),popupChildren:r?E(Eu,{}):E(Dk,{values:n,handleValueClick:n=>{const r=e.createFilter(n);t(r)}})},e.key)}function Dk({values:e,handleValueClick:t}){return E(su,{children:e.length>0?e.map(e=>E(Rk,{handleClick:()=>t(e),value:e},e.name)):E(wu,{text:"No data"})})}function Rk({value:e,handleClick:t}){return E(Tu,{onClick:t,children:E(ha,{children:e.name})})}const Mk=Wt(Ot["filter-bar"],St({display:"flex",flex:"1 0 0",flexDirection:"column",height:"35px",padding:"0 10px",justifyContent:"center",alignItems:"flex-start",gap:"10px",borderRadius:"sm",background:"surface.background",cursor:"pointer"}));function Ok({filterModels:e,addFilters:t}){const[n,r]=f("");return E(I,{children:S(Pl,{modal:!1,placement:"bottom-start",children:[E(Rl,{children:e=>E("div",{...Mk,...e,children:E(Tk,{search:n,setSearch:r})})}),E(Nk,{filterModels:e,addFilters:t})]})})}const Lk=St({display:"flex",width:"14px",height:"14px",padding:"2px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"12px",borderRadius:"sm"}),Fk=Wt(Ot["filter-pill"],St({display:"inline-flex",height:"25px",padding:"5px 10px",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"md",border:"{borderWidths.lg} solid",borderColor:"border.intent.secondary",background:"surface.intent.secondary",fontSize:"sm",fontWeight:"sm",lineHeight:"14px",color:"typography.intent.secondary"})),Bk=Wt(null,St({border:"none",background:"none",padding:0,cursor:"pointer"})),Uk=Wt(null,St({maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"}));function Vk({text:e,onClickRemove:t}){return S("div",{...Fk,children:[E("div",{...Uk,children:e}),E("button",{...Bk,onClick:t,children:E(Ol,{Component:Ml,stylists:[Wt(null,Lk)]})})]})}function Wk({filters:e,getModel:t,removeFilter:n}){return e.map((e,r)=>{const a=t(e.modelKey),o=`${a?.name}: ${e.name}`;return E(Vk,{text:o,onClickRemove:()=>{n(r)}},e.id)})}const Hk=Wt(Ot["dashboard-header"],St({display:"flex",flexDirection:"column",alignItems:"flex-start",paddingBottom:"20px",gap:"20px"})),qk=Wt(null,St({display:"flex",alignItems:"center",gap:"20px",padding:"15px 15px 0 15px",width:"100%"})),jk=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap",gap:"12px",paddingLeft:"15px",paddingRight:"15px",width:"100%"}));function zk({filterModels:e,filters:t,addFilters:n,removeFilter:r,getModel:a}){return S("div",{...Hk,children:[S("div",{...qk,children:[E(Ok,{filterModels:e,addFilters:n}),E(Do,{})]}),E("div",{...jk,children:E(Wk,{filters:t,getModel:a,removeFilter:r})})]})}const Kk=ze.filter(e=>e!=je.COMMENTS),Yk=Wt(null,St({display:"flex",justifyContent:"center",alignItems:"center",padding:"16px"}));function _k(){return E("div",{...Yk,children:E(Do,{})})}function Gk(){return S(I,{children:[E(Nc,{Component:Eh}),E(ha,{wrap:"wrap",children:"No transactions found"}),E(ga,{wrap:"wrap",children:"Try a different set of filters."})]})}const Qk=m({resetSelected:void 0});function Zk({Icon:e,label:t,children:n,onClick:r}){return n?S(Pl,{placement:"bottom-start",children:[E(Rl,{children:n=>S(Zl,{popupTriggerProps:n,children:[e&&E(Nc,{Component:e}),E(Cl,{children:t})]})}),n]}):S(Zl,{onClick:r,children:[e&&E(Nc,{Component:e}),E(Cl,{children:t})]})}const Xk=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M10.6196 14.2124H4.3803C4.06894 14.2128 3.7693 14.0937 3.54327 13.8795C3.31724 13.6654 3.18207 13.3726 3.16568 13.0617L2.61591 3.22968H12.384L11.8342 13.0617C11.8179 13.3726 11.6827 13.6654 11.4567 13.8795C11.2306 14.0937 10.931 14.2128 10.6196 14.2124Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M1.3949 3.22968H13.605",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M6.27894 0.787598H8.72097C9.0448 0.787598 9.35537 0.91624 9.58435 1.14522C9.81334 1.37421 9.94198 1.68478 9.94198 2.00861V3.22963H5.05792V2.00861C5.05792 1.68478 5.18656 1.37421 5.41555 1.14522C5.64453 0.91624 5.9551 0.787598 6.27894 0.787598Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M9.09821 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M5.90167 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10})),"Delete");function Jk({transactions:e,id:t,label:n}){const{mutate:r}=Wb(),a=Dl(),{resetSelected:o}=v(Qk);return t in Zb?E(Tu,{onClick:()=>(t=>{if(e.length>0){const n=((e,t)=>e.map(e=>({id:e.id,reviewStatus:t})))(e,t);r(n)}a.setOpen(!1),o&&o()})(t),children:n}):null}const $k=fo(e=>h.createElement("svg",{width:16,height:15,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M6.36217 8.45534H7.95444C8.20781 8.45534 8.45081 8.35469 8.62998 8.17552C8.80914 7.99636 8.9098 7.75336 8.9098 7.49998C8.9098 7.24661 8.80914 7.00361 8.62998 6.82444C8.45081 6.64528 8.20781 6.54463 7.95444 6.54463H7.31753C7.06416 6.54463 6.82116 6.44397 6.64199 6.26481C6.46283 6.08564 6.36217 5.84265 6.36217 5.58927C6.36217 5.33589 6.46283 5.09289 6.64199 4.91373C6.82116 4.73456 7.06416 4.63391 7.31753 4.63391H8.9098",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M7.63599 3.36011V4.63392",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M7.63599 8.45532V9.72913",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M2.54074 14.1875L4.23491 12.9137L5.93545 14.1875L7.62962 12.9137L9.33015 14.1875L11.0307 12.9137L12.7312 14.1875L13.3681 13.5506V0.8125H1.90384V13.5506L2.54074 14.1875Z",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"})),"Expenses"),ex=[{id:"delete",label:"Delete",Icon:Xk,component:function({transactions:e,...t}){const{mutate:n}=Wb(),r=()=>{const t=ck(e);n(t)};return E(Zk,{...t,onClick:()=>{return t=e.length,n=r,void(t>0&&td({title:"Delete transactions",body:`Are you sure you want to delete ${t} transactions?`,buttons:[{key:Kc,label:"Cancel"},{key:Yc,label:"Delete",type:ed}]}).then(e=>{e===Yc&&n()}));var t,n}})}},{id:"recategorize-expenses",label:"Recategorize",Icon:$k,filter:e=>"EXPENSE"===e.type,component:function({transactions:e,label:t,...n}){const{mutate:r}=Wb(),a=e.length;return a>0&&E(Zk,{label:`${t} ${nd("Expense","Expenses",a,!0)}`,...n,children:E(Hu,{onClick:function(t){var n,a;t?.id&&r((n=e,a=t.id.toString(),n.map(e=>({id:e.id,categoryId:a}))))}})})}},{id:"review",label:"Change Review Status",Icon:$b,subActions:[{id:"USER_REVIEW_REQUIRED",label:"Needs Review",component:Jk},{id:"RECONCILIATION_DISCREPANCY",label:"Discrepancy",component:Jk},{id:"RECONCILED",label:"Reconciled",component:Jk}]},{id:"more",label:"More",Icon:Eh,subActions:[{id:"recategorize-revenue",component:function({transactions:e}){const t=Dl(),{mutate:n}=Wb(),{resetSelected:r}=v(Qk),a="Recategorize "+nd("Revenue","Revenues",e.length,!0);return E(Fu,{triggerChildren:E(Uu,{displayLabel:a}),popupChildren:E(fg,{onClick:function(a){var o,i;n((o=e,i=a.id,o.map(e=>({id:e.id,glAccountId:i})))),t.setOpen(!1),r&&r()},types:og})})},filter:e=>"REVENUE"===e.type}]}];function tx({subActionList:e}){return E(su,{children:e})}function nx({subActions:e,transactions:t,label:n,Icon:r}){const a=g(()=>e.map(e=>{const{component:n,id:r,filter:a,label:o}=e,i=t.filter(e=>!a||a(e));return i.length>0?E(n,{id:r,transactions:i,label:o},r):null}).filter(e=>null!==e),[e,t]);return E(Zk,{label:n,Icon:r,children:E(ql,{children:a.length>0?E(tx,{subActionList:a}):E(Tu,{children:E(ml,{children:"No Actions Available for Selection"})},"no-actions")})})}const rx=Wt(Ot["bulk-select"],St({display:"flex",gap:"15px",flexDirection:"row",alignItems:"center",height:"20px",justifyContent:"flex-start"}));function ax({table:e}){const t=e.getSelectedRowModel(),n=g(()=>t.rows.map(e=>e.original),[t]),r=t.rows.length,a=r>0,o=g(()=>({resetSelected:()=>e.resetRowSelection(!0)}),[e]);return S("div",{...rx,children:[E(kb,{checked:e.getIsAllRowsSelected(),onClick:e.getToggleAllRowsSelectedHandler()}),E(Qk.Provider,{value:o,children:a&&S(I,{children:[E(ha,{children:`${r} selected`}),ex.map(e=>{const{component:t,subActions:r,id:a,filter:o,...i}=e,l=n.filter(e=>!o||o(e));return r?E(nx,{subActions:r,transactions:n,...i},a):t&&E(t,{transactions:l,...i},a)})]})})]})}function ox({transactions:e,columns:t,filterState:n,hasLinkedBankAccount:r}){const a=function({transactions:e,columns:t}){const n=Of({transactions:e,columns:t?[je.SELECT,...t,je.EXPAND]:void 0});return function(e,t){const n=!xn(t.getColumn(qe.SELECT)),r=p(n?e:null);if(n){if(r.current!==e&&void 0!==r.current){const e=t.getSelectedRowModel().rows.map(e=>e.id).reduce((e,t)=>(e[t]=!0,e),{});t.setRowSelection(e)}r.current=e}}(e,n),n}({transactions:e,columns:t});let o;return r||0!==e?.length?"FILTERS_MATCHED_NONE"===n?o=E(Gk,{}):r&&0===e?.length&&(o=E(Yf,{})):o=E(zf,{}),S(ul,{dashboard:"transactionDashboard",children:[xn(o)&&E(ax,{table:a}),E(li,{headerGroups:a.getHeaderGroups()}),xn(o)?E(ci,{children:a.getRowModel().rows.map(e=>E(Uf,{rowData:e},e.id))}):E(ks,{children:o})]})}function ix({limit:e=10,columns:t=Kk}){const{sortInstance:n,setSortInstance:r,apiSort:a}=gb(),{filters:o,filterModels:i,addFilters:l,removeFilter:s,apiFilters:c,getModel:d}=bk(),u={limit:e,sort:a,filter:{...c}},{isFilling:h,paginationControls:p,query:{data:g,isError:m,error:v}}=Pi(u),b=g?.data,{hasPlaidLinkedBankAccount:f}=qp(),y=f??!1;if(m)return E("div",{children:`Error: ${v?.message}`});if(h)return E(Bo,{});if(void 0!==b){const e=function(e,t){let n;return n=0===e?"FILTERS_NOT_APPLIED":e>0&&0===t?"FILTERS_MATCHED_NONE":"FILTERS_MATCHED_ANY",n}(o.length,b.length);return E(I,{children:S(Ao.Provider,{value:p,children:[E(zk,{filterModels:i,addFilters:l,filters:o,removeFilter:s,getModel:d}),E(hl.Provider,{value:{sortInstance:n,setSortInstance:r},children:E(ox,{hasLinkedBankAccount:y,filterState:e,transactions:b,columns:t})}),E(_k,{})]})})}return"zero state"}const lx=e=>E(Oy,{children:E(ix,{...e})}),sx=Rt({base:{display:"flex",flexDirection:"row",border:"{borderWidths.lg} solid",borderColor:"border.layout"},variants:{width:{full:{width:"100%"}}}});function cx({width:e,children:t}){return E("div",{className:sx({width:e}),children:t})}function dx({options:e,handleClick:t,selected:n}){return E(cx,{width:"full",children:e.map(e=>E(jg,{option:e,handleClick:t,selected:n,width:"full",backgroundColor:"foreground"},e.value))})}const ux=St({display:"flex",flexDirection:"column",padding:"15px"});function hx({task:e}){return E("div",{className:ux,children:E(by,{task:e})})}const px=St({padding:"20px 15px 14px 15px",backgroundColor:"surface.foreground"}),gx=St({padding:"15px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",backgroundColor:"surface.foreground",display:"flex",flexDirection:"column",gap:"5px"}),mx=St({width:"120px",height:"20px"}),vx=St({width:"80px",height:"12px"}),bx=St({width:"150px",height:"16px"}),fx=St({display:"flex",flexDirection:"column",gap:"15px",marginTop:"15px"}),yx=St({userSelect:"none",cursor:"pointer"});function kx(){return S("div",{className:fx,children:[S("div",{className:yx,children:[E(ui,{alignment:"horizontal",color:"strong"}),E("div",{className:px,children:E(Wa,{styles:mx})}),S("div",{className:gx,children:[E(Wa,{styles:vx}),E(Wa,{styles:bx})]}),S("div",{className:gx,children:[E(Wa,{styles:vx}),E(Wa,{styles:bx})]}),E(ui,{alignment:"horizontal",color:"strong"})]}),S("div",{className:yx,children:[E(ui,{alignment:"horizontal",color:"strong"}),E("div",{className:px,children:E(Wa,{styles:mx})}),S("div",{className:gx,children:[E(Wa,{styles:vx}),E(Wa,{styles:bx})]}),S("div",{className:gx,children:[E(Wa,{styles:vx}),E(Wa,{styles:bx})]})]})]})}function xx({children:e}){return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:e=>E(Zl,{popupTriggerProps:e,children:E(Eo,{Component:Eh})})}),E(ql,{children:e})]})}const Tx=fo(e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},h.createElement("path",{d:"M14.075 2.10645H0.924988V5.09395H14.075V2.10645Z",strokeMiterlimit:10}),h.createElement("path",{d:"M14.075 5.09375H0.924988V14.0625H14.075V5.09375Z",strokeMiterlimit:10}),h.createElement("path",{d:"M3.3125 8.08105H4.5125",strokeMiterlimit:10}),h.createElement("path",{d:"M5.70624 8.08105H6.89999",strokeMiterlimit:10}),h.createElement("path",{d:"M8.10004 8.08105H9.29379",strokeMiterlimit:10}),h.createElement("path",{d:"M10.4875 8.08105H11.6875",strokeMiterlimit:10}),h.createElement("path",{d:"M10.4875 11.0752H11.6875",strokeMiterlimit:10}),h.createElement("path",{d:"M3.3125 11.0752H4.5125",strokeMiterlimit:10}),h.createElement("path",{d:"M5.70624 11.0752H6.89999",strokeMiterlimit:10}),h.createElement("path",{d:"M8.10004 11.0752H9.29379",strokeMiterlimit:10}),h.createElement("path",{d:"M3.91254 0.3125V3.3",strokeMiterlimit:10}),h.createElement("path",{d:"M7.5 0.3125V3.3",strokeMiterlimit:10}),h.createElement("path",{d:"M11.0875 0.3125V3.3",strokeMiterlimit:10})),"Date"),Cx=St({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),wx=St({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),Ax=St({display:"flex",flexDirection:"column",gap:"12px"}),Ex=St({display:"flex",flexDirection:"row",gap:"10px"}),Ix=St({display:"flex",flexDirection:"column",gap:"10px"}),Sx=({acknowledged:e,setAcknowledged:t})=>S("div",{className:Ax,children:[E(ml,{wrap:"wrap",children:"The selected start date is after the existing start date. Transactions before the new start date will be hidden."}),S("div",{className:Ex,children:[E(fb,{checked:e,onClick:()=>t(!e)}),E(ml,{wrap:"wrap",children:"I understand."})]})]});function Nx({bankAccounts:e}){const{apiPartnerName:t}=v(rs),n=e.reduce((e,t)=>{const n=hn(t.tranStartDate||""),r=hn(e.tranStartDate||"");return n&&r&&sn(n,r)?t:e}).tranStartDate||"",r=((e,t)=>{const{mutate:n}=Td();return jm({defaultValues:{tranStartDate:t},onSubmit:t=>{var r,a;td({title:"Start Date Updated",body:S("div",{className:Ix,children:[E(ml,{wrap:"wrap",children:"Your start dates have been updated and your transactions are being removed in the background."}),E(ml,{wrap:"wrap",children:"This process may take a few minutes to complete, but you may close this alert."})]}),buttons:[{label:"Done",key:_c,type:$c}]}),n((r=e,a=t.value.tranStartDate,r.map(e=>({id:Bi(e.id),tranStartDate:a,duplicateBankAccountIds:[]}))))}})})(e,n),a=Dl(),o=()=>{a.setOpen(!1)},[i,l]=f(!1),{query:{data:s}}=Bc(),c=s?.data?.find(t=>t.id===(e[0]?.integration.id??""))?.apiInstitutionName||"bank",d=hn(e.reduce((e,t)=>{const n=hn(t.tranMinStartDate||""),r=hn(e.tranMinStartDate||"");return n&&r&&sn(n,r)?t:e}).tranMinStartDate||""),u=1===e.length?`${t} can pull your transactions for your ${ad(e[0]?.name,e[0]?.mask)} account dating back to ${fn(d)}.`:`${t} can pull your transactions for your ${c} account(s) dating back to ${fn(d)}.`;return S("form",{className:Cx,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),r.handleSubmit(),a.setOpen(!1)},children:[E(ha,{children:"Set Bank Transaction Start Date"}),E(ml,{wrap:"wrap",children:u}),E(ml,{wrap:"wrap",children:"What date would you like to start pulling transactions back to?"}),E(r.AppField,{name:"tranStartDate",children:e=>E(e.DateInput,{label:"Start Date",maxDate:/* @__PURE__ */new Date,minDate:d,editable:!0})}),E(r.Subscribe,{selector:e=>e,children:e=>{const t=hn(e.values.tranStartDate||""),r=hn(n),a=t&&r&&sn(t,r);return S(I,{children:[e.isDirty&&a&&E(Sx,{acknowledged:i,setAcknowledged:l}),S("div",{className:wx,children:[E(Ym,{showIcon:!1,onClick:o}),E(Ld,{showIcon:!1,textContent:"Confirm",disabled:!!a&&!i})]})]})}})]})}function Px({bankAccounts:e}){return S(Pl,{placement:"right-start",modal:!0,children:[E(Rl,{children:e=>S(Tu,{...e,children:[E(Nc,{Component:Tx}),E(ha,{children:"Set Start Date"})]})}),E(rh,{children:E(Ak,{children:E(Ik,{width:"sm",children:E(Nx,{bankAccounts:e})})})})]})}const Dx=fo(e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},h.createElement("path",{d:"M7.49998 14.4245C11.3242 14.4245 14.4244 11.3244 14.4244 7.50011C14.4244 3.67585 11.3242 0.575684 7.49998 0.575684C3.67573 0.575684 0.575562 3.67585 0.575562 7.50011C0.575562 11.3244 3.67573 14.4245 7.49998 14.4245Z",strokeMiterlimit:10}),h.createElement("path",{d:"M2.88599 12.625L12.6672 2.84375"})),"Stop"),Rx=fo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M11.7346 14.5L11.7346 12.9152C11.7333 12.2895 11.5704 11.6747 11.2616 11.1305C10.9528 10.5863 10.5087 10.1311 9.97233 9.80895L7.43662 8.29386C6.90079 7.97055 6.45795 7.51384 6.1513 6.96831C5.84465 6.42279 5.68467 5.80708 5.68698 5.18127L5.68698 3.60913",strokeMiterlimit:10}),h.createElement("path",{d:"M5.68701 1.1875L5.68701 14.5",strokeMiterlimit:10}),h.createElement("path",{d:"M3.26538 3.60911L5.68699 1.1875L8.10859 3.60911",strokeMiterlimit:10}),h.createElement("path",{d:"M5.68701 7.24146L5.68701 2.39825",strokeMiterlimit:10})),"Combine"),Mx=St({display:"flex",flexDirection:"column",gap:"16px"});function Ox({integration:e,accounts:t}){const{mutate:n}=Av(),r=Dl(),{linkPlaid:a,loading:o,hasOnPlaidLinkOverride:i}=Sv(),{query:{data:l}}=(s=e.id,Fc({},{select:e=>{return{...e,data:(t=e.data,n=s,t?.find(e=>e.id===n))};var t,n}}));var s;const c=l?.data,{query:{data:d}}=Kp(e.id),u=d?.data,h="PLAID"===e.apiName,p="UNIT"===e.apiName;return S(su,{children:[h&&!o&&S(Tu,{onClick:()=>(a({plaidEvent:pv,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Add Account button pressed"}),void r?.setOpen(!1)),children:[E(Nc,{Component:Gi}),E(ha,{children:"Add Account"})]}),h&&u&&E(Px,{bankAccounts:u}),t.length>0&&S(Tu,{onClick:()=>iv({plaidItemAccounts:t}),children:[E(Nc,{Component:Rx}),E(ha,{children:"Merge Accounts"})]}),!p&&S(Tu,{onClick:()=>(async()=>{const t=await(async e=>td({title:"Remove Institution",body:E("div",{className:Mx,children:E(ml,{wrap:"wrap",children:`Would you like to unlink ${e} altogether? If you unlink now and relink ${e} again in the future, you may see duplicate transactions.`})}),buttons:[{key:Kc,label:"Cancel"},{key:Yc,label:"Remove",type:ed}]}))(e.apiInstitutionName);var o;r?.setOpen(!1),t===Yc&&(h&&i?a({plaidEvent:gv,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Remove Institution confirmed in alert"}):(o=e.id,n({id:o})))})(),children:[E(Nc,{Component:Dx}),E(ha,{children:"Remove Institution"})]})]})}const Lx=Rt({base:{userSelect:"none"},variants:{expandable:{true:{cursor:"pointer"}}}});function Fx({children:e,onClick:t,expandable:n=!1}){return S("div",{onClick:t,className:Lx({expandable:n}),children:[E(ui,{alignment:"horizontal",color:"strong"}),e]})}const Bx=St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:"20px",paddingBottom:"14px",paddingLeft:"15px",paddingRight:"15px",backgroundColor:"surface.foreground"});function Ux({children:e}){return E("div",{className:Bx,children:e})}function Vx({plaidItem:e}){const t=my(e);return S(vf,{type:"critical",onClick:n=>{n.stopPropagation(),t&&(vr(`Plaid Bank Error Badge clicked for item ${e.id}`,{plaidItem:e}),vy(t))},disabled:xn(t),children:[E(Nc,{Component:Fd}),E(ga,{children:"Fix Bank Error"}),E(Eo,{Component:ko})]})}const Wx=Rt({base:{padding:"15px",borderBottom:"{borderWidths.md} solid",borderColor:"border.layout.weak",backgroundColor:"surface.foreground",display:"flex",borderTop:"none",borderLeft:"none",borderRight:"none",width:"100%",justifyContent:"space-between",alignItems:"center"},variants:{active:{true:{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",cursor:"pointer"}}}}});function Hx({bankAccountId:e,name:t,mask:n,syncText:r,active:a}){const o=Pt(Wx({active:a}),To);return S("button",{className:o,onClick:t=>{t.stopPropagation(),ki("BankAccountForm",{routeProps:{bankAccountId:e}})},disabled:!a,children:[E(Xg,{accountName:t,accountNo:n,syncText:r,active:a}),a&&E(Nc,{Component:ko})]})}const qx={QBO:"QuickBooks Online",XERO:"Xero",STRIPE:"Stripe",SHOPIFY:"Shopify",SQUARE:"Square",RUTTER:"Rutter",UBER:"Uber",MOOV:"Moov",QUALPAY:"Qualpay",BENCH:"Bench",WAVE:"Wave",MANUAL_ENTRY:"Manual Entry",CSV_IMPORT:"CSV Import",PARTNER_IMPLEMENTATION:"Partner Implementation",FRESHBOOKS:"FreshBooks",FRESHBOOKS2:"FreshBooks"};function jx(e){const{apiPartnerName:t,unitIntegrationBankName:n}=v(rs);return"UNIT"===e?n??t??"Unit":qx[e]||e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const zx=St({overflow:"hidden"}),Kx=e=>{let t;return t=e.isSupported?e.lastSyncedDate?`Last synced ${bn(e.lastSyncedDate)}`:e.syncTransactions?"Processing":"Not Synced":"Not Supported",t};function Yx({integration:e,itemIndex:t,numIntegrations:n}){const{query:{data:r}}=Kp(e.id),a=r?.data,o=1===n,{expanded:i,toggleExpanded:l}=function(e,t){const n=He(e=>e.toggleExpandedIntegration),r=He(e=>e.expandedPlaidItems);return{toggleExpanded:n,expanded:He(e=>e.hasExpandedUpdated)?r.includes(e):t}}(e.id,o),s="PLAID"===e.apiName,c=$g(s?e.apiInstitutionId??void 0:void 0),d=jx(e.apiName);if(u=a,!(Array.isArray(u)&&u.length>0))return null;var u;const h=t===n-1;return S(Fx,{onClick:()=>l(e.id,o),expandable:!0,children:[S(Ux,{children:[S(oh,{children:[c?E("img",{src:c,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):E(xs,{Component:Ku}),E(ha,{children:e.apiInstitutionName??d}),E("div",{onClick:e=>e.stopPropagation(),children:E(xx,{children:E(Ox,{integration:e,accounts:a})})})]}),S(oh,{children:[s&&Tn(e.apiErrorCode)&&E(Vx,{plaidItem:e}),E(Zl,{active:!1,children:E(Eo,{Component:i?Tf:Yh})})]})]}),i&&E("div",{className:zx,children:a.map(e=>E(Hx,{bankAccountId:e.id,mask:e.mask,name:e.name,syncText:Kx(e),active:e.isSupported},e.id))}),!h&&E(ui,{alignment:"horizontal",color:"strong"})]})}const _x=St({objectFit:"contain"});function Gx(e,t,n){const r=({size:n=24})=>E("img",{src:e,alt:t,width:n,height:n,style:{minHeight:n,minWidth:n},className:_x});return r.displayName=t,r}const Qx=Gx("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAGttJREFUeAHFnFuMXVd5x9c5c/GMZxxf4sTxNfcmJDSQFGhSkGhRCFChSqWIoqqtkJoXitQHXoqqVkKVWlFVQuIBIdo8oD4g1BYqFVTahLqg0JYSriExARInsXGwncSJPb7N7Uz/v/+3vnX2OR7HpiB1Zc5ea32X/3fZ31577X1O3Ctj7ba3/c3tvcmJ+0u/3LdWyr5SevO9Xs9SdGulV3r9mK9FV+CvVRlNpKK/Oh90xiX1hLa2JiTJpBx9VzaxJRjYFS/lm9uiS8I445gNowkPB4kj3dOl9A+pf7A3WH3gwN+++/GhlEOJ6e23f3h6sHf3R3sTvff31ZQcmR0GipR97PcZyukhL5OD0aQ351CyIgCBiX46yNh8ywWuaXloulKuzXbCO2NCbngdG135HBOTlYZwySLRAwXwie+fWPpg+Yf3LFXJUkjO2r7dX+z1+2+hOsaTYywczQrQ0A5V520UIc3tvMYtualT3WiBaE5ix6uxigWPSbVhOjZcnp6FDzH0ianDoEsvkpHUC/t2EsdYqsT9T7y4/A6S5HKIyonkINuCY1IDH08OwSHXZAk2nWJMpV0sOSRQfJ8Mxg4cY4w1gUfPh0YHlnHDTjsR8Kpsr4fNvjG6yQF/vQ8Y6310Ab3l1u3TH7XpfW/8s9vnt1z7KJfVAIqanfPAUwebQYRjeFVbTQJOIiOTNRg5VUUanuZrKZ99leleppUUgQvF+iRBLf1gHLhhl3m2rgy0rv2U6fbr8XWtDc4cfeqOycl+//5IDg5UZ9AOfyI5TJuDwWDeHMkxrBr4xZLTcLChtl5ijA0TPKpC/TheVjBi2dKftJF0+nEaeCnPeJyPYSXn/knZ5m7lNi7kywROBl2ThJzB65xxo0l83CA87lASak4By7zZBEP/gWV/uvNqB4hMqPU9jxE48LutYYsY9uEOpXLUbHaU7cNE775JyetWjq823/QzOQ5e/HQMOWjdYL3QVgdHkiM56yUvPTJGJ6DEa36gp4/m2PFHQ8+hqdmvihsUHS0q/+wEMhpXJibsdxMGD2q2qoQGNgFZK/smxZ5PVsqPJAcjKNDQY2iaKSpEESrfOCOyUSHQE9u6mnJ3CIfRBwLgaGkDSrPtcfCRhZcaKZN69KEb8hxHklH5Q27lQ19jkV+Tf77JzKuC4m4SwjKsgB2QeldLoqDMnUk9i7k6RdlZH3BaitDtMPoeI4gDatyd1DV6JqXazKnvRlUnk9uSgpCIAxlDjk1iS7SQCY7WEiLxxK2WxcWD6qdHQ05gkSRFKUUqKMTREcHZr4hhKujtlmyFalUdMu3sK19rOB32DUyyAjqITnrlXzhORXAwFNiJjy3TxSM5XldAt9PVW3z3nw6tRVwx7dBrnNBJdLd5Jr4TRGIyOSmUZQs9A0HJzuqM09qciUhOBqxg13mdWGboaGJGLzp8tW5imKOdNObNT4h2QAeEXLFDW81/K1VRJyQtgVWZ7jRpcwZxdUwaWIqplg6HDskROJUBgckrJmeIE8lqFpueEywoMKmttAu8C8FBMMOc9CuEA2ZcE5N+9byaWdxY3oCywBpniD7EaoCh1D0OxUNfGK4g6OlcZj4SBb0God4LMrL6ZKDgh/MpZ2bjJw5yo2PWj2jYpiWm5TSPh9eKXxPT8oE/1kIuRhw9ykGlOzhk06D4LeEVgy7tpyAm2QcZNZz3bBiIDDhxoc3xwuRQUekI6ozrPDCtNsS0yLByjJ/6lReJAae6SmCqONowiEhMqjpdeZewYioLo1Z9IFQXczLSZwYhgqgKwkECGq8cHLGjGHMS1k+OkxB4xmgBGHMYUEsEdMnzoSIxT8u7Tiy8lR8s20/cVi1SzKREj7CI9YxmXKamkcRrVoNg2cbTABjdxKDrNh9OOncVH9mcGws6epJ1s5z0arDhV8yDLwH+qrx9RjbnElrROrG8uOrcT0/2y8yGiTI9NaF5T7xSllcHZWllUBZX18pAc7YYExP9MjnBGD8gYk24MuAhVJKObVit1Zk64qClbx6bMnowhg6+xNJxI1uDYCqIhADtAiJ/OckBI+AiOeCcX1kt0wrill2byht+YXt5zfXbyr6r58rW+ekyM60EibeqpJxfXi2nzi6XYyfPlWeOnylPHFko3z9yqjx74lw5s7SqRPXLlD72q95EHFSY1JEALkxIdclS3ZiC0JRDkQQRbDcBnoNta124UHYyMcwHUt38mZvrhII0pvmMe64INN7+2h3l937txnLXzdvLhqnYZVj3Mg7nl5fLwaOny1efeKF88dGj5fHnTstPVRa+ZmvxRAw9n6XqjcU0lk71PrSaehs4Puf4xrf+xdrslmt9nQNjPJdpBAmCq8UJ8wSSy9zJ8qQehO8NJXwctb1eWVwelD3bpsufvveOcu9dexF24xXpT9O6Z3xJlfiVx4+VP/nHA+XU0qAmSZXtk4RhsMOHuACrrZrAS9lFevHYk6xBxrG8IZ2I8eRUGXg0dS05ngfdSYE9lpxbd28sH//De8q1O66Q4vieFYDLa92ETmkxuvmaTWVVier1WJh49AAnkxJVkknNmwASNVUM1aQU7se00rTyiV73QUi0W6uqJ5vBmWLZn+CQnCZV5TMp2YOpwim7tkyVv77/9U7OYCDCz6lRfAePL5RT51fKhlkuVXzMLrwbiMBoJCHd+MwNHR07rQGxUayXAgmoyq2SqoqDrmMnB1la7YdJgWaGL6+11dXywXe9uty8a2v5eSYHCwNliMV7RQY3dILG95GE4GO6a9fqhLFaW0s1Jo5s3BnJh1dJqqeurwGecupbteR4LCnd5GQiwV5cXiv33Ly13HvnXq0P//fLKh0e7ynGp188I8fD825i0ifXj3zRX2veZymGHpc6vThdfhOsA69BjtmGIvepAABVYuMWCq3mwDq0rLC1wWp55xv26NY9qauZ1xyRJLBZD4bzsNbzGpKWR90caCOED8FlrCf5tdXy7PPnSl9rUbtw7S+CETgK5jHvJMToTWZ9m7YmVtxnAVazEx7Kfcq20mvX5nF3sopLNBMWoNIV0Ja5iXLnTVeVCSWejV4uktigdeeYYlP49SeO6bI55URsmdtQdl25qey9aq5ctWU2lHQcqATw58z55XLk5KI3j2k/e2xkdaAYIaHnEaRhu4BUCSpMMOpdjPOZ8UsAmVRUn5Vk1EpPZ7JHgcTBXlFGdmyecWCZEOuuc8Dnc4vL5Y8++d/lX793vKx5qxzP6Gwot2oBvumajeVNt1xdfvUXd5bb9m31bvuF0+fLC9pITkyyjIZTnFTHITtBgZUjTkqlm1TpQ3Z4l/JKELqjjxqISIGXXtkyOVBcOWwMLcMaprtfdYXXF35fKCcHelbYNj/lnTHV9EqN6vnBkZfLQ98/UTZt3xwBicZFguqCkv0/RxfLV599unzsSwfLa/deUX73TdcpMf1yVuvc5GzIZcVIlciGJrvDSgebv3HXPE95TVoFwQhdqiCUAYCYZ8AOEI2a5WsAJiAHXQd4LIQTE9CEd4kMDaS068q5ct018+XQwkqZ1ZplNGHQT+hhaHZyuszOTvtS/cbxxfL1zzxWtm2aLv2ZqXRckmoRBCOUfchXNMx8gh14+AnNrepZhQDUkGVdjJcyVSCSY7EQ8lEHSJUciiQSI9HDi0R64N00d7EBj8SXaCzAO7ZsLB97353ljl1z5ezSitcjgg0bCaDLTtU7s1HJ2iK5CSVIc8eD//5IVr2TUntj4CsfsektA79+uBL4GIMi0Mn1WFeSX96jY8W8skRwxaBEq0CW0bQm2TpZYZFEgLnz9soLp5fKWW3iGt9A6x9W9HD62uuuLJ/+wN3lI+++tdyxZ66saId8Tg+lYnEt+8NlnL64mKtfoGbgzQ8JQHNSEKiymZTEpLecZEMX0VhGmHujiL4BRMngTTO9jgBQw0AAxhmoRN9OxXLjtcQx3WGOvHC2bNNifSFoyHWPJGl2eqq8957ryrtev7d865mX9EB6rHz5RyfK4ZcXVRX9Mq2nfbc0lAAKkgpwMuRDxuBkSCZPkpOouflg1Msf/nitR3In4jY/qig9KSSoE1eNQwvZmolqPDdfycPZ03rOePjAkXLbdXHXyVheqWd3rO2TtwZ337S98DlxZql85Ynj5e+/ebQ8cnjBvk3He1BXVfqZyQE/aelvN2HeUYnQkiT55Kdvba4wfVEpHa4gl9iYASvVfGQC6NOJ4ENglH0pU1pAP/e1I+VFvc/x9W3ByztwYqkoPptnp8pv/tKe8nd/cGf55O+8qty1e86Xnt8s6kTQOEH2SWP8sm/10oGfNKok1s3Q6/IkpGxwK6avY3UTW2+598OTG7eC4vhGqkeCgLeESMQLeTWKjpMGYE0OyWY/wmV2fGGpLJ47X950+464BNqpwbVLN8QJatWXQq/cfPWm8huv2VHmp/vlG8+eLPzCKe9SToIDizicJPsnfyTXNW0esuK3BZ0xpP6Ee5I0WDhRJrbd8tYPTyhBMEeSY2kwAMnEdIxjtBpx9SAHTcKRUFWRbtnfPvhSmemtlrtvvUZM/0nq0s1BAdhpJIobwC/rLeQN2zaUh596qSwqg95SyL5Pnv0OxZYU3IbeSQqJMU34PsmW0QRVX1eq4oUXI0GTs1QQzKrUGYcy2gAFH7ZlbdCTmCNkw5WveV8L78MHjpWzZ86V1998VTyb8exxGc2xAtX5oEaibrp6vuzWXujff3iCRSuExMsKRw7FqBDdlWpCYh5JcYJshLjAqJZq7wraeut9usS2tOANXMEyOchnctIwX9DZc3vBUCWJIBtEEqc5On3NJ6any3/+6MXyX489V3ZvmynX79jkS/CVNpHVVdDX/VCNNypJzy8slm8fOV14gWYfkeZP/kUy8Kf6qs5JkF+8ZIuYhrTkZaJWuMS2tksMVxAO8DYWWFwyMACO3uUKw7arTFaPiMPkItMrMzPT5bmF5fJPXz9cHn3qeS++u66c9XtpFnHuYD9t4130ns3T5V8OvFgWpc7lZ3+UEC7/8DViwnc/QkmEsQPVMWJLmejh4vPg9Iv1i0MI2awcigGqsbLWrlfJOXjktRXHEMduhYVRmbEldcIElseFtdkNZf8zZ8r+H32zvPqaufLOu3aVt75mZ7nhmisst6Q71+Xmiiv12ivny+v2zpeHDp7SY4kePeRNC1oz+8fl023VL0gR1zA+aPGmAZyJugbNbYMeATmYCC7PQPSdM8KZwgvOEgny2UIfy+iKap9qZVVMJ1bjKW34JlVRx84Pyn/oG4rPPfLj8s0nXyhT0rlWrzc26PsxfS12WW1Ctp/TVuKrzy6UKQDsC37gouZ2RJm0azrA9yXH3QpfqXZO8vATwtpmaJH2N6tRB+EPShmIexSNO6RbkhdccX1VRXWSA4ueA3rg4YebHRmON+gut0H7JRVN2X/4TPnSU98rd+58pvzxO28p9+j1BtV0qQb2Hj3LeSeNLSnE2whGynKtchhOCJc/MpbjoJF5GrcWdsEmxY08jGRIdZCSiQW1Jikit15s2DQELXAbDMiL+gJQ78J85qxgUZIWWKiwdmzU5Te/ZVN59ORKed+nvlO+cuBomeah8RKN+DaqIlN0EKUrf2RUuHbGVcWbR24k7KV1cvVTeVxGvK9LSbcSWeLbkfqpVeZXOPah60t1XtLNvSjDzEDtxe1WCDK2Kr1zSszbbruyfOjXbyz7tkyXs3opdl6ZilLmLNez2CwApmC1cz4/NVU+/chz5nBiXukT6iQb2/UhU0HjR9y6dbcSMOcoaKITvJLhpPhuxnoD338RAhM1v3J16cGsiYGVKTBPwtj3xhAk152McoZsHiaG1dtRTfVW/VU7N5X3vfkGPXzuKQ89frx84bvHyqP6Cpkv+np64cXXx6whblWXQPQ4VjbrlWvlBP8iR8zxiiSeBxEKX+njZZ4iYTlAEJ7+czLkN0mNeUZLNBaLgVScIJecRMcbQKbqEKAoAyEjHJ0MjapqysObVMB7t885fXO6fH777n3lt163uxx8/nT5mnbAX3vmZPmBvrZ5/vRyOae1Rt8QGXdK18qvXLu5vP/N1/nVLdSLNZ9QGWORDnUcDt/wAb8iMVwokZgunbHnPuMEwawGQ6ePnov1H5kEWAT3iFaaxSuvZgWNMmD3SvjwUFRCkI1E9sqcfq2xc+us7kZxifBuh3bD1VeUW3ZuLr//xrVy8px+nLBwvhw7tVReOrvitWj35g3lVr1dZOPHw+orNS49RB47dlYbUu5K+oIABVcM8eERcUmonli569b2RDEd0mrKIHDF6C426oRniYKQkyNq/GYuEsLlIOfaesjUJnAnHgW2zk2V7XoUSHpl+0cMy7oekJvRY8gNV03pIZT3OSHBgr6iy3M8OeM4SHNyjp86X779kzO6xWsRrrEEemxWI5Q4+eiQGGNVewIxjvE42DMPTI8XZhKORS4YFgvkSki0mGIA54ylknHuEDFNv+/RJmbXlg1lXgsuibygsfCKSAXwBeDyBQJjhBFfhjzuXPv1CHP4jN5l64QI0Xckx6Kxq7u6Pqyuqi9MxzCEUw46E9AkE1/7pA5EM2rs0FNJZycBg+Q0IaGWQpEjvmbed+VGb/jWy0/o/GxHtgY/OXm2fOqRo2ViJs6zlvw40S05+IXfUU0ahKc14eMJyfjsmVTRlpkILqBEiWnIAOQ5h/hw53JNcE10qwe+DUMv5Xr9KCr3JgYb90ZE45gZB+Zdmsc1mI6Y1yr2Vx/50tPl4Dn9eEF3xNjH1KrAR7tDddffUwvHCah46Q60/AxtSFltWEERU/Dl1ahPWBoSrRr6IR8ZrOPoyB1vAjlzkxPasut7Mi6ndURHEpIgTkydWK+OCYS73LJe6P/5vzxZvnDwdNmoX6ax7+BExzIR2lk16JhSg+omJu3RewuTBMkSIrq+zUMPIAWi6BiPt1FKnalLUQxzXwOZF2V/9fknyrf0fPWuu/eUV+/bXuZ0GSwrSSy+3aDH7aw3xwY/t6MiDzx3qvzlQ0+Xh4+eV3K0VxIzkiPT2h2TjExOJjrjcVXhoP5okVANPA/i8ChtTVqCrJHRegJA6OoqNgrJCwd01Mpcb2zmRYKRV7ErkrODqfKZ7z5fPqfN4W0758q9t+0od99yVblxx3y5Ym7aL+a9SAuKp/JMmi0RtD6xk1grZxZXyvcOv1w++92j5fM/OFnO9CfLnJLDbRR5V4UG+Gk/AsRjQjEfLzM+ZCkE/ed4kEFQLfsctwR1GTANJsAEh0YLugZWwJNozbgYOMqLsvlNsxZ77MRK+db+Q2Xmy8+WnVdwW5/Xr8Pmy/VXzetLw1lfjvyAk531qhb4c/pG5KUzy+XwS+fKgaML5Tv6LeKTLy+VJe2NNs7NlFmu4fhryYl59ZdE1GSk//gXiUxd9bURytD/SpQ8tJYgDNBSzRuuIKUtzyL8kApQUbxn5G4BPRHU23IpGzZMlhntpsE8qnI5/OOz5d+eWRBf361LbFoLKV8x89ihH9RpH6R1RrIrnGUlZUr601fo5RoLLvjcUX1B0wvGdscWY9N1UMMv+8haJV20siDgNQwGNDFJZizSpgQHYgQpImPLVp6cbZmWoGWDIjmyHToGBrMzt4OVRJVMKuiZ/pRuoXH7BRdnVtCTnUnRp9SD4RTUm0SOgY6kSNNy4Q9O2BYCahlLd12NlAKt/5oN7HQadIzrzxXkwDt8A8sYwXZb0EWxwhizK6gxDtB89B2sJjVxhZH4fuVq4QyQs0yLXS92+aRZsC3R6ENbiWlfhTCaHPkjHTfwGOYcoub2O56izKsbxapkzTiEg6FkzQ6vO8RIaHcwMKq/dFYbF6s054DtODZuK1iZELgkioA40gceNjBkH2wzfEjsNa2DDlhSkdzgk5TUSR+bDiIVl94VlMzsm8PYb03nTAo26B7G0AFmlP36unBHG7bSOThhG88cSnUydCyLjD/VRvoSIqlVZ0LRZdJNTmNkcsTvJs2+dDEZS3a4SDcEAg1n/P9AaAxQnDsmEZh0o3FW6yRJ6yZJzAwUxZSJtSTskYFm2+iSIiDkbSf4ZmFMPN4D2X76UHvLoFcHKWP8iml/wFHLV7YhDzEKotZqx7DF67wq44gNVB5dGq6hmeNANOr62OSqU5kAFMBME9C5lMIOE334M5iZmuIuxDhdaNDSRtyp8D10k2472K944z18Xh2nvDElixweYbK1cKhNO4OO+piOne5IMo+ANarrzyg7LObmcMjTRmD8kQSzSog/KSj7+J3Vg88WS7vKY0aVyUnZlhxg0asfoO2z5nlnZCPqS6y750EwDVqJuT6cs/FmYyZSjpVPf6HoiCr4yGTKPa9KQasAknMA0ibgCG7Ul0iMBaqN0E1siG2M2fSTNaiOnRgEsYd8NU9Pzerfz7lYi1IOBalWxWYk1QR8AS156/TcosOR6hAywrYdO40hJOir0TpGM7litpb2UR+vnoZr7LCT8hGbYMRjzAee+b2100rQ2qFmRQPcaq0Ctrm0DcJl0BzXUFMooRvHplMHGEzjySNQWutxzBRhJNHzcNpD0e2D+gyE+QivTunMg19l0gf7mxhUk5YClgMvCZQNvqz1D/UV64MAOWNDHEhuBtKoOVHpF+sSB35LFcnpKGQakhS8TpSVMY4V86F2FxMVB18zgSyflEkt00RHLMboJTc9arwH+ytryw/oFjq+DFkyXWZiiC4Bmo1Y9Gc7JK4rE6gAJjhfUizSjMWPUEKBAGktEXVuog7tpNrRzhwBQQY+E+zRq1M1EZgsDXrL/Qf6hz77oceF9Ilgh5LHDT056/UVdYyFaoQ0xrjINIKu69K6Mq55cxI3k5PzDLDNJc0YufTSvYOHEZ/E0cy0ptMrnzj0obc/juXyBP9m11rZn2A2Us8a/GiimpHzS/cjxi8iHjJdYMZZ0BlaVb7Ap4uAdsgjWwkqSS0TFWKaVTOO3zJr+3+4tPBB+E4Q/1bXgRcW36Evhj/Ov7xU5UO/HYdAjfT/Mugms8V22Z6ManfOucLTmxi+G//4DxdPv6O85/bhP/LWRb/tA/98u3ak9yt39+ndyT49GM77uaZdm5KmbMm0aFklyGCca7iNkckPdE9Dx1dw8kRHzrTcWEqeHxJ4DfJY59IbRt5kVlwcl55tggG9lkP6F5iSgS5+2/t4jHT/tOI9JOwHy2r/gSfffe3IPxP4vzL3JrQKxzmrAAAAAElFTkSuQmCC","Stripe"),Zx=Gx("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAABGNJREFUeAHtnD1sEzEUx58vd72UpmUBJhYqZtQFIYG6ICiUsXxIwARDEUJiABZWQGIBBgZAlWBjKpQBUEVbIaEWWBFiRGJgLAP0K7nch/n7koaUJvWdk1zTnF0lufN7tt/7xXc5u/ZjJEm2be91AxoyiE6SwfYR5z0owiXF2lXMiLFlCvjXgOilZdCU4zjfNzKW1ROaZnaQDH6VMTYEnb56els8f4FzPkUBe+h5hdlavtQClLNs+y4RG0WBrlqFOjCviItizHWcm/Btqdq/NYBylNvp2O5zwDlarZSeYz5tO9b5JVqaX/W5GlCvZWcnIDiyKkzp54zrFEbg+6LwP7MKwbK77+H47Op5ij/7M6aVC3xvUjAIe5Bpdh9iGf4e52m558i+/yL32WHPy3/ErzdShq7hXcMJYYRvXWUm6EHZ7B6L0xdkd+pP+T+34x0tuIwGDMPnwxpOTXJ9go2Ba+x0TbHOJMGGmXZ2HnfqHZrHegIYT/0yymOr9VKdg4dr3mOCg+rA08ct/gX59C5g7DfqqX7obAe83OB8O36NjsPDUzCo8swXwzjOzC57GQPSbTEKCVUXOC67hcLTmOU2Rd3KZi8C0hM0bsUxAAPZldJzUJxSQpfTxFaBI8yFrc+EzeI4blIF9DZuQ5utH1DwRsUGJUC456yZElBpOPkymWWVNpUAoaF2uyFH8V3JZlVAUQzqCB0NSPI1akAakISARKx7kAYkISAR6x4kASQGq0mlbrMrex1PUAfRoNIzCcpx/H3yioX7OM4nYXhigADnBmN0q2GnGA2jLgZItxuuK0IFyV1ijAYj2BNNpZl1SVpMDhBh5qh5qZl1bWhVkoA2NKRdhRqQ5JvRgDQgCQGJWPcgDUhCQCLWPUgDkhCQiHUP0oAkBCRi3YM0IAkBiVj3oDYCpLK6op75zayrXhthfnI9iNPshpbEEXKai6PeiG5iM4qYAbyHmUDehCnXz+Up10b8jlw2MUCwKA/H7kS2rE0Uk7vE2sThuGZoQBJiGpAGJCEgEesepAFJCEjEuge1CJDq4nOJOS0VK9ms1IOwgj3XUldaUrkvtrPHTkqAMFw4EbulTS5gkKFksyqgESzvv7DJPkduPrSVITCCQlLdqyGa8rBWZxwvbGYJ/uBcdc2PgtmRimAzi9EHq47hdQYlYo87xV4NAWgFm1m6IzWZMiUAyhthLIuUOR7ZXcT5MBDo41vkAmlTBBsDUVDG0+Z3VH8FG70tvD6t0rZwKhR+YB50pr5eOiUhE7ApPQf59AAYECJGpzKBIlZUCialja5B4P1EQI9dOD9QVkj5B3vkufkxAaHy/yVEO5nLmOZ+5PWnnI4Ij3MJDMIrqnqosWg75jksZp9OLyARYEkwKMUOEhwqPUicFKm4Evj+q4yZQaATNvC/XOh0aEJv4Y8RomsUDEQMgEpaA6icWwSkSYOZH4jxXgxDdiPfrpTorAMR5O01grxd8VxH7KsPL6tqF6UDzLSHCfwLHN4iAPR6ZXwAAAAASUVORK5CYII=","Square"),Xx=Gx("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAD6NJREFUaAXVW1mMW9UZ/ryPPWtmD7NlGSaBBshWIILSUngBJChCBYkuAgQt6gNVpb5XfarEQxEVLwVa1IpWqIIiUKlYqlIgbA1RIXsCyWQm49ltj33ta/v62u73H9szHvte2zOZCPiTY1+fe+455zv/f/7tnnGgBuXz+UHevovlDpbtLJextLB8lSjOyUyznGV5jeUVh8Mxxe/GiUAvY3mGxWT5upHMWeYuzKkiR2UNG97JuudZWivvfc1+a5zvD8ntV8vnvQowwT7Gm0+wOMsbXcw1+0TaiCGUPI8l/QJyjhx6AmPobRuD07Fhw9hNMccbvyDo35UaLAMucvZl3tiwWaQMDZORQ/g0+AIiqQtwuxxwuTzIpYHrtj6Cka4D8Lmb4XE1leZzKb4F9N0lTivABCvyfoplw8R4SQ/i8OTzmEq8D6+rHZs8o+hoGkEocQ4XYh/D7fChv/0b6GoeRH/rbgxu2ncpgYt47yTo6RLgZ1jxMMuG0IL2Bd794klo2XEMth3A7s33o7t1K07OvI7jcy9jidzOcd2luJxOOJxZbOu4GTeM/owcv2RG4FkCfsRJ7orpeXBDkLITLTWPjyf+gJg5jq3tt+LA8E8V2M8u/B0fTT6NiD6JLW03oc0zjHw+h+uHf4ItnTdhIv4Ovph/B7l8dqOmUtnPg4JV9qvYWVfl3XX9poL67MJLWNRPoD+wH9dueQDNTd0E8i6OzP0N2ZyBfYMP4Kaxn2OwYw98TS7uaSeuHXoI3f4rcGT6RYTj59c1dAMPCca7BLA4FRtCwehJTGkfweNox/7hH6DJ3QbDjBPISzChYVff3dgzdC+8bj/a/X3wOH3c0+fRxutdvd9H1hnHudC7iCcXscj6BW1t/kMDIO5ws5F4UBdNhpnC+dB7MBDF7v4fY1NgBA6anZnoMe7l82h2juCawXtYVzAMfm8nueuFkUmqsZt9/I1mnF54E7PaKcxFPoemdeL2qx/DzqGrL3p+xQ62C2BLj2StI8xEj2NCe4/aeAzber9FZeRBOqNhPPIhRTmDfVvuh9/bsdyt2+kHuF3n46fw1snHoRnj0BILyCOHtBlFysxicj6KP779OO657iFct+O7y89exMVlAvii1WImm0Iw+gnFNo7R7u8g4OlQnNRSC+TwEbT7tmNz2y41z1D8HKaWPsO5xYOIJ2LI5iPQMjMQvmezWQKm9uZCmNk8UkYO0XQQL374eyUt12y9jtuhaVlKVIdr+2gRwBdNejpMcf4AHk87elt3cEIFHbiUCiKTXUKHbwgnZl7DdOwYluhxmXmdezulzJIgzWYIVJAKCXJe53N55Ak6azqwGJvHn/79W3S19CDga0FTUws6Wzqxf/u3ccXQXrUY6tkGPjYE8Hz8DHJuDb2+vQh4u5GiKIf181RA71A8M5gMHUIwdpgcNAnEqcR2GaCAs5koMfMehZwc19MxJFiUCuBHwO9nfzlcPnA1HRavTQ/V1RsCOEixNdIZgs7hSPBFTEb/h7A2Tm7l1KQEUZbiWaDSd/VkSjWyALIgNNOK4VIvToqQ3BPQ6VQGEXI+y9XwFARK3a/3sW7Asm+11BzNxzlMRz5FJm3gXPIgfAn6ymRNjhORyRU+6k2j+r4AFg5bkeI6+1/Sw9znOpo8VIAN0poAG6aO+cTnmA5/hjntOOLGDPfkPBnpoG6VlXcgnTbXDbJ8zoVFK68pu+ZCiDjH9CWWEDqau8pu1r5sGHA4PoFDk39GOH2G5iPEmIqj5h0EK4ZEros4+b0RRIVdmyjWeVcOIW0ewz1jtduW3W0YcJCmZFY7ShGKqf0kGnS94lo2vu2l2sMcQikpi1ZcapouE6HYnMVd+6qGAWvpBaVlRdSWNax9v1yL4j5mMEDjwpZkiTI5IgJOBv9uOJ0uVkllNSklJU2tb6sHcjkTi9olACxRTSq9xGlnqmdWUSOLYTLCdzjy8Ls7aDe70OzrhdcZYBjoRIb2N5lZQjQ5peyxpZSwD1FY0pcdh2VYk3Ifji3Ub1g2x4Y4bJgJ6JkwJyB8U2wq62LlMseFyeczDOavwWjPLehv24FA0yb4PW3kqEdxM5c3YWR1RPVpvHPmKSzETytur/RSYGpWJImVdgxWEkTAIXI4acTh9zWWu2gIcCoTp9tIJ7+GLGcpXl5GP3u3PIixzTejvanfcrouhxd+pxdpT5xeWKqgBypQicZXW6d8FSqvlRRQ8owElhLhhgE3lL9KGmFkJBFlQ8K1JnLxwOij2DNyD8FuZssKFBXPToQPIZaaoshaT4FWp7AYFc+V/xQJMPkvklgsr655bT1axSO6EaFHk6SIyRCrSYyS5Ke+ueVH2DVwO9zkcj2SrEYwcpSLmLIF3GjiQ3zyxdhsvSGX7zcIeIlxa4I+bdG/W35clIuJke4DuPKy26r2YlmzVZfioS1o3Lt5++HN6qFW9SE/JMAwjDQicSquBqmhPZygwsowPVOgMi5zTzcxI7ln6B76s6s5KwsxGTpMpXSOmllnci6A9sAAM5U7Ma+dQYxhn5MxsxXJCBIw1NLQ8px4dplsBqHonFKopeSCVZ+luoYApzIx9l4EWoY3S428uXUUnc3MbpSns6mtjwX/gUPn/0oTtEApyJH7zkK6tnlYJQSccNuKs+ycXA0FWZq8fOdosGPJJWpqnSawufyW5XVdwCY5mzYJ2GL/SoDQI28QnKu70U0Nx4P/hG4sEigTdcJJAjBYP8vIykGw4nTYkaypxe6xbC46RKemjhN0I4DtN1Gx+0xGR9ahr3C4fFiKVIe3X4Eqr3ay3l0UcdHC4k3JtyyMi0qtFlhZV2Gu7M9GSFqlmShsdB/XBWxkk8xN6UosKycge0YScZUk2cq9I/ehjbZ4Ze9Xtqr9uxEOC9g8RVpPE7AENA3Qalm0eMCk6ZAVzEmwUEEyWIr3OGzFHaZCe26Ei/7yJxMv0AQdJsf9SslUNbSoyDMKE1+a61mXxPtLpum5JSJ120qDuhxO8oVYhiUn6ZkKYCKmc7GTTMQxBragLd3X4/Zdv8JVA3fzSclbNWBr2E/NWLh8HKXYqKk5fjg+X37H9rou4LS5BJOpGquoxs03gUFmO0KMlUV5WFHAtwk3jj2q3kIUzEa1NFQ+JziEw42S7HctGWEwUT+4qQlYxCVlRDmuXbrGqYKKQ+N/oVmwFymvK4D9zEvvGb6P0lBjUssiLEFIo3ClXZ6amrlsaut6VBNwlv6zTg5LqGdH4jxMhD/Awc+fZsgnLp51WzFP+4bv5TulveQEg4YapDjMbhrZw9KN2PlEOqH2co1u1a2agE1GQLoZIQSObo2jYHL4kuTk3Bt4+9QTCCcm2bF1Yy9fhV418D0CkVStdRuZlaR31sJhcT60ZIxOzkVyWJx7PbWoUilEZkuyN90M+SbCH+L1Y7/GFJN81nvagZ7WMb4E38o9ai/aWQuLYDe4LJz4+ElyWNPFQapNNTmco5eVMJjpoIaupEIyYIVLotQ8ND0L9JM/Pv8cbWO48hH1W5LmLb4+7mXrLJ2sqyishjksU+CCi26IJevb4pqA03T6k5y42NtyERSwAk5SODn5V2ZuPDyzMRs7waDhrKUZEmmwCxpkRWiCOXm5WgMV20tcXE9T1wQsgX82zyipYrnFGRnYtBu3XvFLXNl/O3yuZpXHEmUkWQxxJl2gB2axDfL0v41swupWASEnr9I7awSdJVNCDBPTpn2iQgaw97QIUkyS8vsznHkZaNGevS2XY3PHVcxf7cFw536cnT/I90njXOE0X5fegL72ywmqej3FVY2lZuh/W4eGMqkygZGfDZHohAidD4OAm/nCzY5sAUtWImEscHus9gAkNepjDNzdup2BAKMeTnyU74O3E6SejlC8TbQ29XK8avbKtpiTWJgZS5fT+qiSMFY8rbVSJsMcdXReZUVrPVvNgmJrmVw8HaJ4rVYushBt/kF0MJiX3HKJhJvNTMm2NvWxqhqstBORPzXzphIWK8+t1Jd667AGzKJTVFysRxgmiqNkT7aAlTE3CFiNvtKBKB1xSCRoaNQ3LjydJ9i3MMWDavUOokmktAa8xckVNLVkMGuRLWA5caMTsLzOKCcX7W0kOYH3Tj+Fswvvc8/UN/bS15nZt/HR+HNkvgxpLQEyjtxdzx6WZ8X2yxtFSUzY0YpMVrTIULkk+WI7z2xavsK1lLBvllHSv07+BmN9t3AP34wOinnA28owMLDckyTcxR6fmHkDR6deLmjwGpkO9SC5y+Md6yIxkZLBVCklm5NYAlgC2iq1JseNcqXUrIV8uelAyGGVo1Ov4szcf6iVd2CTfxuBb4ZTzlMycokmgzzmcBTzsVNUUt7amY4iRBlK9uR6yDSZo9YKgG2ejwvgaZaq941xvjxzujmwmCQbrSlnOTw8cyV2WTKUk/iv2nsFhcRn+d9BjoqT0iiJTRDAYvrWRnkI4PnoLBkh23B1FrXY17QAPstSBVher8gBM7eDhtxrFJSIYCD4crPBKu47F7m6kpQTDV9LCxcHr/4qrNG6RFqEQnxqyXxIysfvtcxgnhXAcmz+tsrRR3u/jaFN+xnvLjBfNIkwbedSYoJKIYgkQ8a8M82J8VyHCgIKuk9JotKw4oqS1Edlz7V/yyPrkmhnQSTEsYkyv9XVKuaxil4TwK+wPMmywiL5Qaci4GtXpbtllDUFEv86kV4k8AmEeFA0kriARGqWJ/DidBnj6k2eTFoyl0KyG1Q+jKpXAZGbNuKqqtlIgod65BSA8r8IVLaBn2c9Oju6lLdl8byowlfctKtTbPwcfzxs0aiqSt4g+NzDTL4PY1vxrkHxjzOMjPLMhxyNiCanef5jjrmmBL21EEPMMPWB5Kcdan+Kryzip8yPLIBQcREErJTKPawAUpDUN5vLthIXsr2li4qykyfsBzDUsw0D3Vsx2l84BKf6Xfl4TrAWF3XjD4hn6FPLGwuDRaNEiP8cT0/zrHSQR4iDiCVm4PZy97udavJZk2k+LkIqlceJMwYVD7WAAJT7rHdkHejq6MNIzyg2d44weNmG7vY+enzdaA20qxN6K9iqrlYfEJfb5PKd/HqZpbAhpXKDSd7+i30vbYsYwcfSF7AYn+QL8ilKxQKdnRxOnE7Bnfejr2sAW/uuxFDXNgWyq6WPW4wn8bx+2nv74KNi2rJBVv8JQKkBQT/G6ydYLhno0lilb7HlUuSVjuI+jwzruosAt/GoYa/6GwkPwUlaaB0kYK3/yKPUWZHTz/N3Y2cISg9+9b5FjKv+jKdq2bixX2XDnSzPsqzTyeOTXx7JnGXu8kcdgmUVFXXjqrrlH+T2IH/cxXIHy3YWOVtd5Yay7sukNf0p3v8B6wxHdmdLODAAAAAASUVORK5CYII=","Shopify"),Jx=Gx("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAEigAwAEAAAAAQAAAEgAAAAAYwsr7AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDYuMC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KGV7hBwAAG5JJREFUeAHdXAmYVMW1PnXv7dvd0zPTszCA7NsIiAsMKEhCgLgQeBokkTGKMdEkkvgiT32KyXu+MGrMe4pLPhQN+qL5jNE4EJFoIIpxWAK44AAq64jsyDB7z/R2b99b7z/VCzPAxBkZ88T66OnbdatOVf11zqlTp05B9E9IkkhIiU9ZmSbLZ+r4rXeyWcF1VF2mwbRAs5M0PlPxz60RKaWg0lKNaDH/c9EQxtQ2VWzalNf70KECb6Qp34yFs1HARwmM3DBilu5tsfKzGg+eMbJu8qiBjW1rKmKCZhLozyQqL3eFYMy6PnU5QAqY2bONxU8+6ZYSOekuL9uxI2f0xg0jfLVHL9BbQmO0WHiYFov2ITteoDsJrwf46dwbDJMr2WAQRzfi0uNtkD7/AfJnb7cDOe/FunV/570xF26dPmxYc5p2Obhr5o03arRoUaKrgepSgGR5mUmlZcwt4AOilRs3Bs95960JZn315Xqo/iJvtHmwNxElikeIrDg5jkM2A4KPEJqbZgGFk3Q1BsyDj65DIk0vkTeL4oafLH/Objev4G+xwh6vVE6esmZacXGI20N9gyCCoqzM4t9dkbgvp5xkebm+d26pZ+BeijGxj5YtG5Jf9cE1ntoj38mONA0XUfQ/0kzhhCOFblrSMBQi+KORlBAT1idpeNLdUV2DthEu3rko54pEgqRjmQED0GXlkPTnUktWcLtT2OOF2hGjny+eNm03194ziXwDbiq3RWlphoPTVDv7fcoAVS1Y4C2eMyfODW+vqBjQ8+3Vc4yag9dlR0OF1FxPYct2yeO1SPcwGGAI6CZoWU7HQ6IyT/In00mBqqyfhbDJAV07ZgZMU6OcAmr259Y5RX2erR514aPDpkzZw2Ra9+0kZDuUlWm7Q6VbF4ISrpozzSx+dEWcuaD+sflzPXuqbssO1xW5LY0UdYVFHhOD0TwC4sKgdBSQ1s2c7Fl1msGCWIK5bLIt4dekqWXnUUugoCbev/iRbnPm3s/cVzV1qrd4Bfr4GdNnAqgcIjWztBSsQO6BpUsvyN209onco/tLHAATd6UtDS9jwcB8PktLq8HyAAAUt2cLxxJeQR4dQIWK+m0KlUz4cd8ZM97BSw26iaCbIK6dS50GCLaMgYaUEq5Z+Mjt/l1b5gfqD1HYxeKjwcQRQge3dJpu57rdTmle6qV0yHW0gC60SH4vig0beXvhT255iGvICvR9crLv7VA4IbtTA9laVmaO4BVCSrNx/j2/C+7ffnW09gi5Hj8Ak2z8dYreCb3pugwwjXB0O2r4CntSU//hL+Td8YvvY/Ksqptv9hY/+miHRa7DA5ILbvaKOY/G395+sHDY4sdeyT2w7cJIuMV2DZ8hpAM6HSbVdTB8GiVNhyaMOlnZ2Z5Q37M2VF51/TcnDx1amx7Lp1Xn9x0a1Z6yMt/AsrJYZWVlr8Ev/2Fl7oGtZ4XjTpwMjxfsDCodItOR/nRxGWYkiL1jxwOm7gv1HbFt9xWzLikpKTncUU761JFB55hseK2prCw6b+lzFQBnRMSWUanDYoO4dxDjLh54Z8ixitYhcIlIliGyQv3O3lY568aJipM6oJPYSGs3pRSyNUlK33mvli/NPbh9RNh2TyNweGjgAXA5JjQrkpAR5v6SF5/5M+tRVtgY4z/EoF0O4orpZbHh/rLn8nZvnhVpaY5iCfeBc1Cv3artAv7/+yLJSZSwY4Esv6+pePQLeXPnXcO5DGF7fWsfvRSydU/8+ta8g7tmRUINljT93tMTHB4+wwCVoHu8kZYWO7hv+9UY279zLhuTnQKogm0dbDj3L1syxr/r/Ydj1QdIenN04dgAFG9O24S+g/sx0Xqs7gh5d2x+kA1dtrR5W3KyYWHXeFyCkTdZCAitFMG773jSX7OPwv5cS7gJ3jccV/h0/IkxwJB0YLsFGg4bicq1v8FYxxQLEedN9/Eb3BNETM6ZY2LYsv7xX9+Re2TvqLDUbGwZAM6XLUk97Eg3WLN/VO2CB+7k0e19vNRz/CjbACQrKgwBK3Pz5s29PR9v+7nVVAeZNQx4Go6v92X4LbD8u7x/NPdV3brjtdcGDlxFMSxOzCCZ1AYgmjxZ+Yr7r/zz3Oym6jxbN5Wond56JzPWEx+wb4xJsnPC9UU9Nm24WRXAhlZ5RVOlMwBB/kxIZ3zH6tUD9UN7r7NjERjImdcnEv8y5PCmWjclu2d0+LCqli8fDAwSBJdxenjHECgtVRq46J011+dEG/MsKeACVd6+dNkv67eHfVc5cPB12/7eNTxI9qenuUgBtHHRInb9xst37w56aj65kmJhmE/aF3MfwVytPmo+T3nS2GelHHvwfuo11Vcvr6rKVYcN6kSGHUlIwZdfVt8TX3/1695w4/CoZaMTuso75R50GQGsowyMgYXGgB7VMlJwSi0oPye8nmHLctl/XlLx2teSBHFchaTxlmLIihXqFMBbVz3NtCMQLB2/lX8nWfaL8Bd+OIq1kNy1jOS2l0kerQJgXcFFAl5uuIQ9PosPF3x11Zer4eIsLzUlai8i169fXyBCDRMIyhkbO/bMtQML8nnZz3xS5bi8ymtV72R5imq6LNNpVZ7fZeqk2uA8DZzTUkdixDgy568l72Nvk/H9u4j4tIS3DyodR4fzTqB1kjKqGPL5UAEnL1pj/UV8hgfoFXMZtGoVk6IBOzeP0CLNZ8YsMI+Zhek6CTFuUAdrww2Umb0ExDGBOpzHA+EyNjvs0ASfZbFYMHAqj1vCexYPFhUu48AZ6TADc5fwjumod8jiweP8jGnI0AHS+wwkc9xX8QJZ+QWUWPwECdOfFLk49Ca3w3TSfW9Ni2lzP7m/J3Ae3uHEhY+lTJzd8QEniLxFd5cJBghvcSZX11CSLW0RFhoo4ACuTUIRHqgHsh+qI3lkHWYvVaDHMBLdBoHldyPvCMoESRQVo0GYUAe3QvVXE/n7qTKqY0wHMy9rPkQZDD6I+sEeSWI6zleZTjXqccrOIdH7QnTOh/YNkETXeKB8ohEGIO+vI9kTQPv6kCgYlOyfC5BYR3H7R3YQ1e1KHtUiS/S8gCivZ3JSGPwMUApUWEVmHAebXj79Retv0VlbBW9KURKTGm05D+dMeNDxW/L0JhN3iGcUHCD3rCBx/g/JuHI2aUU9SNo2uVs3k7PmJdInlZLIKyAZjZJbuYZZlvQrbiHhz8LsN5G7aW1yBlFH9D+LtEu/A8w1cj85SPLDDYoz5ScfknbxDaSf+9+qTXloPzmvLyZ5GAM1ABJzR2pQWjBI+hz44nnSkO1WriNqwGQE8khWV6m+65d8j7ShI0j4/OQ21KPMBnLXLSJxBkD352BM4KgUPY6uUAeaUDF6uHm0IlC6OMUpYC/trluGkgWAcMyrCnMJBofZlGccomDes5I8F04g4UVeOk35F0pMm0Farz6k5eaSxOlnZM4mEtlB8v3gJogAvLLoXHTnZszmYZKN+0mfcQP5Sq9VFOwPtlD8739SgzR/8XsyvzoxTVl9O1Onk1X+LDnPzc0Mhvul9xtA/ptuy5SNzK8j9zC4JQY9Mu5y8n53Nsr0z7znBzn9Skpsupqshb/EpNWSyO2WAQkjZfoaMwKYZbj6CdzB70SVa9fmaVYcgQQsXZo6ZFLgMKviHJ3B8ZU9Qeaki9uCw5WRjGHgCICjErM46wCld6BfOAE0RY+feTXCmXwm8cyt20HGrDtPAIfL6N17kHklwOSu8YSdJMGoAzeC7tZK0i++ivxzy04Ah6shaoQ8548j370LMYEFmHjEP/C5fyYJjeMFRCzat2LTnjxkS6VrgocP50vbKrR5cDhPUuVZ4XKJQ+vIc9dLZJx1NvDEe+Q7+/eSs2e3Eh99+AjScgBO6p2qpP6wOKR+ZWT9JL/5HRYjY9T5marxN1aQs3EDeb/3YxJZCFh4eiH6hddpOvh2Du4nG+XIA/EHOO6OShKTvkXea24gwWKHJGNRSmz7EFzbQFrf/mQUn4l+gvvwbP70LorfcRGJgRclJ4xp44SYgymEHc/v88nmQpBoVAB5oqEgnGGBBM8QzAI1UxoUZugoiZFXkWfseNUgg2OtqSDrXsxo6DACElB82o/Jd9s80ntA+XU4ncgJklcrTuA8kZ1L7sv3UvTN35E4ZwrRPij0vL48gGQZ/HUxaPtGAHgufuRByYeqyTNvKWlY3Ti5oRDFHnuA3D/eB2WPDKgbz7w/kfeyGeq9MXIM2V/5EWyq9VgoUF+tbvDtowkOxzEbIsxBSUvak4gH4Evl9rkHx6a++TBp54xJcgheOIcPkfXgrZDdviTGXI0Zu5bki78haxkidNKdV9/MOscGgx9InJdOrZ5RXkDiE2/+NfkSDGyO+woFVkXIvPMpkns/wMj8WMmC6crqm7lEK70Ui8ZVJIonE/UqIX1wcaaMtXI5uU/dR2LclSRKZqGNKWSXfZsSH0FPIbG4aSUXYqV7F+wLjkv1n8NwwBpkOnGGNQmQhCdeZxYD73BmMuEx0QJ7A4oslZwD+5AXJSroRdTcgFmJkbjgqyQ/2kZuM+SZUxqoNoAw2VakWz/zcjvkPHKWL6TYH5+FvkvqJ155zIumUNZTfyExdDTRfnBRSuyT7SBuIQSzItwE7oHCDRTgo8ZEEracW7WNxGhwPttZjUfBJRgHFkIX6iGdFLexbkuLLh65lyzNWGx42UwC1FpNcWYyATCIGUGO00nLxSzaLQqYtEEna2GzBAvbKm9UZScbK0+VWK2xgckzxcs1K9R04jJWM5b+sZRY9FOKlt1OvLKlgdYKCsl70+1EvAaoBSBVkesxLUXThMkRAzA8WozXNNXEytqNSVAReKUMVcyhCCrJUeVYRyURUD/b/klZgkoTIzIpzvoH/5KaOT3D/h7kfrxT2TtcW4eS0y//N5JrV5Bs+ITkx2BP6ALPN6YfA4hnmQEI1WPgEHwkEQioZV/uX4mgnQ9JFBapfP4jI2FwJZRZ4xESZ04hd8MLFDt3JEXun0dufZ0qxyuZNvU/QbMxU0/ZZtXvQARXk2w6AhNiO7lHoBdTyXPJNNhEMGCrlisOkyuXQCR/RsaIc9JFyN21HdIwBO0DWMVFSa878zDmGDYP8Oc/tuENW8jikDesU8lpZ2WZ14vct/5MzkfXkoHVSoALfD/8KVn9BpIDA5GNQOPrU8kzsiQ542lWhe0kd7yJAdYrpcni4rnqemIXrjbkbPKMGcvNquRiNaIaDPDsb5Bv7r3kHMDqNPwJcl9fSO70q4g5iJOAVe3u363sLNYfvBIZNy6CfoIuwnP8oq9TYtVfyQP9JbB0G4OGkO/RV8h+/VU42GtJL72JTNhs3GdOzsED5Lz5RxLdobd4C4K+K3iwceX4SEsPQFTSAPlzm7BBDRtCBCwlF4wUZNdkcTDIev4p0u78JWnZ2WrZ9V4xk+TUb6K2oTrDhDJyDDZk41DWH6bE22vJGIwZQvKMHE36/bBiYWSml2G3rpacVX8h6tGffHfeR/oZvUiHwWkUDwUQ8wEO9AaSjMewjG/B1gW6Dlyi98HWBW37rvvRsXbf+BvFv3sRWdCJXuYeJAbJmH0LJCCu+qQy8YeN2fhzTwElcA7vC1N7QdYMYBKRQPBoPBiEkk1JYFOvXg3SY9Z5kkqQLT0kFGfC3QeRu3E5xRbOJ6fmaPIVv+WBpowstpRlBGKiEhgQukIMGk+JJVjh1q1J5aMx2EsMnpqtaITizz9Dch84Efs5h9k9pWOYa/TuPRUIXDm+bAnJ/e+retbSF9UAeXIyk4Iy+qBi0iZcSvYjt1H89eXJMlwZw1Bt8jMSmwexJx4mt+JZtDs4Aw6wYXouew6hX+sP9e4NHZFU2LTo6aftn69+41vecENfGEo2yijRU5WwCoiC3iQ/qCDn3XfhK4KihdJlBSebQ5TY+DZZry4hY+T52PPgVBqzbb+2TFngwhsAGy/BphzKnsWO92kAM7FzG1nPPI5OPofNKHQCFKyzuAwTikUAIiNjcTUQZ98espb8gZwX52MwZ0I8guS+j34chWWZA2WLvZSLSbM3rCXryfkYLPqaU0TOqw+TUw2lDe5gbpEtLYrz7HfWk7XoQaiNP5HoO0oxgEKQkVBICscrpB7r1nvHsFnXP5rKVW+p4Z6fPZN3YPv3w5FIDCsORppURQokLmJCdkM1sBv+js4Nw4YPxgvk1v3fl8jz28fJd8NPFCHucPTmUgWIWmHQaXnwHSIofFHQT3VKHsUqlQ1bqmhgckVkpQ5ulAcqFcuLbkOSk1BTBZrgxt7nJRUpt8A7/updyIamgNdARqC468BdBWerpV4pb57AT7ZBzVYTdTsXE5etjF5qwB6xCPqPzZR4FMR4jMwyyb8Sh4cBQ/M2Dhr5+/y77rsOb9kzpnSz42blbFY6p6VZRyeQnQ6jSxIgCwSxfxGDL1ODkDuWKkvaeORXZJZ+VzXCf9gQkwdXw3aZnuwEOEIMnAAgUB8iy+450W88N538zYqdw2gg2KL/+UnAuBycDCx6qk+861YJ3YJuFGcgn8uApvDlEA26BJVBh/N4RQLgovfZeB6aoSdyoM8KoTe5nAKHCabGhieAA+UDvYv4Ric7F/YBUvlMiNKkSYKdZvHC/MqWvR4ypOtBd1EyLWZ4YmMuJ5/khnIybvkNNo/XkItVgGBv6P0HHtNF8NHYi5+B3+VCxe7KsGNFCC7imVccxQ2zrmHXSqaD6CjnsTeB9aAvwKXQawDCeZmEcpyngAbXscuCf3MbXJ8Hzx/eKPOE8MbYCyucU7ocv8u0q97wS3xwBQQx2ByoztH86s22ETjWmTRJPe8dOnIrArN3+DBoVAAiqcSE2dBqwL5s3EwyZ3wHq1mO2sHzKpFW1DIep/hvH4Nv5w0YdbBzGFSV0GFO/JuB4s9JO5kspgaaLpehkXrX+itNj7+5jwxMm5QCqjUtLncCOFwJZRF7DfEScUTx81UHRWpemTr3Us7p8ePH17u5wbXkAxhOAvzWqkHMqgzDnO8zBDIPx3nafYFZY8Wb2Lmdov/zX+S8siCp/NiuOI0S7ndgl2o7lJVLTm7B3/geCEPOuBkcJKXiYxACEu/Wc0X8yL4faW7IdHWWNJxsMFDwsoluA8jdvIqit71F+gVwE3SHooO8u3s/Inft7yEW2G4MGIeyYZ6N0wgejJID0u2IVxb0IKugxyuq87hJJBaTo5bzpiuucGnFCnr/0sveHLtnx/aclrrhYddhoYYQI/GAAYYI5CvZdl79NZxNtRBbvMseDK45Xy3PygHF+67TKPFUYt9oB0yPtxn3Pj44f9zaZPdn4mvxMYFkTYPC8boH7rm3YPeWu8ItIRerAdfnz7HU+qSAc1muWZGyojzNwFGD4ih9O24H8gvN+kFnzyu8/Rf3lGNJmcmXZxCYfmy6y8tZg1HN2IlPN/uDjTCY+B2r/LaJwcD5UeYTxZaFtyWnIzjJkdl8z6MFl2Eais97nrP47ln63lkGIERWWcxFwyZO3OP0HvCswcpaaf22+ChxY5Fr/TmOyY6r8cX9yVcXEnHBl2ASuCk0ZPr0j4CBwRfz0p3OAKQyKirU2rzvKxc/0Bzs0eRxLB12CbhIMVe6zpfnG5aPTxOelkBhzZGxExeogZWXZbiHf7cBSEyenOAI9JHjxx+yBp31KxOOMJxI4JqjKvZlQ0nCNhN8M8geWPzw8MmT9+4ZQD5R2va2YlsFzJBxUBGLD8SrqeyOjbm7N5WEdRzsu47JCunEClzpdEs811oiQAkjNPCcyuDdD2GnjXiojgRxoqBEGDDbP7KpZNzsSFF/HKSFTOyMET3+JWAi1qu4v8E3gcLwUoRGTfgJg8NhwMdHuPK0t8sQchKMyFWUqHn8kdu6bX/3oXDNIZu82QZWLNRpt9oXnJUUOLwPTAQKuhu1Z429o+hfb32w6mbcSuSbkydJbXRQm/eTypREFd1068MNvYufDwTzPSAMDxr/vwCnY0qBk8DNn+xsg++QMTjI1YoXLG93b9QuQLwFQXCVsqS/dWfZD0JnDF0f8CHMAleLYJqffghhU4AbP9GAV/c29Rn+lrpgh1EsLi9nndvupKutRnujBUgJjhuG0RTbUll5xXlL7Qp148eCrwJ3HrDpPw3ETXEO3xmLZXk0P98Z21l682UAxcLYDOidjM1zMhw+lRUAksU39L5WUlKze8a1l4b6DN8a8HrwX0jAv6EZWPLaBf9k7f1T81TfdA+fasUCpuEP9RuxlS/UjR3ep46vlzIDfFqHOqxt96RuHaqLda+8+HLu4Z3jw00NUNw5Gu5xsGJipDpM79M6dqrvuSNq5Y03O1m5+Wao97B1Wy4vncET3eVXMtOdTROehAt2L91/92/zD+26JoqbQC5fduH7HP/IEZYm8rl/49gJOhJ60tJhnvh69KXGPmf+YcbceT9cBVWRnuiOdqPTM650Et98RmITIKvqg4ey+EaQRGSsgbMYNxlz1NEOdHk53holbCeAE5wobLjomefehmvhj3A7rfve0XY7DVCqIXa08b5N8p2y3PfeejJ4dO8oPjlV9zvUKqe8AZ+Jfkc736oca2L+XxjI41q6mVtIoZ4DNjWNGndjv+lXKgc8wOE+f6rOaUVTPX7mAaBBjVZhYwdjkrcntbg+ZX687T9ymqqDCXggYQvAn4RofRWQDs/kyTwDx/emM795O4SFGyupC67VTbhnPPBA8CY7gX1kwU234DCNgwmxO4fJAnDYrut0+swApVuqwMxMTnHT5vXre/df98ZcA5dhsqNNeRz4zVH7KjAdJ0zQDmxX4YNDlhRgrNn/UUp3kI9lAAgX5y2Pw35z3h/6TZyW4BSk2Z/XyG6afZd884GRI0ce4sLom46+dZprWvcn3X7rvM4/g4OqcBEv/T8a8I2hordX3+Cp/eTbZrhpuNfGEQx81RyD7XCYMUfSqmNrPuOBPCr3+AkrIIebMCCYeZwOcOyg6+iIi/X4cNbGhwuWJ4tiWXk7Et3PWFxzwdeeYV8Wd17CIyEWLEA8RvsGYEcH2TUApVrjC3l85wxE1b5mJS7HnMv3P2qPTNVamiaIcGgYYrGTZ2LsmUTQKMdFcuiNOlrBQa0ixQsRQEMwBal4AY5D5EAKmF8tAierOJ5yg7l/jxeesXw1/Oilgwc3cT2g6SX4tNhtk+rSKX91KUDp3vDdM/z/ZSwUmQ3gelx14Gh+DljXEZMtYpGhHFmLyItCbAFUCKCKcgMRB4Bh04czFU8YkSB1ruk9KH1ZOx1/9hY+4OQzPD6myrTHwMBlzF7RdF5XfX8uAKU7x9es+CYRX5ZBQywuxxJiszn8mCNsOYiU4yQ1hALy0ihg+nLMko2wHI48KZkwoRGZYL1jCcTER1OnmnwiM2b27DbvjpU69afPFaB099SKx95LHHHjw4f+yrWbft/Rb4Ci4yRYpE6DP/PK1NH2uNz/AU/GB4oj4BlWAAAAAElFTkSuQmCC","Gusto"),$x=Gx("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAACQNJREFUeAHtXA1snGUd/713vY+2d21v7daOjiluDHCuMHDDoTJs2MgkhpBpENQoc8aNaDB+xGQawGk0LItRIwHJIpmEEAUlokQcWNBliEOELYyvfZdttOu6Xtu73ved/99zfddbe733fXvvdVvv/Wd37/O+z9Pn4/f+v5/bo2EcBTbvXyyP1gPaag2YD00LjGsys25zuUgO6AZyO2Rh2yL3XLqvcIGCwSjdt88bcPt/jhw2ahpc+uNquuZyyELDg5FM/Nu4b3GSa88DpMDx/U2D1llNgEy21hxyXZFMYg1BUpxCznHAGYOLWChpIgfldY5rb7WK1RgsZ5eUuCHbQQ5a74BzNji8G8VkvQCkrZ5Y7TzJI6CtdilT7uBRFAFi45rxfk7RpZt8KD6gsmImm1dlMwcgg9fuAOQAZICAQbXDQQ5ABggYVDsc5AA0hoDEV0hl5MsCVQ0HpbI5eN3ArR8OMM4yTTMeIHLNSDKHecEa/G5tK76yNIh4yjwXzViAKEkjqaxwjYaNyxvRta4dN19Wj+7BNISZTFON6ZbneUOuOSsrT2byadKLG2vwmcsbsO7qBnS0ec/M/shA6kzZTOG8BKjwBevqQn9GkdHBICfo3FDn0dDe6ME1F/mwZlEdVi2oQ2tAlM44OiQAWdFB5xygtKwwJW9d8sCokeRL/pNflb543omkwC0KgSIT9LjQVOvCXNErlzR58JFWr/pcPtuLJv/kWmNEdM/+UykZYxxqJW7PCUBceCItVkVGXzAr/9avbPOpxbYG3agXALidQJOckcZ84x5Bp7ZGUx+/cEvA6wK5xgqdGEorHeRiFswkTTtAMXmLIXn7ty8J4PaOIJa1+xD0WXilJhdWrNl/jycQjmfhE6DN0rQBlM5ySjnc0RHAdz8RwhIRi0rQcJJbW1AcNr7/Fw/HYNFPxLQARHFqE9HZsroFtwnnVIpe6o6jJ5LGmkvrJwwxmMhiZ3dM6bAJlSUeVByguICzZI4Xj6ydg45WX4mpTL3q4OkUHnx5EC31bnxzRSNqi+gmgndYLBiNgBWqKEDknKWifJ/4fBvmN9k/1Ft9STy8ewjPHoji7hVN2CAO4WT0xBsRiN9oyYKxL/tnPTpDWqAPCCiPfq7VVnB6IhnsPBrD7/dGBJgRxZ3bP9uK5e3+ybABfZ9n94/AR1/BIlUEIJrxWjHVD98yB4uaPRanNNacin0glsFBWeArxxL415EYdh+Po/t0GnQHNnfOwsZrRaQMrNL2/w3jZDRj2S3gTCoCEEVr0/Uh3HBJ7dhqDUp04vadTGJPTwIH+lN4XzilO5zCexI79Uo5ElfeJOaFPPj+ypCKr8ihRnRMfJ9H9wxbMu2FfRqPUNjaRDkhorV8nh93X9dkojUU+z8u4vLUm1G8259EVMy0Hk4wptDERZrld+OjEjrcekU91i4OoL3B/LR/LcqbAapVp1KfvPmR9L8wuJLb7/lUSLzh0vJOlv/Vv8N45LUhnAjnI0y/V0NznRshAaRN4qhFLR5ce7Ff6ZfF4jdZVSGvnkhg26tD8BuIYKkl2QoQTfrNo4FiqUGfeiuKTTv68baIU4OY5s6Ftej8UJ1wng8LRIQC4lnPEm/bqkkuHFOJ+XP9GBb/x4rnXNgHy7YCxBDqGx9rxGSuBsOMTc/34xcvhTFbgPnWJ0P4wpVBLJ3rU4Ho+MmVc7911wC6DsWK+kRW+rUNoKTonuvm+3H9B+uKjn98OI07/9iLFw/HsWFZI77z8SYsLMPCFR1k9OEz70SxZWe4LNHS+7cNoIyY5Dsk+CQXjSc6dGsf71Hm+Pk7LxIQzVu38X0Z3TMg3fB0nziF+fSJUXujelsAot/DWOumhRO55/X3E7jtD71YJXrmpzc2o6GCkfte0WlffLIXJ0cyU3IKi4FlC0AUrxVibeZJmrOQ3uhN4ut/7sOmlU348lUNhVW2l3cfi+NLIsJHwmnbwOEkz17RFKdNv4UpzkLDfkgCyB91ncaWm5qx0oLDOJUp/FV0zl1/6UOvuA5TCSdKjVk2QASHYkMO0umUsPhvdg/i3s6QpEIrE8FzLJryrbvCuH/nAJi6tRscjlE2QJzYZS1elTplhwwZ/vRmBF8TS1UpK8VxXhFl/ENxGWjK6QiW4zOxv8nIBoCgEubMwVBZM5ZaJcqayfRK0FHRMQ/8ZxC/FQ+Z2cNiuR87xy0bIIrYVXPz6VPGUQslCU8n0G5691QS218fxmN7IjguASi943I8ZLPzKxsg7jgwPCBxpyFoo8rpE12262gcT0qy67lDI+in+ZY9m0pzTSF4ZQHEXcwrRP8sG01WWdmQK5yEXh6IZVXkTZPN3M/Lcn1PRIr5fu6H1RXzQvU/rtB1ygCJ64OgRN8P3TIbjRJYPv12VO5daJCNO17rpI6LovKk+ad+okKPieWJSgAZTmQkGZbDsaEUDshm3n5xC5hbpvhE5McGJP4aw1tGJK46KfNrSgBx+hlB6P5Pt6j4696ufmx+YUBt+BEUj/TqFWA8UuZuKIm6ipuAoqaQFJCYN+KHIQoBZIDrli+2n04RUpMr8TUlgBiVf/XqINZd04C9PUmxKkOoF67hIlOCRFL+p1WUm8l5RiA88pHK/D8FCL+U32K/Pi+xXOtVlgFiWMGdip/JHhcB+Mk/T4N7TnpeWNY99uMA3ig6U9AfXDDXIrH35HOnHvGL2Gxd06wSWv8Qy/LMOyO2pBUmH/Xc1lgCKCMs8z3ZNl4p6Qoq3F9KypRphQuXP4zBNw0Q06l3ycbcD24IqV65U/mCJL+mw1kzXkblWpjWQXRB/i4bdR2vDcuuglu4Z1D9PGWmA6QFf3zwjK0xeg8009y+9Yi54h9Z+SGSUd/na71pDuICdD/lfF1MJeZlWgdVYvALoU8HIIO35ADkAGSAgEG1w0EOQAYIGFQ7HGQIkJyfY9CmeqsFG5d4xN3Vi0DplRMbETF18lLpllVbm9tBHbRNshjMiztUgMAoJttc6swuOZaqoM4pEgEe1SXnmSkrxjO7eCyVg0wegfwRXXKOmZACiGd18cwuUUoPVLO4ce3EQD+/jABNyJY6xwSefUzg/wE1Aw9b7HP6YgAAAABJRU5ErkJggg==","Freshbooks"),eT={GUSTO:Jx,FRESHBOOKS:$x,FRESHBOOKS2:$x,SHOPIFY:Xx,STRIPE:Qx,SQUARE:Zx,UBER:Gx("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAABlNJREFUeAHtnN0vH0sYx586nL5qvFRflHoXOYSkTSsu3IpWpHdSDeGCK3Evxx9xQuqllaC3biTSlpIjlbghLuQkTuIlNKVatKmEaqOYPt9frO4P+/vtzL5Q9knmt7uz88zM89mZ3dln5rdEByWTo/7hMMFhjYM44QE2wlbYDNsN5U8+84TDNoeTDsXIPtgOBmDhJ4j4l4OR4mmLBws/SKB22iAEsxdM6AwH9Lv/OIRw8OQXgR3ezf6Df/7mkPcr3tvbJYDGs4kf3MH/2o30Nv4E/gcgPOYu+cd7R7sE1gEINytPDAh4N2YDMFq0B0gjYbD1ABmA0aJDtR23t1FRUZSamkrp6emUkJBAMTExdOHCBV81vn79Sp8+faK3b9/S1NQUzczM0JcvX9yuoq88VwHdunWL7t+/Tw8ePKA7d+5QbGwsnTmD54SxCCHo/fv3NDY2Rq9evaLe3l5aWFgwVnDgTLAht+Xzd+/eFe3t7YJbBdtrTVZWVkRbW5u4ffu25XoxSzN5mEpkJqMDaVJSUnxgvn//bo3KIdobGxvi2bNnIjEx8UC5Jg03q+cMoOrqavHx48dDTLM3irufqKysNGusSjp7AV2+fFl0dHTYS8FEbk+fPhUXL15UARBMxz5AN27cEG/evDFhjjNJ+vv7xdWrV4MZLHveHkCAMzo66ozlErkODw8LHjLIQgiU3jogdKuhoSEJM5xNipZkY3ezBojHMaKzs9NZixVyb21tDdQqZM5ZA1RVVaVQfXdUysrKZEAYpVUHlJSUJDBwO66yuLgo4uLijAw3G68O6Dh2rf0Xq6WlxSwIo3RqgDDUd2KEvN9Aq8f84iuysrKMjA8ar+zuqK2tpbNnzzrwamhvlvAQ1NTUWMo0KMX97zbo1+x+sHpxXdNfXl4W165dk7YTdiu5O4qKiigiIkL5qqytrRG/p0np80CULl1Sm1uAr6mwsJCeP38uVaaWWJpsT0+P8tVfXV0Vubm54vz581IhPz9fMFjlcru6uqTtZEDQkbtJR0ZGCjw+VWVyclKEhYVJVxZA5+bmVIsV7J0U4eHh0uVK36TT0tKI+7PW+qS38CCGhsr3bOgE8z4GqszNmzcpOTk5UJJDz0kDyszMpJAQabW9wrkl7O27uQPAuLiyIn0pl5aWiP09suXspYf+9jaW4bgvmByQFWlAcJwj/I5y5coV6Wqr9xXpoo5eQZtWkqnJqQIkA0ZLe6oA8UyIZrfprfQ9qLi4mB4/fkw8IDFdiD4hRtB1dXW0ubmpj3ZlH7O1siINKDo6mh49eiRbzl76+fl5qq+v3zt2cwdT2bIi3cUmJiZoZwfL99SEXSRqiha1tra2aHp6WjoXaUAo5MOHD9IFaQromj9+/NAOTW9VdPSZYz5/dnZWH2VqX7qL8cumbyEBhu4qcv36dcrLy6Px8XEp9Xv37pHKOEYrZGRkhNbX17VD01tpQMj5xYsX9PDhQ9OF6BPyFBH19fUR+7L10QH38Q7GE4J07ty5gOkCnUSdVUX6DZeXrYjPnz8rv1m7rYg1AqqTidL3IFwFdndQd3e36gVxXY99QVItdn8FpVsQZyBycnLEt2/f3G4M0uXxfUdkZGQo2Qg7AUtZGQuZjrs0NjYq22cZEC+pc2UNkOpF4EGpwKIKK43AUgtCwRUVFar1d1SPB7OipKTEKhzoq3cxTRdL4Y6b2NC1NLjWAfF0jBgYGDg2jHjM45sx0S6gxa11QKgAxhlYvHTUMjg4KHgNtnb17djaA0iD9Pr16yNjhJZjMxx77kH6JoyVXVhR4bY0NDTY2a30Lc++FqQHVV5eLvCYdVowIVhaWqo3yO59ZwABVnx8vGhubhYYzdotmIbGk4q9CnYD2Z+fc4C0FpWdnS2ampoE+5Esc8K0N8DwBOZ+Qxw5dvUfh1ihUVBQ4PszC/w7vIwm6DQ0HGVw0/ISY3r58iXxcIIw+eiWuApIbxT8Qpgrx1+iMOMJZ5g2b6X/OxT+CgVPoIqzS1+e6v6RAVKtsNt6Sv4gtyt5lOV5gILQ9wCZACTv6g+S6Qk6vY4W9O4EGWS3Ke8AqN/uXE9Qfv14zHufxzn8ivo+j6OdesI7jgzVf+N8wWRPvE90+TeQA5/oAilAAjWssDytrQm2g4Hf98v42E9wT8In87zPBDKEn02Y0wmZAdg6AAAAAElFTkSuQmCC","Uber")};function tT(e){return eT[e]??Ku}const nT=Rt({base:{padding:"15px",borderBottom:"{borderWidths.md} solid",borderColor:"border.layout.weak",backgroundColor:"surface.foreground",display:"flex",flexDirection:"column",borderTop:"none",borderLeft:"none",borderRight:"none",width:"100%",justifyContent:"space-between",alignItems:"start",gap:"5px"},variants:{active:{true:{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",cursor:"pointer"}}}}}),rT=St({display:"flex",flexDirection:"column",gap:"16px"}),aT=({integration:e})=>{const{mutate:t}=Av(),n=Dl(),r=jx(e.apiName);return E(su,{children:S(Tu,{onClick:()=>(async()=>{const a=await(async e=>td({title:"Remove Institution",body:E("div",{className:rT,children:E(ml,{wrap:"wrap",children:`Would you like to unlink ${e} altogether?`})}),buttons:[{key:Kc,label:"Cancel"},{key:Yc,label:"Remove",type:ed}]}))(r);n?.setOpen(!1),a===Yc&&t({id:String(e.id)})})(),children:[E(Nc,{Component:Dx}),E(ha,{children:"Remove Institution"})]})})};function oT({integration:e,isLastItem:t}){const n=jx(e.apiName),r=function(e){if(e)return`Last synced ${bn(e)}`}(e.lastSyncedDate),a=tT(e.apiName),o=Pt(nT({active:!1}),To);return S(Fx,{children:[E(Ux,{children:S(oh,{children:[E(xs,{Component:a}),E(ha,{children:n}),E(xx,{children:E(aT,{integration:e})})]})}),S("div",{className:o,children:[r&&E(ga,{intent:"normal",children:r}),E(ha,{wrap:"wrap",children:n}),e.apiUsername&&E(ha,{wrap:"wrap",children:e.apiUsername})]}),!t&&E(ui,{alignment:"horizontal",color:"strong"})]})}const iT=St({overflow:"hidden"});function lT({manualBankAccounts:e}){return S(Fx,{children:[E(Ux,{children:E(oh,{children:E(ha,{children:"Manually Tracked Accounts"})})}),E("div",{className:iT,children:e.map(e=>E(Hx,{bankAccountId:e.id,name:e.name,mask:e.mask,active:"ACTIVE"===e.status},e.id))})]})}const sT=Pt(St($i,{minWidth:"100%",justifyContent:"start",paddingBlock:"10px",marginBottom:"5px"}),xo),cT=St({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),dT=St({display:"flex",flexDirection:"column",alignItems:"start",width:"100%",marginInline:"15px"});function uT(){const{linkPlaid:e,loading:t}=Nv();return E("button",{className:sT,disabled:t,onClick:()=>{vr("Add New Connection button pressed"),e({plaidEvent:hv,message:"Add New Connection button pressed"})},children:S("div",{className:cT,children:[E(Nc,{Component:Rh}),S("div",{className:dT,children:[E(ha,{children:"Connect your bank"}),E(ga,{children:"Find your banking institution with Plaid"})]}),E(Nc,{Component:ko})]})})}const hT=St({marginBottom:"20px"}),pT=St({display:"flex",marginBlock:"20px",flexDirection:"column",gap:"15px"});function gT({title:e,children:t}){return S("div",{className:hT,children:[E(ga,{children:e}),E("div",{className:pT,children:t}),E(ui,{alignment:"horizontal"})]})}const mT=St({padding:"10px 8px",minWidth:"100%",height:"45px"}),vT=St({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function bT({bank:e}){const t=$g(e.institutionName);return E("div",{className:mT,children:S("div",{className:vT,children:[t?E("img",{src:t,alt:`${e.displayName} logo`,width:"25px",height:"25px"}):E(xs,{Component:Ku}),E(ha,{children:e.displayName})]})})}const fT=St({minWidth:"100%",height:"45px"});function yT(){return S(I,{children:[E(Wa,{styles:fT}),E(Wa,{styles:fT}),E(Wa,{styles:fT})]})}const kT=Pt(St($i,{minWidth:"100%",padding:"10px"}),xo),xT=St({display:"flex",justifyContent:"space-between",alignItems:"center",minWidth:"100%",width:"100%",height:"25px",gap:"15px"}),TT=St({display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",gap:"12px"}),CT=St({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"});function wT({integration:e}){const{linkPlaid:t,loading:n}=Sv(),r=$g(e.apiInstitutionId??void 0),a="PLAID"===e.apiName,o=tT(e.apiName),i=jx(e.apiName);return E("button",{className:kT,disabled:n||!a,onClick:()=>{vr(`Relink button pressed for plaid item ${e.id}`,{integration:e}),t({plaidEvent:pv,plaidItemId:e.id,apiAccessToken:e.apiAccessToken,apiErrorCode:e.apiErrorCode,message:"Already Connected Plaid Institution button pressed"})},children:S("span",{className:xT,children:[S("div",{className:TT,children:[r?E("img",{src:r,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):E(xs,{Component:o}),E(ha,{children:e.apiInstitutionName??i??void 0})]}),a&&S("div",{className:CT,children:[E(Eo,{Component:Sc}),E(ml,{children:"Relink"})]})]})})}const AT=e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:224,height:64,viewBox:"0 0 224 64",...e},h.createElement("g",{fill:"none",fillRule:"nonzero"},h.createElement("path",{fill:"#95BF47",d:"M48.024 12.24a.567.567 0 0 0-.536-.495c-.224 0-5.008-.36-5.008-.36s-3.31-3.33-3.712-3.69c-.357-.36-1.073-.27-1.341-.18-.045 0-.716.225-1.878.585-1.118-3.285-3.086-6.255-6.529-6.255h-.313C27.768.585 26.517 0 25.487 0c-8.048 0-11.894 10.125-13.1 15.255-3.13.99-5.367 1.665-5.635 1.755-1.744.54-1.789.585-2.012 2.25C4.56 20.52 0 56.07 0 56.07l35.549 6.705L54.82 58.59c0-.045-6.752-46.035-6.797-46.35zm-14.443-3.6c-.894.27-1.922.585-2.996.945V8.91c0-1.98-.268-3.6-.715-4.905 1.789.27 2.951 2.295 3.711 4.635zm-5.947-4.185c.492 1.26.805 3.015.805 5.445v.36c-1.967.63-4.07 1.26-6.215 1.935 1.207-4.635 3.487-6.885 5.41-7.74zm-2.37-2.295c.358 0 .716.135 1.029.36-2.594 1.215-5.321 4.275-6.484 10.44-1.7.54-3.354 1.035-4.919 1.53 1.342-4.68 4.606-12.33 10.374-12.33z"}),h.createElement("path",{fill:"#5E8E3E",d:"M47.488 11.7c-.224 0-5.008-.36-5.008-.36s-3.31-3.33-3.712-3.69a.716.716 0 0 0-.492-.225l-2.683 55.35 19.273-4.185s-6.752-46.035-6.797-46.35a.776.776 0 0 0-.581-.54z"}),h.createElement("path",{fill:"#FFF",d:"M29.02 22.41l-2.37 7.11S24.55 28.395 22 28.395c-3.756 0-3.935 2.385-3.935 2.97 0 3.24 8.407 4.5 8.407 12.105 0 5.985-3.757 9.855-8.854 9.855-6.126 0-9.211-3.825-9.211-3.825l1.654-5.445s3.22 2.79 5.902 2.79c1.789 0 2.504-1.395 2.504-2.43 0-4.23-6.886-4.41-6.886-11.385 0-5.85 4.159-11.52 12.61-11.52 3.22-.045 4.83.9 4.83.9z"}),h.createElement("path",{fill:"#000",d:"M77.835 35.263c-1.938-1.032-2.93-1.93-2.93-3.141 0-1.526 1.398-2.513 3.56-2.513 2.524 0 4.777 1.032 4.777 1.032L85 25.256S83.378 24 78.6 24c-6.669 0-11.31 3.814-11.31 9.154 0 3.051 2.163 5.34 5.047 7 2.343 1.301 3.154 2.243 3.154 3.634 0 1.436-1.171 2.603-3.334 2.603-3.2 0-6.264-1.66-6.264-1.66L64 50.115S66.794 52 71.526 52c6.85 0 11.807-3.365 11.807-9.423-.045-3.32-2.524-5.61-5.498-7.314zM103.897 24.304c-3.316 0-5.925 1.62-7.914 4.053l-.089-.045L98.768 13h-7.472L84 52h7.473l2.476-13.33c.972-5.044 3.537-8.152 5.925-8.152 1.68 0 2.343 1.171 2.343 2.838 0 1.035-.088 2.341-.31 3.377L99.078 52h7.473l2.919-15.762c.31-1.666.53-3.648.53-4.999.045-4.368-2.166-6.935-6.102-6.935zM127.92 24C118.943 24 113 32.23 113 41.4c0 5.859 3.565 10.6 10.255 10.6C132.058 52 138 43.994 138 34.6c.044-5.456-3.081-10.6-10.08-10.6zm-3.653 22.185c-2.552 0-3.609-2.191-3.609-4.965 0-4.338 2.201-11.405 6.25-11.405 2.641 0 3.521 2.326 3.521 4.562 0 4.652-2.244 11.808-6.162 11.808zM157.168 24c-5.102 0-8.01 4.489-8.01 4.489h-.09l.447-4.045h-6.713c-.313 2.712-.94 6.89-1.521 10L136 62h7.563l2.104-11.156h.179s1.566.978 4.43.978c8.906 0 14.724-9.066 14.724-18.222 0-5.067-2.282-9.6-7.832-9.6zm-7.25 22.133c-1.969 0-3.133-1.11-3.133-1.11L148.04 38c.895-4.711 3.356-7.822 5.996-7.822 2.328 0 3.044 2.133 3.044 4.133 0 4.889-2.91 11.822-7.16 11.822zM176.287 14A4.25 4.25 0 0 0 172 18.284c0 2.186 1.414 3.716 3.536 3.716h.088c2.343 0 4.332-1.574 4.376-4.284 0-2.186-1.459-3.716-3.713-3.716zM166 52h7.736L179 25h-7.782zM198.487 25.574h-5.453l.277-1.276c.462-2.642 2.034-4.965 4.668-4.965 1.387 0 2.496.41 2.496.41l1.525-6.06S200.66 13 197.748 13c-2.773 0-5.546.774-7.672 2.551-2.681 2.233-3.929 5.467-4.53 8.747l-.23 1.276h-3.652l-1.156 5.831h3.652L180 53h7.81l4.16-21.595h5.408l1.11-5.831z"}),h.createElement("path",{fill:"#000",d:"M216.005 25s-4.788 11.928-6.912 18.45h-.09c-.135-2.1-1.897-18.45-1.897-18.45h-8.04l4.607 24.615c.09.536.045.894-.18 1.251-.904 1.698-2.395 3.35-4.157 4.557-1.445 1.027-3.071 1.697-4.336 2.144L197.123 64c1.536-.313 4.788-1.608 7.498-4.11 3.479-3.216 6.731-8.22 10.029-15.01L224 25h-7.995z"}))),ET=Pt(St($i,{minWidth:"100%",justifyContent:"space-between",paddingBlock:"10px",marginBottom:"5px"}),xo),IT=St({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"}),ST=St({display:"flex",flexDirection:"column",gap:"12px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),NT=St({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),PT=St({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",outline:"none",backgroundColor:"surface.foreground",fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px",padding:"12px 16px",borderRadius:"md",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"}}),DT=St({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"});function RT(){const e=Dl(),{mutateAsync:t}=xv(),[n,r]=f("");return S("div",{className:ST,children:[E(ha,{children:"Enter your shop name"}),E("div",{className:DT,children:E(AT,{})}),E(ml,{children:"Please enter the name of your shop below."}),E("input",{className:PT,value:n,onChange:e=>r(e.target.value),placeholder:"Enter shop name"}),S("div",{className:NT,children:[E(Ym,{showIcon:!1,onClick:()=>{e.setOpen(!1)}}),E(zc,{onClick:async()=>{const r=await t({apiName:"SHOPIFY",apiUserId:n});window.open(r.url),e.setOpen(!1)},children:E(ha,{children:"Connect"})})]})]})}function MT(){const e=tT("SHOPIFY")??Sc;return S(Pl,{placement:"bottom",modal:!0,children:[E(Rl,{children:t=>S("button",{className:ET,...t,children:[S("div",{className:IT,children:[E(xs,{Component:e}),E(ha,{children:"Shopify"})]}),E(Nc,{Component:ko})]})}),E(rh,{children:E(Ak,{children:E(Ik,{width:"sm",children:E(RT,{})})})})]})}const OT=Pt(St($i,{minWidth:"100%",justifyContent:"space-between",paddingBlock:"10px",marginBottom:"5px"}),xo),LT=St({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function FT({apiName:e}){const{mutateAsync:t}=xv(),n=jx(e);if("SHOPIFY"===e)return E(MT,{});const r=tT(e)??Sc;return S("button",{className:OT,onClick:async()=>{const n=await t({apiName:e});window.open(n.url)},children:[S("div",{className:LT,children:[E(xs,{Component:r}),E(ha,{children:n})]}),E(Nc,{Component:ko})]})}const BT=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE","UBER"];function UT(e){return BT.includes(e)}const VT=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE"],WT=St({margin:"15px"}),HT=St({overflowY:"auto"});function qT({connectedBankNames:e=/* @__PURE__ */new Set}){const{query:{data:t},isFilling:n}=Ey(),r=t?.multiAccountIntegrations,a=t?.integrations,o=Tn(r)&&r.length>0||Tn(a)&&a.length>0,i=Vc.filter(t=>!e.has(t.displayName)),l=function({connectedIntegrations:e}){const t=v(rs),n=He(e=>e.externalOptions.banksAndIntegrations?.integrations),r=n?.filter(UT),a=e?.map(e=>e.apiName)||[];let o=r??VT;return t&&(o=o.filter(e=>{switch(e){case"GUSTO":return t.hasPayroll;case"SHOPIFY":return t.hasShopify;case"SQUARE":return t.hasSquare;case"STRIPE":return t.useStripeInvoicePaymentProcessing;default:return!0}})),o=o.filter(e=>!a.includes(e)),o}({connectedIntegrations:a});return E("div",{className:HT,children:S("div",{className:WT,children:[(n||o)&&E(gT,{title:"Already Connected",children:n?E(yT,{}):S(I,{children:[r?.map(e=>E(wT,{integration:e},e.id)),a?.map(e=>E(wT,{integration:e},e.id))]})}),S(gT,{title:"Banks",children:[E(uT,{}),i.length>0&&S(I,{children:[E("div",{className:St({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"}),children:i.map(e=>E(bT,{bank:e},e.institutionName))}),E(ha,{children:"...and 12,000+"})]})]}),l&&l.length>0&&E(gT,{title:"Integrations",children:E("div",{className:St({display:"flex",flexDirection:"column",gap:"8px"}),children:l.map(e=>E(FT,{apiName:e},e))})})]})})}const jT=St({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"15px",padding:"40px 20px",backgroundColor:"surface.foreground",borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"});function zT({showPlaidItems:e,showNewConnectionContent:t,multiAccountIntegrations:n,integrations:r,numIntegrations:a,manualBankAccounts:o}){return t?E(qT,{}):e?S(I,{children:[n?.map((e,t)=>E(Yx,{integration:e,itemIndex:t,numIntegrations:a},e.id)),r?.map((e,t)=>E(oT,{integration:e,isLastItem:t===r.length-1},e.id))]}):o&&o.length>0?E(lT,{manualBankAccounts:o}):S("div",{className:jT,children:[E(xs,{Component:Ku}),E(ha,{wrap:"wrap",textAlign:"center",children:"If you prefer to manually input your transactions as opposed to having them automatically tracked, you can add your Manually Tracked Bank Account(s) here."})]})}const KT=Rt({base:{display:"flex",flexDirection:"column",gap:"15px"},variants:{hideManualBanks:{true:{marginTop:"0px"},false:{marginTop:"15px"}}}}),YT=Rt({base:{overflowY:"auto"},variants:{height:{fill:{height:"100%"}},background:{foreground:{backgroundColor:"surface.foreground"}}}}),_T=Rt({base:{paddingTop:"20px",paddingBottom:"20px",display:"flex",justifyContent:"center",alignItems:"center",position:"sticky",bottom:0,backgroundColor:"surface.background"},variants:{hasPlaidItems:{true:{borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"}}}}),GT=[{label:"Connected Accounts",value:"connected"},{label:"Manually Tracked Banks",value:"manual"}];function QT({showCloseButton:e=!1,onPlaidLink:t,hideManualBanks:n}){Sv();const{query:{data:r},isFilling:a}=Ey(),o=r?.multiAccountIntegrations,i=r?.integrations,{query:{data:l}}=dd({select:e=>{return{...e,plaidItemAccounts:(t=e?.data,t?.filter(e=>wd(e.apiName)&&("ACTIVE"===e.status||"INACTIVE"===e.status||!1===e.isSupported))),manualAccounts:jp(e?.data)};var t}}),{mutate:s}=Cv(),c=l?l.manualAccounts:null,d=o&&i?o.length+i.length:0,u=o?.find(e=>e.apiErrorCode),h=u&&cc(u,!1),p=He(e=>e.externalOptions.banksAndIntegrations),g=p?.integrations,m=n??(void 0!==g&&!g.includes("MANUAL_ENTRY")),v=He(e=>e.banksAndIntegrationsSelectedTab),b=He(e=>e.setBanksAndIntegrationsSelectedTab),f=m||"connected"===v.value,y=0===d&&f,k=f?"Add New Connection":"Add New Account";return E(bv,{onPlaidLink:t,children:S(I,{children:[E(lh,{hideDivider:m,children:S(oh,{children:[e&&E(dh,{}),E(ha,{children:"Banks & Integrations"}),E(Zl,{onClick:()=>s(),active:!1,children:E(Nc,{Component:Sc})})]})}),h&&E(hx,{task:h}),!m&&E(dx,{options:GT,handleClick:e=>b(e),selected:v}),a?E(kx,{}):S(I,{children:[E("div",{className:YT({height:y?"fill":void 0,background:y?"foreground":void 0}),children:E("div",{className:KT({hideManualBanks:m}),children:E(zT,{showPlaidItems:f,showNewConnectionContent:y,multiAccountIntegrations:o,integrations:i,numIntegrations:d,manualBankAccounts:c})})}),!(f&&y)&&E("div",{className:_T({hasPlaidItems:d>0}),children:S(gd,{onClick:()=>{ki(f?"NewConnection":"BankAccountForm")},disabled:f&&!1,children:[E(Nc,{Component:Gi}),E(ha,{children:k})]})})]})]})})}function ZT({onPlaidLink:e,hideManualBanks:t}){return E(Oy,{children:E(QT,{showCloseButton:!1,onPlaidLink:e,hideManualBanks:t})})}const XT=Ce("tight-component-store",1,{upgrade(e){e.createObjectStore("queryClient")}}),JT={queryClient:Pn,persister:/* @__PURE__ */function(e="reactQuery"){return{persistClient:async t=>{await async function(e,t){return(await XT).put("queryClient",t,e)}(e,t)},restoreClient:async()=>await async function(e){return(await XT).get("queryClient",e)}(e),removeClient:async()=>{await async function(e){return(await XT).delete("queryClient",e)}(e)}}}(),maxAge:Nn,dehydrateOptions:{shouldDehydrateQuery:e=>!e.isStale()}};function $T({children:e}){return E(we,{client:Pn,persistOptions:JT,children:e})}const eC=St({position:"absolute",top:0,left:0,width:{base:0,sm:"100dvw"},height:{base:0,sm:"100dvh"},minWidth:{base:0,sm:"100dvw"},minHeight:{base:0,sm:"100dvh"},maxHeight:{base:0,sm:"100dvh"},maxWidth:{base:0,sm:"100dvw"},overflow:"hidden",backgroundColor:"overlay"}),tC=St({position:"absolute",top:0,left:{base:0,sm:"auto"},right:0,bottom:{base:0,sm:"auto"},width:"100dvw",height:"100dvh",minWidth:"100dvw",minHeight:"100dvh",maxHeight:"100dvh",maxWidth:"100dvw",overflow:"hidden"}),nC=Wt(null,Ot.component,tC);function rC({children:e}){const t=p(null),n=p(null);return S(he,{lockScroll:!0,children:[E("div",{className:eC}),E("div",{onMouseDown:e=>{n.current=e.target},onClick:e=>{const r=n.current===t.current,a=e.target===t.current;r&&a&&(n.current=null,He.getState().requestCloseAllDrawers())},ref:t,...nC,children:e})]})}const aC=m({drawerHistory:[]});function oC({children:e}){const t=He(e=>e.drawerHistory),n=g(()=>({drawerHistory:t}),[t]),r=t.length>0;return E(aC.Provider,{value:n,children:r&&E(rC,{children:e})})}const iC=m({isActive:!0,isInHistory:!0});function lC({Component:e,name:t}){const{drawerHistory:n}=v(aC),r=n.at(-1);if(void 0===r)return null;const a=n.find(e=>void 0!==e[t]),o=void 0!==r[t],i=void 0!==a;return a&&a[t]?E(iC.Provider,{value:{isActive:o,isInHistory:i},children:E(e,{...a[t].routeProps})}):void 0}const sC=Rt({base:{position:"absolute",right:0,top:0,left:{base:0,sm:"auto"},bottom:{base:0,sm:"auto"},height:"100%",maxHeight:"100%",maxWidth:"100%",backgroundColor:"surface.background",width:{base:"100%",sm:"512px"},minWidth:{base:"100%",sm:"fit-content"},display:"flex",_focus:{outline:"none"}},variants:{shouldDisplay:{true:{},false:{display:"none"}},animationVariant:{slideInRight:{animation:"slideIn.right"},slideInUp:{animation:"slideIn.up"},slideOutRight:{animation:"slideOut.right"},slideOutDown:{animation:"slideOut.down"},none:{}}},defaultVariants:{shouldDisplay:!0,animationVariant:"none"}});function cC({children:e}){const t=p(null),{isActive:n,isInHistory:r}=v(iC),{animationState:a,handleAnimationEnd:o,shouldDisplay:i}=function({isActive:e,isInHistory:t,focusRef:n}){const r=p(!1),a=p(!1),[o,i]=f("none"),l=He(e=>e.closingDrawerCount),s=l>0,c=e&&s,d=e||s||t;w(()=>{e&&t&&!a.current&&!s&&i("opening"),r.current=e,a.current=t},[e,t,s]),w(()=>{c&&"closing"!==o&&i("closing")},[c,o]);const u=y(e=>{("slide-out-right"===e.animationName||"slide-out-down"===e.animationName)&&(l>1?He.getState().confirmCloseAllDrawers():He.getState().confirmCloseDrawer()),i("none")},[l]);return k(()=>{e&&!s&&n.current?.focus()},[e,s,n]),{animationState:o,handleAnimationEnd:u,shouldDisplay:d}}({isActive:n,isInHistory:r,focusRef:t});return E("div",{ref:t,tabIndex:-1,className:sC({shouldDisplay:i,animationVariant:/* @__PURE__ */function(e){return"none"===e?"none":"opening"===e?"slideInRight":"slideOutRight"}(a)}),onAnimationEnd:o,children:e})}const dC=Wt(null,St({display:"flex",backgroundColor:"surface.foreground",flexDirection:"column",height:"100%",maxHeight:"100%",overflowY:"auto",overflowX:"hidden",minWidth:"fit-content",borderLeft:"1px solid {colors.border.layout.strong}",justifyContent:"flex-start",alignItems:"center",padding:5,gap:"10px"}));function uC({children:e}){return E("div",{tabIndex:-1,...dC,children:e})}const hC=Rt({base:{display:"flex",height:"100%",maxHeight:"100%",minHeight:0,flexDirection:"column",minWidth:{base:"128px",sm:"512px"},maxWidth:{base:"100%",sm:"512px"},flexGrow:1,overflow:"hidden"},variants:{background:{foreground:{backgroundColor:"surface.foreground"}}}});function pC({background:e,children:t}){return E("div",{className:hC({background:e}),children:t})}const gC=Object.freeze({thumbs_up:"👍",thumbs_down:"👎",red_heart:"❤️",hundred_points:"💯",eyes:"👀"});function mC(e){return void 0!==gC[e]}function vC(e){return gC[e]}const bC=fo(e=>h.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",strokeWidth:1.5,width:24,height:24,...e},h.createElement("defs",null,h.createElement("style",null,".cls-63ce7444ea57ea6c838005ed-1{fill:none;stroke:currentColor;stroke-miterlimit:10;}")),h.createElement("path",{className:"cls-63ce7444ea57ea6c838005ed-1",d:"M6.27,21.55H8.5l2.33.95h7.92a2.86,2.86,0,0,0,2.85-2.59l.88-9.13c0-.14,0-.28,0-.42h0a2.18,2.18,0,0,0-2.18-2.18H15.63l.52-1.09a6.27,6.27,0,0,0,.62-2.73h0A2.86,2.86,0,0,0,13.91,1.5h0A1.9,1.9,0,0,0,12,3.41h0a6,6,0,0,1-1.25,3.66l-2.33,3H6.27"}),h.createElement("rect",{className:"cls-63ce7444ea57ea6c838005ed-1",x:1.5,y:9.14,width:4.77,height:13.36})),"ThumbsUp"),fC=St({fontSize:"26px",lineHeight:"26px",width:"26px",userSelect:"none"});function yC({cldrShortName:e}){return E("div",{className:fC,children:vC(e)})}const kC=Rt({base:{padding:0,border:"none",outline:"none"},variants:{type:{sent:{cursor:"default"},received:{cursor:"pointer"}}}}),xC=St({display:"flex",gap:"4px",backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",padding:"4px 8px",alignItems:"center",justifyContent:"center",scrollbar:"hidden",overflow:"hidden"});function TC({reactions:e,type:t,handleClick:n}){return E("div",{className:xC,children:e.map((e,r)=>E("button",{className:kC({type:t}),onClick:"received"===t?()=>n(e.emojiCode):void 0,children:E(yC,{cldrShortName:e.emojiCode})},`${e.emojiCode}_${r}`))})}const CC=async({data:e,accessToken:t,environment:n})=>{const{id:r,emojiCode:a}=e,o={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:r,emojiCode:a},accessToken:t,endpointManager:ho(n)};return await Ir(o)},wC=async({data:e,accessToken:t,environment:n})=>{const{id:r,emojiCode:a}=e,o={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:r,emojiCode:a},accessToken:t,endpointManager:ho(n)};return await async function(e){return yv(e)}(o)};function AC(e,t,n){return yn(Ui({id:e}),t,n)}async function EC(e){const t=Ui({id:e});return vr("mutation successful, invalidating messages queries"),Pn.invalidateQueries({queryKey:t}).catch(e=>br({error:e,severity:"error"}))}function IC(e,t,n){const r=[...e];return r[n]=t,r}const SC=St({backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",display:"flex",justifyContent:"center",alignItems:"center",padding:"8px",cursor:"pointer"}),NC=Object.keys(gC).filter(mC).map(e=>({emojiCode:e,authorInfo:[]}));function PC({conversationId:e,messageId:t,type:n,reactions:r,reactionIsOpen:a,setReactionIsOpen:o}){const{userId:i}=v(rs),{mutate:l}=function(e){const{userId:t,userEmail:n}=v(rs);return md({mutationFn:CC,onMutateFn:({data:r,accessToken:a,environment:o})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:n,environment:r,userId:a,userEmail:o}){const i=AC(n,t,r);await Pn.cancelQueries({queryKey:i});const l=Pn.getQueryData(i);return Pn.setQueryData(i,t=>{const n=t.findIndex(t=>t.id===e.id);return-1===n?t:IC(t,(r=t[n],i=e,l=a,s=o,{...r,reactions:[...r.reactions,{emojiCode:i.emojiCode,authorInfo:[{userId:l,email:s}]}]}),n);var r,i,l,s}),{oldMessages:l}}({data:r,accessToken:a,conversationId:e,environment:o,userId:t,userEmail:n})},onSettled:()=>EC(e)})}(e);return S(Pl,{placement:"top-end",open:a,onOpenChange:o,blockInteraction:!0,children:[E(Rl,{children:e=>E("button",{className:SC,...e,children:E(Nc,{Component:bC})})}),E(ql,{type:"reaction",children:E(TC,{reactions:NC,type:n,handleClick:e=>{r.some(t=>{const n=t.emojiCode===e,r=t.authorInfo.some(e=>e.userId===i);return n&&r})||(l({id:t,emojiCode:e}),o(!1))}})})]})}const DC=Rt({base:{position:"absolute",bottom:"-25px"},variants:{type:{sent:{right:"2px"},received:{left:"2px"}}}});function RC({reactions:e,type:t,handleClick:n}){const r=DC({type:t});return E("div",{className:r,children:E(TC,{reactions:e,handleClick:n,type:t})})}const MC=Rt({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}},hasReactionsOnMessage:{true:{marginBottom:"18px"}}}}),OC=Rt({base:{position:"static",display:"flex",maxWidth:325,padding:"12px 16px",flexDirection:"column",alignItems:"flex-start",borderRadius:"md",borderWidth:1,borderStyle:"solid",flexShrink:1,overflow:"wrap",wordBreak:"break-word",whiteSpace:"pre-wrap"},variants:{type:{sent:{color:"typography.intent.primary",borderColor:"border.intent.primary",backgroundColor:"surface.intent.primary"},received:{color:"typography.base",borderColor:"border.layout",backgroundColor:"surface.foreground"}}}}),LC=St({position:"relative",display:"flex",flexDirection:"column"});function FC({conversationId:e,messageId:t,sentByCurrentUser:n,children:r,reactions:a=[]}){const o=p(null),{isHover:i,setIsHover:l,reactionIsOpen:s,setReactionIsOpen:c}=function(e){const[t,n]=f(!1),[r,a]=f(!1);return k(()=>{if(null===o.current||!i||s)return;const e=o.current,t=t=>{t.target===e||e.contains(t.target)||l(!1)};return window.addEventListener("mousemove",t),()=>{window.removeEventListener("mousemove",t)}},[i=t,o=e,s=r,l=n]),{isHover:t,reactionIsOpen:r,setIsHover:n,setReactionIsOpen:a};var o,i,l,s}(o),{mutate:d}=function(e){const{userId:t}=v(rs);return md({mutationFn:wC,onMutateFn:({data:n,accessToken:r,environment:a})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:n,environment:r,userId:a}){const o=AC(n,t,r);await Pn.cancelQueries({queryKey:o});const i=Pn.getQueryData(o);return Pn.setQueryData(o,t=>{const n=t.findIndex(t=>t.id===e.id),r=t[n];return xn(r)||0===r.reactions.length?t:IC(t,function(e,t,n){const r=e.reactions.filter(e=>e.emojiCode!==t||!e.authorInfo.some(e=>e.userId===n));return{...e,reactions:r}}(r,e.emojiCode,a),n)}),{oldMessages:i}}({data:n,accessToken:r,conversationId:e,environment:a,userId:t})},onSettled:()=>EC(e)})}(e),u=n?"sent":"received",h=a.filter(e=>mC(e.emojiCode)),g=h.length>0;return S("div",{className:MC({type:u,hasReactionsOnMessage:g}),ref:o,onMouseEnter:()=>"received"===u&&l(!0),children:[S("div",{className:LC,children:[E("div",{className:OC({type:u}),children:r}),g&&E(RC,{reactions:h,type:u,handleClick:e=>d({id:t,emojiCode:e})})]}),i&&E(PC,{conversationId:e,messageId:t,type:u,reactions:h,reactionIsOpen:s,setReactionIsOpen:c})]})}const BC=fo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M14.1641 9.87903V14.125H0.835876V9.87903",strokeMiterlimit:10}),h.createElement("path",{d:"M7.49988 10.4883V0.1875",strokeMiterlimit:10}),h.createElement("path",{d:"M11.7395 6.85162L7.4999 11.0913L3.26025 6.85162",strokeMiterlimit:10})),"Download"),UC=Rt({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}}}}),VC=St({position:"static",display:"flex",maxWidth:325,padding:"12px 16px",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"12px",borderRadius:"md",borderWidth:1,borderStyle:"solid",borderColor:"border.layout",backgroundColor:"surface.foreground",flexShrink:1}),WC=St({display:"flex",flexDirection:"column",gap:"4px",flex:1,minWidth:0}),HC=St({textDecoration:"none",color:"inherit",cursor:"pointer"});function qC({sentByCurrentUser:e,attachment:t}){const{fileName:n,fileSize:r,url:a}=t,o=e?"sent":"received",i=th();return E("div",{className:UC({type:o}),children:E("div",{onClick:async()=>{if(i)window.open(a,"_self","noopener,noreferrer");else try{const e=await fetch(a),t=await e.blob(),r=URL.createObjectURL(t),o=document.createElement("a");o.href=r,o.download=n,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)}catch(e){await br({error:new Error("error while downloading attachment"),severity:"error",extraData:{error:e}}),window.open(a,"_blank","noopener,noreferrer")}},className:HC,children:S("div",{className:VC,children:[S("div",{className:WC,children:[E(ml,{children:n}),E(ga,{children:`${r}`})]}),E(Nc,{Component:BC})]})})})}const jC=Wt(null,St({display:"flex",flexDirection:"column-reverse",justifyContent:"center",gap:"10px",alignSelf:"stretch"}));function zC({children:e}){return E("div",{...jC,children:e})}const KC=Wt(null,St({display:"flex",flexDirection:"column-reverse",alignItems:"flex-start",gap:"26px",flex:"1 1 0%",alignSelf:"stretch",overflowY:"auto",overflowX:"hidden",flexFlow:"column",padding:15,scrollbarWidth:"thin",maxHeight:"calc(100% + 15px)",marginBottom:"-15px"})),YC=St({minHeight:1,width:"100%"}),_C=T(function({children:e,activeKeyboard:t,setActiveKeyboard:n,inputRef:r},a){const o=p(null);t&&r?.current?.focus();const i=y(()=>{t&&Tn(r?.current)&&(n(!1),r.current.blur())},[t,r,n]);return function(e,t,n){k(()=>{const r=e.current;if(null!==r){let e=r.scrollTop,a=Date.now();const o=()=>{if(t){const{scrollVelocity:t,currentScrollTop:o,currentTime:i}=function(e,t,n){const r=e.scrollTop,a=Date.now(),o=Math.abs(r-t),i=a-n;return{scrollVelocity:i>0?o/i:0,currentScrollTop:r,currentTime:a}}(r,e,a);t>5&&n(),e=o,a=i}};return r.addEventListener("scroll",o),()=>{r.removeEventListener("scroll",o)}}},[t,n,e])}(o,t,i),S("div",{tabIndex:-1,...KC,ref:o,children:[E("div",{className:YC,ref:a}),e]})}),GC=Object.freeze({message:{text:"",attachments:[]}});function QC(e){const t=0==e?0:Math.floor(Math.log(e)/Math.log(1024));return+(e/Math.pow(1024,t)).toFixed(2)+" "+["B","kB","MB","GB","TB"][t]}const ZC=St({display:"flex",flex:"1 1 0",flexDirection:"row",justifyContent:"space-between",backgroundColor:"surface.foreground",borderWidth:"1px",borderStyle:"solid",borderColor:"border.layout",padding:"8px 16px",marginBottom:"8px"}),XC=St({display:"flex",flexDirection:"row",gap:"8px"}),JC=St({display:"grid",flexDirection:"column"});function $C({attachment:e,onRemove:t}){const n=(r=e).isPending?{text:"Uploading...",accent:"active"}:null===r.id?{text:"Failed to upload. Try uploading again.",intent:"danger"}:{text:QC(r.size)};var r;return S("div",{className:ZC,children:[S("div",{className:XC,children:[E(Nc,{Component:pp}),S("div",{className:JC,children:[E(ml,{children:e.name}),E(ga,{intent:n.intent,accent:n.accent,children:n.text})]})]}),!e.isPending&&E(Zl,{onClick:()=>t(e),children:E(Eo,{Component:Ml})})]})}const ew=St({width:"100%"});function tw({conversationId:e,addMessage:t,blockSubmit:n,isMobile:r,scrollRef:a,setActiveKeyboard:o,inputRef:i,defaultValues:l}){const{form:s}=function({onSubmit:e,defaultValues:t}){return{form:jm({defaultValues:t??GC,onSubmit:t=>{up.safeParse(t.value).success&&(e(t),t.formApi.reset())}})}}({onSubmit:t,defaultValues:l}),c=p(null),d=y(e=>{s.setFieldValue("message",t=>({...t,attachments:[...t.attachments,...e.map(e=>({localId:e.localId,name:e.name,size:e.size,id:null,isPending:!0}))]}))},[s]),u=y(e=>{s.setFieldValue("message",t=>({...t,attachments:t.attachments.map(t=>e.find(e=>e.localId===t.localId)||t)}))},[s]),{mutate:h}=md({mutationFn:mp,onSuccess:async()=>Pn.invalidateQueries({queryKey:["files/attachments"]})}),g=y(e=>{s.setFieldValue("message",t=>({...t,attachments:t.attachments.filter(t=>t.localId!==e.localId)})),null!==e.id&&h({id:e.id})},[s,h]);return E("form",{className:ew,ref:c,onKeyDown:e=>function(e,t,n,r){if(!r&&!e.shiftKey&&"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),null!==t&&!n)){const e=new SubmitEvent("submit",{bubbles:!0,cancelable:!0});t.dispatchEvent(e)}}(e,c.current,n,r),onSubmit:e=>{if(!n)return e.preventDefault(),e.stopPropagation(),s.handleSubmit()},children:E(s.Subscribe,{selector:e=>e.values.message.attachments,children:e=>S(I,{children:[e.map(e=>E($C,{attachment:e,onRemove:g},e.localId)),E(s.AppField,{name:"message",children:t=>E(t.MessageAreaInput,{blockSubmit:n,scrollRef:a,setActiveKeyboard:o,ref:i,onFileSelect:d,onUploadComplete:u,hideFileUpload:e.length>=5})})]})})})}function nw(e,t){return{id:`placeholder_${e.conversationId}_${Date.now()}`,conversationId:e.conversationId,author:{userId:t??"placeholderUserId",email:"placeholderEmail"},status:"ACTIVE",createdDateTime:"",lastUpdatedDateTime:"",text:e.text,reactions:[]}}async function rw(){const e=["conversations/messages"],t=["tasks"],n=["conversations"];return vr("mutation successful, invalidating messages queries"),Promise.all([Pn.invalidateQueries({queryKey:e}),Pn.invalidateQueries({queryKey:t}),Pn.invalidateQueries({queryKey:n})]).catch(e=>br({error:e,severity:"error"}))}const aw=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>ni({data:{data:e},accessToken:t,environment:n}))({data:[e],accessToken:t,environment:n}),ow=async({data:e,accessToken:t,environment:n})=>ni({data:{data:[e]},accessToken:t,environment:n}),iw=St({minHeight:"{borderWidths.lg}",maxHeight:"{borderWidths.lg}",width:"100%",backgroundColor:"border.layout",flex:"1 1 0",display:"flex"}),lw=St({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:5,paddingLeft:15,paddingRight:15}),sw=St({wordBreak:"break-word",maxWidth:250,textAlign:"center"}),cw="Marked As Resolved";function dw({resolver:e}){const t=e?`${e} ${cw}`:cw;return S("div",{className:lw,children:[E("div",{className:iw}),E("div",{className:sw,children:t}),E("div",{className:iw})]})}const uw=Rt({variants:{width:{xs:{width:"30px"},sm:{width:"60px"},md:{width:"120px"},lg:{width:"240px"},xl:{width:"420px"}},height:{xs:{height:"5px"},sm:{height:"10px"},md:{height:"20px"},lg:{height:"40px"},xl:{height:"80px"}}}});function hw({width:e="md",height:t="md"}){return E(Wa,{styles:uw({width:e,height:t})})}const pw=St({display:"flex",flexDirection:"row-reverse"});function gw(){return S(I,{children:[E(hw,{width:"lg",height:"lg"}),E("div",{className:pw,children:E(hw,{width:"md",height:"lg"})}),E("div",{className:pw,children:E(hw,{width:"lg",height:"xl"})}),E(hw,{width:"md",height:"lg"})]})}const mw=St({height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"8px"});function vw({isConversationLoading:e,isFilling:t,message:n}){return e?n?E(zC,{children:E(FC,{conversationId:"",messageId:"",sentByCurrentUser:!0,children:n})}):null:!e&&t?E(zC,{children:E(gw,{})}):S("div",{className:mw,children:[E(ha,{stylists:[Wt(null,St({whiteSpace:"normal",textAlign:"center"}))],children:"Send your bookkeeper a message"}),E(ml,{wrap:"wrap",alignment:"center",children:"Typical response time is within one business day"})]})}const bw=Wt(null,St({display:"flex",alignItems:"center",justifyContent:"center",maxWidth:"100%",minHeight:0,height:"auto",flexDirection:"column",position:"relative",backgroundColor:"surface.background",borderTop:"{borderWidths.lg} solid",borderTopColor:"border.layout",padding:"12px 15px"}));function fw({conversationId:e,setConversationId:t,isResolved:n,isUnread:r,isMobile:a=!1,attachedEntityId:o,defaultValues:i}){const{userId:l}=v(rs),{mutate:s}=function(){const{userId:e}=v(rs);return md({mutationFn:Hi,onMutateFn:({data:t,accessToken:n,environment:r})=>async function({data:e,accessToken:t,environment:n,userId:r}){const a=yn(Ui({id:e.conversationId}),t,n);await Pn.cancelQueries({queryKey:a});const o=Pn.getQueryData(a);return Pn.setQueryData(a,t=>[nw(e,r),...t]),{oldMessages:o}}({data:t,accessToken:n,environment:r,userId:e}),onSettled:rw})}(),{query:{data:c},isFilling:d}=function(e){const t=Tn(e);return Mn({queryKey:Ui({id:e??""}),queryFn:Wi,select:Vi,enabled:t})}(e),{mutate:u,isPending:h,variables:g}=(C=t,w=o,md({mutationFn:ow,onSuccess:e=>{const t=e.data?.[0]?.data?.id;if(xn(e)||xn(t))return;C(t);const n=["conversations"],r=["banks/transactions",{}],a=["summaries",{}];let o=async()=>{},i=async()=>{};if(Tn(w)){const e={id:w};Li(w,Oi.BANK_TRANSACTION)?o=async()=>{const t=Si(e);return await Pn.invalidateQueries({queryKey:t})}:Li(w,Oi.FINANCIAL_SUMMARY)&&(i=async()=>await Pn.invalidateQueries({queryKey:a}))}return vr("mutation successful, invalidating conversation, bank transaction, financial summary, and message queries"),Promise.all([Pn.invalidateQueries({queryKey:n}),Pn.invalidateQueries({queryKey:r}),o(),i()]).catch(e=>br({error:e,severity:"error"}))}})),{mutate:m}=md({mutationFn:aw,onSuccess:async()=>{const e=["conversations"],t=["tasks"];return vr("mutation successful, invalidating conversations queries"),Promise.all([Pn.invalidateQueries({queryKey:e}),Pn.invalidateQueries({queryKey:t})]).catch(e=>br({error:e,severity:"error"}))}}),[b,y]=f(!1),x=p(null),T=p(null);var C,w;k(()=>{n&&r&&e&&m({id:e,readStatus:"READ"})},[n,r,e,m]),k(()=>{hp(T)},[c,T]);const A=xn(e)||xn(c)||d;return S(I,{children:[A?E(_C,{ref:T,inputRef:x,activeKeyboard:b,setActiveKeyboard:y,children:E(vw,{isConversationLoading:h,isFilling:d,message:g?.message?.text})}):S(_C,{ref:T,activeKeyboard:b,setActiveKeyboard:y,inputRef:x,children:[n&&E(dw,{resolver:"Conversation"}),c.map((t,n)=>{const r=t[0].author.userId===l;return E(zC,{children:t.map(t=>S(I,{children:[t.attachments?.map(e=>E(qC,{sentByCurrentUser:r,attachment:e},e.id)),t.text&&E(FC,{conversationId:e,messageId:t.id,sentByCurrentUser:r,reactions:t.reactions,children:t.text},t.id)]}))},n)})]}),E("div",{...bw,children:E(tw,{scrollRef:T,inputRef:x,conversationId:e,blockSubmit:h,isMobile:a,addMessage:({value:t})=>{const{text:n,attachments:r}=t.message,a=n.trim(),i=r.filter(e=>null!==e.id&&!e.isPending),l=i.map(e=>`att_${e.id}`),c=a.length>0,d=l.length>0;if(c||d)if(xn(e)){let e="";if(c){const t=40;e=a.slice(0,t)}else d&&(e=i[0].name);const t=(h=a,p=l,{subject:e,status:"ACTIVE",readStatus:"READ",resolutionStatus:"OPEN",...Tn(g=o)&&{attachedEntityId:g},message:{text:h,...p.length>0&&{attachmentIds:p}}});u(t)}else s({conversationId:e,text:a,...d&&{attachmentIds:l}});var h,p,g},setActiveKeyboard:y,defaultValues:i})})]})}function yw({conversationId:e,attachedEntityId:t}){const[n,r]=f(e),{query:{data:a}}=ti(n),o="CLOSED"===a?.resolutionStatus;return S(pC,{children:[E(lh,{}),E(fw,{conversationId:n,setConversationId:r,isResolved:o,isUnread:"UNREAD"===a?.readStatus,attachedEntityId:t})]})}const kw=Wt(Ot["form-body"],St({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",overflow:"auto",minWidth:{base:0,sm:"512px"}}));function xw({children:e}){return E("div",{...kw,children:e})}function Tw({active:e,icon:t,onClick:n,ariaLabel:r,popupTriggerProps:a}){return E(Zl,{ariaLabel:r,onClick:n,active:e,popupTriggerProps:a,children:E(xs,{Component:t})})}function Cw({activeTab:e,onClick:t,popupTriggerProps:n}){return E(Tw,{active:"conversation"===e,onClick:()=>t("conversation"),icon:Bs,ariaLabel:"conversation-tab",popupTriggerProps:n})}const ww=St({display:"flex",flexDirection:"column",position:"fixed",inset:0,backgroundColor:"surface.background"});function Aw({conversationId:e,attachedEntityId:t}){const n=Dl(),[r,a]=f(e),{query:{data:o}}=ti(r),i="CLOSED"===o?.resolutionStatus;return E(rh,{children:S("div",{className:ww,children:[E(lh,{children:S(oh,{children:[E(dh,{Icon:yo,handleClose:()=>n.setOpen(!1)}),E(ha,{children:"Back"})]})}),E(fw,{conversationId:r,setConversationId:a,isResolved:i,isUnread:"UNREAD"===o?.readStatus,attachedEntityId:t})]})})}const Ew=Wt(null,St({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1})),Iw=Wt(null,St({display:"flex",flexDirection:"column",flex:1,backgroundColor:"surface.background",maxHeight:"100%"})),Sw=St({maxWidth:1,width:1,display:"flex",flexGrow:1,backgroundColor:"border.layout.strong"}),Nw=e=>{Yd(e),_d(e)},Pw=({children:e,onSubmit:t,Header:n,initialTab:r,conversationId:a,transactionId:o})=>{const i=th(),[l,s]=f(r??null),c=e=>s(e===l?null:e);return E(cC,{children:S("div",{...Ew,children:[E(pC,{children:S("form",{onSubmit:e=>{e.preventDefault(),t()},onKeyDown:Nw,...Iw,children:[n,E(xw,{children:e})]})}),null!==l&&E("div",{className:Sw}),"conversation"===l&&E(yw,{conversationId:a,attachedEntityId:o}),E(uC,{children:i?S(Pl,{children:[E(Rl,{children:e=>E(Cw,{onClick:c,activeTab:l,popupTriggerProps:e})}),E(Aw,{conversationId:a,attachedEntityId:o})]}):E(Cw,{onClick:c,activeTab:l})})]})})},Dw=Wt(null,St({display:"flex",flexDirection:"column",margin:"0 0 7px 0",padding:0,justifyContent:"center",minHeight:"36px",backgroundColor:"surface.background",gap:"4px"}));function Rw({transaction:e,bankAccount:t}){const n=e?e.description:"",r=xn(t)||xn(e)?"":((e,t)=>{const n="BANK_TRANSFER"===t.type,r=Ad(t.amount);return`${n?`${r} `:""}${ad(e.name,e.mask)}`})(t,e);return S("div",{...Dw,children:[E(ha,{wrap:"wrap",children:n}),t&&E(ga,{children:r})]})}const Mw=u.object({type:u.enum([ak.EXPENSE,ak.REVENUE,ak.BANK_TRANSFER,ak.TAX_PAYMENT,ak.INVOICE_PAYMENT,ak.PAYOUT,ak.PAYROLL_PAYMENT,ak.BILL_PAYMENT,ak.LOAN_PAYMENT]),amount:u.number({message:"Required"}).refine(e=>0!==e,{message:"Amount must not be 0"}),date:u.string("Required").refine(e=>(function(e,t){const n=Zt(e.getFullYear(),e.getMonth(),e.getDate()),r=Zt(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()<r.getTime()}(new Date(e),/* @__PURE__ */new Date)||on(new Date(e),/* @__PURE__ */new Date))&&sn(new Date(e),/* @__PURE__ */new Date("2000-01-01")),{message:"Invalid date"}),vendor:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}).nullable(),customer:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}).nullable(),frequency:u.union([u.object({name:u.string(),value:u.enum(["ONE_TIME","WEEKLY","MONTHLY","YEARLY"])}),u.undefined()]),category:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}).nullable(),classSegments:u.array(u.object({id:u.string(),name:u.string().optional()})),bankAccount:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}),glAccount:u.object({id:u.string(),name:u.string().optional(),accountNo:u.string().optional()},{message:"Required"}),notes:u.string().nullable()}),Ow=Mw.extend({children:u.array(u.object({amount:u.number().refine(e=>0!==e,{message:"Child expense amounts must not be 0"}),category:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}),glAccount:u.object({id:u.string()},{message:"Required"}),classSegments:u.array(u.object({id:u.string(),name:u.string().optional()}))}))}),Lw=Mw.extend({id:u.string(),type:u.literal(Object.values(ak)),description:u.string(),status:u.literal(Object.values(lk)),reviewStatus:u.literal(Object.values(Zb)),apiName:u.literal(Object.values({PLAID:"PLAID",UNIT:"UNIT",STRIPE:"STRIPE",SHOPIFY:"SHOPIFY",SQUARE:"SQUARE",RUTTER:"RUTTER",UBER:"UBER",MOOV:"MOOV",QUALPAY:"QUALPAY",MANUAL_ENTRY:"MANUAL_ENTRY",CSV_IMPORT:"CSV_IMPORT",PARTNER_IMPLEMENTATION:"PARTNER_IMPLEMENTATION",QBO:"QBO",XERO:"XERO",BENCH:"BENCH",WAVE:"WAVE"})),apiSourceId:u.string().nullable(),customer:u.object({id:u.string(),name:u.string().optional(),email:u.string().optional()}).nullable(),vendor:u.object({id:u.string(),name:u.string().optional()}).nullable(),invoiceItem:u.object({id:u.string(),description:u.string().optional()}).nullable(),bill:u.object({id:u.string(),name:u.string().optional()}).nullable(),payroll:u.object({id:u.string(),date:u.string().optional(),checkDate:u.string().optional(),description:u.string().optional()}).nullable(),apiItemId:u.string().nullable()});Lw.extend({});const Fw=Ow.extend({}).check(e=>{const t=e.value?.children?.reduce((e,t)=>e+t.amount,0);s(e.value?.children)||t===e.value.amount||e.issues.push({code:"custom",message:"Sum of children amounts must equal total amount",input:e.value,path:["children"]})}),Bw=Ow.extend({matchingBankTransaction:u.object({id:u.string(),description:u.string().optional(),amount:u.number().optional(),date:u.string().optional(),bankAccountId:u.string().optional(),apiName:u.enum({BOX:"BOX",CLOVER:"CLOVER",STRIPE:"STRIPE",PLAID:"PLAID",KNOX:"KNOX",UBER:"UBER",FRESHBOOKS:"FRESHBOOKS",HARVEST:"HARVEST",KW:"KW",FRESHBOOKS2:"FRESHBOOKS2",CAPITAL_ONE:"CAPITAL_ONE",SQUARE:"SQUARE",DOTLOOP:"DOTLOOP",REALOGY:"REALOGY",UPWORK:"UPWORK",SHOPIFY:"SHOPIFY",DEDUCTR:"DEDUCTR",ENTERPRISE:"ENTERPRISE",MOXIWORKS:"MOXIWORKS",APPDIRECT:"APPDIRECT",LONEWOLF:"LONEWOLF",LONEWOLF_TRANSACTIONDESK:"LONEWOLF_TRANSACTIONDESK",SAMPLE_BANK:"SAMPLE_BANK",TAXBOT:"TAXBOT",GUSTO:"GUSTO",XERO:"XERO",UNIT:"UNIT",MOOV:"MOOV",QBO:"QBO",QUALPAY:"QUALPAY",BENCH:"BENCH",PARTNER_IMPLEMENTATION:"PARTNER_IMPLEMENTATION",CHECK:"CHECK",RUTTER:"RUTTER",WAVE:"WAVE",MANUAL_ENTRY:"MANUAL_ENTRY",CSV_IMPORT:"CSV_IMPORT"}).optional()}).nullish()}).refine(e=>{const t=e.matchingBankTransaction?.amount,n=e.amount;return!!xn(t)||t===n},{message:"Transfer amount must equal the matching bank transaction amount",path:["matchingBankTransaction"],when:e=>Bw.pick({amount:!0,matchingBankTransaction:!0}).safeParse(e.value).success});Lw.extend({});const Uw=Ow.extend({});Lw.extend({});const Vw=u.object({tax:u.object({paymentInfo:u.object({region:u.enum(Bm,{message:`Tax region must be one of: ${Bm.join(", ")}`}),quarter:u.enum(Um,{message:`Tax quarter must be one of: ${Um.join(", ")}`}),year:u.number({message:"Tax year is required"})}).nullable()})}).superRefine((e,t)=>{e.tax?.paymentInfo||(t.addIssue({path:["tax","paymentInfo","region"],code:"custom",message:`Tax region must be one of: ${Bm.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","quarter"],code:"custom",message:`Tax quarter must be one of: ${Um.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","year"],code:"custom",message:"Tax year is required"}))}),Ww=u.intersection(Vw,Ow);u.intersection(Vw,Lw);const Hw={type:"EXPENSE",amount:null,category:{id:"",name:""},bankAccount:{id:"",name:""},glAccount:{id:"",name:"",accountNo:""},date:"",vendor:{id:"",name:""},customer:{id:"",name:"",email:""},frequency:wi[0],notes:null,classSegments:[],children:[],matchingBankTransaction:{id:"",description:"",amount:0,date:"",bankAccountId:"",apiName:void 0},tax:{paymentInfo:null}};function qw(e){const{mutate:t}=Hb(),n=e?{type:(r=e).type,amount:Sp(r.amount),category:r.category,date:r.date,vendor:r.vendor,customer:r.customer,frequency:r.frequency,bankAccount:r.bankAccount,glAccount:r.glAccount,notes:r.notes,classSegments:r.classSegments,children:r.children.map(e=>({amount:Sp(e.amount),category:e.category,glAccount:e.glAccount,classSegments:e.classSegments})),matchingBankTransaction:r.matchingBankTransaction,tax:r.tax}:Hw;var r;return jm({defaultValues:n,validators:{onBlur:Ow,onSubmit:({value:e})=>{const t=function(e){switch(e){case"EXPENSE":return Fw;case"BANK_TRANSFER":return Bw;case"REVENUE":return Uw;case"TAX_PAYMENT":return Ww;default:return}}(e.type);if(!t)return;const n=t.safeParse(e);return n.success?void 0:n.error.issues.map(e=>({path:e.path.join("."),message:e.message}))}},onSubmit:n=>{e&&(t(function(e,t){const n={id:e,type:t.type,amount:t.amount?Np(t.amount):0,date:t.date,bankAccountId:t.bankAccount.id,frequency:t.frequency?.value,notes:t.notes,classSegmentIds:t.classSegments.map(e=>e.id),children:t.children.map(e=>({amount:e.amount?Np(e.amount):0,categoryId:e.category?.id,glAccountId:e.glAccount?.id,classSegmentIds:t.classSegments.map(e=>e.id)}))};switch(t.type){case"EXPENSE":return{...n,vendorId:t.vendor?.id,customerId:t.customer?.id,categoryId:t.category?.id};case"REVENUE":return{...n,customerId:t.customer?.id,glAccountId:t.glAccount?.id};case"BANK_TRANSFER":return{...n,glAccountId:t.glAccount?.id,matchingBankTransactionId:t.matchingBankTransaction?.id};case"TAX_PAYMENT":return{...n,tax:t.tax};default:return n}}(e.id,n.value)),n.formApi.reset(n.value,{keepDefaultValues:!0}))},onSubmitInvalid:()=>{}})}function jw({children:e,onClick:t,Icon:n,closeOnClick:r=!1}){const a=Dl();return S(Tu,{onClick:()=>{r&&a.setOpen(!1),t()},children:[n&&E(Nc,{Component:n}),E(ha,{children:e})]})}function zw({transaction:e}){const{mutate:t}=Wb(),n=()=>t(ck([e]));return E(jw,{onClick:()=>{return e=n,void td({title:"Delete transaction",body:"Are you sure you want to delete this transaction?",buttons:[{key:Kc,label:"Cancel"},{key:Yc,label:"Delete",type:ed}]}).then(t=>{t===Yc&&e()});var e},children:"Delete"})}function Kw({transaction:e}){const{mutate:t}=Wb();return E(jw,{onClick:()=>{t([e].map(e=>({id:e.id,status:lk.ACTIVE})))},children:"Restore"})}const Yw=zm({defaultValues:Hw,render:function({form:e}){return E(jw,{onClick:()=>{Jn()},closeOnClick:!0,children:"Attach Bill(s)"})}}),_w=zm({defaultValues:Hw,render:function({form:e}){return E(jw,{onClick:()=>{Jn()},closeOnClick:!0,children:"Attach Payroll"})}}),Gw=zm({defaultValues:Hw,render:function({form:e}){return E(jw,{onClick:()=>{Jn()},Icon:Jf,closeOnClick:!0,children:"Attach Invoice(s)"})}}),Qw=wi.filter(e=>"ONE_TIME"!=e.value);function Zw({onClick:e}){const t=Dl();return E(Fu,{triggerChildren:E(Uu,{displayLabel:"Make recurring"}),popupChildren:E(Lm,{frequencies:Qw,onClick:n=>{e(n),t.setOpen(!1)}})})}const Xw=zm({defaultValues:Hw,props:{title:"Transaction",transaction:null},render:function({form:e,title:t,transaction:n}){const r=He(e=>e.FEATUREFLAG_ATTACH_TO_GLSOURCE),a=Se(),o=!xn(n)&&Pp(n)&&"EXPENSE"===n.type;return S(lh,{children:[S(oh,{children:[E(dh,{}),E(ha,{children:t}),E(xx,{children:S(su,{children:[n?.status===lk.ACTIVE&&E(zw,{transaction:n}),n?.status===lk.INACTIVE&&E(Kw,{transaction:n}),r&&S(I,{children:["EXPENSE"===n?.type&&E(Yw,{form:e}),"EXPENSE"===n?.type&&E(_w,{form:e}),"REVENUE"===n?.type&&E(Gw,{form:e})]}),o&&E(e.Subscribe,{selector:e=>e.values.frequency,children:t=>{return a&&!(null!=(n=t)&&"ONE_TIME"!=n.value)&&E(Zw,{onClick:t=>e.setFieldValue("frequency",t)});var n}})]})})]}),E(e.Subscribe,{selector:e=>e.isDefaultValue,children:t=>t?null:E(e.SaveButton,{})})]})}}),Jw=Wt(null,St({position:"relative",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",outline:"none",border:"none",background:"none",padding:"15px 0px",gap:"15px",width:"100%"})),$w=Wt(null,St({backgroundColor:"border.layout",height:"25px",width:"1px",margin:0})),eA=Wt(null,St({backgroundColor:"border.layout",height:"1px",width:"100%"})),tA=Wt(null,St({background:"none",border:"none",outline:"none",marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center",padding:"4px",borderRadius:"md",cursor:"pointer","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:hover":{"& svg":{"& path":{stroke:"icon.accent.danger"}}}}),wo),nA=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px"})),rA=zm({defaultValues:Hw,props:{index:0,numRows:1,removeSplit:()=>{}},render:function({form:e,index:t,numRows:n,removeSplit:r}){return S(I,{children:[S("div",{...Jw,children:[E(e.AppField,{name:`children[${t}].category`,children:e=>E(e.SplitExpenseCategoryField,{value:e.state.value,onChange:e.handleChange})}),S("div",{...nA,children:[E("div",{...$w}),E(e.AppField,{name:`children[${t}].amount`,children:e=>E(e.SplitExpenseAmountField,{value:e.state.value,onChange:e.handleChange,onBlur:e.handleBlur})}),E("button",{onClick:()=>r(t),...tA,children:E(Nc,{Component:Xk})})]})]}),t<n-1&&E("div",{...eA})]})}}),aA=Wt(null,St({display:"flex",flexDirection:"column",alignItems:"flex-start",outline:"none",border:"none",background:"none"})),oA=St({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout.strong",display:"flex",flexDirection:"column",padding:"12px 16px",cursor:"pointer",outline:"none"}),iA=St({borderColor:"border.intent.danger"}),lA=zm({defaultValues:Hw,render:function({form:e}){const t=fe(e.store,e=>{const t=e.errors?.[0]??{},n=Object.values(t).flat().filter(e=>"object"==typeof e&&null!==e&&"message"in e);return n[0]?.message}),n=Wt(null,oA,t?iA:void 0);return S(I,{children:[S("div",{...n,children:[E(ga,{children:"Category"}),E(e.AppField,{name:"children",mode:"array",children:t=>{const n=n=>{if(t.state.value.length<=2){const r=1-n;e.setFieldValue("category",t.state.value[r].category),t.clearValues()}else t.removeValue(n);e.validate("blur")};return S("div",{...aA,children:[t.state.value.map((r,a)=>E(rA,{form:e,index:a,numRows:t.state.value.length,removeSplit:n},`${r?.category?.id}-${a}`)),E($u,{onClick:()=>{const e=Le(t.state.value)?.category,n=Le(t.state.value)?.classSegments,r=Le(t.state.value)?.glAccount;t.pushValue({amount:0,category:e||{id:"",name:""},glAccount:r||{id:""},classSegments:n||[]})}})]})}})]}),t&&E(Vd,{errorMessage:t})]})}}),sA=zm({defaultValues:Hw,render:function({form:e}){const t=fe(e.store,e=>e.values.amount)??0;return E(e.Subscribe,{selector:e=>e.values.children,children:n=>Array.isArray(n)&&0!==n.length?E(lA,{form:e}):E(e.AppField,{name:"children",mode:"array",children:n=>E(e.AppField,{name:"category",children:r=>E(r.ExpenseCategoryField,{category:r.state.value,glAccount:e.state.values.glAccount,onClick:r.handleChange,childrenField:n,totalAmount:t})})})})}}),cA=zm({defaultValues:Hw,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){const r=Se();return S(I,{children:[E(e.AppField,{name:"vendor",children:e=>E(e.VendorFieldInput,{label:"Vendor",onClick:e.handleChange,vendor:e.state.value,editable:n})}),E(e.AppField,{name:"customer",children:e=>E(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value,editable:n})}),E(e.Subscribe,{selector:e=>e.values.frequency,children:a=>{return r&&n&&(o=t.type,void 0!==(i=a)&&"ONE_TIME"!==i.value&&"EXPENSE"===o)&&E(e.AppField,{name:"frequency",children:e=>E(e.FrequencyFieldInput,{label:"Frequency",onClick:e.handleChange,frequency:e.state.value})});var o,i}}),E(sA,{form:e}),n&&E(e.AppField,{name:"bankAccount",children:e=>E(e.ManualBankAccountField,{transaction:t})})]})}}),dA=zm({defaultValues:Hw,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return S(I,{children:[E(e.AppField,{name:"customer",children:e=>E(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value})}),E(e.AppField,{name:"glAccount",children:e=>E(e.GlAccountField,{})}),n&&E(e.AppField,{name:"bankAccount",children:e=>E(e.ManualBankAccountField,{transaction:t})})]})}}),uA=zm({defaultValues:Hw,props:{transaction:{}},render:function({form:e,transaction:t}){return S(I,{children:[E(e.AppField,{name:"bankAccount",children:e=>E(e.ManualBankAccountField,{transaction:t})}),E(e.AppField,{name:"glAccount",children:e=>E(e.BankGlAccountField,{transaction:t})}),E(e.AppField,{name:"matchingBankTransaction",children:e=>E(e.MatchingBankTransferField,{transaction:t})})]})}}),hA=zm({defaultValues:Hw,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return S(I,{children:[E(e.AppField,{name:"tax.paymentInfo.region",children:e=>E(e.TaxCategoryField,{region:e.state.value,onClick:e.handleChange})}),E(e.AppField,{name:"tax.paymentInfo.quarter",children:e=>E(e.ButtonGroupField,{label:"Quarter",options:Fm})}),E(e.AppField,{name:"tax.paymentInfo.year",children:e=>E(e.GenericSelectorField,{label:"Year",options:an({startYear:/* @__PURE__ */(new Date).getFullYear()+1}).map(e=>({value:e,label:String(e)}))})}),n&&E(e.AppField,{name:"bankAccount",children:e=>E(e.ManualBankAccountField,{transaction:t})})]})}}),pA=zm({defaultValues:Hw,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return E(e.Subscribe,{selector:e=>e.values.type,children:r=>{switch(r){case"EXPENSE":return E(cA,{form:e,transaction:t,isManual:n});case"REVENUE":return E(dA,{form:e,transaction:t,isManual:n});case"BANK_TRANSFER":return E(uA,{form:e,transaction:t});case"TAX_PAYMENT":return E(hA,{form:e,transaction:t,isManual:n});default:return null}}})}}),gA={EXPENSE:"Expense",REVENUE:"Income",BANK_TRANSFER:"Bank Transfer",TAX_PAYMENT:"Tax Payment",INVOICE_PAYMENT:"Invoice Payment",PAYOUT:"Payout",PAYROLL_PAYMENT:"Payroll Payment",BILL_PAYMENT:"Bill Payment",LOAN_PAYMENT:"Loan Payment"};function mA({transaction:e,form:t,bankAccount:n,isManual:r,conversationId:a,transactionId:o,initialTab:i,currentType:l}){const s=E(Xw,{form:t,transaction:e,title:gA[l]});return S(Pw,{onSubmit:t.handleSubmit,Header:s,initialTab:i,conversationId:a,transactionId:o,children:[e.description&&E(Rw,{transaction:e,bankAccount:n}),E(t.AppField,{name:"amount",children:e=>E(r?e.EditableAmountField:e.DiscreteAmountField,{label:"Total"})}),E(t.AppField,{name:"date",children:e=>E(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date,editable:r})}),E(pA,{form:t,transaction:e,isManual:r}),E(t.AppField,{name:"notes",children:e=>E(e.TextAreaInput,{label:"Note"})}),E(t.AppField,{name:"type",children:()=>null})]})}function vA({transactionId:e,initialTab:t}){const{transaction:n,form:r,bankAccount:a,isManual:o,isLoading:i}=function({transactionId:e}){const{query:{data:t,isFetching:n},isFilling:r}=Ri({id:e});return{transaction:t,form:qw(t),bankAccount:Wp(t?.bankAccount.id??""),isManual:!xn(t)&&Pp(t),isLoading:r||n&&!t}}({transactionId:e});if(i||!n)return null;const l=n?.conversation?.id??null;return E(r.Subscribe,{selector:e=>e.values.type,children:i=>E(mA,{transaction:n,form:r,bankAccount:a,isManual:o,conversationId:l,transactionId:e,initialTab:t,currentType:i})})}function bA({transactionId:e,initialTab:t}){const{query:{data:n},isFilling:r}=Ri({id:e});return k(()=>{!r&&xn(n)&&xi()},[n,r]),xn(n)?null:E(vA,{transactionId:e,initialTab:t})}const fA={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"column",...r}},defaultValues:{gap:"8px"}},yA=(e={})=>{const t=yt(fA,e);return fA.transform(t,ft)},kA=e=>St(yA(e));kA.raw=yA;const xA={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"row",...r}},defaultValues:{gap:"8px"}},TA=(e={})=>{const t=yt(xA,e);return xA.transform(t,ft)},CA=e=>St(TA(e));function wA({subject:e,children:t}){return S(lh,{children:[S(oh,{children:[E(dh,{}),E(ha,{children:e})]}),E("div",{className:CA({alignItems:"center",gap:15}),children:t})]})}function AA({conversationId:e,defaultValues:t}){const[n,r]=f(e),{query:{data:a}}=ti(n),o="CLOSED"===a?.resolutionStatus;return E(cC,{children:S(pC,{children:[E(wA,{subject:a?.subject??"Conversation"}),E(fw,{conversationId:n,setConversationId:r,isResolved:o,isUnread:"UNREAD"===a?.readStatus,defaultValues:t})]})})}CA.raw=TA;const EA=fo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{clipPath:"url(#clip0_18201_5557)"},h.createElement("path",{d:"M7.5 14.0625C11.1244 14.0625 14.0625 11.1244 14.0625 7.5C14.0625 3.87563 11.1244 0.9375 7.5 0.9375C3.87563 0.9375 0.9375 3.87563 0.9375 7.5C0.9375 11.1244 3.87563 14.0625 7.5 14.0625Z",strokeWidth:.9375,strokeMiterlimit:10}),h.createElement("path",{d:"M7.49999 10.4812V6.30624H6.30624",strokeWidth:.9375,strokeMiterlimit:10}),h.createElement("path",{d:"M6.30624 10.4813H8.69374",strokeWidth:.9375,strokeMiterlimit:10}),h.createElement("path",{d:"M6.90625 4.51874H8.09375",strokeWidth:.9375,strokeMiterlimit:10})),h.createElement("defs",null,h.createElement("clipPath",{id:"clip0_18201_5557"},h.createElement("rect",{width:15,height:15,fill:"white"})))),"Info");function IA({onClick:e,active:t}){return E(ll,{type:"button",onClick:e,active:t,children:E(Nc,{Component:EA})})}const SA=St({display:"flex",flexDirection:"column"});function NA({label:e,data:t,isFilling:n,shimmerWidth:r}){return S("div",{className:SA,children:[E(ga,{children:e}),n?E(hw,{width:r}):E(ha,{wrap:"wrap",children:t??""})]})}function PA({transactionId:e,isOpen:t}){const{query:{data:n},isFilling:r}=Ri({id:e}),a=Wp(n?.bankAccount.id??"");if(xn(n))return null;const o=kA({alignItems:"stretch",gap:5,paddingLeft:16,paddingRight:16,backgroundColor:"surface.foreground",borderWidth:0,borderBottomStyle:"solid",borderColor:"border.layout.strong",maxHeight:0,overflow:"hidden",transition:"all 300ms ease-out","&[data-open='true']":{maxHeight:"1/3",paddingTop:16,paddingBottom:16,borderWidth:"lg",overflow:"scroll"}});return S("div",{"data-open":t,className:o,children:[S("div",{className:CA({justifyContent:"space-between"}),children:[E(NA,{label:"Date",data:n?.date,isFilling:r,shimmerWidth:"md"}),E(NA,{label:"Amount",data:sa(Sp(n.amount)),isFilling:r,shimmerWidth:"sm"})]}),E(NA,{label:"Bank Account",data:ad(a?.name??"",a?.mask??""),isFilling:r,shimmerWidth:"lg"}),E(NA,{label:"Description",data:n?.description,isFilling:r,shimmerWidth:"lg"})]})}function DA({conversationId:e,transactionId:t}){const[n,r]=f(e),[a,o]=f(!0),{query:{data:i}}=ti(n),l="CLOSED"===i?.resolutionStatus;return E(cC,{children:S(pC,{children:[E(wA,{subject:i?.subject??"Conversation",children:Tn(t)&&E(IA,{onClick:()=>o(!a),active:a},"infoButton")}),Tn(t)&&E(PA,{transactionId:t,isOpen:a}),E(fw,{conversationId:n,setConversationId:r,isResolved:l,isUnread:"UNREAD"===i?.readStatus})]})})}function RA(){const{query:{data:e}}=Fc({filter:{apiName:{equal:"PLAID"},status:{equal:"ACTIVE"}}}),t=e?.data,n=He(e=>e.drawerHistory).length>1,r=new Set(t?.flatMap(e=>null!=e.apiInstitutionName?[e.apiInstitutionName]:[]));return E(cC,{children:S(pC,{background:"foreground",children:[E(lh,{children:S(oh,{children:[E(dh,n?{Icon:yo}:{}),E(ha,{children:"Add New Connection"})]})}),E(qT,{connectedBankNames:r})]})})}function MA(){return E(lh,{children:S(oh,{children:[E(dh,{}),E(ha,{children:"Financial Summary"})]})})}const OA=St({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",width:"512px",overflow:"scroll"}),LA=Yt.raw({body:"default"}),FA=St({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"md",padding:"12px",whiteSpace:"pre-wrap",overflowWrap:"break-word"},LA);function BA({summaryText:e}){return E("div",{className:OA,children:E("div",{className:FA,children:e})})}const UA=St({display:"flex",flexDirection:"column",overflow:"auto"});function VA({summary:e}){return S("div",{className:UA,children:[E(MA,{}),E(BA,{summaryText:e})]})}const WA=St({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1});function HA({summaryId:e,conversationId:t}){const{query:{data:n}}=function({id:e}){return Mn({queryKey:zi({id:e}),queryFn:Yi})}({id:e});return E(cC,{children:S("div",{className:WA,children:[E(pC,{children:E(VA,{summary:n?.summary})}),E(ui,{}),E(yw,{conversationId:t??null,attachedEntityId:e})]})})}function qA(){return E(cC,{children:E(pC,{children:E(QT,{showCloseButton:!0})})})}const jA=u.object({id:u.string(),name:u.string({message:"Required"}).refine(e=>e.trim().length>0,{message:"Required"}),mask:u.string({message:"Required"}).refine(e=>e.trim().length<=4,{message:"Must be 4 digits or less"}).refine(e=>e.trim().length>0,{message:"Required"}),type:u.enum(["DEPOSITORY","CREDIT","INVESTMENT","EQUITY","LOAN","OTHER"],{message:"Required"})}),zA={mergeDestination:om,selectedAccount:null};const KA=St({display:"flex",flexDirection:"column",gap:"20px"}),YA=St({display:"grid",gridTemplateColumns:{sm:"300px auto 300px",base:"100%"},gap:"10px",rowGap:"25px",justifyContent:"space-between",paddingLeft:"10px",paddingRight:"10px"}),_A=St.raw({display:"flex",flexDirection:"column",gap:"15px",width:"100%",maxWidth:"300px",height:"100%",justifyContent:"flex-start"}),GA=St(_A,{placeSelf:{sm:"flex-start",base:"center"},alignItems:{sm:"flex-start",base:"center"},maxWidth:{sm:"300",base:"auto"}}),QA=St(_A,{placeSelf:"center",alignItems:"center",maxWidth:{sm:"300",base:"auto"}}),ZA=St(_A,{placeSelf:{sm:"flex-end",base:"center"},alignItems:{sm:"flex-end",base:"center"},maxWidth:{sm:"300",base:"auto"}}),XA=St({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),JA=St({justifyContent:"center",display:"flex",transform:{sm:"none",base:"rotate(90deg)"}}),$A=St({width:"100%",display:"flex",justifyContent:"flex-start"}),eE=St({width:"100%",display:"flex",justifyContent:{sm:"center",base:"flex-start"}}),tE=St({width:"100%",display:"flex",justifyContent:{sm:"flex-end",base:"flex-start"}}),nE=e=>{Yd(e),_d(e)};function rE({account:e}){const t=Dl(),n=function(e,t){const{mutateAsync:n}=xd();return jm({defaultValues:zA,onSubmit:async r=>{if(await Sd()===Yc&&Tn(e)&&Tn(r.value.selectedAccount)){const l=(a=e,o=r.value.mergeDestination,i=r.value.selectedAccount,o===om?{...Ed(i),duplicateBankAccountIds:[Bi(a.id)]}:{...Ed(a),duplicateBankAccountIds:[Bi(i.id)]});try{await n(l),t.setOpen(!1),r.value.mergeDestination===om&&xi()}catch{await Nd()}}var a,o,i},onSubmitInvalid:()=>{}})}(e,t),{query:{data:r},isFilling:a}=dd();if(!(r&&r.data||a))return null;const o=r?.data?.filter(t=>t.glAccountId&&t.isSupported&&t.id!==e?.id&&t.integration.id!==e?.integration.id);return S("form",{className:KA,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),n.handleSubmit()},onKeyDown:nE,children:[E(ha,{children:"Merge Accounts"}),E("div",{className:YA,children:E(n.Subscribe,{selector:e=>e.values.mergeDestination,children:t=>S(I,{children:[S("div",{className:GA,children:[E("div",{className:$A,children:E(ha,{children:"Duplicate Account"})}),t===om?E(tm,{accountName:e.name,accountNo:e.mask,institutionId:e.integration?.apiInstitutionId??""}):E(n.AppField,{name:"selectedAccount",children:n=>E(lm,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:o,isFilling:a,warningMessage:sm(t,e,n.state.value)})})]}),S("div",{className:QA,children:[E("div",{className:eE,children:E(ha,{children:"Into"})}),E(n.AppField,{name:"mergeDestination",children:e=>E("div",{className:JA,children:E(ll,{onClick:()=>e.handleChange(e.state.value===om?am:om),children:E(Nc,{Component:ko})})})})]}),S("div",{className:ZA,children:[E("div",{className:tE,children:E(ha,{children:"Destination Account"})}),t===om?E(n.AppField,{name:"selectedAccount",children:n=>E(lm,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:o,isFilling:a,warningMessage:sm(t,e,n.state.value)})}):E(tm,{accountName:e.name,accountNo:e.mask,institutionId:e?.integration?.apiInstitutionId??""})]})]})})}),S("div",{className:XA,children:[E(Ym,{showIcon:!1,onClick:()=>{t.setOpen(!1)}}),E(n.Subscribe,{selector:e=>e.values.selectedAccount,children:e=>E(Ld,{disabled:xn(e),showIcon:!1,textContent:"Merge"})})]})]})}function aE({bankAccount:e}){return E(su,{children:S(Pl,{placement:"right-start",modal:!0,children:[E(Rl,{children:e=>S(Tu,{...e,children:[E(Nc,{Component:Rx}),E(ha,{children:"Merge Accounts"})]})}),E(rh,{children:E(Ak,{children:E(Ik,{children:E(rE,{account:e})})})})]})})}const oE=St({width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"8px",padding:"12px 16px",borderRadius:"md",textAlign:"left",cursor:"pointer",outline:"none",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"},backgroundColor:{base:"surface.foreground",sm:"surface.intent.action.discrete"},borderWidth:"lg",borderStyle:"solid",borderColor:{base:"border.layout.strong",sm:"transparent"},_supportHover:{backgroundColor:{base:"surface.intent.action",sm:"surface.intent.action.discrete.hover"}}}),iE=({tranStartDate:e})=>S(I,{children:[E(ga,{children:"Start Date"}),An(e)?E(ha,{children:`${fn(hn(e))}`}):E(ha,{children:"Set Start Date"})]});function lE({bankAccount:e}){return S(Pl,{placement:"right-start",modal:!0,children:[E(Rl,{children:t=>E("button",{className:Pt(oE,To),...t,type:"button",children:E(iE,{tranStartDate:e.tranStartDate})})}),E(rh,{children:E(Ak,{children:E(Ik,{width:"sm",children:E(Nx,{bankAccounts:[e]})})})})]})}const sE=e=>["accounting/manualJournalEntry",e.id],cE=async e=>{const t=e.queryKey,n=t[2].accessToken,r=t[2].environment,a={path:"/accounting/manualJournalEntry?id={id}",pathParams:{id:t[1]},accessToken:n,environment:r};return await Ko(a)};function dE({id:e}){return Mn({queryKey:sE({id:String(Bi(e))}),queryFn:cE,enabled:Tn(e)})}const uE=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>{const r={path:"/accounting/manualJournalEntry",bodyParams:{manualJournalEntry:e},accessToken:t,endpointManager:Mr(n)};return await Sr(r)})({data:e,accessToken:t,environment:n});const hE=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/beginningBalance",bodyParams:e,accessToken:t,endpointManager:Mr(n)};return await Sr(r)},pE=u.object({amount:u.number({message:"Required"}).refine(e=>e>=0,{message:"Amount must be above 0"}),date:u.string("Required")}),gE=(e,t)=>{const n=t?.transactions?.find(t=>e.glAccountId&&t?.glAccountId===Bi(e.glAccountId));return 0===n?.crAmount?n?.drAmount:n?.crAmount},mE=e=>{const t=e.beginningBalanceData.journalEntry?.id,{query:{data:n}}=dE({id:t??null}),r=function(){const{query:{data:e}}=$p();return ig(e,["EQUITY"]).filter(e=>"CAPITAL"===e.equityType||"OPENING_BALANCE"===e.equityType)}(),{mutate:a}=md({mutationFn:hE,onSuccess:async()=>{vr("beginning balance mutation successful, invalidating bank account queries");try{return Pn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&br({error:e,severity:"error"})}}});const{mutate:o}=md({onSuccess:async()=>{vr("mutation successful, invalidating manual journal entry queries");try{return Promise.all([Pn.invalidateQueries({queryKey:["accounting/manualJournalEntry"]}),Pn.invalidateQueries({queryKey:["banks/accounts",{}]})])}catch(e){e instanceof Error&&br({error:e,severity:"error"})}},mutationFn:uE}),i=Dl(),l=((e,t)=>{const n=gE(e,t);return{amount:Tn(e.beginningBalanceData.journalEntry?.id)?n:"",date:Tn(t?.date)?t.date:""}})(e,n);return jm({defaultValues:l,validators:{onBlur:pE},onSubmit:l=>{if(i.setOpen(!1),xn(t)||xn(n))a({bankAccountId:Bi(e.id),balance:Number(l.value.amount),date:l.value.date});else{const t=((e,t,n,r,a)=>{if(xn(e.id))return null;const o={...e,id:e.id},i=a.map(e=>Bi(e.id));let l=0;return o.transactions?.forEach(e=>{r.glAccountId&&e.glAccountId===Bi(r.glAccountId)&&(e.drAmount?(l=Number(e.drAmount)-n,e.drAmount=n):e.crAmount&&(l=Number(e.crAmount)-n,e.crAmount=n))}),xn(l)?null:(o.transactions?.forEach(e=>{i.includes(e.glAccountId)&&(e.drAmount?e.drAmount=Number(e.drAmount)-l:e.crAmount&&(e.crAmount=Number(e.crAmount)-l))}),o.date=pn(t)??o.date,o)})(n,hn(l.value.date)||new Date(l.value.date),Number(l.value.amount),e,r);Tn(t)&&o(t)}}})},vE=St({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),bE=St({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"});function fE({bankAccount:e}){const t=mE(e),n=Dl(),r=()=>{n.setOpen(!1)};return S("form",{className:vE,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),t.handleSubmit()},children:[E(ha,{children:"Set Beginning Balance"}),E(t.AppField,{name:"date",children:e=>E(e.DateInput,{label:"Beginning Balance Date",maxDate:/* @__PURE__ */new Date,editable:!0})}),E(t.AppField,{name:"amount",children:e=>E(e.EditableAmountField,{label:"Beginning Balance Amount"})}),E(t.Subscribe,{selector:e=>e,children:e=>S("div",{className:bE,children:[E(Ym,{showIcon:!1,onClick:r}),E(Ld,{showIcon:!1,textContent:"Confirm",disabled:!e.isDirty})]})})]})}const yE=Rt({base:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"8px",padding:"12px 16px",borderRadius:"md",textAlign:"right",cursor:"pointer",outline:"none",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"},backgroundColor:{base:"surface.foreground",sm:"surface.intent.action.discrete"},borderWidth:"lg",borderStyle:"solid",borderColor:{base:"border.layout.strong",sm:"transparent"},_supportHover:{backgroundColor:{base:"surface.intent.action",sm:"surface.intent.action.discrete.hover"}}},variants:{layout:{left:{alignItems:"flex-start"},right:{alignItems:"flex-end"}}}}),kE=St({display:"flex",flexDirection:"row",gap:"8px",width:"100%"});function xE({bankAccount:e,hasMigrationDate:t,beginningBalanceAmount:n,beginningBalanceDate:r,layout:a="left"}){const o=Pt(yE({layout:a}),To),i=Pt(yE({layout:"right"}),To),l=r&&fn(r);return S(Pl,{placement:"right-start",modal:!0,children:[E(Rl,{children:e=>S("div",{className:kE,children:[S("button",{className:o,...e,type:"button",children:[E(ga,{children:"Beginning Balance"}),E(ha,{children:Tn(n)?`$${n}`:"Set Beginning Balance"})]}),t&&l&&S("button",{className:i,...e,type:"button",children:[E(ga,{children:"Migration Date"}),E(ha,{children:l})]})]})}),E(rh,{children:E(Ak,{children:E(Ik,{width:"sm",children:E(fE,{bankAccount:e})})})})]})}const TE=Rt({base:{display:"flex",gap:"8px",width:"100%"},variants:{layout:{stacked:{flexDirection:"column"},inline:{flexDirection:"row"}}}});function CE({bankAccount:e,showStartDate:t}){const{query:{data:n}}=dE({id:e?.beginningBalanceData.journalEntry?.id??null});if(!e)return null;const r=gE(e,n),a=Tn(n?.date)?hn(n?.date):null,o=Tn(e.tranStartDate)?hn(e.tranStartDate):null,i=Tn(a)&&Tn(o)&&!on(a,o),l=i?"left":t?"right":"left";return S("div",{className:TE({layout:i?"stacked":"inline"}),children:[t&&E(lE,{bankAccount:e}),E(xE,{bankAccount:e,hasMigrationDate:i,layout:l,beginningBalanceAmount:r,beginningBalanceDate:a})]})}const wE=St({marginTop:"15px",marginBottom:"15px"}),AE={id:"",name:"",mask:"",type:void 0};const EE=[{value:"DEPOSITORY",label:"Bank Account"},{value:"CREDIT",label:"Credit Card"}],IE=e=>{Yd(e),_d(e)};function SE({bankAccountId:e}){const t=Wp(e),n=t?{id:t.id,name:t.name,mask:t.mask,type:t.type}:AE,[r,a]=f(n),o=function(e,t){const{mutate:n}=xd(),{mutateAsync:r}=kd({mutationFn:bd}),a=An(String(e.id));return jm({defaultValues:e,validators:{onBlur:jA},onSubmit:async e=>{if(a)n(Ed(e.value)),t(e.value),e.formApi.reset(e.value,{keepDefaultValues:!0});else{const n=await r((o=e.value,{apiAccountName:o.name,apiAccountNo:o.mask,apiAccountType:o.type||"DEPOSITORY",duplicateBankAccountIds:[]})),a={id:Fi({id:n?.dataObject?.id,prefix:"BANK_ACCOUNT"}),name:n?.dataObject?.apiAccountName??"",mask:n?.dataObject?.apiAccountNo??"",type:e.value.type};t(a),e.formApi.reset(a,{keepDefaultValues:!0})}var o},onSubmitInvalid:()=>{}})}(r,a),i=!t||Cd(t.apiName),l=!!t&&wd(t.apiName),s=ad(r?.name??"",r?.mask??""),c=An(s)?s:"New Bank Account",d=l&&Tn(t?.tranStartDate),u=Tn(t)&&(d||!0);return E(cC,{children:E(pC,{children:S("form",{onSubmit:e=>{e.preventDefault(),o.handleSubmit()},onKeyDown:IE,children:[S(lh,{children:[S(oh,{children:[E(dh,{}),E(ha,{children:c}),Tn(t)&&E(xx,{children:E(aE,{bankAccount:t})})]}),E(o.Subscribe,{selector:e=>e.isDefaultValue,children:e=>e?null:E(o.SaveButton,{})})]}),S(xw,{children:[E(o.AppField,{name:"name",children:e=>E(e.TextField,{label:"Name",disabled:!i,placeholder:"Enter name..."})}),E(o.AppField,{name:"mask",children:e=>E(e.TextField,{label:"Last 4 Digits (Mask)",type:"number",disabled:!i,placeholder:"0000",maxLength:4})}),E(o.AppField,{name:"type",children:e=>E(e.GenericSelectorField,{label:"Account Type",options:EE,disabled:!i})}),u&&S(I,{children:[E("div",{className:wE,children:E(ui,{alignment:"horizontal"})}),E(CE,{bankAccount:t,showStartDate:d})]})]})]})})})}function NE(){return S(oC,{children:[E(lC,{name:"BankTransactionFormRouter",Component:bA}),E(lC,{name:"Conversation",Component:AA}),E(lC,{name:"MobileConversation",Component:DA}),E(lC,{name:"FinancialSummary",Component:HA}),E(lC,{name:"BanksAndIntegrations",Component:qA}),E(lC,{name:"BankAccountForm",Component:SE}),E(lC,{name:"NewConnection",Component:RA})]})}const PE=({environment:e,children:t})=>E(Dn.Provider,{value:e,children:t}),DE=async e=>{const t=e.queryKey,n={path:"/sdk/introspect",accessToken:t[1].accessToken,environment:t[1].environment};return await Ko(n)};function RE({children:e}){const{query:{data:t}}=Mn({queryKey:["sdk/introspect"],queryFn:DE}),n={userId:t?.userId,userRole:t?.userRole||"OWNER",userEmail:t?.email,companyId:t?.companyId?Fi({id:t.companyId,prefix:"COMPANY"}):void 0,customerPartnerId:t?.customerPartnerId,apiPartnerName:t?.apiPartnerName,clientId:t?.clientId,useStripeInvoicePaymentProcessing:t?.useStripeInvoicePaymentProcessing,hasPayroll:t?.hasPayroll,hasShopify:t?.hasShopify,hasSquare:t?.hasSquare,unitIntegrationBankName:t?.unitIntegrationBankName??null};return E(rs.Provider,{value:n,children:e})}const ME=Object.freeze({CACHE_BUST:"CACHE_BUST",CONNECTED:"CONNECTED",HEARTBEAT:"HEARTBEAT",ERROR:"ERROR"});const OE="SSE connection failed with status";function LE({companyId:e,customerPartnerId:t,sseTypes:n}){const r=Rn();k(()=>{if(!t)return;const a=new AbortController,o=function(e,t,n,r){const a=new URL(`${o=e,Rr[o]}/sse/v1/subscribe`);var o;return a.searchParams.append("customerPartnerId",n),t.forEach(e=>a.searchParams.append("events",e)),r&&a.searchParams.append("companyId",r),a.toString()}(r,n,t,e);let i=0;return Ae(o,{onopen:async e=>async function(e){if(e.status>=400&&e.status<500)throw new Error(`${OE} ${e.status}`)}(e),onmessage:a=>function({event:e,data:t,env:n,sseTypes:r,customerPartnerId:a,companyId:o}){switch(e){case ME.CONNECTED:return void vr("SSE connection established",{env:n,customerPartnerId:a,companyId:o,sseTypes:JSON.stringify(Array.from(r))});case ME.ERROR:throw br({error:{name:"SSE error message from server",message:t},severity:"error"}),new Error("SSE error message from server");case ME.CACHE_BUST:return vr("cache bust event received",{sseTypes:JSON.stringify(Array.from(r))}),void function(e){try{const t=JSON.parse(e);Array.isArray(t)&&t.forEach(e=>{setTimeout(()=>{Pn.invalidateQueries({predicate:t=>t.queryKey.includes(e)&&"fetching"!==t.state.fetchStatus}).catch(e=>br({error:e,severity:"error"}))},500*Math.random()),vr(`invalidated query key: ${e} due to cache bust event`)})}catch(t){return void br({error:t instanceof Error?t:new Error("JSON parse error"),severity:"error",extraData:{data:e}})}}(t)}}({event:a.event,data:a.data,env:r,sseTypes:n,customerPartnerId:t,companyId:e}),onclose:()=>function(){throw br({error:new Error("SSE connection closed by server"),severity:"warning"}),new Error("Connection closed unexpectedly")}(),onerror:e=>function(e,t){if(e.message.includes(OE))throw e;return 3e3*2**Math.min(t,3)}(e,i++),signal:a.signal}).catch(e=>br({error:e,severity:"error"})),()=>a.abort("Closing SSE connection")},[r,t,e,n])}const FE=[ME.CACHE_BUST];function BE({children:e}){const{companyId:t,customerPartnerId:n}=v(rs);return LE({companyId:t,customerPartnerId:n,sseTypes:FE}),e}const UE="undefined"!=typeof window?w:k,VE="undefined"==typeof window;function WE(e={}){let{initializeWithValue:t=!0}=e;VE&&(t=!1);const[n,r]=f(()=>t?{width:window.innerWidth,height:window.innerHeight}:{width:void 0,height:void 0}),a=function(e,t=500,n){const r=p();!function(e){const t=p(e);t.current=e,k(()=>()=>{t.current()},[])}(()=>{r.current&&r.current.cancel()});const a=g(()=>{const a=c(e,t,n),o=(...e)=>a(...e);return o.cancel=()=>{a.cancel()},o.isPending=()=>!!r.current,o.flush=()=>a.flush(),o},[e,t,n]);return k(()=>{r.current=c(e,t,n)},[e,t,n]),a}(r,e.debounceDelay,{leading:!0});function o(){(e.debounceDelay?a:r)({width:window.innerWidth,height:window.innerHeight})}return function(e,t,n,r){const a=p(t);UE(()=>{a.current=t},[t]),k(()=>{const t=window;if(!t||!t.addEventListener)return;const n=e=>{a.current(e)};return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}},[e,void 0,r])}("resize",o),UE(()=>{o()},[]),n}const HE=({children:e})=>{const{width:t,height:n}=WE({debounceDelay:150}),r={dimensions:{width:t,height:n}};return E(eh.Provider,{value:r,children:e})};function qE({children:e,environment:t,accessToken:n}){const r={activeToken:n,accountantToken:void 0};return k(()=>{var e,r;e=n,r=t,ur.setProperties(gr),pr=r,hr=e},[n,t]),E(PE,{environment:t,children:E($T,{children:E(En.Provider,{value:r,children:E(RE,{children:E(BE,{children:S(HE,{children:[E(me.ConfirmationRoot,{}),e,E(NE,{})]})})})})})})}export{ZT as BanksAndIntegrations,Ly as BusinessOwnerDashboard,qE as Tight,lx as TransactionsDashboard,Je as useOptions};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|