@zeniai/web-components 4.1.96-betaRD1 → 4.1.96-betaRD2
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/{SessionTimeoutPopup-BExapOll.cjs → SessionTimeoutPopup-BIbnyWTy.cjs} +1 -1
- package/dist/{SessionTimeoutPopup-DuB-kLd9.js → SessionTimeoutPopup-D6BRm8yQ.js} +175 -169
- package/dist/cockpit.cjs.js +1 -1
- package/dist/cockpit.esm.js +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/package.json +2 -2
|
@@ -75371,7 +75371,7 @@ ${ti.beneficiaryAddress} ${te}`,d(fe),L(!0)},oe=(ue,fe,ie,de)=>{let pe,ge;switch
|
|
|
75371
75371
|
width: ${o.sp3};
|
|
75372
75372
|
cursor: pointer;
|
|
75373
75373
|
color: inherit;
|
|
75374
|
-
`,{common:{footer:Yi,texts:{maxLimitReached:xVs,confirmAction:hVs},headers:S_e,create:gVs,strings:W9,texts:aj,cancel:fVs,confirm:yVs,monthsByIndex:CVs},dateFormat:{visual:{MMMDCommaYYYYformat:N6e}},expenseAutomation:CA,uncategorizedTransactionList:{missingReceipt:{bulkUpload:jVs}}}=F.getLocalizedStrings();function bVs(...e){for(const n of e)if(n!=null&&n>0&&!Number.isNaN(n))return n;return 0}const wVs=e=>{const{accountsForFilters:n,categoryOptions:i,classesForFilters:r,expenseAutomationViewSelector:a,isDisabled:l,isRealtimeInsightsFeatureEnabled:c,isUncategorizedExpenseCategoryEnabled:d,isCOTEnabled:u,onUpdateTab:m,onReconTabUpdate:x,onUpdateStep:h,onSearchTextChanged:g,onFiltersChange:y,onRefresh:j,onClose:b,onBack:E,onBulkUploadConfirmMatchAcknowledged:R,onClearMissingReceiptsTabNavigation:v,closeSidePanel:S,initialMissingReceiptsTab:k,resetTransactionCategorizationLocalData:I,updateOperatingExpensesIdsForReview:A,clearJeScheduleLocalData:T,onSaveReconciliation:P}=e,{isAccountingClassesEnabled:L}=e,B=e.bulkUploadEndpoint!=null||e.onBulkUploadFiles!=null,O=iVs({authParams:e.authParams,bulkUploadEndpoint:e.bulkUploadEndpoint,onBulkUploadProgress:e.onBulkUploadProgress,onBulkUploadSuccess:e.onBulkUploadSuccess,onBulkUploadUploadedFileCount:e.onBulkUploadUploadedFileCount,onBulkUploadFilesFallback:e.onBulkUploadFiles,onUploadError:e.onBulkUploadError}),{currentSelectedView:D,allSteps:_,missingReceipts:Q,jeSchedules:z,fluxAnalysis:H,monthEndInsights:W,transactionView:G,selectedTransactionCategorizationTab:V,reconciliation:q,selectedPeriod:J}=a,{pendingMissingReceiptsTabNavigation:Y}=Q,[Z,ee]=f.useState("expenseAutomationPage"),te=z.uiState.selectedMainTab??"pending_review",{onUpdateJESchedulesUIState:X}=e,se=f.useCallback(Nt=>{X({selectedMainTab:Nt})},[X]),[ne,oe]=f.useState(()=>{}),[ce,re]=f.useState(!1),le=K(),ue=!!e.loggedInUser?.userEmail?.includes("zeni.ai"),fe=ue?Vs:np,{openThread:ie,setOpenThread:de}=f.useContext(fe),{useFeatureGate:pe}=Wr(),ge=pe(Da.isExpenseAutomationSearchAndFilterEnabled),[ae,xe]=f.useState(!1),[Ce,he]=f.useState(!1),[je,ve]=f.useState(k??"missing"),Se=f.useRef(null);f.useEffect(()=>{const Nt=Se.current;Nt!==null&&Nt!==je&&S?.(),Se.current=je},[je,S]);const Ee=f.useCallback(Nt=>{ve(Nt)},[]),[we,$e]=f.useState(null),Te=f.useCallback(Nt=>{$e(Nt),ee(Nt!=null?"expenseAutomationMissingReceipts":"expenseAutomationPage")},[ee]),Ie=e.bulkUploadSelector?.confirmMatchStatus.fetchState,Fe=f.useRef(void 0);f.useEffect(()=>{Fe.current==="In-Progress"&&Ie==="Completed"&&we!=null&&(Te(null),R?.()),Fe.current=Ie},[Ie,we,Te,R]),f.useEffect(()=>{je!=="unmatched"&&Te(null)},[je,Te]),f.useEffect(()=>{Y==="unmatched"&&(B&&Ee("unmatched"),v?.())},[Y,v,B,Ee]),f.useEffect(()=>{B===!1&&(je==="unmatched"||je==="completed")&&Ee("missing")},[B,je,Ee]);const{bulkUploadSelector:ke,onSetBulkUploadCompletedSubTab:Re}=e,Ae=f.useRef(null);f.useEffect(()=>{if(ke==null||ke.phase!=="completed")return;const Nt=ke.currentBatchId;if(Nt==null||ke.currentBatchDetailsFetched!==!0||Ae.current===Nt)return;Ae.current=Nt,ke.unmatchedFiles.length+ke.pastUnmatchedFiles.length>0?Ee("unmatched"):(Ee("completed"),Re?.("ai_accountant"))},[ke,Re,Ee]);const[Pe,_e]=f.useState({categories:[],categoryCombinationOperator:"AND"});f.useEffect(()=>{if(ge.isFeatureEnabled===!1&&Pe.categories.length>0){const Nt={categories:[],categoryCombinationOperator:"AND"};_e(Nt),y(Nt)}},[ge.isFeatureEnabled,Pe.categories.length,y]);const Me=_.find(Nt=>Nt.step===D),{nextStep:He,previousStep:We}=vVs(_,D),{uiState:{searchString:Ve,pageToken:Ye},totalCountByTab:Xe,parentTabTotalCountByTab:et,transactions:wt,fetchStateByTransactionTabs:Ze,transactionLocalData:gt}=G,[Oe,qe]=f.useState(Ve??"");f.useEffect(()=>{qe(Ve??"")},[Ve]);const it=f.useMemo(()=>t.debounce(Nt=>g(Nt),500,{leading:!1,trailing:!0}),[g]);f.useEffect(()=>()=>{it.cancel()},[it]);const nt=f.useCallback(Nt=>{qe(Nt),it(Nt)},[it]),{selectedReconAccount:pt,reconciliationTabsState:{reconcile:{localData:{selectedTransactionIds:dt}}}}=q;let xt="Not-Started",It="complete";switch(D){case"missing_receipts":xt=Q.refreshStatus.fetchState,It=Q.completionStatus,je==="unmatched"&&e.bulkUploadSelector!=null&&(e.bulkUploadSelector.batchListFetchState.fetchState==="In-Progress"||e.bulkUploadSelector.batchDetailsPaginationState.fetchState==="In-Progress"||e.bulkUploadSelector.batchDetailsRevalidating===!0)&&xt!=="In-Progress"&&(xt="In-Progress");break;case"je_schedules":xt=z.refreshStatus.fetchState,It=z.completionStatus;break;case"month_end_insights":W!=null&&(xt=W?.fetchState);break;case"flux_analysis":xt=H.refreshStatus.fetchState,It=H.completionStatus;break;case"transaction_categorization":xt=G.refreshStatus.fetchState,It=G.completionStatus;break;case"reconciliation":pt==null?(xt=q.refreshStatus.fetchState,It=q.completionStatus):(xt=q.selectedReconAccount?.refreshStatus.fetchState??"Not-Started",It=q.completionStatus)}const Qt=a.monthEndCloseChecksView.fetchState,vt=Qt==="Not-Started"||Qt==="In-Progress",Tt=a.monthEndCloseChecksView.monthEndCloseChecks?.monthEndCloseCheckList.find(Nt=>Nt.id===D),Je=vt?void 0:Math.floor(Tt?.progress??0),bt=()=>{ne()},ht=Nt=>{_e(Nt),y(Nt)},$t=f.useMemo(()=>{const Nt=U.TRANSACTION_FILTER_CATEGORIES,No=n??[],sn=r??[];return Nt.reduce((Zn,Bt)=>{const po=Bt.value;switch(po){case"amount":return{...Zn,[po]:[]};case"payment_account_name":{const ft=No.map(Kt=>({label:Kt.accountName??"",value:Kt.accountName??""}));return{...Zn,[po]:ft}}case"payment_account_type":{const ft=new Set,Kt=[];for(const Ot of wt)Ot.paymentType==null||Ot.paymentType===""||ft.has(Ot.paymentType)||(ft.add(Ot.paymentType),Kt.push({label:Ot.paymentTypeName??Ot.paymentType,value:Ot.paymentType}));return{...Zn,[po]:Kt}}case"class":{const ft=sn.map(Kt=>({label:Kt.className??"",value:Kt.classId??""}));return{...Zn,[po]:ft}}case"category":{const ft=i?.map(Kt=>({label:Kt.accountName??"",value:Kt.accountId??""}))??[];return{...Zn,[po]:ft}}default:return{...Zn,[po]:[]}}},{})},[n,r,i,wt]),{saveStatus:At,selectedCheckBoxTransactionIds:yo}=G,_n=()=>{const Nt=kNe(a.fluxAnalysis.sections,a.fluxAnalysis.reviewOperatingExpensesIds);switch(Z){case"expenseAutomationFluxPage":return{formId:"expenseAutomationFluxPage",isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:Nt===!0?Yi.markAsReviewed:aj.undo,style:{justifyContent:"space-evenly"},isLoading:a.fluxAnalysis.bulkReviewStatus.fetchState==="In-Progress",isDisabled:!1},leftSideComponent:uH(a.fluxAnalysis.reviewOperatingExpensesIds.length,x8,le,aj.vendor,D),cancelBtn:{label:Yi.cancel,style:{width:"96px",justifyContent:"space-evenly"},onClick:()=>{A([])}}};case"expenseAutomationTransactionsPage":return{formId:"expenseAutomationTransactionsPage",isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:Yi.save,style:{minWidth:"96px",justifyContent:"space-evenly"},isLoading:At.fetchState==="In-Progress",isDisabled:G.hasInFlightCategoryClassRecommendations===!0},leftSideComponent:uH(yo.length,U.MAX_SELECTION_LIMIT,le,aj.transaction,D),cancelBtn:{label:Yi.cancel,style:{width:"96px",justifyContent:"space-evenly"},onClick:()=>{I(V,wt.map(No=>No.id),J,!1,Xe[V],U.getLineItemsByTransactionIdsFromLocalData(gt,V),d,Ye)}}};case"expenseAutomationJESchedulePage":return{formId:"expenseAutomationJESchedulePage",nextBtnLabel:Yi.next,backBtnLabel:Yi.back,isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:Yi.next,style:{justifyContent:"space-evenly"},isDisabled:l||Me?.isNextDisabled===!0||He==null,suffixIcon:t.jsxRuntimeExports.jsx(z6e,{}),onClick:()=>{He!=null&&h(He.step)}},cancelBtn:{label:Yi.back,isDisabled:l||Me?.isPrevDisabled===!0||We==null,style:{width:"96px",justifyContent:"space-evenly"},prefixIcon:t.jsxRuntimeExports.jsx(F6e,{}),onClick:()=>{We!=null&&h(We.step)}}};case"expenseAutomationBankReconReconcilePage":return{formId:"expenseAutomationBankReconReconcilePage",nextBtnLabel:Yi.reconcile,backBtnLabel:Yi.saveForLater,isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:Yi.reconcile,onClick:()=>{P({reconcileAction:"reconcile"})},isDisabled:q.reconciliationTabsState.balances.variance.amount!==0,isLoading:q.actionFetchStates.reconcileFetch.fetchState==="In-Progress",style:{justifyContent:"space-evenly",minWidth:132}},leftSideComponent:uH(dt.length,1/0,le,aj.transaction,D),cancelBtn:{onClick:()=>{P({reconcileAction:"save_reconcile_for_later"})},reverseSpinnerColor:!1,isLoading:q.actionFetchStates.saveForLaterFetch.fetchState==="In-Progress",label:Yi.saveForLater,style:{minWidth:132,justifyContent:"space-evenly"}}};case"expenseAutomationJEAccountSettingsPage":return{formId:"expenseAutomationJEAccountSettingsPage",nextBtnLabel:Yi.save,backBtnLabel:Yi.cancel,isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:Yi.save,isLoading:z.accountSettingsView.saveState.fetchState==="In-Progress",style:{justifyContent:"space-evenly",minWidth:82}},cancelBtn:{onClick:()=>bt(),label:Yi.cancel,style:{minWidth:82,justifyContent:"space-evenly"}}};case"expenseAutomationMissingReceipts":return{formId:"expenseAutomationMissingReceipts",isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:jVs.confirmMatch,isLoading:e.bulkUploadSelector?.confirmMatchStatus.fetchState==="In-Progress",isDisabled:we==null||e.bulkUploadSelector?.confirmMatchStatus.fetchState==="In-Progress",style:{minWidth:"96px",justifyContent:"space-evenly"},onClick:()=>{we!=null&&e.bulkUploadSelector?.confirmMatchStatus.fetchState!=="In-Progress"&&e.onConfirmBulkUploadMatch?.(we.batchId,we.attachmentId,we.transactionId,we.transactionType,we.fileName)}},cancelBtn:{label:Yi.cancel,style:{width:"96px",justifyContent:"space-evenly"},onClick:()=>Te(null)}};default:{const No=D==="reconciliation"&&a.reconciliation.selectedTab==="review"&&a.reconciliation.selectedAccountId!=null,sn=D==="reconciliation"&&a.reconciliation.selectedAccountId==null,Zn=D==="reconciliation"&&a.reconciliation.selectedTab==="reconcile"&&a.reconciliation.selectedAccountId!=null,Bt=He?.step==="month_end_insights"&&(D==="flux_analysis"&&(a.fluxAnalysis.sections.generalExpense?.balancesByMonth!=null||a.fluxAnalysis.sections.reimbursement?.balancesByMonth!=null)||sn),po=D==="transaction_categorization"&&a.selectedTransactionCategorizationTab==="review",ft=D==="transaction_categorization"&&a.selectedTransactionCategorizationTab==="autoCategorized",Kt=a.monthEndCloseChecksView.monthEndCloseChecks?.monthEndCloseCheckList.find(As=>As.id==="month_end_insights"),Ot=a.monthEndCloseChecksView.monthEndCloseChecks?.reportEmailSentDate==null&&Kt?.isDisabled===!1&&(c||Me?.isNextDisabled===!1),mo=He?.step==="month_end_insights"&&(sn||D==="flux_analysis")?!Ot:Me?.isNextDisabled===!0;return{formId:"expenseAutomationPage",nextBtnLabel:Yi.next,backBtnLabel:Yi.back,isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:Bt===!0?RVs(a.selectedPeriod.month):Yi.next,style:{justifyContent:"space-evenly"},isDisabled:mo||He==null,suffixIcon:t.jsxRuntimeExports.jsx(z6e,{}),onClick:()=>{po?m("autoCategorized"):No?x("reconcile"):He!=null&&h(He.step)}},cancelBtn:{label:Yi.back,isDisabled:l||Me?.isPrevDisabled===!0||We==null,style:{width:"96px",justifyContent:"space-evenly"},prefixIcon:t.jsxRuntimeExports.jsx(F6e,{}),onClick:()=>{ft?m("review"):Zn?x("review"):No?E():We!=null&&h(We.step)}}}}}},zo=()=>{switch(Z){case"expenseAutomationFluxPage":return{confirmAction:()=>{xe(!1),A([]),b()}};case"expenseAutomationTransactionsPage":return{confirmAction:()=>{xe(!1),I(V,wt.map(Nt=>Nt.id),J,!1,Xe[V],U.getLineItemsByTransactionIdsFromLocalData(gt,V),d,Ye),b()}};case"expenseAutomationJESchedulePage":return{confirmAction:()=>{xe(!1),T(),b()}};default:return{confirmAction:()=>{xe(!1)},confirmationDescription:W9.empty}}},xn=()=>{Z==="expenseAutomationFluxPage"||Z==="expenseAutomationJESchedulePage"||Z==="expenseAutomationTransactionsPage"?xe(!0):b()},{primaryBtn:Vt,cancelBtn:Mt,leftSideComponent:Xo}=_n(),{confirmAction:ls}=zo(),On=Nt=>{if(D==="transaction_categorization"&&(Nt==="autoCategorized"||Nt==="review")){const No=Nt;return{count:et[No],isFetching:Ze[No].fetchState==="In-Progress"}}if(D==="reconciliation"){const{reconciliation:No}=a,{selectedAccountId:sn}=No;return sn==null?{count:0,isFetching:!1}:Nt==="review"?{count:No.accountReconciliationsByAccountID[sn]?.accountReconEntity?.transactionsToReview.length,isFetching:No.accountReconciliationsByAccountID[sn]?.transactionFetchState.fetchState==="In-Progress"}:{count:No.accountReconciliationsByAccountID[sn]?.accountReconEntity?.transactionsToReconcile.length,isFetching:No.accountReconciliationsByAccountID[sn]?.transactionFetchState.fetchState==="In-Progress"}}if(D==="missing_receipts"){if(Nt==="missing")return{count:Q.transactions.length,isFetching:Q.fetchState==="In-Progress"};if(Nt==="unmatched")return{count:(e.bulkUploadSelector?.unmatchedFiles.length??0)+(e.bulkUploadSelector?.pastUnmatchedFiles.length??0),isFetching:je==="unmatched"&&a_e({bulkUploadSelector:e.bulkUploadSelector})};if(Nt==="completed")return{count:e.bulkUploadSelector?.completedTransactions?.totalCount??0,isFetching:e.bulkUploadSelector?.completedTransactions?.fetchState?.fetchState==="In-Progress",hideCountInTab:!0}}if(D==="je_schedules"){if(Nt==="pending_review")return{count:z.draftSchedules.length+z.resolveSchedules.length,isFetching:z.fetchState==="In-Progress"};if(Nt==="ongoing")return z.ongoingSchedules.length>0?{count:z.ongoingSchedules.length,isFetching:!1}:void 0;if(Nt==="completed")return z.completedSchedules.length>0?{count:z.completedSchedules.length,isFetching:!1}:void 0}},Hn=D==="reconciliation"&&q.selectedAccountId!=null&&q.selectedReconAccount!=null,{month:kn,year:ts}=J,js=U.dateNow().set("month",kn-1).set("year",ts),Yn=js.startOf("month").format(N6e),os=js.endOf("month").format(N6e),qn=`${Yn} ${W9.hyphen} ${os}`,xs=e.sidePanelIsOpen??!1,Ss=e.sidePanelIsFullView??!1,Vo=D==="missing_receipts"&&je==="missing"&&B,gn=e.bulkUploadSelector?.phase,bn=e.bulkUploadSelector,hs=bVs(bn?.progress.total,bn?.uploadedFileCount,O.uploadFileCount),Fo={bulkUploadPhase:gn,isDraggingFiles:O.isDraggingFiles,isUploading:O.isUploading===!0,matchingProgressBannerTotal:hs,onDismissUploadError:O.clearUploadError,onFilesSelected:O.handleBulkUploadFiles,showEmailOrDropZone:O.isUploading!==!0&&gn!=="matching"&&Q.fetchState!=="In-Progress"&&Q.fetchState!=="Not-Started",uploadError:O.uploadError,uploadFileCount:O.uploadFileCount},Dn=D==="missing_receipts"&&je==="completed"&&B&&e.bulkUploadSelector!=null,Ne=D==="transaction_categorization"&&V==="autoCategorized",ut={onDragLeave:O.handleDragLeave,onDragOver:O.handleDragOver,onDrop:O.handleDrop},Ue=D==="reconciliation"&&q.selectedAccountId==null,so=Ne?t.jsxRuntimeExports.jsx(oTs,{activeSubTab:G.selectedTransactionCategorizationCompletedSubTab,allTabs:rVs,onSubTabChange:e.onUpdateTransactionCategorizationCompletedSubTab}):null,Zt=Vo===!0&&!(xs&&Ss)?t.jsxRuntimeExports.jsx(k6e,{...ut,children:t.jsxRuntimeExports.jsx(D6e,{...Fo})}):Dn===!0&&!(xs&&Ss)&&e.bulkUploadSelector!=null?t.jsxRuntimeExports.jsx(O6e,{activeSubTab:e.bulkUploadSelector.completedSubTab,onSubTabChange:Nt=>{e.onSetBulkUploadCompletedSubTab?.(Nt)}}):Ne&&!(xs&&Ss)?so:Ue?t.jsxRuntimeExports.jsx(bNs,{}):null,to=e.isExpenseAutomationCommentingEnabled===!0&&(D==="transaction_categorization"||D==="reconciliation"||D==="missing_receipts"||D==="flux_analysis"||D==="je_schedules");return t.jsxRuntimeExports.jsx(E5o,{companyId:e.companyId,currentSelectedView:D,isCommentingEnabled:to,onThreadClickRoute:e.onExpenseAutomationCommentingThreadClick,children:t.jsxRuntimeExports.jsxs(lVs,{children:[ae?t.jsxRuntimeExports.jsx(fo,{titleComponent:t.jsxRuntimeExports.jsx(Io,{children:hVs}),primaryButtonText:yVs,secondaryButtonText:fVs,proceedButtonVariant:"destructive",action:{onOkClick:()=>{ls()},onCancelClick:()=>xe(!1)},descriptionComponent:t.jsxRuntimeExports.jsx(Mo,{children:CA.confirmationDescription})}):null,t.jsxRuntimeExports.jsx(cf,{isOpen:e.sidePanelIsOpen??!1,isFullView:e.sidePanelIsFullView??!1,listContentPercent:e.sidePanelListPercent,disableMarginTop:nVs(D,B),panelContent:e.panelContent,headerContent:t.jsxRuntimeExports.jsx(dLs,{filters:Pe,selectedEntity:"transaction_categorization",vendorSearchAutoCompleteData:e.vendorSearchAutoCompleteData,vendorSearchAutoCompleteActions:e.vendorSearchAutoCompleteActions,hideTabSwitcher:ce===!0,isCompletionLoading:vt,completionProgressRaw:Tt!=null&&Number.isFinite(Tt.progress)?Tt.progress:void 0,completionPercentage:Je,onBack:E,navBarCustomElement:D==="reconciliation"&&q.selectedAccountId!=null?t.jsxRuntimeExports.jsx(EVs,{reconciliation:q}):void 0,onReconTabUpdate:x,currentRecontab:q.selectedTab,currentMissingReceiptsTab:je,onMissingReceiptsTabUpdate:Ee,currentJeTab:te,onJeTabUpdate:se,selectedGenericTab:D==="je_schedules"?te:void 0,searchText:Oe,onRefresh:D==="missing_receipts"?()=>{switch(je){case"missing":e.onFetchMissingReceiptsList();break;case"unmatched":e.onFetchBulkUploadBatches?.({cacheOverride:!0,invalidateBatchDetailsCache:!0});break;case"completed":e.onFetchCompletedTransactions?.(void 0,!0);break}}:j,onFiltersChange:ht,filterOptions:$t,onGenericTabChange:D==="je_schedules"?Nt=>se(Nt.id):void 0,reconcileDetailPageFetchState:q.selectedAccountId!=null?q.accountReconciliationsByAccountID[q.selectedAccountId]?.transactionFetchState.fetchState:"Not-Started",selectedReconAccountId:Hn?q.selectedAccountId:void 0,currentSelectedView:D,titleStyle:{justifyContent:"center",marginLeft:o.sp0},headerData:na(D,et.autoCategorized,Hn?q.selectedAccountId:void 0,Hn?q.selectedReconAccount?.accountReconEntity?.account.accountName:void 0,Hn?qn:void 0,ge.isFeatureEnabled,D==="missing_receipts"?{includeBulkUploadTabs:B,navTitle:B?S_e.receipts:void 0}:void 0,to),currentTab:V,getTabCountAndFetchState:On,completionStatus:It,refreshStatus:xt,companyId:e.companyId,companyName:a.monthEndInsights?.companyName??W9.empty,isZeniUser:ue,onAllThreadsClick:()=>{ie!=null&&de(null),he(!0)},onUpdateTab:m,onSearchTextChanged:nt,onClose:xn,belowTabsSlot:Zt,isAiCfoAccessEnabled:e.isAiCfoAccessEnabled,onAskAiCfoClick:e.onAskAiCfoClick}),listContent:t.jsxRuntimeExports.jsxs(cVs,{children:[D==="missing_receipts"?t.jsxRuntimeExports.jsx(nWs,{isAccountingClassesEnabled:L,missingReceiptsTab:je,missingTransactionCount:Q.transactions.length,missingReceiptsBulkUploadChromeInPageBody:Vo===!0&&xs&&Ss?t.jsxRuntimeExports.jsx(k6e,{...ut,children:t.jsxRuntimeExports.jsx(D6e,{...Fo})}):null,missingReceiptsCompletedChromeInPageBody:Dn===!0&&xs&&Ss&&e.bulkUploadSelector!=null?t.jsxRuntimeExports.jsx(O6e,{activeSubTab:e.bulkUploadSelector.completedSubTab,onSubTabChange:Nt=>{e.onSetBulkUploadCompletedSubTab?.(Nt)}}):Ne&&xs&&Ss?so:null,bulkUploadInteractions:O,bulkUploadSelector:e.bulkUploadSelector,selectedPeriod:J,authParams:e.authParams,bulkUploadEndpoint:e.bulkUploadEndpoint,transactionAttachmentsEndpoint:e.transactionAttachmentsEndpoint,onBulkUploadSuccess:e.onBulkUploadSuccess,onBulkUploadFiles:e.onBulkUploadFiles,onClearBulkUploadBatchDetailsForScopeChange:e.onClearBulkUploadBatchDetailsForScopeChange,onFetchBulkUploadBatches:e.onFetchBulkUploadBatches,onFetchMoreBatchDetails:e.onFetchMoreBatchDetails,onFetchCompletedTransactions:e.onFetchCompletedTransactions,onDeleteUnmatchedReceipt:e.onDeleteUnmatchedReceipt,onLoadMoreManualSearch:e.onLoadMoreManualSearch,onSearchTransactionsForManualMatch:e.onSearchTransactionsForManualMatch,onPendingMatchChange:Te,pendingMatchAttachmentId:we?.attachmentId??null,pendingMatchTransactionId:we?.transactionId??null,onMissingReceiptsRowClick:e.onMissingReceiptsRowClick,onSetBulkUploadCompletedSubTab:e.onSetBulkUploadCompletedSubTab,onSetBulkUploadSortConfig:e.onSetBulkUploadSortConfig,onResetBulkUploadSort:e.onResetBulkUploadSort,setMissingReceiptsTab:Ee,tableSectionProps:{parentProps:{...e,filters:Pe,isAccountingClassesEnabled:L},isCOTEnabled:u,setIsJeAccountSettingsOpened:re,setResetJeAccountSettingsForm:oe,allThreadsSectionOpen:Ce,setCurrentFooterFormId:ee,currentFooterFormId:Z,onCloseAllThreadsSection:()=>he(!1)}}):D==="flux_analysis"?t.jsxRuntimeExports.jsxs(mVs,{children:[t.jsxRuntimeExports.jsx(wNs,{}),t.jsxRuntimeExports.jsx(yA,{filters:Pe,...e,isAccountingClassesEnabled:L,isCOTEnabled:u,selectedMainTab:te,setIsJeAccountSettingsOpened:re,setResetJeAccountSettingsForm:oe,allThreadsSectionOpen:Ce,setCurrentFooterFormId:ee,currentFooterFormId:Z,onCloseAllThreadsSection:()=>he(!1)})]}):D==="transaction_categorization"?t.jsxRuntimeExports.jsxs(dVs,{children:[t.jsxRuntimeExports.jsx(uVs,{children:t.jsxRuntimeExports.jsx(yA,{filters:Pe,...e,isAccountingClassesEnabled:L,isCOTEnabled:u,selectedMainTab:te,setIsJeAccountSettingsOpened:re,setResetJeAccountSettingsForm:oe,allThreadsSectionOpen:Ce,setCurrentFooterFormId:ee,currentFooterFormId:Z,onCloseAllThreadsSection:()=>he(!1)})}),e.isTransactionActivityEnabled===!0||e.isRightPanelOpen===!0?t.jsxRuntimeExports.jsx(pVs,{$isOpen:e.isRightPanelOpen===!0&&e.rightSidePanel!=null,children:e.isRightPanelOpen===!0&&e.rightSidePanel!=null?e.rightSidePanel:null}):null]}):t.jsxRuntimeExports.jsx(yA,{filters:Pe,...e,isAccountingClassesEnabled:L,isCOTEnabled:u,selectedMainTab:te,setIsJeAccountSettingsOpened:re,setResetJeAccountSettingsForm:oe,allThreadsSectionOpen:Ce,setCurrentFooterFormId:ee,currentFooterFormId:Z,onCloseAllThreadsSection:()=>he(!1)}),t.jsxRuntimeExports.jsx(Rt,{controller:D!=="month_end_insights"&&e.sidePanelIsOpen!==!0&&Z!=="expenseAutomationPage",children:t.jsxRuntimeExports.jsx(Wt,{style:{width:"-webkit-fill-available",height:p[8]},formId:$Vs(Z),primaryBtn:Vt,leftSideComponent:Xo,cancelBtn:Mt,separatorStyle:{marginRight:o.sp4}})})]})})]})})},EVs=({reconciliation:e})=>{const{clearedBalance:n,variance:i,variancePercentage:r,deposits:a,payments:l}=e.reconciliationTabsState.balances,{balance:c}=e.selectedReconAccount?.accountReconEntity??{},{selectedReconAccount:d}=e,{transactionFetchState:u}=d??{},m=u?.fetchState==="In-Progress";return t.jsxRuntimeExports.jsx(TVs,{children:t.jsxRuntimeExports.jsxs(LVs,{children:[t.jsxRuntimeExports.jsx(pH,{children:m?t.jsxRuntimeExports.jsxs(fH,{children:[t.jsxRuntimeExports.jsx(ye,{height:22,width:120,style:{borderRadius:o.sp2}}),t.jsxRuntimeExports.jsx(ye,{height:27,width:120,style:{borderRadius:o.sp2}})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(mH,{children:[t.jsxRuntimeExports.jsx(xH,{children:CA.accountRecon.reconciliation.headers.bankBalance}),t.jsxRuntimeExports.jsx(gH,{children:t.jsxRuntimeExports.jsx(BVs,{})})]}),t.jsxRuntimeExports.jsx(hH,{children:ze("0,0.00",c)})]})}),t.jsxRuntimeExports.jsx(pH,{children:m?t.jsxRuntimeExports.jsxs(fH,{children:[t.jsxRuntimeExports.jsx(ye,{height:22,width:120,style:{borderRadius:o.sp2}}),t.jsxRuntimeExports.jsx(ye,{height:27,width:120,style:{borderRadius:o.sp2}})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(mH,{children:[t.jsxRuntimeExports.jsxs(OVs,{children:[t.jsxRuntimeExports.jsx(xH,{children:CA.accountRecon.reconciliation.headers.clearedBalance}),t.jsxRuntimeExports.jsx(Le,{placement:"bottom",title:t.jsxRuntimeExports.jsxs(zVs,{children:[t.jsxRuntimeExports.jsxs(_6e,{children:[t.jsxRuntimeExports.jsxs(H6e,{children:[l.count," ",aj.payments]}),t.jsxRuntimeExports.jsx(W6e,{children:ze("0,0.[00]",l.totalAmount)})]}),t.jsxRuntimeExports.jsxs(_6e,{children:[t.jsxRuntimeExports.jsxs(H6e,{children:[a.count," ",aj.deposits]}),t.jsxRuntimeExports.jsx(W6e,{children:ze("0,0.[00]",a.totalAmount)})]})]}),display:"flex",children:t.jsxRuntimeExports.jsx(DVs,{})})]}),t.jsxRuntimeExports.jsx(gH,{children:t.jsxRuntimeExports.jsx(MVs,{})})]}),t.jsxRuntimeExports.jsx(hH,{children:ze("0,0.00",n)})]})}),t.jsxRuntimeExports.jsx(pH,{children:m?t.jsxRuntimeExports.jsxs(fH,{children:[t.jsxRuntimeExports.jsx(ye,{height:22,width:120,style:{borderRadius:o.sp2}}),t.jsxRuntimeExports.jsx(ye,{height:27,width:120,style:{borderRadius:o.sp2}})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(mH,{children:[t.jsxRuntimeExports.jsx(xH,{children:CA.accountRecon.reconciliation.headers.variance}),t.jsxRuntimeExports.jsx(gH,{children:t.jsxRuntimeExports.jsx(PVs,{})})]}),t.jsxRuntimeExports.jsxs(hH,{children:[ze("0,0.00",i),r!=null&&t.jsxRuntimeExports.jsx("span",{style:{marginLeft:2},children:`(${r.toFixed(2)}%)`})]})]})})]})})},uH=(e,n,i,r,a)=>{const l=r,c=(e>1?l+"s":l)+" selected";return e>0?t.jsxRuntimeExports.jsxs(SVs,{currentView:a,style:i==="small"?{position:"absolute",top:o.sp2,left:`-${o.sp5}`}:{},children:[t.jsxRuntimeExports.jsx(AVs,{multiDigit:e>=5,children:e}),t.jsxRuntimeExports.jsx(kVs,{children:c}),e===n?t.jsxRuntimeExports.jsx(IVs,{children:`(${xVs})`}):null]}):null},RVs=e=>{const n=CVs[e];return`${gVs}${W9.space}${n}${W9.space}${S_e.insights}`};function vVs(e,n){if(e.length===0)return{nextStep:void 0,previousStep:void 0};const i=e.findIndex(d=>d.step===n);if(i===-1)return{nextStep:void 0,previousStep:void 0};const r=(i+1)%e.length,a=(i-1+e.length)%e.length,l=e[r],c=e[a];return{nextStep:l,previousStep:c}}const $Vs=e=>`${e}_form`,SVs=s.div`
|
|
75374
|
+
`,{common:{footer:Yi,texts:{maxLimitReached:xVs,confirmAction:hVs},headers:S_e,create:gVs,strings:W9,texts:aj,cancel:fVs,confirm:yVs,monthsByIndex:CVs},dateFormat:{visual:{MMMDCommaYYYYformat:N6e}},expenseAutomation:CA,uncategorizedTransactionList:{missingReceipt:{bulkUpload:jVs}}}=F.getLocalizedStrings();function bVs(...e){for(const n of e)if(n!=null&&n>0&&!Number.isNaN(n))return n;return 0}const wVs=e=>{const{accountsForFilters:n,categoryOptions:i,classesForFilters:r,expenseAutomationViewSelector:a,isDisabled:l,isRealtimeInsightsFeatureEnabled:c,isUncategorizedExpenseCategoryEnabled:d,isCOTEnabled:u,onUpdateTab:m,onReconTabUpdate:x,onUpdateStep:h,onSearchTextChanged:g,onFiltersChange:y,onRefresh:j,onClose:b,onBack:E,onBulkUploadConfirmMatchAcknowledged:R,onClearMissingReceiptsTabNavigation:v,closeSidePanel:S,initialMissingReceiptsTab:k,resetTransactionCategorizationLocalData:I,updateOperatingExpensesIdsForReview:A,clearJeScheduleLocalData:T,onSaveReconciliation:P}=e,{isAccountingClassesEnabled:L}=e,B=e.bulkUploadEndpoint!=null||e.onBulkUploadFiles!=null,O=iVs({authParams:e.authParams,bulkUploadEndpoint:e.bulkUploadEndpoint,onBulkUploadProgress:e.onBulkUploadProgress,onBulkUploadSuccess:e.onBulkUploadSuccess,onBulkUploadUploadedFileCount:e.onBulkUploadUploadedFileCount,onBulkUploadFilesFallback:e.onBulkUploadFiles,onUploadError:e.onBulkUploadError}),{currentSelectedView:D,allSteps:_,missingReceipts:Q,jeSchedules:z,fluxAnalysis:H,monthEndInsights:W,transactionView:G,selectedTransactionCategorizationTab:V,reconciliation:q,selectedPeriod:J}=a,{pendingMissingReceiptsTabNavigation:Y}=Q,[Z,ee]=f.useState("expenseAutomationPage"),te=z.uiState.selectedMainTab??"pending_review",{onUpdateJESchedulesUIState:X}=e,se=f.useCallback(Nt=>{X({selectedMainTab:Nt})},[X]),[ne,oe]=f.useState(()=>{}),[ce,re]=f.useState(!1),le=K(),ue=!!e.loggedInUser?.userEmail?.includes("zeni.ai"),fe=ue?Vs:np,{openThread:ie,setOpenThread:de}=f.useContext(fe),{useFeatureGate:pe}=Wr(),ge=pe(Da.isExpenseAutomationSearchAndFilterEnabled),[ae,xe]=f.useState(!1),[Ce,he]=f.useState(!1),[je,ve]=f.useState(k??"missing"),Se=f.useRef(null);f.useEffect(()=>{const Nt=Se.current;Nt!==null&&Nt!==je&&S?.(),Se.current=je},[je,S]);const Ee=f.useCallback(Nt=>{ve(Nt)},[]),[we,$e]=f.useState(null),Te=f.useCallback(Nt=>{$e(Nt),ee(Nt!=null?"expenseAutomationMissingReceipts":"expenseAutomationPage")},[ee]),Ie=e.bulkUploadSelector?.confirmMatchStatus.fetchState,Fe=f.useRef(void 0);f.useEffect(()=>{Fe.current==="In-Progress"&&Ie==="Completed"&&we!=null&&(Te(null),R?.()),Fe.current=Ie},[Ie,we,Te,R]),f.useEffect(()=>{je!=="unmatched"&&Te(null)},[je,Te]),f.useEffect(()=>{Y==="unmatched"&&(B&&Ee("unmatched"),v?.())},[Y,v,B,Ee]),f.useEffect(()=>{B===!1&&(je==="unmatched"||je==="completed")&&Ee("missing")},[B,je,Ee]);const{bulkUploadSelector:ke,onSetBulkUploadCompletedSubTab:Re}=e,Ae=f.useRef(null);f.useEffect(()=>{if(ke==null||ke.phase!=="completed")return;const Nt=ke.currentBatchId;if(Nt==null||ke.currentBatchDetailsFetched!==!0||Ae.current===Nt)return;Ae.current=Nt,ke.unmatchedFiles.length+ke.pastUnmatchedFiles.length>0?Ee("unmatched"):(Ee("completed"),Re?.("ai_accountant"))},[ke,Re,Ee]);const[Pe,_e]=f.useState({categories:[],categoryCombinationOperator:"AND"});f.useEffect(()=>{if(ge.isFeatureEnabled===!1&&Pe.categories.length>0){const Nt={categories:[],categoryCombinationOperator:"AND"};_e(Nt),y(Nt)}},[ge.isFeatureEnabled,Pe.categories.length,y]);const Me=_.find(Nt=>Nt.step===D),{nextStep:He,previousStep:We}=vVs(_,D),{uiState:{searchString:Ve,pageToken:Ye},totalCountByTab:Xe,parentTabTotalCountByTab:et,transactions:wt,fetchStateByTransactionTabs:Ze,transactionLocalData:gt}=G,[Oe,qe]=f.useState(Ve??"");f.useEffect(()=>{qe(Ve??"")},[Ve]);const it=f.useMemo(()=>t.debounce(Nt=>{console.log("[EA-SEARCH] debounce fired, calling onSearchTextChanged",{value:Nt}),g(Nt)},500,{leading:!1,trailing:!0}),[g]);f.useEffect(()=>()=>{it.cancel()},[it]);const nt=f.useCallback(Nt=>{qe(Nt),it(Nt)},[it]),{selectedReconAccount:pt,reconciliationTabsState:{reconcile:{localData:{selectedTransactionIds:dt}}}}=q;let xt="Not-Started",It="complete";switch(D){case"missing_receipts":xt=Q.refreshStatus.fetchState,It=Q.completionStatus,je==="unmatched"&&e.bulkUploadSelector!=null&&(e.bulkUploadSelector.batchListFetchState.fetchState==="In-Progress"||e.bulkUploadSelector.batchDetailsPaginationState.fetchState==="In-Progress"||e.bulkUploadSelector.batchDetailsRevalidating===!0)&&xt!=="In-Progress"&&(xt="In-Progress");break;case"je_schedules":xt=z.refreshStatus.fetchState,It=z.completionStatus;break;case"month_end_insights":W!=null&&(xt=W?.fetchState);break;case"flux_analysis":xt=H.refreshStatus.fetchState,It=H.completionStatus;break;case"transaction_categorization":xt=G.refreshStatus.fetchState,It=G.completionStatus;break;case"reconciliation":pt==null?(xt=q.refreshStatus.fetchState,It=q.completionStatus):(xt=q.selectedReconAccount?.refreshStatus.fetchState??"Not-Started",It=q.completionStatus)}const Qt=a.monthEndCloseChecksView.fetchState,vt=Qt==="Not-Started"||Qt==="In-Progress",Tt=a.monthEndCloseChecksView.monthEndCloseChecks?.monthEndCloseCheckList.find(Nt=>Nt.id===D),Je=vt?void 0:Math.floor(Tt?.progress??0),bt=()=>{ne()},ht=Nt=>{_e(Nt),y(Nt)},$t=f.useMemo(()=>{const Nt=U.TRANSACTION_FILTER_CATEGORIES,No=n??[],sn=r??[];return Nt.reduce((Zn,Bt)=>{const po=Bt.value;switch(po){case"amount":return{...Zn,[po]:[]};case"payment_account_name":{const ft=No.map(Kt=>({label:Kt.accountName??"",value:Kt.accountName??""}));return{...Zn,[po]:ft}}case"payment_account_type":{const ft=new Set,Kt=[];for(const Ot of wt)Ot.paymentType==null||Ot.paymentType===""||ft.has(Ot.paymentType)||(ft.add(Ot.paymentType),Kt.push({label:Ot.paymentTypeName??Ot.paymentType,value:Ot.paymentType}));return{...Zn,[po]:Kt}}case"class":{const ft=sn.map(Kt=>({label:Kt.className??"",value:Kt.classId??""}));return{...Zn,[po]:ft}}case"category":{const ft=i?.map(Kt=>({label:Kt.accountName??"",value:Kt.accountId??""}))??[];return{...Zn,[po]:ft}}default:return{...Zn,[po]:[]}}},{})},[n,r,i,wt]),{saveStatus:At,selectedCheckBoxTransactionIds:yo}=G,_n=()=>{const Nt=kNe(a.fluxAnalysis.sections,a.fluxAnalysis.reviewOperatingExpensesIds);switch(Z){case"expenseAutomationFluxPage":return{formId:"expenseAutomationFluxPage",isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:Nt===!0?Yi.markAsReviewed:aj.undo,style:{justifyContent:"space-evenly"},isLoading:a.fluxAnalysis.bulkReviewStatus.fetchState==="In-Progress",isDisabled:!1},leftSideComponent:uH(a.fluxAnalysis.reviewOperatingExpensesIds.length,x8,le,aj.vendor,D),cancelBtn:{label:Yi.cancel,style:{width:"96px",justifyContent:"space-evenly"},onClick:()=>{A([])}}};case"expenseAutomationTransactionsPage":return{formId:"expenseAutomationTransactionsPage",isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:Yi.save,style:{minWidth:"96px",justifyContent:"space-evenly"},isLoading:At.fetchState==="In-Progress",isDisabled:G.hasInFlightCategoryClassRecommendations===!0},leftSideComponent:uH(yo.length,U.MAX_SELECTION_LIMIT,le,aj.transaction,D),cancelBtn:{label:Yi.cancel,style:{width:"96px",justifyContent:"space-evenly"},onClick:()=>{I(V,wt.map(No=>No.id),J,!1,Xe[V],U.getLineItemsByTransactionIdsFromLocalData(gt,V),d,Ye)}}};case"expenseAutomationJESchedulePage":return{formId:"expenseAutomationJESchedulePage",nextBtnLabel:Yi.next,backBtnLabel:Yi.back,isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:Yi.next,style:{justifyContent:"space-evenly"},isDisabled:l||Me?.isNextDisabled===!0||He==null,suffixIcon:t.jsxRuntimeExports.jsx(z6e,{}),onClick:()=>{He!=null&&h(He.step)}},cancelBtn:{label:Yi.back,isDisabled:l||Me?.isPrevDisabled===!0||We==null,style:{width:"96px",justifyContent:"space-evenly"},prefixIcon:t.jsxRuntimeExports.jsx(F6e,{}),onClick:()=>{We!=null&&h(We.step)}}};case"expenseAutomationBankReconReconcilePage":return{formId:"expenseAutomationBankReconReconcilePage",nextBtnLabel:Yi.reconcile,backBtnLabel:Yi.saveForLater,isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:Yi.reconcile,onClick:()=>{P({reconcileAction:"reconcile"})},isDisabled:q.reconciliationTabsState.balances.variance.amount!==0,isLoading:q.actionFetchStates.reconcileFetch.fetchState==="In-Progress",style:{justifyContent:"space-evenly",minWidth:132}},leftSideComponent:uH(dt.length,1/0,le,aj.transaction,D),cancelBtn:{onClick:()=>{P({reconcileAction:"save_reconcile_for_later"})},reverseSpinnerColor:!1,isLoading:q.actionFetchStates.saveForLaterFetch.fetchState==="In-Progress",label:Yi.saveForLater,style:{minWidth:132,justifyContent:"space-evenly"}}};case"expenseAutomationJEAccountSettingsPage":return{formId:"expenseAutomationJEAccountSettingsPage",nextBtnLabel:Yi.save,backBtnLabel:Yi.cancel,isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:Yi.save,isLoading:z.accountSettingsView.saveState.fetchState==="In-Progress",style:{justifyContent:"space-evenly",minWidth:82}},cancelBtn:{onClick:()=>bt(),label:Yi.cancel,style:{minWidth:82,justifyContent:"space-evenly"}}};case"expenseAutomationMissingReceipts":return{formId:"expenseAutomationMissingReceipts",isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:jVs.confirmMatch,isLoading:e.bulkUploadSelector?.confirmMatchStatus.fetchState==="In-Progress",isDisabled:we==null||e.bulkUploadSelector?.confirmMatchStatus.fetchState==="In-Progress",style:{minWidth:"96px",justifyContent:"space-evenly"},onClick:()=>{we!=null&&e.bulkUploadSelector?.confirmMatchStatus.fetchState!=="In-Progress"&&e.onConfirmBulkUploadMatch?.(we.batchId,we.attachmentId,we.transactionId,we.transactionType,we.fileName)}},cancelBtn:{label:Yi.cancel,style:{width:"96px",justifyContent:"space-evenly"},onClick:()=>Te(null)}};default:{const No=D==="reconciliation"&&a.reconciliation.selectedTab==="review"&&a.reconciliation.selectedAccountId!=null,sn=D==="reconciliation"&&a.reconciliation.selectedAccountId==null,Zn=D==="reconciliation"&&a.reconciliation.selectedTab==="reconcile"&&a.reconciliation.selectedAccountId!=null,Bt=He?.step==="month_end_insights"&&(D==="flux_analysis"&&(a.fluxAnalysis.sections.generalExpense?.balancesByMonth!=null||a.fluxAnalysis.sections.reimbursement?.balancesByMonth!=null)||sn),po=D==="transaction_categorization"&&a.selectedTransactionCategorizationTab==="review",ft=D==="transaction_categorization"&&a.selectedTransactionCategorizationTab==="autoCategorized",Kt=a.monthEndCloseChecksView.monthEndCloseChecks?.monthEndCloseCheckList.find(As=>As.id==="month_end_insights"),Ot=a.monthEndCloseChecksView.monthEndCloseChecks?.reportEmailSentDate==null&&Kt?.isDisabled===!1&&(c||Me?.isNextDisabled===!1),mo=He?.step==="month_end_insights"&&(sn||D==="flux_analysis")?!Ot:Me?.isNextDisabled===!0;return{formId:"expenseAutomationPage",nextBtnLabel:Yi.next,backBtnLabel:Yi.back,isNextDisabled:!1,isPrevDisabled:!1,primaryBtn:{label:Bt===!0?RVs(a.selectedPeriod.month):Yi.next,style:{justifyContent:"space-evenly"},isDisabled:mo||He==null,suffixIcon:t.jsxRuntimeExports.jsx(z6e,{}),onClick:()=>{po?m("autoCategorized"):No?x("reconcile"):He!=null&&h(He.step)}},cancelBtn:{label:Yi.back,isDisabled:l||Me?.isPrevDisabled===!0||We==null,style:{width:"96px",justifyContent:"space-evenly"},prefixIcon:t.jsxRuntimeExports.jsx(F6e,{}),onClick:()=>{ft?m("review"):Zn?x("review"):No?E():We!=null&&h(We.step)}}}}}},zo=()=>{switch(Z){case"expenseAutomationFluxPage":return{confirmAction:()=>{xe(!1),A([]),b()}};case"expenseAutomationTransactionsPage":return{confirmAction:()=>{xe(!1),I(V,wt.map(Nt=>Nt.id),J,!1,Xe[V],U.getLineItemsByTransactionIdsFromLocalData(gt,V),d,Ye),b()}};case"expenseAutomationJESchedulePage":return{confirmAction:()=>{xe(!1),T(),b()}};default:return{confirmAction:()=>{xe(!1)},confirmationDescription:W9.empty}}},xn=()=>{Z==="expenseAutomationFluxPage"||Z==="expenseAutomationJESchedulePage"||Z==="expenseAutomationTransactionsPage"?xe(!0):b()},{primaryBtn:Vt,cancelBtn:Mt,leftSideComponent:Xo}=_n(),{confirmAction:ls}=zo(),On=Nt=>{if(D==="transaction_categorization"&&(Nt==="autoCategorized"||Nt==="review")){const No=Nt;return{count:et[No],isFetching:Ze[No].fetchState==="In-Progress"}}if(D==="reconciliation"){const{reconciliation:No}=a,{selectedAccountId:sn}=No;return sn==null?{count:0,isFetching:!1}:Nt==="review"?{count:No.accountReconciliationsByAccountID[sn]?.accountReconEntity?.transactionsToReview.length,isFetching:No.accountReconciliationsByAccountID[sn]?.transactionFetchState.fetchState==="In-Progress"}:{count:No.accountReconciliationsByAccountID[sn]?.accountReconEntity?.transactionsToReconcile.length,isFetching:No.accountReconciliationsByAccountID[sn]?.transactionFetchState.fetchState==="In-Progress"}}if(D==="missing_receipts"){if(Nt==="missing")return{count:Q.transactions.length,isFetching:Q.fetchState==="In-Progress"};if(Nt==="unmatched")return{count:(e.bulkUploadSelector?.unmatchedFiles.length??0)+(e.bulkUploadSelector?.pastUnmatchedFiles.length??0),isFetching:je==="unmatched"&&a_e({bulkUploadSelector:e.bulkUploadSelector})};if(Nt==="completed")return{count:e.bulkUploadSelector?.completedTransactions?.totalCount??0,isFetching:e.bulkUploadSelector?.completedTransactions?.fetchState?.fetchState==="In-Progress",hideCountInTab:!0}}if(D==="je_schedules"){if(Nt==="pending_review")return{count:z.draftSchedules.length+z.resolveSchedules.length,isFetching:z.fetchState==="In-Progress"};if(Nt==="ongoing")return z.ongoingSchedules.length>0?{count:z.ongoingSchedules.length,isFetching:!1}:void 0;if(Nt==="completed")return z.completedSchedules.length>0?{count:z.completedSchedules.length,isFetching:!1}:void 0}},Hn=D==="reconciliation"&&q.selectedAccountId!=null&&q.selectedReconAccount!=null,{month:kn,year:ts}=J,js=U.dateNow().set("month",kn-1).set("year",ts),Yn=js.startOf("month").format(N6e),os=js.endOf("month").format(N6e),qn=`${Yn} ${W9.hyphen} ${os}`,xs=e.sidePanelIsOpen??!1,Ss=e.sidePanelIsFullView??!1,Vo=D==="missing_receipts"&&je==="missing"&&B,gn=e.bulkUploadSelector?.phase,bn=e.bulkUploadSelector,hs=bVs(bn?.progress.total,bn?.uploadedFileCount,O.uploadFileCount),Fo={bulkUploadPhase:gn,isDraggingFiles:O.isDraggingFiles,isUploading:O.isUploading===!0,matchingProgressBannerTotal:hs,onDismissUploadError:O.clearUploadError,onFilesSelected:O.handleBulkUploadFiles,showEmailOrDropZone:O.isUploading!==!0&&gn!=="matching"&&Q.fetchState!=="In-Progress"&&Q.fetchState!=="Not-Started",uploadError:O.uploadError,uploadFileCount:O.uploadFileCount},Dn=D==="missing_receipts"&&je==="completed"&&B&&e.bulkUploadSelector!=null,Ne=D==="transaction_categorization"&&V==="autoCategorized",ut={onDragLeave:O.handleDragLeave,onDragOver:O.handleDragOver,onDrop:O.handleDrop},Ue=D==="reconciliation"&&q.selectedAccountId==null,so=Ne?t.jsxRuntimeExports.jsx(oTs,{activeSubTab:G.selectedTransactionCategorizationCompletedSubTab,allTabs:rVs,onSubTabChange:e.onUpdateTransactionCategorizationCompletedSubTab}):null,Zt=Vo===!0&&!(xs&&Ss)?t.jsxRuntimeExports.jsx(k6e,{...ut,children:t.jsxRuntimeExports.jsx(D6e,{...Fo})}):Dn===!0&&!(xs&&Ss)&&e.bulkUploadSelector!=null?t.jsxRuntimeExports.jsx(O6e,{activeSubTab:e.bulkUploadSelector.completedSubTab,onSubTabChange:Nt=>{e.onSetBulkUploadCompletedSubTab?.(Nt)}}):Ne&&!(xs&&Ss)?so:Ue?t.jsxRuntimeExports.jsx(bNs,{}):null,to=e.isExpenseAutomationCommentingEnabled===!0&&(D==="transaction_categorization"||D==="reconciliation"||D==="missing_receipts"||D==="flux_analysis"||D==="je_schedules");return t.jsxRuntimeExports.jsx(E5o,{companyId:e.companyId,currentSelectedView:D,isCommentingEnabled:to,onThreadClickRoute:e.onExpenseAutomationCommentingThreadClick,children:t.jsxRuntimeExports.jsxs(lVs,{children:[ae?t.jsxRuntimeExports.jsx(fo,{titleComponent:t.jsxRuntimeExports.jsx(Io,{children:hVs}),primaryButtonText:yVs,secondaryButtonText:fVs,proceedButtonVariant:"destructive",action:{onOkClick:()=>{ls()},onCancelClick:()=>xe(!1)},descriptionComponent:t.jsxRuntimeExports.jsx(Mo,{children:CA.confirmationDescription})}):null,t.jsxRuntimeExports.jsx(cf,{isOpen:e.sidePanelIsOpen??!1,isFullView:e.sidePanelIsFullView??!1,listContentPercent:e.sidePanelListPercent,disableMarginTop:nVs(D,B),panelContent:e.panelContent,headerContent:t.jsxRuntimeExports.jsx(dLs,{filters:Pe,selectedEntity:"transaction_categorization",vendorSearchAutoCompleteData:e.vendorSearchAutoCompleteData,vendorSearchAutoCompleteActions:e.vendorSearchAutoCompleteActions,hideTabSwitcher:ce===!0,isCompletionLoading:vt,completionProgressRaw:Tt!=null&&Number.isFinite(Tt.progress)?Tt.progress:void 0,completionPercentage:Je,onBack:E,navBarCustomElement:D==="reconciliation"&&q.selectedAccountId!=null?t.jsxRuntimeExports.jsx(EVs,{reconciliation:q}):void 0,onReconTabUpdate:x,currentRecontab:q.selectedTab,currentMissingReceiptsTab:je,onMissingReceiptsTabUpdate:Ee,currentJeTab:te,onJeTabUpdate:se,selectedGenericTab:D==="je_schedules"?te:void 0,searchText:Oe,onRefresh:D==="missing_receipts"?()=>{switch(je){case"missing":e.onFetchMissingReceiptsList();break;case"unmatched":e.onFetchBulkUploadBatches?.({cacheOverride:!0,invalidateBatchDetailsCache:!0});break;case"completed":e.onFetchCompletedTransactions?.(void 0,!0);break}}:j,onFiltersChange:ht,filterOptions:$t,onGenericTabChange:D==="je_schedules"?Nt=>se(Nt.id):void 0,reconcileDetailPageFetchState:q.selectedAccountId!=null?q.accountReconciliationsByAccountID[q.selectedAccountId]?.transactionFetchState.fetchState:"Not-Started",selectedReconAccountId:Hn?q.selectedAccountId:void 0,currentSelectedView:D,titleStyle:{justifyContent:"center",marginLeft:o.sp0},headerData:na(D,et.autoCategorized,Hn?q.selectedAccountId:void 0,Hn?q.selectedReconAccount?.accountReconEntity?.account.accountName:void 0,Hn?qn:void 0,ge.isFeatureEnabled,D==="missing_receipts"?{includeBulkUploadTabs:B,navTitle:B?S_e.receipts:void 0}:void 0,to),currentTab:V,getTabCountAndFetchState:On,completionStatus:It,refreshStatus:xt,companyId:e.companyId,companyName:a.monthEndInsights?.companyName??W9.empty,isZeniUser:ue,onAllThreadsClick:()=>{ie!=null&&de(null),he(!0)},onUpdateTab:m,onSearchTextChanged:nt,onClose:xn,belowTabsSlot:Zt,isAiCfoAccessEnabled:e.isAiCfoAccessEnabled,onAskAiCfoClick:e.onAskAiCfoClick}),listContent:t.jsxRuntimeExports.jsxs(cVs,{children:[D==="missing_receipts"?t.jsxRuntimeExports.jsx(nWs,{isAccountingClassesEnabled:L,missingReceiptsTab:je,missingTransactionCount:Q.transactions.length,missingReceiptsBulkUploadChromeInPageBody:Vo===!0&&xs&&Ss?t.jsxRuntimeExports.jsx(k6e,{...ut,children:t.jsxRuntimeExports.jsx(D6e,{...Fo})}):null,missingReceiptsCompletedChromeInPageBody:Dn===!0&&xs&&Ss&&e.bulkUploadSelector!=null?t.jsxRuntimeExports.jsx(O6e,{activeSubTab:e.bulkUploadSelector.completedSubTab,onSubTabChange:Nt=>{e.onSetBulkUploadCompletedSubTab?.(Nt)}}):Ne&&xs&&Ss?so:null,bulkUploadInteractions:O,bulkUploadSelector:e.bulkUploadSelector,selectedPeriod:J,authParams:e.authParams,bulkUploadEndpoint:e.bulkUploadEndpoint,transactionAttachmentsEndpoint:e.transactionAttachmentsEndpoint,onBulkUploadSuccess:e.onBulkUploadSuccess,onBulkUploadFiles:e.onBulkUploadFiles,onClearBulkUploadBatchDetailsForScopeChange:e.onClearBulkUploadBatchDetailsForScopeChange,onFetchBulkUploadBatches:e.onFetchBulkUploadBatches,onFetchMoreBatchDetails:e.onFetchMoreBatchDetails,onFetchCompletedTransactions:e.onFetchCompletedTransactions,onDeleteUnmatchedReceipt:e.onDeleteUnmatchedReceipt,onLoadMoreManualSearch:e.onLoadMoreManualSearch,onSearchTransactionsForManualMatch:e.onSearchTransactionsForManualMatch,onPendingMatchChange:Te,pendingMatchAttachmentId:we?.attachmentId??null,pendingMatchTransactionId:we?.transactionId??null,onMissingReceiptsRowClick:e.onMissingReceiptsRowClick,onSetBulkUploadCompletedSubTab:e.onSetBulkUploadCompletedSubTab,onSetBulkUploadSortConfig:e.onSetBulkUploadSortConfig,onResetBulkUploadSort:e.onResetBulkUploadSort,setMissingReceiptsTab:Ee,tableSectionProps:{parentProps:{...e,filters:Pe,isAccountingClassesEnabled:L},isCOTEnabled:u,setIsJeAccountSettingsOpened:re,setResetJeAccountSettingsForm:oe,allThreadsSectionOpen:Ce,setCurrentFooterFormId:ee,currentFooterFormId:Z,onCloseAllThreadsSection:()=>he(!1)}}):D==="flux_analysis"?t.jsxRuntimeExports.jsxs(mVs,{children:[t.jsxRuntimeExports.jsx(wNs,{}),t.jsxRuntimeExports.jsx(yA,{filters:Pe,...e,isAccountingClassesEnabled:L,isCOTEnabled:u,selectedMainTab:te,setIsJeAccountSettingsOpened:re,setResetJeAccountSettingsForm:oe,allThreadsSectionOpen:Ce,setCurrentFooterFormId:ee,currentFooterFormId:Z,onCloseAllThreadsSection:()=>he(!1)})]}):D==="transaction_categorization"?t.jsxRuntimeExports.jsxs(dVs,{children:[t.jsxRuntimeExports.jsx(uVs,{children:t.jsxRuntimeExports.jsx(yA,{filters:Pe,...e,isAccountingClassesEnabled:L,isCOTEnabled:u,selectedMainTab:te,setIsJeAccountSettingsOpened:re,setResetJeAccountSettingsForm:oe,allThreadsSectionOpen:Ce,setCurrentFooterFormId:ee,currentFooterFormId:Z,onCloseAllThreadsSection:()=>he(!1)})}),e.isTransactionActivityEnabled===!0||e.isRightPanelOpen===!0?t.jsxRuntimeExports.jsx(pVs,{$isOpen:e.isRightPanelOpen===!0&&e.rightSidePanel!=null,children:e.isRightPanelOpen===!0&&e.rightSidePanel!=null?e.rightSidePanel:null}):null]}):t.jsxRuntimeExports.jsx(yA,{filters:Pe,...e,isAccountingClassesEnabled:L,isCOTEnabled:u,selectedMainTab:te,setIsJeAccountSettingsOpened:re,setResetJeAccountSettingsForm:oe,allThreadsSectionOpen:Ce,setCurrentFooterFormId:ee,currentFooterFormId:Z,onCloseAllThreadsSection:()=>he(!1)}),t.jsxRuntimeExports.jsx(Rt,{controller:D!=="month_end_insights"&&e.sidePanelIsOpen!==!0&&Z!=="expenseAutomationPage",children:t.jsxRuntimeExports.jsx(Wt,{style:{width:"-webkit-fill-available",height:p[8]},formId:$Vs(Z),primaryBtn:Vt,leftSideComponent:Xo,cancelBtn:Mt,separatorStyle:{marginRight:o.sp4}})})]})})]})})},EVs=({reconciliation:e})=>{const{clearedBalance:n,variance:i,variancePercentage:r,deposits:a,payments:l}=e.reconciliationTabsState.balances,{balance:c}=e.selectedReconAccount?.accountReconEntity??{},{selectedReconAccount:d}=e,{transactionFetchState:u}=d??{},m=u?.fetchState==="In-Progress";return t.jsxRuntimeExports.jsx(TVs,{children:t.jsxRuntimeExports.jsxs(LVs,{children:[t.jsxRuntimeExports.jsx(pH,{children:m?t.jsxRuntimeExports.jsxs(fH,{children:[t.jsxRuntimeExports.jsx(ye,{height:22,width:120,style:{borderRadius:o.sp2}}),t.jsxRuntimeExports.jsx(ye,{height:27,width:120,style:{borderRadius:o.sp2}})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(mH,{children:[t.jsxRuntimeExports.jsx(xH,{children:CA.accountRecon.reconciliation.headers.bankBalance}),t.jsxRuntimeExports.jsx(gH,{children:t.jsxRuntimeExports.jsx(BVs,{})})]}),t.jsxRuntimeExports.jsx(hH,{children:ze("0,0.00",c)})]})}),t.jsxRuntimeExports.jsx(pH,{children:m?t.jsxRuntimeExports.jsxs(fH,{children:[t.jsxRuntimeExports.jsx(ye,{height:22,width:120,style:{borderRadius:o.sp2}}),t.jsxRuntimeExports.jsx(ye,{height:27,width:120,style:{borderRadius:o.sp2}})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(mH,{children:[t.jsxRuntimeExports.jsxs(OVs,{children:[t.jsxRuntimeExports.jsx(xH,{children:CA.accountRecon.reconciliation.headers.clearedBalance}),t.jsxRuntimeExports.jsx(Le,{placement:"bottom",title:t.jsxRuntimeExports.jsxs(zVs,{children:[t.jsxRuntimeExports.jsxs(_6e,{children:[t.jsxRuntimeExports.jsxs(H6e,{children:[l.count," ",aj.payments]}),t.jsxRuntimeExports.jsx(W6e,{children:ze("0,0.[00]",l.totalAmount)})]}),t.jsxRuntimeExports.jsxs(_6e,{children:[t.jsxRuntimeExports.jsxs(H6e,{children:[a.count," ",aj.deposits]}),t.jsxRuntimeExports.jsx(W6e,{children:ze("0,0.[00]",a.totalAmount)})]})]}),display:"flex",children:t.jsxRuntimeExports.jsx(DVs,{})})]}),t.jsxRuntimeExports.jsx(gH,{children:t.jsxRuntimeExports.jsx(MVs,{})})]}),t.jsxRuntimeExports.jsx(hH,{children:ze("0,0.00",n)})]})}),t.jsxRuntimeExports.jsx(pH,{children:m?t.jsxRuntimeExports.jsxs(fH,{children:[t.jsxRuntimeExports.jsx(ye,{height:22,width:120,style:{borderRadius:o.sp2}}),t.jsxRuntimeExports.jsx(ye,{height:27,width:120,style:{borderRadius:o.sp2}})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(mH,{children:[t.jsxRuntimeExports.jsx(xH,{children:CA.accountRecon.reconciliation.headers.variance}),t.jsxRuntimeExports.jsx(gH,{children:t.jsxRuntimeExports.jsx(PVs,{})})]}),t.jsxRuntimeExports.jsxs(hH,{children:[ze("0,0.00",i),r!=null&&t.jsxRuntimeExports.jsx("span",{style:{marginLeft:2},children:`(${r.toFixed(2)}%)`})]})]})})]})})},uH=(e,n,i,r,a)=>{const l=r,c=(e>1?l+"s":l)+" selected";return e>0?t.jsxRuntimeExports.jsxs(SVs,{currentView:a,style:i==="small"?{position:"absolute",top:o.sp2,left:`-${o.sp5}`}:{},children:[t.jsxRuntimeExports.jsx(AVs,{multiDigit:e>=5,children:e}),t.jsxRuntimeExports.jsx(kVs,{children:c}),e===n?t.jsxRuntimeExports.jsx(IVs,{children:`(${xVs})`}):null]}):null},RVs=e=>{const n=CVs[e];return`${gVs}${W9.space}${n}${W9.space}${S_e.insights}`};function vVs(e,n){if(e.length===0)return{nextStep:void 0,previousStep:void 0};const i=e.findIndex(d=>d.step===n);if(i===-1)return{nextStep:void 0,previousStep:void 0};const r=(i+1)%e.length,a=(i-1+e.length)%e.length,l=e[r],c=e[a];return{nextStep:l,previousStep:c}}const $Vs=e=>`${e}_form`,SVs=s.div`
|
|
75375
75375
|
display: flex;
|
|
75376
75376
|
justify-content: flex-start;
|
|
75377
75377
|
align-items: center;
|