@zeniai/web-app-ui 5.1.60-qa → 5.1.61-qa

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.
Files changed (107) hide show
  1. package/dist/assets/AddressRoutes-DYu6X0mE.js +1 -0
  2. package/dist/assets/{AddressScreen-FgxQZ6Pn.js → AddressScreen-DmitYkw7.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-CZfRGF0l.js → AiCfoScreen-It5Iqwvu.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-DxR0TAud.js → BillPayApprovalRoutes-BzW0b3Z-.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-CxBU4_Qt.js → BillPayRoutes-BM10Ap-2.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-CsuP5vKP.js → BusinessVerificationPageScreen-tq2Pq8-k.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-BJGdQu7N.js → CardsAiCfoScreen-DWCPoMx2.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-DV0rSLTc.js → ChargeCardRoutes-BKpbGgWX.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-MkVkCyf-.js → CompanyPassportScreen-CdbgEPbH.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-BZSmdXjw.js → ConnectionAuthScreen-B6ApFE5A.js} +1 -1
  11. package/dist/assets/CustomerOnboardingAuthScreen-BC6kPGo0.js +1 -0
  12. package/dist/assets/CustomerOnboardingRoutes-DC4e3Ogu.js +30 -0
  13. package/dist/assets/{DashboardRoutes-CF_VnugU.js → DashboardRoutes-BpHU2Qkf.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-DDp58t5d.js → DefaultTenantHome-TmE6YsRf.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-DJG5dj2b.js → DomesticWireDetailScreen-Bg4mE0II.js} +1 -1
  16. package/dist/assets/{DrawerScreen-Q_os61z4.js → DrawerScreen-Q_Fkogtz.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-DWaZ2x0h.js → EntityDetailRoutes-FVCOQ4xF.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-BAGScNm2.js → ExpenseAutomationRoutes-CGrxhlUE.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-BsLL5iCn.js → FeaturePreviewScreen-D35UAPet.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-OGK79MYJ.js → HubSpotOAuthCallbackScreen-CqLWzeL5.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-DPOV0bqy.js → MagicLinkRoutes-Cy9sY1KO.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-DIaQ6IJE.js → MagicLinkSignInScreen-CTQVJ1D1.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-DQwHFEP8.js → MobileAppDrawer-DChLZMjE.js} +1 -1
  24. package/dist/assets/NotFoundScreen-DRRoMVDk.js +1 -0
  25. package/dist/assets/{NotificationRoutes-BLkbRobx.js → NotificationRoutes-DC-UVqrq.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-B21EksvD.js → OAuthConsentScreen-DXJTz5MU.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-ClN_7czZ.js → PandLWithForecastRoutes-DtN54cOv.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-BBk6x3GN.js → PeopleRoutes-DM0B31yg.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-BpOIoQ_l.js → PerformanceRoutes-yT4nKfMt.js} +1 -1
  30. package/dist/assets/{Preview-dDFLUSBQ.js → Preview-DgYvT3D-.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-BmcSCHav.js → QBOConnectionScreen-Dxk5EKMF.js} +1 -1
  32. package/dist/assets/{ReferralListScreen-CXbObkR0.js → ReferralListScreen-DoZyTHjO.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRoutes-C7YE-LAA.js → ReimbursementApprovalRoutes-AEJXMIeN.js} +1 -1
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Q0l5mvWj.js → ReimbursementApprovalRuleDetailScreen-Btjx5v4l.js} +1 -1
  35. package/dist/assets/{ReimbursementRoutes-DcDcmnq5.js → ReimbursementRoutes-CLjD-rz3.js} +1 -1
  36. package/dist/assets/{ReportsRoutes-BMAOx8yk.js → ReportsRoutes-DIvKwgKT.js} +1 -1
  37. package/dist/assets/{RewardsRoutes-Cz7znVbs.js → RewardsRoutes-B_SjWYxl.js} +1 -1
  38. package/dist/assets/{ScreenRoutes-Uy0Kxm7R.js → ScreenRoutes-DrzMUCeq.js} +2 -2
  39. package/dist/assets/{SettingsRoutes-DVfn4HMx.js → SettingsRoutes-CwZJeFhH.js} +1 -1
  40. package/dist/assets/{SetupPagesScreen-CVepw64Y.js → SetupPagesScreen-DHP6inkV.js} +1 -1
  41. package/dist/assets/{SignInScreen-CA6G7f6o.js → SignInScreen-B5h77NMY.js} +1 -1
  42. package/dist/assets/{SignOutScreen-B7LAzkpH.js → SignOutScreen-MsTaSP0q.js} +1 -1
  43. package/dist/assets/{TaskListScreen-BYXHdSHM.js → TaskListScreen-BDTDGrzi.js} +1 -1
  44. package/dist/assets/{TaskRoutes-0COd9gMj.js → TaskRoutes-CNamnrYQ.js} +1 -1
  45. package/dist/assets/{TransactionDetailRoutes-B7hwRUTE.js → TransactionDetailRoutes-DWs1Egcj.js} +1 -1
  46. package/dist/assets/{TransactionDetailScreen-BLBk60iy.js → TransactionDetailScreen-BbsGsqi_.js} +1 -1
  47. package/dist/assets/{TransactionListRoutes-CU2IvbfK.js → TransactionListRoutes-Co9duxwX.js} +1 -1
  48. package/dist/assets/{TreasuryRoutes-nOHCoa6D.js → TreasuryRoutes-B_Dv4GZ7.js} +1 -1
  49. package/dist/assets/{VendorsRoutes-Bms7VhV2.js → VendorsRoutes-puD2Dgk7.js} +1 -1
  50. package/dist/assets/{WiseConfirmationScreen-DgOnupdP.js → WiseConfirmationScreen-DAi_rrl_.js} +1 -1
  51. package/dist/assets/{ZeniAccountRoutes-rCwoYBVh.js → ZeniAccountRoutes-CbulRVVe.js} +1 -1
  52. package/dist/assets/{ZeniAccountStatementScreen-DnZ2Bj4h.js → ZeniAccountStatementScreen-DbJvbotJ.js} +1 -1
  53. package/dist/assets/{accountMappingHelper-BBILjeHz.js → accountMappingHelper-BPz1owqi.js} +1 -1
  54. package/dist/assets/{analytics-BlxwN6GD.js → analytics-C-A3qVJh.js} +1 -1
  55. package/dist/assets/{analyticsHelper-CrGhWq9e.js → analyticsHelper-CewoJ3Hu.js} +1 -1
  56. package/dist/assets/{core-Ctjv24YM.js → core-SRRzy8qJ.js} +1 -1
  57. package/dist/assets/{decodeURIComponentSafe-Z8As9uQN.js → decodeURIComponentSafe-Bz-26BXW.js} +1 -1
  58. package/dist/assets/{dnd-DdE4ICzz.js → dnd-CR8sMRK3.js} +1 -1
  59. package/dist/assets/{empty-Cgmg-ODN.js → empty-BjaZv87n.js} +1 -1
  60. package/dist/assets/{empty-BgBFHjf_.js → empty-Btqk4ZK3.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-BxJPDgaA.js → emptyVideoElement-CcSCePHi.js} +1 -1
  62. package/dist/assets/{epic-D1NCPIYf.js → epic-DDYIjE2A.js} +1 -1
  63. package/dist/assets/{getLocaleForTenant-DnliJT-u.js → getLocaleForTenant-DHWNDQcY.js} +1 -1
  64. package/dist/assets/{index-B6LHkFfA.js → index-6PBzTIZ2.js} +1 -1
  65. package/dist/assets/{index-BJyv5Z6x.js → index-BnX1nS7p.js} +85 -85
  66. package/dist/assets/{index-DN_Tvj5e.js → index-CEFX9nem.js} +1 -1
  67. package/dist/assets/{index-DZAo63F3.js → index-CejiZfG4.js} +1 -1
  68. package/dist/assets/{index-Brx9Hk6c.js → index-CxtVVz4g.js} +1 -1
  69. package/dist/assets/{index-DrylXWCT.js → index-DiKyQs4W.js} +1 -1
  70. package/dist/assets/{index-D5yqrruP.js → index-JPErnqsm.js} +2 -2
  71. package/dist/assets/{index-hzMyClsK.js → index-rTYnRLvf.js} +1 -1
  72. package/dist/assets/{lexical-z-P2V9ug.js → lexical-qJrDnJMV.js} +1 -1
  73. package/dist/assets/{liveblocks-UQZFqaDN.js → liveblocks-DS8sOLD1.js} +1 -1
  74. package/dist/assets/{lottie-h9wdJ9gi.js → lottie-Coq2aDEW.js} +1 -1
  75. package/dist/assets/{mui-DU4JyJ-_.js → mui-DQ-jfgFM.js} +1 -1
  76. package/dist/assets/{pathToGoBack-dHZq4iEC.js → pathToGoBack-BmSmVqnZ.js} +1 -1
  77. package/dist/assets/{pdf-BK4Cbxeo.js → pdf-D2Xq7623.js} +4 -4
  78. package/dist/assets/{pdf-lib-BWuwD2_b.js → pdf-lib-fB9Fkl6A.js} +1 -1
  79. package/dist/assets/{plaid-Dtkg2fMC.js → plaid-DWZgMqW3.js} +1 -1
  80. package/dist/assets/{pusher-BRkEMaTd.js → pusher-Xj81uOBz.js} +1 -1
  81. package/dist/assets/{react-DDqHZ_bg.js → react-BlqDZveQ.js} +1 -1
  82. package/dist/assets/{react-BEV1hQDm.js → react-CgdBA-iC.js} +1 -1
  83. package/dist/assets/{react-lX-1Fc9t.js → react-DRyTZBkZ.js} +1 -1
  84. package/dist/assets/{react-BTEnGEot.js → react-DrjKWElm.js} +1 -1
  85. package/dist/assets/{react-Tzoiwmeg.js → react-DyXk5i5q.js} +1 -1
  86. package/dist/assets/{react-B6jUeEM2.js → react-eGjCUI9Z.js} +1 -1
  87. package/dist/assets/{recharts-RL5R0Iqz.js → recharts-CHATJmXy.js} +1 -1
  88. package/dist/assets/{routePaths-C7N5VwuK.js → routePaths-DyfF54Mg.js} +1 -1
  89. package/dist/assets/{sentry-C0E1AQIe.js → sentry-B2Aew07S.js} +1 -1
  90. package/dist/assets/{url-DASTrDxO.js → url-BOKPP8B2.js} +1 -1
  91. package/dist/assets/{url-B8pn9E20.js → url-BfvldWlU.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BguLij7r.js → useAiCfoDashboardSuggestedQuestionsChips-DiiAXpvy.js} +1 -1
  93. package/dist/assets/{useAskAiCfoHostNavButtonProps-DZ2VqCuW.js → useAskAiCfoHostNavButtonProps-RYFll1PC.js} +1 -1
  94. package/dist/assets/{useCashManagementBanner-Cg-NIFnV.js → useCashManagementBanner-DeSZsTvv.js} +1 -1
  95. package/dist/assets/{useChargeCardPusherEvents-CaVuS_Mc.js → useChargeCardPusherEvents-iVaYEDl9.js} +1 -1
  96. package/dist/assets/{useDeviceId-_WmC04ST.js → useDeviceId-obtSvxuy.js} +1 -1
  97. package/dist/assets/{useEmailConnectResultRefresh-BJvktFhn.js → useEmailConnectResultRefresh-DEaO6bJX.js} +1 -1
  98. package/dist/assets/{useInitialThreadRequest-B13VgkiL.js → useInitialThreadRequest-8loDIspA.js} +1 -1
  99. package/dist/assets/{utils-hcCBORos.js → utils-D8kKiFqT.js} +1 -1
  100. package/dist/assets/{withTransactionSidePanel-Dj5HWFje.js → withTransactionSidePanel-CpddR0Hs.js} +1 -1
  101. package/dist/assets/{zeni-epic-state-ym9j-rvL.js → zeni-epic-state-DcKqCCCg.js} +3 -3
  102. package/dist/index.html +1 -1
  103. package/package.json +1 -1
  104. package/dist/assets/AddressRoutes-RF8G7l2e.js +0 -1
  105. package/dist/assets/CustomerOnboardingAuthScreen-xBcb8Thx.js +0 -1
  106. package/dist/assets/CustomerOnboardingRoutes-B7Fnla-Z.js +0 -30
  107. package/dist/assets/NotFoundScreen-DtHa7L00.js +0 -1
@@ -1 +1 @@
1
- import{j as b}from"./liveblocks-UQZFqaDN.js";import{a as f}from"./sentry-C0E1AQIe.js";import{u as T,j as g,h as _,g as O,i as k,n as F}from"./core-Ctjv24YM.js";import{kW as L,Qs as w,Qc as C,Fs as V,FE as B,Fz as A,FA as E,Qt as j,eV as z,Fy as W}from"./zeni-epic-state-ym9j-rvL.js";import{z as P,m as N,w as Q,bP as K,af as $,bC as G,bQ as H}from"./index-BJyv5Z6x.js";import"./mui-DU4JyJ-_.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="093eeaf0-be1e-4b69-9357-7e6ced0b1549",e._sentryDebugIdIdentifier="sentry-dbid-093eeaf0-be1e-4b69-9357-7e6ced0b1549")}catch{}})();function J(){const e=T(),s=f.useRef(!1),t=g(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=g(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))},[p,t,e])}const M=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=I.concat(R);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(K);function X(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>C(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];S==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1})));const x=y.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=h?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(W(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(H);function ne(){const e=g(t=>z(t)),{isApprovalRulesV3Enabled:s}=G(e?.tenantId);return s?b.jsx(Z,{}):b.jsx(X,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>C(n)),[a,d]=f.useState(!1);if(J(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,J as u};
1
+ import{j as b}from"./liveblocks-DS8sOLD1.js";import{a as f}from"./sentry-B2Aew07S.js";import{u as T,j as g,h as _,g as O,i as k,n as F}from"./core-SRRzy8qJ.js";import{kW as L,Qs as w,Qc as C,Fs as V,FE as B,Fz as A,FA as E,Qt as j,eV as z,Fy as W}from"./zeni-epic-state-DcKqCCCg.js";import{z as P,m as N,w as Q,bP as K,af as $,bC as G,bQ as H}from"./index-BnX1nS7p.js";import"./mui-DQ-jfgFM.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="093eeaf0-be1e-4b69-9357-7e6ced0b1549",e._sentryDebugIdIdentifier="sentry-dbid-093eeaf0-be1e-4b69-9357-7e6ced0b1549")}catch{}})();function J(){const e=T(),s=f.useRef(!1),t=g(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=g(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))},[p,t,e])}const M=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=I.concat(R);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(K);function X(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>C(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];S==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1})));const x=y.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=h?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(W(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(H);function ne(){const e=g(t=>z(t)),{isApprovalRulesV3Enabled:s}=G(e?.tenantId);return s?b.jsx(Z,{}):b.jsx(X,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>C(n)),[a,d]=f.useState(!1);if(J(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,J as u};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-UQZFqaDN.js";import{h as W,u as re,g as Z,i as X,j as E,N as _,n as K,l as mt,o as ct,p as C}from"./core-Ctjv24YM.js";import{eV as H,QH as le,c6 as me,ED as Be,kF as dt,EQ as ne,EP as ae,QI as ut,bn as ce,gm as Te,QJ as pt,N4 as bt,ku as je,N5 as Se,N6 as gt,jp as ht,P_ as ft,jE as St,Er as It,u8 as Rt,jw as yt,Fb as Fe,QK as De,QL as At,QM as kt,QN as vt,QO as Ct,QP as Et,EX as Ie,jK as wt,Q7 as xt,ER as Bt,EB as Tt,QQ as jt,EA as Ft,QR as Dt,EJ as Re,E$ as Ut,E_ as Lt,EW as Pt,QS as Ue,Ka as $t,bq as Mt,EM as _t,Ft as Nt,QT as Qt,QU as Ot,F7 as Gt,F4 as ye,Pt as zt,Ey as Zt,QV as Le,FV as Ae,G1 as Ht,QW as Vt,QX as G,QY as Wt,QZ as Pe,Q_ as Kt,Q$ as $e,R0 as Me,Fj as se,bu as qt,bK as de,cG as ue,fA as _e,fy as Ne,R1 as Jt,fv as Xt,PG as Yt,R2 as en,R3 as Qe,PK as tn,Qs as nn,R4 as an,QG as sn,F_ as ke,FZ as on,R5 as rn,R6 as ln,R7 as mn,R8 as cn,R9 as dn,Qd as un,FQ as pn,FU as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LU as Rn,cQ as yn,cS as An,cR as kn,cz as vn}from"./zeni-epic-state-ym9j-rvL.js";import{$ as Oe,q as Ge,W as Y,U as k,z as $,b$ as ze,x as ee,d as v,aK as ve,o as F,au as J,A as Cn,a as Ze,c0 as En,s as z,Z as He,c1 as wn,I as te,c2 as xn,V as Bn,y as Tn,w as pe,f as Ve,a7 as jn,bn as Fn,a2 as Dn,m as We,c3 as Un,a9 as Ln}from"./index-BJyv5Z6x.js";import{n as N,S as Pn}from"./mui-DU4JyJ-_.js";import ie from"./NotFoundScreen-DtHa7L00.js";import{S as Ce}from"./SetupPagesScreen-CVepw64Y.js";import{F as Ke}from"./FeaturePreviewScreen-BsLL5iCn.js";import{a as f}from"./sentry-C0E1AQIe.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-DZ2VqCuW.js";import{u as qe}from"./useInitialThreadRequest-B13VgkiL.js";import{D as $n}from"./DrawerScreen-Q_os61z4.js";import{M as Je}from"./MobileAppDrawer-DQwHFEP8.js";import{R as Mn}from"./ReimbursementApprovalRoutes-C7YE-LAA.js";import{FallBackRoute as _n}from"./ScreenRoutes-Uy0Kxm7R.js";import"./recharts-RL5R0Iqz.js";import"./analytics-BlxwN6GD.js";import"./plaid-Dtkg2fMC.js";import"./dnd-DdE4ICzz.js";import"./stripe-DMRn4zHo.js";import"./lottie-h9wdJ9gi.js";import"./lexical-z-P2V9ug.js";import"./pdf-BK4Cbxeo.js";import"./utils-hcCBORos.js";import"./analyticsHelper-CrGhWq9e.js";import"./routePaths-C7N5VwuK.js";import"./BusinessVerificationPageScreen-CsuP5vKP.js";import"./ReimbursementApprovalRuleDetailScreen-Q0l5mvWj.js";import"./getLocaleForTenant-DnliJT-u.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="798ec063-10f2-4126-9760-2a08eb0469c9",e._sentryDebugIdIdentifier="sentry-dbid-798ec063-10f2-4126-9760-2a08eb0469c9")}catch{}})();const Xe=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Qn=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Re(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Re(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ft(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(De()),e(At());const i=Xe(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Fe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=W(),t=re(),n=Z(),{reimbursementId:r}=X(),d=Oe(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,j=w.includes("edit"),A=w.includes("reimbursement/new"),[D,x]=f.useState(!1),B=$.getSignedInUser(),I=E(p=>H(p)),g=E(p=>le(p,r)),P=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,y,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(ze,{isNewReimbursement:r==null}):s.jsxs(On,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(Qn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const On=N.div`
1
+ import{j as s}from"./liveblocks-DS8sOLD1.js";import{h as W,u as re,g as Z,i as X,j as E,N as _,n as K,l as mt,o as ct,p as C}from"./core-SRRzy8qJ.js";import{eV as H,QH as le,c6 as me,ED as Be,kF as dt,EQ as ne,EP as ae,QI as ut,bn as ce,gm as Te,QJ as pt,N4 as bt,ku as je,N5 as Se,N6 as gt,jp as ht,P_ as ft,jE as St,Er as It,u8 as Rt,jw as yt,Fb as Fe,QK as De,QL as At,QM as kt,QN as vt,QO as Ct,QP as Et,EX as Ie,jK as wt,Q7 as xt,ER as Bt,EB as Tt,QQ as jt,EA as Ft,QR as Dt,EJ as Re,E$ as Ut,E_ as Lt,EW as Pt,QS as Ue,Ka as $t,bq as Mt,EM as _t,Ft as Nt,QT as Qt,QU as Ot,F7 as Gt,F4 as ye,Pt as zt,Ey as Zt,QV as Le,FV as Ae,G1 as Ht,QW as Vt,QX as G,QY as Wt,QZ as Pe,Q_ as Kt,Q$ as $e,R0 as Me,Fj as se,bu as qt,bK as de,cG as ue,fA as _e,fy as Ne,R1 as Jt,fv as Xt,PG as Yt,R2 as en,R3 as Qe,PK as tn,Qs as nn,R4 as an,QG as sn,F_ as ke,FZ as on,R5 as rn,R6 as ln,R7 as mn,R8 as cn,R9 as dn,Qd as un,FQ as pn,FU as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LU as Rn,cQ as yn,cS as An,cR as kn,cz as vn}from"./zeni-epic-state-DcKqCCCg.js";import{$ as Oe,q as Ge,W as Y,U as k,z as $,b$ as ze,x as ee,d as v,aK as ve,o as F,au as J,A as Cn,a as Ze,c0 as En,s as z,Z as He,c1 as wn,I as te,c2 as xn,V as Bn,y as Tn,w as pe,f as Ve,a7 as jn,bn as Fn,a2 as Dn,m as We,c3 as Un,a9 as Ln}from"./index-BnX1nS7p.js";import{n as N,S as Pn}from"./mui-DQ-jfgFM.js";import ie from"./NotFoundScreen-DRRoMVDk.js";import{S as Ce}from"./SetupPagesScreen-DHP6inkV.js";import{F as Ke}from"./FeaturePreviewScreen-D35UAPet.js";import{a as f}from"./sentry-B2Aew07S.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-RYFll1PC.js";import{u as qe}from"./useInitialThreadRequest-8loDIspA.js";import{D as $n}from"./DrawerScreen-Q_Fkogtz.js";import{M as Je}from"./MobileAppDrawer-DChLZMjE.js";import{R as Mn}from"./ReimbursementApprovalRoutes-AEJXMIeN.js";import{FallBackRoute as _n}from"./ScreenRoutes-DrzMUCeq.js";import"./recharts-CHATJmXy.js";import"./analytics-C-A3qVJh.js";import"./plaid-DWZgMqW3.js";import"./dnd-CR8sMRK3.js";import"./stripe-DMRn4zHo.js";import"./lottie-Coq2aDEW.js";import"./lexical-qJrDnJMV.js";import"./pdf-D2Xq7623.js";import"./utils-D8kKiFqT.js";import"./analyticsHelper-CewoJ3Hu.js";import"./routePaths-DyfF54Mg.js";import"./BusinessVerificationPageScreen-tq2Pq8-k.js";import"./ReimbursementApprovalRuleDetailScreen-Btjx5v4l.js";import"./getLocaleForTenant-DHWNDQcY.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="798ec063-10f2-4126-9760-2a08eb0469c9",e._sentryDebugIdIdentifier="sentry-dbid-798ec063-10f2-4126-9760-2a08eb0469c9")}catch{}})();const Xe=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Qn=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Re(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Re(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ft(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(De()),e(At());const i=Xe(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Fe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=W(),t=re(),n=Z(),{reimbursementId:r}=X(),d=Oe(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,j=w.includes("edit"),A=w.includes("reimbursement/new"),[D,x]=f.useState(!1),B=$.getSignedInUser(),I=E(p=>H(p)),g=E(p=>le(p,r)),P=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,y,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(ze,{isNewReimbursement:r==null}):s.jsxs(On,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(Qn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const On=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-UQZFqaDN.js";import{g as G,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as Y}from"./core-Ctjv24YM.js";import{eV as v,fP as I,Ml as Te,ku as K,qO as W,rD as A,ki as Re,jm as Me,v7 as X,rI as Oe,bs as Ae,Mm as ke,bn as Fe,wg as De,Mn as je,Mo as Ee,u$ as Pe,Mp as H,Mq as ve,Mr as Le,Ms as Be,Mt as Ve,Mu as w,Mv as k,Mw as F,Mx as N,My as D,Mz as j,dI as Ue,vY as xe,vM as q,vN as $,w2 as ze,vR as Z,w8 as Ge,MA as Ye,MB as He,MC as Ne,MD as qe,ME as $e,fA as Ze,fy as Qe}from"./zeni-epic-state-ym9j-rvL.js";import{J as Je,K as Ke,N as We,Q as Xe,q as ea,W as ee,U as E,z as ae,V as aa,I as sa,c as ta,X as oa,Z as na,x as ra,d as P,f as ia,_ as la,s as se,a0 as ca,a1 as da,a2 as pa}from"./index-BJyv5Z6x.js";import"./mui-DU4JyJ-_.js";import fa from"./NotFoundScreen-DtHa7L00.js";import{F as ma}from"./FeaturePreviewScreen-BsLL5iCn.js";import{a as _}from"./sentry-C0E1AQIe.js";import{u as ua}from"./useInitialThreadRequest-B13VgkiL.js";import{t as Q,a as J,b as _a}from"./routePaths-C7N5VwuK.js";import{M as ha}from"./MobileAppDrawer-DQwHFEP8.js";import"./recharts-RL5R0Iqz.js";import"./analytics-BlxwN6GD.js";import"./plaid-Dtkg2fMC.js";import"./dnd-DdE4ICzz.js";import"./stripe-DMRn4zHo.js";import"./lottie-h9wdJ9gi.js";import"./lexical-z-P2V9ug.js";import"./pdf-BK4Cbxeo.js";import"./utils-hcCBORos.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="5013603f-d13b-4bef-a871-0a315317d792",e._sentryDebugIdIdentifier="sentry-dbid-5013603f-d13b-4bef-a871-0a315317d792")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ne()),e(qe()),e($e())},ga=we(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(e),r=ke(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:K(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return J(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?J(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(k({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>K(n)),M=d(n=>W(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),O=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,C,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(X());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Je(he??"")==="reports",be=Ke(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-DS8sOLD1.js";import{g as G,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as Y}from"./core-SRRzy8qJ.js";import{eV as v,fP as I,Ml as Te,ku as K,qO as W,rD as A,ki as Re,jm as Me,v7 as X,rI as Oe,bs as Ae,Mm as ke,bn as Fe,wg as De,Mn as je,Mo as Ee,u$ as Pe,Mp as H,Mq as ve,Mr as Le,Ms as Be,Mt as Ve,Mu as w,Mv as k,Mw as F,Mx as N,My as D,Mz as j,dI as Ue,vY as xe,vM as q,vN as $,w2 as ze,vR as Z,w8 as Ge,MA as Ye,MB as He,MC as Ne,MD as qe,ME as $e,fA as Ze,fy as Qe}from"./zeni-epic-state-DcKqCCCg.js";import{J as Je,K as Ke,N as We,Q as Xe,q as ea,W as ee,U as E,z as ae,V as aa,I as sa,c as ta,X as oa,Z as na,x as ra,d as P,f as ia,_ as la,s as se,a0 as ca,a1 as da,a2 as pa}from"./index-BnX1nS7p.js";import"./mui-DQ-jfgFM.js";import fa from"./NotFoundScreen-DRRoMVDk.js";import{F as ma}from"./FeaturePreviewScreen-D35UAPet.js";import{a as _}from"./sentry-B2Aew07S.js";import{u as ua}from"./useInitialThreadRequest-8loDIspA.js";import{t as Q,a as J,b as _a}from"./routePaths-DyfF54Mg.js";import{M as ha}from"./MobileAppDrawer-DChLZMjE.js";import"./recharts-CHATJmXy.js";import"./analytics-C-A3qVJh.js";import"./plaid-DWZgMqW3.js";import"./dnd-CR8sMRK3.js";import"./stripe-DMRn4zHo.js";import"./lottie-Coq2aDEW.js";import"./lexical-qJrDnJMV.js";import"./pdf-D2Xq7623.js";import"./utils-D8kKiFqT.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="5013603f-d13b-4bef-a871-0a315317d792",e._sentryDebugIdIdentifier="sentry-dbid-5013603f-d13b-4bef-a871-0a315317d792")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ne()),e(qe()),e($e())},ga=we(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(e),r=ke(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:K(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return J(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?J(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(k({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>K(n)),M=d(n=>W(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),O=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,C,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(X());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Je(he??"")==="reports",be=Ke(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-UQZFqaDN.js";import{W as j,z as w,aQ as y,x as I,d as p,f as F,d6 as T,U as P}from"./index-BJyv5Z6x.js";import"./mui-DU4JyJ-_.js";import m from"./NotFoundScreen-DtHa7L00.js";import{a as d}from"./sentry-C0E1AQIe.js";import{u as L,j as x,h as V,g as A,n as U,o as R,p as f}from"./core-Ctjv24YM.js";import{eV as z,TA as C,PT as B,TB as v,vD as G,fG as Y,TC as O,vB as Q}from"./zeni-epic-state-ym9j-rvL.js";import{R as b}from"./ReferralListScreen-CXbObkR0.js";import"./recharts-RL5R0Iqz.js";import"./analytics-BlxwN6GD.js";import"./plaid-Dtkg2fMC.js";import"./dnd-DdE4ICzz.js";import"./stripe-DMRn4zHo.js";import"./lottie-h9wdJ9gi.js";import"./lexical-z-P2V9ug.js";import"./pdf-BK4Cbxeo.js";import"./utils-hcCBORos.js";import"./useAskAiCfoHostNavButtonProps-DZ2VqCuW.js";import"./MobileAppDrawer-DQwHFEP8.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4c74d74d-0d18-4951-9a6f-1e1613f4d2b9",e._sentryDebugIdIdentifier="sentry-dbid-4c74d74d-0d18-4951-9a6f-1e1613f4d2b9")}catch{}})();const W=U(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(Q())},onUpdateInviteFormLocalData:s=>{e(O({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(T),q=()=>{const e=L(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=x(o=>z(o)),c=V(),D=A(),{useDynamicConfig:g}=j(),u=w.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=x(o=>C(o)),_=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:k}=g(y.zeniAccountsConfig),N=B(k);d.useEffect(()=>{e(v()),r?.rewardsLastViewedTime==null&&i===!1&&(e(G()),s(!0))},[]),d.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(Y(!0)))},[l.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(W,{navigate:c,location:D,currentTenant:r,companyName:S,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(P.isReferralFeatureEnabled);return a.jsxs(R,{children:[a.jsx(f,{path:"/",element:t?a.jsx(b,{}):a.jsx(m,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(b,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(q,{}):a.jsx(m,{})}),a.jsx(f,{path:"*",element:a.jsx(m,{})})]})}export{fe as default};
1
+ import{j as a}from"./liveblocks-DS8sOLD1.js";import{W as j,z as w,aQ as y,x as I,d as p,f as F,d6 as T,U as P}from"./index-BnX1nS7p.js";import"./mui-DQ-jfgFM.js";import m from"./NotFoundScreen-DRRoMVDk.js";import{a as d}from"./sentry-B2Aew07S.js";import{u as L,j as x,h as V,g as A,n as U,o as R,p as f}from"./core-SRRzy8qJ.js";import{eV as z,TA as C,PT as B,TB as v,vD as G,fG as Y,TC as O,vB as Q}from"./zeni-epic-state-DcKqCCCg.js";import{R as b}from"./ReferralListScreen-DoZyTHjO.js";import"./recharts-CHATJmXy.js";import"./analytics-C-A3qVJh.js";import"./plaid-DWZgMqW3.js";import"./dnd-CR8sMRK3.js";import"./stripe-DMRn4zHo.js";import"./lottie-Coq2aDEW.js";import"./lexical-qJrDnJMV.js";import"./pdf-D2Xq7623.js";import"./utils-D8kKiFqT.js";import"./useAskAiCfoHostNavButtonProps-RYFll1PC.js";import"./MobileAppDrawer-DChLZMjE.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4c74d74d-0d18-4951-9a6f-1e1613f4d2b9",e._sentryDebugIdIdentifier="sentry-dbid-4c74d74d-0d18-4951-9a6f-1e1613f4d2b9")}catch{}})();const W=U(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(Q())},onUpdateInviteFormLocalData:s=>{e(O({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(T),q=()=>{const e=L(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=x(o=>z(o)),c=V(),D=A(),{useDynamicConfig:g}=j(),u=w.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=x(o=>C(o)),_=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:k}=g(y.zeniAccountsConfig),N=B(k);d.useEffect(()=>{e(v()),r?.rewardsLastViewedTime==null&&i===!1&&(e(G()),s(!0))},[]),d.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(Y(!0)))},[l.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(W,{navigate:c,location:D,currentTenant:r,companyName:S,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(P.isReferralFeatureEnabled);return a.jsxs(R,{children:[a.jsx(f,{path:"/",element:t?a.jsx(b,{}):a.jsx(m,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(b,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(q,{}):a.jsx(m,{})}),a.jsx(f,{path:"*",element:a.jsx(m,{})})]})}export{fe as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-CF_VnugU.js","assets/sentry-C0E1AQIe.js","assets/core-Ctjv24YM.js","assets/zeni-epic-state-ym9j-rvL.js","assets/index-BJyv5Z6x.js","assets/mui-DU4JyJ-_.js","assets/analytics-BlxwN6GD.js","assets/utils-hcCBORos.js","assets/withTransactionSidePanel-Dj5HWFje.js","assets/useAskAiCfoHostNavButtonProps-DZ2VqCuW.js","assets/TransactionDetailScreen-BLBk60iy.js","assets/decodeURIComponentSafe-Z8As9uQN.js","assets/routePaths-C7N5VwuK.js","assets/NotFoundScreen-DtHa7L00.js","assets/useInitialThreadRequest-B13VgkiL.js","assets/analyticsHelper-CrGhWq9e.js","assets/CompanyPassportScreen-MkVkCyf-.js","assets/MobileAppDrawer-DQwHFEP8.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BguLij7r.js","assets/FeaturePreviewScreen-BsLL5iCn.js","assets/ReferralListScreen-CXbObkR0.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-CxBU4_Qt.js","assets/AddressScreen-FgxQZ6Pn.js","assets/DomesticWireDetailScreen-DJG5dj2b.js","assets/DrawerScreen-Q_os61z4.js","assets/SetupPagesScreen-CVepw64Y.js","assets/BusinessVerificationPageScreen-CsuP5vKP.js","assets/BillPayApprovalRoutes-DxR0TAud.js","assets/ReimbursementApprovalRuleDetailScreen-Q0l5mvWj.js","assets/getLocaleForTenant-DnliJT-u.js","assets/ReimbursementRoutes-DcDcmnq5.js","assets/ReimbursementApprovalRoutes-C7YE-LAA.js","assets/TransactionListRoutes-CU2IvbfK.js","assets/ZeniAccountStatementScreen-DnZ2Bj4h.js","assets/SettingsRoutes-DVfn4HMx.js","assets/accountMappingHelper-BBILjeHz.js","assets/QBOConnectionScreen-BmcSCHav.js","assets/empty-BgBFHjf_.js","assets/index-DrylXWCT.js","assets/url-DASTrDxO.js","assets/index-B6LHkFfA.js","assets/useEmailConnectResultRefresh-BJvktFhn.js","assets/ReportsRoutes-BMAOx8yk.js","assets/ChargeCardRoutes-DV0rSLTc.js","assets/useChargeCardPusherEvents-CaVuS_Mc.js","assets/PeopleRoutes-BBk6x3GN.js","assets/ExpenseAutomationRoutes-BAGScNm2.js","assets/TreasuryRoutes-nOHCoa6D.js","assets/useCashManagementBanner-Cg-NIFnV.js","assets/VendorsRoutes-Bms7VhV2.js","assets/pathToGoBack-dHZq4iEC.js","assets/ZeniAccountRoutes-rCwoYBVh.js","assets/AddressRoutes-RF8G7l2e.js","assets/PandLWithForecastRoutes-ClN_7czZ.js","assets/CustomerOnboardingRoutes-B7Fnla-Z.js","assets/TransactionDetailRoutes-B7hwRUTE.js","assets/EntityDetailRoutes-DWaZ2x0h.js","assets/NotificationRoutes-BLkbRobx.js","assets/PerformanceRoutes-BpOIoQ_l.js","assets/RewardsRoutes-Cz7znVbs.js","assets/TaskRoutes-0COd9gMj.js","assets/TaskListScreen-BYXHdSHM.js","assets/AiCfoScreen-CZfRGF0l.js","assets/CardsAiCfoScreen-BJGdQu7N.js"])))=>i.map(i=>d[i]);
2
- import{_ as a,bn as is,eV as rs,fA as os,fy as ls,fz as cs,gh as ds,fn as ms,cT as ge,cA as us,fQ as _s,cs as ps,bE as As,bo as Es,fV as gs,v as xs,LT as Is,bs as Ts,LU as js,bK as hs,fS as Us,bJ as Rs,bt as Hs,co as bs,LV as Ds,LW as ys,cQ as fs,cS as Cs,cR as vs,cz as Os,cG as Ps,o6 as xe,fw as Ie,gr as Fs,fZ as Te,go as je,gp as he,f_ as Ls}from"./zeni-epic-state-ym9j-rvL.js";import{j as e}from"./liveblocks-UQZFqaDN.js";import{a as v}from"./sentry-C0E1AQIe.js";import{u as ks,h as Bs,i as Vs,g as Ss,j as G,l as Ue,N as c,o as Ns,p as t}from"./core-Ctjv24YM.js";import{m as Zs,u as Ms,z as H,W as ws,c as zs,B as Gs,U as B,I as $s,L as F,a as Re,t as _,P as Ws,d as ee,l}from"./index-BJyv5Z6x.js";import"./mui-DU4JyJ-_.js";import{f as He}from"./analyticsHelper-CrGhWq9e.js";import{t as Ys}from"./getLocaleForTenant-DnliJT-u.js";import"./recharts-RL5R0Iqz.js";import"./analytics-BlxwN6GD.js";import"./plaid-Dtkg2fMC.js";import"./dnd-DdE4ICzz.js";import"./stripe-DMRn4zHo.js";import"./lottie-h9wdJ9gi.js";import"./lexical-z-P2V9ug.js";import"./pdf-BK4Cbxeo.js";import"./utils-hcCBORos.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="b63071a4-518e-4f12-a778-958f9b4c94c0",i._sentryDebugIdIdentifier="sentry-dbid-b63071a4-518e-4f12-a778-958f9b4c94c0")}catch{}})();const qs={dashboard:()=>a(()=>import("./DashboardRoutes-CF_VnugU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>a(()=>import("./BillPayRoutes-CxBU4_Qt.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>a(()=>import("./ReimbursementRoutes-DcDcmnq5.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>a(()=>import("./TransactionListRoutes-CU2IvbfK.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>a(()=>import("./SettingsRoutes-DVfn4HMx.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,42,28,29,32,21])),reports:()=>a(()=>import("./ReportsRoutes-BMAOx8yk.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-DV0rSLTc.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>a(()=>import("./PeopleRoutes-BBk6x3GN.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-BAGScNm2.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>a(()=>import("./TreasuryRoutes-nOHCoa6D.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>a(()=>import("./VendorsRoutes-Bms7VhV2.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-rCwoYBVh.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],se=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Js=l(()=>a(()=>import("./ReportsRoutes-BMAOx8yk.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Ks=l(()=>a(()=>import("./AddressRoutes-RF8G7l2e.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Xs=l(()=>a(()=>import("./PeopleRoutes-BBk6x3GN.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),ea=l(()=>a(()=>import("./PandLWithForecastRoutes-ClN_7czZ.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),sa=l(()=>a(()=>import("./CustomerOnboardingRoutes-B7Fnla-Z.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,42,45,21]))),aa=l(()=>a(()=>import("./VendorsRoutes-Bms7VhV2.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),na=l(()=>a(()=>import("./TransactionDetailRoutes-B7hwRUTE.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),be=l(()=>a(()=>import("./EntityDetailRoutes-DWaZ2x0h.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),ta=l(()=>a(()=>import("./DashboardRoutes-CF_VnugU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),De=l(()=>a(()=>import("./BillPayRoutes-CxBU4_Qt.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),ia=l(()=>a(()=>import("./SettingsRoutes-DVfn4HMx.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,42,28,29,32,21]))),ye=l(()=>a(()=>import("./ReimbursementRoutes-DcDcmnq5.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),ra=l(()=>a(()=>import("./ZeniAccountRoutes-rCwoYBVh.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),oa=l(()=>a(()=>import("./TreasuryRoutes-nOHCoa6D.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),la=l(()=>a(()=>import("./TransactionListRoutes-CU2IvbfK.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ca=l(()=>a(()=>import("./ChargeCardRoutes-DV0rSLTc.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),da=l(()=>a(()=>import("./NotificationRoutes-BLkbRobx.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),ma=l(()=>a(()=>import("./PerformanceRoutes-BpOIoQ_l.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),ua=l(()=>a(()=>import("./ExpenseAutomationRoutes-BAGScNm2.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_a=l(()=>a(()=>import("./RewardsRoutes-Cz7znVbs.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),pa=l(()=>a(()=>import("./TaskRoutes-0COd9gMj.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),Aa=l(()=>a(()=>import("./AiCfoScreen-CZfRGF0l.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),fe=l(()=>a(()=>import("./CardsAiCfoScreen-BJGdQu7N.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),D=l(()=>a(()=>import("./NotFoundScreen-DtHa7L00.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),Ea=l(()=>a(()=>import("./TaskListScreen-BYXHdSHM.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Na({setTenantEmailDomain:i}){const U=ks(),V=Bs(),{tenantEmailDomain:o}=Vs(),S=Zs().mode,{setLoading:f,clearAllLoading:O,clearLoading:M}=Ms(),y=H.getSignedInUserTenant(o)?.tenantId,j=H.getSignedInUser(),ae=is(j),$=Ss(),[N,ve]=v.useState(!1),r=G(n=>rs(n)),{useFeatureGate:L}=ws(),w=zs(),ne=Gs(),{isFeatureEnabled:Oe}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Fe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),h=G(n=>n.tenantState.fetchState),A=G(n=>n.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||h==="Completed"?os(te,r):void 0,W=A==="Completed"||h==="Completed"?ls(r):void 0,Le=A==="Completed"||h==="Completed"?cs(r):void 0,ke=Fe||te||!!Le||!!W||!!u,{isFeatureEnabled:Be}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:J}=L(B.isAiCfoFileUploadEnabled),Y=G(n=>ds(n));if(o!=null){const n=H.getSignedInUserTenant(o);j!=null&&n!=null&&He(j,r,S)}const z={tenantId:y,userId:j?.userId,sessionId:j?.zeniSessionId},ie=ms(),p=$s(),Ve=r.company==null||p?.loggedInUserRoleMap!=null&&ge(p.loggedInUserRole),Se=us(p?.loggedInUserRoleMap),re=v.useRef(!0),oe=Ue("/:tenantEmailDomain/onboarding/*")!==null,K=Ue("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ne=G(n=>z.tenantId!=null?_s(n,z.tenantId):void 0);v.useEffect(()=>{f(F.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(K!=null&&y!=null){const n=K.params.selectedPeriod;if(n!=null){const R=n.split("-");if(R.length===2){const d=ps(Number(R[0])),s=Number(R[1]),m=As(`01-${d<10?`0${d}`:d}-${s}`,Re.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),Z=Es();m.isAfter(Z,"month")===!1?U(gs(y,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[K,y]),v.useEffect(()=>{N||(ve(!0),f(F.TENANT_FETCHING)),re.current?re.current=!1:!xs(ie,z)&&H.isSignedIn()&&(f(F.TENANT_FETCHING),function(n,R,d,s){if(Ie(R?.userId,R?.zeniSessionId,n.tenantId),d(Fs(!0)),d(Te(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=H.getSignedInUserTenantWithId(n.tenantId);s&&Re.updateAppLocaleID(Ys(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?ee.identify(n.userId,{tenant_id:n.tenantId}):ee.resetUserIdentity()}(z,j,U,Ne))},[z,ie,j,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(F.TENANT_FETCHING),function(n,R,d,s,m,Z,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,as=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(q&&as){k(Te(s));const Q=H.getSignedInUserTenantWithId(s);Q?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(Q?.tenantEmailDomain),Ie(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)))}else q&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),q&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)));if(q){ee.identify(m.userId,{tenant_id:s});const Q=s==null||s!=null&&(R==="Completed"||R==="Error");n==="Completed"||R!=="Not-Started"&&R!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),Z(F.TENANT_FETCHING),k(Ls(m.userId,s,m.zeniSessionId))),Q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(xe(m.userId,m.zeniSessionId)))}}(h,A,r,y,j,f,U))},[y,A]),v.useEffect(()=>{H.isSignedIn()&&h==="Completed"&&Y.tenantsBaseInOrder.length>0&&(M(F.TENANT_FETCHING),H.saveSignedInUserTenants(Is(Y.tenantsBaseInOrder)),j!=null&&He(j,r,S,void 0,Y.tenantsBaseInOrder))},[Y,h,r,j]),v.useEffect(()=>{A==="In-Progress"&&f(F.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&y!=null?(O(),_.markActiveTenantFetchCompleted(y)):A==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),M(F.TENANT_FETCHING),M(F.TENANT_SWITCHING))),h!=="Completed"&&h!=="Error"||(h==="Completed"?_.markAllTenantsFetchCompleted():h==="Error"&&_.markAllTenantsFetchFailed())},[A,h,y,N]);const le=v.useRef(!1);v.useEffect(()=>{!le.current&&A==="Completed"&&N&&(le.current=!0,function(n=Qs,R=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],Z=qs[m];Z!=null?Z().then(()=>se(()=>d(s+1))).catch(()=>se(()=>d(s+1))):d(s+1)};se(()=>d(0))},R)}())},[A,N]);const C=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Ze}=L(B.isReferralFeatureEnabled),Me=r?.userRole!=null&&r.userRole.includes("charge_card_user"),we=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&ge(r.userRole),ce=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,de=ke&&!C,ze=js(p?.loggedInUserRoleMap),Ge=r.externalConnections?.accounting[0]?.isValid,me=r.company?.companyOnboardingInfo.isOnboardingCompleted,ue=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,_e=ue&&hs(p?.loggedInUserRoleMap),pe=Oe&&!C,$e=r.company!=null&&Us(r.company),We=Pe&&$e===!0&&!C,Ye=ce&&Rs(p?.loggedInUserRoleMap),qe=de&&Hs(p?.loggedInUserRoleMap),Qe=pe&&bs(p?.loggedInUserRoleMap),Je=Ds(p?.loggedInUserRoleMap),Ke=ys(p?.loggedInUserRoleMap),E=fs(p?.loggedInUserRoleMap),g=Cs(p?.loggedInUserRoleMap),x=vs(p?.loggedInUserRoleMap),I=Os(p?.loggedInUserRoleMap),T=Ps(p?.loggedInUserRoleMap),Ae=ce&&I,Ee=ue&&T,Xe=pe&&E,es=We&&g,X=de&&x,ss=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Se===!0||ze===!0||Je===!0||Ke===!0;return H.isSignedIn()?y==null?h==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&h!=="In-Progress"&&U(xe(j.userId,j.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||h==="Completed"?(me===!0||ae&&!oe)&&Ge===!1&&u===!1&&W===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||me!==!1||oe||ae?N&&r?.userRole&&u!=null&&W!=null&&o!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(ga,{isDashboardAccess:P,isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,isTenantCardsOnly:W})}),e.jsx(t,{path:"dashboard/*",element:P?e.jsx(ta,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:P?e.jsx(Js,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ss||P?e.jsx(Xs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:P?e.jsx(ea,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(sa,{})}),e.jsx(t,{path:"transaction/*",element:P&&C===!1||Me||we?e.jsx(na,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:P&&C===!1?e.jsx(la,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:P&&C===!1?e.jsx(be,{entityType:"customer"}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:P&&C===!1?e.jsx(be,{entityType:"vendor"}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(Ea,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(pa,{})}),e.jsx(t,{path:"address/*",element:Ye||_e||Qe||qe?e.jsx(Ks,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:Xe?e.jsx(ra,{}):e.jsx(D,{})}),e.jsx(t,{path:"treasury/*",element:es?e.jsx(oa,{}):e.jsx(D,{})}),e.jsx(t,{path:"performance",element:ne===!0?e.jsx(ma,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ne===!0&&C===!1?e.jsx(ua,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(da,{})}),e.jsx(t,{path:"vendors/*",element:Ve?e.jsx(aa,{}):e.jsx(D,{})}),e.jsx(t,{path:"bill/*",element:Ae?e.jsx(De,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:Ae?e.jsx(De,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:Ee?e.jsx(ye,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:Ee?e.jsx(ye,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Be?e.jsx(ia,{hasAdminLevelAccess:_e}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask",element:X&&w?e.jsx(fe,{isFileUploadEnabled:J}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:X&&w?e.jsx(fe,{isFileUploadEnabled:J}):e.jsx(D,{})}),e.jsx(t,{path:"cards/*",element:X?e.jsx(ca,{}):e.jsx(D,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(_a,{}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:w?e.jsx(Aa,{isFileUploadEnabled:J}):e.jsx(D,{})}),e.jsx(t,{path:"*",element:e.jsx(D,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const ga=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:M})=>O===!0&&U?e.jsx(c,{to:"checking"}):M===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),b=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(ja,{tenantEmailDomain:O}):S?e.jsx(Ta,{tenantEmailDomain:O}):U?e.jsx(ha,{tenantEmailDomain:O}):V?e.jsx(Ia,{tenantEmailDomain:O}):o?e.jsx(xa,{tenantEmailDomain:O}):e.jsx(D,{}),xa=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),Ia=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Ta=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Ce=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{b as FallBackRoute,Na as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-BpHU2Qkf.js","assets/sentry-B2Aew07S.js","assets/core-SRRzy8qJ.js","assets/zeni-epic-state-DcKqCCCg.js","assets/index-BnX1nS7p.js","assets/mui-DQ-jfgFM.js","assets/analytics-C-A3qVJh.js","assets/utils-D8kKiFqT.js","assets/withTransactionSidePanel-CpddR0Hs.js","assets/useAskAiCfoHostNavButtonProps-RYFll1PC.js","assets/TransactionDetailScreen-BbsGsqi_.js","assets/decodeURIComponentSafe-Bz-26BXW.js","assets/routePaths-DyfF54Mg.js","assets/NotFoundScreen-DRRoMVDk.js","assets/useInitialThreadRequest-8loDIspA.js","assets/analyticsHelper-CewoJ3Hu.js","assets/CompanyPassportScreen-CdbgEPbH.js","assets/MobileAppDrawer-DChLZMjE.js","assets/useAiCfoDashboardSuggestedQuestionsChips-DiiAXpvy.js","assets/FeaturePreviewScreen-D35UAPet.js","assets/ReferralListScreen-DoZyTHjO.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-BM10Ap-2.js","assets/AddressScreen-DmitYkw7.js","assets/DomesticWireDetailScreen-Bg4mE0II.js","assets/DrawerScreen-Q_Fkogtz.js","assets/SetupPagesScreen-DHP6inkV.js","assets/BusinessVerificationPageScreen-tq2Pq8-k.js","assets/BillPayApprovalRoutes-BzW0b3Z-.js","assets/ReimbursementApprovalRuleDetailScreen-Btjx5v4l.js","assets/getLocaleForTenant-DHWNDQcY.js","assets/ReimbursementRoutes-CLjD-rz3.js","assets/ReimbursementApprovalRoutes-AEJXMIeN.js","assets/TransactionListRoutes-Co9duxwX.js","assets/ZeniAccountStatementScreen-DbJvbotJ.js","assets/SettingsRoutes-CwZJeFhH.js","assets/accountMappingHelper-BPz1owqi.js","assets/QBOConnectionScreen-Dxk5EKMF.js","assets/empty-Btqk4ZK3.js","assets/index-DiKyQs4W.js","assets/url-BOKPP8B2.js","assets/index-6PBzTIZ2.js","assets/useEmailConnectResultRefresh-DEaO6bJX.js","assets/ReportsRoutes-DIvKwgKT.js","assets/ChargeCardRoutes-BKpbGgWX.js","assets/useChargeCardPusherEvents-iVaYEDl9.js","assets/PeopleRoutes-DM0B31yg.js","assets/ExpenseAutomationRoutes-CGrxhlUE.js","assets/TreasuryRoutes-B_Dv4GZ7.js","assets/useCashManagementBanner-DeSZsTvv.js","assets/VendorsRoutes-puD2Dgk7.js","assets/pathToGoBack-BmSmVqnZ.js","assets/ZeniAccountRoutes-CbulRVVe.js","assets/AddressRoutes-DYu6X0mE.js","assets/PandLWithForecastRoutes-DtN54cOv.js","assets/CustomerOnboardingRoutes-DC4e3Ogu.js","assets/TransactionDetailRoutes-DWs1Egcj.js","assets/EntityDetailRoutes-FVCOQ4xF.js","assets/NotificationRoutes-DC-UVqrq.js","assets/PerformanceRoutes-yT4nKfMt.js","assets/RewardsRoutes-B_SjWYxl.js","assets/TaskRoutes-CNamnrYQ.js","assets/TaskListScreen-BDTDGrzi.js","assets/AiCfoScreen-It5Iqwvu.js","assets/CardsAiCfoScreen-DWCPoMx2.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a,bn as is,eV as rs,fA as os,fy as ls,fz as cs,gh as ds,fn as ms,cT as ge,cA as us,fQ as _s,cs as ps,bE as As,bo as Es,fV as gs,v as xs,LT as Is,bs as Ts,LU as js,bK as hs,fS as Us,bJ as Rs,bt as Hs,co as bs,LV as Ds,LW as ys,cQ as fs,cS as Cs,cR as vs,cz as Os,cG as Ps,o6 as xe,fw as Ie,gr as Fs,fZ as Te,go as je,gp as he,f_ as Ls}from"./zeni-epic-state-DcKqCCCg.js";import{j as e}from"./liveblocks-DS8sOLD1.js";import{a as v}from"./sentry-B2Aew07S.js";import{u as ks,h as Bs,i as Vs,g as Ss,j as G,l as Ue,N as c,o as Ns,p as t}from"./core-SRRzy8qJ.js";import{m as Zs,u as Ms,z as H,W as ws,c as zs,B as Gs,U as B,I as $s,L as F,a as Re,t as _,P as Ws,d as ee,l}from"./index-BnX1nS7p.js";import"./mui-DQ-jfgFM.js";import{f as He}from"./analyticsHelper-CewoJ3Hu.js";import{t as Ys}from"./getLocaleForTenant-DHWNDQcY.js";import"./recharts-CHATJmXy.js";import"./analytics-C-A3qVJh.js";import"./plaid-DWZgMqW3.js";import"./dnd-CR8sMRK3.js";import"./stripe-DMRn4zHo.js";import"./lottie-Coq2aDEW.js";import"./lexical-qJrDnJMV.js";import"./pdf-D2Xq7623.js";import"./utils-D8kKiFqT.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="b63071a4-518e-4f12-a778-958f9b4c94c0",i._sentryDebugIdIdentifier="sentry-dbid-b63071a4-518e-4f12-a778-958f9b4c94c0")}catch{}})();const qs={dashboard:()=>a(()=>import("./DashboardRoutes-BpHU2Qkf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>a(()=>import("./BillPayRoutes-BM10Ap-2.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>a(()=>import("./ReimbursementRoutes-CLjD-rz3.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>a(()=>import("./TransactionListRoutes-Co9duxwX.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>a(()=>import("./SettingsRoutes-CwZJeFhH.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,42,28,29,32,21])),reports:()=>a(()=>import("./ReportsRoutes-DIvKwgKT.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-BKpbGgWX.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>a(()=>import("./PeopleRoutes-DM0B31yg.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-CGrxhlUE.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>a(()=>import("./TreasuryRoutes-B_Dv4GZ7.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>a(()=>import("./VendorsRoutes-puD2Dgk7.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-CbulRVVe.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],se=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Js=l(()=>a(()=>import("./ReportsRoutes-DIvKwgKT.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Ks=l(()=>a(()=>import("./AddressRoutes-DYu6X0mE.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Xs=l(()=>a(()=>import("./PeopleRoutes-DM0B31yg.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),ea=l(()=>a(()=>import("./PandLWithForecastRoutes-DtN54cOv.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),sa=l(()=>a(()=>import("./CustomerOnboardingRoutes-DC4e3Ogu.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,42,45,21]))),aa=l(()=>a(()=>import("./VendorsRoutes-puD2Dgk7.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),na=l(()=>a(()=>import("./TransactionDetailRoutes-DWs1Egcj.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),be=l(()=>a(()=>import("./EntityDetailRoutes-FVCOQ4xF.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),ta=l(()=>a(()=>import("./DashboardRoutes-BpHU2Qkf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),De=l(()=>a(()=>import("./BillPayRoutes-BM10Ap-2.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),ia=l(()=>a(()=>import("./SettingsRoutes-CwZJeFhH.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,42,28,29,32,21]))),ye=l(()=>a(()=>import("./ReimbursementRoutes-CLjD-rz3.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),ra=l(()=>a(()=>import("./ZeniAccountRoutes-CbulRVVe.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),oa=l(()=>a(()=>import("./TreasuryRoutes-B_Dv4GZ7.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),la=l(()=>a(()=>import("./TransactionListRoutes-Co9duxwX.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ca=l(()=>a(()=>import("./ChargeCardRoutes-BKpbGgWX.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),da=l(()=>a(()=>import("./NotificationRoutes-DC-UVqrq.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),ma=l(()=>a(()=>import("./PerformanceRoutes-yT4nKfMt.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),ua=l(()=>a(()=>import("./ExpenseAutomationRoutes-CGrxhlUE.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_a=l(()=>a(()=>import("./RewardsRoutes-B_SjWYxl.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),pa=l(()=>a(()=>import("./TaskRoutes-CNamnrYQ.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),Aa=l(()=>a(()=>import("./AiCfoScreen-It5Iqwvu.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),fe=l(()=>a(()=>import("./CardsAiCfoScreen-DWCPoMx2.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),D=l(()=>a(()=>import("./NotFoundScreen-DRRoMVDk.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),Ea=l(()=>a(()=>import("./TaskListScreen-BDTDGrzi.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Na({setTenantEmailDomain:i}){const U=ks(),V=Bs(),{tenantEmailDomain:o}=Vs(),S=Zs().mode,{setLoading:f,clearAllLoading:O,clearLoading:M}=Ms(),y=H.getSignedInUserTenant(o)?.tenantId,j=H.getSignedInUser(),ae=is(j),$=Ss(),[N,ve]=v.useState(!1),r=G(n=>rs(n)),{useFeatureGate:L}=ws(),w=zs(),ne=Gs(),{isFeatureEnabled:Oe}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Fe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),h=G(n=>n.tenantState.fetchState),A=G(n=>n.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||h==="Completed"?os(te,r):void 0,W=A==="Completed"||h==="Completed"?ls(r):void 0,Le=A==="Completed"||h==="Completed"?cs(r):void 0,ke=Fe||te||!!Le||!!W||!!u,{isFeatureEnabled:Be}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:J}=L(B.isAiCfoFileUploadEnabled),Y=G(n=>ds(n));if(o!=null){const n=H.getSignedInUserTenant(o);j!=null&&n!=null&&He(j,r,S)}const z={tenantId:y,userId:j?.userId,sessionId:j?.zeniSessionId},ie=ms(),p=$s(),Ve=r.company==null||p?.loggedInUserRoleMap!=null&&ge(p.loggedInUserRole),Se=us(p?.loggedInUserRoleMap),re=v.useRef(!0),oe=Ue("/:tenantEmailDomain/onboarding/*")!==null,K=Ue("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ne=G(n=>z.tenantId!=null?_s(n,z.tenantId):void 0);v.useEffect(()=>{f(F.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(K!=null&&y!=null){const n=K.params.selectedPeriod;if(n!=null){const R=n.split("-");if(R.length===2){const d=ps(Number(R[0])),s=Number(R[1]),m=As(`01-${d<10?`0${d}`:d}-${s}`,Re.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),Z=Es();m.isAfter(Z,"month")===!1?U(gs(y,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[K,y]),v.useEffect(()=>{N||(ve(!0),f(F.TENANT_FETCHING)),re.current?re.current=!1:!xs(ie,z)&&H.isSignedIn()&&(f(F.TENANT_FETCHING),function(n,R,d,s){if(Ie(R?.userId,R?.zeniSessionId,n.tenantId),d(Fs(!0)),d(Te(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=H.getSignedInUserTenantWithId(n.tenantId);s&&Re.updateAppLocaleID(Ys(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?ee.identify(n.userId,{tenant_id:n.tenantId}):ee.resetUserIdentity()}(z,j,U,Ne))},[z,ie,j,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(F.TENANT_FETCHING),function(n,R,d,s,m,Z,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,as=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(q&&as){k(Te(s));const Q=H.getSignedInUserTenantWithId(s);Q?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(Q?.tenantEmailDomain),Ie(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)))}else q&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),q&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)));if(q){ee.identify(m.userId,{tenant_id:s});const Q=s==null||s!=null&&(R==="Completed"||R==="Error");n==="Completed"||R!=="Not-Started"&&R!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),Z(F.TENANT_FETCHING),k(Ls(m.userId,s,m.zeniSessionId))),Q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(xe(m.userId,m.zeniSessionId)))}}(h,A,r,y,j,f,U))},[y,A]),v.useEffect(()=>{H.isSignedIn()&&h==="Completed"&&Y.tenantsBaseInOrder.length>0&&(M(F.TENANT_FETCHING),H.saveSignedInUserTenants(Is(Y.tenantsBaseInOrder)),j!=null&&He(j,r,S,void 0,Y.tenantsBaseInOrder))},[Y,h,r,j]),v.useEffect(()=>{A==="In-Progress"&&f(F.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&y!=null?(O(),_.markActiveTenantFetchCompleted(y)):A==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),M(F.TENANT_FETCHING),M(F.TENANT_SWITCHING))),h!=="Completed"&&h!=="Error"||(h==="Completed"?_.markAllTenantsFetchCompleted():h==="Error"&&_.markAllTenantsFetchFailed())},[A,h,y,N]);const le=v.useRef(!1);v.useEffect(()=>{!le.current&&A==="Completed"&&N&&(le.current=!0,function(n=Qs,R=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],Z=qs[m];Z!=null?Z().then(()=>se(()=>d(s+1))).catch(()=>se(()=>d(s+1))):d(s+1)};se(()=>d(0))},R)}())},[A,N]);const C=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Ze}=L(B.isReferralFeatureEnabled),Me=r?.userRole!=null&&r.userRole.includes("charge_card_user"),we=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&ge(r.userRole),ce=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,de=ke&&!C,ze=js(p?.loggedInUserRoleMap),Ge=r.externalConnections?.accounting[0]?.isValid,me=r.company?.companyOnboardingInfo.isOnboardingCompleted,ue=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,_e=ue&&hs(p?.loggedInUserRoleMap),pe=Oe&&!C,$e=r.company!=null&&Us(r.company),We=Pe&&$e===!0&&!C,Ye=ce&&Rs(p?.loggedInUserRoleMap),qe=de&&Hs(p?.loggedInUserRoleMap),Qe=pe&&bs(p?.loggedInUserRoleMap),Je=Ds(p?.loggedInUserRoleMap),Ke=ys(p?.loggedInUserRoleMap),E=fs(p?.loggedInUserRoleMap),g=Cs(p?.loggedInUserRoleMap),x=vs(p?.loggedInUserRoleMap),I=Os(p?.loggedInUserRoleMap),T=Ps(p?.loggedInUserRoleMap),Ae=ce&&I,Ee=ue&&T,Xe=pe&&E,es=We&&g,X=de&&x,ss=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Se===!0||ze===!0||Je===!0||Ke===!0;return H.isSignedIn()?y==null?h==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&h!=="In-Progress"&&U(xe(j.userId,j.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||h==="Completed"?(me===!0||ae&&!oe)&&Ge===!1&&u===!1&&W===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||me!==!1||oe||ae?N&&r?.userRole&&u!=null&&W!=null&&o!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(ga,{isDashboardAccess:P,isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,isTenantCardsOnly:W})}),e.jsx(t,{path:"dashboard/*",element:P?e.jsx(ta,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:P?e.jsx(Js,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ss||P?e.jsx(Xs,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:P?e.jsx(ea,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(sa,{})}),e.jsx(t,{path:"transaction/*",element:P&&C===!1||Me||we?e.jsx(na,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:P&&C===!1?e.jsx(la,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:P&&C===!1?e.jsx(be,{entityType:"customer"}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:P&&C===!1?e.jsx(be,{entityType:"vendor"}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(Ea,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(pa,{})}),e.jsx(t,{path:"address/*",element:Ye||_e||Qe||qe?e.jsx(Ks,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:Xe?e.jsx(ra,{}):e.jsx(D,{})}),e.jsx(t,{path:"treasury/*",element:es?e.jsx(oa,{}):e.jsx(D,{})}),e.jsx(t,{path:"performance",element:ne===!0?e.jsx(ma,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ne===!0&&C===!1?e.jsx(ua,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(da,{})}),e.jsx(t,{path:"vendors/*",element:Ve?e.jsx(aa,{}):e.jsx(D,{})}),e.jsx(t,{path:"bill/*",element:Ae?e.jsx(De,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:Ae?e.jsx(De,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:Ee?e.jsx(ye,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:Ee?e.jsx(ye,{}):e.jsx(b,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Be?e.jsx(ia,{hasAdminLevelAccess:_e}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask",element:X&&w?e.jsx(fe,{isFileUploadEnabled:J}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:X&&w?e.jsx(fe,{isFileUploadEnabled:J}):e.jsx(D,{})}),e.jsx(t,{path:"cards/*",element:X?e.jsx(ca,{}):e.jsx(D,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(_a,{}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:w?e.jsx(Aa,{isFileUploadEnabled:J}):e.jsx(D,{})}),e.jsx(t,{path:"*",element:e.jsx(D,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const ga=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:M})=>O===!0&&U?e.jsx(c,{to:"checking"}):M===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),b=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(ja,{tenantEmailDomain:O}):S?e.jsx(Ta,{tenantEmailDomain:O}):U?e.jsx(ha,{tenantEmailDomain:O}):V?e.jsx(Ia,{tenantEmailDomain:O}):o?e.jsx(xa,{tenantEmailDomain:O}):e.jsx(D,{}),xa=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),Ia=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Ta=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Ce=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{b as FallBackRoute,Na as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-UQZFqaDN.js";import{a as p}from"./sentry-C0E1AQIe.js";import{h as V,g as Q,u as T,j as h,s as ce,n as $,i as G,o as q,p as A}from"./core-Ctjv24YM.js";import{bn as je,eV as M,gm as Pe,mY as le,Oc as Me,hC as he,O3 as De,qO as Ue,ku as fe,mU as Te,hE as _e,O5 as Re,O4 as Fe,Qu as Oe,ze as Be,EI as Ve,Q3 as ze,Qc as Le,c6 as ee,cL as Ne,cM as Qe,M3 as $e,Qv as Ge,M4 as Ke,xG as Ze,Qw as He,H7 as Je,Eo as We,Ef as be,Ec as qe,xK as Se,Ei as ye,El as Ce,Er as ne,u8 as te,xJ as Ye,k6 as Y,k9 as Ie,Qx as Xe,la as en,xZ as nn,MZ as tn,M_ as an,k4 as on,Qy as sn,k7 as cn,rg as ln,MU as rn,MV as dn,rk as un,hn as pn,Mc as W,hf as re,hc as gn,hk as mn,Md as hn,xW as fn,Qz as bn,QA as Sn,EF as yn,fy as xe,fA as Ee,QB as Cn,ga as In,Mm as xn,xV as de,gf as ue,ge as En,xU as An,gd as vn,gc as wn,QC as kn,fD as Ae,QD as jn,QE as Pn,y0 as Mn,xT as pe,QF as Dn,fU as Un,xQ as Tn,bZ as _n,c5 as Rn,c4 as Fn,b_ as On,c2 as Bn,c1 as Vn,c0 as zn,c3 as Ln,b$ as Nn}from"./zeni-epic-state-ym9j-rvL.js";import{W as ae,U as R,z as j,af as ve,bR as Qn,d as J,f as $n,bC as Gn,I as K,w as oe,bS as Kn,bT as Zn,ar as Hn,i as we,bU as Jn,bV as Wn,bW as qn,a9 as Yn,V as Xn,bX as et,s as nt,bY as tt}from"./index-BJyv5Z6x.js";import{n as F}from"./mui-DU4JyJ-_.js";import{M as _}from"./MobileAppDrawer-DQwHFEP8.js";import{a as Z,g as H,m as at}from"./accountMappingHelper-BBILjeHz.js";import{t as ot,A as st}from"./AddressScreen-FgxQZ6Pn.js";import N from"./NotFoundScreen-DtHa7L00.js";import{g as it}from"./analyticsHelper-CrGhWq9e.js";import{B as ct}from"./BusinessVerificationPageScreen-CsuP5vKP.js";import{C as lt}from"./CompanyPassportScreen-MkVkCyf-.js";import{q as ge}from"./QBOConnectionScreen-BmcSCHav.js";import{u as rt}from"./useEmailConnectResultRefresh-BJvktFhn.js";import{B as dt}from"./BillPayApprovalRoutes-DxR0TAud.js";import{R as ut}from"./ReimbursementApprovalRoutes-C7YE-LAA.js";import"./recharts-RL5R0Iqz.js";import"./analytics-BlxwN6GD.js";import"./plaid-Dtkg2fMC.js";import"./dnd-DdE4ICzz.js";import"./stripe-DMRn4zHo.js";import"./lottie-h9wdJ9gi.js";import"./lexical-z-P2V9ug.js";import"./pdf-BK4Cbxeo.js";import"./utils-hcCBORos.js";import"./routePaths-C7N5VwuK.js";import"./empty-BgBFHjf_.js";import"./pdf-lib-BWuwD2_b.js";import"./index-DrylXWCT.js";import"./url-DASTrDxO.js";import"./index-B6LHkFfA.js";import"./decodeURIComponentSafe-Z8As9uQN.js";import"./ReimbursementApprovalRuleDetailScreen-Q0l5mvWj.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="246db98f-60ba-4662-9b56-db795c22859c",e._sentryDebugIdIdentifier="sentry-dbid-246db98f-60ba-4662-9b56-db795c22859c")}catch{}})();const pt=F.div`
1
+ import{j as o}from"./liveblocks-DS8sOLD1.js";import{a as p}from"./sentry-B2Aew07S.js";import{h as V,g as Q,u as T,j as h,s as ce,n as $,i as G,o as q,p as A}from"./core-SRRzy8qJ.js";import{bn as je,eV as M,gm as Pe,mY as le,Oc as Me,hC as he,O3 as De,qO as Ue,ku as fe,mU as Te,hE as _e,O5 as Re,O4 as Fe,Qu as Oe,ze as Be,EI as Ve,Q3 as ze,Qc as Le,c6 as ee,cL as Ne,cM as Qe,M3 as $e,Qv as Ge,M4 as Ke,xG as Ze,Qw as He,H7 as Je,Eo as We,Ef as be,Ec as qe,xK as Se,Ei as ye,El as Ce,Er as ne,u8 as te,xJ as Ye,k6 as Y,k9 as Ie,Qx as Xe,la as en,xZ as nn,MZ as tn,M_ as an,k4 as on,Qy as sn,k7 as cn,rg as ln,MU as rn,MV as dn,rk as un,hn as pn,Mc as W,hf as re,hc as gn,hk as mn,Md as hn,xW as fn,Qz as bn,QA as Sn,EF as yn,fy as xe,fA as Ee,QB as Cn,ga as In,Mm as xn,xV as de,gf as ue,ge as En,xU as An,gd as vn,gc as wn,QC as kn,fD as Ae,QD as jn,QE as Pn,y0 as Mn,xT as pe,QF as Dn,fU as Un,xQ as Tn,bZ as _n,c5 as Rn,c4 as Fn,b_ as On,c2 as Bn,c1 as Vn,c0 as zn,c3 as Ln,b$ as Nn}from"./zeni-epic-state-DcKqCCCg.js";import{W as ae,U as R,z as j,af as ve,bR as Qn,d as J,f as $n,bC as Gn,I as K,w as oe,bS as Kn,bT as Zn,ar as Hn,i as we,bU as Jn,bV as Wn,bW as qn,a9 as Yn,V as Xn,bX as et,s as nt,bY as tt}from"./index-BnX1nS7p.js";import{n as F}from"./mui-DQ-jfgFM.js";import{M as _}from"./MobileAppDrawer-DChLZMjE.js";import{a as Z,g as H,m as at}from"./accountMappingHelper-BPz1owqi.js";import{t as ot,A as st}from"./AddressScreen-DmitYkw7.js";import N from"./NotFoundScreen-DRRoMVDk.js";import{g as it}from"./analyticsHelper-CewoJ3Hu.js";import{B as ct}from"./BusinessVerificationPageScreen-tq2Pq8-k.js";import{C as lt}from"./CompanyPassportScreen-CdbgEPbH.js";import{q as ge}from"./QBOConnectionScreen-Dxk5EKMF.js";import{u as rt}from"./useEmailConnectResultRefresh-DEaO6bJX.js";import{B as dt}from"./BillPayApprovalRoutes-BzW0b3Z-.js";import{R as ut}from"./ReimbursementApprovalRoutes-AEJXMIeN.js";import"./recharts-CHATJmXy.js";import"./analytics-C-A3qVJh.js";import"./plaid-DWZgMqW3.js";import"./dnd-CR8sMRK3.js";import"./stripe-DMRn4zHo.js";import"./lottie-Coq2aDEW.js";import"./lexical-qJrDnJMV.js";import"./pdf-D2Xq7623.js";import"./utils-D8kKiFqT.js";import"./routePaths-DyfF54Mg.js";import"./empty-Btqk4ZK3.js";import"./pdf-lib-fB9Fkl6A.js";import"./index-DiKyQs4W.js";import"./url-BOKPP8B2.js";import"./index-6PBzTIZ2.js";import"./decodeURIComponentSafe-Bz-26BXW.js";import"./ReimbursementApprovalRuleDetailScreen-Btjx5v4l.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="246db98f-60ba-4662-9b56-db795c22859c",e._sentryDebugIdIdentifier="sentry-dbid-246db98f-60ba-4662-9b56-db795c22859c")}catch{}})();const pt=F.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-UQZFqaDN.js";import{h as X,g as Y,u as ee,i as $,j as v,N as j,n as W,t as Ye}from"./core-Ctjv24YM.js";import{bJ as en,co as Ie,PT as ye,eV as V,cA as nn,zu as Q,ze as tn,Q3 as an,Q6 as on,rz as ne,rn as te,l2 as ae,tG as L,Q8 as Ae,ge as Qe,gd as Ge,gc as $e,Q9 as sn,zD as cn,Eo as ke,Ef as _e,Ec as ve,DW as K,Ei as Pe,El as Ee,Er as Te,u8 as we,gt as rn,cv as un,fA as dn,fy as ln,fz as pn,bt as mn,Qa as yn,CW as le,Dy as fn,Qb as gn,bK as Sn,FH as pe,EI as bn,Qc as hn,Qd as Cn,FL as In,FP as An,tz as kn,Kd as _n,Gk as Ce,Hk as me,Qe as vn,Qf as Pn,Qg as En,Qh as We,Qi as Tn,MG as wn,Pg as Dn,MX as Un,Qj as He,D_ as On,MY as Fn,E2 as Vn,Qk as Ve,GG as qe,la as xn,rq as Ke,tI as Bn,bE as je,tU as Re,cy as jn,Ql as Je,fT as Rn,G2 as zn,G6 as Nn,Qm as Ln,Gn as ze,Qn as Mn,Qo as Zn,Qp as Qn,Qq as Gn,gm as $n,AO as Wn,Qr as Hn,AT as qn,AS as Kn}from"./zeni-epic-state-ym9j-rvL.js";import{I as ie,W as oe,U as de,m as De,aQ as J,bC as Xe,z as D,x as se,d as U,w as Ue,f as G,bD as Jn,au as ce,bE as x,bF as Xn,bG as Yn,af as Be,bH as et,s as Ne,av as Le,q as nt,y as tt,bI as at,bJ as it,bK as ot,a7 as st}from"./index-BJyv5Z6x.js";import{a as C}from"./sentry-C0E1AQIe.js";import{n as xe,D as ct,S as rt}from"./mui-DU4JyJ-_.js";import{M as fe}from"./MobileAppDrawer-DQwHFEP8.js";import N from"./NotFoundScreen-DtHa7L00.js";import{a as Me}from"./analyticsHelper-CrGhWq9e.js";import{d as Ze}from"./routePaths-C7N5VwuK.js";import{B as Fe}from"./BusinessVerificationPageScreen-CsuP5vKP.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="961f3188-8294-4079-9416-8fac291663b3",e._sentryDebugIdIdentifier="sentry-dbid-961f3188-8294-4079-9416-8fac291663b3")}catch{}})();const ut=xe.div`
1
+ import{j as u}from"./liveblocks-DS8sOLD1.js";import{h as X,g as Y,u as ee,i as $,j as v,N as j,n as W,t as Ye}from"./core-SRRzy8qJ.js";import{bJ as en,co as Ie,PT as ye,eV as V,cA as nn,zu as Q,ze as tn,Q3 as an,Q6 as on,rz as ne,rn as te,l2 as ae,tG as L,Q8 as Ae,ge as Qe,gd as Ge,gc as $e,Q9 as sn,zD as cn,Eo as ke,Ef as _e,Ec as ve,DW as K,Ei as Pe,El as Ee,Er as Te,u8 as we,gt as rn,cv as un,fA as dn,fy as ln,fz as pn,bt as mn,Qa as yn,CW as le,Dy as fn,Qb as gn,bK as Sn,FH as pe,EI as bn,Qc as hn,Qd as Cn,FL as In,FP as An,tz as kn,Kd as _n,Gk as Ce,Hk as me,Qe as vn,Qf as Pn,Qg as En,Qh as We,Qi as Tn,MG as wn,Pg as Dn,MX as Un,Qj as He,D_ as On,MY as Fn,E2 as Vn,Qk as Ve,GG as qe,la as xn,rq as Ke,tI as Bn,bE as je,tU as Re,cy as jn,Ql as Je,fT as Rn,G2 as zn,G6 as Nn,Qm as Ln,Gn as ze,Qn as Mn,Qo as Zn,Qp as Qn,Qq as Gn,gm as $n,AO as Wn,Qr as Hn,AT as qn,AS as Kn}from"./zeni-epic-state-DcKqCCCg.js";import{I as ie,W as oe,U as de,m as De,aQ as J,bC as Xe,z as D,x as se,d as U,w as Ue,f as G,bD as Jn,au as ce,bE as x,bF as Xn,bG as Yn,af as Be,bH as et,s as Ne,av as Le,q as nt,y as tt,bI as at,bJ as it,bK as ot,a7 as st}from"./index-BnX1nS7p.js";import{a as C}from"./sentry-B2Aew07S.js";import{n as xe,D as ct,S as rt}from"./mui-DQ-jfgFM.js";import{M as fe}from"./MobileAppDrawer-DChLZMjE.js";import N from"./NotFoundScreen-DRRoMVDk.js";import{a as Me}from"./analyticsHelper-CewoJ3Hu.js";import{d as Ze}from"./routePaths-DyfF54Mg.js";import{B as Fe}from"./BusinessVerificationPageScreen-tq2Pq8-k.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="961f3188-8294-4079-9416-8fac291663b3",e._sentryDebugIdIdentifier="sentry-dbid-961f3188-8294-4079-9416-8fac291663b3")}catch{}})();const ut=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as u}from"./liveblocks-UQZFqaDN.js";import{a as f,b as T,q as A}from"./sentry-C0E1AQIe.js";import{u as z,h as D,j as l,g as M,N as O,n as j}from"./core-Ctjv24YM.js";import{u as P,z as s,m as _,d as E,a as F,e as B,f as N,h as V,g as Y,Y as $,i as b}from"./index-BJyv5Z6x.js";import{eV as Z,LS as q,LT as J,fw as W,fZ as H,LY as X,gl as G,cX as K,LZ as y,L_ as Q,L$ as R,bY as v}from"./zeni-epic-state-ym9j-rvL.js";import"./mui-DU4JyJ-_.js";import{u as ee}from"./useDeviceId-_WmC04ST.js";import{f as te}from"./analyticsHelper-CrGhWq9e.js";import{t as ne}from"./getLocaleForTenant-DnliJT-u.js";import"./recharts-RL5R0Iqz.js";import"./analytics-BlxwN6GD.js";import"./plaid-Dtkg2fMC.js";import"./dnd-DdE4ICzz.js";import"./stripe-DMRn4zHo.js";import"./lottie-h9wdJ9gi.js";import"./lexical-z-P2V9ug.js";import"./pdf-BK4Cbxeo.js";import"./utils-hcCBORos.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="470955b0-7319-430e-b2c6-80ecb5b6b307",t._sentryDebugIdIdentifier="sentry-dbid-470955b0-7319-430e-b2c6-80ecb5b6b307")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:b.googleClientId,microsoftClientId:b.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(R({authCode:n,oauthProvider:a,appType:"web",redirectUri:v(c),sourceUri:v(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(y())}}})($),ae=T.memo(ie);function be({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect(()=>{g()},[g]);const a=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:C,accountUnlockTime:h}=l(e=>e.tenantState),p=l(e=>e.tenantState.fetchState),k=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),o=l(e=>e.tenantState.loggedInUser),r=l(e=>Z(e)),I=l(e=>q(e)),m=M(),w=_().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect(()=>{L.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))},[L.fetchState,c]),f.useEffect(()=>{t(void 0)},[]),f.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(X("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then(()=>{const e=Y();e!=null&&B(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))},2e3))},[S,p,k,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(O,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&h!=null?u.jsx(V,{onClose:()=>i(y()),unlockDate:h}):null]})}export{be as default};
1
+ import{j as u}from"./liveblocks-DS8sOLD1.js";import{a as f,b as T,q as A}from"./sentry-B2Aew07S.js";import{u as z,h as D,j as l,g as M,N as O,n as j}from"./core-SRRzy8qJ.js";import{u as P,z as s,m as _,d as E,a as F,e as B,f as N,h as V,g as Y,Y as $,i as b}from"./index-BnX1nS7p.js";import{eV as Z,LS as q,LT as J,fw as W,fZ as H,LY as X,gl as G,cX as K,LZ as y,L_ as Q,L$ as R,bY as v}from"./zeni-epic-state-DcKqCCCg.js";import"./mui-DQ-jfgFM.js";import{u as ee}from"./useDeviceId-obtSvxuy.js";import{f as te}from"./analyticsHelper-CewoJ3Hu.js";import{t as ne}from"./getLocaleForTenant-DHWNDQcY.js";import"./recharts-CHATJmXy.js";import"./analytics-C-A3qVJh.js";import"./plaid-DWZgMqW3.js";import"./dnd-CR8sMRK3.js";import"./stripe-DMRn4zHo.js";import"./lottie-Coq2aDEW.js";import"./lexical-qJrDnJMV.js";import"./pdf-D2Xq7623.js";import"./utils-D8kKiFqT.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="470955b0-7319-430e-b2c6-80ecb5b6b307",t._sentryDebugIdIdentifier="sentry-dbid-470955b0-7319-430e-b2c6-80ecb5b6b307")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:b.googleClientId,microsoftClientId:b.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(R({authCode:n,oauthProvider:a,appType:"web",redirectUri:v(c),sourceUri:v(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(y())}}})($),ae=T.memo(ie);function be({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect(()=>{g()},[g]);const a=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:C,accountUnlockTime:h}=l(e=>e.tenantState),p=l(e=>e.tenantState.fetchState),k=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),o=l(e=>e.tenantState.loggedInUser),r=l(e=>Z(e)),I=l(e=>q(e)),m=M(),w=_().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect(()=>{L.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))},[L.fetchState,c]),f.useEffect(()=>{t(void 0)},[]),f.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(X("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then(()=>{const e=Y();e!=null&&B(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))},2e3))},[S,p,k,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(O,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&h!=null?u.jsx(V,{onClose:()=>i(y()),unlockDate:h}):null]})}export{be as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-UQZFqaDN.js";import{a as n}from"./sentry-C0E1AQIe.js";import{u,g as m,h as g,N as p}from"./core-Ctjv24YM.js";import{z as f,w as b,t as y,d as l,f as h}from"./index-BJyv5Z6x.js";import{gq as x,gr as I,Me as w}from"./zeni-epic-state-ym9j-rvL.js";import{n as j}from"./mui-DU4JyJ-_.js";import"./recharts-RL5R0Iqz.js";import"./analytics-BlxwN6GD.js";import"./plaid-Dtkg2fMC.js";import"./dnd-DdE4ICzz.js";import"./stripe-DMRn4zHo.js";import"./lottie-h9wdJ9gi.js";import"./lexical-z-P2V9ug.js";import"./pdf-BK4Cbxeo.js";import"./utils-hcCBORos.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="082b224a-6888-43ba-90fb-948c1b853671",e._sentryDebugIdIdentifier="sentry-dbid-082b224a-6888-43ba-90fb-948c1b853671")}catch{}})();function $(){const e=u(),t=m(),i=g(),a=n.useRef(!1),c=f.isSignedIn(),r=t.state?.message==="logout",o=r||c;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{f.clearAll(),e(x()),e(I(!1)),w(),y.reset(),l.trackLogout(h.Event.logoutSuccess),l.resetUserIdentity()}catch(d){console.error("Error during sign out:",d)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(b,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.div`
1
+ import{j as s}from"./liveblocks-DS8sOLD1.js";import{a as n}from"./sentry-B2Aew07S.js";import{u,g as m,h as g,N as p}from"./core-SRRzy8qJ.js";import{z as f,w as b,t as y,d as l,f as h}from"./index-BnX1nS7p.js";import{gq as x,gr as I,Me as w}from"./zeni-epic-state-DcKqCCCg.js";import{n as j}from"./mui-DQ-jfgFM.js";import"./recharts-CHATJmXy.js";import"./analytics-C-A3qVJh.js";import"./plaid-DWZgMqW3.js";import"./dnd-CR8sMRK3.js";import"./stripe-DMRn4zHo.js";import"./lottie-Coq2aDEW.js";import"./lexical-qJrDnJMV.js";import"./pdf-D2Xq7623.js";import"./utils-D8kKiFqT.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="082b224a-6888-43ba-90fb-948c1b853671",e._sentryDebugIdIdentifier="sentry-dbid-082b224a-6888-43ba-90fb-948c1b853671")}catch{}})();function $(){const e=u(),t=m(),i=g(),a=n.useRef(!1),c=f.isSignedIn(),r=t.state?.message==="logout",o=r||c;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{f.clearAll(),e(x()),e(I(!1)),w(),y.reset(),l.trackLogout(h.Event.logoutSuccess),l.resetUserIdentity()}catch(d){console.error("Error during sign out:",d)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(b,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-UQZFqaDN.js";import{a as D}from"./sentry-C0E1AQIe.js";import{h as K,u as U,g as z,j as G,i as _,n as M}from"./core-Ctjv24YM.js";import{z as R,W as O,U as p,Z as V,x as W,d as Z,f as H,d9 as J,s as g,k as Q}from"./index-BJyv5Z6x.js";import{eV as q,TH as F,I$ as C,TI as x,TD as X,In as y,TJ as Y,Iv as E,HR as aa,J0 as S,TK as B,fv as ea,IS as ta,IX as sa,IK as oa,II as w,IY as na,IF as ia,TL as la,TM as ra,TN as ka,TO as ca,TP as T,eh as da,TQ as ua,TR as pa}from"./zeni-epic-state-ym9j-rvL.js";import{n as Ta}from"./mui-DU4JyJ-_.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-DZ2VqCuW.js";import{M as ga}from"./MobileAppDrawer-DQwHFEP8.js";import"./recharts-RL5R0Iqz.js";import"./analytics-BlxwN6GD.js";import"./plaid-Dtkg2fMC.js";import"./dnd-DdE4ICzz.js";import"./stripe-DMRn4zHo.js";import"./lottie-h9wdJ9gi.js";import"./lexical-z-P2V9ug.js";import"./pdf-BK4Cbxeo.js";import"./utils-hcCBORos.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ba12953b-6d31-4164-b24b-55d8aec13743",e._sentryDebugIdIdentifier="sentry-dbid-ba12953b-6d31-4164-b24b-55d8aec13743")}catch{}})();const fa=Ta.div`
1
+ import{j as u}from"./liveblocks-DS8sOLD1.js";import{a as D}from"./sentry-B2Aew07S.js";import{h as K,u as U,g as z,j as G,i as _,n as M}from"./core-SRRzy8qJ.js";import{z as R,W as O,U as p,Z as V,x as W,d as Z,f as H,d9 as J,s as g,k as Q}from"./index-BnX1nS7p.js";import{eV as q,TH as F,I$ as C,TI as x,TD as X,In as y,TJ as Y,Iv as E,HR as aa,J0 as S,TK as B,fv as ea,IS as ta,IX as sa,IK as oa,II as w,IY as na,IF as ia,TL as la,TM as ra,TN as ka,TO as ca,TP as T,eh as da,TQ as ua,TR as pa}from"./zeni-epic-state-DcKqCCCg.js";import{n as Ta}from"./mui-DQ-jfgFM.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-RYFll1PC.js";import{M as ga}from"./MobileAppDrawer-DChLZMjE.js";import"./recharts-CHATJmXy.js";import"./analytics-C-A3qVJh.js";import"./plaid-DWZgMqW3.js";import"./dnd-CR8sMRK3.js";import"./stripe-DMRn4zHo.js";import"./lottie-Coq2aDEW.js";import"./lexical-qJrDnJMV.js";import"./pdf-D2Xq7623.js";import"./utils-D8kKiFqT.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ba12953b-6d31-4164-b24b-55d8aec13743",e._sentryDebugIdIdentifier="sentry-dbid-ba12953b-6d31-4164-b24b-55d8aec13743")}catch{}})();const fa=Ta.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as n}from"./liveblocks-UQZFqaDN.js";import se from"./NotFoundScreen-DtHa7L00.js";import{a as c}from"./sentry-C0E1AQIe.js";import{h as H,u as O,j as f,g as ne,i as oe,N as ie,n as re,o as ce,p as g}from"./core-Ctjv24YM.js";import{I2 as Z,I5 as le,H$ as de,eV as M,TD as W,Ij as Y,HY as pe,IP as ue,II as ke,TE as Q,TF as N,HU as me,HR as ge,rz as fe,rn as he,l2 as Ie,Id as Se,TG as Te,Iu as be,Ir as Ee,I8 as Ge,Io as Ce,In as De}from"./zeni-epic-state-ym9j-rvL.js";import{z as C,d7 as xe,$ as je,W as ye,U as b,k as X,s as v,x as we,d as V,f as ve,d8 as Re,i as A,au as Fe}from"./index-BJyv5Z6x.js";import{n as Ue}from"./mui-DU4JyJ-_.js";import{u as Be}from"./useInitialThreadRequest-B13VgkiL.js";import{M as Pe}from"./MobileAppDrawer-DQwHFEP8.js";import Le from"./TaskListScreen-BYXHdSHM.js";import"./recharts-RL5R0Iqz.js";import"./analytics-BlxwN6GD.js";import"./plaid-Dtkg2fMC.js";import"./dnd-DdE4ICzz.js";import"./stripe-DMRn4zHo.js";import"./lottie-h9wdJ9gi.js";import"./lexical-z-P2V9ug.js";import"./pdf-BK4Cbxeo.js";import"./utils-hcCBORos.js";import"./useAskAiCfoHostNavButtonProps-DZ2VqCuW.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4b972bd8-bed9-47e6-985d-0d951c9144ca",e._sentryDebugIdIdentifier="sentry-dbid-4b972bd8-bed9-47e6-985d-0d951c9144ca")}catch{}})();function $e(){const e=H(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=f(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(Z())},[t]),k=c.useCallback((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let _,q=[];const ze=re(function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=W(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>N(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(fe(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(Y(!1,s))},onCreateTagClick:a=>{e(ge(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function w(){const e=H(),t=O(),s=ne(),u=je(),{taskId:r,taskGroupId:d}=oe(),l=f(i=>M(i)),k=Be(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,J]=c.useState(!1),[F,K]=c.useState(!1),[U,ee]=c.useState(!1),[B,j]=c.useState(!1),T=c.useRef(!1),G=f(i=>i.taskListState.updateTasksFetchState.fetchState),P=f(i=>W(i)),L=f(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(J(!0),t(Y(!1,r)))},[p,t]),c.useEffect(()=>{F||P.fetchState==="Completed"||(K(!0),t(pe()))},[F,t,P.fetchState]),c.useEffect(()=>{U||L==="Completed"||(ee(!0),t(ue()))},[U,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),j(!0))},[t,r]);c.useEffect(()=>{if(B)if(G!=="In-Progress"){if(T.current){if(G==="Error")return j(!1),void(T.current=!1);if(G==="Completed"){j(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[B,G,l,s,e]);const $=f(i=>Q(i,r)),y=$.fetchState,z=C.getSignedInUser();if(z==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(we,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Pe,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(ze,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:z,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ne=Ue.div`
1
+ import{j as n}from"./liveblocks-DS8sOLD1.js";import se from"./NotFoundScreen-DRRoMVDk.js";import{a as c}from"./sentry-B2Aew07S.js";import{h as H,u as O,j as f,g as ne,i as oe,N as ie,n as re,o as ce,p as g}from"./core-SRRzy8qJ.js";import{I2 as Z,I5 as le,H$ as de,eV as M,TD as W,Ij as Y,HY as pe,IP as ue,II as ke,TE as Q,TF as N,HU as me,HR as ge,rz as fe,rn as he,l2 as Ie,Id as Se,TG as Te,Iu as be,Ir as Ee,I8 as Ge,Io as Ce,In as De}from"./zeni-epic-state-DcKqCCCg.js";import{z as C,d7 as xe,$ as je,W as ye,U as b,k as X,s as v,x as we,d as V,f as ve,d8 as Re,i as A,au as Fe}from"./index-BnX1nS7p.js";import{n as Ue}from"./mui-DQ-jfgFM.js";import{u as Be}from"./useInitialThreadRequest-8loDIspA.js";import{M as Pe}from"./MobileAppDrawer-DChLZMjE.js";import Le from"./TaskListScreen-BDTDGrzi.js";import"./recharts-CHATJmXy.js";import"./analytics-C-A3qVJh.js";import"./plaid-DWZgMqW3.js";import"./dnd-CR8sMRK3.js";import"./stripe-DMRn4zHo.js";import"./lottie-Coq2aDEW.js";import"./lexical-qJrDnJMV.js";import"./pdf-D2Xq7623.js";import"./utils-D8kKiFqT.js";import"./useAskAiCfoHostNavButtonProps-RYFll1PC.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4b972bd8-bed9-47e6-985d-0d951c9144ca",e._sentryDebugIdIdentifier="sentry-dbid-4b972bd8-bed9-47e6-985d-0d951c9144ca")}catch{}})();function $e(){const e=H(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=f(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(Z())},[t]),k=c.useCallback((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let _,q=[];const ze=re(function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=W(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>N(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(fe(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(Y(!1,s))},onCreateTagClick:a=>{e(ge(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function w(){const e=H(),t=O(),s=ne(),u=je(),{taskId:r,taskGroupId:d}=oe(),l=f(i=>M(i)),k=Be(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,J]=c.useState(!1),[F,K]=c.useState(!1),[U,ee]=c.useState(!1),[B,j]=c.useState(!1),T=c.useRef(!1),G=f(i=>i.taskListState.updateTasksFetchState.fetchState),P=f(i=>W(i)),L=f(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(J(!0),t(Y(!1,r)))},[p,t]),c.useEffect(()=>{F||P.fetchState==="Completed"||(K(!0),t(pe()))},[F,t,P.fetchState]),c.useEffect(()=>{U||L==="Completed"||(ee(!0),t(ue()))},[U,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),j(!0))},[t,r]);c.useEffect(()=>{if(B)if(G!=="In-Progress"){if(T.current){if(G==="Error")return j(!1),void(T.current=!1);if(G==="Completed"){j(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[B,G,l,s,e]);const $=f(i=>Q(i,r)),y=$.fetchState,z=C.getSignedInUser();if(z==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(we,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Pe,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(ze,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:z,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ne=Ue.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-UQZFqaDN.js";import i from"./NotFoundScreen-DtHa7L00.js";import{T as r}from"./TransactionDetailScreen-BLBk60iy.js";import"./sentry-C0E1AQIe.js";import{o as s,p as o}from"./core-Ctjv24YM.js";import"./zeni-epic-state-ym9j-rvL.js";import"./recharts-RL5R0Iqz.js";import"./index-BJyv5Z6x.js";import"./mui-DU4JyJ-_.js";import"./analytics-BlxwN6GD.js";import"./plaid-Dtkg2fMC.js";import"./dnd-DdE4ICzz.js";import"./stripe-DMRn4zHo.js";import"./lottie-h9wdJ9gi.js";import"./lexical-z-P2V9ug.js";import"./pdf-BK4Cbxeo.js";import"./utils-hcCBORos.js";import"./useAskAiCfoHostNavButtonProps-DZ2VqCuW.js";import"./decodeURIComponentSafe-Z8As9uQN.js";import"./routePaths-C7N5VwuK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
1
+ import{j as t}from"./liveblocks-DS8sOLD1.js";import i from"./NotFoundScreen-DRRoMVDk.js";import{T as r}from"./TransactionDetailScreen-BbsGsqi_.js";import"./sentry-B2Aew07S.js";import{o as s,p as o}from"./core-SRRzy8qJ.js";import"./zeni-epic-state-DcKqCCCg.js";import"./recharts-CHATJmXy.js";import"./index-BnX1nS7p.js";import"./mui-DQ-jfgFM.js";import"./analytics-C-A3qVJh.js";import"./plaid-DWZgMqW3.js";import"./dnd-CR8sMRK3.js";import"./stripe-DMRn4zHo.js";import"./lottie-Coq2aDEW.js";import"./lexical-qJrDnJMV.js";import"./pdf-D2Xq7623.js";import"./utils-D8kKiFqT.js";import"./useAskAiCfoHostNavButtonProps-RYFll1PC.js";import"./decodeURIComponentSafe-Bz-26BXW.js";import"./routePaths-DyfF54Mg.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as x}from"./liveblocks-UQZFqaDN.js";import{a as i}from"./sentry-C0E1AQIe.js";import{u as q,k as Ke,j as g,s as fe,g as Se,h as Te,i as be,N as Ze,n as Qe}from"./core-Ctjv24YM.js";import{nL as he,eV as Z,gm as Xe,Oc as et,mY as tt,mG as at,bn as nt,cT as Ee,bs as Ie,r7 as W,Nb as H,Od as ve,Oe as oe,NB as De,kF as Ce,Of as ke,NG as se,NH as ce,lu as Ae,K6 as ie,N5 as M,kz as Oe,kx as Ue,kJ as ot,ny as st,Og as ct,Oh as it,vk as K,kE as xe,Jr as we,cY as rt,cZ as lt,Oi as dt,N4 as ut,Oj as mt,vg as pt,Ok as ft,Ol as ht,Om as yt,On as gt,Oo as St,kI as Tt,Op as bt,Oq as Et,N6 as It,Or as vt,Os as Dt,Ot as Ct,Jl as kt,Jb as At,JA as Ot,kK as Ut,K7 as ye,nD as xt}from"./zeni-epic-state-ym9j-rvL.js";import{W as Y,U as w,z as _e,aQ as Pe,m as wt,q as _t,aR as Pt,y as Ft,k as ae,I as Vt,aS as Bt,s as ne,Z as Nt,aT as Rt,d as Fe,aU as zt,au as Lt,a2 as te}from"./index-BJyv5Z6x.js";import{n as Gt,S as jt,D as $t}from"./mui-DU4JyJ-_.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-DZ2VqCuW.js";import{d as Ve}from"./decodeURIComponentSafe-Z8As9uQN.js";import{h as Be,c as Ne,g as qt,e as Wt}from"./routePaths-C7N5VwuK.js";import{u as Ht}from"./utils-hcCBORos.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="44bdd3d1-e4b3-477b-a552-212bae2ba9e1",t._sentryDebugIdIdentifier="sentry-dbid-44bdd3d1-e4b3-477b-a552-212bae2ba9e1")}catch{}})();function Yt(t=!0){const e=q(),s=Ke(),{useFeatureGate:a}=Y(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Jt(t,e){const s=function(){const r=q(),[p,S]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=Y(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=g(h=>Z(h)),b=k.companyId,U=g(h=>Xe(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:B,dismissedAccounts:L}=g(h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(_);G.current=_;const N=i.useRef(B);N.current=B;const P=i.useRef(L);P.current=L;const R=g(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[R]),l=m!=null?I[m]??null:null,j=i.useCallback(h=>{if(!v)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),Q=N.current??{},J=P.current;for(const z of u)if($.has(z.accountId)&&Q[z.accountId]==null&&J?.[z.accountId]==null)return y(z.classificationType),O(z.accountId),void S(!0)},[v]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),S(!1),y(null),O(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(at(b,m)),S(!1),y(null),O(null))},[r,b,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=_e.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=q(),{useFeatureGate:a,useDynamicConfig:n}=Y(),o=g(u=>Z(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:S}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:W(e)}),[t,e]),f=g(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=g(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=g(u=>{if(b!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),_=g(u=>oe(u)),B=g(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),L=o.company?.companyInfo.firstMonthOfFY??1,G=g(u=>Ce(u.accountState,u.accountListState,"accountList")),[N,P]=i.useState(!1),[R,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{P(!1),I(!1),j(!1)},[t,e]);const D=i.useCallback(()=>{P(!1),I(!1)},[]),[F,h]=i.useState(!1),E=B?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(N?R||U==null||(I(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),P(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,R,U,E]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:S,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:_,uiState:B,firstMonthOfFY:L,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Kt={overlayWidth:new Ft(100,100,58)},Zt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=_t(),r=q(),p=g(y=>oe(y)),S=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:S,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:S,children:x.jsx(Qt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Qt=Gt(jt)`
1
+ import{j as x}from"./liveblocks-DS8sOLD1.js";import{a as i}from"./sentry-B2Aew07S.js";import{u as q,k as Ke,j as g,s as fe,g as Se,h as Te,i as be,N as Ze,n as Qe}from"./core-SRRzy8qJ.js";import{nL as he,eV as Z,gm as Xe,Oc as et,mY as tt,mG as at,bn as nt,cT as Ee,bs as Ie,r7 as W,Nb as H,Od as ve,Oe as oe,NB as De,kF as Ce,Of as ke,NG as se,NH as ce,lu as Ae,K6 as ie,N5 as M,kz as Oe,kx as Ue,kJ as ot,ny as st,Og as ct,Oh as it,vk as K,kE as xe,Jr as we,cY as rt,cZ as lt,Oi as dt,N4 as ut,Oj as mt,vg as pt,Ok as ft,Ol as ht,Om as yt,On as gt,Oo as St,kI as Tt,Op as bt,Oq as Et,N6 as It,Or as vt,Os as Dt,Ot as Ct,Jl as kt,Jb as At,JA as Ot,kK as Ut,K7 as ye,nD as xt}from"./zeni-epic-state-DcKqCCCg.js";import{W as Y,U as w,z as _e,aQ as Pe,m as wt,q as _t,aR as Pt,y as Ft,k as ae,I as Vt,aS as Bt,s as ne,Z as Nt,aT as Rt,d as Fe,aU as zt,au as Lt,a2 as te}from"./index-BnX1nS7p.js";import{n as Gt,S as jt,D as $t}from"./mui-DQ-jfgFM.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-RYFll1PC.js";import{d as Ve}from"./decodeURIComponentSafe-Bz-26BXW.js";import{h as Be,c as Ne,g as qt,e as Wt}from"./routePaths-DyfF54Mg.js";import{u as Ht}from"./utils-D8kKiFqT.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="44bdd3d1-e4b3-477b-a552-212bae2ba9e1",t._sentryDebugIdIdentifier="sentry-dbid-44bdd3d1-e4b3-477b-a552-212bae2ba9e1")}catch{}})();function Yt(t=!0){const e=q(),s=Ke(),{useFeatureGate:a}=Y(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Jt(t,e){const s=function(){const r=q(),[p,S]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=Y(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=g(h=>Z(h)),b=k.companyId,U=g(h=>Xe(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:B,dismissedAccounts:L}=g(h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(_);G.current=_;const N=i.useRef(B);N.current=B;const P=i.useRef(L);P.current=L;const R=g(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[R]),l=m!=null?I[m]??null:null,j=i.useCallback(h=>{if(!v)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),Q=N.current??{},J=P.current;for(const z of u)if($.has(z.accountId)&&Q[z.accountId]==null&&J?.[z.accountId]==null)return y(z.classificationType),O(z.accountId),void S(!0)},[v]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),S(!1),y(null),O(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(at(b,m)),S(!1),y(null),O(null))},[r,b,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=_e.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=q(),{useFeatureGate:a,useDynamicConfig:n}=Y(),o=g(u=>Z(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:S}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:W(e)}),[t,e]),f=g(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=g(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=g(u=>{if(b!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),_=g(u=>oe(u)),B=g(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),L=o.company?.companyInfo.firstMonthOfFY??1,G=g(u=>Ce(u.accountState,u.accountListState,"accountList")),[N,P]=i.useState(!1),[R,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{P(!1),I(!1),j(!1)},[t,e]);const D=i.useCallback(()=>{P(!1),I(!1)},[]),[F,h]=i.useState(!1),E=B?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(N?R||U==null||(I(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),P(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,R,U,E]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:S,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:_,uiState:B,firstMonthOfFY:L,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Kt={overlayWidth:new Ft(100,100,58)},Zt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=_t(),r=q(),p=g(y=>oe(y)),S=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:S,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:S,children:x.jsx(Qt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Qt=Gt(jt)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;