PageSourceSearch

https://app.bluetape.com/static/js/713.521d9d0f.chunk.js

js bluetape.com collected 2026-10-02 02:45:47 UTC 1,187,109 bytes, 1 lines download raw bytes

1(self.webpackChunk_linqpal_web=self.webpackChunk_linqpal_web||[]).push([[713],{66950:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(50016);const o=n.p+"static/media/noInvoice.25da980c645070038edae4c2577caa2b.svg"},96510:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>wd});var o=n(73819),r=n(13459),a=n(63680),l=n(97976),i=n(35790),s=n(66146),c=n(50016),d=n(77356),u=n(42589),m=n(37149),p=n(5438),g=n(67976),h=n(32872),v=n(27757),y=n(67337),b=n(16148),f=n(83613),E=n(67869),C=n(76321),A=n(79746),S=n(5878),w=n(83149),P=n(49727),I=n(62033),x=n(63957),D=n(13569),T=n(7435),k=n(95390),B=n(68215),F=n(20282),_=n(52993),N=n(82997),R=n(43872),L=n(58876);function M(e){let{value:t,onChangeText:n,editable:o=!0,onSubmitEditing:r,hidden:a,placeholder:l,autoFocus:i,testID:s="email",...d}=e;const u=(0,_.Lx)(t&&!N.validators.validateEmail(t)?"Invalid Email ":"");return c.createElement(R.A,Object.assign({testID:s,name:"email",value:t},u,{autoFocus:i,onChangeText:n,editable:o,placeholder:l||"[email protected]",onSubmitEditing:r,autoComplete:"email",keyboardType:L.ui.EmailAddress,inputOuterStyle:a?{display:"none"}:void 0},d))}var O=n(68096),z=n(29731),j=n(33346),W=n(72839),V=n(44985);const H=(0,p.PA)((e=>{var t;let{navigation:n}=e;const{login:o,isValidEmail:r,setLogin:a}=D.A,{isBusy:l}=f.A,{t:i}=(0,z.Bd)("auth");(0,c.useEffect)((()=>D.A.removeError("forgot")),[]);const s=(0,c.useCallback)((()=>{D.A.sendPasswordResetEmail().then((()=>{(0,V.W)(W.I.forgot_password),n.navigate(E.f0.Auth.SignInForgotFinish)}))}),[n]);return c.createElement(I.A,null,c.createElement(O.Ay,{testID:"back-button"}),c.createElement(T.A,null,i("signIn.forgotTitle")),c.createElement(T.t,{style:{marginTop:20}},i("signIn.forgotSubTitle")),c.createElement(M,{label:i("signIn.emailLabel"),value:o,onChangeText:a,autoFocus:!0,onSubmitEditing:s,hidden:!1,placeholder:""}),c.createElement(j.K,{error:null===(t=D.A.errors.get("forgot"))||void 0===t?void 0:t.message}),c.createElement(F.hK,{height:32}),c.createElement(x.A,{onPress:s,disabled:!r||l,loading:l},i("signIn.forgotSubmitLabel")),c.createElement(F.hK,null),c.createElement(P.A,{style:{fontSize:16,fontWeight:"500",color:B.commonColors.textLight}},i("signIn.newUserQuestion"),c.createElement(k.N,{textStyle:{fontSize:16,fontWeight:"500"},title:i("SignUp"),color:B.commonColors.accentText,onPress:()=>n.replace(E.f0.Auth.SignUp)})))}));var U=n(86419),G=n(29073),Y=n(72753),Q=n(75143),q=n(97076),K=n(7371),J=n(6142);function Z(e){var t;let{navigation:n}=e;const{setMessage:o}=(0,g.JX)(),{sendPasswordResetEmail:r,login:a,errors:l}=D.A,{t:i}=(0,z.Bd)("auth");return c.createElement(I.A,null,c.createElement(K.A,{style:{flex:1,alignItems:"center"}},c.createElement(q._FW,null),c.createElement(P.A,{style:{fontWeight:"600",fontSize:32,textAlign:"center",width:"100%"}},i("signIn.forgotTitle2")),c.createElement(F.hK,{height:30}),c.createElement(T.t,{style:{textAlign:"center",width:"100%",fontWeight:"500",color:"#668598"}},i("signIn.forgotSubTitle2"),a),c.createElement(F.hK,null),c.createElement(T.t,{style:{textAlign:"center",width:"100%",fontWeight:"500",color:"#668598"}},c.createElement(z.x6,{i18nKey:"signIn.forgotResendText",t:i},"Didn't receive the email? Check your spam filter, or request to"," ",c.createElement(Q.A,{onPress:()=>{D.A.removeError("forgot"),r().then((()=>{o(g.$z.SUCCESS,"Email has successfully sent")})).catch((e=>{console.log(e),D.A.setError("forgot","error",e.code)}))},testID:"resend-email"},"resend email."))),c.createElement(F.hK,null),c.createElement(x.A,{onPress:()=>{var e,t,o,r;null===(e=window)||void 0===e||null===(t=e.opener)||void 0===t||t.postMessage({type:J.c.PASS_RESTORE_INSTRUCTIONS_SENT},window.location.origin),null===(o=window)||void 0===o||null===(r=o.parent)||void 0===r||r.postMessage({type:J.c.PASS_RESTORE_INSTRUCTIONS_SENT},window.location.origin),n.replace(E.f0.Auth.SignIn)}},i("signIn.submitLabel")),c.createElement(j.K,{error:null===(t=l.get("forgot"))||void 0===t?void 0:t.message})))}var X=n(30649),$=n(44399);const ee=(0,y.A)(),te=()=>{const e=(0,$.A)("signin");return(0,c.useEffect)((()=>e.cleanVerifier),[]),c.createElement(ee.Navigator,{screenOptions:b.pc,headerMode:b.Hu,initialRouteName:E.f0.Auth.SignIn},c.createElement(ee.Screen,{name:E.f0.Auth.SignIn,component:S.A}),c.createElement(ee.Screen,{name:E.f0.Auth.SignInPassword,component:X.A}),c.createElement(ee.Screen,{name:E.f0.Auth.SignInVerify,component:w.A}),c.createElement(ee.Screen,{name:E.f0.Auth.SignUpHome,component:U.A}),c.createElement(ee.Screen,{name:E.f0.Auth.SignInForgotPassword,component:H}),c.createElement(ee.Screen,{name:E.f0.Auth.SignInForgotFinish,component:Z}),c.createElement(ee.Screen,{name:E.f0.Auth.SignUp,component:U.A}),c.createElement(ee.Screen,{name:E.f0.Auth.SignUpPassword,component:Y.A}),c.createElement(ee.Screen,{name:E.f0.Auth.SignUpForm,component:G.A}))};var ne=n(49757),oe=n(61289),re=n(27232),ae=n(54977),le=n(91855),ie=n(78267),se=n(38
1117),ce=n(17171),de=n(14329),ue=n(98808);const me=ue.k$,pe=(0,p.PA)((e=>{let{onActive:t,onIdle:n,onLogout:o}=e;const[r,a]=(0,c.useState)(!1),[i,s]=(0,c.useState)(!1),[d,u]=(0,c.useState)(!1),m=(0,l.P)(),p=(0,c.useRef)(0),g=(0,c.useRef)(0),h=(0,c.useMemo)((()=>["click","keydown","pointerdown"]),[]),v=(0,c.useCallback)((()=>{m.logOut()}),[m]),y=(0,c.useCallback)((()=>{p.current&&(clearTimeout(p.current),p.current=null)}),[]),b=(0,c.useCallback)((()=>{y(),g.current&&clearTimeout(g.current),g.current=setTimeout((()=>{const e=(0,ue.XM)();i?(clearTimeout(g.current),y()):e<me?(b(),t&&t()):(n&&n(),a(!0))}),me)}),[y,i,t,n]),f=(0,c.useCallback)((()=>{if(!i){if((0,ue.XM)()>=me)return s(!0),void v();(0,ue.W0)(),g.current&&(t&&t(),b())}}),[i,v,t,b]),E=(0,c.useCallback)((()=>{h.forEach((e=>{window.addEventListener(e,f)})),b()}),[h,f,b]),C=(0,c.useCallback)((()=>{h.forEach((e=>{window.removeEventListener(e,f)}))}),[h,f]);return(0,c.useEffect)((()=>(E(),()=>{C(),clearTimeout(g.current),y()})),[E,y,C,v,m]),(0,c.useEffect)((()=>{r&&m.userStore.isAuthenticated&&(p.current=setTimeout((()=>{u(!0),a(!1),clearTimeout(g.current),v()}),12e4))}),[r,m.userStore.isAuthenticated,v]),c.createElement(c.Fragment,null,c.createElement(ge,{visible:r&&m.userStore.isAuthenticated,handleContinue:()=>{a(!1),s(!1),b()},handleLogout:()=>{C(),y(),s(!0),o&&o(),a(!1),v()}}),c.createElement(he,{visible:d,onClose:()=>{u(!1)}}))})),ge=e=>{let{visible:t,handleContinue:n,handleLogout:o}=e;const{t:r}=(0,z.Bd)("global"),{sm:a}=(0,ce.Qs)();return t?c.createElement(de.BtAlert,{visible:t,type:"warning",width:a?600:335,onClose:n,verticalButtons:!a,buttons:[{label:r("logOut"),appearance:"outline",style:ve.btnDesktop,onPress:o},{label:r("TimeoutHandler.continue-session"),style:ve.btnDesktop,onPress:n}]},a&&c.createElement(F.hK,{height:20}),c.createElement(se.A,{style:a?ve.titleDesktop:ve.titleMobile},r("TimeoutHandler.session-about-to-expire")),c.createElement(se.A,{style:a?ve.subtitleDesktop:ve.subtitleMobile},r("TimeoutHandler.you-will-be-logged"))):null},he=e=>{let{visible:t,onClose:n}=e;const{t:o}=(0,z.Bd)("global");return t?c.createElement(le.A,{visible:t,onClose:n,style:{alignItems:"center"},backDropAction:!1,animationIn:"fadeIn",animationOut:"fadeOut"},c.createElement(K.A,{style:ve.timeoutInfoWrapper},c.createElement(q.OCj,{stroke:"#EB9928",width:40,height:50}),c.createElement(se.A,{style:ve.sessionExpiredLabel},o("TimeoutHandler.session-expired")),c.createElement(F.eF,{onPress:n},o("TimeoutHandler.login")))):null},ve=ie.A.create({titleDesktop:{color:"#003353",fontSize:28,fontWeight:"600",lineHeight:28,marginBottom:12,textAlign:"center"},titleMobile:{color:"#003353",fontSize:18,fontWeight:"600",lineHeight:28,marginBottom:8,textAlign:"center"},subtitleDesktop:{color:"#003353",fontWeight:"400",fontSize:18,lineHeight:24,marginBottom:46,textAlign:"center"},subtitleMobile:{color:"#668598",fontWeight:"400",fontSize:16,lineHeight:26,textAlign:"center"},btnDesktop:{minWidth:224},timeoutInfoWrapper:{height:235,backgroundColor:"white",width:420,borderRadius:8,overflow:"hidden",alignItems:"center",padding:30,justifyContent:"space-between"},sessionExpiredLabel:{fontSize:16,lineHeight:24}});var ye=n(70509),be=n(4419),fe=n(14425);const Ee=n(62679),{BtScreen:Ce,BtSidebar:Ae,BtModal:Se,Col:we,Row:Pe,BtInput:Ie,BtSelect:xe,BtDropdown:De,BtButton:Te,Spacer:ke,BtText:Be,BtDatePicker:Fe,BtSecureInput_v1:_e,BtCheckBox:Ne,BtMonthYearPicker:Re,BtRadioButton:Le,BtProgress:Me,BtStatus:Oe,BtAlert:ze,BtTitle:je}=ye.ui,We=()=>{const[e,t]=(0,c.useState)(!1),[n,o]=(0,c.useState)(!1);return c.createElement(Ce,{title:"Title",leftTitleAction:c.createElement(Te,{size:"small",onPress:()=>t(!0)},"Sidebar"),rightTitleAction:c.createElement(K.A,{style:{flexDirection:"row"}},c.createElement(Te,{size:"small",appearance:"ghost",onPress:()=>o(!0)},"Modal"),c.createElement(ke,{width:20,height:0}),c.createElement(Te,{size:"small",appearance:"outline",status:"danger"},"action 3"))},c.createElement(Pe,null,c.createElement(we,{sm:6,md:4,xs:12},c.createElement(He,null),c.createElement(Ke,null)),c.createElement(we,{sm:6,md:4,xs:12},c.createElement(Ye,null)),c.createElement(we,{sm:6,md:4,xs:12},c.createElement(qe,null))),c.createElement(Ve,{visible:e,onClose:()=>t(!1)}),c.createElement(Qe,{visible:n,onClose:()=>o(!1)}))},Ve=e=>{let{visible:t,onClose:n}=e;return c.createElement(Ae,{visible:t,title:"Title",onClose:n,footer:c.createElement(K.A,{style:{flexDirection:"row"}},c.createElement(Te,{size:"small",appearance:"ghost",onPress:n},"action 2"),c.createElement(K.A,{style:{flex:1}}),c.createElement(Te,{size:"small",appearance:"outline",status:"danger",onPress:n},"action 3"))},c.createElement(Te,{appearance:"ghost"},"ghost"),c.createElement(ke,{height:5}),c.createElement(Te,{status:"danger"},"danger"),c.createElement(ke,{height:5}),c.createElement(Te,{status:"warning"},"warning"))},He=()=>c.createElement(c.Fragment,null,c.createElement(Be,null,"Buttons"),c.createElement(Te,null,"default"),c.createElement(ke,{height:5}),c.createElement(Te,{appearance:"outline"},"outline"),c.createElement(ke,{height:5}),c.createElement(Te,{appearance:"ghost"},"ghost"),c.createElement(ke,{height:5}),c.createElement(Te,{status:"danger"},"danger"),c.createElement(ke,{height:5}),c.createElement(Te,{status:"warning"},"warning")),Ue=[{value:1,label:"option 1"},{value:2,label:"option 2"},{value:3,label:"option 3"}],Ge=["option 1","option 2","option 3"],Ye=()=>{const[e,t]=(0,c.useState)(""),[n,o]=(0,c.useState)("11/2021");return c.createElement(c.Fragment,null,c.createElement(K.A,{style:{position:"relative"}}
1,c.createElement(K.A,{style:{position:"absolute",right:0,bottom:0,zIndex:1e3}},c.createElement(be.A,{source:Ee.hasOwnProperty("default")?Ee.default:Ee,style:{width:310,height:48,borderBottomRightRadius:5,borderTopRightRadius:5},resizeMode:"contain"}),c.createElement(K.A,{style:{position:"absolute",height:"100%",alignItems:"center",right:10,flexDirection:"row",justifyContent:"center",marginRight:28}},c.createElement(q.XAi,null),c.createElement(Be,{style:{color:"white",fontWeight:"600",fontSize:16,marginLeft:15}},"Encrypted & Secure Data"))),c.createElement(_e,{label:"asdasdsa",placeholder:"asdasdasd",onLayout:e=>console.log(e)})),c.createElement(Ie,{label:"input",value:e,onChangeText:t}),c.createElement(Ie,{label:"input success",status:"success",value:e,onChangeText:t}),c.createElement(Ie,{label:"input warning",status:"warning",value:e,onChangeText:t}),c.createElement(_e,{label:"secured input",value:e,onChangeText:t}),c.createElement(Ie,{label:"input with error",errorText:"here will be the error text",value:e,onChangeText:t}),c.createElement(xe,{label:"select",options:Ue,keyName:"value",labelName:"label"}),c.createElement(xe,{label:"select flat array",primitiveArray:!0,options:Ge,status:"warning"}),c.createElement(xe,{label:"multiselect",options:Ge,multiSelect:!0,primitiveArray:!0}),c.createElement(Fe,{label:"date picker"}),c.createElement(Re,{label:"month year picker",value:n,onChange:o}))},Qe=e=>{let{visible:t,onClose:n}=e;return c.createElement(Se,{visible:t,onClose:n,title:"title",footer:c.createElement(K.A,{style:{flexDirection:"row"}},c.createElement(Te,{size:"small",appearance:"ghost",onPress:n},"Submit"),c.createElement(K.A,{style:{flex:1}}),c.createElement(Te,{size:"small",appearance:"outline",status:"danger",onPress:n},"Delete"))},c.createElement(K.A,{style:{width:350,height:100,alignItems:"center",justifyContent:"center"}},c.createElement(Be,null,"this is content")))},qe=()=>{const[e,t]=(0,c.useState)(!1),[n,o]=(0,c.useState)("radio1");return c.createElement(c.Fragment,null,c.createElement(Ne,{label:"checkbox",checked:e,onPress:()=>t(!e)}),c.createElement(Le,{label:"radio1",checked:"radio1"===n,onPress:()=>o("radio1")}),c.createElement(Le,{label:"radio2",checked:"radio2"===n,onPress:()=>o("radio2")}),c.createElement(ke,null),c.createElement(fe.Divider,null),c.createElement(Be,null,"Progress"),c.createElement(Me.Bar,{progress:.6}),c.createElement(ke,{height:10}),c.createElement(Me.Bar,{indeterminate:!0,borderRadius:0,borderWidth:0,height:8,unfilledColor:"rgba(0, 153, 255, 0.2)",color:"#0099ff",indeterminateAnimationDuration:1500}),c.createElement(ke,null),c.createElement(De,{anchor:c.createElement(Te,{size:"small"},"Dropdown on button"),fullWidth:!0},c.createElement(fe.MenuItem,{onPress:()=>console.log("click"),title:"View more"}),c.createElement(fe.MenuItem,{onPress:()=>console.log("click"),title:"second more"})),c.createElement(ke,null),c.createElement(De,{anchor:c.createElement(Be,null,"Dropdown on Text"),fullWidth:!0},c.createElement(fe.MenuItem,{onPress:()=>console.log("click"),title:"View more"}),c.createElement(fe.MenuItem,{onPress:()=>console.log("click"),title:"second more"})),c.createElement(ke,null),c.createElement(Be,null,"Statuses"),c.createElement(K.A,{style:{justifyContent:"space-between",flexDirection:"row",width:"100%",flexWrap:"wrap"}},c.createElement(Oe,{type:"EXPIRED"}),c.createElement(Oe,{type:"PAID"}),c.createElement(Oe,{type:"PENDING"}),c.createElement(Oe,{type:"DRAFT"}),c.createElement(Oe,{type:"CANCELLED"}),c.createElement(Oe,{type:"FAILED"}),c.createElement(Oe,{type:"PLACED"}),c.createElement(Oe,{type:"DISMISSED"})))},Ke=()=>{const[e,t]=(0,c.useState)(!0);return c.createElement(K.A,null,c.createElement(ke,null),c.createElement(je,null,"Alert"),c.createElement(Te,{onPress:()=>t(!e)},"alert"),c.createElement(ze,{visible:e,onClose:()=>t(!e),title:"Are you sure you want to continue?",width:500,type:"danger",buttons:[{label:"Delete the project",onPress:()=>t(!e),appearance:"outline",status:"danger"},{label:"Go back",onPress:()=>t(!e)}]},c.createElement(Be,{size:18,style:{lineHeight:26,textAlign:"center"},weight:"500"},"The GoodTrace project and all information about it will be permanently deleted without the possibility of recovery")))};var Je=n(21319),Ze=n(78886);const Xe=(0,p.PA)((e=>{let{navigation:t,route:n}=e;const{params:o}=n;(0,Ze.A)(o);const r=(0,$.A)(),{verifier:a,createVerifier:l}=r,[i,s]=(0,c.useState)(null),{setMessage:u}=(0,g.JX)();return(0,c.useEffect)((()=>{a||l()}),[l,a]),(0,c.useEffect)((()=>
1{if(o&&o.phone){const{phone:e}=o;D.A.setLogin(e),D.A.isValidLogin?D.A.checkIsExist().then((e=>{s(e)})):(u(g.$z.ERROR,"Invalid login parameter"),t.navigate(E.f0.Home._self))}}),[t,o,o.phone,u]),(0,c.useEffect)((()=>{if(null!==i&&a)if(i){if(D.A.signIn(a),D.A.canAskOtp){const e=(0,E.oh)((0,E.wl)("Auth.SignInVerify"),{action:"request-credit"});t.replace(e.name,e.params)}}else{Je.A.setValue("phone",null===o||void 0===o?void 0:o.phone),Je.A.setValue("type","password");const e=(0,E.oh)((0,E.wl)("Auth.SignUpForm"),{action:"request-credit"});t.replace(e.name,e.params)}}),[i,t,null===o||void 0===o?void 0:o.phone,a,D.A.canAskOtp]),o&&o.phone?c.createElement(d.A,null):(t.navigate(E.f0.Home._self),null)}));var $e=n(82345),et=n(45143),tt=n(61390),nt=n(64504),ot=n(50763),rt=n(32572),at=n(88626),lt=n(33469);const it=(0,p.PA)((function(e){var t,n,o;let{document:r}=e;const{t:a}=(0,z.Bd)("application"),[l,i]=(0,c.useState)(!1),[s,d]=(0,c.useState)(!0),{isBusy:u,userStore:m}=f.A,{isOptionalStep:p}=et.Ay,{screenWidth:g,sm:h}=(0,ce.Qs)(),v=(0,c.useMemo)((()=>new ot.N(r)),[r]),y=v.getCurrentStep(r),[b,E]=y.split("."),{component:C,title:A,description:S,descriptionStyle:w,canSkip:P=!0,canMoveNext:I=!0,showFooterMessage:x,handleBack:D}=v.findComponentByPath(y)||{};(0,c.useEffect)((()=>{v.getFlowSteps(!0).includes(y)||r.setCurrent("review.review")}),[y,r,v]),(0,c.useEffect)((()=>{"review.agreement"===(null===r||void 0===r?void 0:r.current)&&r.setCurrent("review.review")}),[]);const[T,k]=(0,c.useState)({value:"",filled:!1,group:b,identifier:E}),B=(0,c.useCallback)((e=>{k(e)}),[]),_=(0,c.useCallback)((e=>{d(e)}),[]),N=()=>I&&v.moveToNextStep(T,(0,at.I)(T.group)),R=()=>P&&v.skipToNextStep(T,(0,at.I)(T.group)),L=()=>{D&&D()||(d(!0),v.moveToPreviousStep(T,(0,at.I)(T.group)))},M=v.getFlowSteps(),O=et.Ay.canSubmit(M),j=null===(t=f.A.userStore)||void 0===t||null===(n=t.document)||void 0===n?void 0:n.current,W="review.preview"===j,V=!(null!==T&&void 0!==T&&T.filled)&&!p(j,T.value),H="review.review"===j,U=(0,c.useRef)();(0,c.useEffect)((()=>{var e;null===(e=U.current)||void 0===e||e.scrollTo({y:0,animated:!1})}),[null===r||void 0===r?void 0:r.current]);const G=et.Ay.isGetPaidApplication?a("GetPaidApplication"):et.Ay.isCreditApplication?a("CreditRequest"):et.Ay.isInHouseCreditApplication?a("InHouseCreditApplication",{supplierName:lt.h.getCompanyName(null===(o=m.suppliers)||void 0===o?void 0:o.find((e=>e.id===et.Ay.supplierId)))}):"";return c.createElement(K.A,{style:{flex:1}},c.createElement(nt.Y9,{title:G,sm:h,t:a,skip:P&&s,onClose:()=>i(!0),onSkip:R}),"review.agreement"!==y&&c.createElement(c.Fragment,null,c.createElement(nt.hE,{text:a((0,at.I)(b))}),c.createElement(nt.z2,{progress:v.getProgress()})),c.createElement(rt.A,{ref:U,contentContainerStyle:{flexGrow:1,alignItems:"center"},showsVerticalScrollIndicator:!1},c.createElement(K.A,{style:{paddingHorizontal:h?0:20,paddingVertical:W?0:20,flex:1,minWidth:g>700?700:"100%",maxWidth:g>700?700:void 0}},h&&v.canMoveToPreviousStep()&&c.createElement("div",{style:{position:"sticky",top:0,padding:W?"20px 0":0,zIndex:1e3,backgroundColor:"white"}},c.createElement(nt.oq,{t:a,sm:h,onPress:L})),c.createElement(F.hK,{height:h?20:10}),c.createElement(K.A,null,"review.agreement"!==y?c.createElement(nt.vN,{t:a,sm:h,title:A}):c.createElement("div",{style:{textAlign:"center"}},c.createElement(nt.vN,{t:a,sm:h,title:A}))),c.createElement(K.A,null,c.createElement(nt.VY,{description:S,sm:h,t:a,style:w})),C?c.createElement(C,{doc:r,group:b,item:E,sm:h,onValueUpdate:B,flowController:v,setNavigationVisible:_}):null,s&&c.createElement(nt.O4,{t:a,sm:h,next:I,onNext:N,skip:P&&R,document:r,currentItem:E,disableNext:V,isBusy:u})),s&&c.createElement(nt.me,{t:a,sm:h,next:I,onNext:N,onBack:L,document:r,currentItem:E,disableNext:V,isBusy:u,canSubmit:O,showFooterMessage:x,isReview:H})),l&&c.createElement(nt.ZJ,{onCloseAlert:()=>i(!1),onCloseApplication:()=>{i(!1),v.updateDocument(T,(0,at.I)(T.group)),et.Ay.setCurrentCoOwnerIndex(-1)}}))})),st=(0,p.PA)((function(){var e;const t=(0,$e.useRoute)();return(0,c.useEffect)((()=>{var e;let n;const o=null===(e=t.params)||void 0===e?void 0:e.supplierId;switch(t.name){case E.f0.CreditApplication:n=tt.X.Credit;break;case E.f0.GetPaidApplication:n=tt.X.Supplier;break;case E.f0.InHouseCreditApplication:n=tt.X.InHouseCredit;break;default:throw new Error("Unsupported application type")}et.Ay.loadApplication(n,o)}),[t.name,null===(e=t.params)||void 0===e?void 0:e.supplierId]),et.Ay.loading?c.createElement(d.A,null):c.createElement(it,{document:f.A.userStore.document})}));var ct=n(93894);const dt=e=>{let{children:t}=e;return c.createElement(c.Fragment,null,l.A.branding&&c.createElement(ct.X,{disableHomeLink:!0}),t)};var ut=n(2745),mt=n(6970);class pt{constructor(e){var t,n,o,r;
1this._validator=void 0,this.data=void 0,this.users=void 0,this.initialStep=void 0,this.currentStep=void 0,this.visitedSteps=void 0,this.initialStep=(null===e||void 0===e?void 0:e.initialStep)||"",this.currentStep=(null===e||void 0===e?void 0:e.currentStep)||(null===e||void 0===e?void 0:e.initialStep)||"",this.data={businessInfo:(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.businessInfo)||{},finance:(null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n.finance)||{},coOwners:(null===e||void 0===e||null===(o=e.data)||void 0===o?void 0:o.coOwners)||[],primaryBankAccount:null===e||void 0===e||null===(r=e.data)||void 0===r?void 0:r.primaryBankAccount},this.users=(null===e||void 0===e?void 0:e.users)||[],this.visitedSteps=(null===e||void 0===e?void 0:e.visitedSteps)||[],this._validator=new N.L5(this),(0,ut.makeAutoObservable)(this)}get invitedOwner(){return this.users.find((e=>e.role===mt.y.Owner&&!e.id))}get totalOwnershipPercentage(){const e=this.users.find((e=>e.role===mt.y.Owner)),t=e&&e.ownershipPercentage||0;return this.totalCoOwnersPercentage+t}get totalCoOwnersPercentage(){var e;const t=(null===(e=this.data)||void 0===e?void 0:e.coOwners)||[];return t&&0!==t.length?t.reduce(((e,t)=>e+(t.percentOwned||0)),0):0}validate(e,t){return this._validator.validate(e,t)}}let gt=function(e){return e[e.REVIEW=0]="REVIEW",e[e.PREVIEW=1]="PREVIEW",e[e.AGREEMENT=2]="AGREEMENT",e}({});class ht{constructor(){this._currentStep=gt.REVIEW,this._previousStep=gt.REVIEW,this._isAgreementAccepted=!1,this._isAgreementRead=!0,(0,ut.makeAutoObservable)(this)}get currentStep(){return this._currentStep}set currentStep(e){this._previousStep=this._currentStep,this._currentStep=e}get isAgreementAccepted(){return this._isAgreementAccepted}set isAgreementAccepted(e){this._isAgreementAccepted=e}get isAgreementRead(){return this._isAgreementRead}set isAgreementRead(e){this._isAgreementRead=e}moveBack(){return this._currentStep!==gt.REVIEW&&(this._currentStep=this._previousStep,!0)}}var vt=n(35866);class yt{constructor(e){this._id="",this._type=vt.H.INDIVIDUAL,this._percentOwned=0,this._address="",this._city="",this._state="",this._zip="",this._phone="",this._email="",this._firstName="",this._lastName="",this._birthday="",this._ssn="",this._entityName="",this._ein="",e&&Object.assign(this,e),(0,ut.makeAutoObservable)(this)}get id(){return this._id}set id(e){this._id=e}get type(){return this._type}set type(e){this.setType(e)}get percentOwned(){return this._percentOwned}set percentOwned(e){this._percentOwned=e}get address(){return this._address}set address(e){this._address=e}get city(){return this._city}set city(e){this._city=e}get state(){return this._state}set state(e){this._state=e}get zip(){return this._zip}set zip(e){this._zip=e}get phone(){return this._phone}set phone(e){this.setPhone(e)}get email(){return this._email}set email(e){this.setEmail(e)}get firstName(){return this._firstName}set firstName(e){this.setFirstName(e)}get lastName(){return this._lastName}set lastName(e){this.setLastName(e)}get birthday(){return this._birthday}set birthday(e){this.setBirthday(e)}get ssn(){return this._ssn}set ssn(e){this.setSSN(e)}get entityName(){return this._entityName}set entityName(e){this.setEntityName(e)}get ein(){return this._ein}set ein(e){this.setEIN(e)}setType(e){e===vt.H.ENTITY?(this._firstName="",this._lastName="",this._birthday="",this._ssn=""):(this._entityName="",this._ein=""),this._type=e}setPercentage(e){this._percentOwned=e}setPhone(e){this._phone=e}setEmail(e){this._email=e}setFirstName(e){this._firstName=e}setLastName(e){this._lastName=e}setBirthday(e){this._birthday=e}setSSN(e){this._ssn=e}setEntityName(e){this._entityName=e}setEIN(e){this._ein=e}}var bt=n(63913);class ft{constructor(){this.coOwners=[],this._currentCoOwner=null,(0,ut.makeAutoObservable)(this)}get currentCoOwner(){return this._currentCoOwner}createNew(){this._currentCoOwner=new yt({id:(0,bt.A)()})}edit(e){this._currentCoOwner=new yt((0,ut.toJS)(e))}save(e){var t,n;if(!this._currentCoOwner)return;null!==(t=e.data)&&void 0!==t&&t.coOwners||(e.data.coOwners=[]);const o=null===(n=e.data)||void 0===n?void 0:n.coOwners.findIndex((e=>{var t;return e.id===(null===(t=this._currentCoOwner)||void 0===t?void 0:t.id)})),r=(0,ut.toJS)(this._currentCoOwner),a=new yt(r);-1!==o?e.data.coOwners[o]=a:e.data.coOwners.push(a),this._currentCoOwner=null}cancelEdit(){this._currentCoOwner=null}remove(e){const t=this.coOwners.findIndex((t=>t.id===e.id));this.coOwners.splice(t,1)}}var Et=n(61009),Ct=n(31259),At=n(61043),St=n(38498);class wt{constructor(){this.definition=[(0,Ct.Y)("businessInfo.firstStepChoice",(e=>null===e||void 0===e?void 0:e.initialStep)),Et.g.businessInfo.email,Et.g.businessInfo.category,(0,Ct.Y)("businessInfo.categoryflowChoice",(e=>{var t,n;return(null===(t=e.data)||void 0===t||null===(n=t.businessInfo)||void 0===n?void 0:n.category)===L.In.SUB_CONTRACTOR?Et.g.businessInfo.trade:Et.g.businessInfo.businessName})),Et.g.businessInfo.trade,Et.g.businessInfo.businessName,Et.g.businessInfo.businessPhone,Et.g.businessInfo.businessAddress,(0,Ct.Y)("businessInfo.businessAddressChoice",((e,t)=>
1t.type===tt.X.InHouseCredit?Et.g.businessInfo.type:Et.g.businessInfo.startDate)),Et.g.businessInfo.startDate,Et.g.businessInfo.type,Et.g.businessInfo.ein,Et.g.finance.revenue,(0,Ct.Y)("finance.revenueChoice",((e,t)=>t.type===tt.X.InHouseCredit?Et.g.bank.primaryAccount:Et.g.finance.debt)),Et.g.finance.debt,(0,Ct.Y)("finance.debtChoice",((e,t)=>t.type===tt.X.Supplier?Et.g.finance.arAdvanceRequestedLimit:Et.g.finance.creditLimit)),Et.g.finance.creditLimit,(0,Ct.Y)("finance.gotoBusinessOwner",(()=>"businessOwner.alreadySubmittedflowChoice")),Et.g.finance.arAdvanceRequestedLimit,(0,Ct.Y)("businessOwner.alreadySubmittedChoice",((e,t)=>this.hasSupplierAppSubmitted(t)?Et.g.businessOwner.address:Et.g.businessOwner.isOwner)),Et.g.businessOwner.isOwner,(0,Ct.Y)("businessOwner.isOwnerChoice",((e,t)=>this.isOwner(e,t)?Et.g.businessOwner.ownershipPercentage:Et.g.businessOwner.isAuthorized)),Et.g.businessOwner.ownershipPercentage,(0,Ct.Y)("businessOwner.goToOwnerAddress",(()=>Et.g.businessOwner.address)),Et.g.businessOwner.isAuthorized,(0,Ct.Y)("businessOwner.isAuthorizedChoice",((e,t)=>this.isAuthorized(e,t)?Et.g.businessOwner.address:Et.g.businessOwner.authorizedDetails)),Et.g.businessOwner.authorizedDetails,Et.g.businessOwner.address,Et.g.businessOwner.birthdate,Et.g.businessOwner.ssn,(0,Ct.Y)("coOwners.coOwnersChoice",((e,t)=>this.canEditCoOwners(e,t)?Et.g.coOwners.coOwners:Et.g.bank.primaryAccount)),Et.g.coOwners.coOwners,Et.g.bank.primaryAccount,Et.g.review.review]}isOwner(e,t){return e.users.some((e=>e.id===t.userId&&e.role===mt.y.Owner))}isAuthorized(e,t){return e.users.some((e=>e.id===t.userId&&e.role===mt.y.Authorized))}hasSupplierAppSubmitted(e){return[St.s4.Applied,St.s4.Approved,St.s4.Rejected].includes(e.companyStatus)}canEditCoOwners(e,t){var n;const o=e.users.find((e=>e.id===t.userId&&e.role===mt.y.Owner)),r=100-((null===o||void 0===o?void 0:o.ownershipPercentage)||0)>=At.Q.MinCoOwnerPercentage,a=(null===(n=e.data.coOwners)||void 0===n?void 0:n.length)>0;return r||a}}class Pt{constructor(){var e;this._flow=new wt,this._flowController=void 0,this._applicationOptions=void 0,this._stepOptions={},this._draft=void 0,this._previousStep="",this._isSubmitting=!1,this._reviewStore=new ht,this._coOwnersStore=new ft,this._isPrimaryBankAccountChanged=!1,this._currentUser=void 0,this._flow=new wt,this._draft=new pt,this._flowController=new Ct.N(this._flow.definition),this._applicationOptions={type:tt.X.Credit,userId:f.A.userStore.user.id,companyStatus:(null===(e=f.A.userStore.company)||void 0===e?void 0:e.status)||N.s4.New},(0,ut.makeAutoObservable)(this)}get reviewStore(){return this._reviewStore}get coOwnersStore(){return this._coOwnersStore}get currentStep(){var e;return(null===(e=this._draft)||void 0===e?void 0:e.currentStep)||""}get previousStep(){return this._previousStep}get currentGroup(){var e;return((null===(e=this._draft)||void 0===e?void 0:e.currentStep)||"").split(".")[0]||""}get draft(){return this._draft}get type(){return this._applicationOptions.type}get currentUserId(){if(!this.currentUser.id)throw new Error("Current draft user is not initialized");return this.currentUser.id}get isSupplierApp(){return this._applicationOptions.type===tt.X.Supplier}get isCreditApp(){return this._applicationOptions.type===tt.X.Credit}get isInHouseCreditApp(){return this._applicationOptions.type===tt.X.InHouseCredit}get isOwner(){return this.currentUser.role===mt.y.Owner}get isAuthorized(){return this.currentUser.role===mt.y.Authorized}get currentUser(){return this._currentUser}get isCurrentStepValid(){return!!this.currentStep&&this.validateStep(this.currentStep)}get isInReview(){return this.currentStep===Et.g.review.review}get hasSubmissionRights(){return!0}get canGoBack(){if(!this._stepOptions.canGoBack)return!1;const e=this._flowController.getFirstStep(this._draft,this._applicationOptions);return this.currentStep!==e||this._draft.visitedSteps.includes(Et.g.review.review)}get canSubmit(){const e=this.getFlowSteps().every((e=>this._draft.validate(e,this._applicationOptions))),t=this.isSupplierApp||this.isCreditApp;return this.hasSubmissionRights&&e&&this.reviewStore.isAgreementAccepted&&(!t||this.reviewStore.isAgreementRead)}get isSubmitting(){return this._isSubmitting}get stepOptions(){return this._stepOptions}get isPrimaryBankAccountChanged(){return this._isPrimaryBankAccountChanged}setCurrentStep(e){this._previousStep===Et.g.review.review&&e!==Et.g.review.review&&(this.reviewStore.currentStep=gt.REVIEW),this._previousStep=this.currentStep,this._draft.currentStep=e}setStepOptions(e){var t,n,o,r;this._stepOptions={...e,canGoBack:null===(t=null===e||void 0===e?void 0:e.canGoBack)||void 0===t||t,canSkip:null===(n=null===e||void 0===e?void 0:e.canSkip)||void 0===n||n,showGroupTitle:null===(o=null===e||void 0===e?void 0:e.showGroupTitle)||void 0===o||o,showNavigationButtons:null===(r=null===e||void 0===e?void 0:e.showNavigationButtons)||void 0===r||r}}setIsPrimaryBankAccountChanged(e){this._isPrimaryBankAccountChanged=e}setPrimaryBankAccount(e){const t=(0,ut.toJS)(e);this._applicationOptions.bankAccount=t,this._draft.data.primaryBankAccount=t}goToStep(e){this._previousStep=this.currentStep,this._draft.currentStep=e}moveNext(){const e=this._flowController.getNextStep(this.currentStep,this._draft,this._applicationOptions);this.updateVisitedSteps(e),this.setCurrentStep(e)}moveBack(){let e=this._flowController.getPreviousStep(this.currentStep,this._draft,this._applicationOptions);e===this.currentStep&&(e=Et.g.review.review),this.setCurrentStep(e)}tryReturnToReview(){this._previousStep===Et.g.review.review&&this.setCurrentStep(Et.g.review.review)}skipStep(){const e=this._flowController.findNextStep(this.currentStep,this._draft,this._applicationOptions);this.updateVisitedSteps(e),this.setCurrentStep(e)}getFlowSteps(){return this._flowController.getFlowSteps(this._draft,this._applicationOptions).filter((e=>e!==Et.g.review.review))}getFlowGroups(){return this._flowController.getFlowGroups(this._draft,this._applicationOptions).filter((e=>e!==Et.Z.review))}getGroupSteps(e){return this._flowController.getGroupSteps(e,this._draft,this._applicationOptions)}validateStep(e){return this._draft.validate(e,this._applicationOptions)}editGroup(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.getGroupSteps(e),o=n.findIndex((e=>!this.validateStep(e)));if(t||0===o||-1===o){const t=this._flowController.getFirstGroupStep(e,this._draft,this._applicationOptions);this.setCurrentStep(t)}else{const e=n[o];this.setCurrentStep(e)}}async loadDraft(){var e,t;const n=null===(e=f.A.userStore.company)||void 0===e?void 0:e.id;if(!n)return;this._applicationOptions={type:tt.X.Credit,userId:f.A.userStore.id,companyStatus:(null===(t=f.A.userStore.company)||void 0===t?void 0:t.status)||N.s4.New};const o=await N.Vv.pW.getUnifiedApplicationDraft({companyId:n});if(o.draft){this._draft=new pt(o.draft);const e=f.A.screensStore.paymentMethodsStore.paymentMethods.find((e=>{var t,n;return e._id===(null===(t=this._draft.data)||void 0===t||null===(n=t.primaryBankAccount)||void 0===n?void 0:n._id)}));this._applicationOptions.bankAccount=(0,ut.toJS)(e);this.getFlowSteps().includes(this.currentStep)||(this._draft.currentStep=Et.g.review.review,this._previousStep=Et.g.review.review)}else{const e=Et.g.businessInfo.email;this._draft=new pt({initialStep:e,currentStep:e,data:{businessInfo:{businessName:{}},finance:{},coOwners:[]},users:[],visitedSteps:[]}),console.log("new unified application, initial step",e)}return this.ensureCurrentUser(),Promise.resolve()}async saveDraft(){return console.log("saving draft",(0,ut.toJS)(this.draft)),Promise.resolve()}async submitApplication(){return this._isSubmitting=!0,this._isSubmitting=!1,Promise.resolve()}ensureCurrentUser(){const e=this._applicationOptions.userId;let t=this._draft.users.find((t=>t.id===e));var n,o,r;t||(t=(0,ut.observable)({id:e,firstName:(null===(n=f.A.userStore.user)||void 0===n?void 0:n.firstName)||"",lastName:(null===(o=f.A.userStore.user)||void 0===o?void 0:o.lastName)||"",email:(null===(r=f.A.userStore.user)||void 0===r?void 0:r.email)||""}),this._draft.users.push(t));this._currentUser=t}updateVisitedSteps(e){const t=e===Et.g.review.review?e:this.currentStep;this._draft.visitedSteps.includes(t)||this._draft.visitedSteps.push(t)}}const It=(0,c.createContext)(null),xt=e=>{let{children:t}=e;const[n]=(0,c.useState)((()=>new Pt));return c.createElement(It.Provider,{value:n},t)},Dt=(0,a.PA)((()=>{var e;const{userStore:t}=(0,l.P)(),n=(null===(e=t.company)||void 0===e?void 0:e.status)||N.s4.New,o=t.settings.get("approveRead");return[N.s4.New,N.s4.NotStarted].includes(n)&&o?c.createElement(xt,null,c.createElement(dt,null,c.createElement(st,null))):null}));var Tt=n(51567),kt=n(38938),Bt=n(4670);const Ft=(0,p.PA)((e=>{let{title:t,onBack:n,onClose:o,children:r}=e;return c.createElement(de.BtScreen,{title:t,titleCentered:!0,rightTitleAction:!!o&&c.createElement(Bt.A,{style:_t.button,onPress:o},c.createElement(q.tz0,{width:12,height:12})),leftTitleAction:!!n&&c.createElement(Bt.A,{style:_t.button,onPress:n},c.createElement(q.MNv,{width:12,height:12,fill:"#335C75"}))},c.createElement(K.A,{style:_t.contentWrapper},r))})),_t=ie.A.create({button:{borderColor:"#E6EBEE",borderRadius:6,borderWidth:1,alignItems:"center",justifyContent:"center",width:40,height:40},contentWrapper:{maxWidth:500,alignSelf:"center",alignItems:"center"}}),Nt=(0,p.PA)((e=>{let{invoices:t,selectedPlan:n,paymentOptions:o,onSelect:r,onContinue:a,onClose:l}=e;const{t:i}=(0,z.Bd)("application"),s=f.A.userStore.document,d=o.plans.some((e=>e.metadata.frequency===L.X7.SINGLE));return c.createElement(Ft,{title:i("CreditRequestPaymentPlan.title"),onClose:l},c.createElement(de.QG,{style:Rt.heading},i("ChooseAPaymentPlan.Heading")),!d&&o.plans.length?c.createElement(de.QG,{style:Rt.subHeading},i("ChooseAPaymentPlan.SubHeading")):null,c.createElement(kt.x,{paymentPlans:o.plans,downPaymentSettings:o.downPaymentSettings,selectedPlan:n,onSelect:e=>{r(e)}}),c.createElement(K.A,{style:Rt.continueButtonWrapper},c.createElement(Tt.P,{onPress:()=>{n&&N.JZ.kQ.updatePlan(t.map((e=>e._id)),n.id,null===s||void 0===s?void 0:s.loanApplicationId).then(a)},buttonStyle:Rt.continueButton,loading:f.A.isBusy,disabled:f.A.isBusy||!n},i("Continue"))))})),Rt=ie.A.create({heading:{marginTop:40,fontWeight:"600",fontSize:16,lineHeight:24,alignSelf:"center"},subHeading:{marginTop:4,marginBottom:9,fontWeight:"500",fontSize:12,lineHeight:20,color:"#335C75",width:250,textAlign:"center"},continueButtonWrapper:{width:"100%",alignItems:"flex-end",marginVertical:30},continueButton:{width:150}});var Lt=n(4109),Mt=n(61774),Ot=n(34956);
1const zt=e=>{let{downPayment:t,paymentMethod:n,onBack:o,onClose:r,onContinue:a}=e;const{t:l}=(0,z.Bd)("global"),{canUsePaymentMethod:i}=(0,Ot.mu)(),[s,d]=(0,c.useState)({method:Mt.G.Card,accountId:"",...n}),u=s.method===Mt.G.Wire||i(s.accountId);return c.createElement(Ft,{title:l("payInvoice.pay-invoice"),onBack:o,onClose:r},c.createElement(K.A,{style:jt.wrapper},c.createElement(Lt.l,{downPayment:t,paymentMethod:s,onChange:d})),c.createElement(de.BtButton,{disabled:!u,onPress:()=>a(s),style:jt.continueButton,testID:"down-payment-step-continue-button"},l("DownPaymentModal.continue")))},jt=ie.A.create({wrapper:{marginTop:38},continueButton:{width:120,marginTop:32,alignSelf:"flex-end"}});var Wt=n(70618),Vt=n(12743);const Ht=e=>{let{invoiceIds:t,paymentPlan:n,downPayment:o,paymentOptions:r,onSuccess:a,onBack:l,onClose:i}=e;const{t:s}=(0,z.Bd)("global"),{sm:d}=(0,ce.Qs)(),u=(0,$e.useNavigation)();return c.createElement(Ft,{title:s("payInvoice.pay-invoice"),onBack:l,onClose:i},c.createElement(F.hK,{height:38}),c.createElement(Wt.J,{invoiceIds:t,paymentPlan:n,downPaymentMethod:o,paymentOptions:r}),c.createElement(F.hK,{height:d?38:20}),c.createElement(K.A,{style:{marginLeft:"auto"}},c.createElement(Vt.N,{invoiceIds:t,paymentPlan:n,downPayment:o,paymentOptions:r,navigation:u,onSuccess:a})),c.createElement(F.hK,{height:30}))};var Ut=n(79148),Gt=n(85825);const Yt=(0,p.PA)((e=>{let{onClose:t}=e;const{t:n}=(0,z.Bd)("global"),{t:o}=(0,z.Bd)("application");return c.createElement(Ft,{title:o("CreditRequestPaymentPlan.title"),onClose:t},c.createElement(K.A,{style:Qt.loadingView},c.createElement(Gt.I,{maxWidth:32}),c.createElement(de.QG,{style:Qt.loadingText},n("CreditApplication.LoadingPlans"))))})),Qt=ie.A.create({loadingText:{fontWeight:"500"},loadingView:{flexDirection:"row",gap:10,minHeight:250,alignItems:"center",justifyContent:"center"}});var qt=function(e){return e[e.Loading=0]="Loading",e[e.PaymentPlan=1]="PaymentPlan",e[e.DownPayment=2]="DownPayment",e[e.Payment=3]="Payment",e}(qt||{});const Kt=e=>{let{invoices:t,onClose:n,onSuccess:o}=e;const{step:r,goTo:a,goNext:l,goBack:i}=(0,Ot.qM)(qt);(0,c.useEffect)((()=>{const{paymentMethodsStore:e}=f.A.screensStore;e.primaryCreditMethod||e.loading||e.fetchPaymentMethods()}),[]);const[s,d]=(0,c.useState)(null),[u,m]=(0,c.useState)(null),p=t.map((e=>e._id)),g=t.reduce(((e,t)=>e+t.total_amount),0),{response:h}=(0,Ut.g)({api:()=>{var e;return N.Vv._8.creditPaymentOptions({invoiceId:null===(e=t[0])||void 0===e?void 0:e._id,totalAmount:g})},onSuccess:()=>a(qt.PaymentPlan)}),v=null===h||void 0===h?void 0:h.downPaymentSettings.isRequired;return c.createElement(c.Fragment,null,r===qt.Loading&&c.createElement(Yt,{onClose:n}),r===qt.PaymentPlan&&h&&c.createElement(Nt,{invoices:t,selectedPlan:s,paymentOptions:h,onSelect:d,onContinue:()=>a(v?qt.DownPayment:qt.Payment),onClose:n}),r===qt.DownPayment&&h&&s&&c.createElement(zt,{downPayment:s.downPayment,paymentMethod:u,onContinue:e=>{m(e),l()},onBack:i,onClose:n}),r===qt.Payment&&h&&s&&c.createElement(Ht,{invoiceIds:p,paymentOptions:h,paymentPlan:s,downPayment:u,onSuccess:o,onBack:()=>a(v?qt.DownPayment:qt.PaymentPlan),onClose:n}))},Jt=(0,a.PA)((()=>{const{setPayAndSubmitApplication:e,invoiceDetails:t,submissionStage:n}=et.Ay,o=(0,$e.useNavigation)();e(!0);const r=()=>{et.Ay.adjustFinalStep(),et.Ay.setSubmissionStage(et.Xt.APPLICATION)};return c.createElement(xt,null,c.createElement(dt,null,c.createElement(c.Fragment,null,n===et.Xt.APPLICATION&&c.createElement(st,null),n===et.Xt.PAYMENT&&c.createElement(Kt,{invoices:t,onClose:r,onSuccess:()=>{r(),o.navigate(E.f0.Console._self)}}))))}));var Zt=n(41436),Xt=n(12344),$t=n(32260),en=n(88459),tn=n(92147),nn=n(70764),on=n(56480),rn=n(50767),an=n(97219),ln=n(4557),sn=n(83639),cn=n(14344),dn=n(61699),un=n(51599),mn=n(23588),pn=n(36684);const gn="PublicPageShell_viewport__FDeWc",hn="PublicPageShell_scroll__ULwIg",vn="PublicPageShell_root__Y1vlD",yn="PublicPageShell_toolbar__pXwom",bn="PublicPageShell_back__r5B9d",fn="PublicPageShell_title__lCSUR",En="PublicPageShell_footer__-dm7n",Cn=e=>{let{onBack:t,title:n,footer:o,children:r}=e;const{t:a}=(0,z.Bd)("global");return c.createElement(rn.a,{className:gn},c.createElement(rn.a,{className:hn,"data-testid":"publicPageScroll"},c.createElement(nn.B,{className:vn,gap:12},c.createElement(un.Y,{className:yn,justify:"center"},!!t&&c.createElement(mn.M,{className:bn,variant:"subtle","aria-label":a("back"),onClick:t},c.createElement(pn.A,{size:20})),c.createElement(on.E,{className:fn},null!==n&&void 0!==n?n:a("InvoiceDetails.title"))),r)),!!o&&c.createElement(rn.a,{className:En,"data-testid":"publicPageFooter"},o))},An="ReceiptSummary_header__0AnCl",Sn="ReceiptSummary_successIcon__9I7wV",wn="ReceiptSummary_headerText__dcEo8",Pn="ReceiptSummary_card__3klCW",In="ReceiptSummary_name__oH7lX",xn="ReceiptSummary_amount__6yNhj",Dn="ReceiptSummary_amountLabel__8BSna",Tn="ReceiptSummary_collected__j6rsr",kn=e=>{let{receipt:t,onViewAttachment:n,onSignIn:r}=e;const{t:a}=(0,z.Bd)("global"),{supplier:l,invoice:i,payment:s,customerHasAccount:d}=t,u=a("InvoiceReceipt.invoice-number",{number:i.invoiceNumber}),m=s.displayName||s.accountNumber||"",p=[{label:c.createElement(nn.B,{gap:6,align:"flex-start"},c.createElement(on.E,{className:In},l.name),c.createElement(o.x1,{phone:l.phone})),value:c.createElement(nn.B,{gap:6,align:"flex-end"},c.createElement(on.E,{className:xn},(0,dn.zQ)(i.amountPaid)),c.createElement(on.E,{className:Dn},a("InvoiceReceipt.AmountPaid")))},i.status===L.uR.collected&&{label:a("InvoiceReceipt.status"),value:c.createElement(on.E,{className:Tn},a("InvoiceReceipt.collected-by-supplier"))},{label:i.hasAttachment?c.createElement(o.t5,{leftSection:c.createElement(rn.a,{mt:-2},c.createElement(sn.A,{size:20})),onClick:n},u):u,value:i.dueDate?a("InvoiceReceipt.due-on",{date:i.dueDate}):null},...Bn(i,a),{label:a("InvoiceReceipt.payment_method"),value:m},!!s.paidOn&&{label:a("InvoiceReceipt.paid_on"),value:s.paidOn}];return c.createElement(Cn,{title:a("InvoiceReceipt.payment_details")},c.createElement(nn.B,{align:"center",gap:12,className:An},c.createElement(cn.A,{size:64,className:Sn}),c.createElement(on.E,{className:wn},a("InvoiceReceipt.payment-collected-by-supplier"))),c.createElement(an.Z,{className:Pn,withBorder:!0},c.createElement(o.YX,{items:p})),c.createElement(ln.$,{fullWidth:!0,onClick:r},a(d?"InvoiceReceipt.login":"InvoiceReceipt.signup")))},Bn=(e,t)=>e.addressType===N.nT.DELIVERY?[{label:t("InvoiceDetails.deliver-to"),value:e.address}]:e.addressType===N.nT.PICKUP?[{label:t("InvoiceDetails.pick-up"),value:null}]:[];var Fn=n(96557),_n=n(92985);const Nn={flex:1,width:"100%",height:"100%",margin:0},Rn=(0,a.PA)((e=>{let{invoiceId:t,customerHasAccount:n,customerPrefill:o,opened:r,onClose:a,navigation:i,route:s}=e;const d=(0,l.P)(),u=m.A.get("session"),p=!!(b.HZ&&u||d.userStore.isAuthenticated),g=!!d.userStore.settings.get("onboarding");return(0,c.useEffect)((()=>{r&&(D.A.setCodeVerifier(!1),D.A.setCanAskPassword(!1),_n.Y.canOfferSignIn(o,n)?D.A.setLogin(o.email):Je.A.setUpInvoiceLinkSignup(_n.Y.toSignupCustomer(t,o)))}),[r,n,o,t]),(0,c.useEffect)((()=>
1{if(!r||!p||!g)return;a();const e=(0,E.oh)((0,E.wl)("Console.Payables.Receipt"),{id:t});null===i||void 0===i||i.replace(e.name,e.params)}),[r,p,g,t,i,a]),!r||p&&g?null:c.createElement(le.A,{visible:!0,onClose:a,style:Nn},c.createElement(Fn.c,{invoice:_n.Y.toWizardInvoice(t,o,n),onClose:a,navigation:i,route:s}))})),Ln="CollectedPaymentReceipt_loading__yt9Wo",Mn=e=>{let{route:t,navigation:n}=e;const r=On(null===t||void 0===t?void 0:t.params),a=(0,en.X)(),[l,i]=(0,c.useState)(!1),{data:s,isPending:d,isError:u}=(0,Xt.I)($t.o.collectedPaymentReceipt(null!==r&&void 0!==r?r:{},{enabled:!!r,retry:!1}));if((0,c.useEffect)((()=>{if(!s||!a)return;const e=(0,E.oh)((0,E.wl)("Console.Payables.Receipt"),{id:s.invoice.id});null===n||void 0===n||n.replace(e.name,e.params)}),[s,a,n]),!r||u)return c.createElement(tn.G,null);if(d||!s||a)return c.createElement(Zt.o,{className:Ln},c.createElement(o.aC,null));return c.createElement(c.Fragment,null,c.createElement(kn,{receipt:s,onViewAttachment:()=>{const e=s.invoice.attachmentToken;e&&N.Vv.NJ.invoiceDocument({token:e}).then((e=>{let{url:t}=e;window.open(t,"_blank")}))},onSignIn:()=>i(!0)}),c.createElement(Rn,{invoiceId:s.invoice.id,customerHasAccount:s.customerHasAccount,customerPrefill:s.customerPrefill,opened:l,onClose:()=>i(!1),navigation:n,route:t}))},On=e=>null!==e&&void 0!==e&&e.token?{token:e.token}:null!==e&&void 0!==e&&e.id?{id:e.id}:null;var zn=n(88333);const jn=(0,a.PA)((()=>c.createElement(xt,null,c.createElement(dt,null,c.createElement(st,null)))));var Wn=n(46705),Vn=n(25128),Hn=n(48328);const Un=ie.A.create({wrapper:{alignSelf:"center",alignItems:"center"},link:{fontWeight:"700",color:"#00A0F3",textDecorationLine:"underline"},title:{fontFamily:"Inter",fontSize:28,fontWeight:"700",textAlign:"center"},message:{fontFamily:"Inter",fontSize:18,fontWeight:"500",lineHeight:26,textAlign:"center",marginTop:35},button:{width:350,alignSelf:"center",marginTop:35}}),Gn=()=>{const{t:e}=(0,z.Bd)("global"),{sm:t}=(0,ce.Qs)();return c.createElement(K.A,{style:[Un.wrapper,{width:t?590:350}]},c.createElement(q.F3K,{width:200,height:200}),c.createElement(P.A,{style:Un.title},e("DocumentApproval.agreement-submitted-title")),c.createElement(P.A,{style:Un.message},e("DocumentApproval.agreement-submitted-message")),c.createElement(F.hK,{height:36}),c.createElement(de.BtButton,{size:"large",style:{width:250},onPress:()=>window.location.replace(L.DS.SignUp)},e("DocumentApproval.setup-account")))};var Yn=n(40046);let Qn=function(e){return e.AlreadyApproved="document_already_approved",e.TokenExpired="approval_token_expired",e.UnhandledError="unhandled",e}({});const qn=e=>{let{errorCode:t}=e;const{t:n}=(0,z.Bd)("global"),{sm:o}=(0,ce.Qs)(),r=t===Qn.TokenExpired?"DocumentApproval.approval-expired-title":"DocumentApproval.approval-error-title",a=t===Qn.TokenExpired?"DocumentApproval.approval-expired-message":"DocumentApproval.approval-error-message";return c.createElement(K.A,{style:[Un.wrapper,{width:o?590:350}]},c.createElement(q.KDJ,null),c.createElement(P.A,{style:Un.title},n(r)),c.createElement(P.A,{style:Un.message},c.createElement(z.x6,{t:n,i18nKey:a,components:{email:c.createElement(P.A,{onPress:()=>Yn.A.openURL("mailto:[email protected]"),style:{fontWeight:"600",color:"#00A0F3"}},"[email protected]")}})))};var Kn=n(94790);const Jn=e=>{let{title:t,children:n}=e;const{sm:o}=(0,ce.Qs)();return c.createElement(c.Fragment,null,c.createElement(K.A,{style:Zn.container},o?c.createElement(Bt.A,{onPress:()=>Yn.A.openURL(L.DS.BT),style:Zn.logo},c.createElement(q.gkA,{width:o?163:122,height:o?20:16})):null,c.createElement(se.A,{style:Zn.title},t)),c.createElement(rt.A,{style:{width:o?880:370,alignSelf:"center",marginTop:35}},n))},Zn=ie.A.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"center",width:"100%",position:"relative",padding:20,borderBottomWidth:1,borderColor:"#EBEEEF"},logo:{left:20,position:"absolute"},title:{fontFamily:"Inter, sans-serif",fontWeight:"600",fontSize:20,textAlign:"center"}});var Xn=n(60236);const $n=e=>{var t,n;let{route:o}=e;const{t:r}=(0,z.Bd)("global"),{sm:a}=(0,ce.Qs)(),[l,i]=(0,c.useState)(),[s,d]=(0,c.useState)(),[u,m]=(0,c.useState)(),[p,g]=(0,c.useState)(!1),[h,v]=(0,c.useState)(!1),[y,b]=(0,c.useState)(!1),[f,E]=(0,c.useState)(null),C=null===o||void 0===o||null===(t=o.params)||void 0===t?void 0:t.token;(0,c.useEffect)((()=>
1{if(C)try{const e=(0,Wn.A)(C);e.documentId&&e.approvalId?(i({...e}),g(!0),Promise.all([N.JZ.bc.publicMasterAgreement(C),N.JZ.bc.publicPersonalGuarantorAgreement(C)]).then((e=>{let[t,n]=e;d(t),m(n)})).catch((()=>E(Qn.UnhandledError))).finally((()=>g(!1)))):E(Qn.UnhandledError)}catch{E(Qn.UnhandledError)}else E(Qn.UnhandledError)}),[C]);return c.createElement(Jn,{title:r("DocumentApproval.credit.header")},f?c.createElement(qn,{errorCode:f}):y?c.createElement(Gn,null):c.createElement(K.A,{style:{alignItems:"center"}},c.createElement(F.hK,{height:35}),null!==s&&void 0!==s&&s.url?c.createElement(Xn.A,{pdfUrl:s.url}):c.createElement(K.A,{style:{...eo.docViewer,width:a?"100%":350}}),c.createElement(F.hK,{height:35}),c.createElement(se.A,{style:Un.title},c.createElement(z.x6,{t:r,i18nKey:"DocumentApproval.credit.title",values:{company:null!==(n=null===l||void 0===l?void 0:l.companyName)&&void 0!==n?n:"..."}})),p?c.createElement(K.A,{style:eo.spinner},c.createElement(fe.Spinner,null)):c.createElement(se.A,{style:Un.message},c.createElement(z.x6,{t:r,i18nKey:null!==u&&void 0!==u&&u.url?"DocumentApproval.credit.individualOwnerMessage":"DocumentApproval.credit.entityOwnerMessage",components:{tradeCredit:c.createElement(se.A,{style:Un.link,onPress:()=>{l&&Hn.A.downloadMasterAgreementWithJwt(C)}}),pga:c.createElement(se.A,{style:Un.link,onPress:()=>{null!==l&&void 0!==l&&l.ownerId&&Hn.A.downloadPersonalGuarantorAgreementWithJwt(C)}}),customer:c.createElement(se.A,{style:Un.link,onPress:Hn.A.downloadCustomerAgreement}),terms:c.createElement(se.A,{style:Un.link,onPress:()=>(0,Vn.Yx)(L.DS.TC)}),privacy:c.createElement(se.A,{style:Un.link,onPress:()=>(0,Vn.Yx)(L.DS.PP)})}})),c.createElement(de.BtButton,{size:"large",style:Un.button,disabled:h||p,onPress:async()=>{try{var e;v(!0);const t=await(0,Kn.v4)();await N.JZ.bc.approveCreditAgreements(null===o||void 0===o||null===(e=o.params)||void 0===e?void 0:e.token,t),b(!0)}catch(t){t.code===Qn.AlreadyApproved?b(!0):E(t.code)}finally{v(!1)}}},r("DocumentApproval.submit"))))},eo={docViewer:{height:400,backgroundColor:"white",marginTop:-50,padding:15,border:"20px solid #f8f9f9",borderRadius:20,borderBottom:0},spinner:{marginTop:25}},to=e=>{var t,n;let{route:o}=e;const{t:r}=(0,z.Bd)("global"),{sm:a}=(0,ce.Qs)(),[l,i]=(0,c.useState)(),[s,d]=(0,c.useState)(),[u,m]=(0,c.useState)(!1),[p,g]=(0,c.useState)(!1),[h,v]=(0,c.useState)(!1),[y,b]=(0,c.useState)(null),f=null===o||void 0===o||null===(t=o.params)||void 0===t?void 0:t.token;(0,c.useEffect)((()=>{if(f)try{const e=(0,Wn.A)(f);e.documentId&&e.approvalId?(i(e),m(!0),N.JZ.bc.publicGuarantySecuredAgreement(f).then(d).catch((()=>b(Qn.UnhandledError))).finally((()=>m(!1)))):b(Qn.UnhandledError)}catch{b(Qn.UnhandledError)}else b(Qn.UnhandledError)}),[f]);return c.createElement(Jn,{title:r("DocumentApproval.get-paid.header")},y?c.createElement(qn,{errorCode:y}):h?c.createElement(Gn,null):c.createElement(K.A,{style:{alignItems:"center"}},c.createElement(se.A,{style:Un.title},r("DocumentApproval.get-paid.title1")),c.createElement(se.A,{style:Un.title},c.createElement(z.x6,{t:r,i18nKey:"DocumentApproval.get-paid.title2",values:{company:null!==(n=null===l||void 0===l?void 0:l.companyName)&&void 0!==n?n:"..."}})),c.createElement(F.hK,{height:16}),c.createElement(se.A,{style:no.subtitle},c.createElement(z.x6,{t:r,i18nKey:"DocumentApproval.get-paid.subtitle",tOptions:{escapeValue:!1}})),c.createElement(F.hK,{height:16}),null!==s&&void 0!==s&&s.url?c.createElement(Xn.A,{pdfUrl:s.url}):c.createElement(K.A,{style:{...oo,width:a?"100%":350}}),c.createElement(se.A,{style:Un.message},c.createElement(z.x6,{t:r,i18nKey:"DocumentApproval.get-paid.agreementsList",components:{invoicePurchase:c.createElement(se.A,{style:Un.link,onPress:()=>{null!==l&&void 0!==l&&l.legacyCompanyId&&Hn.A.downloadInvoicePurchaseAgreementWithJwt(f)}}),seller:c.createElement(se.A,{style:Un.link,onPress:()=>{null!==l&&void 0!==l&&l.legacyCompanyId&&Hn.A.downloadSellerAgreementWithJwt(f)}}),terms:c.createElement(se.A,{style:Un.link,onPress:()=>(0,Vn.Yx)(L.DS.TC)}),privacy:c.createElement(se.A,{style:Un.link,onPress:()=>(0,Vn.Yx)(L.DS.PP)})}})),c.createElement(de.BtButton,{size:"large",style:Un.button,disabled:p||u,onPress:async()=>{try{g(!0);const e=await(0,Kn.v4)();await N.JZ.bc.approveGetPaidAgreements(f,e),v(!0)}catch(e){e.code===Qn.AlreadyApproved?v(!0):b(e.code)}finally{g(!1)}}},r("DocumentApproval.submit"))))},no=ie.A.create({subtitle:{fontFamily:"Inter, sans-serif",fontSize:16,lineHeight:28,textAlign:"center"},spinner:{marginTop:25}}),oo={height:400,backgroundColor:"white",padding:15,border:"20px solid #f8f9f9",borderRadius:20,borderBottom:0};var ro=n(6652),ao=n(56543),lo=n(12709);const io=(0,p.PA)((e=>{let{onNext:t,onSignUp:n,login:o,error:r,loading:a}=e;const[l,i]=(0,c.useState)(o||""),{t:s}=(0,z.Bd)("auth"),{verifier:d,createVerifier:u}=(0,$.A)("verify-phone");(0,c.useEffect)((()=>{u()}),[]);const m=(0,c.useCallback)((()=>{try{const e=(0,lo.validateEmail)(l)?"email":"phone";if(!d)throw new Error("RecaptchaVerifier was not created");t({login:l,type:e,verifier:d})}catch(e){console.error(e)}}),[l,t,d]),p=(0,c.useCallback)((e=>{i(e)}),[i]),g=(e=>(0,lo.validateEmail)(e)||(0,lo.validateUSPhoneNumber)(e))(l);return c.createElement(I.A,{showsBackButton:!1},c.createElement(T.A,{testID:"login-title"}
1,s("signIn.title")),c.createElement(T.t,{style:{marginTop:20}},s("subTitle")),c.createElement(F.hK,{height:40}),c.createElement(ao.p,{testID:"login",value:l,onChangeText:p,label:s("signIn.loginLabel"),autoFocus:!0,mandatory:!0}),c.createElement(j.K,{error:r}),c.createElement(F.hK,{height:32}),c.createElement(x.A,{onPress:m,disabled:!g||a,loading:a,testID:"sign-in-submit-btn"},s("signIn.submitLabel")),c.createElement(F.hK,{height:40}),c.createElement(P.A,{style:{fontFamily:"Inter, sans-serif",fontSize:16,fontWeight:"500",color:B.commonColors.textLight,alignSelf:"center"},testID:"link-to-signup"},"".concat(s("signIn.signUpQuestion")," "),c.createElement(k.N,{textStyle:{fontSize:16,fontWeight:"500"},title:s("SignUp"),color:B.commonColors.accentText,testID:"signup_link",onPress:n})))}));var so=n(62712),co=n(25944);const uo=(0,p.PA)((e=>{let{onNext:t,onForgotPassword:n,onBack:o,onSignUp:r,login:a,loading:l,error:i}=e;const[s,d]=(0,c.useState)(""),{t:u}=(0,z.Bd)(["auth"]),m=(0,c.useCallback)((()=>{t({password:s})}),[t,s]),p=(0,c.useCallback)((e=>{d(e)}),[d]),g=(0,co.A)(s).length;return c.createElement(I.A,{onBackPress:o},c.createElement(O.Ay,{testID:"back-button-to-login",onPress:o}),c.createElement(T.A,{testID:"password-title"},u("auth:signIn.passwordTitle")),c.createElement(T.t,{style:{marginTop:16}},c.createElement(z.x6,{t:u,i18nKey:"auth:signIn.caption",components:{styled:c.createElement(se.A,{style:{color:"#00A0F3"}})},values:{login:a}})),c.createElement(so.A,{testID:"password",label:u("auth:signIn.passwordLabel"),value:s,onChangeText:p,newPassword:!0,showEye:!0,mandatory:!0}),c.createElement(F.hK,null),c.createElement(j.K,{error:i}),c.createElement(F.hK,{height:40}),c.createElement(Q.A,{testID:"forgot-password",onPress:n,style:{color:"#668598",fontSize:14}},c.createElement(z.x6,{t:u,i18nKey:"auth:signIn.forgotLink",components:{styled:c.createElement(se.A,{style:{color:"#00A0F3"},testID:"forgot_password_link"})},values:{login:"Click Here"}})),c.createElement(F.hK,{height:20}),c.createElement(x.A,{onPress:m,disabled:!g||l,loading:l,testID:"sign-in-submit-btn"},u("auth:signIn.loginButtonLabel")),c.createElement(F.hK,{height:40}),c.createElement(se.A,{style:{fontSize:16,fontWeight:"500",color:B.commonColors.textLight,alignSelf:"center"},testID:"link-to-signup"},"".concat(u("auth:signIn.signUpQuestion")," "),c.createElement(k.N,{textStyle:{fontSize:16,fontWeight:"500"},title:u("auth:SignUp"),color:B.commonColors.accentText,testID:"signup_link",onPress:r})))}));var mo=n(4726),po=n(8219),go=n(61208);const ho=(0,p.PA)((e=>{let{onNext:t,onBack:n,onSignUp:o,onResendSmsCode:r,login:a,loading:l,error:i}=e;const[s,d]=(0,c.useState)(""),{t:u}=(0,z.Bd)("auth"),{verifier:m,createVerifier:p}=(0,$.A)("verify-phone");(0,c.useEffect)((()=>{p()}),[]);const g=(0,c.useCallback)((()=>{t({otp:s,codeVerifier:m})}),[t,s,m]),h=(0,c.useCallback)((e=>{d(e)}),[d]);return c.createElement(I.A,{onBackPress:n},c.createElement(O.Ay,{onPress:n,testID:"back-button-to-login"}),c.createElement(T.A,{testID:"code-title"},u("codeTitle")),c.createElement(mo.A,{height:16}),c.createElement(T.t,{testID:"code-subtitle"},u("codeSubTitle"),c.createElement(P.A,{style:{color:B.commonColors.accentText}},"****",a.slice(-4))),c.createElement(mo.A,{height:40}),c.createElement(po.A,{otp:s,onChange:h,testID:"six-digit-code-component"}),c.createElement(mo.A,null),c.createElement(j.K,{error:i}),c.createElement(mo.A,{height:20}),c.createElement(P.A,{style:{fontSize:14,color:B.commonColors.textLight,marginVertical:20,textAlign:"center"},testID:"codeQuestion"},u("codeQuestion"),c.createElement(k.N,{title:u("resendCode"),color:"#00A0F3",onPress:r,testID:"resend-code-link"})),c.createElement(go.nu,null,(()=>c.createElement(x.A,{disabled:l||6!==s.length,onPress:g,testID:"sign-in-submit-btn",loading:f.A.isBusy},u("signIn.loginButtonLabel")))),c.createElement(P.A,{style:{color:B.commonColors.textLight,marginTop:40,fontWeight:"500",fontSize:16},testID:"signup-question"},u("signIn.signUpQuestion"),c.createElement(k.N,{textStyle:{fontWeight:"500",fontSize:16},title:u("SignUp"),color:"#00A0F3",onPress:o,testID:"signup-link"})),c.createElement(mo.A,null))}));var vo=n(48697),yo=n(44943);let bo=function(e){return e[e.IDLE=0]="IDLE",e[e.SIGN_IN_LOGIN=1]="SIGN_IN_LOGIN",e[e.SIGN_IN_PASSWORD=2]="SIGN_IN_PASSWORD",e[e.SIGN_IN_PHONE_VERIFY=3]="SIGN_IN_PHONE_VERIFY",e[e.FORGOT_PASSWORD=4]="FORGOT_PASSWORD",e}({});const fo=(0,c.memo)((e=>{let{onSuccess:t,onSignUp:n,mode:o,initialStep:r=bo.SIGN_IN_LOGIN,initialState:a={}}=e;const i=(0,$e.useNavigation)(),{userStore:s}=l.A,[d,u]=(0,c.useState)(r),[m,p]=(0,c.useState)(a),[g,h]=(0,c.useState)(!1),[v,y]=(0,c.useState)(!1),b=window.location.origin;let f;o&&o===yo.K.POPUP&&(f="width=800,height=600,scrollbars=yes,resizable=yes");const C=(0,c.useRef)(null),[A,S]=(0,c.useState)(null),[w,P]=(0,c.useState)(null),I=(0,c.useCallback)((async e=>{if(y(!1),d===bo.SIGN_IN_LOGIN){const{login:t,type:o,verifier:r}=e;let l=!1;try{h(!0);l=!(await N.Vv.kQ.check({login:t.toLowerCase()})).exists,p({...m,...e,verifier:r,isNewUser:l})}catch(a){console.error(a)}if("email"===o&&u(bo.SIGN_IN_PASSWORD),"phone"===o)if(l)n&&n();else{const e=t;try{C.current=await ro.A.auth().signInWithPhoneNumber(e,r),u(bo.SIGN_IN_PHONE_VERIFY)}catch(a){console.error(a);const e=a,{code:t}=e;t&&"auth/invalid-phone-number"===t&&y("auth/wrong-password")}}h(!1)}if(d===bo.SIGN_IN_PASSWORD){const{login:n}=m;try{var o;h(!0);const{password:r}=e;await s.waitForPendingLogOut();const a=await ro.A.auth().signInWithEmailAndPassword(n,r),l=await(null===(o=a.user)||void 0===o?void 0:o.getIdToken());
1if(!l)throw new Error("Unable to receive a token from the firebase");await N.Vv.kQ.webAuth({idToken:l}),await s.setAuthState(a.user),await N.JZ.kQ.conversion({lastLogin:(0,vo.W)()}),t()}catch(a){console.error(a);const e=a,{code:t}=e;t?("auth/wrong-password"===t&&y("auth/wrong-password"),"auth/user-not-found"===t&&y("auth/user-not-found"),"auth/too-many-requests"===t&&y("auth/too-many-requests")):y("auth/user-not-found")}h(!1)}if(d===bo.SIGN_IN_PHONE_VERIFY){const{otp:n}=e,o=C.current;if(!o)return;try{var r;h(!0);const e=await o.confirm(n),a=await(null===(r=e.user)||void 0===r?void 0:r.getIdToken());if(!a)throw new Error("Unable to receive a token from the firebase");await N.Vv.kQ.webAuth({idToken:a}),s.setIsAuthenticated(!0),t()}catch(a){console.error(a);const e=a,{code:t}=e;t?"auth/invalid-verification-code"===t&&y("auth/invalid-verification-code"):y("auth/user-not-found")}h(!1)}}),[t,n,m,d,s]),x=(0,c.useCallback)((()=>{y(!1),d!==bo.SIGN_IN_PHONE_VERIFY&&d!==bo.SIGN_IN_PASSWORD||u(bo.SIGN_IN_LOGIN)}),[d]),D=(0,c.useCallback)((async()=>{const{login:e,verifier:t}=m;try{if(!e)throw new Error("no phone");if(!t)throw new Error("no verifyer");C.current=await ro.A.auth().signInWithPhoneNumber(e,t)}catch(n){console.error(n)}}),[m]),T=(0,c.useCallback)((async()=>{if(n)n();else if(o){const e=window.open("/signup","_blank",f);S(e)}else i.navigate(E.f0.Auth._self,{screen:E.f0.Auth.SignUpHome})}),[f,i,o,n]),k=(0,c.useCallback)((()=>{const e=window.open("/forgot-password","_blank",f);P(e)}),[f]);return(0,c.useEffect)((()=>{const e=e=>{e.origin===b?(console.log("here event.data",e.data.type),e.data.type===J.c.USER_SIGNED_UP&&A?(A.close(),S(null),s.setIsAuthenticated(!0),t()):e.data.type===J.c.PASS_RESTORE_INSTRUCTIONS_SENT&&w&&(w.close(),P(null),u(bo.SIGN_IN_PASSWORD))):console.warn("Received message from unexpected origin:",e.origin)};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[A,t,s,b,w]),c.createElement(c.Fragment,null,d===bo.SIGN_IN_LOGIN&&c.createElement(io,{onNext:I,onSignUp:T,login:m.login,loading:g,error:v}),d===bo.SIGN_IN_PASSWORD&&c.createElement(uo,{onNext:I,onBack:x,onForgotPassword:k,onSignUp:T,login:m.login,loading:g,error:v}),d===bo.SIGN_IN_PHONE_VERIFY&&c.createElement(ho,{onNext:I,onBack:x,onSignUp:T,onResendSmsCode:D,login:m.login,loading:g}))}));var Eo=n(71003),Co=n(98690),Ao=n(38767);const So=e=>{let{email:t}=e;const[n,o]=(0,c.useState)(0),[r,a]=(0,c.useState)(0),[l,i]=(0,c.useState)(0),s=r/n*r,d=l/n*r;return c.createElement(K.A,{style:Do.container},c.createElement(rt.A,{style:Do.emailScrollContainer,horizontal:!0,showsHorizontalScrollIndicator:!1,onContentSizeChange:e=>{o(e)},onLayout:e=>{const{width:t}=e.nativeEvent.layout;a(t)},onScroll:e=>{const{contentOffset:t}=e.nativeEvent;i(t.x)},scrollEventThrottle:16,contentContainerStyle:Do.scrollContent,testID:"scrolled-email-container"},c.createElement(K.A,{testID:"email-with-icon-container",style:Do.emailContainer},c.createElement(q.n_M,{width:20,height:20}),c.createElement(se.A,{testID:"logged-in-user-email",style:Do.emailContent},t))),n>r&&c.createElement(K.A,{style:Do.customScrollIndicatorContainer},c.createElement(K.A,{style:[Do.customScrollIndicator,{width:s,left:d}]})))},wo=(0,p.PA)((e=>{let{isWeb:t,email:n,button:o,isGuest:r}=e;const{branding:a}=l.A,i=a?c.createElement(be.A,{source:{uri:null===a||void 0===a?void 0:a.logoUrl},style:{height:t?47:36,width:t?151:83},resizeMode:"contain"}):c.createElement(q.SeL,null);return c.createElement(K.A,{style:[Do.topBarView,t?Do.topBarViewWeb:Do.topBarViewMobile,r&&Do.topBarViewGuest]},n?c.createElement(K.A,{testID:"right-top-bar-container",style:[t||!t&&a?{width:"30%"}:{width:"50%"},{marginLeft:8}]},c.createElement(So,{email:n})):c.createElement(K.A,{style:{width:"30%"}}),t||!t&&(!n||a)?c.createElement(K.A,{style:{width:"30%",alignItems:"center",alignSelf:"center"},testID:"centered-bt-icon-top-bar"},i):null,o?c.createElement(K.A,{style:{width:"30%",alignItems:"flex-end",marginRight:8},testID:"left-topbar-btn-container"},o):c.createElement(K.A,{style:{width:"30%"}}))})),Po=(0,p.PA)((e=>{let{button:t}=e;const{branding:n}=l.A,o=n&&t?c.createElement(be.A,{source:{uri:null===n||void 0===n?void 0:n.logoUrl},style:{height:54,width:151},resizeMode:"contain"}):c.createElement(q.SeL,null);return n&&!t?c.createElement(K.A,{style:(0,Ao.composeStyle)({flexDirection:"row",width:"100%",height:58,alignItems:"center",justifyContent:"space-between",borderBottomWidth:1,borderBottomColor:"#E6EBEE"}),testID:"whitelabelHeader"},c.createElement(be.A,{source:{uri:null===n||void 0===n?void 0:n.logoUrl},style:{width:83,height:36,marginTop:5},resizeMode:"contain"}),c.createElement(Co._,null)):c.createElement(K.A,{style:[Do.topBarView,Do.topBarViewMobile]},c.createElement(K.A,{style:{width:"30%"}}),c.createElement(K.A,{style:{width:"30%",alignItems:"center",alignSelf:"center"},testID:"centered-bt-icon-top-bar"},o),t?c.createElement(K.A,{style:{width:"30%",alignItems:"flex-end"},testID:"left-topbar-btn-container"},t):c.createElement(K.A,{style:{width:"30%"}}))})),Io=e=>
1{let{email:t,children:n,button:o,isWeb:r,footer:a,contentViewStyle:i}=e;const{branding:s}=l.A;let d;const u=(0,c.useCallback)((()=>{d&&d.scrollTo({x:0,y:0,animated:!0})}),[d]);return(0,c.useEffect)((()=>{u()}),[!0,u]),c.createElement(Eo.A,{testID:"root-safe-area-view",style:Do.rootView},c.createElement(wo,{email:t,button:o,isWeb:r}),c.createElement(rt.A,{style:[{flex:1},!!s&&{borderBottomWidth:1,borderBottomColor:"#E6EBEE"}],ref:e=>{d=e},testID:"root-content-scroll-container"},c.createElement(K.A,{testID:"root-content-screen",style:[Do.contentView,i]},n)),a,!!s&&c.createElement(K.A,{style:[Do.poweredByContainer]},c.createElement(Co._,null)))},xo=e=>{let{email:t,children:n,button:o,isWeb:r,contentViewStyle:a}=e;const{branding:i}=l.A;let s;const d=(0,c.useCallback)((()=>{s&&s.scrollTo({x:0,y:0,animated:!0})}),[s]);return(0,c.useEffect)((()=>{d()}),[!0,d]),c.createElement(Eo.A,{testID:"root-safe-area-view",style:Do.rootView},c.createElement(wo,{email:t,button:o,isWeb:r,isGuest:!0}),c.createElement(rt.A,{style:{flex:1},contentContainerStyle:{flexGrow:1},ref:e=>{s=e},testID:"root-content-scroll-container"},c.createElement(K.A,{testID:"root-content-screen",style:[Do.contentView,a]},n)),!!i&&c.createElement(K.A,{style:Do.poweredByContainer},c.createElement(Co._,null)))},Do=ie.A.create({topBarView:{width:"100%",maxWidth:"100%",flexDirection:"row",alignItems:"center",alignSelf:"center",justifyContent:"space-between",borderBottomWidth:1,borderBottomColor:"#E6EBEE"},topBarViewMobile:{height:66,marginBottom:2},topBarViewWeb:{paddingHorizontal:26,height:80},topBarViewGuest:{marginBottom:0},rootView:{backgroundColor:"white",flex:1,justifyContent:"center",width:"100%",height:"100%"},topBar:{display:"flex",flexDirection:"column",justifyContent:"space-around",alignItems:"flex-start",height:47},emailContent:{marginLeft:2,fontSize:14,fontWeight:"700",lineHeight:24,color:"#19262F",fontFamily:"Inter",overflow:"hidden",whiteSpace:"nowrap"},emailScrollContainer:{flex:1,maxHeight:"100%",maxWidth:"100%"},container:{position:"relative"},poweredByContainer:{display:"flex",justifyContent:"center",alignItems:"flex-end",paddingTop:5,marginBottom:10,paddingRight:18,borderTopWidth:1,borderTopColor:"#E6EBEE"},customScrollIndicatorContainer:{position:"absolute",bottom:0,left:0,right:0,height:3,backgroundColor:"#E6EBEE"},customScrollIndicator:{position:"absolute",height:"100%",backgroundColor:"#80D4FB",borderRadius:3},scrollContent:{flexGrow:1,alignItems:"center"},emailContainer:{display:"flex",flexDirection:"row",alignItems:"center"},contentView:{marginTop:24,marginRight:36,marginBottom:31,marginLeft:36}}),To=async e=>{try{const{status:t,isPaid:n}=await N.Vv.SU.checkInvoiceIsPaid({invoiceId:e});return{status:t,isPaid:n}}catch(t){return console.error(t),null}},ko=async e=>{try{return await N.Vv.SU.showInvoiceIdle({invoiceId:e})}catch(t){return console.error(t),null}};var Bo=n(74161),Fo=n.n(Bo);const _o=e=>{const[t,n]=(0,c.useState)(null),[o,r]=(0,c.useState)(null),[a,l]=(0,c.useState)(!0),[i,s]=(0,c.useState)(null),[d,u]=(0,c.useState)(null),[m,p]=(0,c.useState)(null),g=(0,c.useCallback)((async(e,t)=>{const o=null===e||void 0===e?void 0:e.companyId;if(!o)return n(L.lI);try{const a=await(async e=>{try{return await N.JZ.XX.getInvoiceCompanyInfo(e)}catch(t){return console.error(t),null}})(o);if(!a)return n(L.lI);const l=function(e,t,n){var o,r,a;return{id:null!==(o=null===n||void 0===n?void 0:n._id)&&void 0!==o?o:null,customerId:null!==(r=null===n||void 0===n?void 0:n.customer_account_id)&&void 0!==r?r:"",supplierInvitationDetails:null!==(a=null===n||void 0===n?void 0:n.supplierInvitationDetails)&&void 0!==a?a:null,total_amount:e.totalAmount,invoice_number:e.invoiceNumber,invoice_due_date:Fo()().tz("America/Chicago"),company:t,type:N.tD.INVOICE,status:L.uR.due,connector:{integrationId:e.connector.integrationId,project:e.connector.projectDetails,customerId:e.connector.externalCustomerId},lines:e.lines.map((e=>({description:e.description,unitAmount:e.unitAmount,quantity:e.quantity,subTotal:e.subTotal,taxAmount:e.taxAmount,totalAmount:e.totalAmount})))}}(e,a,t);r(l),p(!1)}catch(a){console.error("Error handling JWT invoice:",a),n(L.lI)}}),[]),h=(0,c.useCallback)((async e=>{const{errorCode:t,data:o}=e||{},{invoiceId:a,payload:l}=o||{};if(t)return n(t);if(!a&&!l)return n(L.lI);if(a){const[e,t]=await Promise.all([To(a),ko(a)]);if(!e||!t)return n(L.lI);const o=(null===t||void 0===t?void 0:t.currentInvoiceCreditStatus)&&[...L.$D,...L.Vi].includes(t.currentInvoiceCreditStatus),i=e.isPaid||o;s(e.status),u(t.currentInvoiceCreditStatus),i?(r(t.invoice),p(!0)):await g(l,t)}else await g(l)}),[g]);return(0,c.useEffect)((()=>{(async()=>
1{if(!e)return n(L.lI);l(!0);const t=await(async e=>{try{const t=e+"",{errorCode:n,data:o}=await N.JZ.XX.checkAndGetInvoiceFromJwt(t);return{errorCode:n,data:o}}catch(t){return console.error(t),null}})(e);if(!t)return n(L.lI),void l(!1);await h(t),l(!1)})()}),[e,h]),{errorCode:t,loading:a,invoice:o,invoicePaymentStatus:i,invoiceCreditStatus:d,isInvoicePaid:m}};var No=n(1923),Ro=n(219),Lo=n(67956),Mo=n(89077),Oo=n(10272);const zo=e=>{let{name:t,phone:n,totalAmount:o,style:r,companyFontSize:a=18}=e;const{t:l}=(0,z.Bd)("global"),i=n?(0,Mo.L)(n,"US").formatInternational().slice(3):null,s=i?"(".concat(i.slice(0,3),")").concat(i.slice(3)):null;return c.createElement(K.A,{style:[jo.container,r],testID:"company-info-container"},c.createElement(K.A,{style:jo.companyInfo},c.createElement(de.BtText,{size:a,weight:"700",style:jo.companyName,numberOfLines:1,ellipsizeMode:"tail",testID:"company-name"},t),n&&c.createElement(K.A,{style:jo.phoneContainer,testID:"company-phone-container"},c.createElement(q.Oh,null),c.createElement(de.BtText,{style:jo.phoneText,weight:"500",onPress:()=>{Yn.A.openURL("tel:".concat(n))},testID:"company-phone"},s))),c.createElement(K.A,{style:jo.amountDueContainer,testID:"amount-due-container"},c.createElement(de.BtText,{weight:"700",size:18,style:jo.amountValue,testID:"amount-due-value"},(0,Lo.Wl)(o)),c.createElement(de.BtText,{style:jo.amountTitle,weight:"500",testID:"amount-due-title"},l("TabInvoice.amount_due"))))},jo=ie.A.create({container:{flexDirection:"row"},companyInfo:{flex:1},companyName:{lineHeight:28,letterSpacing:.032,fontFamily:"Inter",color:Oo.B.text.black},phoneContainer:{flexDirection:"row",alignItems:"center",marginTop:7},phoneText:{color:"#00A0F3",marginLeft:5,fontFamily:"Inter",lineHeight:21,fontSize:14},amountDueContainer:{alignItems:"flex-end"},amountValue:{fontFamily:"Inter",lineHeight:28,letterSpacing:.032,color:"#001929"},amountTitle:{color:"#394D5A",lineHeight:21,fontSize:14,fontFamily:"Inter",marginTop:6}});var Wo=n(9855),Vo=n.n(Wo),Ho=n(90336);const Uo=e=>{let{type:t,invoice_number:n,invoice_due_date:o,style:r,addressType:a,address:l,attention:i,invoice_document:s}=e;return c.createElement(c.Fragment,null,c.createElement(K.A,{style:[Go.container,r]},c.createElement(K.A,{style:Go.infoRow,testID:"invoice-info"},c.createElement(se.A,{style:Go.labelText,testID:"invoice-type-and_number"},"".concat(Vo()(t).replace("_"," ")," #").concat(n)),c.createElement(se.A,{style:Go.valueText,testID:"invoice-due-date"},"Due on ".concat((0,Lo.jr)(o)))),c.createElement(No.A,{style:Go.divider,testID:"divider"}),c.createElement(Ho.O,{addressType:a,address:l,attention:i,invoice_document:s})))},Go=ie.A.create({container:{marginTop:14},infoRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},labelText:{fontSize:14,fontFamily:"Inter",fontWeight:"500",lineHeight:21,color:Oo.B.text.grey500,maxWidth:"50%"},valueText:{fontSize:14,fontFamily:"Inter",fontWeight:"500",lineHeight:21,color:Oo.B.text.black,textAlign:"right",maxWidth:"50%"},divider:{marginTop:14,marginBottom:14}});var Yo=n(75488);const Qo=(0,a.PA)((e=>{let{onPress:t,showInfo:n,amountLessThanMin:o=!1,currentInvoiceCreditStatus:r,disabled:a}=e;const{t:l}=(0,z.Bd)(),[i,s]=(0,c.useState)({info:l("payWithCreditButton.does-not-affect-credit-score"),subtitle:l("payables.payment.regular.credit.noFees")}),d=(0,c.useMemo)((()=>L.$D.find((e=>e===r))?c.createElement(on.E,{span:!0,fw:600,fz:16},l("payWithCreditButton.app-processing")):c.createElement(z.x6,{i18nKey:"pay-with-btc",t:l,id:"pay-with-btc-title-container"},c.createElement(on.E,{span:!0,fw:600,fz:16},"Pay with")," ",c.createElement(on.E,{span:!0,fw:600,fz:16,c:"blue.6"},"BlueTape Credit"))),[r,l]),u=(0,c.useCallback)((()=>{o&&s({info:l("payWithCreditButton.min-amount-applicable"),subtitle:l("payWithCreditButton.not-eligible")})}),[o,l]);return(0,c.useEffect)((()=>{u()}),[u]),c.createElement(K.A,{testID:"pay-with-btc-container"},c.createElement(Yo.y,{title:d,subtitle:i.subtitle,disabled:a,leftIcon:c.createElement(q.IiJ,null),onClick:t}),n&&c.createElement(K.A,{testID:"btc-info-container",style:{flexDirection:"row",marginTop:5}},c.createElement(q.mo0,{style:{alignSelf:"center"}}),c.createElement(on.E,{"data-testid":"btc-info-title",style:{fontSize:12,color:"#99ADBA",marginLeft:8,fontWeight:"500"}},i.info)))}));var qo=n(93018),Ko=n(78573),Jo=n(76036),Zo=n(19925),Xo=n(13673),$o=n(10150);const er=(0,p.PA)((e=>{let{onClose:t,onPrimaryForCreditChanged:n}=e;const{t:o}=(0,z.Bd)("global"),{sm:r}=(0,Zo.Qs)(),{setReconnectCreditBank:a}=Xo.A,{onlineConnectedBanks:i}=l.A.screensStore.paymentMethodsStore,s=l.A.userStore.document,d=(0,c.useRef)(null),[u,m]=(0,c.useState)(!1),[p,g]=(0,c.useState)(null),[h,v]=(0,c.useState)(""),y=i.filter((e=>e.connectionType===L.FP.PLAID)),b=(0,c.useMemo)((()=>p&&p.connectionType===L.FP.PLAID),[p]),f=l.A.userStore.isAuthenticated;(0,c.useEffect)((()=>{f&&l.A.userStore.fetchDocument(tt.X.Credit)}),[f]);const E=c.createElement(de.BtButton,{onPress:()=>{var e;return null===(e=d.current)||void 0===e?void 0:e.createToken()},loading:u&&!h,appearance:"outline",disabled:l.A.isBusy,testID:"connect-bank-account-with-plaid"},o("ConnectBankWithPlaid.connect-bank-account")),C=e=>{var t;if(e.isExpiredPlaidBank)v(e._id),null===(t=d.current)||void 0===t||t.createToken(e._id);else if(e.isDisconnectedPlaidBank){var n;null===(n=d.current)||void 0===n||n.createToken("",e.routingNumber)}else g(e)};return c.createElement($o.A,{height:"100%",visible:!0,onClose:t,title:o("ConnectBankWithPlaid.header"),testID:"connect-bank-with-plaid-modal"},c.createElement(rt.A,{style:(0,Ao.composeStyle)({alignSelf:"center"},r?{maxWidth:670}:{width:"100%",padding:20}),testID:"connect-bank-scroll-container"},c.createElement(se.A,{style:tr.message1Desktop,testID:"connect-bank-reconnect-all-banks"},o("ConnectBankWithPlaid.reconnect-all-banks")),c.createElement(qo.W,null),null!==y&&void 0!==y&&y.length?c.createElement(c.Fragment,null,c.createElement(se.A,{style:{fontWeight:"600",fontSize:r?24:20,lineHeight:r?36:30,marginTop:40},testID:"banks-connected"},o("ConnectBankWithPlaid.banks-connected")),c.createElement(se.A,{style:(0,Ao.composeStyle)(tr.connectedText,{fontSize:r?18:16}),testID:"connected-accounts-shown-below"},o("ConnectBankWithPlaid.connected-accounts-shown-below")),c.createElement(se.A,{style:(0,Ao.composeStyle)(tr.selectPrimaryText,{fontSize:r?18:16}),testID:"select-primary-for-loan-payment"},o("ConnectBankWithPlaid.select-primary-for-loan-payment")),c.createElement(K.A,{style:{flexDirection:r?"row":"column"}},y.map((e=>{var t;return c.createElement(K.A,{style:{flexDirection:"column"},testID:"plaid-banks-list-container"},c.createElement(Jo.L,{bankAccount:e,selectedBankAccountId:null!==(t=null===p||void 0===p?void 0:p._id)&&void 0!==t?t:"",onPress:C,loadingBankId:h,showDisconnectedBadge:!0}),(null===p||void 0===p?void 0:p._id)===e.id&&c.createElement(se.A,{style:{fontWeight:"400",fontSize:12,color:"#668598",marginTop:10},testID:"bank-selected-as-primary"},o("ConnectBankWithPlaid.selected-as-primary")),!r&&c.createElement(F.hK,{height:20}))}))),c.createElement(K.A,{style:{height:1,borderRadius:2,width:"100%",backgroundColor:"#CCD6DD",marginTop:r?30:15}}),c.createElement(se.A,{style:{fontWeight:"600",fontSize:r?24:20,lineHeight:36,marginTop:r?20:10},testID:"or-connect-new-bank"},o("ConnectBankWithPlaid.or-connect-new-bank")),c.createElement(F.hK,{height:r?30:25}),E):c.createElement(c.Fragment,null,c.createElement(se.A,{style:(0,Ao.composeStyle)(tr.message2,!r&&tr.mobileMessage2),testID:"connect-bank-accounts"},o("ConnectBankWithPlaid.connect-accounts")),c.createElement(se.A,{style:(0,Ao.composeStyle)(tr.message3,!r&&tr.mobileMessage3),testID:"review-business-cashflow"},o("ConnectBankWithPlaid.to-review-business-cashflow")),E),c.createElement(Ko.R,{ref:d,setLoa
1ding:m,onConnectSuccess:()=>{h&&v("")}}),c.createElement(de.BtButton,{style:{width:133,alignSelf:"flex-end",marginTop:30},onPress:()=>{if(p&&s){const e=(0,ut.toJS)(N.c2.create({...(0,ut.toJS)(p),isPrimaryForCredit:!0}));N.JZ.QN.addBankAccount(e).then((async()=>{s.setData("details",e,"","bank","BankDetails",!0),await l.A.screensStore.paymentMethodsStore.fetchPaymentMethods(),a(!1),n()}))}},disabled:!b||l.A.isBusy,testID:"plaid-continue-btn"},o("ConnectBankWithPlaid.continue-button"))))})),tr=ie.A.create({message1Desktop:{fontWeight:"700",fontSize:18,lineHeight:28,alignSelf:"center",marginTop:25,textAlign:"center"},message2:{fontWeight:"600",fontSize:24,marginTop:40,lineHeight:48},mobileMessage2:{fontSize:20,lineHeight:30},message3:{fontWeight:"500",fontSize:18,color:"#626D75",lineHeight:30,marginBottom:30},mobileMessage3:{fontSize:16,lineHeight:28},selectPrimaryText:{fontWeight:"600",fontSize:18,marginBottom:35},connectedText:{fontWeight:"500",fontSize:18,lineHeight:30,color:"#626D75",marginBottom:20}});var nr=n(38146),or=n(74027);const rr=(0,c.memo)((e=>{let{onSuccess:t}=e;const{t:n}=(0,z.Bd)(["errors","global"]);return c.createElement(nr.s,{visible:!0,icon:c.createElement(q.F3K,null),title:n("global:CreditApplication.submit-success-messages.with-invoice-previously-approved.title"),message:c.createElement(K.A,null,c.createElement(se.A,{style:ar.text,testID:"pay-with-btc-success-message"},n("global:CreditApplication.submit-success-messages.with-invoice-previously-approved.message")),c.createElement(or.i,{onRedirect:t,wrapperStyle:ar.redirectionLabelWrapper})),exitable:!1,buttonData:{title:"Ok, got it",contentStyle:{width:"100%"},style:{width:"90%"},onPress:t},textContentBottomMargin:20,onDismiss:t})})),ar=ie.A.create({text:{fontFamily:"Inter, sans-serif",fontSize:14,lineHeight:21,color:"#001929"},redirectionLabelWrapper:{borderTopColor:"#DEE5EB",borderTopWidth:1,paddingVertical:10}});var lr=n(22155),ir=n(4700);const sr=(0,c.memo)((e=>{let{initialValues:t,onCreate:n,onClose:o}=e;const{t:r}=(0,z.Bd)("global"),{jobId:a="",streetAddress:l="",unitNumber:i="",city:s="",state:d="",zip:u="",projectType:m="",firstName:p="",lastName:g=""}=t||{},{values:h,touched:v,errors:y,submitForm:b,setFieldValue:f,setFieldTouched:E,isSubmitting:C}=(0,lr.Wx)({initialValues:{jobId:a,streetAddress:l,unitNumber:i,city:s,state:d,zip:u,projectType:m,firstName:p,lastName:g},validateOnBlur:!0,validationSchema:ir.Ik({jobId:ir.Yj().required("Required"),streetAddress:ir.Yj().required("Required"),unitNumber:ir.Yj(),city:ir.Yj().required("Required"),state:ir.Yj().required("Required"),zip:ir.Yj().length(5,r("ProjectForm.invalid-zip")).required("Required"),projectType:ir.Yj().required("Required"),firstName:ir.Yj().required("Required"),lastName:ir.Yj().required("Required")}),onSubmit:e=>{console.log("form submit"),n(e)}});return console.log(y),c.createElement($o.A,{visible:!0,onClose:o,testID:"add-new-project-modal"},c.createElement(se.A,{style:cr.title1,testID:"add-new-project-title-no-project-exist"},r("ProjectForm.main-heading-when-no-projects-exist")),c.createElement(se.A,{style:cr.subtitle,testID:"add-new-project-subtitle"},r("ProjectForm.main-subheading")),c.createElement(se.A,{style:cr.title2,testID:"add-new-project-title-job-id"},r("ProjectForm.what-is-jobid")),c.createElement(de.BtInput,{size:"medium",value:h.jobId,status:y.jobId&&v.jobId?"danger":"",onChangeText:e=>f("jobId",e),onBlur:()=>E("jobId"),mandatory:!0,label:r("ProjectForm.jobid-label"),testID:"jobId"}),c.createElement(se.A,{style:cr.title2,testID:"add-new-project-address-title"},r("ProjectForm.address-title")),c.createElement(se.A,{style:cr.subtitle,testID:"add-new-project-address-subtitle"},r("ProjectForm.address-subtitle")),c.createElement(de.BtInput,{size:"medium",value:h.streetAddress,status:y.streetAddress&&v.streetAddress?"danger":"",onChangeText:e=>f("streetAddress",e),onBlur:()=>E("streetAddress"),label:r("ProjectForm.street-address"),testID:"streetAddress",mandatory:!0}),c.createElement(de.sy,{size:"medium",value:h.unitNumber,onChangeText:e=>f("unitNumber",e),style:{marginTop:20},label:r("ProjectForm.unit-num"),testID:"unitNumber",format:"#####"}),c.createElement(de.BtInput,{size:"medium",mandatory:!0,value:h.state,status:y.state&&v.state?"danger":"",onChangeText:e=>f("state",e),onBlur:()=>E("state"),label:r("ProjectForm.state"),testID:"state",containerStyle:{marginTop:20}}),c.createElement(K.A,{style:{flexDirection:"row",justifyContent:"space-between",width:"100%",marginTop:20}},c.createElement(de.sy,{size:"medium",value:h.zip,onChangeText:e=>f("zip",e),onBlur:()=>E("zip"),style:(0,Ao.composeStyle)({width:"48%"},y.zip&&v.zip?{borderColor:"red"}:{}),label:r("ProjectForm.zip"),testID:"zip",validate:()=>
1y.zip?r("ProjectForm.invalid-zip"):"",format:"#####",required:!0}),c.createElement(de.BtInput,{size:"medium",value:h.city,status:y.city&&v.city?"danger":"",onChangeText:e=>f("city",e),onBlur:()=>E("city"),style:{width:"48%"},label:r("ProjectForm.city"),testID:"city",mandatory:!0})),c.createElement(se.A,{style:cr.title2,testID:"add-new-project--type-title"},r("ProjectForm.project-type-title")+"*"),c.createElement(de.HN,{value:h.projectType,onChange:e=>{E("projectType"),f("projectType",e)},options:[{label:r("ProjectForm.commercial"),value:"commercial"},{label:r("ProjectForm.residential"),value:"residential"}],radioStyle:{marginRight:32},groupStyle:{flexDirection:"row"},labelStyle:{color:"#19262F",fontWeight:"500",fontSize:16},testID:"projectType_privateType",error:y.projectType&&v.projectType?y.projectType:""}),c.createElement(se.A,{style:cr.title2,testID:"add-new-project-home-owner-info-title"},r("ProjectForm.enter-home-owner-information")),c.createElement(K.A,{style:{flexDirection:"row",justifyContent:"space-between",width:"100%",marginTop:20}},c.createElement(de.BtInput,{size:"medium",value:h.firstName,status:y.firstName&&v.firstName?"danger":"",onChangeText:e=>f("firstName",e),onBlur:()=>E("firstName"),testID:"firstName",label:r("ProjectForm.first-name-label"),style:{width:"48%"},mandatory:!0}),c.createElement(de.BtInput,{size:"medium",value:h.lastName,status:y.lastName&&v.lastName?"danger":"",onChangeText:e=>f("lastName",e),onBlur:()=>E("lastName"),testID:"lastName",label:r("ProjectForm.last-name-label"),style:{width:"48%"},mandatory:!0})),c.createElement(de.Spacer,{height:44}),c.createElement(K.A,{style:{flexDirection:"row-reverse"}},c.createElement(Bt.A,{style:cr.button,activeOpacity:.8,onPress:b,disabled:C,testID:"projects-add-button"},c.createElement(de.BtText,{style:cr.addButtonLabel,testID:"add-new-project-mobile-title"},r("ProjectForm.mobile-title")))),c.createElement(de.Spacer,{height:44}))})),cr=ie.A.create({title1:{fontWeight:"700",fontSize:28,lineHeight:34,color:"#394D5A",marginTop:20,marginBottom:4},title2:{fontWeight:"700",fontSize:20,lineHeight:28,color:"#394D5A",marginTop:20,marginBottom:20},subtitle:{fontWeight:"400",fontSize:16,lineHeight:24,color:"#394D5A",marginBottom:20,letterSpacing:-.5},button:{border:"none",borderRadius:4,backgroundColor:"#00A0F3",flexDirection:"row",alignItems:"center",justifyContent:"center",paddingHorizontal:24,paddingVertical:16,maxWidth:220,maxHeight:48,marginTop:15,marginBottom:40},addButtonLabel:{color:"#FFF",fontSize:16,fontWeight:"700",lineHeight:24}});var dr=n(24038),ur=n(30584),mr=n(10349),pr=n(48321);const gr=(0,a.PA)((e=>{let{onProjectSelect:t}=e;const{t:n}=(0,z.Bd)("global"),{searchText:o,setSearchText:r}=(0,ce.ui)(),[a,l]=(0,c.useState)(!1),{count:i,pageSize:s,refresher:d}=pr.Ay,u=[{cell:e=>{var n;return c.createElement(K.A,{style:{flexDirection:"row",marginBottom:20,marginTop:20,width:"100%"},testID:"projects-table-cell-container"},c.createElement(K.A,{style:{flex:1}},c.createElement(de.BtText,{style:hr.rowsLabel},e.data?(e=>{let{streetAddress:t,city:n,state:o,zip:r}=e;return"".concat(t,", ").concat(n,", ").concat(o,", ").concat(r)})(null===(n=e.data)||void 0===n?void 0:n.propertyAddress.items[0].content):e.address)),c.createElement(Bt.A,{style:{width:126,height:34,borderRadius:8,backgroundColor:"#F5F7F8",alignItems:"center",justifyContent:"center"}},c.createElement(de.BtText,{style:{fontWeight:"700",fontSize:14},onPress:()=>{t(e)}},"Select")))}}];return c.createElement(K.A,{style:hr.mainWrapper,testID:"projects-table-wrapper"},c.createElement(de.tv,{style:vr,columns:u,apiCaller:e=>N.Vv.Cv.findAll(e),filterPlaceholder:n("Projects.searchPropertyAddress"),defaultSortColumn:n("Projects.createdAt"),refresher:d,noDataComponent:c.createElement(mr.P,{title:n("noItems"),subtitle:n("Projects.TryAgainProject"),btnText:n("Projects.create-project")}),pagination:!0,paginationServer:!0,rowsPerPage:s,paginationTotalRows:i,paginationPerPage:5,filterWidth:"100%",subHeader:!0,subHeaderAlign:n("Projects.left"),highlightOnHover:!1,subHeaderComponent:c.createElement(ur.L,{value:o,onChange:r,setRe
1setPaginationToggle:l,resetPaginationToggle:a})}))})),hr=ie.A.create({mainWrapper:{flex:1},inputContainer:{width:542,paddingLeft:16,paddingRight:19,backgroundColor:"#F7F9FC",borderRadius:4,borderWidth:1,borderColor:"#E4E9F2",textAlignVertical:"top",flexDirection:"row",alignItems:"center",marginTop:31,marginLeft:-24},input:{marginTop:0,backgroundColor:"#F7F9FC",borderWidth:1,borderColor:"#E4E9F2"},rowsLabel:{fontWeight:"500",fontSize:14,color:"#003353",lineHeight:20},businessNameLabel:{fontSize:16,color:"#335C75",lineHeight:24}}),vr={table:{style:{backgroundColor:dr.Tj.surface,alignSelf:"center"}},tableWrapper:{style:{backgroundColor:dr.Tj.surface,width:"100%",justifyContent:"center",display:"flex"}},subHeader:{style:{paddingBottom:0,flex:1}},head:{style:{}},headRow:{style:{borderBottomWidth:0,minHeight:35},denseStyle:{}},contextMenu:{style:{},activeStyle:{}},cells:{style:{paddingLeft:0,paddingRight:0,color:dr.Tj.primary,fontSize:16,lineHeight:1.5,fontWeight:"400"}},rows:{selectedHighlightStyle:{},denseStyle:{},stripedStyle:{}},expanderRow:{style:{}},expanderCell:{style:{}},expanderButton:{style:{}},pagination:{style:{width:"90%",alignSelf:"center",borderTopWidth:0},pageButtonsStyle:{}},noData:{style:{}},progress:{style:{width:"100%"}}},yr=e=>{let{onAddNewProject:t,onProjectSelected:n,onClose:o}=e;const{t:r}=(0,z.Bd)("global");return c.createElement($o.A,{visible:!0,onClose:o,height:"100%",width:662,testID:"select-project-modal"},c.createElement(de.BtText,{style:br.title,testID:"select-project-title"},"Add or select a project for this invoice to continue your trade credit request."),c.createElement(de.BtText,{style:br.subtitle,testID:"select-project-subtitle"},"To request trade credit for this invoice, project details are required. Select or add project details pertaining to this purchase."),c.createElement(Bt.A,{style:br.addProjectBtnWithProjects,activeOpacity:.8,onPress:t,testID:"projects-add-button"},c.createElement(de.BtText,{style:br.addButtonLabel,testID:"project-modal-add-new-project-title"},r("Projects.add_new_project")),c.createElement(q.GD8,{width:16,height:16})),c.createElement(K.A,{style:{marginTop:30},testID:"projects-table-container"},c.createElement(gr,{onProjectSelect:n})))},br=ie.A.create({mainWrapperWithProjects:{flex:1,width:680,alignSelf:"center",marginTop:30},mainWrapperWithoutProjects:{flex:1},title:{color:"#003353",fontSize:24,fontWeight:"700",lineHeight:32,marginBottom:16},subtitle:{color:"#003353",fontSize:14,fontWeight:"500",lineHeight:24},addProjectBtnWithoutProjects:{border:"none",borderRadius:4,backgroundColor:"#00A0F3",flexDirection:"row",alignItems:"center",paddingHorizontal:24,paddingVertical:16,maxWidth:220,maxHeight:48,position:"absolute",right:36,top:12},addProjectBtnWithProjects:{border:"none",borderRadius:4,backgroundColor:"#00A0F3",flexDirection:"row",alignItems:"center",paddingHorizontal:24,paddingVertical:16,maxWidth:220,maxHeight:48,marginTop:15},addButtonLabel:{color:"#FFF",fontSize:16,fontWeight:"700",lineHeight:24,marginRight:24},loadingIndicator:{marginTop:300}}),fr=e=>{let{onSelect:t,onClose:n}=e;const{t:o}=(0,z.Bd)("global"),{sm:r}=(0,Zo.Qs)(),[a,l]=(0,c.useState)(null),i=[{label:o("SelectPurchaseType.inventory"),value:L.P_.INVENTORY},{label:o("SelectPurchaseType.specific-project"),value:L.P_.PROJECT}];return c.createElement(de.BtAlert,{visible:!0,onClose:n,buttons:[{label:"Go Back",appearance:"outline",style:r?Er.buttonDesktop:Er.buttonMobile,onPress:n},{label:"Continue",style:r?Er.buttonDesktop:Er.buttonMobile,onPress:()=>{a&&t(a)},disabled:!a}],width:r?650:void 0,buttonsContainerStyle:r&&{justifyContent:"center"}},c.createElement(se.A,{style:r?Er.desktopTitleStyle:Er.mobTitleStyle},o("SelectPurchaseType.title")),c.createElement(de.HN,{value:a,options:i,onChange:e=>l(e),radioStyle:{marginRight:32},groupStyle:{flexDirection:r?"row":"column",marginBottom:35,justifyContent:"center"},testID:"purchase-type"}))},Er=ie.A.create({desktopTitleStyle:{fontWeight:"700",fontSize:28,lineHeight:36,color:"#003353",marginBottom:25,width:493,textAlign:"center"},mobTitleStyle:{fontWeight:"600",fontSize:18,lineHeight:28,color:"#003353",textAlign:"center",marginBottom:11},buttonDesktop:{width:210,marginBottom:40,marginRight:5,marginLeft:5},buttonMobile:{minWidth:140,marginRight:5,marginLeft:5}});var Cr=n(52628);var Ar=n(97537),Sr=n(18394),wr=n(45983),Pr=n(82047);const Ir=(0,c.memo)((e=>
1{let{headerIcon:t,footer:n,backgroundColor:o,title:r,subtitle:a,paymentMethodSubtitle:l,paymentMethodName:i,paymentMethodIcon:s,modalStyle:d={},onClose:u}=e;return c.createElement(wr.A,{visible:!0,modalStyle:{justifyContent:"flex-end",...d},onClose:u,contentStyle:{padding:0},containerStyle:{backgroundColor:o,width:355,borderRadius:20,marginHorizontal:10,padding:0,display:"flex",justifyContent:"flex-start"},testID:"payment-status-modal"},c.createElement(K.A,{style:{height:40,alignItems:"flex-end",padding:15},testID:"payment-status-icon"},c.createElement(Pr.A,{icon:c.createElement(q.sJ3,{height:"14",width:"14"}),onPress:u})),c.createElement(c.Fragment,null,t,c.createElement(F.hK,{height:16}),c.createElement(K.A,{style:{alignItems:"center"}},c.createElement(se.A,{testID:"payment-status-title",style:{textAlign:"center",fontSize:18,fontWeight:"600",color:"#003353"}},r),c.createElement(F.hK,{height:12}),c.createElement(se.A,{style:{fontFamily:"Inter, sans-serif",textAlign:"center",marginHorizontal:30,paddingBottom:45,fontSize:14,lineHeight:21,color:"#001929"},testID:"payment-status-subtitle"},a),c.createElement(or.i,{onRedirect:u})),!!i&&c.createElement(K.A,{style:{backgroundColor:"white",borderBottomLeftRadius:20,borderBottomRightRadius:20,paddingTop:32,paddingHorizontal:20},testID:"payment-method-info"},c.createElement(Sr.c,{key:0,icon:s,title:i,subtitle:l,endIcon:c.createElement(c.Fragment,null),testID:"payment-method-item"}),c.createElement(F.hK,{height:20}),n)))})),xr=e=>{let{type:t}=e;return t===L.GG.CARD?c.createElement(q.Xlz,null):c.createElement(q.MIV,null)};var Dr=n(75562);n(21786);const Tr=e=>"loading"===e||"success"===e?"Payment is Processing":"Insufficient Funds"===e?"Insufficient funds":"cancelled"===e?"This invoice has been cancelled by the supplier":"fail"===e?"Unsuccessful":"Error"===e?"Error":"LogicalError"===e?"There has been some error":"loading"!==e&&"success"!==e&&"Insufficient Funds"!==e&&"cancelled"!==e&&"fail"!==e&&"Error"!==e&&"LogicalError"!==e?"Please Try Again":"",kr=(0,c.memo)((e=>{var t,n,o,r;let{error:a,paymentMethod:l,paymentMethodName:i,paymentMethodSubtitle:s,paymentMethodType:d,onClose:u,onContinue:m}=e;const{t:p}=(0,z.Bd)("global"),g=(0,c.useMemo)((()=>l?(e=>{const t=Ar.Ay.getFixedT(null,"global");if(e.paymentMethodType===L.GG.BANK){var n,o;const r=(null===(n=e.accountNumber)||void 0===n?void 0:n.slice(-3))||"";return{name:e.name,subtitle:"savings"===e.accountType?t("PaymentMethodsListing.business-saving",{accNum:r}):t("PaymentMethodsListing.business-checking",{accNum:r}),displayNumber:"...".concat((null===(o=e.accountNumber)||void 0===o?void 0:o.slice(-3))||""),type:e.accountType||"checking"}}if(e.paymentMethodType===L.GG.CARD){var r,a,l,i;const n=(null===(r=e.cardMetadata)||void 0===r?void 0:r.lastFour)||(null===(a=e.accountNumber)||void 0===a?void 0:a.slice(-4))||"";return{name:e.name,subtitle:"Debit"===(null===(l=e.cardMetadata)||void 0===l?void 0:l.type)?t("PaymentMethodsListing.debit-card",{accNum:n}):t("PaymentMethodsListing.credit-card",{accNum:n}),displayNumber:"...".concat(n),type:(null===(i=e.cardMetadata)||void 0===i?void 0:i.type)||"Credit"}}return{name:"",subtitle:"",displayNumber:"",type:""}})(l):null),[l]),{title:h,subtitle:v}=(0,c.useMemo)((()=>{const e=Dr.PaymentError.isPaymentError(a)?a.errorCode:null,{status:t,message:n}=Br(null!==e&&void 0!==e?e:null,a);return{title:e?t:Tr(t),subtitle:n}}),[a]);return c.createElement(Ir,{headerIcon:c.createElement(q.S_R,{style:{alignSelf:"center"}}),footer:c.createElement(c.Fragment,null,c.createElement(x.A,{testID:"payment-failed-submit-btn",style:{backgroundColor:Oo.B.blue.blue400},onPress:m},p("TabInvoice.go_back_and_try_again")),c.createElement(F.hK,{height:20})),backgroundColor:"#f5ebec",title:h,subtitle:v,paymentMethodSubtitle:null!==(t=null!==s&&void 0!==s?s:null===g||void 0===g?void 0:g.subtitle)&&void 0!==t?t:"",paymentMethodName:null!==(n=null!==i&&void 0!==i?i:null===g||void 0===g?void 0:g.name)&&void 0!==n?n:"",paymentMethodIcon:c.createElement(xr,{type:null!==(o=null!==(r=null===l||void 0===l?void 0:l.paymentMethodType)&&void 0!==r?r:d)&&void 0!==o?o:""}),onClose:u})})),Br=(e,t)=>
1{if(console.error(t),e){return{status:L.Pk[e].replace(/([a-z])([A-Z])/g,"$1 $2"),message:e}}{var n,o;const e=Ar.Ay.getFixedT(null,"errors"),r=(null===(n=t.response)||void 0===n||null===(o=n.data)||void 0===o?void 0:o.result)||e("system-failure");return{status:Fr(r,t),message:_r(t)}}},Fr=(e,t)=>{const n=Ar.Ay.getFixedT(null,"errors");return e===Dr.InsufficientFundsError.name||t.result===Dr.InsufficientFundsError.name?n("insufficient-funds"):n("LogicalError"===e?"error-occurred":"system-failure")},_r=e=>{var t,n,o;return(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.message)||(null===(o=e.data)||void 0===o?void 0:o.message)||e.message||e.toString()};var Nr=n(65700),Rr=n(88634),Lr=n(63288),Mr=function(e){return e[e.None=0]="None",e[e.SelectPurchaseType=1]="SelectPurchaseType",e[e.AddNewProject=2]="AddNewProject",e[e.SelectProject=3]="SelectProject",e[e.PlanSelection=4]="PlanSelection",e[e.DownPayment=5]="DownPayment",e[e.Payment=6]="Payment",e[e.Success=7]="Success",e[e.Error=8]="Error",e}(Mr||{});const Or=e=>{var t,n,o,r,a,l,i,s;let{invoiceId:d,invoice:u,jwtToken:m,paymentMethodName:p,userProjects:g,paymentOptions:h,invoice_connector_project:v,invoice_connector_integration_id:y,company_credit_purchaseType:b,onSuccess:f,onClose:E,onFail:C}=e;const[A,S]=(0,c.useState)(Mr.None),[w,P]=(0,c.useState)({selectedPaymentPlan:null,downPaymentMethod:null}),[I,x]=(0,c.useState)(null),[D,T]=(0,c.useState)(null),k=b===L.P_.PROJECT,B=b===L.P_.PROJECT_OR_INVENTORY,F=(0,c.useCallback)((()=>{const e=y,t=null===v||void 0===v?void 0:v.external_project_id;if(v){const n=g.length>0?g.find((n=>{var o,r;return(null===n||void 0===n||null===(o=n.connector)||void 0===o?void 0:o.integration_id)===e&&(null===n||void 0===n||null===(r=n.connector)||void 0===r?void 0:r.external_project_id)===t})):void 0;n?(x(n),S(Mr.PlanSelection)):(x(v),S(Mr.AddNewProject))}else g.length>0?S(Mr.SelectProject):S(Mr.AddNewProject)}),[y,v,g]),_=(0,c.useCallback)((async()=>{if(!g)throw new Error("user projects still empty");B?S(Mr.SelectPurchaseType):k?F():S(Mr.PlanSelection)}),[g,B,k,F]);(0,c.useEffect)((()=>{_()}),[_]);const R=(0,c.useCallback)((e=>{e===L.P_.INVENTORY?(x(null),S(Mr.PlanSelection)):F()}),[F]),M=(0,c.useCallback)((async e=>{if(A===Mr.SelectProject)return x(e),void S(Mr.PlanSelection);if(A===Mr.AddNewProject){const{jobId:t,streetAddress:n,unitNumber:o,city:r,state:a,zip:l,projectType:i,firstName:s,lastName:c}=e;let d="Default";"commercial"===i&&(d="Public"),"residential"===i&&(d="Private");const u=[n,o,a,r,l].filter(Boolean).join(", "),m={address:n,jobId:t,type:d,jobAddress:{address:n,unitNo:o,state:a,zipCode:l,city:r},primeContractorDetails:{firstName:s,lastName:c}},{data:p}=function(e){try{var t,n;const o=e,r=(0,Cr.get)(o,"address"),a=(0,Cr.get)(o,"contractValue.$numberDecimal"),l=(0,Cr.get)(o,"startDate"),i=(0,Cr.get)(o,"endDate"),s=(0,Cr.get)(o,"jobId"),c=(0,Cr.get)(o,"role"),d=(0,Cr.get)(o,"type"),u=(0,Cr.get)(o,"jobAddress"),m=(0,Cr.get)(u,"address"),p=(0,Cr.get)(u,"unitNo"),g=(0,Cr.get)(u,"state"),h=(0,Cr.get)(u,"zipCode"),v=(0,Cr.get)(u,"city"),y=(0,Cr.get)(u,"lotNumber"),b=(0,Cr.get)(u,"blockNumber"),f=(0,Cr.get)(o,"primeContractorDetails"),E=(0,Cr.get)(f,"businessName"),C=(0,Cr.get)(f,"firstName"),A=(0,Cr.get)(f,"lastName"),S=(0,Cr.get)(f,"businessPhoneNumber"),w=(0,Cr.get)(f,"businessEmail"),P=(0,Cr.get)(f,"businessAddress"),I=(0,Cr.get)(f,"state"),x=(0,Cr.get)(f,"city"),D=(0,Cr.get)(f,"zipCode"),T=(0,Cr.get)(o,"privateProjectDetails"),k=(0,Cr.get)(T,"builtFor.buildForType"),B=(0,Cr.get)(o,"publicProjectDetails"),F=(0,Cr.get)(B,"description"),_=(0,Cr.get)(B,"hasBond"),N=(0,Cr.get)(o,"federalProjectDetails.hasBond"),R=null!==(t=(0,Cr.get)(o,"individualOwners"))&&void 0!==t?t:[],L=null!==(n=(0,Cr.get)(o,"businessOwners"))&&void 0!==n?n:[];let M={group:"projectType",items:[]};return"Private"===d&&(M={group:"projectType",items:[{identifier:"type",title:"Type",content:"private",filled:!0},{identifier:"privateType",title:"Select type of private project",content:"commercial",filled:!0},{identifier:"projectBuiltFor",title:"Project is being built for:",content:null!==k&&void 0!==k?k:"",filled:!!k}]}),"Public"===d&&(M={group:"projectType",items:[{identifier:"type",title:"Type",content:"public",filled:!0},{identifier:"descriptionOfPublicProject",title:"Select type of private project",content:null!==F&&void 0!==F?F:"",filled:!!F},{identifier:"bondExists",title:"Is there a bond for this project?",content:_?"yes":"no",filled:!0},{identifier:"uploadBond",title:"Please upload a copy of the bond",content:"",filled:!1}]}),"Federal"===d&&(M={group:"projectType",items:[{identifier:"type",title:"Type",content:"federal",filled:!0},{identifier:"bondExists",title:"Is there a bond for this project?",content:N?"yes":"no",filled:!0},{identifier:"uploadBond",title:"Please upload a copy of the bond",content:"",filled:!1}]}),{address:null!==r&&void 0!==r?r:"inital project",data:{propertyAddress:{group:"propertyAddress",items:[{identifier:"address",title:"Address",content:{streetAddress:m||"",state:g||"",zip:h||"",city:v||"",unitNum:p||"",houseNum:"",subdivision:"",lotNum:y||"",blockNum:b||""},filled:!!(m||g||h||v||p||y||b)},{identifier:"jobId",title:"What is the Job ID?",content:s||"",filled:!!s},{identifier:"noticeOfCommencement",title:"Please upload a notice of commencement",content:"",filled:!1}]},projectInformation:{group:"projectInformation",items:[{identifier:"contractValue",title:"Contract value",content:a||"",filled:!!a},{identifier:"uploadContract",title:"Please upload the contract",content:"",filled:!1},{identifier:"timePeriod",title:"",content:{firstDayOnJob:l?Fo()(l).format("MM/DD/YYYY"):"",expectedLastDayOnJob:i?Fo()(i).format("MM/DD/YYYY"):""},filled:!(!l&&!i)},{identifier:"role",title:"Role on this project",content:c||"",filled:!!c},{identifier:"primeContractorDetails",title:"Tell us more about the prime contractor",content:{businessName:E||"",firstName:C||"",lastName:A||"",phone:S||"",email:w||"",businessAddress:{address:P||"",city:x||"",state:I||"",zip:D||""}},filled:!!(E||C||A||S||w||P||x||I||D)}]},projectType:M,propertyOwner:{group:"propertyOwner",items:[{identifier:"details",title:"Details",content:[...R.map((e=>({...e,type:"individual"}))),...L.map((e=>({...e,type:"business",phone:e.businessPhoneNumber,address:e.businessAddress})))],filled:!!(null!==R&&void 0!==R&&R.length||null!==L&&void 0!==L&&L.length)}]}}}}catch(o){return console.error(o),{address:"inital project"}}}(m),{data:g}=await N.Vv.Cv.create({data:{currentSection:"",data:p},address:u,connector:{integration_id:y,external_project_id:null===v||void 0===v?void 0:v.external_project_id,source_modified_date:(new Date).toISOString()}});return x(g),void S(Mr.PlanSelection)}var t;A!==Mr.PlanSelection?A!==Mr.DownPayment?A===Mr.Payment&&S(Mr.Success):S(Mr.Payment):S(null!==h&&void 0!==h&&null!==(t=h.downPaymentSettings)&&void 0!==t&&t.isRequired?Mr.DownPayment:Mr.Payment)}),[A,y,null===v||void 0===v?void 0:v.external_project_id,null===h||void 0===h||null===(t=h.downPaymentSettings)||void 0===t?void 0:t.isRequired]),O=(0,c.useCallback)((async()=>
1{if(!w.selectedPaymentPlan)throw new Error("No payment plan selected");const e=I?I._id||I.id:null;let t=d;if(!t){if(!m)throw new Dr.PaymentError("JWT token is missing",L.lI);const{invoiceId:e,errorCode:n}=await N.JZ.XX.upsertInvoiceFromJwt(m);if(n)throw new Dr.PaymentError("Error occurred while upserting invoice",n);t=e}if(!t)throw new Dr.PaymentError("Invoice ID is missing",L.lI);await N.Vv.kQ.handleLoanApplication({invoiceId:[t],paymentPlan:w.selectedPaymentPlan.id,cardId:void 0},w.downPaymentMethod,e)}),[d,m,I,w.downPaymentMethod,w.selectedPaymentPlan]),z=(0,c.useCallback)((e=>{T(e),S(Mr.Error)}),[]),j=(0,c.useCallback)((()=>{var e;(A===Mr.DownPayment&&S(Mr.PlanSelection),A===Mr.Payment)&&S(null!==h&&void 0!==h&&null!==(e=h.downPaymentSettings)&&void 0!==e&&e.isRequired?Mr.DownPayment:Mr.PlanSelection)}),[null===h||void 0===h||null===(n=h.downPaymentSettings)||void 0===n?void 0:n.isRequired,A]),W=(0,c.useCallback)((()=>{E()}),[E]),V=(0,c.useCallback)((()=>{S(Mr.AddNewProject)}),[]),H=null!==I&&void 0!==I&&I.individualOwners?null===I||void 0===I?void 0:I.individualOwners[0]:void 0,U={jobId:null===I||void 0===I?void 0:I.jobId,streetAddress:null===I||void 0===I||null===(o=I.jobAddress)||void 0===o?void 0:o.address,unitNumber:null===I||void 0===I||null===(r=I.jobAddress)||void 0===r?void 0:r.unitNo,city:null===I||void 0===I||null===(a=I.jobAddress)||void 0===a?void 0:a.city,state:null===I||void 0===I||null===(l=I.jobAddress)||void 0===l?void 0:l.state,zip:null===I||void 0===I||null===(i=I.jobAddress)||void 0===i?void 0:i.zipCode,projectType:(null===I||void 0===I||I.type,"commercial"),firstName:null===H||void 0===H?void 0:H.firstName,lastName:null===H||void 0===H?void 0:H.lastName};return c.createElement(c.Fragment,null,A===Mr.None&&null,A===Mr.PlanSelection&&c.createElement(Nr.N,{paymentOptions:h,selectedPlan:w.selectedPaymentPlan,onChange:e=>{P({...w,selectedPaymentPlan:e})},onContinue:M,onClose:W}),A===Mr.DownPayment&&w.selectedPaymentPlan&&c.createElement(Rr.k,{downPayment:null===(s=w.selectedPaymentPlan)||void 0===s?void 0:s.downPayment,paymentMethod:w.downPaymentMethod,onChange:e=>{P({...w,downPaymentMethod:e})},onContinue:M,onBack:j,onClose:W}),A===Mr.Payment&&w.selectedPaymentPlan&&c.createElement(c.Fragment,null,c.createElement(Lr.I,{invoiceIds:d?[d]:[],paymentOptions:h,paymentPlan:w.selectedPaymentPlan,downPayment:w.downPaymentMethod,onBack:j,onClose:W,onPay:O,onSuccess:M,onFailure:z,onPreviewAgreement:!d&&u&&m?()=>N.JZ.IE.makeIntegrationAgreement({paymentPlan:w.selectedPaymentPlan,jwtToken:m}):d||u?void 0:()=>Promise.resolve(null)})),A===Mr.Success&&c.createElement(rr,{onSuccess:()=>{W(),null===f||void 0===f||f()}}),A===Mr.AddNewProject&&c.createElement(sr,{initialValues:U,onCreate:M,onClose:W}),A===Mr.SelectPurchaseType&&c.createElement(fr,{onSelect:R,onClose:W}),A===Mr.SelectProject&&!!g&&c.createElement(yr,{onClose:W,onAddNewProject:V,onProjectSelected:M,isProjectForLinkingMandatory:!0}),A===Mr.Error&&D&&c.createElement(kr,{error:D,paymentMethodType:L.GG.CARD,paymentMethodSubtitle:"",paymentMethodName:p,onContinue:W,onClose:()=>{W(),C&&C()}}))},zr=e=>{let{isWeb:t,mode:n}=e;const{t:o}=(0,z.Bd)("global"),r=(0,$e.useNavigation)();let a;n&&n===yo.K.POPUP&&(a="width=800,height=600,scrollbars=yes,resizable=yes");const l=o(t?"quickbooks.go-to-app-web":"quickbooks.go-to-app-mobile");return c.createElement(Bt.A,{style:Vr.goToAppView,onPress:()=>{n?window.open("/","_blank",a):r.navigate(E.f0.Home._self)},testID:"go-to-app-button-topbar"},c.createElement(se.A,{testID:"go-to-app-topbar-title",style:Vr.goToAppText},l))},jr=e=>{let{onLogOut:t}=e;const{t:n}=(0,z.Bd)("global"),o=n("quickbooks.logout");return c.createElement(Bt.A,{style:Vr.goToAppView,onPress:t,testID:"log-out-button-topbar"},c.createElement(se.A,{testID:"log-out-topbar-title",style:Vr.goToAppText},o))},Wr=e=>{let{isWeb:t,onPress:n}=e;const{t:o}=(0,z.Bd)("global");return c.createElement(Bt.A,{style:[Vr.loginView,t?Vr.loginWebView:Vr.loginMobileView],onPress:n,testID:"login-button-toolbar"},c.createElement(se.A,{style:[Vr.loginText,t?Vr.loginTextWeb:Vr.loginTextMobile]},o("quickbooks.login")))},Vr=ie.A.create({loginView:{borderRadius:8,height:44,alignItems:"center",justifyContent:"center"},goToAppView:{alignItems:"center",justifyContent:"center",height:44,borderRadius:8,backgroundColor:"#EDF1F7",paddingHorizontal:16,maxWidth:172},loginMobileView:{paddingHorizontal:16,paddingVertical:12},loginWebView:{backgroundColor:"#00A0F3",paddingHorizontal:24,paddingVertical:16,width:100},goToAppText:{fontWeight:"700",fontFamily:"Inter",fontSize:14,lineHeight:24,textAlign:"center",color:"#335C75"},loginText:{fontFamily:"Inter",fontWeight:"700",lineHeight:24,textAlign:"center"},loginTextMobile:{color:"#00A0F3",fontSize:16},loginTextWeb:{fontSize:14,color:"#FFFFFF"}}),Hr=e=>{let{isWeb:t}=e;const{t:n}=(0,z.Bd)("global");return c.createElement(K.A,{style:[Ur.container,t?{marginTop:60}:{marginTop:90}],testID:"invoice-payment-processing-container"},c.createElement(q.lvu,null),c.createElement(K.A,{style:Ur.textsContainer,testID:"invoice-payment-processing-message"},c.createElement(se.A,{style:Ur.mainText,testID:"invoice-payment-processing-main-text"},n("quickbooks.payment-is-processing")),c.createElement(se.A,{style:Ur.infoText,testID:"invoice-payment-processing-info-text"},n("quickbooks.no-further-actions"))))},Ur=ie.A.create({container:{justifyContent:"space-between",alignItems:"center",paddingBottom:20},textsContainer:{marginTop:30},mainText:{fontFamily:"Inter",fontSize:24,fontWeight:"700",lineHeight:32,textAlign:"center",color:"#19262F",width:340},infoText:{marginTop:8,fontFamily:"Inter",fontSize:16,fontWeight:"400",lineHeight:32,textAlign:"center",color:"#19262F"}}),Gr=e=>{let{isWeb:t}=e;const{t:n}=(0,z.Bd)("global");return c.createElement(K.A,{style:[Yr.container,t?{marginTop:60}:{marginTop:90}],testID:"invoice-is-paid-container"},c.createElement(q.lvu,null),c.createElement(K.A,{style:Yr.textsContainer,testID:"invoice-is-paid-message"},c.createElement(se.A,{style:Yr.mainText,testID:"invoice-is-paid-main-text"},n("quickbooks.invoice-is-paid")),c.createElement(se.A,{style:Yr.infoText,testID:"invoice-is-paid-info-text"},n("quickbooks.no-further-actions"))))},Yr=ie.A.create({container:{justifyContent:"space-between",alignItems:"center",paddingBottom:20},textsContainer:{marginTop:30},mainText:{fontFamily:"Inter",fontSize:24,fontWeight:"700",lineHeight:32,textAlign:"center",color:"#19262F",width:300},infoText:{marginTop:8,fontFamily:"Inter",fontSize:16,fontWeight:"400",lineHeight:32,textAlign:"center",color:"#19262F"}}),Qr=ie.A.create({chooseMethodText:{fontSize:16,color:"#003353",fontWeight:"600",marginTop:34,marginBottom:16,lineHeight:21,alignSelf:"center"}}),qr=(0,c.memo)((e=>{let{onClose:t,errorCode:n}=e;const{t:o}=(0,z.Bd)("global"),r=L.Pk[n],a=r.replace(/([a-z])([A-Z])/g,"$1 $2"),l=n;return c.createElement(Ir,{headerIcon:c.createElement(q.S_R,{style:{alignSelf:"center"}}),footer:c.createElement(c.Fragment,null,c.createElement(x.A,{style:{backgroundColor:"#00A0F3"},onPress:()=>{t(r)}},o("TabInvoice.go_back_and_try_again")),c.createElement(F.hK,{height:20})),backgroundColor:"#f5ebec",title:a,subtitle:l,onClose:()=>{t(r)}})})),Kr=e=>{const[t,n]=(0,c.useState)(null),[o,r]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{(async()=>{r(!0);const t=await(async()=>{try{return await N.Vv.kQ.info()}catch(e){return console.error(e),null}})();if(!t)return e(L.lI),void r(!1);n(t),r(!1)})()}),[]),{userInfo:t,loading:o}},Jr=e=>{const[t,n]=(0,c.useState)(null),[o,r]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{(async()=>{r(!0);const t=await(async()=>{try{const{items:e}=await N.Vv.Cv.findAll({page:1,pageSize:60});return e}catch(e){return console.error(e),null}})();if(!t)return e(L.lI),void r(!1);n(t),r(!1)})()}),[]),{userProjects:t,loading:o}},Zr=(e,t)=>
1{const[n,o]=(0,c.useState)(null),[r,a]=(0,c.useState)(null),[l,i]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{(async()=>{i(!0);const n=await(async e=>{try{const t=await N.JZ.rN.show({id:e});if(!t.invoices)return null;const n=t.invoices[0],{invoices:o,...r}=t;return{invoice:n,invoiceMetadata:{...r,loanApplicationStatus:r.loanApplicationStatus||"new"}}}catch(t){return console.error(t),null}})(e);if(!n)return i(!1),t(L.lI);o(n.invoice),a(n.invoiceMetadata),i(!1)})()}),[e]),{invoice:n,invoiceMetadata:r,loading:l}};let Xr=function(e){return e[e.NONE=0]="NONE",e[e.PAY_WITH_BLUETAPE_CREDIT_FLOW=1]="PAY_WITH_BLUETAPE_CREDIT_FLOW",e[e.PAY_WITH_BANK_ACCOUNT_FLOW=2]="PAY_WITH_BANK_ACCOUNT_FLOW",e[e.PAY_WITH_CARD_FLOW=3]="PAY_WITH_CARD_FLOW",e[e.ADD_NEW_PROJECT_FLOW=4]="ADD_NEW_PROJECT_FLOW",e[e.ADD_NEW_BANK_ACOUNT=5]="ADD_NEW_BANK_ACOUNT",e[e.CONNECT_NEW_BANK_ACCOUNT=6]="CONNECT_NEW_BANK_ACCOUNT",e[e.ADD_NEW_CREDIT_CARD=7]="ADD_NEW_CREDIT_CARD",e[e.ADD_NEW_PAYMENT_METHOD=8]="ADD_NEW_PAYMENT_METHOD",e[e.NOT_ENOUGH_PERMISSIONS=9]="NOT_ENOUGH_PERMISSIONS",e}({}),$r=function(e){return e[e.NONE=0]="NONE",e[e.ADD_NEW_CREDIT_CARD=1]="ADD_NEW_CREDIT_CARD",e[e.PAYMENT_ERROR=2]="PAYMENT_ERROR",e[e.PAYMENT_SUCCESS=3]="PAYMENT_SUCCESS",e}({}),ea=function(e){return e[e.CONTACT_INFO=0]="CONTACT_INFO",e[e.ADD_NEW_PAYMENT_METHOD=1]="ADD_NEW_PAYMENT_METHOD",e[e.ADD_NEW_CREDIT_CARD=2]="ADD_NEW_CREDIT_CARD",e[e.PAY_INVOICE=3]="PAY_INVOICE",e}({});const ta=(e,t)=>({handleResetFlow:(0,c.useCallback)((()=>{e(Xr.NONE)}),[]),handlePrimaryForCreditChanged:(0,c.useCallback)((()=>{e(Xr.NONE),t()}),[t])}),na=(e,t)=>e&&[L.xi.PROCESSING,L.xi.SUCCESS].find((t=>t===e))||t&&[...L.$D,...L.Vi].find((e=>e===t))?L.X.NoActionsNeeded:L.X.SomethingWentWrong,oa=e=>{let{onPress:t,styles:n}=e;const{t:o}=(0,z.Bd)("global");return c.createElement(K.A,{style:n||{paddingHorizontal:4,paddingVertical:16,justifyContent:"center"}},c.createElement(de.BtButton,{onPress:t,testID:"IntegrationRedirectBack",style:{height:55}},o("integrations.buttons.redirect-back")))};var ra=n(97009);const aa=(0,a.PA)((e=>{var t,n,o,r,a,l,i,s,u,m;let{invoice:p,minBnplAmount:g=5,onLogOut:h,isWeb:v,mode:y,invoicePaymentStatus:b,invoiceCreditStatus:E,isInvoicePaid:C,onRedirectBack:A,jwtToken:S}=e;const{t:w}=(0,z.Bd)("global"),P=(0,$e.useNavigation)(),I=(0,$e.useRoute)(),[x,D]=(0,c.useState)(Xr.NONE),[T,k]=(0,c.useState)(null),[B,_]=(0,c.useState)(null),[R,M]=(0,c.useState)(null);let O;y&&y===yo.K.POPUP&&(O="width=800,height=600,scrollbars=yes,resizable=yes");const{invoiceMetadata:j,loading:W}=null!==p&&void 0!==p&&p.id?Zr(p.id,M):{invoiceMetadata:null,loading:!1},{userInfo:V,loading:H}=Kr(M),U=f.A.screensStore.paymentMethodsStore,G=(0,c.useRef)(!1);(0,c.useEffect)((()=>{G.current||(G.current=!0,U.fetchPaymentMethods())}),[U]);const{userProjects:Y,loading:Q}=Jr(M),{creditPaymentOptions:q,loading:K}=((e,t)=>{const[n,o]=(0,c.useState)(!0),[r,a]=(0,c.useState)(null);return(0,c.useEffect)((()=>{(async()=>{o(!0);try{const t=await N.Vv._8.jwtCreditPaymentOptions({jwtToken:e});a(t)}catch{return o(!1),t(L.lI)}finally{o(!1)}})()}),[e]),{creditPaymentOptions:r,loading:n}})(S,M),Z=(0,c.useMemo)((()=>H||U.loading||Q||K||W),[H,U.loading,Q,K,W]),X=((e,t,n,o,r,a,l)=>(0,c.useCallback)((async()=>{var i,s,c,d;if(!e)return;if(!(null===(i=e.company)||void 0===i||null===(s=i.credit)||void 0===s?void 0:s.LoCnumber)){try{await N.Vv.kQ.loanApplication();const e=window.open("/request-credit","_blank",n);o(e)}catch(m){console.error(m),l(L.lI)}return}const u=t.find((e=>e.isPrimaryForCredit));if(u)return u.isManualEntry?(a(u),void r(Xr.PAY_WITH_BLUETAPE_CREDIT_FLOW)):void(u&&u.connectionType===L.FP.PLAID&&"expired"!==(null===(c=u.plaid)||void 0===c?void 0:c.status)&&"disconnected"!==(null===(d=u.plaid)||void 0===d?void 0:d.status)?(a(u),r(Xr.PAY_WITH_BLUETAPE_CREDIT_FLOW)):r(Xr.CONNECT_NEW_BANK_ACCOUNT));r(Xr.CONNECT_NEW_BANK_ACCOUNT)}),[t,e,n]))(V,U.paymentMethods,O,k,D,_,M),$=(0,c.useMemo)((()=>window.location.origin),[]);(0,c.useEffect)((()=>{const e=e=>{e.origin===$?e.data.type===J.c.CREDIT_APPLICATION_SUBMITTED&&T&&(T.close(),k(null),window.location.reload()):console.warn("Received message from unexpected origin:",e.origin)};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[T,$]);const ee=(e=>(0,c.useCallback)((async()=>{try{await e(L.X.PaymentProcessing)}catch(t){console.error("Error handling ACH card payment success:",t)}}),[e]))(A),te=(e=>(0,c.useCallback)((async()=>{try{await e(L.X.InReview)}catch(t){console.error("Error handling BTC payment success:",t)}}),[e]))(A),ne=(e=>(0,c.useCallback)((async()=>{try{await e(L.X.SomethingWentWrong)}catch(t){console.error("Error handling payment failure:",t)}}),[e]))(A),{handleResetFlow:oe,handlePrimaryForCreditChanged:re}=ta(D,U.fetchPaymentMethods),ae=null!==V&&void 0!==V&&null!==(t=V.user)&&void 0!==t&&t.email?V.user.email:null!==V&&void 0!==V&&null!==(n=V.user)&&void 0!==n&&n.login?V.user.login:"";if(Z)return c.createElement(d.A,null);if(!p||R)return c.createElement(qr,{errorCode:null!==R&&void 0!==R?R:L.lI,onClose:e=>{A(e)}});const le=p.company.bnplPaymentAvailable&&(null===j||void 0===j?void 0:j.loanApplicationStatus)!==L.r7.REJECTED&&(null===j||void 0===j?void 0:j.currentInvoiceCreditStatus)!==L.r7.REJECTED&&!(null===q||void 0===q||!q.plans.length),ie=(null===j||void 0===j?void 0:j.acceptAchPayment)||p.company.acceptAchPayment||p.company.cardPaymentAvailable,ce=(null===V||void 0===V||null===(o=V.company)||void 0===o?void 0:o._id)===(null===(r=p.company)||void 0===r?void 0:r.id),de=(ie||le)&&!C&&!ce,ue=Number(p.total_amount)<g,me=[...L.$D,...L.Vi].includes(E);return c.createElement(Io,{email:ae,isWeb:v,button:c.createElement(jr,{onLogOut:h})},c.createElement(Ro.A,{containerStyle:{alignSelf:"center"},contentContainerStyle:{height:"100%"},footer:(()=>
1{if(C){const e=na(b,E);return c.createElement(oa,{onPress:()=>A(e),styles:{paddingHorizontal:24,paddingVertical:32,justifyContent:"center"}})}return null})()},c.createElement(zo,{name:(null===(a=p.company)||void 0===a?void 0:a.name)||"",phone:(null===(l=p.company)||void 0===l?void 0:l.phone)||"",totalAmount:Number(p.total_amount),style:{paddingVertical:20,flexDirection:"row"}}),c.createElement(No.A,{style:{marginBottom:14}}),c.createElement(Uo,{type:p.type,invoice_number:p.invoice_number,invoice_due_date:p.invoice_due_date}),(C&&b===N.bx.xi.SUCCESS||E===L.r7.CLOSED)&&c.createElement(Gr,{isWeb:v}),(me&&E!==L.r7.CLOSED||C&&b===N.bx.xi.PROCESSING)&&c.createElement(Hr,{isWeb:v}),de&&c.createElement(se.A,{style:Qr.chooseMethodText},w("InvoiceDetails.choose-method")),le&&!C&&!ce&&c.createElement(c.Fragment,null,c.createElement(Qo,{currentInvoiceCreditStatus:E,amountLessThanMin:Number(p.total_amount)<g,onPress:X,showInfo:!0,disabled:me||ue}),c.createElement(F.hK,{height:23})),!C&&ie&&!ce&&c.createElement(c.Fragment,null,c.createElement(ra.Z,{invoices:[p],withBanks:j.acceptAchPayment,withCards:j.cardPaymentAvailable,navigation:P,route:I,onSuccess:ee,onError:ne}),c.createElement(F.hK,{height:43})),x===Xr.PAY_WITH_BLUETAPE_CREDIT_FLOW&&B&&p&&Y&&V&&q&&c.createElement(Or,{invoiceId:p.id,invoice:p,jwtToken:S,companyName:p.company.name,paymentMethodName:B.name,onClose:oe,onSuccess:te,onFail:ne,userProjects:Y,paymentOptions:q,invoice_connector_project:null===(i=p.connector)||void 0===i?void 0:i.project,invoice_connector_integration_id:null===(s=p.connector)||void 0===s?void 0:s.integration_id,company_credit_purchaseType:null===(u=V.company)||void 0===u||null===(m=u.credit)||void 0===m?void 0:m.purchaseType}),x===Xr.CONNECT_NEW_BANK_ACCOUNT&&c.createElement(er,{onClose:oe,onPrimaryForCreditChanged:re})))})),la=e=>{let{onPress:t,styles:n,title:o}=e;return c.createElement(K.A,{testID:"footer-login-btn-container",style:n||{paddingHorizontal:4,paddingVertical:16,justifyContent:"center"}},c.createElement(de.BtButton,{onPress:t,testID:"footer-login-btn",style:{height:55}},o))},ia=(0,p.PA)((e=>{let{invoice:t,isInvoicePaid:n,onPress:o,invoicePaymentStatus:r,invoiceCreditStatus:a,onRedirectBack:l,isWeb:i}=e;const{t:s}=(0,z.Bd)("global");return c.createElement(Ro.A,{containerStyle:{alignSelf:"center"},contentContainerStyle:{height:"100%"},footer:(()=>{if(n){const e=na(r,a);return c.createElement(oa,{onPress:()=>l(e),styles:{paddingHorizontal:24,paddingVertical:32,justifyContent:"center"}})}return n?null:c.createElement(la,{title:s("integrations.buttons.login-to-pay"),onPress:o,styles:{paddingHorizontal:24,paddingVertical:32,justifyContent:"center"}})})(),styleWidth:i?null:"100%"},c.createElement(zo,{name:t.company.name,phone:t.company.phone,totalAmount:Number(t.total_amount),style:{paddingVertical:20,flexDirection:"row"}}),c.createElement(No.A,{style:{marginBottom:14}}),c.createElement(Uo,{type:t.type,invoice_number:t.invoice_number,invoice_due_date:t.invoice_due_date}),(n&&r===L.xi.SUCCESS||a===L.r7.CLOSED)&&c.createElement(Gr,{isWeb:i}),(n&&a!==L.r7.CLOSED||n&&r===L.xi.PROCESSING)&&c.createElement(Hr,{isWeb:i}))}));let sa=function(e){return e[e.HOME=0]="HOME",e[e.PASSWORD=1]="PASSWORD",e[e.USER_INFO_FORM=2]="USER_INFO_FORM",e}({});const ca=e=>{let{initialStep:t=sa.HOME,onLogin:n,onSuccess:o,onUserExists:r}=e;const a=(0,$e.useNavigation)(),l=(0,$e.useRoute)(),{setValue:i,setLogin:s}=Je.A,{setCodeVerifier:d}=D.A,[u,m]=(0,c.useState)(t);(0,c.useEffect)((()=>{i("type","password"),s(Je.A.email)}),[s,i]);const p=(0,c.useCallback)((async()=>{u===sa.HOME&&m(sa.PASSWORD),sa.PASSWORD===u&&m(sa.USER_INFO_FORM)}),[u]),g=(0,c.useCallback)((async()=>{sa.PASSWORD===u&&m(sa.HOME),u===sa.USER_INFO_FORM&&m(sa.PASSWORD)}),[u]),h=(0,c.useCallback)((e=>{d(!1),e&&n()}),[n,d]);return c.createElement(c.Fragment,null,u===sa.HOME&&c.createElement(U.A,{onContinue:p,navigation:a,dontNavigate:h,route:l,onUserExists:r}),u===sa.PASSWORD&&c.createElement(Y.A,{onContinue:p,onBack:g,dontNavigate:h,navigation:a}),u===sa.USER_INFO_FORM&&c.createElement(G.A,{navigation:a,onBack:g,dontNavigate:h,onSuccessSignUp:o}))};var da=n(58319),ua=function(e){return e[e.IDLE=0]="IDLE",e[e.SIGN_IN=1]="SIGN_IN",e[e.SIGN_UP=2]="SIGN_UP",e[e.INVOICE_DETAILS=3]="INVOICE_DETAILS",e}(ua||{});const ma=(0,a.PA)((e=>{var t;let{route:n}=e;const{userStore:o}=l.A,{remoteConfig:r}=(0,l.P)(),{isAuthenticated:a,setIsAuthenticated:i,setAuthState:s,user:u}=o,[p,g]=(0,c.useState)(window.innerWidth),[h,v]=(0,c.useState)(bo.SIGN_IN_LOGIN),[y,b]=(0,c.useState)({});function f(){g(window.innerWidth)}(0,c.useEffect)((()=>(window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)})),[]);const E=p>575,{jwt:C,mode:A,redirectUrl:S}=null!==(t=null===n||void 0===n?void 0:n.params)&&void 0!==t?t:{},[w,P]=(0,c.useState)(ua.IDLE),I=r.get("de_min_approval_amount")||5,{invoice:x,loading:D,errorCode:T,isInvoicePaid:k,invoiceCreditStatus:B,invoicePaymentStatus:F}=_o(C),_=(0,c.useCallback)((async()=>{[ua.SIGN_IN,ua.SIGN_UP].includes(w)&&a&&P(ua.INVOICE_DETAILS)}),[w,a]),R=(0,c.useCallback)((()=>{w===ua.SIGN_UP&&P(ua.SIGN_IN),w===ua.SIGN_IN&&P(ua.SIGN_UP)}),[w]),L=(0,c.useCallback)((e=>{b(e),v(bo.SIGN_IN_PASSWORD),P(ua.SIGN_IN)}),[]),M=(0,c.useCallback)((async()=>{w!==ua.IDLE||a||P(ua.SIGN_IN)}),[w,a]),O=(0,c.useCallback)((async e=>{var t,n,o,r;if(A===yo.K.POPUP)console.log("paymentSuccess"),null===(t=window)||void 0===t||null===(n=t.opener)||void 0===n||n.postMessage({status:e},"*"),null===(o=window)||void 0===o||null===(r=o.parent)||void 0===r||r.postMessage({status:e},"*");else if(A===yo.K.REDIRECT&&S){const t=new URL(S);t.searchParams.append("status",e),window.location.href=t.toString()}}),[A,S]),z=(0,c.useCallback)((async()=>
1{console.log("Log out, clearing session"),await N.JZ.kQ.logout(),s(null),i(!1),m.A.remove("session"),da.q.clear(),await ro.A.auth().signOut(),P(ua.IDLE)}),[s,i]);return(0,c.useEffect)((()=>{x&&a&&!k&&P(ua.INVOICE_DETAILS)}),[x,a,k]),D?c.createElement(d.A,null):T?c.createElement(qr,{errorCode:T,onClose:O}):c.createElement(c.Fragment,null,w===ua.SIGN_IN&&c.createElement(fo,{onSuccess:_,onSignUp:R,initialStep:h,initialState:y,mode:A}),w===ua.SIGN_UP&&c.createElement(ca,{onSuccess:_,onLogin:R,onUserExists:L}),w===ua.INVOICE_DETAILS&&c.createElement(aa,{invoice:x,minBnplAmount:I,onLogOut:z,onRedirectBack:O,invoiceCreditStatus:B,invoicePaymentStatus:F,isInvoicePaid:!!k,jwtToken:C,mode:A,isWeb:E}),w===ua.IDLE&&(E?c.createElement(Io,{email:null!==u&&void 0!==u&&u.email?u.email:null!==u&&void 0!==u&&u.login?u.login:"",isWeb:E},c.createElement(ia,{invoice:x,invoicePaymentStatus:F,isInvoicePaid:!!k,invoiceCreditStatus:B,onRedirectBack:O,onPress:M,isWeb:E})):c.createElement(ia,{invoice:x,invoicePaymentStatus:F,isInvoicePaid:!!k,invoiceCreditStatus:B,onRedirectBack:O,onPress:M,isWeb:E})))})),pa=async e=>{let{invoiceId:t,invoiceNumber:n,supplierCompanyId:o}=e;try{const e=await N.JZ.rN.show({id:t,invoiceNumber:n,supplierCompanyId:o});if(!e.invoices)return null;const r=e.invoices[0],{invoices:a,...l}=e;return{invoice:r,invoiceMetadata:{...l,loanApplicationStatus:l.loanApplicationStatus||"new"}}}catch(r){return console.error(r),null}},ga=(e,t,n)=>{const[o,r]=(0,c.useState)(!0),[a,l]=(0,c.useState)(null);return(0,c.useEffect)((()=>{if(!e)return l(null),void r(!1);(async()=>{r(!0);try{const n=await N.Vv._8.creditPaymentOptions({invoiceId:e,totalAmount:t});l(n)}catch(o){return console.error(o),void n(L.lI)}finally{r(!1)}})()}),[e,t]),{creditPaymentOptions:a,loading:o}};var ha=n(94435),va=(n(25891),n(22759),n(30404));const ya=e=>{let{showText:t=!0}=e;const{t:n}=(0,z.Bd)("global");return t?c.createElement(ha.gn,{color:"#CCD6DD",containerStyle:{marginBottom:20}},c.createElement(se.A,{style:ba.orText},n("InvoiceDetails.or"))):c.createElement(K.A,{style:{marginBottom:20}},c.createElement(ha.Hr,{color:"#CCD6DD"}))},ba=ie.A.create({listItem:{borderWidth:1,borderColor:"#CCD6DD",height:72,borderRadius:8},orText:{fontWeight:"400",fontSize:12,color:"#99ADBA"},header:{height:va.u,marginBottom:12,flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:"#FFFFFF",paddingHorizontal:20,borderBottomWidth:1,borderBottomColor:"#F5F7F8"},achDiscountView:{height:48,width:"96%",borderRadius:8,backgroundColor:"rgba(0, 160, 243, 0.05)",paddingVertical:14,paddingHorizontal:18,flexDirection:"row",marginBottom:14,marginHorizontal:9},compactAchDiscountView:{height:26,width:300,borderRadius:12,backgroundColor:"rgba(0, 160, 243, 0.05)",paddingVertical:5,paddingHorizontal:10,flexDirection:"row",alignSelf:"center"},compactAchDiscountText:{fontWeight:"700",fontSize:12,lineHeight:16,color:"#00A0F3"},achDiscountText:{fontWeight:"700",fontSize:14,lineHeight:21,color:"#00A0F3"}}),fa=(e,t,n,o,r,a)=>(0,c.useCallback)((async()=>{var l,i,s,c;if(!e)return;if(!(null===(l=e.company)||void 0===l||null===(i=l.credit)||void 0===i?void 0:i.LoCnumber)){try{await N.Vv.kQ.loanApplication();const e=window.open("/request-credit","_blank",a);n(e)}catch(u){console.error(u)}return}const d=t.find((e=>e.isPrimaryForCredit));if(d)return d.isManualEntry?(r(d),void o(Xr.PAY_WITH_BLUETAPE_CREDIT_FLOW)):void(d&&d.connectionType===L.FP.PLAID&&"expired"!==(null===(s=d.plaid)||void 0===s?void 0:s.status)&&"disconnected"!==(null===(c=d.plaid)||void 0===c?void 0:c.status)?(r(d),o(Xr.PAY_WITH_BLUETAPE_CREDIT_FLOW)):o(Xr.CONNECT_NEW_BANK_ACCOUNT));o(Xr.CONNECT_NEW_BANK_ACCOUNT)}),[t,e,a]),Ea=(e,t,n,o)=>{n===yo.K.POPUP?(e=>{var t,n,o,r;null===(t=window)||void 0===t||null===(n=t.opener)||void 0===n||n.postMessage({type:"success"===e?J.c.PAYMENT_SUCCESS:J.c.PAYMENT_FAIL},"*"),null===(o=window)||void 0===o||null===(r=o.parent)||void 0===r||r.postMessage({type:"success"===e?J.c.PAYMENT_SUCCESS:J.c.PAYMENT_FAIL},"*")})(e):n===yo.K.REDIRECT&&o?((e,t)=>{const n=new URL(t);n.searchParams.append("paymentStatus",e),window.location.href=n.toString()})(e,o):t.navigate(E.f0.Home._self)},Ca=e=>{let{email:t,navigation:n,mode:o,redirectUrl:r}=e;Ea("[email protected]"===t?"fail":"success",n,o,r)},Aa=e=>{let{navigation:t,mode:n,redirectUrl:o}=e;Ea("fail",t,n,o)};let Sa=function(e){return e.NetSuite="NetSuite",e}({});const wa=e=>{let{isWeb:t,email:n,onPress:o}=e;const{t:r}=(0,z.Bd)("global");return c.createElement(Io,{email:n,isWeb:t},c.createElement(K.A,{style:[Pa.container,t?{marginTop:60}:{marginTop:90}
1],testID:"not-enough-permissions-container"},c.createElement(q.YQQ,null),c.createElement(K.A,{style:Pa.textsContainer,testID:"not-enough-permissions-message"},c.createElement(se.A,{style:Pa.mainText,testID:"not-enough-permissions-main-title"},r("integrations.not-enough-permissions-text")),c.createElement(se.A,{style:Pa.infoText,testID:"not-enough-permissions-info-title"},r("integrations.not-enough-permissions-info"))),c.createElement(la,{onPress:o,title:r("integrations.buttons.login-to-another-account"),styles:{paddingVertical:32,justifyContent:"center",width:354}})))},Pa=ie.A.create({container:{justifyContent:"space-between",alignItems:"center",paddingBottom:20},textsContainer:{marginTop:38},mainText:{fontFamily:"Inter",fontSize:24,fontWeight:"700",lineHeight:32,textAlign:"center",color:"#19262F",maxWidth:581},infoText:{marginTop:8,fontFamily:"Inter",fontSize:16,fontWeight:"400",lineHeight:32,textAlign:"center",color:"#19262F"}});var Ia=n(80232),xa=n(61144);const Da=e=>{let{status:t}=e;const{t:n}=(0,z.Bd)("global");return c.createElement(c.Fragment,null,c.createElement(K.A,{style:{flexDirection:"row",justifyContent:"space-between",paddingTop:4},testID:"invoice-status-info-container"},c.createElement(se.A,{style:(0,Ao.composeStyle)(Ta.normalText,{maxWidth:"50%"}),testID:"invoice-status-title"},n("integrations.invoice.status")),c.createElement(Ia.V,{status:t,statusOptionsProvider:xa.O})),c.createElement(No.A,{style:{marginTop:12,marginBottom:14},testID:"divider"}))},Ta=ie.A.create({normalText:{fontSize:14,fontWeight:"500",lineHeight:21,color:"#99ADBA"}});var ka=n(25207);const Ba=e=>{var t,n,o,r;let{invoice:a,additionalFields:l=[],buttons:i=[],footer:s,backgroundColor:d}=e;return c.createElement(K.A,{style:[_a.container,{backgroundColor:d}]},c.createElement(zo,{name:null!==(t=null===(n=a.company)||void 0===n?void 0:n.name)&&void 0!==t?t:"",phone:null!==(o=null===(r=a.company)||void 0===r?void 0:r.phone)&&void 0!==o?o:"",totalAmount:Number(a.total_amount),style:{paddingTop:20,flexDirection:"row",paddingBottom:14}}),c.createElement(No.A,{style:{marginBottom:14}}),c.createElement(Uo,{type:a.type,invoice_number:a.invoice_number,invoice_due_date:a.invoice_due_date,addressType:a.addressType,address:a.address,attention:a.attention,invoice_document:a.invoice_document}),l.length>0&&c.createElement(Fa,{additionalFields:l}),s&&c.createElement(K.A,{style:_a.footer},s),c.createElement(K.A,{style:_a.buttonContainer},i.map((e=>c.createElement(ka.A,{onPress:e.onPress,buttonStyle:[_a.button,e.style],textStyle:e.textStyle,disabled:e.disabled,testID:e.testID,label:e.label})))))},Fa=e=>{let{additionalFields:t,rowStyle:n}=e;return c.createElement(K.A,null,t.map(((e,t)=>c.createElement(c.Fragment,{key:t},c.createElement(K.A,{style:[_a.fieldRow,n]},c.createElement(se.A,{style:[_a.fieldText,e.labelStyle]},e.label),c.createElement(K.A,{style:_a.fieldValueContainer},"string"===typeof e.value||"number"===typeof e.value?c.createElement(se.A,{style:[_a.fieldText,_a.valueText,e.valueStyle]},e.value):e.value)),c.createElement(No.A,{style:{marginVertical:14}})))))},_a=ie.A.create({container:{padding:20,paddingBottom:8,backgroundColor:"#fff",borderRadius:8,shadowColor:"#000",shadowOpacity:.1,shadowRadius:5,shadowOffset:{width:0,height:2},maxWidth:600},fieldRow:{flexDirection:"row",justifyContent:"space-between",marginTop:14},fieldText:{fontSize:14,fontFamily:"Inter",fontWeight:"500",lineHeight:21,color:"#394D5A"},valueText:{color:"#001929"},fieldValueContainer:{maxWidth:"60%",alignItems:"flex-end"},buttonContainer:{marginTop:20},button:{marginBottom:12},footer:{marginTop:20,alignItems:"center"}}),Na=e=>{var t,n;let{invoice:o}=e;return c.createElement(c.Fragment,null,c.createElement(zo,{name:(null===(t=o.company)||void 0===t?void 0:t.name)||"",phone:(null===(n=o.company)||void 0===n?void 0:n.phone)||"",totalAmount:Number(o.total_amount),style:{paddingVertical:20,flexDirection:"row"}}),c.createElement(No.A,{testID:"divider"}),c.createElement(Uo,{type:o.type,invoice_number:o.invoice_number,invoice_due_date:o.invoice_due_date,addressType:o.addressType,address:o.address,attention:o.attention,invoice_document:o.invoice_document}))},Ra=ie.A.create({container:{maxWidth:212,alignSelf:"center",marginVertical:30},message:{fontSize:16,fontWeight:"500",fontFamily:"Inter",lineHeight:32,color:"#19262F",textAlign:"center"}}),La=()=>{const{t:e}=(0,z.Bd)("global");return c.createElement(K.A,{style:Ra.container},c.createElement(se.A,{style:Ra.message},e("integrations.factoringQuoteWarning.message")))},Ma=(0,a.PA)((e=>{var t,n,o,r,a,l,i,s,u,m,p;let{invoiceId:g,minBnplAmount:h=5,onLogOut:v,onPermissionDenied:y,isWeb:b,mode:E,redirectUrl:C}=e;null===(t=window)||void 0===t||null===(n=t.opener)||void 0===n||n.postMessage({type:J.c.CONNECTION_ESTABLISHED},"*"),null===(o=window)||void 0===o||null===(r=o.parent)||void 0===r||r.postMessage({type:J.c.CONNECTION_ESTABLISHED},"*");const A=(0,$e.useNavigation)(),S=(0,$e.useRoute)(),{t:w}=(0,z.Bd)("global"),[P,I]=(0,c.useState)(Xr.NONE),[x,D]=(0,c.useState)(null),[T,k]=(0,c.useState)(null),[B,_]=(0,c.useState)(null),R=window.location.origin;let M;E&&E===yo.K.POPUP&&(M="width=800,height=600,scrollbars=yes,resizable=yes");const{invoice:O,invoiceMetadata:j,loading:W,isInvoicePaid:V,invoicePaymentStatus:H}=((e,t)=>{const[n,o]=(0,c.useState)(null),[r,a]=(0,c.useState)(null),[l,i]=(0,c.useState)(null),[s,d]=(0,c.useState)(null),[u,m]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{(async()=>{m(!0);const n=await pa({invoiceId:e});if(!n)return t(L.lI),void m(!1);const r=await N.Vv.SU.checkInvoiceIsPaid({invoiceId:e});o(n.invoice),d(n.invoiceMetadata),a(null===r||void 0===r?void 0:r.status),i(null===r||void 0===r?void 0:r.isPaid),m(!1)})()}),[e]),{invoice:n,invoiceMetadata:s,loading:u,isInvoicePaid:l,invoicePaymentStatus:r}})(g,k),{userInfo:U,loading:G}=Kr(k),Y=f.A.screensStore.paymentMethodsStore,Q=(0,c.useRef)(!1);(0,c.useEffect)((()=>{Q.current||(Q.current=!0,Y.fetchPaymentMethods())}),[Y]);const{userProjects:q,loading:Z}=Jr(k),{creditPaymentOptions:X,loading:$}=ga(g,Number(null===O||void 0===O?void 0:O.total_amount),k),ee=W||G||Y.loading||Z||$,{handleResetFlow:te,handlePrimaryForCreditChanged:ne}=ta(I,Y.fetchPaymentMethods),oe=(0,c.useMemo)((()=>{var e,t;return(null===U||void 0===U||null===(e=U.user)||void 0===e?void 0:e.email)||(null===U||void 0===U||null===(t=U.user)||void 0===t?void 0:t.login)||""}),[U]);(0,c.useEffect)((()=>{var e,t,n;(null===O||void 0===O||null===(e=O.connector)||void 0===e?void 0:e.connector_type)===Sa.NetSuite&&(O.customerCompanyId&&O.customerCompanyId!==(null===U||void 0===U||null===(t=U.company)||void 0===t?void 0:t._id)&&(null===O||void 0===O?void 0:O.company_id)!==(null===U||void 0===U||null===(n=U.company)||void 0===n?void 0:n._id)&&I(Xr.NOT_ENOUGH_PERMISSIONS))}),[O,U]);const re=fa(U,Y.paymentMethods,D,I,_,M),ae=(0,c.useCallback)((()=>{console.log("paymentSuccess",oe),Ca({email:oe,navigation:A,mode:E,redirectUrl:C})}),[oe,E,C]),le=(0,c.useCallback)((()=>{console.log("paymentFail"),Aa({navigation:A,mode:E,redirectUrl:C})}),[E,C]);if((0,c.useEffect)((()=>{const e=e=>{e.origin===R?e.data.type===J.c.CREDIT_APPLICATION_SUBMITTED&&x&&(x.close(),D(null),window.location.reload()):console.warn("Received message from unexpected origin:",e.origin)};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[x,R]),ee)return c.createElement(d.A,null);if(!O||!j||T)return c.createElement(c.Fragment,null);if(P===Xr.NOT_ENOUGH_PERMISSIONS)return c.createElement(wa,{email:oe,isWeb:b,onPress:y});const ie=(null===U||void 0===U||null===(a=U.company)||void 0===a?void 0:a._id)===(null===O||void 0===O?void 0:O.company_id),ce=O.type===N.tD.QUOTE,de=Number(O.total_amount)<h,ue=O.status===L.uR.draft,me=j.bnplPaymentAvailable&&j.currentInvoiceCreditStatus!==L.r7.REJECTED&&j.loanApplicationStatus!==L.r7.REJECTED&&!(null===X||void 0===X||!X.plans.length),pe=j.currentInvoiceCreditStatus,ge=[...L.$D,...L.Vi].includes(pe),he=!ie&&!V&&!ge,ve=ce&&(null===(l=O.paymentDetails)||void 0===l?void 0:l.paymentType)===N.mn.FACTORING,ye=j.acceptAchPayment||j.cardPaymentAvailable,be=(ye||me||(null===O||void 0===O?void 0:O.isPaymentMethodsAdded))&&he&&!ve;return c.createElement(Io,{email:oe,isWeb:b,button:E?c.createElement(jr,{onLogOut:v}):c.createElement(zr,{isWeb:b,mode:E})},b&&c.createElement(K.A,{style:{width:486,alignSelf:"center",marginBottom:60,marginTop:42}}
1,c.createElement(Ba,{invoice:O,additionalFields:!ie||V||ge?[]:[{label:w("integrations.invoice.status"),value:c.createElement(Ia.V,{status:null!==(i=O.status)&&void 0!==i?i:L.uR.placed,statusOptionsProvider:xa.O})}],backgroundColor:"#F8F9F9"})),c.createElement(Ro.A,{containerStyle:{alignSelf:"center"},contentContainerStyle:{height:"100%"}},!b&&c.createElement(Na,{invoice:O}),!b&&ie&&!V&&!ge&&c.createElement(Da,{status:O.status||L.uR.placed}),(V&&H===N.bx.xi.SUCCESS||pe===L.r7.CLOSED)&&c.createElement(Gr,{isWeb:b}),(ge&&pe!==L.r7.CLOSED||V&&H===N.bx.xi.PROCESSING)&&c.createElement(Hr,{isWeb:b}),be&&c.createElement(se.A,{style:Qr.chooseMethodText,testID:"choose-payment-method-title"},w("InvoiceDetails.choose-method")),me&&he&&!ve&&c.createElement(c.Fragment,null,c.createElement(Qo,{currentInvoiceCreditStatus:j.currentInvoiceCreditStatus,amountLessThanMin:Number(O.total_amount)<h,onPress:re,showInfo:!0,disabled:ge||de||ue}),c.createElement(F.hK,{height:23}),!(ge||de||ue||ce)&&c.createElement(ya,null)),he&&ye&&!ce&&c.createElement(c.Fragment,null,c.createElement(ra.Z,{invoices:[O],withBanks:j.acceptAchPayment,withCards:j.cardPaymentAvailable,navigation:A,route:S,onSuccess:ae,onError:le}),c.createElement(F.hK,{height:43})),ve&&c.createElement(La,null),P===Xr.PAY_WITH_BLUETAPE_CREDIT_FLOW&&B&&O&&q&&U&&X&&c.createElement(Or,{invoiceId:g,companyName:O.company.name,paymentMethodName:B.name,onClose:te,onSuccess:ae,onFail:le,userProjects:q,paymentOptions:X,invoice_connector_project:null===(s=O.connector)||void 0===s?void 0:s.project,invoice_connector_integration_id:null===(u=O.connector)||void 0===u?void 0:u.integration_id,company_credit_purchaseType:null===(m=U.company)||void 0===m||null===(p=m.credit)||void 0===p?void 0:p.purchaseType}),P===Xr.CONNECT_NEW_BANK_ACCOUNT&&c.createElement(er,{onClose:te,onPrimaryForCreditChanged:ne})))}));var Oa=n(44859);const za=e=>{let{children:t}=e;return c.createElement(K.A,{style:{paddingHorizontal:20,marginBottom:27}},t)},ja=e=>{let{children:t}=e;return c.createElement(K.A,{style:{paddingHorizontal:20,height:92,justifyContent:"space-between",marginBottom:27}},t)},Wa=(0,p.PA)((e=>{var t,n,o;let{invoice:r,invoiceCreditExist:a,isInvoicePaid:i,onPressLogin:s,onPressSignUp:d,onPressPayAsGuest:u,invoicePaymentStatus:m,invoiceCreditStatus:p,isWeb:g,customer:h}=e;const{branding:v}=l.A,{t:y}=(0,z.Bd)("global"),b=i||a,f=r.type===N.tD.QUOTE&&(null===(t=r.paymentDetails)||void 0===t?void 0:t.paymentType)===N.mn.FACTORING,{mobileWidth:E}=(0,Zo.Qs)(),C=r.type===N.tD.QUOTE,A=l.A.remoteConfig.acceptCards&&r.company.cardPaymentAvailable&&!C;return c.createElement(Ro.A,{containerStyle:{alignSelf:"center"},contentContainerStyle:{height:"100%",paddingTop:g?42:0},footer:c.createElement(c.Fragment,null,!g&&(()=>{if(b)return null;if(f)return null;if(null!==h&&void 0!==h&&h.isAuthorized)return c.createElement(za,null,c.createElement(ka.A,{label:y("integrations.buttons.login-and-pay"),onPress:s,buttonStyle:{height:50},textStyle:{fontSize:14}}));const e=h?{label:y("integrations.buttons.sign-up-and-pay"),onPress:d}:{label:y("integrations.buttons.login-to-pay"),onPress:s};return A?c.createElement(ja,null,c.createElement(ka.A,{label:e.label,onPress:e.onPress,buttonStyle:{height:40},textStyle:{fontSize:14}}),c.createElement(ka.A,{label:y("integrations.buttons.pay-by-card"),onPress:u,buttonStyle:{backgroundColor:"#F8F9F9",height:40},textStyle:{color:"#001929",fontSize:14}})):c.createElement(za,null,c.createElement(ka.A,{label:e.label,onPress:e.onPress,buttonStyle:{height:40},textStyle:{fontSize:14}}))})(),!!v&&b&&!g&&c.createElement(K.A,{style:Va.poweredByContainer},c.createElement(Co._,null))),styleWidth:g?500:"100%",toolbar:!g&&c.createElement(Po,{button:b&&c.createElement(Wr,{isWeb:g,onPress:s})})},g?c.createElement(Ba,{invoice:{company:{name:r.company.name,phone:r.company.phone},total_amount:Number(r.total_amount),type:r.type,invoice_number:r.invoice_number,invoice_due_date:r.invoice_due_date},buttons:g?(()=>{if(f)return[];if(b)return[{label:y("integrations.buttons.pay-invoice"),onPress:()=>{},disabled:!0}];if(null!==h&&void 0!==h&&h.isAuthorized)return[{label:y("integrations.buttons.login-to-pay"),onPress:s}];const e=[h?{label:y("integrations.buttons.sign-up-and-pay"),onPress:d}:{label:y("integrations.buttons.login-to-pay"),onPress:s}];return A&&e.push({label:y("integrations.buttons.pay-by-card"),onPress:u,style:{backgroundColor:"#FFFFFF"},textStyle:{color:"#001929"}}),e})():[],footer:b?c.createElement(Oa.ye,null):void 0,backgroundColor:"#F8F9F9"}
1):c.createElement(K.A,{style:[Va.container,{width:E>576?"100%":E-40}]},c.createElement(zo,{name:(null===(n=r.company)||void 0===n?void 0:n.name)||"",phone:(null===(o=r.company)||void 0===o?void 0:o.phone)||"",totalAmount:Number(r.total_amount),style:{paddingVertical:20,flexDirection:"row"}}),c.createElement(No.A,{testID:"divider"}),c.createElement(Uo,{type:r.type,invoice_number:r.invoice_number,invoice_due_date:r.invoice_due_date})),(i&&m===N.bx.xi.SUCCESS||p===L.r7.CLOSED)&&c.createElement(Gr,{isWeb:g}),(a&&p!==L.r7.CLOSED||i&&m===N.bx.xi.PROCESSING)&&c.createElement(Hr,{isWeb:g}),f&&c.createElement(La,null))})),Va=ie.A.create({container:{display:"flex",justifyContent:"center",marginTop:16,maxWidth:"100%",width:350},poweredByContainer:{display:"flex",justifyContent:"center",alignItems:"flex-end",borderTopWidth:1,borderTopColor:"#E6EBEE",paddingTop:10,marginBottom:18,paddingRight:10}});var Ha=n(53941);const Ua=e=>{let{containerStyle:t,titleStyle:n,infoStyle:o}=e;const{t:r}=(0,z.Bd)("global"),a=(0,Ha.A)();return c.createElement(K.A,{style:[Ga.container,t],testID:"invoice-payment-processing-container"},a?c.createElement(q.Gcy,null):c.createElement(q.dWy,null),c.createElement(K.A,{style:Ga.textsContainer,testID:"invoice-processed-message"},c.createElement(se.A,{style:[Ga.mainText,n],testID:"invoice-processed-main-text"},r(a?"integrations.pay-as-guest.invoice-processed.mobile-title":"integrations.pay-as-guest.invoice-processed.title")),c.createElement(se.A,{style:[Ga.infoText,o],testID:"invoice-processed-info-text"},r(a?"integrations.pay-as-guest.invoice-processed.mobile-info":"integrations.pay-as-guest.invoice-processed.info"))))},Ga=ie.A.create({container:{justifyContent:"space-between",alignItems:"center",marginBottom:30,maxWidth:"94%"},textsContainer:{marginTop:30,justifyContent:"center",alignItems:"center"},mainText:{fontFamily:"Inter",fontSize:24,fontWeight:"700",lineHeight:32,textAlign:"center",color:"#19262F",maxWidth:"100%"},infoText:{marginTop:8,fontFamily:"Inter",fontSize:16,fontWeight:"400",lineHeight:32,textAlign:"center",color:"#19262F",maxWidth:"100%"}}),Ya=e=>{let{label:t,value:n,isBold:o=!1,divider:r=!1}=e;return c.createElement(K.A,{style:[qa.row,r&&qa.rowWithDivider]},c.createElement(se.A,{style:[qa.rowLabel,o&&qa.boldValue]},t),c.createElement(se.A,{style:[qa.rowLabel,qa.rowValue,o&&qa.boldValue]},n))},Qa=ie.A.create({modalContainer:{width:"100%",flex:1,padding:20},headerContainer:{marginBottom:20},title:{fontSize:18,lineHeight:32,fontFamily:"Inter",fontWeight:"700",color:"#001929"},tableContainer:{marginBottom:20}}),qa=ie.A.create({row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:10},rowWithDivider:{borderBottomWidth:1,borderBottomColor:"#EBEEEF",paddingBottom:20,marginBottom:10},rowLabel:{fontFamily:"Inter",fontSize:14,fontWeight:"400",lineHeight:24,color:"#001929"},rowValue:{fontWeight:"500",maxWidth:"50%",textAlign:"right"},boldValue:{fontWeight:"700",fontSize:16}}),Ka=e=>{var t,n;let{invoice:o,paymentMethodData:r}=e;const{t:a}=(0,z.Bd)("global"),l=[{label:a("integrations.pay-as-guest.payment-details.supplier"),value:o.company.name},{label:a("integrations.pay-as-guest.payment-details.invoice-num"),value:"#"+o.invoice_number},{label:a("integrations.pay-as-guest.payment-details.invoice-due-date"),value:o.invoice_due_date},{label:a("integrations.pay-as-guest.payment-details.payment-method"),value:(()=>{const{card:e}=r,t=e.accountNumber.replace("*","");return a("integrations.pay-as-guest.payment-details.card-ending-in",{last4:t})})(),divider:!0},{label:a("integrations.invoice.invoice-amount"),value:(0,Lo.Wl)(o.total_amount)},{label:a("integrations.invoice.service-fee"),value:(0,Lo.Wl)(null===(t=r.payment)||void 0===t?void 0:t.fee),divider:!0},{label:a("integrations.pay-as-guest.payment-details.total-paid"),value:(0,Lo.Wl)(Number(o.total_amount)+Number(null===(n=r.payment)||void 0===n?void 0:n.fee)),isBold:!0}];return c.createElement(K.A,{style:Qa.modalContainer},c.createElement(K.A,{style:Qa.headerContainer},c.createElement(se.A,{style:Qa.title},a("integrations.pay-as-guest.payment-details.title"))),c.createElement(K.A,{style:Qa.tableContainer},l.map(((e,t)=>c.createElement(Ya,{key:t,label:e.label,value:e.value,isBold:e.isBold,divider:e.divider})))))},Ja=ie.A.create({container:{backgroundColor:"#F4F9FD",flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:12,paddingBottom:16,paddingRight:20},containerMobile:{paddingRight:10},iconWrapper:{marginTop:1,height:50,width:50,alignSelf:"flex-start",alignItems:"center",justifyContent:"center"},textWrapper:{flex:1,maxWidth:"90%",alignItems:"flex-start",justifyContent:"center",alignSelf:"flex-start"},textWrapperMobile:{maxWidth:"100%"},title:{marginTop:14,fontSize:16,fontWeight:"700",fontFamily:"Inter",maxWidth:"85%",lineHeight:24,color:"#19262F",textAlign:"left",marginBottom:6},info:{fontSize:14,fontWeight:"400",fontFamily:"Inter",lineHeight:24,color:"#082131",textAlign:"left"}}),Za=()=>{const{t:e}=(0,z.Bd)("global"),t=(0,Ha.A)();return c.createElement(K.A,{style:t?(0,Ao.composeStyle)(Ja.container,Ja.containerMobile):Ja.container},c.createElement(K.A,{style:Ja.iconWrapper},c.createElement(q.WlC,null)),c.createElement(K.A,{style:t?(0,Ao.composeStyle)(Ja.textWrapper,Ja.textWrapperMobile):Ja.textWrapper},c.createElement(se.A,{style:t?(0,Ao.composeStyle)(Ja.title,Ja.textWrapperMobile):Ja.title},e("integrations.pay-as-guest.enter-password.faster-checkout")),c.createElement(se.A,{style:Ja.info},e("integrations.pay-as-guest.enter-password.info"))))};var Xa=n(2490);const $a=(e,t)=>e?"":t("integrations.pay-as-guest.contact-section.empty-field"),el=(e,t)=>
1{const n=e.replace(/\D/g,"").slice(0,10);return n?n.length<10?t("integrations.pay-as-guest.contact-section.phone-invalid-length"):(0,lo.validateUSPhoneNumber)(n)?"":t("integrations.pay-as-guest.contact-section.phone-invalid"):t("integrations.pay-as-guest.contact-section.empty-field")};var tl,nl,ol,rl,al=n(60034),ll=n(43723);const il=e=>{let{value:t,label:n,validationError:o,hint:r=null,height:a,width:l,onFocus:i,onBlur:s,onChange:d,mandatory:u}=e;const[m,p]=(0,c.useState)(!1),[g,h]=(0,c.useState)(!1);return c.createElement(c.Fragment,null,c.createElement(dl,{error:o},n||"",u&&c.createElement("span",null,"*")),c.createElement(sl,{isFocused:g,height:a,width:l,error:o},c.createElement(cl,{value:t,error:o,onChange:d,onFocus:e=>{h(!0),i&&i(e)},onBlur:e=>{h(!1),s&&s(e)},type:m?"text":"password"}),!(null===t||void 0===t||!t.length)&&c.createElement(ul,{onClick:()=>{p((e=>!e))}},m?c.createElement(q.Oe9,{width:24,height:24}):c.createElement(q.BqX,{width:24,height:24}))),r&&c.createElement("div",null,r))},sl=ll.default.div(tl||(tl=(0,al.A)(["\n  position: relative;\n  width: ",";\n  height: ",";\n  border: ",";\n  border-radius: 4px;\n  height: ",";\n  width: ",";\n  max-width: '100%';\n"])),(e=>{let{width:t}=e;return t||"100%"}),(e=>{let{height:t}=e;return t||"auto"}),(e=>{let{isFocused:t,error:n}=e;return n?"3px solid #EC002A":t?"1px solid ".concat(B.commonColors.accentText):"1px solid #99ADBA"}),(e=>{let{height:t}=e;return t||"40px"}),(e=>{let{width:t}=e;return t})),cl=ll.default.input(nl||(nl=(0,al.A)(["\n  font-size: 14px;\n  line-height: 16px;\n  font-weight: 600;\n  padding: 10px 14px;\n  color: #001929;\n  border-radius: 4px;\n  flex: 1;\n  box-sizing: border-box;\n  padding-horizontal: 14px;\n  width: 100%;\n  background-color: ",";\n  padding-right: 44px; /* Room for the icon */\n  outline: none;\n  border: none;\n  height: 100%;\n\n  /* Hide the default browser password visibility icon */\n  &::-ms-reveal,\n  &::-ms-clear,\n  &::-webkit-password-field {\n    display: none;\n  }\n\n  /* Safari fixes */\n  &::-webkit-contacts-auto-fill-button,\n  &::-webkit-credentials-auto-fill-button {\n    display: none;\n  }\n\n  /* Firefox fixes (password reveal icon) */\n  &::-moz-password-reveal-button {\n    display: none;\n  }\n"])),(e=>{let{error:t}=e;return"#FFFFFF"})),dl=ll.default.label(ol||(ol=(0,al.A)(["\n  color: ",";\n  font-size: 12px;\n  font-family: Inter;\n  font-weight: 400;\n  line-height: 16px;\n  margin-bottom: 4px;\n"])),(e=>{let{error:t}=e;return t?"#EC002A":"#001929"})),ul=ll.default.button(rl||(rl=(0,al.A)(["\n  position: absolute;\n  right: 10px;\n  top: 50%;
1\n  margin-top: 1px;\n  transform: translateY(-50%);\n  background-color: transparent;\n  border: none;\n  cursor: pointer;\n"]))),ml=ie.A.create({container:{paddingHorizontal:69.5,paddingVertical:28,borderRadius:20,maxWidth:700,width:"100%",alignItems:"center",justifyContent:"space-around"},title:{fontFamily:"Inter",fontWeight:"700",fontSize:24,lineHeight:32,color:"#19262F",textAlign:"center",width:"80%"},mobile:{width:"100%"},passwordInput:{marginTop:30,width:"100%"},button:{width:"100%"},hintContainer:{marginTop:10},hint:{fontFamily:"Inter",fontWeight:"400",fontSize:12,lineHeight:14.4,color:"#001929"},error:{marginTop:14}}),pl=e=>{let{onPress:t,containerStyle:n}=e;const{t:o}=(0,z.Bd)("global"),r=(0,Ha.A)(),{values:a,handleChange:l,handleSubmit:i,isSubmitting:s,isValid:d,setFieldTouched:u,setFieldError:m,handleBlur:p,errors:g,touched:h,setSubmitting:v}=(0,lr.Wx)({initialValues:{password:""},validate:e=>{const t=(e=>{const t={length:e.length>=8,uppercase:/[A-Z]/.test(e),number:/\d/.test(e)};return Object.values(t).every((e=>e))?null:t})(e.password);if(t){return t}return{}},onSubmit:async e=>{let{password:n}=e;if(null===n||void 0===n||!n.length)return m("password",o("integrations.pay-as-guest.enter-password.password-hint")),u("password",!0),void v(!1);try{await t({password:n}),v(!1)}catch(r){v(!1)}}});return c.createElement(K.A,{style:[ml.container,n]},c.createElement(se.A,{style:r?[ml.title,ml.mobile]:ml.title,testID:"invoice-processed-main-text"},o("integrations.pay-as-guest.enter-password.title")),c.createElement(de.Spacer,{height:3}),c.createElement(K.A,{style:ml.passwordInput},c.createElement(il,{value:a.password,height:"48px",mandatory:!0,onChange:l("password"),label:o("integrations.pay-as-guest.enter-password.enter-safe"),onBlur:()=>{u("password",!0),p("password")},validationError:!!(Object.keys(g).length>0&&h.password),hint:Object.keys(g).length>0&&h.password?c.createElement(Xa.R,{containerStyle:ml.error,passwordValidation:g}):c.createElement(K.A,{style:ml.hintContainer},c.createElement(se.A,{style:ml.hint},o("integrations.pay-as-guest.enter-password.password-hint-correct")))})),c.createElement(de.Spacer,{height:40}),c.createElement(ka.A,{label:o("integrations.pay-as-guest.enter-password.create-account"),onPress:i,buttonStyle:ml.button,disabled:s||!d}))},gl=ie.A.create({pageContainer:{flex:1,flexDirection:"row",justifyContent:"center",width:"100%",height:"100%"},leftSection:{flex:1,width:"50%",height:"100%",backgroundColor:"#F8F9F9",justifyContent:"flex-start"},paymentInfoContainer:{alignItems:"center",minWidth:320,width:"67%",maxWidth:610,justifyContent:"center",alignSelf:"center",marginTop:40},infoAlert:{paddingHorizontal:60,marginBottom:10},signUpContainer:{alignItems:"center",width:"74%",minWidth:400,maxWidth:640,justifyContent:"center",alignSelf:"center",marginTop:100},rightSection:{flex:1,width:"50%",justifyContent:"flex-start"}}),hl=e=>{let{invoice:t,paymentMethodData:n,onCreateAccount:o}=e;const[r,a]=(0,c.useState)((()=>{if(n)return n;const e=localStorage.getItem("paymentMethodData");return e?JSON.parse(e):null}));return(0,c.useEffect)((()=>{n&&a(n)}),[n]),r?c.createElement(K.A,{style:gl.pageContainer},c.createElement(K.A,{style:gl.leftSection},c.createElement(K.A,{style:gl.paymentInfoContainer},c.createElement(Ua,null),c.createElement(Ka,{invoice:t,paymentMethodData:r}))),c.createElement(K.A,{style:gl.rightSection},c.createElement(K.A,{style:gl.signUpContainer},c.createElement(K.A,{style:gl.infoAlert},c.createElement(Za,null)),c.createElement(pl,{onPress:o})))):null};var vl=n(74655);const yl=e=>{let{paymentMethod:t,onRemove:n,isLoading:o}=e;return o?c.createElement(vl.a,null):c.createElement(K.A,{style:bl.paymentMethodContainer},c.createElement(K.A,{style:bl.paymentMethodTopContainer},c.createElement(K.A,{style:bl.cardIconWrapper},c.createElement(q.BFk,null)),c.createElement(K.A,{style:bl.paymentMethodDetailsContainer},c.createElement(se.A,{style:bl.paymentMethodType},"".concat(t.card.name," ").concat(t.card.accountNumber)),c.createElement(se.A,{style:bl.paymentMethodOwner},t.bankAccount.accountholderName)),c.createElement(Bt.A,{onPress:n},c.createElement(K.A,{style:bl.trashIconWrapper},c.createElement(q.Bx0,null)))))},bl=ie.A.create({paymentMethodContainer:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",padding:16,backgroundColor:"#F4F9FD",borderRadius:12},paymentMethodTopContainer:{flexDirection:"row",flex:1},cardIconWrapper:{marginRight:15,justifyContent:"flex-start"},paymentMethodDetailsContainer:{flex:1,justifyContent:"flex-start"},paymentMethodType:{fontSize:14,fontWeight:"700",lineHeight:20,color:"#001929",fontFamily:"Inter",marginBottom:4,fontVariantLigatures:"none"},paymentMethodOwner:{fontSize:14,color:"#001929",lineHeight:20,fontWeight:"700",fontFamily:"Inter"},trashIconWrapper:{marginLeft:10,justifyContent:"flex-start"}});var fl;const El=(0,ll.default)(q.REV)(fl||(fl=(0,al.A)(["\n  opacity: ",";\n"])),(e=>{let{opacity:t}=e;return t||1})),Cl=ie.A.create({container:{minHeight:64,maxHeight:80,marginTop:3},button:{flexDirection:"row",alignItems:"center",justifyContent:"flex-start",height:48,borderRadius:12,paddingHorizontal:16},cardButton:{backgroundColor:"#F4F9FD",borderWidth:2,borderColor:"#00A0F3"},cardButtonDisabled:{borderWidth:2,borderColor:"rgba(0, 160, 243, 0.3)"},bankButton:{backgroundColor:"#F8F9F9"},iconWrapper:{marginRight:8,justifyContent:"center",alignItems:"center"},buttonText:{fontSize:14,lineHeight:20,fontFamily:"Inter",fontWeight:"700",color:"#001929"},buttonTextDisabled:{color:"rgba(0, 25, 41, 0.3)"},phoneNumberHint:{fontWeight:"400",fontSize:12,lineHeight:16,fontFamily:"Inter",color:"#001929",marginTop:10,marginBottom:20}}),Al=e=>{let{onAddCardPress:t,phoneNumber:n}=e;const{t:o}=(0,z.Bd)("global"),r=!n;return c.createElement(K.A,{style:Cl.container},c.createElement(Bt.A,{style:r?[Cl.button,Cl.cardButton,Cl.cardButtonDisabled]:[Cl.button,Cl.cardButton],onPress:t,disabled:r},c.createElement(K.A,{style:Cl.iconWrapper},c.createElement(El,{opacity:r?.3:1})),c.createElement(P.A,{style:r?[Cl.buttonText,Cl.buttonTextDisabled]:Cl.buttonText},o("integrations.pay-as-guest.payment-method-section.add-card-payment"))),!n&&c.createElement(de.BtText,{style:Cl.phoneNumberHint},o("integrations.pay-as-guest.payment-method-section.add-card-hint")))},Sl=e=>{let{paymentMethod:t,onAddCardPress:n,onRemovePaymentMethod:o,sectionTitleStyle:r,phoneNumber:a,isLoading:l}=e;const{t:i}=(0,z.Bd)("global");return c.createElement(K.A,null,c.createElement(se.A,{style:[wl.sectionTitle,r]},i("integrations.pay-as-guest.payment-method-section.payment-method")),t?c.createElement(yl,{paymentMethod:t,isLoading:l,onRemove:o}):c.createElement(Al,{onAddCardPress:n,phoneNumber:a}))},wl=ie.A.create({sectionTitle:{fontSize:20,lineHeight:28,fontWeight:"700",fontFamily:"Inter",color:"#001929",marginBottom:18},addPaymentButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",height:48,borderWidth:2,borderColor:"#00A0F3",borderRadius:8,marginBottom:12,backgroundColor:"#FFFFFF"},addPaymentButtonText:{color:"#00A0F3",fontWeight:"600",fontSize:14},paymentMethodContainer:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:16,backgroundColor:"#F8F9F9",borderRadius:8,borderWidth:1,borderColor:"#D3D3D3",marginBottom:12},paymentMethodDetailsContainer:{flex:1,marginRight:8},paymentMethodType:{fontSize:14,fontWeight:"600",marginBottom:4,color:"#001929"},paymentMethodDetails:{fontSize:14,color:"#394D5A",marginBottom:4},paymentMethodOwner:{fontSize:14,color:"#001929"}});var Pl=n(74227);const Il=e=>{let{text:t,fontSize:n,weight:o}=e;return c.createElement(Pl.default,{height:"20",width:"100%"},c.createElement(Pl.Defs,null,c.createElement(Pl.LinearGradient,{id:"gradient",x1:"0",y1:"0",x2:"1",y2:"0"},c.createElement(Pl.Stop,{offset:"0%",stopColor:"#8400AF"}),c.createElement(Pl.Stop,{offset:"100%",stopColor:"#00679D"}
1))),c.createElement(Pl.Text,{x:"0",y:"15",fill:"url(#gradient)",fontSize:n,fontWeight:o,fontFamily:"Inter"},t))},xl=ie.A.create({container:{marginTop:20},titleContainer:{flexDirection:"row",alignItems:"center",marginBottom:8},iconWrapper:{justifyContent:"center",alignItems:"center",marginRight:8},gradientTextContainer:{flex:1},text:{fontSize:14,fontFamily:"Inter",fontWeight:"500",color:"#001929",lineHeight:20}}),Dl=e=>{let{description:t}=e;const{t:n}=(0,z.Bd)("global");return c.createElement(K.A,{style:xl.container},c.createElement(K.A,{style:xl.titleContainer},c.createElement(K.A,{style:xl.iconWrapper},c.createElement(q.pKE,{width:24,height:24})),c.createElement(K.A,{style:xl.gradientTextContainer},c.createElement(Il,{text:n("integrations.pay-as-guest.payment-method-section.data-are-secured"),fontSize:16,weight:"700"}))),c.createElement(P.A,{style:xl.text},null!==t&&void 0!==t?t:n("integrations.pay-as-guest.payment-method-section.data-are-secured-details")))},Tl=e=>{let{billingAddress:t}=e;const{addressLine1:n,addressLine2:o,city:r,stateCode:a,zipCode:l}=t,{t:i}=(0,z.Bd)("global"),s="".concat(n).concat(o?" ".concat(o):"",", ").concat(r,", ").concat(a,"(").concat(L.ve[a],"), ").concat(l);return c.createElement(K.A,{style:kl.container},c.createElement(se.A,{style:kl.title},i("integrations.pay-as-guest.payment-method-section.billing-address")),c.createElement(se.A,{style:kl.address},s))},kl=ie.A.create({container:{marginVertical:16},title:{fontWeight:"700",fontFamily:"Inter",fontSize:16,color:"#001929",marginBottom:4,lineHeight:28},address:{fontSize:14,fontFamily:"Inter",fontWeight:"500",color:"#001929",lineHeight:22}});var Bl=n(48724);let Fl=function(e){return e.FIRST_NAME="firstName",e.LAST_NAME="lastName",e.EMAIL="email",e.PHONE="phone",e.BUSINESS_NAME="businessName",e.IS_BUSINESS="isBusiness",e}({});const _l=e=>e?e.startsWith("+1")?e:"+1".concat(e):"",Nl=(0,c.memo)((e=>{let{onValidationChange:t,hideHeaderTitle:n}=e;const{t:o}=(0,z.Bd)("global"),{width:r}=(0,Bl.A)(),a=r<1320,{values:l,errors:i,setFieldValue:s,setFieldTouched:d,validateForm:u}=(0,lr.j7)(),m=(0,c.useCallback)((()=>{const e=Object.values(i).some((e=>e)),n=!!i[Fl.PHONE];t(!e,n?"":_l(l[Fl.PHONE]),l)}),[t,i,l]),p=(0,c.useMemo)((()=>(0,Cr.debounce)(m,300)),[m]);(0,c.useEffect)((()=>(p(),()=>{p.cancel()})),[p]),(0,c.useEffect)((()=>{u().then((e=>{Object.keys(e).forEach((t=>{const n=l[t];e[t]&&n&&d(t,!0,!1)})),setTimeout((()=>{m()}),10)}))}),[]);const g=(0,c.useCallback)((()=>{const e=!l[Fl.IS_BUSINESS],t={[Fl.IS_BUSINESS]:e,[Fl.BUSINESS_NAME]:""};Object.entries(t).forEach((e=>{let[t,n]=e;s(t,n,!1)})),d(Fl.BUSINESS_NAME,e,!1),setTimeout((()=>{u().then((()=>{m()}))}),0)}),[s,l,d,u,m]);function h(e,t){return c.createElement(lr.D0,{name:e,key:e},(n=>{let{field:o,meta:r}=n;return c.createElement(de.BtInput,Object.assign({},o,{size:"medium",testID:t.testID,label:t.label,mandatory:t.mandatory,disabled:t.disabled,onChangeText:t=>s(e,t),onBlur:()=>d(e,!0),status:r.touched&&r.error?"danger":"",errorTextComponent:c.createElement(Xa.A,{text:r.touched&&r.error?r.error:""}),style:[Ll.input,!!r.error&&r.touched&&Ll.inputError],labelStyle:[Ll.inputPlaceholder,!!r.error&&r.touched&&Ll.inputPlaceholderError],textStyle:Ll.inputText}))}))}return c.createElement(K.A,{style:Ll.container},!n&&c.createElement(c.Fragment,null,c.createElement(P.A,{style:Ll.sectionTitle},o("integrations.pay-as-guest.contact-section.contact-information")),c.createElement(P.A,{style:Ll.sectionDescription},o("integrations.pay-as-guest.contact-section.contact-information-details"))),c.createElement(K.A,{style:[Ll.inputRow,a?Ll.inputColumn:Ll.inputRow]},h(Fl.FIRST_NAME,{label:o("integrations.pay-as-guest.contact-section.first-name"),testID:"guestFirstName",mandatory:!0}),h(Fl.LAST_NAME,{label:o("integrations.pay-as-guest.contact-section.last-name"),testID:"guestLastName",mandatory:!0})),c.createElement(K.A,{style:[Ll.inputRow,a?Ll.inputColumn:Ll.inputRow]},h(Fl.EMAIL,{label:o("integrations.pay-as-guest.contact-section.email-address"),testID:"guestEmail",mandatory:!0}),c.createElement(lr.D0,{name:Fl.PHONE},(e=>{let{field:t,meta:n}=e;
1return c.createElement(de.LQ,Object.assign({},t,{value:t.value,status:n.touched&&n.error?"danger":"",size:"medium",testID:"guestPhone",label:o("integrations.pay-as-guest.contact-section.phone-number"),labelStyle:[Ll.inputPlaceholder,n.touched&&!!n.error&&Ll.inputPlaceholderError],onChangeText:e=>s(Fl.PHONE,e.parsed),onBlur:()=>d(Fl.PHONE,!0),validate:e=>el(e,o),style:[Ll.input,n.touched&&!!n.error&&Ll.inputError],textStyle:Ll.inputText,required:!0}))}))),c.createElement(K.A,{style:[Ll.singleInputRow,a?Ll.inputColumn:Ll.singleInputRow]},h(Fl.BUSINESS_NAME,{label:o("integrations.pay-as-guest.contact-section.business-name"),testID:"guestBusinessName",mandatory:l[Fl.IS_BUSINESS],disabled:!l[Fl.IS_BUSINESS]})),c.createElement(Bt.A,{style:Ll.checkboxWrapper,onPress:g,activeOpacity:.7},c.createElement(de.BtCheckBox,{style:Ll.checkbox,checked:!l[Fl.IS_BUSINESS],onPress:g}),c.createElement(de.BtText,{style:Ll.checkboxLabel},o("integrations.pay-as-guest.contact-section.not-a-business"))))}));function Rl(e){let{onValidationChange:t,hideHeaderTitle:n,initialValues:o}=e;const{t:r}=(0,z.Bd)("global");return c.createElement(lr.l1,{initialValues:o,validate:e=>{var t;const n={};return n[Fl.FIRST_NAME]=$a(e[Fl.FIRST_NAME],r)||"",n[Fl.LAST_NAME]=$a(e[Fl.LAST_NAME],r)||"",n[Fl.EMAIL]=((e,t)=>e?(0,lo.validateEmail)(e)?"":t("integrations.pay-as-guest.contact-section.email-invalid"):t("integrations.pay-as-guest.contact-section.empty-field"))(e[Fl.EMAIL],r)||"",n[Fl.PHONE]=el(null!==(t=e[Fl.PHONE])&&void 0!==t?t:"",r)||"",e[Fl.IS_BUSINESS]?n[Fl.BUSINESS_NAME]=$a(e[Fl.BUSINESS_NAME],r)||"":delete n[Fl.BUSINESS_NAME],n},onSubmit:e=>{console.log("Form submitted with:",e)},validateOnMount:!0},(()=>c.createElement(Nl,{onValidationChange:t,hideHeaderTitle:n})))}const Ll=ie.A.create({checkboxWrapper:{flexDirection:"row",marginBottom:30},checkbox:{width:20,height:20,marginRight:11},checkboxLabel:{fontWeight:"500",fontSize:14,lineHeight:20,color:"#001929",fontFamily:"Inter"},container:{marginBottom:24,minHeight:230,display:"flex",flexShrink:1},sectionTitle:{fontSize:20,lineHeight:28,fontWeight:"700",fontFamily:"Inter",color:"#001929",marginBottom:4},sectionDescription:{fontSize:14,lineHeight:22,fontWeight:"500",fontFamily:"Inter",color:"#001929",marginBottom:18},inputRow:{flexDirection:"row",justifyContent:"space-between",marginBottom:48,gap:24},singleInputRow:{flexDirection:"row",marginBottom:38},inputColumn:{flexDirection:"column",gap:24,marginBottom:24},input:{height:40,minWidth:200,flex:1,borderRadius:4,borderColor:"#99ADBA"},inputText:{fontFamily:"Inter",fontWeight:"600",fontSize:14,lineHeight:16,color:"#001929"},inputError:{color:"#EC002A",borderWidth:2,backgroundColor:"#FFF2F4",borderColor:"#EC002A"},inputPlaceholder:{fontFamily:"Inter",fontWeight:"400",fontSize:12,lineHeight:16,color:"#001929",marginBottom:1},inputPlaceholderError:{color:"#EC002A"},errorMessage:{fontFamily:"Inter",fontWeight:"400",fontSize:12,lineHeight:14.4,color:"#EC002A"}}),Ml=async e=>{try{return await N.JZ.B9.payInvoice(e)}catch(t){return console.error(t),t}};var Ol=n(87053),zl=n(91818),jl=n(10375),Wl=n(86843);const Vl=e=>{let{onClose:t}=e;const{t:n}=(0,z.Bd)("global");return c.createElement(o.HD,{onClose:t,icon:c.createElement(o.GQ,{type:"danger"}),title:n("integrations.pay-as-guest.payment-failed"),buttons:[n("integrations.pay-as-guest.try-again")]},c.createElement(on.E,{fz:16,style:{whiteSpace:"pre-wrap"}},c.createElement(z.x6,{t:n,i18nKey:"integrations.pay-as-guest.payment-failed-message",components:{email:c.createElement(o.bT,{fz:16})}})))},Hl=ie.A.create({pageContainer:{flexDirection:"row",width:"100%",paddingHorizontal:200,justifyContent:"center",paddingTop:40,gap:40},leftSection:{flex:1,marginRight:20,maxWidth:600},rightSection:{flex:1,maxWidth:600},sectionTitle:{fontSize:18,fontWeight:"600",color:"#001929",marginBottom:8},billingAddressContainer:{marginTop:20,padding:16,backgroundColor:"#fff",borderRadius:8,shadowColor:"#000",shadowOpacity:.1,shadowRadius:5,shadowOffset:{width:0,height:2}},billingAddressText:{fontSize:14,color:"#394D5A"},footerText:{fontSize:12,color:"#394D5A",textAlign:"center",marginTop:20},totalStyle:{fontWeight:"700",fontSize:16,lineHeight:21}}),Ul=e=>{var t,n,o,r,a,l,i,s,d,u;let{invoice:m,paymentMethodData:p,setPaymentMethodData:g,onPaymentSuccess:h,contactDetails:v,setContactDetails:y,customer:b,onUserExists:f}=e;const{screenWidth:E}=(0,Zo.Qs)(),C=(0,c.useMemo)((()=>E<600?20:E<1200?100:200),[E]),{t:A}
1=(0,z.Bd)("global"),[S,w]=(0,c.useState)(!1),[P,I]=(0,c.useState)(""),[x,D]=(0,c.useState)($r.NONE),[T,k]=(0,c.useState)(!1),[B,F]=(0,c.useState)(!1),_=(0,c.useCallback)(((e,t,n)=>{y(n),w(e),I(t)}),[y]),R=(0,c.useCallback)((()=>{D($r.ADD_NEW_CREDIT_CARD)}),[]),L=(0,c.useCallback)((()=>{D($r.NONE)}),[]),M=(0,c.useCallback)((()=>{g(null)}),[g]),O=(0,c.useCallback)((async()=>{var e,t;if(!v||null===p||void 0===p||null===(e=p.bankAccount)||void 0===e||!e.id)return void console.error("Payment cannot be processed: Missing contact details or payment method");k(!0);const n=await Ml({user:{...v,phone:_l(v.phone)},company:{name:null!==(t=v.businessName)&&void 0!==t?t:"",isBusiness:!!v.isBusiness},payment:p.payment,bankAccountId:p.bankAccount.id,invoiceId:m._id});k(!1),"ok"===(null===n||void 0===n?void 0:n.result)?(localStorage.setItem("contactDetails",JSON.stringify(v)),localStorage.setItem("paymentMethodData",JSON.stringify(p)),console.log("Payment Successful"),D($r.PAYMENT_SUCCESS)):(console.error("Payment Failed"),"auth/user-already-exists"===(null===n||void 0===n?void 0:n.code)?f({type:"email",login:v.email,isNewUser:!1}):D($r.PAYMENT_ERROR))}),[v,p,m,f]),j=(0,c.useMemo)((()=>{var e,t;return[...S&&p?[{label:A("integrations.invoice.invoice-amount"),value:(0,Lo.Wl)(m.total_amount)},{label:A("integrations.invoice.service-fee"),value:(0,Lo.Wl)(null===(e=p.payment)||void 0===e?void 0:e.fee)},{label:A("integrations.invoice.total"),value:(0,Lo.Wl)(Number(m.total_amount)+Number(null===(t=p.payment)||void 0===t?void 0:t.fee)),labelStyle:Hl.totalStyle,valueStyle:Hl.totalStyle}]:[]]}),[S,m,A,p]);console.log("invoice",m);return c.createElement(c.Fragment,null,c.createElement(K.A,{style:[Hl.pageContainer,{paddingHorizontal:C}]},c.createElement(K.A,{style:Hl.leftSection},c.createElement(Rl,{onValidationChange:_,initialValues:{[Fl.FIRST_NAME]:null!==(t=null===b||void 0===b?void 0:b.firstName)&&void 0!==t?t:"",[Fl.LAST_NAME]:null!==(n=null===b||void 0===b?void 0:b.lastName)&&void 0!==n?n:"",[Fl.EMAIL]:null!==(o=null===b||void 0===b?void 0:b.email)&&void 0!==o?o:"",[Fl.PHONE]:(null!==(r=null===b||void 0===b?void 0:b.phone)&&void 0!==r?r:"").replace(/\D/g,"").slice(-10),[Fl.BUSINESS_NAME]:null!==(a=null===b||void 0===b?void 0:b.businessName)&&void 0!==a?a:"",[Fl.IS_BUSINESS]:!0}}),c.createElement(Sl,{paymentMethod:p,onAddCardPress:R,onRemovePaymentMethod:M,phoneNumber:P,isLoading:B}),(null===p||void 0===p||null===(l=p.bankAccount)||void 0===l?void 0:l.billingAddress)&&c.createElement(Tl,{billingAddress:p.bankAccount.billingAddress}),c.createElement(Dl,null)),c.createElement(K.A,{style:Hl.rightSection},c.createElement(Ba,{invoice:m,additionalFields:j,buttons:[{label:A("integrations.buttons.pay-invoice"),onPress:O,disabled:!S||!p||T}],footer:c.createElement(Oa.ye,null),backgroundColor:"#F8F9F9"}))),x===$r.ADD_NEW_CREDIT_CARD&&c.createElement(Ol.v,{owner:{type:zl.v.Guest},successMessage:A("common.paymentMethods.addCard.successGuest"),onClose:L,onSuccess:e=>{(e=>{var t;F(!0),N.JZ.B9.paymentInfo({accountId:e,invoiceId:null!==(t=m._id)&&void 0!==t?t:m.id}).then(g).catch((e=>{console.log(e),jl.$.show({variant:"error",message:A("system-failure")})})).finally((()=>F(!1)))})(e.cardId),D($r.NONE)}}),x===$r.PAYMENT_ERROR&&c.createElement(Vl,{onClose:L}),x===$r.PAYMENT_SUCCESS&&c.createElement(Wl.L,{amount:null!==(i=null===p||void 0===p||null===(s=p.payment)||void 0===s?void 0:s.totalAmount)&&void 0!==i?i:0,supplierName:null!==(d=null===m||void 0===m||null===(u=m.company)||void 0===u?void 0:u.name)&&void 0!==d?d:"",onClose:()=>{null===h||void 0===h||h(),L()}}))},Gl=(0,p.PA)((e=>{let{buttonRight:t,buttonLeft:n}=e;const{branding:o}=l.A,r=o?c.createElement(be.A,{source:{uri:null===o||void 0===o?void 0:o.logoUrl},style:{height:54,width:151},resizeMode:"contain"}):c.createElement(q.SeL,null);return c.createElement(K.A,{style:Yl.topBarView},n?c.createElement(K.A,{style:Yl.buttonContainerLeft,testID:"left-topbar-btn-container"},n):c.createElement(K.A,{style:Yl.emptyContainer}),c.createElement(K.A,{style:Yl.logoContainer,testID:"centered-bt-icon-top-bar"},r),t?c.createElement(K.A,{style:Yl.buttonContainerRight,testID:"right-topbar-btn-container"},t):c.createElement(K.A,{style:Yl.emptyContainer}))})),Yl=ie.A.create({topBarView:{width:"100%",maxWidth:"100%",flexDirection:"row",alignItems:"center",alignSelf:"center",justifyContent:"space-between",borderBottomWidth:1,borderBottomColor:"#E6EBEE",height:66,marginBottom:2},buttonContainerLeft:{flex:1,alignItems:"flex-start"},buttonContainerRight:{flex:1,alignItems:"flex-end"},logoContainer:{width:"30%",alignItems:"center",alignSelf:"center"},emptyContainer:{flex:1}}),Ql=ie.A.create({section:{marginTop:8,marginBottom:20},container:{display:"flex",justifyContent:"center",marginTop:16,maxWidth:"100%",width:350},continueContainer:{borderTopColor:"#E6EBEE",borderTopWidth:1,height:80,justifyContent:"center",width:"100%",paddingHorizontal:20,gap:10},paymentMethodTitle:{fontSize:16},totalText:{fontWeight:"700",fontSize:14,lineHeight:21},row:{marginTop:0},poweredByContainer:{display:"flex",justifyContent:"center",alignItems:"flex-end",marginTop:-5,marginBottom:18,marginRight:18},poweredByContainerBorders:{borderTopWidth:1,paddingTop:10,borderTopColor:"#E6EBEE"}}),ql=e=>{var t,n,o,r,a,i,s,d,u,m,p;let{invoice:g,paymentMethodData:h,setPaymentMethodData:v,onPaymentSuccess:y,contactDetails:b,setContactDetails:f,customer:E,onSignUp:C,onUserExists:A}=e;const{branding:S}=l.A,{t:w}=(0,z.Bd)("global"),[P,I]=(0,c.useState)(!1),[x,D]=(0,c.useState)(""),[T,k]=(0,c.useState)(!1),[B,F]=(0,c.useState)(!1),[_,R]=(0,c.useState)(!1),[L,M]=(0,c.useState)(!1),[O,j]=(0,c.useState)(ea.CONTACT_INFO),{mobileWidth:W}=(0,Zo.Qs)(),V=(0,c.useCallback)(((e,t,n)=>{f(n),I(e),D(t)}),[f]),H=()=>{P&&j(h?ea.PAY_INVOICE:ea.ADD_NEW_PAYMENT_METHOD)},U=(0,c.useCallback)((()=>{j(ea.ADD_NEW_CREDIT_CARD)}),[]),G=(0,c.useCallback)((()=>{v(null),j(ea.ADD_NEW_PAYMENT_METHOD)}),[v]),Y=(0,c.useCallback)((()=>{j(ea.CONTACT_INFO)}),[]),Q=(0,c.useCallback)((()=>{j(h?ea.PAY_INVOICE:ea.ADD_NEW_PAYMENT_METHOD)}),[h]),J=(0,c.useCallback)((async()=>{var e,t;if(!b||null===h||void 0===h||null===(e=h.bankAccount)||void 0===e||!e.id)return void console.error("Payment cannot be processed: Missing contact details or payment method");k(!0);const n=await Ml({user:{...b,phone:_l(b.phone)},company:{name:null!==(t=b.businessName)&&void 0!==t?t:"",isBusiness:!!b.isBusiness},payment:h.payment,bankAccountId:h.bankAccount.id,invoiceId:g._id});k(!1),"ok"===(null===n||void 0===n?void 0:n.result)?(console.log("Payment Successful"),localStorage.setItem("contactDetails",JSON.stringify(b)),localStorage.setItem("paymentMethodData",JSON.stringify(h)),M(!0)):"auth/user-already-exists"===(null===n||void 0===n?void 0:n.code)?(console.error("Payment Failed"),A({type:"email",login:b.email,isNewUser:!1})):R(!0)}),[b,h,g,A]),Z=(0,c.useMemo)((()=>O===ea.CONTACT_INFO?c.createElement(K.A,{style:Ql.continueContainer},c.createElement(ka.A,{onPress:H,disabled:!P,label:w("integrations.buttons.continue")})):O===ea.PAY_INVOICE?c.createElement(K.A,{style:[Ql.continueContainer,{height:127,paddingVertical:12,marginBottom:6}]},c.createElement(Oa.ye,null),c.createElement(ka.A,{onPress:J,disabled:!P||!h||T,label:w("integrations.buttons.pay-invoice")})):null),[O,P,w]),X=(0,c.useMemo)((()=>O===ea.CONTACT_INFO?c.createElement(c.Fragment,null):c.createElement(Bt.A,{onPress:Y},c.createElement(q.Z3O,{width:40,height:40}))),[O,Y]),$=(0,c.useMemo)((()=>{var e,t;return[...P&&h?[{label:w("integrations.invoice.invoice-amount"),value:(0,dn.zQ)(g.total_amount)},{label:w("integrations.invoice.service-fee"),value:(0,dn.zQ)(null===(e=h.payment)||void 0===e?void 0:e.fee)},{label:w("integrations.invoice.total"),value:(0,dn.zQ)(Number(g.total_amount)+Number(null===(t=h.payment)||void 0===t?void 0:t.fee)),labelStyle:Ql.totalText,valueStyle:Ql.totalText}]:[]]}),[P,h,g,w]);return c.createElement(Ro.A,{containerStyle:{alignSelf:"center"},toolbar:c.createElement(Gl,{buttonRight:c.createElement(Bt.A,{onPress:C},c.createElement(q.Tir,{width:40,height:40})),buttonLeft:X}),contentContainerStyle:{height:"100%"},footer:c.createElement(c.Fragment,null,Z,!!S&&c.createElement(K.A,{style:[Ql.poweredByContainer,!Z&&Ql.poweredByContainerBorders]},c.createElement(Co._,null))),styleWidth:"100%"},c.createElement(K.A,{style:[Ql.container,{width:W>576?"100%":W-40}]},c.createElement(Na,{invoice:g}
1),O===ea.CONTACT_INFO&&c.createElement(K.A,{key:"contact-info",style:Ql.section},c.createElement(Rl,{onValidationChange:V,hideHeaderTitle:!0,initialValues:{[Fl.FIRST_NAME]:null!==(t=null===E||void 0===E?void 0:E.firstName)&&void 0!==t?t:null===b||void 0===b?void 0:b.firstName,[Fl.LAST_NAME]:null!==(n=null===E||void 0===E?void 0:E.lastName)&&void 0!==n?n:null===b||void 0===b?void 0:b.lastName,[Fl.EMAIL]:null!==(o=null===E||void 0===E?void 0:E.email)&&void 0!==o?o:null===b||void 0===b?void 0:b.email,[Fl.PHONE]:(null!==(r=null!==(a=null===E||void 0===E?void 0:E.phone)&&void 0!==a?a:null===b||void 0===b?void 0:b.phone)&&void 0!==r?r:"").replace(/\D/g,"").slice(-10),[Fl.BUSINESS_NAME]:null!==(i=null===E||void 0===E?void 0:E.businessName)&&void 0!==i?i:null===b||void 0===b?void 0:b.businessName,[Fl.IS_BUSINESS]:!P||(null===b||void 0===b?void 0:b.isBusiness)}})),O===ea.ADD_NEW_PAYMENT_METHOD&&c.createElement(K.A,{key:"add-credit-card",style:Ql.section},c.createElement(Sl,{paymentMethod:null,onAddCardPress:U,onRemovePaymentMethod:G,sectionTitleStyle:Ql.paymentMethodTitle,phoneNumber:x,isLoading:B}),c.createElement(Dl,null)),O===ea.ADD_NEW_CREDIT_CARD&&c.createElement(Ol.v,{owner:{type:zl.v.Guest},successMessage:w("common.paymentMethods.addCard.successGuest"),onClose:Q,onSuccess:e=>{var t;t=e.cardId,F(!0),N.JZ.B9.paymentInfo({accountId:t,invoiceId:g._id}).then((e=>{v(e),j(ea.PAY_INVOICE)})).catch((e=>{console.log(e),jl.$.show({variant:"error",message:w("system-failure")})})).finally((()=>F(!1))),Q()}}),O===ea.PAY_INVOICE&&c.createElement(c.Fragment,null,c.createElement(Fa,{additionalFields:$,rowStyle:Ql.row}),c.createElement(K.A,{key:"pay-invoice",style:Ql.section},c.createElement(Sl,{paymentMethod:h,onAddCardPress:U,onRemovePaymentMethod:G,sectionTitleStyle:Ql.paymentMethodTitle,phoneNumber:x}),(null===h||void 0===h||null===(s=h.bankAccount)||void 0===s?void 0:s.billingAddress)&&c.createElement(Tl,{billingAddress:h.bankAccount.billingAddress}),c.createElement(Dl,null))),_&&c.createElement(Vl,{onClose:()=>R(!1)}),L&&c.createElement(Wl.L,{amount:null!==(d=null===h||void 0===h||null===(u=h.payment)||void 0===u?void 0:u.totalAmount)&&void 0!==d?d:0,supplierName:null!==(m=null===g||void 0===g||null===(p=g.company)||void 0===p?void 0:p.name)&&void 0!==m?m:"",onClose:()=>{null===y||void 0===y||y(),Q()}})))},Kl=ie.A.create({container:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:16,maxWidth:"100%",width:350},passwordContainer:{paddingHorizontal:0,marginBottom:20},passwordTitle:{fontSize:16,lineHeight:24,alignSelf:"flex-start",textAlign:"left",width:"100%"},passwordInfo:{fontSize:14,lineHeight:20,alignSelf:"flex-start",textAlign:"left",width:"100%"},invoiceProcessedTitle:{fontSize:20,lineHeight:32,width:"100%"},invoiceProcessedInfo:{fontSize:14,lineHeight:28,width:"100%"},infoAlert:{marginBottom:10,marginRight:-4},poweredByContainer:{display:"flex",justifyContent:"center",alignItems:"flex-end",marginTop:10,marginBottom:18,marginRight:18}}),Jl=e=>{let{invoice:t,paymentMethodData:n,onCreateAccount:o}=e;const[r,a]=(0,c.useState)((()=>{if(n)return n;const e=localStorage.getItem("paymentMethodData");return e?JSON.parse(e):null}));(0,c.useEffect)((()=>{n&&a(n)}),[n]);const{mobileWidth:l}=(0,Zo.Qs)();return c.createElement(Ro.A,{containerStyle:{alignSelf:"center"},toolbar:c.createElement(Po,null),contentContainerStyle:{height:"100%"},styleWidth:"100%"},c.createElement(K.A,{style:[Kl.container,{width:l>576?"100%":l-40}]},c.createElement(K.A,{style:Kl.infoAlert},c.createElement(Za,null)),c.createElement(pl,{onPress:o,containerStyle:Kl.passwordContainer}),c.createElement(Ua,{titleStyle:Kl.invoiceProcessedTitle,infoStyle:Kl.invoiceProcessedInfo,containerStyle:{maxWidth:l,width:l}}),c.createElement(Ka,{invoice:t,paymentMethodData:r})))};var Zl=n(68532),Xl=n(8922);const $l=(0,p.PA)((e=>{let{navigation:t,onBack:n,dontNavigate:o,onSuccessSignUp:r}=e;const{firstName:a,lastName:i,setValue:s,phone:d,canSignUp:u,canSubmit:m,isValidLogin:p,isValidEmail:g,signUp:h,errors:v,company_name:y,setIsBusiness:b,isBusiness:f}=Je.A,{isBusy:C}=l.A,{t:A}=(0,z.Bd)("auth"),{sm:S,screenWidth:w}=(0,ce.Qs)(),P=w<575,D=P?"90%":S?500:400,k=(0,c.useCallback)((async()=>{await h(),localStorage.removeItem("paymentMethodData"),localStorage.removeItem("contactDetails"),r?r():t.navigate(E.f0.Home._self)}),[h,r,t]);(0,c.useEffect)((()=>Je.A.removeError("signup")),[]),(0,c.useLayoutEffect)((()=>{p?m||t.replace(E.f0.Auth.SignUpPassword):t.replace(E.f0.Auth.SignUp)}),[m,g,p,t]);const B=()=>n?n():t.goBack(),F=()=>{var e,n,r;return c.createElement(c.Fragment,null,c.createElement(O.Ay,{onPress:B,testID:"signupFormBack"}),c.createElement(T.A,{style:{alignSelf:void 0}},A("signUp.formTitle")),c.createElement(mo.A,{height:16}),c.createElement(T.t,{style:{alignSelf:void 0}},A("signUp.formSubTitle")),c.createElement(K.A,{style:{flexDirection:S?"row":"column"}},c.createElement(K.A,{style:{flex:1}},c.createElement(ao.p,{testID:"firstName",value:a,onChangeText:e=>s("firstName",e),label:A("signUp.firstNameLabel"),mandatory:!0,autoFocus:!0,style:ei.input})),S&&c.createElement(mo.A,{width:20}),c.createElement(K.A,{style:{flex:1}},c.createElement(ao.p,{testID:"lastName",value:i,onChangeText:e=>s("lastName",e),label:A("signUp.lastNameLabel"),mandatory:!0,style:ei.input}))),c.createElement(Xl.A,{testID:"phone",label:A("signUp.loginLabelPhone"),value:d,onChangeText:e=>{s("phone",e)},inputStyle:ei.input,mandatory:!0}),c.createElement(j.K,{error:null===(e=v.get("login"))||void 0===e?void 0:e.message}),c.createElement(mo.A,{height:30}),f&&c.createElement(de.BtText,{style:ei.businessNameHint},A("signUp.businessNameHint")),c.createElement(ao.p,{testID:"businessNameInput",value:y,label:A("businessName"),onChangeText:e=>s("company_name",e),disabled:!f,size:"large",style:ei.input,mandatory:!0}),c.createElement(Bt.A,{style:ei.checkboxWrapper,onPress:b,activeOpacity:.7},c.createElement(de.BtCheckBox,{style:ei.checkbox,checked:!f,onPress:b}),c.createElement(de.BtText,{style:ei.checkboxLabel},A("signUp.ImNotABusiness"))),null!==(n=v.get("signup"))&&void 0!==n&&n.message?c.createElement(c.Fragment,null,c.createElement(mo.A,{height:30}),c.createElement(j.K,{error:null===(r=v.get("signup"))||void 0===r?void 0:r.message}),c.createElement(mo.A,{height:10})):c.createElement(mo.A,{height:45}),c.createElement(x.A,{onPress:k,disabled:!u||C,loading:C,testID:"continue-button"},A("signUp.formSubmitLabel")),c.createElement(mo.A,{height:40}),c.createElement(Zl.y,{navigation:t,testID:"login-link",dontNavigate:o}))};return P?c.createElement(I.A,{onBackPress:B,contentStyle:{marginTop:S?0:20}},F()):c.createElement(K.A,{style:{marginVertical:S?50:28,flexGrow:1}},c.createElement(K.A,{style:{width:D,alignSelf:"center"}},F()))})),ei=ie.A.create({checkboxWrapper:{flexDirection:"row",marginTop:16},checkbox:{width:20,height:20,marginRight:11},checkboxLabel:{fontWeight:"400",fontSize:14,lineHeight:20,color:"#668598"},businessNameHint:{fontWeight:"500",fontSize:14,lineHeight:22,fontFamily:"Inter",color:"#00A0F3",marginBottom:-16}
1,input:{minHeight:64}});var ti=function(e){return e[e.PAY_AS_GUEST=0]="PAY_AS_GUEST",e[e.INVOICE_RECEIPT=1]="INVOICE_RECEIPT",e[e.SIGN_UP=2]="SIGN_UP",e}(ti||{});const ni=e=>{var t,n,o,r;let{invoice:a,isInvoicePaidOff:l,isWeb:i,customer:s,onSignUp:d,mode:u,redirectUrl:m,onUserExists:p}=e;null===(t=window)||void 0===t||null===(n=t.opener)||void 0===n||n.postMessage({type:J.c.CONNECTION_ESTABLISHED},"*"),null===(o=window)||void 0===o||null===(r=o.parent)||void 0===r||r.postMessage({type:J.c.CONNECTION_ESTABLISHED},"*");const[g,h]=(0,c.useState)(ti.PAY_AS_GUEST),{setValue:v,setLogin:y,setPassword:b,setIsBusiness:f}=Je.A,[E,C]=(0,c.useState)({firstName:"",lastName:"",email:"",phone:"",businessName:"",isBusiness:!0}),[A,S]=(0,c.useState)(null),w=(0,$e.useNavigation)(),{t:P}=(0,z.Bd)("global");(0,c.useEffect)((()=>{h(l?ti.INVOICE_RECEIPT:ti.PAY_AS_GUEST)}),[l]);const I=(0,c.useCallback)((()=>{if(console.log("paymentSuccess"),"popup"===u||"redirect"===u&&m){const e=window.location.href;window.open(e,"_blank"),Ca({navigation:w,mode:u,redirectUrl:m})}else window.location.reload()}),[u,m,i]),x=(0,c.useCallback)((e=>{var t,n,o,r,l,i,s;let{password:c}=e,d=E;if(!d||Object.values(d).some((e=>""===e))){const e=localStorage.getItem("contactDetails");e&&(d=JSON.parse(e))}v("type","password"),v("firstName",(null===(t=d)||void 0===t?void 0:t.firstName)||""),v("lastName",(null===(n=d)||void 0===n?void 0:n.lastName)||""),v("email",(null===(o=d)||void 0===o?void 0:o.email)||""),v("phone",(0,Mo.L)(d.phone,"US").formatNational()),v("company_name",(null===(r=d)||void 0===r?void 0:r.businessName)||""),v("guest_customer_id",null!==(l=a.customer_account_id)&&void 0!==l?l:""),y(null===(i=d)||void 0===i?void 0:i.email),null!==(s=d)&&void 0!==s&&s.isBusiness||f(),b(c),h(ti.SIGN_UP)}),[E,v,y,b,f,a]),D=(0,c.useCallback)((()=>{h(ti.INVOICE_RECEIPT)}),[]),T=(0,c.useMemo)((()=>g===ti.PAY_AS_GUEST?c.createElement(Ul,{invoice:a,paymentMethodData:A,setPaymentMethodData:S,onPaymentSuccess:I,contactDetails:E,setContactDetails:C,customer:s,onUserExists:p}):g===ti.INVOICE_RECEIPT?c.createElement(hl,{invoice:a,paymentMethodData:A,onCreateAccount:x}):g===ti.SIGN_UP?c.createElement($l,{navigation:w,onBack:D}):null),[g,a,x,I,A,S,E,C,s,w,D,p]),k=(0,c.useMemo)((()=>g===ti.PAY_AS_GUEST?c.createElement(ql,{invoice:a,paymentMethodData:A,setPaymentMethodData:S,onPaymentSuccess:I,contactDetails:E,setContactDetails:C,customer:s,onSignUp:d,onUserExists:p}):g===ti.INVOICE_RECEIPT?c.createElement(Jl,{invoice:a,paymentMethodData:A,onCreateAccount:x}):g===ti.SIGN_UP?c.createElement($l,{navigation:w,onBack:D}):null),[g,a,I,A,E,S,C,x,s,w,D,d,p]),B=g===ti.PAY_AS_GUEST?c.createElement(ka.A,{label:P("integrations.buttons.sign-up"),onPress:d,buttonStyle:{width:148,height:40,backgroundColor:"#F8F9F9"},textStyle:{fontSize:14,color:"#001929"}}):null;return i?c.createElement(xo,{isWeb:i,button:B,contentViewStyle:{margin:0,height:"100%"}},T):k};let oi=function(e){return e[e.IDLE=0]="IDLE",e[e.SIGN_IN=1]="SIGN_IN",e[e.SIGN_UP=2]="SIGN_UP",e[e.INVOICE_DETAILS=3]="INVOICE_DETAILS",e[e.PAY_AS_GUEST=4]="PAY_AS_GUEST",e}({});const ri=e=>{let{step:t,isAuthenticated:n,navigation:o,setStep:r,setAuthState:a,setIsAuthenticated:l,setSignInInitialState:i,setSignInInitialStep:s,customer:d,setValue:u,setLogin:p}=e;const g=(0,c.useCallback)((()=>{[oi.SIGN_IN,oi.SIGN_UP].includes(t)&&n&&r(oi.INVOICE_DETAILS)}),[t,n,r]),h=(0,c.useCallback)((()=>{t!==oi.IDLE||n||(o.setParams({isGuest:!0}),r(oi.PAY_AS_GUEST))}),[t,n,o,r]),v=(0,c.useCallback)((async()=>{console.log("Logging out, clearing session"),await N.JZ.kQ.logout(),await a(null),l(!1),m.A.remove("session"),da.q.clear(),await ro.A.auth().signOut(),r(oi.IDLE)}),[a,l,r]),y=(0,c.useCallback)((async()=>{await v(),r(oi.IDLE)}),[v,r]),b=(0,c.useCallback)((e=>{i(e),s(bo.SIGN_IN_PASSWORD),t===oi.PAY_AS_GUEST&&o.setParams({isGuest:void 0}),r(oi.SIGN_IN)}),[t,o,i,s,r]),f=(0,c.useCallback)((async()=>{await v(),r(oi.SIGN_IN)}),[v,r]),E=(0,c.useCallback)((async()=>{n||(null!==d&&void 0!==d&&d.email&&i({login:d.email,type:"email"}),t===oi.IDLE&&r(oi.SIGN_IN),t===oi.PAY_AS_GUEST&&(o.setParams({isGuest:void 0}),r(oi.SIGN_IN)))}),[t,n,o,d,i,r]),C=(0,c.useCallback)((()=>{var e,t,n;null!==d&&void 0!==d&&d.email&&(u("type","password"),u("firstName",null!==(e=null===d||void 0===d?void 0:d.firstName)&&void 0!==e?e:""),u("lastName",null!==(t=null===d||void 0===d?void 0:d.lastName)&&void 0!==t?t:""),u("email",null!==(n=null===d||void 0===d?void 0:d.email)&&void 0!==n?n:""),u("phone",null!==d&&void 0!==d&&d.phone?(0,Mo.L)(d.phone,"US").formatNational():""),p(null===d||void 0===d?void 0:d.email))}),[d,u,p]);return{handleNext:g,handlePayAsGuest:h,handleSignUpUserExists:b,handlePermissionDenied:f,handleLogin:E,handleLogOut:y,handleSignUp:(0,c.useCallback)((async()=>{n||(C(),t===oi.IDLE&&r(oi.SIGN_UP),t===oi.PAY_AS_GUEST&&(o.setParams({isGuest:void 0}),r(oi.SIGN_UP)))}),[t,n,o,C,r]),handleAuthChange:(0,c.useCallback)((()=>{t===oi.SIGN_UP&&(null!==d&&void 0!==d&&d.email&&i({login:d.email,type:"email"}),r(oi.SIGN_IN)),t===oi.SIGN_IN&&(C(),r(oi.SIGN_UP))}),[t,d,i,C,r])}},ai=(0,a.PA)((e=>{var t;let{route:n,navigation:o}=e;const{userStore:r}=l.A,{setValue:a,setLogin:i}=Je.A,{remoteConfig:s}=(0,l.P)(),{isAuthenticated:u,setIsAuthenticated:m,setAuthState:p,user:g}=r,{invoiceId:h="",mode:v,redirectUrl:y,isGuest:b}=null!==(t=null===n||void 0===n?void 0:n.params)&&void 0!==t?t:{},[f,E]=(0,c.useState)(oi.IDLE),[C,A]=(0,c.useState)(bo.SIGN_IN_LOGIN),[S,w]=(0,c.useState)({}),[P,I]=(0,c.useState)(window.innerWidth),x=P>575,D=s.get("de_min_approval_amount")||5;(0,c.useEffect)((()=>{const e=()=>I(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),(0,c.useEffect)((()=>{h&&(u?E(oi.INVOICE_DETAILS):b&&E(oi.PAY_AS_GUEST))}),[h,u,b]);const{invoice:T,customer:k,invoiceCreditStatus:B,invoicePaymentStatus:F,loading:_,isInvoicePaid:R}=(e=>{const[t,n]=(0,c.useState)(null),[o,r]=(0,c.useState)(null),[a,l]=(0,c.useState)(null),[i,s]=(0,c.useState)(null),[d,u]=(0,c.useState)(null),[m,p]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{(async()=>
1{if(e){p(!0);const t=await N.Vv.SU.showInvoiceIdle({invoiceId:e});if(!t)return;const o=await N.Vv.SU.checkInvoiceIsPaid({invoiceId:e});n(t.invoice),r(t.customer),s(t.currentInvoiceCreditStatus),l(o.status),u(o.isPaid),p(!1)}})()}),[e]),{invoice:t,customer:o,invoiceCreditStatus:i,loading:m,isInvoicePaid:d,invoicePaymentStatus:a}})(h),{handleNext:M,handlePayAsGuest:O,handleSignUpUserExists:z,handlePermissionDenied:j,handleLogin:W,handleLogOut:V,handleSignUp:H,handleAuthChange:U}=ri({step:f,isAuthenticated:u,navigation:o,setStep:E,setAuthState:p,setIsAuthenticated:m,setSignInInitialState:w,setSignInInitialStep:A,customer:k,setValue:a,setLogin:i}),G=[...L.$D,...L.Vi].includes(B),Y=(0,c.useMemo)((()=>u?c.createElement(zr,{isWeb:x,mode:v}):R||G?c.createElement(Wr,{isWeb:x,onPress:W}):null),[u,R,G,x,v,W]),Q=(0,c.useMemo)((()=>c.createElement(Wa,{invoice:T,invoicePaymentStatus:F,invoiceCreditExist:G,isInvoicePaid:R,invoiceCreditStatus:B,onPressLogin:W,onPressSignUp:H,onPressPayAsGuest:O,isWeb:x,customer:k})),[T,F,G,R,B,W,H,O,x,k]);return _?c.createElement(d.A,null):T&&h?c.createElement(c.Fragment,null,f===oi.SIGN_IN&&c.createElement(fo,{onSuccess:M,onSignUp:U,initialStep:C,initialState:S,mode:v}),f===oi.SIGN_UP&&c.createElement(ca,{onSuccess:M,onLogin:U,onUserExists:z}),f===oi.INVOICE_DETAILS&&c.createElement(Ma,{invoiceId:h,minBnplAmount:D,onLogOut:V,onPermissionDenied:j,mode:v,redirectUrl:y,isWeb:x}),f===oi.PAY_AS_GUEST&&c.createElement(ni,{invoice:T,isInvoicePaidOff:R||G,isWeb:x,customer:k,onSignUp:H,mode:v,redirectUrl:y,onUserExists:z}),f===oi.IDLE&&(x?c.createElement(Io,{email:null!==g&&void 0!==g&&g.email?g.email:null!==g&&void 0!==g&&g.login?g.login:"",isWeb:x,button:Y},Q):Q)):null})),li=e=>{let{isWeb:t}=e;const{t:n}=(0,z.Bd)("global");return c.createElement(Io,{isWeb:t},c.createElement(K.A,{style:[ii.container,t?{marginTop:60}:{marginTop:100,paddingHorizontal:10}],testID:"sync-invoice-again-container"},c.createElement(q.YQQ,null),c.createElement(K.A,{style:ii.textsContainer,testID:"sync-invoice-again-message"},c.createElement(se.A,{style:ii.mainText,testID:"sync-invoice-again-main-title"},n("integrations.invoice-not-found")),c.createElement(se.A,{style:ii.infoText,testID:"sync-invoice-again-info-title"},n("integrations.ask-sync-invoice")))))},ii=ie.A.create({container:{justifyContent:"space-between",alignItems:"center",paddingBottom:20},textsContainer:{marginTop:38},mainText:{fontFamily:"Inter",fontSize:24,fontWeight:"700",lineHeight:32,textAlign:"center",color:"#19262F",maxWidth:581},infoText:{marginTop:8,fontFamily:"Inter",fontSize:16,fontWeight:"400",lineHeight:32,textAlign:"center",color:"#19262F"}}),si=(0,a.PA)((e=>{var t,n,o,r,a,l,i,s,u,m,p,g;let{invoiceNumber:h,supplierCompanyId:v,minBnplAmount:y=5,onLogOut:b,onPermissionDenied:E,isWeb:C,mode:A,redirectUrl:S}=e;null===(t=window)||void 0===t||null===(n=t.opener)||void 0===n||n.postMessage({type:J.c.CONNECTION_ESTABLISHED},"*"),null===(o=window)||void 0===o||null===(r=o.parent)||void 0===r||r.postMessage({type:J.c.CONNECTION_ESTABLISHED},"*");const w=(0,$e.useNavigation)(),P=(0,$e.useRoute)(),{t:I}=(0,z.Bd)("global"),[x,D]=(0,c.useState)(Xr.NONE),[T,k]=(0,c.useState)(null),[B,_]=(0,c.useState)(null),[R,M]=(0,c.useState)(null),O=window.location.origin;let j;A&&A===yo.K.POPUP&&(j="width=800,height=600,scrollbars=yes,resizable=yes");const{invoice:W,invoiceMetadata:V,loading:H,isInvoicePaid:U,invoicePaymentStatus:G}=((e,t,n)=>{const[o,r]=(0,c.useState)(null),[a,l]=(0,c.useState)(null),[i,s]=(0,c.useState)(null),[d,u]=(0,c.useState)(null),[m,p]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{(async()=>{var o;p(!0);const a=await pa({invoiceNumber:e,supplierCompanyId:t});if(null===a||void 0===a||null===(o=a.invoice)||void 0===o||!o._id)return n(L.lI),void p(!1);const i=await N.Vv.SU.checkInvoiceIsPaid({invoiceId:a.invoice._id});r(a.invoice),u(a.invoiceMetadata),l(null===i||void 0===i?void 0:i.status),s(null===i||void 0===i?void 0:i.isPaid),p(!1)})()}),[e,t]),{invoice:o,invoiceMetadata:d,loading:m,isInvoicePaid:i,invoicePaymentStatus:a}})(h,v,_),{userInfo:Y,loading:Q}=Kr(_),q=f.A.screensStore.paymentMethodsStore,Z=(0,c.useRef)(!1);(0,c.useEffect)((()=>{Z.current||(Z.current=!0,q.fetchPaymentMethods())}),[q]);const{userProjects:X,loading:$}=Jr(_),{creditPaymentOptions:ee,loading:te}=ga(null!==(a=null===W||void 0===W?void 0:W._id)&&void 0!==a?a:"",Number(null===W||void 0===W?void 0:W.total_amount),_),ne=H||Q||q.loading||$||te,{handleResetFlow:oe,handlePrimaryForCreditChanged:re}=ta(D,q.fetchPaymentMethods),ae=(0,c.useMemo)((()=>{var e,t;return(null===Y||void 0===Y||null===(e=Y.user)||void 0===e?void 0:e.email)||(null===Y||void 0===Y||null===(t=Y.user)||void 0===t?void 0:t.login)||""}),[Y]);(0,c.useEffect)((()=>{var e,t,n;(null===W||void 0===W||null===(e=W.connector)||void 0===e?void 0:e.connector_type)===Sa.NetSuite&&(W.customerCompanyId&&W.customerCompanyId!==(null===Y||void 0===Y||null===(t=Y.company)||void 0===t?void 0:t._id)&&(null===W||void 0===W?void 0:W.company_id)!==(null===Y||void 0===Y||null===(n=Y.company)||void 0===n?void 0:n._id)&&D(Xr.NOT_ENOUGH_PERMISSIONS))}),[W,Y]);const le=fa(Y,q.paymentMethods,k,D,M,j),ie=(0,c.useCallback)((()=>{console.log("paymentSuccess",ae),Ca({email:ae,navigation:w,mode:A,redirectUrl:S})}),[ae,A,S]),ce=(0,c.useCallback)((()=>{console.log("paymentFail"),Aa({navigation:w,mode:A,redirectUrl:S})}),[A,S]);if((0,c.useEffect)((()=>{const e=e=>{e.origin===O?e.data.type===J.c.CREDIT_APPLICATION_SUBMITTED&&T&&(T.close(),k(null),window.location.reload()):console.warn("Received message from unexpected origin:",e.origin)};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[T,O]),ne)return c.createElement(d.A,null);if(!W)return c.createElement(li,{isWeb:C});if(!V||B)return c.createElement(c.Fragment,null);if(x===Xr.NOT_ENOUGH_PERMISSIONS)return c.createElement(wa,{email:ae,isWeb:C,onPress:E});const de=(null===Y||void 0===Y||null===(l=Y.company)||void 0===l?void 0:l._id)===(null===W||void 0===W?void 0:W.company_id),ue=W.type===N.tD.QUOTE,me=(null===(i=W.paymentDetails)||void 0===i?void 0:i.paymentType)===N.mn.FACTORING,pe=ue&&me,ge=Number(W.total_amount)<y,he=W.status===L.uR.draft,ve=V.bnplPaymentAvailable&&V.currentInvoiceCreditStatus!==L.r7.REJECTED&&V.loanApplicationStatus!==L.r7.REJECTED&&!(null===ee||void 0===ee||!ee.plans.length),ye=V.currentInvoiceCreditStatus,be=[...L.$D,...L.Vi].includes(ye),fe=!de&&!U&&!be,Ee=V.acceptAchPayment||V.cardPaymentAvailable,Ce=(Ee||ve||(null===W||void 0===W?void 0:W.isPaymentMethodsAdded))&&fe&&!pe;return c.createElement(Io,{email:ae,isWeb:C,button:A?c.createElement(jr,{onLogOut:b}):c.createElement(zr,{isWeb:C,mode:A})},C&&c.createElement(K.A,{style:{width:486,alignSelf:"center",marginBottom:60}}
1,c.createElement(Ba,{invoice:W,additionalFields:!de||U||be?[]:[{label:I("integrations.invoice.status"),value:c.createElement(Ia.V,{status:null!==(s=W.status)&&void 0!==s?s:L.uR.placed,statusOptionsProvider:xa.O})}],backgroundColor:"#F8F9F9"})),c.createElement(Ro.A,{containerStyle:{alignSelf:"center"},contentContainerStyle:{height:"100%"}},!C&&c.createElement(Na,{invoice:W}),!C&&de&&!U&&!be&&c.createElement(Da,{status:W.status||L.uR.placed}),(U&&G===N.bx.xi.SUCCESS||ye===L.r7.CLOSED)&&c.createElement(Gr,{isWeb:C}),(be&&ye!==L.r7.CLOSED||U&&G===N.bx.xi.PROCESSING)&&c.createElement(Hr,{isWeb:C}),Ce&&c.createElement(se.A,{style:Qr.chooseMethodText,testID:"choose-payment-method-title"},I("InvoiceDetails.choose-method")),ve&&fe&&!me&&c.createElement(c.Fragment,null,c.createElement(Qo,{currentInvoiceCreditStatus:V.currentInvoiceCreditStatus,amountLessThanMin:Number(W.total_amount)<y,onPress:le,showInfo:!0,disabled:be||ge||he}),c.createElement(F.hK,{height:23}),!(be||ge||he||ue)&&c.createElement(ya,null)),fe&&Ee&&!ue&&c.createElement(c.Fragment,null,c.createElement(ra.Z,{invoices:[W],withBanks:V.acceptAchPayment,withCards:V.cardPaymentAvailable,navigation:w,route:P,onSuccess:ie,onError:ce}),c.createElement(F.hK,{height:43})),pe&&c.createElement(La,null),x===Xr.PAY_WITH_BLUETAPE_CREDIT_FLOW&&R&&W&&X&&Y&&(null===ee||void 0===ee?void 0:ee.plans)&&c.createElement(Or,{invoiceId:W._id,companyName:W.company.name,paymentMethodName:R.name,onClose:oe,onSuccess:ie,onFail:ce,userProjects:X,paymentOptions:ee,invoice_connector_project:null===(u=W.connector)||void 0===u?void 0:u.project,invoice_connector_integration_id:null===(m=W.connector)||void 0===m?void 0:m.integration_id,company_credit_purchaseType:null===(p=Y.company)||void 0===p||null===(g=p.credit)||void 0===g?void 0:g.purchaseType}),x===Xr.CONNECT_NEW_BANK_ACCOUNT&&c.createElement(er,{onClose:oe,onPrimaryForCreditChanged:re})))})),ci=(0,a.PA)((e=>{var t;let{route:n,navigation:o}=e;const{userStore:r}=l.A,{setValue:a,setLogin:i}=Je.A,{remoteConfig:s}=(0,l.P)(),{isAuthenticated:u,setIsAuthenticated:m,setAuthState:p,user:g}=r,{invoiceNumber:h="",supplierCompanyId:v="",mode:y,redirectUrl:b,isGuest:f}=null!==(t=null===n||void 0===n?void 0:n.params)&&void 0!==t?t:{},[E,C]=(0,c.useState)(oi.IDLE),[A,S]=(0,c.useState)(bo.SIGN_IN_LOGIN),[w,P]=(0,c.useState)({}),[I,x]=(0,c.useState)(window.innerWidth),D=I>575,T=s.get("de_min_approval_amount")||5;(0,c.useEffect)((()=>{h&&u&&v&&(u?C(oi.INVOICE_DETAILS):f&&C(oi.PAY_AS_GUEST))}),[h,u,v,f]),(0,c.useEffect)((()=>{const e=()=>x(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const{invoice:k,customer:B,invoiceCreditStatus:F,invoicePaymentStatus:_,loading:R,isInvoicePaid:M}=((e,t)=>{const[n,o]=(0,c.useState)(null),[r,a]=(0,c.useState)(null),[l,i]=(0,c.useState)(null),[s,d]=(0,c.useState)(null),[u,m]=(0,c.useState)(null),[p,g]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{(async()=>{if(e&&t){var n;g(!0);const r=await N.Vv.SU.showInvoiceIdle({invoiceNumber:e,supplierCompanyId:t});if(null===r||void 0===r||null===(n=r.invoice)||void 0===n||!n._id)return void g(!1);const l=await N.Vv.SU.checkInvoiceIsPaid({invoiceId:r.invoice._id});o(r.invoice),a(r.customer),d(r.currentInvoiceCreditStatus),i(l.status),m(l.isPaid),g(!1)}})()}),[e,t]),{invoice:n,customer:r,invoiceCreditStatus:s,loading:p,isInvoicePaid:u,invoicePaymentStatus:l}})(h,v),O=[...L.$D,...L.Vi].includes(F),{handleNext:z,handlePayAsGuest:j,handleLogOut:W,handleSignUpUserExists:V,handlePermissionDenied:H,handleLogin:U,handleSignUp:G,handleAuthChange:Y}=ri({step:E,isAuthenticated:u,navigation:o,setStep:C,setAuthState:p,setIsAuthenticated:m,setSignInInitialState:P,setSignInInitialStep:S,customer:B,setValue:a,setLogin:i}),Q=(0,c.useMemo)((()=>u?c.createElement(zr,{isWeb:D,mode:y}):M||O?c.createElement(Wr,{isWeb:D,onPress:U}):null),[u,M,O,D,y,U]),q=(0,c.useMemo)((()=>c.createElement(Wa,{invoice:k,invoicePaymentStatus:_,invoiceCreditExist:O,isInvoicePaid:M,invoiceCreditStatus:F,onPressLogin:U,onPressSignUp:G,onPressPayAsGuest:j,isWeb:D,customer:B})),[k,_,O,M,F,U,G,j,D,B]);return h&&v?R?c.createElement(d.A,null):k?k.connector?c.createElement(c.Fragment,null,E===oi.SIGN_IN&&c.createElement(fo,{onSuccess:z,onSignUp:Y,initialStep:A,initialState:w,mode:y}),E===oi.SIGN_UP&&c.createElement(ca,{onSuccess:z,onLogin:Y,onUserExists:V}),E===oi.INVOICE_DETAILS&&c.createElement(si,{invoiceNumber:h,supplierCompanyId:v,minBnplAmount:T,onLogOut:W,onPermissionDenied:H,mode:y,redirectUrl:b,isWeb:D}),E===oi.PAY_AS_GUEST&&c.createElement(ni,{invoice:k,isInvoicePaidOff:M||O,isWeb:D,customer:B,onSignUp:G,mode:y,redirectUrl:b,onUserExists:V}),E===oi.IDLE&&(D?c.createElement(Io,{email:null!==g&&void 0!==g&&g.email?g.email:null!==g&&void 0!==g&&g.login?g.login:"",isWeb:D,button:Q},q):q)):null:c.createElement(li,{isWeb:D}):null}));var di=n(71995);const ui=e=>{let{children:t,currentStep:n,wrapperStyle:o}=e;const{screenWidth:r,sm:a}=(0,ce.Qs)(),l=(0,c.useRef)(null);return(0,c.useEffect)((()=>{var e;null===(e=l.current)||void 0===e||e.scrollTo({y:0,animated:!1})}),[n]),c.createElement(rt.A,{ref:l,contentContainerStyle:{flexGrow:1,alignItems:"center"},showsVerticalScrollIndicator:!1},c.createElement(K.A,{style:[{paddingHorizontal:a?0:20,paddingVertical:20,flex:1,minWidth:r>600?600:"100%",maxWidth:r>600?600:void 0},o]},t))},mi="[email protected]",pi="855-428-1185",gi=()=>c.createElement(K.A,{style:hi.contactContainer},c.createElement(fe.Icon,{name:"phone-outline",width:20,fill:Oo.B.blue.blue400}),c.createElement(de.b_,{onPress:()=>Yn.A.openURL("tel:".concat(pi)),title:pi,textStyle:hi.contactText}),c.createElement(F.hK,{width:16}),c.createElement(fe.Icon,{name:"at-outline",width:20,fill:Oo.B.blue.blue400}),c.createElement(de.b_,{onPress:()=>Yn.A.openURL("mailto:".concat(mi)),title:mi,textStyle:hi.contactText})),hi=ie.A.create({contactContainer:{flexDirection:"row",alignItems:"center"},contactText:{fontFamily:"Inter, sans-serif",fontSize:14,fontWeight:"600",color:Oo.B.blue.blue400,marginLeft:4}}),vi=()=>{const{t:e}=(0,z.Bd)("application");return c.createElement(K.A,{style:yi.footer},c.createElement(gi,null),c.createElement(de.QG,{style:yi.footerNote},e("LenderApplication.Wizard.AutoSaveHint")))}
1,yi=ie.A.create({footer:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginHorizontal:22,marginVertical:16},footerNote:{fontSize:14,fontWeight:"500",color:Oo.B.text.grey400}});var bi=n(77095);const fi=e=>{let{logoutWarning:t}=e;const[n,o]=c.useState(!1);return c.createElement(Bt.A,{onPress:()=>o(!0),style:Ci.closeButton},c.createElement(fe.Icon,{name:"log-out-outline",width:24,color:Oo.B.elements.black}),n&&c.createElement(Ei,{logoutWarning:t,onClose:()=>o(!1),onLogout:()=>f.A.logOut()}))},Ei=e=>{let{logoutWarning:t,onClose:n,onLogout:o}=e;const{t:r}=(0,z.Bd)("application");return c.createElement(bi.yZ,{title:r("LenderApplication.CloseWarning.Title"),onClose:n,testID:"LenderApplication.PreviousProjects.Modal"},c.createElement(bi.yZ.Content,null,t?c.createElement(de.QG,{style:Ci.message},t):c.createElement(c.Fragment,null,c.createElement(de.QG,{style:Ci.message},r("LenderApplication.CloseWarning.Message1")),c.createElement(F.hK,{height:16}),c.createElement(de.QG,{style:Ci.message},r("LenderApplication.CloseWarning.Message2")))),c.createElement(bi.yZ.Buttons,null,c.createElement(de.BtButton,{appearance:"ghost",onPress:n,style:Ci.footerButton,testID:"LenderApplication.CloseWarning.GoBack"},r("LenderApplication.CloseWarning.GoBack")),c.createElement(de.BtButton,{onPress:o,style:Ci.footerButton,testID:"LenderApplication.CloseWarning.LogOut"},r("LenderApplication.CloseWarning.LogOut"))))},Ci=ie.A.create({closeButton:{alignItems:"center",justifyContent:"center",width:36,height:36,backgroundColor:Oo.B.background.grey100,borderRadius:8,borderWidth:0,marginRight:22},message:{fontSize:16},footerButton:{minWidth:120}}),Ai=e=>{let{logoutWarning:t,children:n}=e;return c.createElement(K.A,{style:Si.wrapper},c.createElement(K.A,{style:Si.contentContainer},n),c.createElement(fi,{logoutWarning:t}))},Si=ie.A.create({wrapper:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginVertical:18},contentContainer:{flexDirection:"row",flexWrap:"wrap",justifyContent:"center",flex:1}}),wi=(0,a.PA)((e=>{let{text:t}=e;return c.createElement(de.QG,{style:Pi.groupTitle},t)})),Pi=ie.A.create({groupTitle:{fontSize:14,fontWeight:"600",lineHeight:22}});var Ii=n(94573);var xi=n(32326);function Di(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;if(!e||e.length<=t)return e;const n=e.lastIndexOf(".");if(-1===n)return e.substring(0,t-3)+"...";const o=e.substring(n),r=e.substring(0,n);if(o.length>10)return e.substring(0,t-3)+"...";const a=t-o.length-3;return r.length<=a?e:r.substring(0,a)+"..."+o}var Ti=n(40701);const ki=()=>{const{t:e}=(0,z.Bd)("application");return c.createElement(K.A,{style:{flex:1}},c.createElement(Ai,null,c.createElement(wi,null)),c.createElement(fe.Divider,null),c.createElement(ui,null,c.createElement(K.A,{style:Bi.successContainer},c.createElement(Ti.G,{name:"checkmark-outline"}),c.createElement(F.hK,{height:24}),c.createElement(de.QG,{style:Bi.successTitle},e("LenderApplication.Completed.Title")),c.createElement(F.hK,{height:16}),c.createElement(de.QG,{style:Bi.successDescription},e("LenderApplication.Completed.Description")))),c.createElement(vi,null))},Bi=ie.A.create({successContainer:{flex:1,paddingHorizontal:60,paddingVertical:20},successTitle:{fontSize:24,fontWeight:"700",lineHeight:36,textAlign:"center"},successDescription:{fontSize:14,fontWeight:"500",lineHeight:20,textAlign:"center",color:Oo.B.text.black}});var Fi=n(60863);const _i=()=>c.createElement(K.A,{style:Ni.spinner},c.createElement(fe.Spinner,null)),Ni=ie.A.create({spinner:{flex:1,justifyContent:"center",alignItems:"center"}}),Ri=()=>{var e;const{t:t}=(0,z.Bd)("application"),n=(0,$e.useNavigation)(),o=null===(e=(0,$e.useRoute)().params)||void 0===e?void 0:e.lenderId;if(!o)throw new Error("Lender ID is required");const[r,a]=(0,c.useState)(!1),{documents:l,draft:i,loading:s,loadData:d,downloadDocument:u,removeDocument:m,pickAndUploadDocument:p,isUploading:g,uploadError:h,creditApplication:v,submitDocuments:y,isSubmitting:b,removingDocumentId:f}=function(e){const[t,n]=(0,c.useState)([]),[o,r]=(0,c.useState)(null),[a,l]=(0,c.useState)(!1),[i,s]=(0,c.useState)(null),[d,u]=(0,c.useState)(!1),[m,p]=(0,c.useState)(null),{isUploading:g,error:h,pickAndUploadFile:v}=(0,ce.A3)(),y=(0,c.useCallback)((async()=>
1{if(e){l(!0);try{const[t,o,a]=await Promise.all([N.Vv.pW.getLenderDocuments({lenderId:e}),N.Vv.pW.getLenderApplicationDraft({lenderId:e}),N.Vv.pW.getLenderCreditApplication({lenderId:e})]);n(t.documents||[]),r(o.draft),s(a)}catch(t){throw new Error("Error loading lender documents")}finally{l(!1)}}}),[e]),b=(0,c.useCallback)((async(t,n)=>{try{return await N.Vv.pW.uploadLenderDocument({lenderId:e,templateCode:t},n),await y(),{success:!0}}catch(o){const e=o instanceof Error?o.message:"Failed to upload document";return console.error("Error uploading document:",o),{success:!1,error:e}}}),[e,y]),f=(0,c.useCallback)((async e=>{try{if(!e.s3Url)throw new Error("Document URL not available");return await N.Vv.pW.getLenderDocumentDownload({s3Url:e.s3Url})}catch(t){return console.error("Error downloading document:",t),null}}),[]),E=(0,c.useCallback)((async t=>{p(t);try{return await N.Vv.pW.removeLenderDocument({lenderId:e,documentId:t}),await y(),{success:!0}}catch(n){const e=n instanceof Error?n.message:"Failed to remove document";return console.error("Error removing document:",n),{success:!1,error:e}}finally{p(null)}}),[e,y]),C=(0,c.useCallback)((async e=>{const n=t.map((e=>e.fileName)).filter((e=>void 0!==e));await v(e,(async t=>{const n=await b(e,t);if(!n.success)throw new Error(n.error||"Upload failed")}),n)}),[v,b,t]),A=(0,c.useCallback)((async()=>{u(!0);try{const t=await N.Vv.pW.submitLenderDocuments({lenderId:e});return t.success&&await y(),t}catch(t){const e=t instanceof Error?t.message:"Failed to submit documents";return console.error("Error submitting documents:",t),{success:!1,error:e}}finally{u(!1)}}),[e,y]);return{documents:t,draft:o,loading:a,loadData:y,downloadDocument:f,removeDocument:E,pickAndUploadDocument:C,isUploading:g,uploadError:h,creditApplication:i,submitDocuments:A,isSubmitting:d,removingDocumentId:m}}(o);(0,c.useEffect)((()=>{d()}),[d]);const C=Object.values((0,Ii.b)(i)).filter((e=>e.required)),A=l.some((e=>!!e.s3Url)),S=C.every((e=>{const t=l.find((t=>t.type===e.type));return null===t||void 0===t?void 0:t.s3Url})),w=(null===v||void 0===v?void 0:v.status)&&[Fi.W.Approved,Fi.W.Rejected].includes(v.status),P=(null===v||void 0===v?void 0:v.status)&&[Fi.W.SentBack,Fi.W.Canceled].includes(v.status);return s?c.createElement(_i,null):w||r?c.createElement(ki,null):(P&&n.navigate(E.f0.LenderApplication),c.createElement(K.A,{style:{flex:1}},c.createElement(Ai,null,c.createElement(wi,{text:t("LenderApplication.Documents.Header")})),c.createElement(No.A,null),c.createElement(ui,null,c.createElement(de.QG,{style:Li.title},t("LenderApplication.Documents.Title")),c.createElement(F.hK,{height:16}),c.createElement(de.QG,{style:Li.description},t("LenderApplication.Documents.Description")),c.createElement(F.hK,{height:32}),h&&c.createElement(c.Fragment,null,c.createElement(de.QG,{style:Li.errorText},h),c.createElement(F.hK,{height:12})),c.createElement(K.A,{style:Li.documentsList},Object.entries((0,Ii.b)(i)).map((e=>{let[n,o]=e;const r=l.find((e=>e.type===o.type));return c.createElement(K.A,{key:n,style:Li.documentRow},c.createElement(K.A,{style:Li.documentColumn},null!==r&&void 0!==r&&r.id?c.createElement(fe.Icon,{name:"checkmark-outline",width:20,fill:Oo.B.service.green}):c.createElement(fe.Icon,{name:"file-text-outline",width:20,fill:Oo.B.text.grey400}),c.createElement(de.QG,{style:Li.documentName},t("LenderApplication.Documents.Names.".concat(n))),o.required?c.createElement(de.QG,{style:[Li.documentName,Li.required]},t("LenderApplication.SubmittedPage.RequiredDocument")):c.createElement(de.QG,{style:Li.documentName},t("LenderApplication.SubmittedPage.OptionalDocument"))),c.createElement(K.A,{style:Li.documentColumn},null!==r&&void 0!==r&&r.id?c.createElement(c.Fragment,null,c.createElement(de.b_,{title:Di(r.fileName||""),textStyle:Li.documentLink,onPress:()=>(async e=>{try{if(!e.s3Url)return;const t=await u(e);null!==t&&void 0!==t&&t.url&&(0,xi.m)(t.url,{},t.fileName)}catch(t){console.error("Error generating download link:",t)}})(r)}),c.createElement(Bt.A,{onPress:()=>(async e=>{if(!e)return;const t=await m(e);!t.success&&t.error&&console.error("Remove failed:",t.error)})(r.id),disabled:!!f,style:[!!f&&{opacity:.5}]},c.createElement(fe.Icon,{name:"trash-2-outline",width:20,fill:Oo.B.text.grey400}))):c.createElement(de.BtButton,{size:"small",disabled:g,onPress:()=>(async e=>{try{await p(e)}catch(t){console.error("Upload failed:",t)}})(o.type),style:Li.uploadButton},t("LenderApplication.Documents.Upload"))))}))),c.createElement(F.hK,{height:34}),c.createElement(de.BtButton,{disabled:!A||!S||b,onPress:async()=>{try{const e=await y();e.success?a(!0):console.error("Submit failed:",null===e||void 0===e?void 0:e.error)}catch(e){console.error("Submit failed:",e)}},loading:b,style:Li.submitButton},t("LenderApplication.Documents.SubmitDocuments"))),c.createElement(vi,null)))},Li=ie.A.create({title:{fontSize:24,fontWeight:"700",lineHeight:36},description:{fontSize:16,fontWeight:"500",lineHeight:24},documentsList:{flexDirection:"column",gap:16},documentRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderWidth:1,borderRadius:8,borderColor:Oo.B.elements.grey300,paddingHorizontal:20,paddingVertical:12},documentColumn:{flexDirection:"row",alignItems:"center",gap:8},documentLink:{fontFamily:"Inter, sans-serif",fontSize:14,fontWeight:"600",color:Oo.B.blue.blue400,textDecorationLine:"underline"},documentName:{fontSize:14,fontWeight:"500"},required:{color:Oo.B.service.red100c},errorText:{fontSize:14,fontWeight:"500",color:Oo.B.service.red100c,lineHeight:20},uploadButton:{paddingHorizontal:26},submitButton:{width:250,alignSelf:"flex-end"}});let Mi=function(e){return e.Street="street",e.City="city",e.State="state",e.Zip="zip",e.Building="building",e.Apartment="apartment",e}({}),Oi=function(e){return e.Single="Single",e.Married="Married",e}({}),zi=function(e){return e.RecentForeclosureOrRelief="RecentForeclosureOrRelief",e.RecentBankruptcy="RecentBankruptcy",e.CurrentFederalDefault="CurrentFederalDefault",e.FelonyConviction="FelonyConviction",e.PendingLitigation="PendingLitigation",e.OutstandingJudgments="OutstandingJudgments",e.LawsuitDefendant="LawsuitDefendant",e.PortfolioLitigation="PortfolioLitigation",e}({}),ji=function(e){return e.PermanentResident="PermanentResident",e.Visa="Visa",e.ForeignResident="ForeignResident",e}({}),Wi=function(e){return e.NewConstruction="NewConstruction",e.ConstructionCompletion="ConstructionCompletion",e.Rehab="Rehab",e.Bridge="Bridge",e}({}),Vi=function(e){return e.SingleFamily="SingleFamily",e.MultiFamily="MultiFamily",e.Condo="Condo",e.Townhomes="Townhomes",e.Duplex="Duplex",e.Triplex="Triplex",e.Fourplex="Fourplex",e}({}),Hi=function(e){return e.Purchase="Purchase",e.Refinance="Refinance",e}({}),Ui=function(e){return e.SellerCarry="SellerCarry",e.EntityOwnership="EntityOwnership",e}({}),Gi=function(e){return e.PersonalPortfolio="PersonalPortfolio",e.InvestToSelf="InvestToSelf",e.HiredByCompany="HiredByCompany",e}({});const Yi="sponsor",Qi="businessEntity",qi="previousProjects",Ki="currentProject",Ji="review",Zi={[Yi]:{loanOfficer:"".concat(Yi,".loanOfficer"),personalInformation:"".concat(Yi,".personalInformation"),homeAddress:"".concat(Yi,".homeAddress"),maritalStatus:"".concat(Yi,".maritalStatus"),statements:"".concat(Yi,".statements"),citizenship:"".concat(Yi,".citizenship")},[Qi]:{entityInformation:"".concat(Qi,".entityInformation"),address:"".concat(Qi,".address"),isCreatedForProject:"".concat(Qi,".isCreatedForProject"),representative:"".concat(Qi,".representative")},[qi]:{projects:"".concat(qi,".projects"),bankAccounts:"".concat(qi,".bankAccounts")},[Ki]:{loanType:"".concat(Ki,".loanType"),loanPurpose:"".concat(Ki,".loanPurpose"),loanTerm:"".concat(Ki,".loanTerm"),generalContractor:"".concat(Ki,".generalContractor"),mainAddress:"".concat(Ki,".mainAddress"),originalPurchaseDetails:"".concat(Ki,".originalPurchaseDetails"),payoffAmount:"".concat(Ki,".payoffAmount"),subordinateDebts:"".concat(Ki,".subordinateDebts"),permits:"".concat(Ki,".permits"),hasMultipleBuilds:"".concat(Ki,".hasMultipleBuilds"),builds:"".concat(Ki,".builds"),projectDetails:"".concat(Ki,".projectDetails"),project
1ValueDetails:"".concat(Ki,".projectValueDetails")},[Ji]:{review:"".concat(Ji,".review")}};var Xi=n(47059),$i=n.n(Xi);class es{constructor(e){this._draft=void 0,this._draft=e}validate(e){var t,n,o,r,a,l,i,s,c,d,u,m,p,g,h,v,y,b,f,E,C,A;switch(e){case Zi.sponsor.loanOfficer:return this.validateLoanOfficer();case Zi.sponsor.personalInformation:return this.validateSponsorPersonalInfo();case Zi.sponsor.homeAddress:return es.validateAddress(null===(t=this._draft.data)||void 0===t||null===(n=t.sponsor)||void 0===n?void 0:n.homeAddress);case Zi.sponsor.maritalStatus:return!(null===(o=this._draft.data)||void 0===o||null===(r=o.sponsor)||void 0===r||!r.maritalStatus);case Zi.sponsor.statements:return this.validateSponsorStatements();case Zi.sponsor.citizenship:return this.validateSponsorCitizenship();case Zi.businessEntity.entityInformation:return this.validateBusinessEntityInformation();case Zi.businessEntity.address:return es.validateAddress(null===(a=this._draft.data)||void 0===a||null===(l=a.businessEntity)||void 0===l?void 0:l.address);case Zi.businessEntity.isCreatedForProject:return this.validateBusinessEntityIncorporationDate();case Zi.businessEntity.representative:return this.validateBusinessEntityRepresentative();case Zi.previousProjects.projects:return this.validatePreviousProjects();case Zi.previousProjects.bankAccounts:return!0;case Zi.currentProject.loanType:return!(null===(i=this._draft.data)||void 0===i||null===(s=i.currentProject)||void 0===s||!s.loanType);case Zi.currentProject.loanPurpose:return!(null===(c=this._draft.data)||void 0===c||null===(d=c.currentProject)||void 0===d||!d.loanPurpose);case Zi.currentProject.loanTerm:return!(null===(u=this._draft.data)||void 0===u||null===(m=u.currentProject)||void 0===m||!m.loanTermMonths);case Zi.currentProject.generalContractor:return this.validateGeneralContractor();case Zi.currentProject.mainAddress:return es.validateAddress(null===(p=this._draft.data)||void 0===p||null===(g=p.currentProject)||void 0===g?void 0:g.mainAddress,[Mi.Street,Mi.Building,Mi.Apartment]);case Zi.currentProject.originalPurchaseDetails:return this.validateOriginalPurchaseDetails();case Zi.currentProject.payoffAmount:return!1===(null===(h=this._draft.data)||void 0===h||null===(v=h.currentProject)||void 0===v?void 0:v.hasPayoffAmount)||!0===(null===(y=this._draft.data)||void 0===y||null===(b=y.currentProject)||void 0===b?void 0:b.hasPayoffAmount)&&((null===(f=this._draft.data)||void 0===f||null===(E=f.currentProject)||void 0===E?void 0:E.payoffAmount)||0)>0;case Zi.currentProject.subordinateDebts:return this.validateSubordinateDebts();case Zi.currentProject.permits:return this.validatePermits();case Zi.currentProject.hasMultipleBuilds:return this.isBoolean(null===(C=this._draft.data)||void 0===C||null===(A=C.currentProject)||void 0===A?void 0:A.hasMultipleBuilds);case Zi.currentProject.builds:return this.validateBuilds();case Zi.currentProject.projectDetails:return this.validateProjectDetails();case Zi.currentProject.projectValueDetails:return this.validateProjectValueDetails();case Zi.review.review:return!0;default:throw new Error("Unknown validation path: ".concat(e))}}static validateBuild(e,t){var n,o,r,a,l;if(!e)return!1;let i=!!e.breakdown&&!!e.type&&(e.numberOfUnits||0)>0&&(e.budget||0)>0&&((null===(n=e.projectValueDetails)||void 0===n?void 0:n.projectValue)||0)>0&&((null===(o=e.projectValueDetails)||void 0===o?void 0:o.perUnitValue)||0)>0&&((null===(r=e.projectValueDetails)||void 0===r?void 0:r.totalFinishedValue)||0)>0&&((null===(a=e.projectValueDetails)||void 0===a?void 0:a.perUnitFinishedValue)||0)>0&&this.validateAddress(e.address,[Mi.Street,Mi.Building,Mi.Apartment]);var s,c;(null===(l=t.data.currentProject)||void 0===l?void 0:l.loanPurpose)===Hi.Refinance&&(i=i&&((null===(s=e.projectValueDetails)||void 0===s?void 0:s.budgetSpent)||0)>0&&((null===(c=e.projectValueDetails)||void 0===c?void 0:c.perUnitBudgetSpent)||0)>0);return i}static validateProject(e){return!!e&&(!!e.entityTitle&&(e.numberOfUnits||0)>0&&(e.numberOfHomesCompleted||0)>0&&(e.acquisitionPrice||0)>0&&(e.dispositionPrice||0)>0&&(0,lo.checkIfDateIsInPast)(e.acquisitionDate||"")&&(0,lo.checkIfDateIsInPast)(e.dispositionDate||"")&&!!e.type&&!!e.structure&&this.validateAddress(e.address,[Mi.Street,Mi.Building,Mi.Apartment]))}
1isBoolean(e){return"boolean"===typeof e}validateLoanOfficer(){var e,t;const n=null===(e=this._draft.data)||void 0===e||null===(t=e.sponsor)||void 0===t?void 0:t.loanOfficer;return!!n&&(n.id?!!n.id:!!n.name&&(0,lo.validateUSPhoneNumber)(n.phone||""))}validateSponsorPersonalInfo(){var e,t;const n=null===(e=this._draft.data)||void 0===e||null===(t=e.sponsor)||void 0===t?void 0:t.personalInfo;return!!n&&(!!n.firstName&&!!n.lastName&&(0,lo.validateEmail)(n.email)&&(0,lo.validateUSPhoneNumber)(n.phone||"")&&(0,lo.validateBirthdate)(n.birthdate)&&(0,lo.validateSsn)(n.ssn))}static validateAddress(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Mi.Building,Mi.Apartment];return!!e&&(((null===t||void 0===t?void 0:t.includes(Mi.City))||!!e.city)&&((null===t||void 0===t?void 0:t.includes(Mi.State))||!!e.state)&&((null===t||void 0===t?void 0:t.includes(Mi.Street))||!!e.street)&&((null===t||void 0===t?void 0:t.includes(Mi.Building))||!!e.building)&&((null===t||void 0===t?void 0:t.includes(Mi.Apartment))||!!e.apartment)&&((null===t||void 0===t?void 0:t.includes(Mi.Zip))||(0,lo.validateZip)(e.zip)))}validateSponsorStatements(){var e,t;const n=null===(e=this._draft.data)||void 0===e||null===(t=e.sponsor)||void 0===t?void 0:t.statements;
1if(!n||0===n.length)return!1;return[zi.RecentForeclosureOrRelief,zi.RecentBankruptcy,zi.CurrentFederalDefault,zi.FelonyConviction,zi.PendingLitigation,zi.OutstandingJudgments,zi.LawsuitDefendant,zi.PortfolioLitigation].every((e=>n.some((t=>t.statementId===e&&this.isBoolean(t.answer)))))}validateSponsorCitizenship(){var e,t,n,o;return!0===(null===(e=this._draft.data)||void 0===e||null===(t=e.sponsor)||void 0===t?void 0:t.isUsCitizen)||!(null===(n=this._draft.data)||void 0===n||null===(o=n.sponsor)||void 0===o||!o.legalResidencyStatus)}validateBusinessEntityInformation(){var e;const t=null===(e=this._draft.data)||void 0===e?void 0:e.businessEntity;return!!t&&(!!t.name&&!!t.type&&(0,lo.validateEin)(t.ein))}validateBusinessEntityIncorporationDate(){var e,t,n,o;const r=null===(e=this._draft.data)||void 0===e||null===(t=e.businessEntity)||void 0===t?void 0:t.isCreatedForProject,a=null===(n=this._draft.data)||void 0===n||null===(o=n.businessEntity)||void 0===o?void 0:o.incorporationDate;return this.isBoolean(r)&&(0,lo.validateDate)(a)}validateBusinessEntityRepresentative(){var e,t;const n=null===(e=this._draft.data)||void 0===e||null===(t=e.businessEntity)||void 0===t?void 0:t.representative;return!!n&&(!!n.firstName&&!!n.lastName&&(0,lo.validateEmail)(n.email)&&(0,lo.validateUSPhoneNumber)(n.phone)&&(n.sameAsSponsor||!!n.position))}validateOriginalPurchaseDetails(){var e;const t=null===(e=this._draft.data)||void 0===e?void 0:e.currentProject,n=(null===t||void 0===t?void 0:t.loanPurpose)===Hi.Purchase||(0,lo.validateDate)(null===t||void 0===t?void 0:t.originalPurchaseDate);return((null===t||void 0===t?void 0:t.originalPurchasePrice)||0)>0&&n}validateSubordinateDebts(){var e,t;const n=null===(e=this._draft.data)||void 0===e?void 0:e.currentProject;return!1===(null===n||void 0===n?void 0:n.hasSubordinateDebts)||((null===n||void 0===n||null===(t=n.subordinateDebts)||void 0===t?void 0:t.length)||0)>0&&((null===n||void 0===n?void 0:n.subordinateDebtBalance)||0)>0}validatePermits(){var e;const t=null===(e=this._draft.data)||void 0===e?void 0:e.currentProject;return!0===(null===t||void 0===t?void 0:t.willHavePermitsBeforeClosing)||!1===(null===t||void 0===t?void 0:t.willHavePermitsBeforeClosing)&&(0,lo.checkIfDateIsInFuture)((null===(n=this._draft.data)||void 0===n||null===(o=n.currentProject)||void 0===o?void 0:o.estimatedPermitsDate)||"");var n,o}validateGeneralContractor(){var e,t,n,o,r,a;return!0===(null===(e=this._draft.data)||void 0===e||null===(t=e.currentProject)||void 0===t?void 0:t.isGeneralContractor)||!1===(null===(n=this._draft.data)||void 0===n||null===(o=n.currentProject)||void 0===o?void 0:o.isGeneralContractor)&&!(null===(r=this._draft.data)||void 0===r||null===(a=r.currentProject)||void 0===a||!a.generalContractorName)}validateProjectDetails(){var e,t,n,o,r,a,l,i;return!(null===(e=this._draft.data)||void 0===e||null===(t=e.currentProject)||void 0===t||!t.hasMultipleBuilds)||!(null===(n=this._draft.data)||void 0===n||null===(o=n.currentProject)||void 0===o||!o.buildType)&&((null===(r=this._draft.data)||void 0===r||null===(a=r.currentProject)||void 0===a?void 0:a.numberOfUnits)||0)>0&&((null===(l=this._draft.data)||void 0===l||null===(i=l.currentProject)||void 0===i?void 0:i.budget)||0)>0}validateBuilds(){var e,t;if(null===(e=this._draft.data)||void 0===e||null===(t=e.currentProject)||void 0===t||!t.hasMultipleBuilds)return!0;const n=this._draft.data.currentProject.builds;return!(null===n||void 0===n||!n.length)&&(!(n.length>8)&&n.every((e=>es.validateBuild(e,this._draft))))}validatePreviousProjects(){var e,t;return!(null===(e=this._draft.data)||void 0===e||null===(t=e.previousProjects)||void 0===t||!t.length)&&this._draft.data.previousProjects.every((e=>es.validateProject(e)))}validateProjectValueDetails(){var e;const t=null===(e=this._draft.data)||void 0===e?void 0:e.currentProject,n=null===t||void 0===t?void 0:t.projectValueDetails;if(!n)return!1;const o=(n.projectValue||0)>0&&(n.perUnitValue||0)>0,r=(n.totalFinishedValue||0)>0&&(n.perUnitFinishedValue||0)>0;let a=!0;if(this.isRefinance){const e=null===t||void 0===t?void 0:t.originalPurchaseDate;if(!e)return!1;if(!(0,lo.validateDate)(e))return!1;$i().tz(e,"MM/DD/YYYY","UTC").isAfter($i().utc().subtract(18,"months"))&&(a=(n.budgetSpent||0)>0&&(n.perUnitBudgetSpent||0)>0)}return o&&a&&r}
1get isRefinance(){var e,t;return(null===(e=this._draft.data)||void 0===e||null===(t=e.currentProject)||void 0===t?void 0:t.loanPurpose)===Hi.Refinance}}class ts{get id(){return this._id}get initialStep(){return this._initialStep}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e}get visitedSteps(){return this._visitedSteps}set visitedSteps(e){this._visitedSteps=e}get __v(){return this.___v}set __v(e){this.___v=e}get data(){return this._data}constructor(e){var t,n,o,r,a,l,i,s,c,d,u,m,p,g,h,v,y,b,f,E,C,A,S,w,P;this._validator=void 0,this._id=void 0,this._initialStep=void 0,this._currentStep=void 0,this._visitedSteps=void 0,this.___v=void 0,this._data=void 0,this._id=(null===e||void 0===e?void 0:e.id)||"",this._initialStep=(null===e||void 0===e?void 0:e.initialStep)||"",this._currentStep=(null===e||void 0===e?void 0:e.currentStep)||(null===e||void 0===e?void 0:e.initialStep)||"",this._data={lenderId:(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.lenderId)||"",sponsor:{...null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n.sponsor,loanOfficer:(null===e||void 0===e||null===(o=e.data)||void 0===o||null===(r=o.sponsor)||void 0===r?void 0:r.loanOfficer)||{},personalInfo:(null===e||void 0===e||null===(a=e.data)||void 0===a||null===(l=a.sponsor)||void 0===l?void 0:l.personalInfo)||{},homeAddress:(null===e||void 0===e||null===(i=e.data)||void 0===i||null===(s=i.sponsor)||void 0===s?void 0:s.homeAddress)||{},statements:(null===e||void 0===e||null===(c=e.data)||void 0===c||null===(d=c.sponsor)||void 0===d?void 0:d.statements)||[]},businessEntity:{...null===e||void 0===e||null===(u=e.data)||void 0===u?void 0:u.businessEntity,address:(null===e||void 0===e||null===(m=e.data)||void 0===m||null===(p=m.businessEntity)||void 0===p?void 0:p.address)||{},representative:(null===e||void 0===e||null===(g=e.data)||void 0===g||null===(h=g.businessEntity)||void 0===h?void 0:h.representative)||{}},currentProject:{...null===e||void 0===e||null===(v=e.data)||void 0===v?void 0:v.currentProject,mainAddress:(null===e||void 0===e||null===(y=e.data)||void 0===y||null===(b=y.currentProject)||void 0===b?void 0:b.mainAddress)||{},builds:(null===e||void 0===e||null===(f=e.data)||void 0===f||null===(E=f.currentProject)||void 0===E?void 0:E.builds)||[],subordinateDebts:(null===e||void 0===e||null===(C=e.data)||void 0===C||null===(A=C.currentProject)||void 0===A?void 0:A.subordinateDebts)||[],projectValueDetails:(null===e||void 0===e||null===(S=e.data)||void 0===S||null===(w=S.currentProject)||void 0===w?void 0:w.projectValueDetails)||{}},previousProjects:(null===e||void 0===e||null===(P=e.data)||void 0===P?void 0:P.previousProjects)||[]},this._visitedSteps=(null===e||void 0===e?void 0:e.visitedSteps)||[],this.___v=(null===e||void 0===e?void 0:e.__v)||0,this._validator=new es(this),(0,ut.makeAutoObservable)(this,{id:!1})}toJson(){return{id:this.id,initialStep:this.initialStep,currentStep:this.currentStep,visitedSteps:this.visitedSteps,data:(0,ut.toJS)(this.data),__v:this.__v}}validate(e){return this._validator.validate(e)}}class ns{constructor(){this.definition=[Zi.sponsor.loanOfficer,Zi.sponsor.personalInformation,Zi.sponsor.homeAddress,Zi.sponsor.maritalStatus,Zi.sponsor.statements,Zi.sponsor.citizenship,Zi.businessEntity.entityInformation,Zi.businessEntity.address,Zi.businessEntity.isCreatedForProject,Zi.businessEntity.representative,Zi.previousProjects.projects,Zi.previousProjects.bankAccounts,Zi.currentProject.loanType,Zi.currentProject.loanPurpose,Zi.currentProject.loanTerm,Zi.currentProject.generalContractor,Zi.currentProject.mainAddress,Zi.currentProject.originalPurchaseDetails,Zi.currentProject.payoffAmount,(0,Ct.Y)("currentProject.subordinateDebtsChoice",(e=>this.isPurchase(e)?Zi.currentProject.subordinateDebts:this.isRefinance(e)?Zi.currentProject.permits:Zi.currentProject.hasMultipleBuilds)),Zi.currentProject.subordinateDebts,Zi.currentProject.permits,Zi.currentProject.hasMultipleBuilds,(0,Ct.Y)("currentProject.buildsChoice",(e=>{var t,n,o,r;return!0===(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(n=t.currentProject)||void 0===n?void 0:n.hasMultipleBuilds)?Zi.currentProject.builds:!1===(null===e||void 0===e||null===(o=e.data)||void 0===o||null===(r=o.currentProject)||void 0===r?void 0:r.hasMultipleBuilds)?Zi.currentProject.projectDetails:Zi.review.review})),Zi.currentProject.builds,(0,Ct.Y)("currentProject.skipSingleBuild",(()=>Zi.review.review)),Zi.currentProject.projectDetails,(0,Ct.Y)("currentProject.projectValueDetailsChoice",(e=>{var t,n;return this.isPurchase(e)||(0,lo.validateDate)(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(n=t.currentProject)||void 0===n?void 0:n.originalPurchaseDate)?Zi.currentProject.projectValueDetails:Zi.review.review})),Zi.currentProject.projectValueDetails,Zi.review.review]}isPurchase(e){var t,n;return(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(n=t.currentProject)||void 0===n?void 0:n.loanPurpose)===Hi.Purchase}isRefinance(e){var t,n;return(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(n=t.currentProject)||void 0===n?void 0:n.loanPurpose)===Hi.Refinance}}class os{constructor(){this._applicationOptions=void 0,this._flow=new ns,this._flowController=void 0,this._lenderId="",this._draft=new ts,this._stepOptions={},this._shouldStartApplication=!1,this._showResumePage=!1,this._showGoToReview=!1,this._isDraftLoading=!0,this._isDraftSaving=!1,this._isSubmitting=!1,this._isSubmitted=!1,this._loanOfficers=[],this._pendingSave=null,this._currentSavePromise=null,this._flowController=new Ct.N(this._flow.definition),this._applicationOptions={},(0,ut.makeAutoObservable)(this)}get shouldStartApplication(){return this._shouldStartApplication}get showResumePage(){return this._showResumePage}get showGoToReview(){return this._showGoToReview}set showGoToReview(e){this._showGoToReview=e}get currentStep(){var e;return(null===(e=this._draft)||void 0===e?void 0:e.currentStep)||""}get currentGroup(){var e;return((null===(e=this._draft)||void 0===e?void 0:e.currentStep)||"").split(".")[0]||""}get draft(){return this._draft}get stepOptions(){return this._stepOptions}get loanOfficers(){return this._loanOfficers}get isDraftSaving(){return this._isDraftSaving}get isDraftLoading(){return this._isDraftLoading}get isInReview(){return this.currentStep===Zi.review.review}get isSubmitting(){return this._isSubmitting}get isSubmitted(){return this._isSubmitted}get canGoBack(){return this.currentStep!==this._draft.initialStep}
1get isRefinance(){return this.draft.data.currentProject.loanPurpose===Hi.Refinance}get shouldUseOriginalPurchaseDate(){return this.isRefinance}get shouldUseBudgets(){if(!this.shouldUseOriginalPurchaseDate)return!1;const e=this.draft.data.currentProject.originalPurchaseDate;if(!e)return!1;if(!(0,lo.validateDate)(e))return!1;return $i().tz(e,"MM/DD/YYYY","UTC").isAfter($i().utc().subtract(18,"months"))}get isCurrentStepValid(){return!!this.currentStep&&this.validateStep(this.currentStep)}get canSubmit(){return!this._isDraftSaving&&this.getFlowSteps().every((e=>this._draft.validate(e)))}init(e){this._lenderId=e}hideWelcomePage(){this._shouldStartApplication=!1}hideResumePage(){this._showResumePage=!1}setStepOptions(e){const t={canSkip:!0};this._stepOptions=e?{...t,...e}:t}goToStep(e){this.changeStep(e),this.saveDraft().catch((e=>console.error(e)))}moveNext(){const e=this._flowController.getNextStep(this.currentStep,this._draft,{});e&&this.changeStep(e),this.saveDraft().catch((e=>console.error(e)))}moveBack(){const e=this._flowController.getPreviousStep(this.currentStep,this._draft,{});e&&e!==this.currentStep&&this.changeStep(e),this.saveDraft().catch((e=>console.error(e)))}getFlowSteps(){return this._flowController.getFlowSteps(this._draft,this._applicationOptions)}getFlowGroups(){return this._flowController.getFlowGroups(this._draft,this._applicationOptions).filter((e=>e!==Ji))}getGroupSteps(e){return this._flowController.getGroupSteps(e,this._draft,this._applicationOptions)}validateStep(e){var t,n;return null!==(t=null===(n=this._draft)||void 0===n?void 0:n.validate(e))&&void 0!==t&&t}editGroup(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";const n=this.getGroupSteps(e),o=n.findIndex((e=>!this.validateStep(e)));if("normal"===t||0===o||-1===o){const t=this._flowController.getFirstGroupStep(e,this._draft,this._applicationOptions);this.changeStep(t)}else{const e=n[o];this.changeStep(e)}}async createDraft(){var e;this.ensureInitialized();if(null===(e=f.A.userStore.company)||void 0===e?void 0:e.id){this._isDraftSaving=!0;try{const e=await N.Vv.pW.createLenderApplicationDraft({lenderId:this._lenderId,initialStep:Zi.sponsor.loanOfficer});this._draft=new ts(e.draft),this.changeStep(this._draft.initialStep)}finally{(0,ut.runInAction)((()=>{this._isDraftSaving=!1}))}}}async loadLoanOfficers(){try{const e=await N.Vv.pW.getLoanOfficers();this._loanOfficers=(null===e||void 0===e?void 0:e.loanOfficers)||[]}catch(e){console.error("Error loading loan officers:",e),this._loanOfficers=[]}}async loadDraft(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"initial";this.ensureInitialized(),this._isDraftLoading=!0;const t=await N.Vv.pW.getLenderApplicationDraft({lenderId:this._lenderId}).finally((()=>{(0,ut.runInAction)((()=>{this._isDraftLoading=!1}))}));(0,ut.runInAction)((()=>{t.draft?(this._draft=new ts(t.draft),"initial"===e&&(this._shouldStartApplication=!this.checkDraftHasAnyData(t.draft.data),this.canSubmit?this.changeStep(Zi.review.review):this._showResumePage=!this._shouldStartApplication,this.adjustInitialValues())):(this._draft=new ts({initialStep:Zi.sponsor.loanOfficer}),this._shouldStartApplication=!0)}))}async saveDraft(){if(this._pendingSave=this._draft.toJson(),this._currentSavePromise)return this._currentSavePromise;const e=this.handleSaveLoop();this._currentSavePromise=e;try{await e}finally{this._currentSavePromise===e&&(this._currentSavePromise=null)}}async handleSaveLoop(){for(this._isDraftSaving=!0;this._pendingSave;){const t=this._pendingSave;this._pendingSave=null;try{const e=await N.Vv.pW.updateLenderApplicationDraft({draft:{...t,__v:this._draft.__v}});this.draft.__v=e.draft.__v}catch(e){console.error("save failed:",e),await this.tryReloadDraftOnVersionMismatch(e);break}}this._isDraftSaving=!1}async submitApplication(){this._isSubmitting=!0;try{await N.Vv.pW.submitLenderApplication({draft:this._draft.toJson()}),(0,ut.runInAction)((()=>{this._isSubmitted=!0}))}catch(e){console.error("submit failed:",e),await this.loadDraft("reload")}finally{(0,ut.runInAction)((()=>{this._isSubmitting=!1}))}}changeStep(e){this._stepOptions.onChangeStep&&this._stepOptions.onChangeStep(this),this._draft.currentStep=e,this._draft.visitedSteps.includes(e)||this._draft.visitedSteps.push(e)}checkDraftHasAnyData(e){if(!e)return!1;const t=e=>null!==e&&void 0!==e&&("string"===typeof e?""!==e.trim():"number"===typeof e||("boolean"===typeof e||(Array.isArray(e)?e.length>0&&e.some(t):"object"===typeof e&&Object.values(e).some(t))));return t(e.sponsor)||t(e.businessEntity)||t(e.currentProject)||t(e.previousProjects)}async tryReloadDraftOnVersionMismatch(e){"version-mismatch"===e.code&&(this._pe
1ndingSave=null,await this.loadDraft("reload"))}ensureInitialized(){if(!this._lenderId)throw new Error("LenderApplicationStore is not initialized")}adjustInitialValues(){const e=this._draft.data.currentProject;!1===this.shouldUseBudgets&&(e.projectValueDetails.budgetSpent=void 0,e.projectValueDetails.perUnitBudgetSpent=void 0)}}const rs=(0,c.createContext)(null),as=()=>{const e=(0,c.useContext)(rs);if(!e)throw new Error("useLenderApplication must be used within a LenderApplicationProvider");return e},ls=e=>{let{children:t}=e;const[n]=(0,c.useState)((()=>new os));return c.createElement(rs.Provider,{value:n},t)};class is{static required(e,t){return e.trim()?"":null!==t&&void 0!==t?t:Ar.Ay.t("application:ValidationErrors.FieldRequired")}static positiveNumber(e){const t=Number(e);return!isNaN(t)&&t>0?"":Ar.Ay.t("application:ValidationErrors.FieldRequired")}static email(e){return(0,lo.validateEmail)(e)?"":Ar.Ay.t("application:ValidationErrors.InvalidEmail")}static zip(e){return(0,lo.validateZip)(null===e||void 0===e?void 0:e.trim())?"":Ar.Ay.t("application:ValidationErrors.InvalidZip")}static phone(e){return(0,lo.validateUSPhoneNumber)(e)?"":Ar.Ay.t("application:ValidationErrors.InvalidPhone")}static date(e){return(0,lo.validateDate)(e)?"":Ar.Ay.t("application:ValidationErrors.InvalidDate")}static pastDate(e){return(0,lo.checkIfDateIsInPast)(e)?"":Ar.Ay.t("application:ValidationErrors.InvalidDate")}static futureDate(e){return(0,lo.checkIfDateIsInFuture)(e)?"":Ar.Ay.t("application:ValidationErrors.InvalidDate")}static birthdate(e){return(0,lo.validateBirthdate)(e.trim())?"":Ar.Ay.t("application:ValidationErrors.InvalidDate")}static ssn(e){const t=e.replace(/\D/g,"");return t.length>9||(0,lo.validateSsn)(t)?"":Ar.Ay.t("application:ValidationErrors.InvalidSSN")}static ein(e){const t=e.replace(/\D/g,"");return t.length>9||(0,lo.validateEin)(t)?"":Ar.Ay.t("application:ValidationErrors.InvalidTaxID")}}var ss=n(64156),cs=n(83952),ds=n(72722);const us=ie.A.create({formContainer:{flexShrink:1},row:{flexDirection:"row",marginBottom:32,minHeight:68,maxHeight:68},lastRow:{marginBottom:0},validatableEditor:{minHeight:68,maxHeight:68},column:{flex:1},columnLeft:{flex:1,marginRight:12},columnRight:{flex:1,marginLeft:12},radioGroupHorizontal:{flexDirection:"row",gap:32},radioGroupVertical:{flexDirection:"column",gap:6},checkBoxGroupVertical:{flexDirection:"column",gap:24},radioLabel:{fontFamily:"Inter, sans-serif",fontWeight:"500",fontSize:14,color:Oo.B.text.black},checkboxLabel:{fontFamily:"Inter, sans-serif",fontWeight:"500",fontSize:14,color:Oo.B.text.black},plainText:{fontSize:16,fontWeight:"500",color:Oo.B.text.black},actionLink:{fontSize:12,fontWeight:"700",marginLeft:4,color:Oo.B.text.grey500}}),ms=ie.A.create({formContainer:{flexShrink:1},row:{flexDirection:"column",marginBottom:0},lastRow:{marginBottom:0},column:{marginBottom:16},columnLeft:{marginBottom:16},columnRight:{marginBottom:16}});function ps(e){return(0,c.useMemo)((()=>gs(e)),[e])}function gs(e){return new Proxy(e,{get(e,t,n){const o=Reflect.get(e,t,n);return function(e){return!!function(e){return"object"===typeof e&&null!==e&&!Array.isArray(e)}(e)&&((!e||"object"!==typeof e||!e.__isProxy)&&((!e||"object"!==typeof e||!e.$mobx)&&!(e instanceof Map||e instanceof Set||e instanceof WeakMap||e instanceof WeakSet)))}(o)?gs(o):o},set:(e,t,n,o)=>((0,ut.runInAction)((()=>{Reflect.set(e,t,n,o)})),!0)})}const hs={options:{title:"LenderApplication.Flow.Sponsor.PersonalInfo.Title",onChangeStep:e=>{const t=e.draft.data.businessEntity.representative;if(t.sameAsSponsor){const n=e.draft.data.sponsor.personalInfo;t.firstName=n.firstName,t.lastName=n.lastName,t.email=n.email,t.phone=n.phone}}},component:(0,a.PA)((()=>{const{t:e}=(0,z.Bd)("application"),{sm:t}=(0,ce.Qs)(),n=ps(as().draft.data.sponsor.personalInfo),o=t?us:ms;return c.createElement(K.A,{style:o.formContainer},c.createElement(K.A,{style:o.row},c.createElement(K.A,{style:o.columnLeft},c.createElement(de.xb,{required:!0,autoFocus:!0,value:n.firstName||"",label:e("LenderApplication.Flow.Sponsor.PersonalInfo.FirstName"),testID:"LenderApplication.Sponsor.FirstName",onChangeText:e=>n.firstName=e,validate:is.required})),c.createElement(K.A,{style:o.columnRight},c.createElement(de.xb,{required:!0,value:n.lastName||"",label:e("LenderApplication.Flow.Sponsor.PersonalInfo.LastName"),testID:"LenderApplication.Sponsor.LastName",onChangeText:e=>n.lastName=e,validate:is.required}))),c.createElement(K.A,{style:o.row},c.createElement(K.A,{style:o.columnLeft},c.createElement(de.xb,{required:!0,value:(null===n||void 0===n?void 0:n.email)||"",label:e("LenderApplication.Flow.Sponsor.PersonalInfo.Email"),testID:"LenderApplication.Sponsor.Email",onChangeText:e=>n.email=e,validate:is.email})),c.createElement(K.A,{style:o.columnRight},c.createElement(ss.f,{required:!0,value:(null===n||void 0===n?void 0:n.birthdate)||"",label:e("LenderApplication.Flow.Sponsor.PersonalInfo.Birthdate"),testID:"LenderApplication.Sponsor.Birthdate",onCh
1angeText:e=>{n.birthdate=e},validate:is.birthdate}))),c.createElement(K.A,{style:[o.row,o.lastRow]},c.createElement(K.A,{style:o.columnLeft},c.createElement(ds.J,{required:!0,value:(null===n||void 0===n?void 0:n.phone)||"",label:e("LenderApplication.Flow.Sponsor.PersonalInfo.Phone"),onChangeText:e=>n.phone=e.parsed,testID:"LenderApplication.Sponsor.Phone",validate:is.phone})),c.createElement(K.A,{style:o.columnRight},c.createElement(cs.d,{required:!0,value:(null===n||void 0===n?void 0:n.ssn)||"",label:e("LenderApplication.Flow.Sponsor.PersonalInfo.Ssn"),testID:"LenderApplication.Sponsor.Ssn",onChangeText:e=>{n.ssn=e},validate:is.ssn}))),c.createElement(F.hK,{height:24}),c.createElement(Dl,{description:e("LenderApplication.Flow.SecurityNotice")}))}))};var vs=n(23019);const ys=(0,a.PA)((e=>{let{address:t,autoFocus:n=!1,optionalFields:o=[Mi.Building,Mi.Apartment],testID:r}=e;const{t:a}=(0,z.Bd)("application"),{sm:l}=(0,ce.Qs)(),i=ps(t),s=l?us:ms,d=!o.includes(Mi.Street),u=!o.includes(Mi.City),m=!o.includes(Mi.State),p=!o.includes(Mi.Zip),g=!o.includes(Mi.Building),h=!o.includes(Mi.Apartment);return c.createElement(K.A,{style:s.formContainer},c.createElement(K.A,{style:s.row},c.createElement(K.A,{style:s.column},c.createElement(de.WG,{placeholder:a("LenderApplication.Wizard.AddressSearchPlaceholder"),autoFocus:n,style:bs.addressLine,label:a("LenderApplication.Address.Search"),testID:"".concat(r,".Search"),onSelect:e=>{(0,ut.runInAction)((()=>{i.street=e.street,i.state=e.state,i.city=e.city,i.zip=e.zip}))}}))),c.createElement(K.A,{style:s.row},c.createElement(K.A,{style:s.columnLeft},c.createElement(de.xb,{required:d,value:i.street||"",label:a("LenderApplication.Address.Street"),testID:"".concat(r,".Street"),onChangeText:e=>i.street=e,validate:d?is.required:void 0})),c.createElement(K.A,{style:s.columnRight},c.createElement(de.xb,{required:u,value:i.city||"",label:a("LenderApplication.Address.City"),testID:"".concat(r,".City"),onChangeText:e=>i.city=e,validate:u?is.required:void 0}))),c.createElement(K.A,{style:s.row},c.createElement(K.A,{style:s.columnLeft},c.createElement(de.xb,{required:m,value:i.state||"",label:a("LenderApplication.Address.State"),testID:"".concat(r,".State"),onChangeText:e=>{i.state=e},validate:m?is.required:void 0})),c.createElement(K.A,{style:s.columnRight},c.createElement(vs.Y,{required:p,value:i.zip||"",format:"#####",label:a("LenderApplication.Address.Zip"),testID:"".concat(r,".Zip"),onChangeText:e=>i.zip=e,validate:p?is.zip:void 0}))),c.createElement(K.A,{style:[s.row,s.lastRow]},c.createElement(K.A,{style:s.columnLeft},c.createElement(de.xb,{required:g,value:i.building||"",label:a("LenderApplication.Address.Building"),testID:"".concat(r,".Building"),onChangeText:e=>i.building=e,validate:g?is.required:void 0})),c.createElement(K.A,{style:s.columnRight},c.createElement(de.xb,{required:h,value:i.apartment||"",label:a("LenderApplication.Address.Apartment"),testID:"".concat(r,".Apartment"),onChangeText:e=>i.apartment=e,validate:h?is.required:void 0}))))})),bs=ie.A.create({addressLine:{borderWidth:2,borderRadius:4,borderColor:Oo.B.text.grey400}}),fs={options:{title:"LenderApplication.Flow.Sponsor.HomeAddress.Title"},component:(0,a.PA)((()=>{const e=as();return c.createElement(ys,{address:e.draft.data.sponsor.homeAddress,autoFocus:!0,testID:"LenderApplication.Sponsor.HomeAddress"})}))},Es=[{label:Ar.Ay.t("application:LenderApplication.Flow.Sponsor.MaritalStatus.Single"),value:Oi.Single},{label:Ar.Ay.t("application:LenderApplication.Flow.Sponsor.MaritalStatus.Married"),value:Oi.Married}],Cs={options:{title:"LenderApplication.Flow.Sponsor.MaritalStatus.Title"},component:(0,p.PA)((()=>{const e=ps(as().draft.data.sponsor);return c.createElement(de.HN,{value:e.maritalStatus,options:Es,onChange:t=>{e.maritalStatus=t},labelStyle:us.radioLabel,groupStyle:us.radioGroupVertical,testID:"LenderApplication.Sponsor.MaritalStatus"})}))},As=[{label:Ar.Ay.t("application:LenderApplication.Flow.Sponsor.Citizenship.Radio.Yes"),value:!0},{label:Ar.Ay.t("application:LenderApplication.Flow.Sponsor.Citizenship.Radio.No"),value:!1}],Ss=[{name:Ar.Ay.t("application:LenderApplication.Flow.Sponsor.Citizenship.Options.PermanentResident"),id:ji.PermanentResident},{name:Ar.Ay.t("application:LenderApplication.Flow.Sponsor.Citizenship.Options.Visa"),id:ji.Visa},{name:Ar.Ay.t("application:LenderApplication.Flow.Sponsor.Citizenship.Options.ForeignResident"),id:ji.ForeignResident}],ws={options:{title:"LenderApplication.Flow.Sponsor.Citizenship.Title"},component:(0,p.PA)((()=>{const{t:e}=(0,z.Bd)("application"),t=ps(as().draft.data.sponsor);return c.createElement(c.Fragment,null,c.createElement(de.HN,{value:t.isUsCitizen,options:As,onChange:e=>{t.isUsCitizen=e,!0===e&&(t.legalResidencyStatus=void 0)},labelStyle:us.radioLabel,groupStyle:us.radioGroupVertical,testID:"LenderApplication.Sponsor.Citizenship"}),!1===t.isUsCitizen&&c.createElement(c.Fragment,null,c.createElement(F.hK,{height:24}),c.createElement(de.BtSelect,{mandatory:!0,label:e("LenderApplication.Flow.Sponsor.Citizenship.LegalResidency"),value:t.legalResidencyStatus,options:Ss,onChange:e=>{t.legalResidencyStatus=e.id},appearance:"thick-border",testID:"LenderApplication.Sponsor.Citizenship.LegalResidency"}
1)))}))},Ps=ie.A.create({container:{flex:1},statementContainer:{marginBottom:32,borderBottomWidth:1,borderBottomColor:Oo.B.elements.grey200},statementContainerLast:{marginBottom:-32,borderBottomWidth:0},statementText:{fontSize:16,fontWeight:"600",lineHeight:24,marginBottom:12,color:"#333"},explanationWarning:{fontSize:14,fontWeight:"500",lineHeight:24,color:Oo.B.blue.blue400,marginTop:6}}),Is={options:{title:"LenderApplication.Flow.Sponsor.Statements.Title"},component:(0,p.PA)((()=>{const{t:e}=(0,z.Bd)("application"),t=as().draft.data.sponsor.statements,n=e=>t.find((t=>t.statementId===e)),o=Object.values(zi);return c.createElement(K.A,{style:Ps.container},o.map(((r,a)=>{var l;const i=null===(l=n(r))||void 0===l?void 0:l.answer;return c.createElement(K.A,{key:r,style:a===o.length-1?Ps.statementContainerLast:Ps.statementContainer},c.createElement(de.QG,{style:Ps.statementText},e("LenderApplication.Flow.Sponsor.Statements.Questions.".concat(r))),c.createElement(de.HN,{value:i,options:[{label:e("LenderApplication.Flow.Sponsor.Statements.Radio.Yes"),value:!0},{label:e("LenderApplication.Flow.Sponsor.Statements.Radio.No"),value:!1}],onChange:e=>((e,o)=>{const r=n(e);(0,ut.runInAction)((()=>{r?r.answer=o:t.push({statementId:e,answer:o})}))})(r,e),groupStyle:us.radioGroupHorizontal,labelStyle:us.radioLabel,testID:"LenderApplication.Sponsor.Statements.".concat(r)}),!0===i&&c.createElement(de.QG,{style:Ps.explanationWarning},e("LenderApplication.Flow.Sponsor.Statements.ExplanationWarning")),c.createElement(F.hK,{height:26}))})))}))},xs=(0,p.PA)((e=>{var t;let{onClose:n}=e;const{t:o}=(0,z.Bd)("application"),{sm:r}=(0,ce.Qs)(),{setMessage:a}=(0,g.JX)(),{userStore:l}=f.A,i=(0,Ao.JA)(Ds,Ts,r),[s,d]=(0,c.useState)(!1),u=()=>c.createElement(de.QG,{style:[i.alertText,{fontWeight:"700"}]});return c.createElement(bi.yZ,{title:o("VerifyEmailAlert.Title"),onClose:n,style:Ds.modal,testID:"VerifyEmailModal"},c.createElement(bi.yZ.Content,null,c.createElement(F.hK,{height:r?10:4}),c.createElement(de.QG,{style:i.alertText},c.createElement(z.x6,{t:o,i18nKey:"VerifyEmailAlert.Message",components:{bold:u()}})),c.createElement(F.hK,{height:20}),c.createElement(de.QG,{style:i.alertText},o("VerifyEmailAlert.Steps")),c.createElement(de.QG,{style:i.alertText},c.createElement(z.x6,{t:o,i18nKey:"VerifyEmailAlert.Step1",values:{email:null===(t=l.user)||void 0===t?void 0:t.email},components:{styled:u()}})),c.createElement(de.QG,{style:i.alertText},o("VerifyEmailAlert.Step2")),c.createElement(de.QG,{style:i.alertText},c.createElement(z.x6,{t:o,i18nKey:"VerifyEmailAlert.Step3",components:{bold:u()}})),c.createElement(de.QG,{style:i.alertText},o("VerifyEmailAlert.Step4")),c.createElement(F.hK,{height:20})),c.createElement(bi.yZ.Buttons,null,c.createElement(de.BtButton,{appearance:"ghost",onPress:n,style:i.footerButton,testID:"VerifyEmailModal.GoBack"},o("VerifyEmailAlert.GoBackToApplication")),c.createElement(de.BtButton,{onPress:()=>{d(!0),N.JZ.kQ.sendVerificationEmail().then((()=>{a(g.$z.SUCCESS,o("VerifyEmailAlert.SuccessNotification")),n()})).finally((()=>d(!1)))},disabled:s,loading:s,style:i.footerButton,testID:"VerifyEmailModal.SendAgain"},o("VerifyEmailAlert.SendAgain"))))})),Ds=ie.A.create({modal:{width:640},footerButton:{minWidth:240},alertText:{fontWeight:"400",fontSize:18,lineHeight:26,letterSpacing:0,color:"#082131",textAlign:"left",fontFamily:"Inter"}}),Ts=ie.A.create({alertText:{fontSize:16,lineHeight:24},footerButton:{minWidth:void 0}}),ks=e=>{let{currentPage:t,totalPages:n,onPageChange:o}=e;const{t:r}=(0,z.Bd)("application"),a=[...Array(n)].map(((e,t)=>t+1)),l=t<n,i=t>1;return c.createElement(K.A,{style:Bs.container},c.createElement(Bt.A,{style:[Bs.navigationLink,!i&&Bs.navigationLinkDisabled],onPress:()=>{i&&o(t-1)},disabled:!i},c.createElement(fe.Icon,{name:"arrow-back-outline",width:20,fill:"#001929"}),c.createElement(de.QG,{style:[Bs.pageButtonText,Bs.pageButtonTextActive]},r("Pagination.Previous"))),c.createElement(K.A,{style:Bs.pageNumbersContainer},a.map((e=>{const n=e===t;return c.createElement(Bt.A,{key:e,style:[Bs.pageButton,n&&Bs.pageButtonActive],onPress:()=>o(e)},c.createElement(de.QG,{style:[Bs.pageButtonText,n&&Bs.pageButtonTextActive]},e))}))),c.createElement(Bt.A,{style:[Bs.navigationLink,!l&&Bs.navigationLinkDisabled],onPress:()=>{l&&o(t+1)},disabled:!l},c.createElement(de.QG,{style:Bs.navigationLinkText},r("Pagination.Next")),c.createElement(fe.Icon,{name:"arrow-forward-outline",width:20,fill:"#001929"})))},Bs=ie.A.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginTop:20},navigationLink:{flexDirection:"row",alignItems:"center",paddingVertical:8,backgroundColor:"transparent"},navigationLinkDisabled:{opacity:.4},navigationLinkText:{fontSize:14,fontWeight:"500"},pageNumbersContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center",flex:1},pageButton:{width:40,height:40,borderRadius:8,alignItems:"center",justifyContent:"center",marginHorizontal:4},pageButtonActive:{backgroundColor:"#F8F9F9"},pageButtonText:{fontSize:14,fontWeight:"500",color:"#717680"},pageButtonTextActive:{fontWeight:"600",color:"#001929"}}),Fs={[Yi]:Ar.Ay.t("application:LenderApplication.Groups.Sponsor"),[Qi]:Ar.Ay.t("application:LenderApplication.Groups.BusinessEntity"),[Ki]:Ar.Ay.t("application:LenderApplication.Groups.CurrentProject"),[qi]:Ar.Ay.t("application:LenderApplication.Groups.PreviousProjects")},_s=(0,a.PA)((e=>{let{onEditSection:t}=e;const{t:n}=(0,z.Bd)("application"),o=as(),r=o.getFlowGroups();return c.createElement(c.Fragment,null,r.map((e=>{const r=o.getGroupSteps(e),a=r.length,l=r.filter((e=>o.validateStep(e))).length,i=a===l;return c.createElement(K.A,{style:Ns.groupContainer,key:e},c.createElement(K.A,{style:Ns.icon},i?c.createElement(fe.Icon,{name:"checkmark-outline",width:22,fill:Oo.B.service.green}):c.createElement(fe.Icon,{name:"alert-triangle-outline",width:22,fill:Oo.B.service.orange})),c.createElement(K.A,{style:Ns.groupContentWrapper},c.createElement(K.A,{style:Ns.groupHeaderRow},c.createElement(de.QG,{style:Ns.groupName},Fs[e]),c.createElement(de.b_,{title:n("LenderApplication.Flow.Review.EditSectionLink"),textStyle:Ns.editLink,onPress:()=>(0,ut.runInAction)((()=>{null===t||void 0===t||t(),o.showGoToReview=!0,o.editGroup(e,"fromInvalid")}))}
1)),c.createElement(de.QG,{style:[Ns.groupProgress,!i&&Ns.groupProgressIncomplete]},i?c.createElement(z.x6,{t:n,i18nKey:1===a?"LenderApplication.Flow.Review.FilledGroupDescriptionSingular":"LenderApplication.Flow.Review.FilledGroupDescriptionPlural",values:{total:a}}):c.createElement(z.x6,{t:n,i18nKey:1===a?"LenderApplication.Flow.Review.IncompleteGroupDescriptionSingular":"LenderApplication.Flow.Review.IncompleteGroupDescriptionPlural",values:{filled:l,total:a}}))))})))})),Ns=ie.A.create({groupContainer:{flexDirection:"row",padding:16,marginBottom:12,backgroundColor:Oo.B.background.grey100},groupContentWrapper:{flex:1,flexDirection:"column"},groupHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:10},icon:{marginRight:10},groupName:{fontSize:14,fontWeight:"700",lineHeight:20},groupProgress:{fontSize:14,fontWeight:"500",marginTop:6},groupProgressIncomplete:{color:Oo.B.service.orange},editLink:{fontFamily:"Inter, sans-serif",fontSize:14,fontWeight:"700",lineHeight:20,color:Oo.B.blue.blue400}}),Rs=ie.A.create({documentsPrompt:{fontSize:14,fontWeight:"700",color:Oo.B.blue.blue400,lineHeight:20},description:{fontSize:14,fontWeight:"500",lineHeight:20},submitButton:{alignSelf:"flex-end",marginTop:24,width:240}}),Ls={options:{title:"LenderApplication.Flow.Review.Title"},component:(0,p.PA)((()=>{const{t:e}=(0,z.Bd)("application"),[t,n]=(0,c.useState)(!1),[o,r]=(0,c.useState)(!1),a=as();return c.createElement(K.A,null,c.createElement(_s,null),c.createElement(F.hK,{height:24}),c.createElement(de.QG,{style:Rs.documentsPrompt},e("LenderApplication.Flow.Review.DocumentsPrompt")),c.createElement(de.QG,{style:Rs.description},e("LenderApplication.Flow.Review.Description1")),c.createElement(F.hK,{height:24}),c.createElement(de.QG,{style:Rs.description},e("LenderApplication.Flow.Review.Description2")),c.createElement(F.hK,{height:24}),c.createElement(de.QG,{style:Rs.description},e("LenderApplication.Flow.Review.Description3")),c.createElement(de.BtButton,{onPress:async()=>{try{n(!0);(await N.JZ.kQ.checkEmailIsVerified()).isVerified?await a.submitApplication():(r(!0),n(!1))}catch(e){console.error("Failed to submit application:",e)}finally{n(!1)}},loading:t||a.isSubmitting||a.isDraftSaving||a.isDraftLoading,disabled:t||a.isSubmitting||a.isDraftSaving||a.isDraftLoading||!a.canSubmit,style:Rs.submitButton,testID:"LenderApplication.Review.Submit"},e("LenderApplication.Flow.Review.SubmitButton")),o&&c.createElement(xs,{onClose:()=>r(!1)}))}))};var Ms=n(73058);let Os=function(e){return e.SoleProprietorship="SoleProprietorship",e.Partnership="Partnership",e.LLC="LLC",e.Corporation="Corporation",e.Other="Other",e}({});Os.SoleProprietorship,Os.Partnership,Os.LLC,Os.Corporation,Os.Other;const zs=[{name:Ar.Ay.t("application:LenderApplication.Flow.BusinessEntity.Information.BusinessTypes.SoleProprietorship"),id:Os.SoleProprietorship},{name:Ar.Ay.t("application:LenderApplication.Flow.BusinessEntity.Information.BusinessTypes.Partnership"),id:Os.Partnership},{name:Ar.Ay.t("application:LenderApplication.Flow.BusinessEntity.Information.BusinessTypes.LLC"),id:Os.LLC},{name:Ar.Ay.t("application:LenderApplication.Flow.BusinessEntity.Information.BusinessTypes.Corporation"),id:Os.Corporation},{name:Ar.Ay.t("application:LenderApplication.Flow.BusinessEntity.Information.BusinessTypes.Other"),id:Os.Other}],js={options:{title:"LenderApplication.Flow.BusinessEntity.Information.Title"},component:(0,a.PA)((()=>{const{t:e}=(0,z.Bd)("application"),{sm:t}=(0,ce.Qs)(),n=ps(as().draft.data.businessEntity),o=t?us:ms;return c.createElement(K.A,{style:o.formContainer},c.createElement(K.A,{style:o.row},c.createElement(K.A,{style:o.column},c.createElement(de.xb,{required:!0,autoFocus:!0,value:n.name||"",label:e("LenderApplication.Flow.BusinessEntity.Information.Name"),testID:"LenderApplication.BusinessEntity.Name",onChangeText:e=>n.name=e,validate:is.required}))),c.createElement(K.A,{style:o.row},c.createElement(K.A,{style:o.column},c.createElement(de.BtSelect,{mandatory:!0,label:e("LenderApplication.Flow.BusinessEntity.Information.Type"),value:null===n||void 0===n?void 0:n.type,options:zs,onChange:e=>n.type=e.id,appearance:"thick-border",testID:"LenderApplication.BusinessEntity.Type"}))),c.createElement(K.A,{style:o.row},c.createElement(K.A,{style:o.column},c.createElement(Ms.b,{required:!0,value:(null===n||void 0===n?void 0:n.ein)||"",label:e("LenderApplication.Flow.BusinessEntity.Information.Ein"),testID:"LenderApplication.BusinessEntity.EIN",onChangeText:e=>n.ein=e,validate:is.ein}))),c.createElement(Dl,{description:e("LenderApplication.Flow.SecurityNotice")}))}))},Ws={options:{title:"LenderApplication.Flow.BusinessEntity.Address.Title"},component:(0,a.PA)((()=>{const e=as();return c.createElement(ys,{address:e.draft.data.businessEntity.address,autoFocus:!0,testID:"LenderApplication.BusinessEntity.Address"})}))},Vs=[{label:Ar.Ay.t("application:LenderApplication.Flow.BusinessEntity.isCreatedForProject.Radio.Yes"),value:!0},{label:Ar.Ay.t("application:LenderApplication.Flow.BusinessEntity.isCreatedForProject.Radio.No"),value:!1}],Hs={options:{title:"LenderApplication.Flow.BusinessEntity.isCreatedForProject.Title"},component:(0,p.PA)((()=>{const{t:e}=(0,z.Bd)("application"),t=ps(as().draft.data.businessEntity);return c.createElement(c.Fragment,null,c.createElement(de.HN,{value:t.isCreatedForProject,options:Vs,onChange:e=>t.isCreatedForProject=e,labelStyle:us.radioLabel,groupStyle:us.radioGroupVertical,testID:"LenderApplication.BusinessEntity.IsCreatedForProject"}),c.createElement(F.hK,{height:24}),c.createElement(K.A,{style:us.validatableEditor},c.createElement(ss.f,{required:!0,value:t.incorporationDate,label:e("LenderApplication.Flow.BusinessEntity.isCreatedForProject.IncorporationDate"),testID:"LenderApplication.BusinessEntity.IncorporationDate",onCh
1angeText:e=>t.incorporationDate=e,validate:is.birthdate})))}))};var Us=n(47639);const Gs={options:{title:"LenderApplication.Flow.BusinessEntity.Representative.Title",description:"LenderApplication.Flow.BusinessEntity.Representative.Description"},component:(0,a.PA)((()=>{var e;const{t:t}=(0,z.Bd)("application"),{sm:n}=(0,ce.Qs)(),o=as(),r=ps(null===(e=o.draft.data.businessEntity)||void 0===e?void 0:e.representative),a=(null===r||void 0===r?void 0:r.sameAsSponsor)||!1,l=n?us:ms;return c.createElement(c.Fragment,null,c.createElement(Us.o,{checked:a,onPress:e=>{(0,ut.runInAction)((()=>{if(r.sameAsSponsor=e,e){const e=o.draft.data.sponsor.personalInfo;e&&(r.firstName=e.firstName,r.lastName=e.lastName,r.phone=e.phone||"",r.email=e.email||"",r.position=void 0)}}))},label:t("LenderApplication.Flow.BusinessEntity.Representative.SameAsSponsorCheckbox"),testID:"LenderApplication.Representative.SameAsSponsor",labelStyle:us.checkboxLabel}),c.createElement(F.hK,{height:24}),c.createElement(K.A,{style:l.formContainer},c.createElement(K.A,{style:l.row},c.createElement(K.A,{style:l.columnLeft},c.createElement(de.xb,{required:!0,autoFocus:!0,disabled:a,value:(null===r||void 0===r?void 0:r.firstName)||"",label:t("LenderApplication.Flow.BusinessEntity.Representative.FirstName"),testID:"LenderApplication.Representative.FirstName",onChangeText:e=>r.firstName=e,validate:is.required})),c.createElement(K.A,{style:l.columnRight},c.createElement(de.xb,{required:!0,disabled:a,value:(null===r||void 0===r?void 0:r.lastName)||"",label:t("LenderApplication.Flow.BusinessEntity.Representative.LastName"),testID:"LenderApplication.Representative.LastName",onChangeText:e=>r.lastName=e,validate:is.required}))),c.createElement(K.A,{style:[l.row,a&&l.lastRow]},c.createElement(K.A,{style:l.columnLeft},c.createElement(ds.J,{required:!0,disabled:a,value:(null===r||void 0===r?void 0:r.phone)||"",label:t("LenderApplication.Flow.BusinessEntity.Representative.Phone"),onChangeText:e=>r.phone=e.parsed,testID:"LenderApplication.Representative.Phone",validate:is.phone})),c.createElement(K.A,{style:l.columnRight},c.createElement(de.xb,{required:!0,disabled:a,value:(null===r||void 0===r?void 0:r.email)||"",label:t("LenderApplication.Flow.BusinessEntity.Representative.Email"),testID:"LenderApplication.Representative.Email",onChangeText:e=>r.email=e,validate:is.email}))),!a&&c.createElement(K.A,{style:[l.row,l.lastRow]},c.createElement(K.A,{style:l.column},c.createElement(de.xb,{required:!0,value:(null===r||void 0===r?void 0:r.position)||"",label:t("LenderApplication.Flow.BusinessEntity.Representative.Position"),testID:"LenderApplication.Representative.Position",onChangeText:e=>(0,ut.runInAction)((()=>{r.position=e})),validate:is.required})))))}))},Ys=[{name:Ar.Ay.t("application:LenderApplication.Enums.LoanType.NewConstruction"),id:Wi.NewConstruction},{name:Ar.Ay.t("application:LenderApplication.Enums.LoanType.ConstructionCompletion"),id:Wi.ConstructionCompletion},{name:Ar.Ay.t("application:LenderApplication.Enums.LoanType.Rehab"),id:Wi.Rehab},{name:Ar.Ay.t("application:LenderApplication.Enums.LoanType.Bridge"),id:Wi.Bridge}],Qs={options:{title:"LenderApplication.Flow.CurrentProject.LoanType.Title"},component:(0,a.PA)((()=>{const{t:e}=(0,z.Bd)("application"),t=ps(as().draft.data.currentProject);return c.createElement(de.BtSelect,{mandatory:!0,label:e("LenderApplication.Flow.CurrentProject.LoanType.LoanType"),value:t.loanType,options:Ys,onChange:e=>t.loanType=e.id,appearance:"thick-border",testID:"LenderApplication.CurrentProject.LoanType"})}))},qs={options:{title:"LenderApplication.Flow.CurrentProject.MainAddress.Title"},component:(0,a.PA)((()=>{const e=as();return c.createElement(ys,{address:e.draft.data.currentProject.mainAddress,autoFocus:!0,optionalFields:[Mi.Street,Mi.Building,Mi.Apartment],testID:"LenderApplication.CurrentProject.MainAddress"})}))},Ks=[{label:Ar.Ay.t("application:LenderApplication.Flow.CurrentProject.HasMultipleBuilds.Radio.Yes"),value:!0},{label:Ar.Ay.t("application:LenderApplication.Flow.CurrentProject.HasMultipleBuilds.Radio.No"),value:!1}],Js={options:{title:"LenderApplication.Flow.CurrentProject.HasMultipleBuilds.Title",description:"LenderApplication.Flow.CurrentProject.HasMultipleBuilds.Description",onChangeStep:e=>{const t=e.draft.data.currentProject;t.hasMultipleBuilds?(t.projectValueDetails={},t.numberOfUnits=void 0,t.budget=void 0,t.buildType=void 0):t.builds=[]}},component:(0,p.PA)((()=>{const e=ps(as().draft.data.currentProject);return c.createElement(de.HN,{value:e.hasMultipleBuilds,options:Ks,onChange:t=>e.hasMultipleBuilds=t,labelStyle:us.radioLabel,groupStyle:us.radioGroupVertical,testID:"LenderApplication.CurrentProject.HasMultipleBuilds"})}))};var Zs=n(74881);const Xs=[{name:Ar.Ay.t("application:LenderApplication.Enums.BuildType.SingleFamily"),id:Vi.SingleFamily},{name:Ar.Ay.t("application:LenderApplication.Enums.BuildType.Condo"),id:Vi.Condo},{name:Ar.Ay.t("application:LenderApplication.Enums.BuildType.Townhouse"),id:Vi.Townhomes},{name:Ar.Ay.t("application:LenderApplication.Enums.BuildType.Duplex"),id:Vi.Duplex},{name:Ar.Ay.t("application:LenderApplication.Enums.BuildType.Triplex"),id:Vi.Triplex},{name:Ar.Ay.t("application:LenderApplication.Enums.BuildType.Fourplex"),id:Vi.Fourplex},{name:Ar.Ay.t("application:LenderApplication.Enums.BuildType.MultiFamily"),id:Vi.MultiFamily}],$s={options:{title:"LenderApplication.Flow.CurrentProject.ProjectDetails.Title"},component:(0,a.PA)((()=>{var e,t;const{t:n}=(0,z.Bd)("application"),{sm:o}=(0,ce.Qs)(),r=ps(as().draft.data.currentProject),a=o?us:ms;return c.createElement(K.A,{style:a.formContainer},c.createElement(K.A,{style:a.row},c.createElement(K.A,{style:a.column},c.createElement(de.BtSelect,{mandatory:!0,label:n("LenderApplication.Flow.CurrentProject.ProjectDetails.BuildType"),value:r.buildType,options:Xs,onChange:e=>r.buildType=e.id,appearance:"thick-border",testID:"LenderApplication.CurrentProject.BuildType"}))),c.createElement(K.A,{style:a.row},c.createElement(K.A,{style:a.column},c.createElement(vs.Y,{required:!0,format:"#######",value:(null===(e=r.numberOfUnits)||void 0===e?void 0:e.toString())||"",label:n("LenderApplication.Flow.CurrentProject.ProjectDetails.NumberOfUnits"),testID:"LenderApplication.CurrentProject.NumberOfUnits",onChangeText:e=>
1r.numberOfUnits=parseInt(e)||0,validate:is.positiveNumber}))),c.createElement(K.A,{style:[a.row,a.lastRow]},c.createElement(K.A,{style:a.column},c.createElement(Zs.w,{required:!0,value:(null===(t=r.budget)||void 0===t?void 0:t.toString())||"",label:n("LenderApplication.Flow.CurrentProject.ProjectDetails.Budget"),testID:"LenderApplication.CurrentProject.Budget",onChangeText:e=>r.budget=e.floatValue||0,validate:is.positiveNumber}))))}))},ec=e=>{let{title:t}=e;return c.createElement(c.Fragment,null,c.createElement(No.A,{style:tc.divider}),c.createElement(de.QG,{style:tc.title},t))},tc=ie.A.create({divider:{backgroundColor:Oo.B.elements.grey200},title:{fontSize:18,fontWeight:"700",marginVertical:16}}),nc=(0,a.PA)((e=>{var t,n,o,r,a,l;let{autofocus:i=!1,buildValue:s,showBudget:d}=e;const{t:u}=(0,z.Bd)("application"),{sm:m}=(0,ce.Qs)(),p=m?us:ms;return c.createElement(K.A,{style:p.formContainer},c.createElement(K.A,{style:p.row},c.createElement(K.A,{style:p.columnLeft},c.createElement(Zs.w,{autoFocus:i,required:!0,value:(null===(t=s.projectValue)||void 0===t?void 0:t.toString())||"",label:u("LenderApplication.Flow.CurrentProject.ProjectValueDetails.ProjectValue"),testID:"LenderApplication.CurrentProject.ProjectValueDetails.ProjectValue",onChangeText:e=>s.projectValue=e.floatValue||0,validate:is.positiveNumber})),c.createElement(K.A,{style:p.columnRight},c.createElement(Zs.w,{required:!0,value:(null===(n=s.perUnitValue)||void 0===n?void 0:n.toString())||"",label:u("LenderApplication.Flow.CurrentProject.ProjectValueDetails.PerUnitProjectValue"),testID:"LenderApplication.CurrentProject.ProjectValueDetails.PerUnitValue",onChangeText:e=>s.perUnitValue=e.floatValue||0,validate:is.positiveNumber}))),d&&c.createElement(K.A,{style:p.row},c.createElement(K.A,{style:p.columnLeft},c.createElement(Zs.w,{required:!0,value:(null===(o=s.budgetSpent)||void 0===o?void 0:o.toString())||"",label:u("LenderApplication.Flow.CurrentProject.ProjectValueDetails.BudgetSpent"),testID:"LenderApplication.CurrentProject.ProjectValueDetails.BudgetSpent",onChangeText:e=>s.budgetSpent=e.floatValue||0,validate:is.positiveNumber})),c.createElement(K.A,{style:p.columnRight},c.createElement(Zs.w,{required:!0,value:(null===(r=s.perUnitBudgetSpent)||void 0===r?void 0:r.toString())||"",label:u("LenderApplication.Flow.CurrentProject.ProjectValueDetails.PerUnitBudgetSpent"),testID:"LenderApplication.CurrentProject.ProjectValueDetails.PerUnitBudgetSpent",onChangeText:e=>s.perUnitBudgetSpent=e.floatValue||0,validate:is.positiveNumber}))),c.createElement(K.A,{style:[p.row,p.lastRow]},c.createElement(K.A,{style:p.columnLeft},c.createElement(Zs.w,{required:!0,value:(null===s||void 0===s||null===(a=s.totalFinishedValue)||void 0===a?void 0:a.toString())||"",label:u("LenderApplication.Flow.CurrentProject.ProjectValueDetails.TotalFinishedValue"),testID:"LenderApplication.CurrentProject.ProjectValueDetails.TotalFinishedValue",onChangeText:e=>s.totalFinishedValue=e.floatValue||0,validate:is.positiveNumber})),c.createElement(K.A,{style:p.columnRight},c.createElement(Zs.w,{required:!0,value:(null===s||void 0===s||null===(l=s.perUnitFinishedValue)||void 0===l?void 0:l.toString())||"",label:u("LenderApplication.Flow.CurrentProject.ProjectValueDetails.PerUnitFinishedValue"),testID:"LenderApplication.CurrentProject.ProjectValueDetails.PerUnitFinishedValue",onChangeText:e=>s.perUnitFinishedValue=e.floatValue||0,validate:is.positiveNumber}))))})),oc=(0,a.PA)((e=>{var t,n;let{build:o,onSave:r,onClose:l}=e;const{t:i}=(0,z.Bd)("application"),{sm:s}=(0,ce.Qs)(),d=as(),u=d.draft.data.currentProject.mainAddress,m=o||d.draft.data.currentProject.builds.length>0?d.draft.data.currentProject.builds[0]:{},p=ps((0,a.iz)((()=>({...m,breakdown:(null===o||void 0===o?void 0:o.breakdown)||"",address:null!==m&&void 0!==m&&m.address?{...m.address}:{street:u.street,city:u.city,state:u.state,zip:u.zip},projectValueDetails:null!==m&&void 0!==m&&m.projectValueDetails?{...m.projectValueDetails}:{}})))),g=s?us:ms,h=es.validateBuild(p,d.draft);return c.createElement(bi.yZ,{title:i(o?"LenderApplication.Flow.CurrentProject.Builds.BuildModal.TitleEdit":"LenderApplication.Flow.CurrentProject.Builds.BuildModal.TitleAdd"),onClose:l,testID:"LenderApplication.CurrentProject.Builds.Modal"},c.createElement(bi.yZ.Content,null,c.createElement(K.A,{style:[g.row,s?rc.breakdown:{}]},c.createElement(K.A,{style:g.column},c.createElement(de.QG,{style:us.plainText},i("LenderApplication.Flow.CurrentProject.Builds.BuildModal.BreakdownHint")),c.createElement(F.hK,{height:16}),c.createElement(de.xb,{value:p.breakdown||"",required:!0,multiline:!0,autoFocus:!0,maxLength:1e3,numberOfLines:3,label:i("LenderApplication.Flow.CurrentProject.Builds.BuildModal.Breakdown"),onChangeText:e=>p.breakdown=e,testID:"LenderApplication.CurrentProject.Builds.BuildModal.Breaksown",validate:is.required}))),c.createElement(F.hK,{height:32}),c.createElement(ec,{title:i("LenderApplication.Flow.CurrentProject.Builds.BuildModal.BuildAddress")}),c.createElement(ys,{address:p.address,optionalFields:[Mi.Street,Mi.Building,Mi.Apartment],testID:"LenderApplication.CurrentProject.Builds.BuildModal.Address"}),c.createElement(F.hK,{height:32}),c.createElement(ec,{title:i("LenderApplication.Flow.CurrentProject.Builds.BuildModal.BuildDetails")}),c.createElement(K.A,{style:g.row},c.createElement(K.A,{style:g.column},c.createElement(de.BtSelect,{mandatory:!0,label:i("LenderApplication.Flow.CurrentProject.Builds.BuildModal.Type"),value:p.type,options:Xs,onChange:e=>p.type=e.id,appearance:"thick-border",testID:"LenderApplication.CurrentProject.Builds.BuildModal.Type"}))),c.createElement(K.A,{style:[g.row,g.lastRow]},c.createElement(K.A,{style:g.columnLeft},c.createElement(vs.Y,{required:!0,format:"#######",value:(null===(t=p.numberOfUnits)||void 0===t?void 0:t.toString())||"",label:i("LenderApplication.Flow.CurrentProject.Builds.BuildModal.NumberOfUnits"),testID:"LenderApplication.CurrentProject.Builds.BuildModal.NumberOfUnits",onChangeText:e=>
1p.numberOfUnits=parseInt(e)||0,validate:is.positiveNumber})),c.createElement(K.A,{style:g.columnRight},c.createElement(Zs.w,{required:!0,value:(null===(n=p.budget)||void 0===n?void 0:n.toString())||"",label:i("LenderApplication.Flow.CurrentProject.Builds.BuildModal.Budget"),testID:"LenderApplication.CurrentProject.Builds.BuildModal.Budget",onChangeText:e=>p.budget=e.floatValue||0,validate:is.positiveNumber}))),c.createElement(F.hK,{height:32}),c.createElement(ec,{title:i("LenderApplication.Flow.CurrentProject.Builds.BuildModal.BuildValueDetails")}),c.createElement(nc,{buildValue:p.projectValueDetails,showBudget:d.isRefinance})),c.createElement(bi.yZ.Buttons,null,c.createElement(de.BtButton,{appearance:"ghost",onPress:l,style:rc.footerButton,testID:"LenderApplication.CurrentProject.Builds.BuildModal.Close"},i("LenderApplication.Flow.CurrentProject.Builds.BuildModal.Close")),c.createElement(de.BtButton,{disabled:!h,onPress:()=>r((0,ut.toJS)(p)),style:rc.footerButton,testID:"LenderApplication.CurrentProject.Builds.BuildModal.Save"},i("LenderApplication.Flow.CurrentProject.Builds.BuildModal.Save"))))})),rc=ie.A.create({footerButton:{minWidth:120},breakdown:{minHeight:130,maxHeight:130}});var ac=n(31604),lc=n.n(ac),ic=n(75187);const sc=ie.A.create({buildItem:{flexDirection:"row",alignItems:"center",backgroundColor:"#fff",borderWidth:1,borderRadius:8,borderColor:Oo.B.elements.grey300,padding:16,marginBottom:12},buildContent:{flex:1,marginHorizontal:16},buildAddress:{fontSize:16,fontWeight:"600",marginBottom:6},buildDetails:{flexDirection:"row"},buildDetailText:{fontSize:12,fontWeight:"500",color:Oo.B.text.grey600},buildActions:{flexDirection:"row",alignItems:"center",gap:6}}),cc={options:{title:"LenderApplication.Flow.CurrentProject.Builds.Title",description:"LenderApplication.Flow.CurrentProject.Builds.Description"},component:(0,a.PA)((()=>{const{t:e}=(0,z.Bd)("application"),t=as(),n=ps(t.draft.data.currentProject),[o,r]=(0,c.useState)(!1),[a,l]=(0,c.useState)(null),[i,s]=(0,c.useState)(1),d=n.builds||[],u=Math.ceil(d.length/4),m=4*(i-1),p=m+4,g=d.slice(m,p),h=e=>{l(e),r(!0)},v=()=>{r(!1),l(null)};return c.createElement(c.Fragment,null,d.length<8&&c.createElement(Bt.A,{style:sc.buildItem,onPress:()=>h(null)},c.createElement(K.A,null,c.createElement(q.Pp9,null)),c.createElement(K.A,{style:sc.buildContent},c.createElement(de.QG,{style:sc.buildAddress,numberOfLines:1},e("LenderApplication.Flow.CurrentProject.Builds.AddNewBuild")),c.createElement(K.A,{style:sc.buildDetails},c.createElement(de.QG,{style:sc.buildDetailText},e("LenderApplication.Flow.CurrentProject.Builds.AddNewBuildHint"))))),g.map(((t,o)=>{var r;const a=m+o;return c.createElement(K.A,{key:a,style:sc.buildItem},c.createElement(K.A,null,c.createElement(q.hO2,null)),c.createElement(K.A,{style:sc.buildContent},c.createElement(de.QG,{style:sc.buildAddress,numberOfLines:1},e("LenderApplication.Flow.CurrentProject.Builds.List.Title",{number:a+1})),c.createElement(K.A,{style:sc.buildDetails},c.createElement(de.QG,{style:sc.buildDetailText},(0,ic.M)({...t.address,address:(null===(r=t.address)||void 0===r?void 0:r.street)||""})))),c.createElement(K.A,{style:sc.buildActions},c.createElement(de.b_,{title:e("LenderApplication.Flow.CurrentProject.Builds.List.Edit"),textStyle:us.actionLink,onPress:()=>h(a)}),c.createElement(de.b_,{title:e("LenderApplication.Flow.CurrentProject.Builds.List.Delete"),textStyle:us.actionLink,onPress:()=>(e=>{var t;null===(t=n.builds)||void 0===t||t.splice(e,1)})(a)})))})),d.length>4&&c.createElement(ks,{currentPage:i,totalPages:u,onPageChange:s}),o&&c.createElement(oc,{build:lc()(a)?d[a]:null,onSave:e=>{(0,ut.runInAction)((()=>{null!==a?n.builds[a]=e:n.builds.push(e)})),t.saveDraft().catch((e=>console.error(e))),v()},onClose:v}))}))},dc=[{label:Ar.Ay.t("application:LenderApplication.Flow.CurrentProject.LoanPurpose.Radio.Purchase"),value:Hi.Purchase},{label:Ar.Ay.t("application:LenderApplication.Flow.CurrentProject.LoanPurpose.Radio.Refinance"),value:Hi.Refinance}],uc={options:{title:"LenderApplication.Flow.CurrentProject.LoanPurpose.Title",onChangeStep:e=>{const t=e.draft.data.currentProject;var n;(e.shouldUseOriginalPurchaseDate||(t.originalPurchaseDate=void 0),e.isRefinance)||(null===(n=t.builds)||void 0===n||n.forEac
1h((e=>{e.projectValueDetails&&(e.projectValueDetails.budgetSpent=void 0,e.projectValueDetails.perUnitBudgetSpent=void 0)})))}},component:(0,p.PA)((()=>{const e=ps(as().draft.data.currentProject);return c.createElement(de.HN,{value:e.loanPurpose,options:dc,onChange:t=>e.loanPurpose=t,labelStyle:us.radioLabel,groupStyle:us.radioGroupVertical,testID:"LenderApplication.CurrentProject.LoanPurpose"})}))},mc={options:{title:"LenderApplication.Flow.CurrentProject.LoanTerm.Title"},component:(0,a.PA)((()=>{const{t:e}=(0,z.Bd)("application"),t=ps(as().draft.data.currentProject);return c.createElement(de.BtSelect,{mandatory:!0,label:e("LenderApplication.Flow.CurrentProject.LoanTerm.LoanTerm"),value:t.loanTermMonths,options:[6,9,12,15,18,24].map((t=>({name:c.createElement(z.x6,{t:e,i18nKey:"LenderApplication.Flow.CurrentProject.LoanTerm.LoanTermOption",values:{months:t}}),id:t}))),onChange:e=>{t.loanTermMonths=e.id},appearance:"thick-border",testID:"LenderApplication.CurrentProject.LoanType"})}))},pc=[{label:Ar.Ay.t("application:LenderApplication.Flow.CurrentProject.PayoffAmount.Radio.Yes"),value:!0},{label:Ar.Ay.t("application:LenderApplication.Flow.CurrentProject.PayoffAmount.Radio.No"),value:!1}],gc={options:{title:"LenderApplication.Flow.CurrentProject.PayoffAmount.Title"},component:(0,p.PA)((()=>{var e;const{t:t}=(0,z.Bd)("application"),n=ps(as().draft.data.currentProject);return c.createElement(c.Fragment,null,c.createElement(de.HN,{value:n.hasPayoffAmount,options:pc,onChange:e=>{(0,ut.runInAction)((()=>{n.hasPayoffAmount=e,e||(n.payoffAmount=0)}))},labelStyle:us.radioLabel,groupStyle:us.radioGroupVertical,testID:"LenderApplication.CurrentProject.HasPayoffAmount"}),n.hasPayoffAmount&&c.createElement(c.Fragment,null,c.createElement(F.hK,{height:24}),c.createElement(K.A,{style:us.validatableEditor},c.createElement(Zs.w,{required:!0,value:null===(e=n.payoffAmount)||void 0===e?void 0:e.toString(),label:t("LenderApplication.Flow.CurrentProject.PayoffAmount.Amount"),testID:"LenderApplication.CurrentProject.PayoffAmount",onChangeText:e=>n.payoffAmount=e.floatValue||0,validate:is.positiveNumber}))))}))},hc=[{type:Ui.SellerCarry,label:Ar.Ay.t("application:LenderApplication.Flow.CurrentProject.SubordinateDebts.Options.SellerCarry"),testID:"LenderApplication.CurrentProject.SubordinateDebts.SellerCarry"},{type:Ui.EntityOwnership,label:Ar.Ay.t("application:LenderApplication.Flow.CurrentProject.SubordinateDebts.Options.EntityOwnership"),testID:"LenderApplication.CurrentProject.SubordinateDebts.EntityOwnership"}],vc={options:{title:"LenderApplication.Flow.CurrentProject.SubordinateDebts.Title"},component:(0,p.PA)((()=>{var e,t;const{t:n}=(0,z.Bd)("application"),o=ps(as().draft.data.currentProject);return c.createElement(c.Fragment,null,c.createElement(K.A,{style:us.checkBoxGroupVertical},hc.map((e=>{var t;return c.createElement(de.BtCheckBox,{checked:null===(t=o.subordinateDebts)||void 0===t?void 0:t.includes(e.type),disabled:!1===o.hasSubordinateDebts,onPress:t=>((e,t)=>(0,ut.runInAction)((()=>{const n=o.subordinateDebts;o.subordinateDebts=t?n.includes(e)?n:[...n,e]:n.filter((t=>t!==e)),t&&(o.hasSubordinateDebts=!0),0===n.length&&(o.subordinateDebtBalance=0,o.hasSubordinateDebts=void 0)})))(e.type,t),label:e.label,labelStyle:us.checkboxLabel,testID:e.testID,key:e.type})})),c.createElement(de.BtCheckBox,{checked:!1===o.hasSubordinateDebts,onPress:e=>(e=>{(0,ut.runInAction)((()=>{o.hasSubordinateDebts=!e,e&&(o.subordinateDebts=[],o.subordinateDebtBalance=0)}))})(e),label:n("LenderApplication.Flow.CurrentProject.SubordinateDebts.Options.None"),labelStyle:us.checkboxLabel,testID:"LenderApplication.CurrentProject.SubordinateDebts.None"})),!(null===(e=o.subordinateDebts)||void 0===e||!e.length)&&c.createElement(c.Fragment,null,c.createElement(F.hK,{height:24}),c.createElement(K.A,{style:us.validatableEditor},c.createElement(Zs.w,{required:!0,value:(null===(t=o.subordinateDebtBalance)||void 0===t?void 0:t.toString())||"",label:n("LenderApplication.Flow.CurrentProject.SubordinateDebts.DebtTotalBalances"),testID:"LenderApplication.CurrentProject.SubordinateDebts.Balance",onChangeText:e=>o.subordinateDebtBalance=e.floatValue||0,validate:is.positiveNumber}))))}))},yc={options:{title:"LenderApplication.Flow.CurrentProject.ProjectValueDetails.Title"},component:(0,a.PA)((()=>{const e=as(),t=e.draft.data.currentProject,n=ps(null===t||void 0===t?void 0:t.projectValueDetails),o=e.shouldUseBudgets;return c.createElement(nc,{autofocus:!0,buildValue:n,showBudget:o})}))},bc=[{name:Ar.Ay.t("application:LenderApplication.Enums.ProjectStructure.PersonalPortfolio"),id:Gi.PersonalPortfolio},{name:Ar.Ay.t("application:LenderApplication.Enums.ProjectStructure.InvestToSelf"),id:Gi.InvestToSelf},{name:Ar.Ay.t("application:LenderApplication.Enums.ProjectStructure.HiredByCompany"),id:Gi.HiredByCompany}],fc=(0,a.PA)((e=>{var t,n,o,r;let{project:l,onSave:i,onClose:s}=e;const{t:d}=(0,z.Bd)("application"),{sm:u}=(0,ce.Qs)(),m=ps((0,a.iz)((()=>({...l,address:null!==l&&void 0!==l&&l.address?{...l.address}:{street:"",city:"",state:"",zip:""}})))),p=es.validateProject(m),g=u?us:ms;return c.createElement(bi.yZ,{title:d(l?"LenderApplication.Flow.PreviousProjects.Projects.ProjectMod
1al.TitleEdit":"LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.TitleAdd"),onClose:s,testID:"LenderApplication.PreviousProjects.Projects.Modal"},c.createElement(bi.yZ.Content,null,c.createElement(K.A,{style:g.row},c.createElement(K.A,{style:g.column},c.createElement(de.xb,{required:!0,autoFocus:!0,value:m.entityTitle||"",label:d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.EntityTitle"),testID:"LenderApplication.PreviousProjects.Projects.ProjectModal.EntityTitle",onChangeText:e=>m.entityTitle=e,validate:is.required}))),c.createElement(K.A,{style:[g.row,g.lastRow]},c.createElement(K.A,{style:g.columnLeft},c.createElement(vs.Y,{required:!0,format:"#######",value:(null===(t=m.numberOfHomesCompleted)||void 0===t?void 0:t.toString())||"",label:d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.NumberOfHomes"),testID:"LenderApplication.PreviousProjects.Projects.ProjectModal.NumberOfHomes",onChangeText:e=>{m.numberOfHomesCompleted=parseInt(e)||0},validate:is.required})),c.createElement(K.A,{style:g.columnRight},c.createElement(vs.Y,{required:!0,format:"#######",value:(null===(n=m.numberOfUnits)||void 0===n?void 0:n.toString())||"",label:d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.NumberOfUnits"),testID:"LenderApplication.PreviousProjects.Projects.ProjectModal.NumberOfUnits",onChangeText:e=>
1m.numberOfUnits=parseInt(e)||0,validate:is.required}))),c.createElement(F.hK,{height:32}),c.createElement(ec,{title:d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.ProjectAddress")}),c.createElement(ys,{address:m.address,autoFocus:!1,testID:"LenderApplication.PreviousProjects.Projects.ProjectModal.Address"}),c.createElement(F.hK,{height:32}),c.createElement(ec,{title:d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.ProjectStructure")}),c.createElement(K.A,{style:g.row},c.createElement(K.A,{style:g.columnLeft},c.createElement(Zs.w,{required:!0,value:(null===(o=m.acquisitionPrice)||void 0===o?void 0:o.toString())||"",label:d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.AcquisitionPrice"),testID:"LenderApplication.PreviousProjects.Projects.ProjectModal.AcquisitionPrice",onChangeText:e=>m.acquisitionPrice=e.floatValue||0,validate:is.positiveNumber})),c.createElement(K.A,{style:g.columnRight},c.createElement(ss.f,{required:!0,value:m.acquisitionDate,label:d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.AcquisitionDate"),testID:"LenderApplication.PreviousProjects.Projects.ProjectModal.AcquisitionDate",onChangeText:e=>m.acquisitionDate=e,validate:is.pastDate}))),c.createElement(K.A,{style:g.row},c.createElement(K.A,{style:g.columnLeft},c.createElement(Zs.w,{required:!0,value:(null===(r=m.dispositionPrice)||void 0===r?void 0:r.toString())||"",label:d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.DispositionPrice"),testID:"LenderApplication.PreviousProjects.Projects.ProjectModal.DispositionPrice",onChangeText:e=>m.dispositionPrice=e.floatValue||0,validate:is.positiveNumber})),c.createElement(K.A,{style:g.columnRight},c.createElement(ss.f,{required:!0,value:m.dispositionDate,label:d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.DispositionDate"),testID:"LenderApplication.PreviousProjects.Projects.ProjectModal.DispositionDate",onChangeText:e=>m.dispositionDate=e,validate:is.pastDate}))),c.createElement(K.A,{style:g.row},c.createElement(K.A,{style:g.column},c.createElement(de.BtSelect,{mandatory:!0,label:d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.ProjectType"),value:m.type,options:Ys,onChange:e=>m.type=e.id,appearance:"thick-border",testID:"LenderApplication.PreviousProjects.Projects.ProjectModal.ProjectType"}))),c.createElement(K.A,{style:g.row},c.createElement(K.A,{style:g.column},c.createElement(de.BtSelect,{mandatory:!0,label:d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.ProjectStructure"),value:m.structure,options:bc,onChange:e=>m.structure=e.id,appearance:"thick-border",testID:"LenderApplication.PreviousProjects.Projects.ProjectModal.ProjectStructure"})))),c.createElement(bi.yZ.Buttons,null,c.createElement(de.BtButton,{appearance:"ghost",onPress:s,style:Ec.footerButton,testID:"LenderApplication.PreviousProjects.Projects.ProjectModal.Close"},d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.Close")),c.createElement(de.BtButton,{disabled:!p,onPress:()=>i((0,ut.toJS)(m)),style:Ec.footerButton,testID:"LenderApplication.PreviousProjects.Projects.ProjectModal.Save"},d("LenderApplication.Flow.PreviousProjects.Projects.ProjectModal.Save"))))})),Ec=ie.A.create({footerButton:{minWidth:120}}),Cc=(0,a.PA)((()=>{const{t:e}=(0,z.Bd)("application"),t=as(),n=ps(t.draft.data.previousProjects),[o,r]=(0,c.useState)(!1),[a,l]=(0,c.useState)(null),[i,s]=(0,c.useState)(1),d=Math.ceil(n.length/4),u=4*(i-1),m=u+4,p=n.slice(u,m),g=e=>{l(e),r(!0)},h=()=>{r(!1),l(null)};return c.createElement(c.Fragment,null,n.length<30&&c.createElement(Bt.A,{style:Ac.projectItem,onPress:()=>g(null)},c.createElement(K.A,null,c.createElement(q.Pp9,null)),c.createElement(K.A,{style:Ac.projectContent},c.createElement(de.QG,{style:Ac.projectTitle,numberOfLines:1},e("LenderApplication.Flow.PreviousProjects.Projects.AddProject")),c.createElement(K.A,{style:Ac.projectDetails},c.createElement(de.QG,{style:Ac.projectDetailText},e("LenderApplication.Flow.PreviousProjects.Projects.AddProjectHint"))))),p.map(((n,o)=>{var r;const a=u+o;return c.createElement(K.A,{key:a,style:Ac.projectItem},c.createElement(K.A,null,c.createElement(q.hO2,null)),c.createElement(K.A,{style:Ac.projectContent},c.createElement(de.QG,{style:Ac.projectTitle,numberOfLines:1},e("LenderApplication.Flow.PreviousProjects.Projects.List.Title",{number:a+1})),c.createElement(de.QG,{style:Ac.projectAddress,numberOfLines:1},(0,ic.M)({...n.address,address:null===n||void 0===n||null===(r=n.address)||void 0===r?void 0:r.street}))),c.createElement(K.A,{style:Ac.projectActions},c.createElement(de.b_,{title:e("LenderApplication.Flow.PreviousProjects.Projects.List.
1Edit"),textStyle:us.actionLink,onPress:()=>g(a)}),c.createElement(de.b_,{title:e("LenderApplication.Flow.PreviousProjects.Projects.List.Delete"),textStyle:us.actionLink,onPress:()=>(e=>{(0,ut.runInAction)((()=>{var n;null===(n=t.draft.data.previousProjects)||void 0===n||n.splice(e,1)}))})(a)})))})),n.length>4&&c.createElement(ks,{currentPage:i,totalPages:d,onPageChange:s}),o&&c.createElement(fc,{project:lc()(a)?n[a]:null,onSave:e=>{(0,ut.runInAction)((()=>{null!==a?t.draft.data.previousProjects[a]=e:t.draft.data.previousProjects.push(e)})),t.saveDraft().catch((e=>console.error(e))),h()},onClose:h}))})),Ac=ie.A.create({projectItem:{flexDirection:"row",alignItems:"center",backgroundColor:"#fff",borderWidth:1,borderRadius:8,borderColor:Oo.B.elements.grey300,padding:16,marginBottom:12},projectContent:{flex:1,marginHorizontal:16},projectTitle:{fontSize:16,fontWeight:"600",marginBottom:4},projectAddress:{fontSize:14,fontWeight:"500",color:Oo.B.text.grey600,marginBottom:6},projectDetails:{flexDirection:"row"},projectDetailText:{fontSize:12,fontWeight:"500",color:Oo.B.text.grey600},projectActions:{flexDirection:"row",alignItems:"center",gap:6}}),Sc={options:{title:e=>0===e.draft.data.previousProjects.length?"LenderApplication.Flow.PreviousProjects.Projects.Title.NoProjects":"LenderApplication.Flow.PreviousProjects.Projects.Title.HasProjects",description:"LenderApplication.Flow.PreviousProjects.Projects.Description"},component:Cc},wc={options:{title:"LenderApplication.Flow.Sponsor.LoanOfficer.Title",description:"LenderApplication.Flow.Sponsor.LoanOfficer.Description"},component:(0,a.PA)((()=>{const{t:e}=(0,z.Bd)("application"),{sm:t}=(0,ce.Qs)(),n=as(),o=ps(n.draft.data.sponsor.loanOfficer),r=""===o.id,a=t?us:ms;return c.createElement(K.A,{style:a.formContainer},c.createElement(K.A,{style:[a.row,!r&&a.lastRow]},c.createElement(K.A,{style:a.column},c.createElement(de.BtSelect,{mandatory:!0,label:e("LenderApplication.Flow.Sponsor.LoanOfficer.LoanOfficer"),value:o.id,options:[...n.loanOfficers,{name:"Other",id:""}],onChange:e=>{(0,ut.runInAction)((()=>{o.id=e.id,e.id?(o.name=e.name,o.phone=e.phone):(o.name=void 0,o.phone=void 0)}))},appearance:"thick-border",testID:"LenderApplication.Sponsor.LoanOfficer.Officer"}))),r&&c.createElement(c.Fragment,null,c.createElement(K.A,{style:a.row},c.createElement(K.A,{style:a.column},c.createElement(de.xb,{required:!0,autoFocus:!0,value:o.name||"",label:e("LenderApplication.Flow.Sponsor.LoanOfficer.Name"),testID:"LenderApplication.Sponsor.LoanOfficer.Name",onChangeText:e=>{o.name=e},validate:is.required}))),c.createElement(K.A,{style:[a.row]},c.createElement(K.A,{style:a.column},c.createElement(ds.J,{required:!0,value:o.phone||"",label:e("LenderApplication.Flow.Sponsor.LoanOfficer.Phone"),onChangeText:e=>{o.phone=e.parsed},testID:"LenderApplication.Sponsor.LoanOfficer.Phone",validate:is.phone}))),c.createElement(K.A,{style:[a.row,a.lastRow]},c.createElement(K.A,{style:a.column},c.createElement(de.xb,{value:o.brokerageCompany||"",label:e("LenderApplication.Flow.Sponsor.LoanOfficer.BrokerageCompany"),testID:"LenderApplication.Sponsor.LoanOfficer.BrokerageCompany",onChangeText:e=>{o.brokerageCompany=e}})))))}))};var Pc=n(73622),Ic=n(66760);const xc=e=>{let{label:t,onPress:n,style:o,disabled:r=!1,iconPosition:a="left",testID:l}=e;return c.createElement(Bt.A,{disabled:r,style:[Tc.container,o],onPress:n,testID:null!==l&&void 0!==l?l:"add-link"},c.createElement(K.A,{style:Tc.content},"left"===a&&c.createElement(Dc,{disabled:r}),c.createElement(de.QG,{style:[Tc.text,r&&Tc.textDisabled]}," ".concat(t," ")),"none"!==a?"right"===a&&c.createElement(Dc,{disabled:r}):null))},Dc=e=>{let{disabled:t}=e;return c.createElement(fe.Icon,{name:"plus-outline",fill:t?"rgba(0, 160, 243, 0.3)":"#00A0F3",width:18})},Tc=ie.A.create({container:{alignSelf:"flex-start",marginTop:8},content:{flexDirection:"row",alignItems:"center"},text:{color:"#00A0F3",fontSize:14,fontWeight:"700",lineHeight:24},textDisabled:{opacity:.3}}),kc=ie.A.create({loadingContainer:{paddingTop:16,alignItems:"center",height:100},listItemContainer:{paddingHorizontal:0},bankTitle:{fontFamily:"Inter, sans-serif",fontSize:16,fontWeight:"600",color:Oo.B.text.black},bankDescription:{fontFamily:"Inter, sans-serif",fontSize:12,fontWeight:"500",color:Oo.B.text.black},connectButton:{marginTop:8},sectionTitle:{fontSize:18,fontWeight:"700"},bankList:{marginTop:4}}),Bc={options:{title:"LenderApplication.Flow.PreviousProjects.BankAccounts.Title",description:"LenderApplication.Flow.PreviousProjects.BankAccounts.Description"},component:(0,p.PA)((e=>{var t;let{}=e;const{t:n}=(0,z.Bd)("application"),[o,r]=(0,c.useState)(!1),{userStore:a,screensStore:{paymentMethodsStore:l}}=f.A;(0,c.useEffect)((()=>{var e;(null===(e=l.onlineConnectedBanks)||void 0===e?void 0:e.length)>0||(r(!0),l.fetchPaymentMethods().catch((e=>console.error(e))).finally((()=>r(!1))))}),[l]);const{connectPlaid:i,isInitializing:s}=(0,Pc.g)((async()=>{r(!0),Promise.all([a.fetchUser(),l.fetchPaymentMethods()]).catch((e=>console.error(e))).finally((()=>r(!1)))}));return c.createElement(c.Fragment,null,o?c.createElement(K.A,{style:kc.loadingContainer},c.createElement(fe.Spinner,null)):null!==(t=l.onlineConnectedBanks)&&void 0!==t&&t.length?c.createElement(c.Fragment,null,c.createElement(F.hK,{height:16}),c.createElement(de.QG,{style:kc.sectionTitle},n("LenderApplication.Flow.PreviousProjects.BankAccounts.ConnectedBanks")),c.createElement(F.hK,{height:16}),c.createElement(K.A,{style:kc.bankList},l.onlineConnectedBanks.map((e=>{var t;return c.createElement(Sr.c,{icon:c.createElement(q.P9R,null),title:e.name,subtitle:c.createElement(z.x6,{t:n,i18nKey:"LenderApplication.Flow.PreviousProjects.BankAccounts.AccountNumber",values:{number:null===(t=e.accountNumber)||void 0===t?void 0:t.slice(-4)}}),key:e.id,testID:"LenderApplication.PreviousProjects.BankAccounts.New",onPress:()=>{},otherStyles:{container:kc.listItemContainer,title:kc.bankTitle,subTitle:kc.bankDescription},disabled:s,endIcon:s?c.createElement(c.Fragment,null):c.createElement(de.b_,{textStyle:us.actionLink,title:n("LenderApplication.Flow.PreviousProjects.BankAccounts.DeleteAccount"),onPress:()=>(async e=>{r(!0);try{await N.JZ.QN.removeBankAccount(e),await l.fetchPaymentMethods()}catch(t){console.error("Error deleting bank account:",t)}finally{r(!1)}})(e.id)})})}))),c.createElement(xc,{label:n("LenderApplication.Flow.PreviousProjects.BankAccounts.ConnectAnotherAccount"),disabled:s,onPress:()=>i(),testID:"down-payment-modal-add-new-card"})):c.createElement(Sr.c,{icon:c.createElement(q.P9R,null),title:n("LenderApplication.Flow.PreviousProjects.BankAccounts.ConnectButton.Title"),subtitle:n("LenderApplication.Flow.PreviousProjects.BankAccounts.ConnectButton.Description"),testID:"LenderApplication.PreviousProjects.BankAccounts.New",onPress:i,otherStyles:{container:kc.listItemContainer,title:kc.bankTitle,subTitle:kc.bankDescription},disabled:s,endIcon:s?c.createElement(Ic.A,null):c.createElement(q.hIg,{style:{width:24,height:24}})}
1))}))},Fc=[{label:Ar.Ay.t("application:LenderApplication.Flow.CurrentProject.GeneralContractor.Radio.Self"),value:!0},{label:Ar.Ay.t("application:LenderApplication.Flow.CurrentProject.GeneralContractor.Radio.Other"),value:!1}],_c={options:{title:"LenderApplication.Flow.CurrentProject.GeneralContractor.Title",onChangeStep:e=>{const t=e.draft.data.currentProject;t.isGeneralContractor&&(t.generalContractorName=void 0)}},component:(0,p.PA)((()=>{const{t:e}=(0,z.Bd)("application"),t=as(),n=ps(t.draft.data.currentProject);return c.createElement(c.Fragment,null,c.createElement(de.HN,{value:n.isGeneralContractor,options:Fc,onChange:e=>n.isGeneralContractor=e,labelStyle:us.radioLabel,groupStyle:us.radioGroupVertical,testID:"LenderApplication.BusinessEntity.IsGeneralContractorRadio"}),!1===t.draft.data.currentProject.isGeneralContractor&&c.createElement(c.Fragment,null,c.createElement(F.hK,{height:32}),c.createElement(K.A,{style:us.validatableEditor},c.createElement(de.xb,{required:!0,autoFocus:!0,value:n.generalContractorName,label:e("LenderApplication.Flow.CurrentProject.GeneralContractor.ContractorName"),testID:"LenderApplication.CurrentProject.GeneralContractor.ContractorName",onChangeText:e=>n.generalContractorName=e,validate:is.required}))))}))},Nc={options:{title:e=>e.shouldUseOriginalPurchaseDate?"LenderApplication.Flow.CurrentProject.OriginalPurchaseDetails.Title.PriceAndDate":"LenderApplication.Flow.CurrentProject.OriginalPurchaseDetails.Title.Price",canSkip:!1,onChangeStep:e=>{const t=e.draft.data.currentProject;!1===e.shouldUseBudgets&&(t.projectValueDetails.budgetSpent=void 0,t.projectValueDetails.perUnitBudgetSpent=void 0)}},component:(0,a.PA)((()=>{var e;const{t:t}=(0,z.Bd)("application"),{sm:n}=(0,ce.Qs)(),o=as(),r=ps(o.draft.data.currentProject),a=n?us:ms;return c.createElement(K.A,{style:a.formContainer},c.createElement(K.A,{style:[a.row,!o.shouldUseOriginalPurchaseDate&&a.lastRow]},c.createElement(K.A,{style:a.column},c.createElement(Zs.w,{required:!0,autoFocus:!0,value:(null===(e=r.originalPurchasePrice)||void 0===e?void 0:e.toString())||"",label:t("LenderApplication.Flow.CurrentProject.OriginalPurchaseDetails.Price"),testID:"LenderApplication.CurrentProject.OriginalPurchasePrice",onChangeText:e=>r.originalPurchasePrice=e.floatValue||0,validate:is.positiveNumber}))),o.shouldUseOriginalPurchaseDate&&c.createElement(K.A,{style:[a.row,a.lastRow]},c.createElement(K.A,{style:a.column},c.createElement(ss.f,{required:!0,value:r.originalPurchaseDate||"",label:t("LenderApplication.Flow.CurrentProject.OriginalPurchaseDetails.Date"),testID:"LenderApplication.CurrentProject.OriginalPurchaseDate",onChangeText:e=>r.originalPurchaseDate=e,validate:is.date}))))}))},Rc=[{label:Ar.Ay.t("application:LenderApplication.Flow.CurrentProject.Permits.Radio.Yes"),value:!0},{label:Ar.Ay.t("application:LenderApplication.Flow.CurrentProject.Permits.Radio.No"),value:!1}],Lc={options:{title:"LenderApplication.Flow.CurrentProject.Permits.Title"},component:(0,p.PA)((()=>{const{t:e}=(0,z.Bd)("application"),t=ps(as().draft.data.currentProject);return c.createElement(c.Fragment,null,c.createElement(de.HN,{value:t.willHavePermitsBeforeClosing,options:Rc,onChange:e=>{t.willHavePermitsBeforeClosing=e},labelStyle:us.radioLabel,groupStyle:us.radioGroupVertical,testID:"LenderApplication.CurrentProject.PermitsClosing"}),!1===t.willHavePermitsBeforeClosing&&c.createElement(c.Fragment,null,c.createElement(F.hK,{height:24}),c.createElement(K.A,{style:us.validatableEditor},c.createElement(ss.f,{required:!0,value:t.estimatedPermitsDate,label:e("LenderApplication.Flow.CurrentProject.Permits.EstimatedPermitsDate"),testID:"LenderApplication.CurrentProject.Permits.EstimatedPermitsDate",onChangeText:e=>t.estimatedPermitsDate=e,validate:is.futureDate}))))}))};const Mc=(0,p.PA)((()=>{var e;const{sm:t}=(0,ce.Qs)(),{t:n}=(0,z.Bd)("application"),o=as(),r=null===(e=o.stepOptions)||void 0===e?void 0:e.title,a="function"===typeof r?r(o):r;return a?c.createElement(K.A,null,c.createElement(de.QG,{style:[Oc.title,t?Oc.titleDesktop:Oc.titleMobile]},n(a))):null})),Oc=ie.A.create({title:{fontWeight:"600",marginBottom:10},titleDesktop:{fontSize:24,lineHeight:36},titleMobile:{fontSize:18,lineHeight:26}}),zc=(0,p.PA)((()=>{var e;const{sm:t}=(0,ce.Qs)(),{t:n}=(0,z.Bd)("application"),o=null===(e=as().stepOptions)||void 0===e?void 0:e.description;return o?c.createElement(de.QG,{style:[jc.description,t?jc.descriptionDesktop:jc.descriptionMobile]},n(o)):null}
1)),jc=ie.A.create({description:{fontSize:16,fontWeight:"600"},descriptionDesktop:{lineHeight:30},descriptionMobile:{marginBottom:12}}),Wc=(0,p.PA)((()=>{const{t:e}=(0,z.Bd)("application"),t=as();return t.canGoBack?c.createElement("div",{style:{position:"sticky",top:0,zIndex:1e3,backgroundColor:"white",marginTop:20}},c.createElement(Bt.A,{style:Vc.wrapper,onPress:()=>t.moveBack(),testID:"LenderApplication.Wizard.BackButton"},c.createElement(fe.Icon,{name:"arrow-back-outline",width:22,height:22,fill:Oo.B.blue.blue400}),c.createElement(de.QG,{style:Vc.label},t.isInReview?e("LenderApplication.Wizard.BackButtonReview"):e("LenderApplication.Wizard.BackButton")))):c.createElement(F.hK,{height:44})})),Vc=ie.A.create({wrapper:{flexDirection:"row",alignItems:"center"},label:{fontWeight:"700",fontSize:16,lineHeight:24,color:Oo.B.blue.blue400,marginLeft:5}}),Hc=()=>{const e=as(),[t,n]=c.useState(0);return(0,c.useEffect)((()=>{const t=e.getFlowSteps().filter((e=>e!==Zi.review.review)),o=t.reduce(((t,n)=>{const o=e.draft.visitedSteps.includes(n),r=e.validateStep(n);return o&&r?t+1:t}),0);n(o/t.length)}),[e,e.currentStep]),c.createElement(K.A,{style:Uc.progressBar},c.createElement(K.A,{style:[Uc.filledProgress,{flex:t}]}),c.createElement(K.A,{style:[Uc.emptyProgress,{flex:1-t}]}))},Uc=ie.A.create({progressBar:{width:"100%",flexDirection:"row",height:3},filledProgress:{height:"100%",backgroundColor:Oo.B.blue.blue400},emptyProgress:{height:"100%",backgroundColor:Oo.B.elements.grey300}}),Gc=(0,a.PA)((()=>{const{sm:e}=(0,Zo.Qs)(),{t:t}=(0,z.Bd)("application"),n=as();return n.isInReview?null:c.createElement(K.A,{style:Yc.buttonsWrapper},c.createElement(K.A,{style:Yc.buttonsContainer},n.showGoToReview&&c.createElement(de.b_,{onPress:()=>n.goToStep(Zi.review.review),textStyle:[Yc.goToReview,!e&&Yc.goToReviewMobile],testID:"LenderApplication.Wizard.GoToReview",title:t("LenderApplication.Wizard.GoToReview")})),c.createElement(K.A,{style:Yc.buttonsContainer},n.stepOptions.canSkip&&c.createElement(de.BtButton,{onPress:()=>n.moveNext(),status:"basic",testID:"LenderAppication.Wizard.SkipButton"},t("SkipForNow")),c.createElement(de.BtButton,{onPress:()=>n.moveNext(),disabled:!n.isCurrentStepValid,style:{width:150},testID:"LenderApplication.Wizard.NextButton"},t("Next"))))})),Yc=ie.A.create({buttonsWrapper:{flexDirection:"row",width:"100%",justifyContent:"space-between",alignItems:"center",marginTop:36},buttonsContainer:{flexDirection:"row",alignItems:"center",gap:20},goToReview:{fontFamily:"Inter, sans-serif",fontSize:16,fontWeight:"700",color:Oo.B.blue.blue400},goToReviewMobile:{fontSize:14}}),Qc=(0,a.PA)((()=>{const e=as(),t=e.getFlowGroups();return c.createElement(c.Fragment,null,t.map(((n,o)=>{const r=e.getGroupSteps(n).every((t=>e.validateStep(t))),a=e.currentGroup===n;return c.createElement(K.A,{key:n,style:qc.groupWrapper},c.createElement(K.A,{style:[qc.groupCircle,r?qc.filledGroupCircle:a?qc.activeGroupCircle:{}]},r?c.createElement(fe.Icon,{name:"checkmark-outline",width:20,fill:Oo.B.service.green}):c.createElement(de.QG,{style:[qc.groupTitle,a&&qc.activeGroupIndex]},o+1)),c.createElement(Bt.A,{onPress:()=>e.editGroup(n)},c.createElement(de.QG,{style:qc.groupTitle},Fs[n])),o!==t.length-1&&c.createElement(fe.Icon,{name:"chevron-right-outline",width:18,color:Oo.B.text.grey700,style:qc.separator}))})))})),qc=ie.A.create({groupWrapper:{flexDirection:"row",alignItems:"center"},groupCircle:{width:32,height:32,borderRadius:16,alignItems:"center",justifyContent:"center",marginRight:10,backgroundColor:Oo.B.background.grey100},filledGroupCircle:{backgroundColor:"".concat(Oo.B.service.green,"1A")},activeGroupCircle:{backgroundColor:Oo.B.blue.blue100,color:"#000"},groupTitle:{fontSize:14,fontWeight:"600",lineHeight:22},activeGroupIndex:{color:Oo.B.blue.blue400},separator:{marginHorizontal:8}}),Kc=(0,p.PA)((()=>{const{t:e}=(0,z.Bd)("application"),{sm:t}=(0,ce.Qs)(),n=as(),o=(0,c.useMemo)((()=>n.currentStep?function(e){switch(e){case Zi.sponsor.loanOfficer:return wc;case Zi.sponsor.personalInformation:return hs;case Zi.sponsor.homeAddress:return fs;case Zi.sponsor.maritalStatus:return Cs;case Zi.sponsor.statements:return Is;case Zi.sponsor.citizenship:return ws;case Zi.businessEntity.entityInformation:return js;case Zi.businessEntity.address:return Ws;case Zi.businessEntity.isCreatedForProject:return Hs;case Zi.businessEntity.representative:return Gs;case Zi.previousProjects.projects:return Sc;case Zi.previousProjects.bankAccounts:return Bc;case Zi.currentProject.loanType:return Qs;case Zi.currentProject.loanPurpose:return uc;case Zi.currentProject.loanTerm:return mc;case Zi.currentProject.generalContractor:return _c;case Zi.currentProject.mainAddress:return qs;case Zi.currentProject.originalPurchaseDetails:return Nc;case Zi.currentProject.payoffAmount:return gc;case Zi.currentProject.subordinateDebts:return vc;case Zi.currentProject.permits:return Lc;case Zi.currentProject.hasMultipleBuilds:return Js;case Zi.currentProject.builds:return cc;case Zi.currentProject.projectDetails:return $s;case Zi.currentProject.projectValueDetails:return yc;case Zi.review.review:return Ls;default:throw new Error("no editor for path: ".concat(e))}}(n.currentStep):{options:{},component:()=>c.createElement(c.Fragment,null)}),[n.currentStep]);return(0,c.useEffect)((()=>{n.setStepOptions(o.options)}),[n,o.options]),c.createElement(K.A,{style:{flex:1}},c.createElement(Ai,null,n.isInReview?c.createElement(wi,{text:e("LenderApplication.Flow.Review.Header")}
1):c.createElement(Qc,null)),c.createElement(Hc,null),c.createElement(ui,{currentStep:n.currentStep},c.createElement(Wc,null),c.createElement(F.hK,{height:t?20:10}),c.createElement(Mc,null),c.createElement(zc,null),c.createElement(F.hK,{height:24}),c.createElement(o.component,null),c.createElement(Gc,null)),c.createElement(vi,null))})),Jc=(0,a.PA)((()=>{const{t:e}=(0,z.Bd)("application"),{t:t}=(0,z.Bd)("global"),{sm:n}=(0,ce.Qs)(),[o,r]=c.useState(!1),a=as();return c.createElement(K.A,{style:{flex:1}},c.createElement(Ai,{logoutWarning:t("are-you-sure-to-logout")},c.createElement(Qc,null)),c.createElement(Hc,null),c.createElement(F.hK,{height:n?20:10}),c.createElement(ui,null,c.createElement(de.QG,{style:Xc.title},e("LenderApplication.WelcomePage.Title")),c.createElement(de.QG,{style:Xc.plainText},e("LenderApplication.WelcomePage.Description")),c.createElement(F.hK,{height:16}),c.createElement(de.QG,{style:Xc.plainText},e("LenderApplication.WelcomePage.Description1")),c.createElement(F.hK,{height:16}),c.createElement(K.A,{style:Xc.sections},c.createElement(Zc,{title:e("LenderApplication.WelcomePage.Section1.Title"),description:e("LenderApplication.WelcomePage.Section1.Description")}),c.createElement(Zc,{title:e("LenderApplication.WelcomePage.Section2.Title"),description:e("LenderApplication.WelcomePage.Section2.Description")}),c.createElement(Zc,{title:e("LenderApplication.WelcomePage.Section3.Title"),description:e("LenderApplication.WelcomePage.Section3.Description")}),c.createElement(Zc,{title:e("LenderApplication.WelcomePage.Section4.Title"),description:e("LenderApplication.WelcomePage.Section4.Description")})),c.createElement(F.hK,{height:20}),c.createElement(de.QG,{style:Xc.plainText},e("LenderApplication.WelcomePage.PrivacyStatement")),c.createElement(F.hK,{height:20}),c.createElement(gi,null),c.createElement(F.hK,{height:32}),c.createElement(K.A,null,c.createElement(de.BtButton,{onPress:()=>{a.draft.id?a.hideWelcomePage():(r(!0),a.createDraft().then((()=>a.hideWelcomePage())).catch((e=>console.error(e))).finally((()=>r(!1))))},loading:o,disabled:o,appearance:"filled",status:"primary",accessoryRight:()=>c.createElement(fe.Icon,{name:"arrow-forward-outline",width:20,fill:"#FFFFFF"}),style:Xc.startButton},e("LenderApplication.WelcomePage.StartApplicationButton")))))})),Zc=e=>{let{title:t,description:n}=e;return c.createElement(K.A,{style:Xc.sectionCard},c.createElement(de.QG,{size:16,weight:"600",style:Xc.sectionTitle},t),c.createElement(de.QG,{size:14,style:Xc.plainText},n))},Xc=ie.A.create({title:{fontSize:32,fontWeight:"700",marginBottom:16,lineHeight:44},plainText:{fontSize:14,fontWeight:"500",lineHeight:20},sections:{flexDirection:"column",gap:12},sectionCard:{backgroundColor:Oo.B.background.grey100,padding:16,borderRadius:8},sectionTitle:{fontSize:14,fontWeight:"700",lineHeight:20,marginBottom:8},startButton:{alignSelf:"flex-end",minWidth:200,borderRadius:8}}),$c=()=>{var e;const{t:t}=(0,z.Bd)("application"),{t:n}=(0,z.Bd)("global"),o=(0,$e.useNavigation)(),r=as(),a=(0,Ii.b)(r.draft);return c.createElement(K.A,{style:{flex:1}},c.createElement(Ai,{logoutWarning:n("are-you-sure-to-logout")}),c.createElement(No.A,null),c.createElement(ui,null,c.createElement(Ti.G,{name:"upload-outline"}),c.createElement(F.hK,{height:32}),c.createElement(de.QG,{style:ed.title},t("LenderApplication.SubmittedPage.Title")),c.createElement(F.hK,{height:24}),c.createElement(de.QG,{style:ed.title},t("LenderApplication.SubmittedPage.SubTitle")),c.createElement(F.hK,{height:32}),c.createElement(de.QG,{style:ed.plainText},c.createElement(z.x6,{t:t,i18nKey:"LenderApplication.SubmittedPage.Description",values:{email:(null===(e=f.A.userStore.user)||void 0===e?void 0:e.email)||""},components:{styled:c.createElement(de.QG,{style:ed.email})}})),c.createElement(F.hK,{height:16}),c.createElement(de.QG,{style:ed.plainText},t("LenderApplication.SubmittedPage.ThankYou")),c.createElement(F.hK,{height:32}),c.createElement(de.BtButton,{onPress:()=>{o.navigate(E.f0.LenderDocuments,{lenderId:r.draft.data.lenderId})},style:ed.uploadDocumentsButton},t("LenderApplication.SubmittedPage.UploadDocumentsButton")),c.createElement(F.hK,{height:46}),c.createElement(de.QG,{style:ed.subtitle},t("LenderApplication.SubmittedPage.DocumentsListTitle")),c.createElement(F.hK,{height:16}),Object.entries(a).map((e=>{let[n,o]=e;return c.createElement(K.A,{key:n,style:ed.documentItem},c.createElement(fe.Icon,{name:"file-text-outline",width:19,fill:Oo.B.blue.blue400}),c.createElement(de.QG,{style:ed.plainText},t("LenderApplication.Documents.Names.".concat(n))))}))),c.createElement(vi,null))},ed=ie.A.create({icon:{width:72,height:72,borderRadius:36,backgroundColor:Oo.B.blue.blue100,justifyContent:"center",alignItems:"center",alignSelf:"center"},title:{fontSize:24,fontWeight:"700",textAlign:"center",lineHeight:36},subtitle:{fontSize:14,fontWeight:"700",color:Oo.B.text.black},plainText:{fontSize:14,fontWeight:"500",textAlign:"center",lineHeight:20},uploadDocumentsButton:{width:200,alignSelf:"center"},email:{fontWeight:"700",color:Oo.B.blue.blue400},required:{color:Oo.B.service.red100c},documentItem:{flexDirection:"row",alignItems:"center",marginBottom:12,gap:8}}),td=(0,a.PA)((()=>{const{t:e}=(0,z.Bd)("application"),{t:t}=(0,z.Bd)("global"),{sm:n}=(0,ce.Qs)(),o=as();return c.createElement(K.A,{style:{flex:1}},c.createElement(Ai,{logoutWarning:t("are-you-sure-to-logout")}
1,c.createElement(Qc,null)),c.createElement(Hc,null),c.createElement(F.hK,{height:n?20:10}),c.createElement(ui,null,c.createElement(de.QG,{style:nd.title},e("LenderApplication.ResumePage.Title")),c.createElement(de.QG,{style:nd.plainText},e("LenderApplication.ResumePage.Description")),c.createElement(F.hK,{height:16}),c.createElement(_s,{onEditSection:()=>o.hideResumePage()}),c.createElement(F.hK,{height:32}),c.createElement(K.A,null,c.createElement(de.BtButton,{onPress:()=>{o.hideResumePage();const e=o.getFlowSteps().find((e=>!o.validateStep(e)));o.goToStep(e||Zi.review.review)},appearance:"filled",status:"primary",accessoryRight:()=>c.createElement(fe.Icon,{name:"arrow-forward-outline",width:20,fill:"#FFFFFF"}),style:nd.resumeButton},e("LenderApplication.ResumePage.ResumeButton")))))})),nd=ie.A.create({title:{fontSize:32,fontWeight:"700",marginBottom:16,lineHeight:44},plainText:{fontSize:14,fontWeight:"500",lineHeight:20},resumeButton:{alignSelf:"flex-end","align-items":"flex-end",width:160}}),od=(0,a.PA)((()=>c.createElement(ls,null,c.createElement(rd,null)))),rd=(0,a.PA)((()=>{const e=(0,$e.useNavigation)(),t=as(),[n,o]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{o(!0),N.Vv.pW.getLenderApplications().then((n=>{const r=(null===n||void 0===n?void 0:n.applications)||[];if(!r.length)throw new Error("No lenders for current user");const a=r.find((e=>!e.applicationId||e.status&&[Fi.W.SentBack,Fi.W.Canceled].includes(e.status)));if(a)t.init(a.lenderId),Promise.all([t.loadDraft().catch((e=>console.error(e))),t.loadLoanOfficers().catch((e=>console.error(e)))]).finally((()=>o(!1)));else{const t=r[r.length-1].lenderId;e.navigate(E.f0.LenderDocuments,{lenderId:t})}}))}),[e,t]),n?c.createElement(_i,null):t.shouldStartApplication?c.createElement(Jc,null):t.showResumePage?c.createElement(td,null):t.isSubmitted?c.createElement($c,null):c.createElement(Kc,null)}));function ad(){return c.createElement(rt.A,{contentContainerStyle:ld.content},c.createElement(K.A,{style:ld.container},c.createElement(se.A,{style:ld.title},"Table demo"),c.createElement(se.A,{style:ld.description},"Fake invoice list using TanStack Table with a grouped amounts column and row-spanned cells."),c.createElement(o.X4,null)))}const ld={content:{backgroundColor:"#FFFFFF",flexGrow:1,padding:24},container:{alignSelf:"center",maxWidth:1200,width:"100%"},description:{color:"#5F788A",fontFamily:"Inter, sans-serif",fontSize:14,marginBottom:24},title:{color:"#2F4858",fontFamily:"Inter, sans-serif",fontSize:28,fontWeight:"600",marginBottom:8}},id=c.lazy((()=>Promise.resolve().then(n.bind(n,50112)))),sd=c.lazy((()=>n.e(42).then(n.bind(n,43042)))),cd=c.lazy((()=>Promise.all([n.e(879),n.e(818)]).then(n.bind(n,12717)))),dd=(0,y.A)(),ud=(0,p.PA)((()=>{const{userStore:e}=f.A,{isAuthenticated:t,userInfoReady:n,hasLineOfCreditApps:o,isLenderClient:r}=e,a=!!e.settings.get("onboarding"),l=(0,c.useMemo)((()=>t&&!n?d.A:t&&!a?id:t&&a?cd:te),[t,n,a]);if(t&&n&&r&&!o)return c.createElement(dd.Navigator,{screenOptions:{...b.pc,cardStyle:{flex:1}},headerMode:b.Hu},c.createElement(dd.Screen,{name:E.f0.LenderApplication,component:od}),c.createElement(dd.Screen,{name:E.f0.LenderDocuments,component:Ri}));const{screensStore:{notificationStore:i}}=f.A,s=ae.NE.create(),u=re.nR.create({},{notificationStore:i});return c.createElement(ae.pK,{value:s},c.createElement(re.j3,{value:u},c.createElement(ne.$U,null,c.createElement(dd.Navigator,{screenOptions:{...b.pc,cardStyle:{flex:1}},headerMode:b.Hu},c.createElement(dd.Screen,{name:E.f0.Home._self,component:l}),c.createElement(dd.Screen,{name:E.f0.IntegrationPayment,component:ai}),c.createElement(dd.Screen,{name:E.f0.IntegrationJwtPayment,component:ma}),c.createElement(dd.Screen,{name:E.f0.InvoicePayment,component:ci}),c.createElement(dd.Screen,{name:E.f0.EmailActions,component:sd}),c.createElement(dd.Screen,{name:E.f0.Invitation,component:A.A}),c.createElement(dd.Screen,{name:E.f0.Kitten,component:We}),c.createElement(dd.Screen,{name:E.f0.TableDemo,component:ad}),c.createElement(dd.Screen,{name:E.f0.Authorize,component:Xe}),c.createElement(dd.Screen,{name:E.f0.DocumentApproval,component:$n}),c.createElement(dd.Screen,{name:E.f0.CreditAgreementsApproval,component:$n}),c.createElement(dd.Screen,{name:E.f0.GetPaidAgreementsApproval,component:to}),t&&c.createElement(c.Fragment,null,c.createElement(dd.Screen,{name:E.f0.GetPaidApplication,component:Dt}),c.createElement(dd.Screen,{name:E.f0.CreditApplication,component:Jt}),c.createElement(dd.Screen,{name:E.f0.InHouseCreditApplication,component:jn}),c.createElement(dd.Screen,{name:E.f0.NewProject,component:e=>{let{route:t,navigation:n}=e;return(0,Ha.A)()?c.createElement(di.w,{route:t,navigation:n}):c.createElement(zn.m,{route:t,navigation:n})}})),c.createElement(dd.Screen,{name:E.f0.InvoiceLink._self,component:C.A}),c.createElement(dd.Screen,{name:E.f0.PaymentCollectedReceipt,component:Mn})))))})),md={...h.A,colors:{...h.A.colors,background:"white"}};function pd(){return c.createElement(ne.$U,null,c.createElement(c.Suspense,{fallback:c.createElement(d.A,null)},c.createElement(v.A,{ref:oe.navigationRef,linking:E.yJ,documentTitle:{enabled:!1},theme:md},c.createElement(ud,null)),c.createElement(pe,null)))}var gd=n(38542),hd=n(25672),vd=n(78806),yd=n(52290);const bd=e=>({variables:{"--bluetape-colors-list-hover":e.other.colors.list.hover,"--bluetape-colors-table-header":e.other.colors.table.header,"--bluetape-colors-table-tinted":e.other.colors.table.tinted},dark:{},light:{}});var fd=n(31612);const{customTheme:Ed,evaMapping:Cd}=ye.theme,Ad=(0,a.PA)((()=>c.createElement(i.A,{color:gd.theme.commonColors.accentText,visible:l.A.isBusy,indeterminate:!0}))),Sd=(0,a.PA)((function(){return(0,c.useEffect)((()=>
1{if(l.A.isReady){var e;const t=document.getElementById("logo");t&&(null===(e=t.parentNode)||void 0===e||e.removeChild(t))}}),[l.A.isReady]),l.A.isReady?c.createElement(u.A,{cookies:m.A.getProvider()},c.createElement(p.Kq,{store:l.A},c.createElement(s.A,{theme:gd.theme.light},c.createElement(fe.IconRegistry,{icons:vd.A}),c.createElement(fe.ApplicationProvider,Object.assign({},hd,{theme:{...hd.light,...Ed},customMapping:Cd}),c.createElement(g.Ay,null,c.createElement(pd,null),c.createElement(K.A,{style:{position:"absolute",zIndex:1e5,top:0,left:0,right:0}},c.createElement(Ad,null))))))):c.createElement(d.A,null)})),wd=()=>((0,c.useEffect)((()=>{const e=e=>{const t=e.target;t&&"function"===typeof t.closest&&!t.closest(".mantine-Notification-root")&&fd.$e.clean()};return document.addEventListener("click",e,{capture:!0}),()=>document.removeEventListener("click",e,{capture:!0})}),[]),c.createElement(r.Ht,{client:da.q},c.createElement(yd.y,{defaultColorScheme:"light",theme:o.az,cssVariablesResolver:bd},c.createElement(jl.$,null),c.createElement(o.Sg,null,c.createElement(Sd,null)))))},57081:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var o=n(50016),r=n(74227);const a=e=>{let{width:t=16,height:n=16,color:a="#00A0F3"}=e;return o.createElement(r.default,{width:t,height:n,viewBox:"0 0 16 16",fill:"none"},o.createElement(r.G,{clipPath:"url(#clip0_3707_552)"},o.createElement(r.Path,{d:"M12.2 3.80665C11.94 3.54665 11.52 3.54665 11.26 3.80665L7.99998 7.05998L4.73998 3.79998C4.47998 3.53998 4.05998 3.53998 3.79998 3.79998C3.53998 4.05998 3.53998 4.47998 3.79998 4.73998L7.05998 7.99998L3.79998 11.26C3.53998 11.52 3.53998 11.94 3.79998 12.2C4.05998 12.46 4.47998 12.46 4.73998 12.2L7.99998 8.93998L11.26 12.2C11.52 12.46 11.94 12.46 12.2 12.2C12.46 11.94 12.46 11.52 12.2 11.26L8.93998 7.99998L12.2 4.73998C12.4533 4.48665 12.4533 4.05998 12.2 3.80665Z",fill:a})),o.createElement(r.Defs,null,o.createElement(r.ClipPath,{id:"clip0_3707_552"},o.createElement(r.Rect,{width:"16",height:"16",fill:"white"}))))}},64413:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});const o={gray0:"var(--mantine-color-gray-0)",gray1:"var(--mantine-color-gray-1)",gray2:"var(--mantine-color-gray-2)",gray3:"var(--mantine-color-gray-3)",gray4:"var(--mantine-color-gray-4)",gray5:"var(--mantine-color-gray-5)",gray6:"var(--mantine-color-gray-6)",gray7:"var(--mantine-color-gray-7)",gray8:"var(--mantine-color-gray-8)",gray9:"var(--mantine-color-gray-9)",gray:"var(--mantine-color-gray-6)",red0:"var(--mantine-color-red-0)",red1:"var(--mantine-color-red-1)",red2:"var(--mantine-color-red-2)",red3:"var(--mantine-color-red-3)",red4:"var(--mantine-color-red-4)",red5:"var(--mantine-color-red-5)",red6:"var(--mantine-color-red-6)",red7:"var(--mantine-color-red-7)",red8:"var(--mantine-color-red-8)",red9:"var(--mantine-color-red-9)",red:"var(--mantine-color-red-6)",pink0:"var(--mantine-color-pink-0)",pink1:"var(--mantine-color-pink-1)",pink2:"var(--mantine-color-pink-2)",pink3:"var(--mantine-color-pink-3)",pink4:"var(--mantine-color-pink-4)",pink5:"var(--mantine-color-pink-5)",pink6:"var(--mantine-color-pink-6)",pink7:"var(--mantine-color-pink-7)",pink8:"var(--mantine-color-pink-8)",pink9:"var(--mantine-color-pink-9)",pink:"var(--mantine-color-pink-6)",grape0:"var(--mantine-color-grape-0)",grape1:"var(--mantine-color-grape-1)",grape2:"var(--mantine-color-grape-2)",grape3:"var(--mantine-color-grape-3)",grape4:"var(--mantine-color-grape-4)",grape5:"var(--mantine-color-grape-5)",grape6:"var(--mantine-color-grape-6)",grape7:"var(--mantine-color-grape-7)",grape8:"var(--mantine-color-grape-8)",grape9:"var(--mantine-color-grape-9)",grape:"var(--mantine-color-grape-6)",violet0:"var(--mantine-color-violet-0)",violet1:"var(--mantine-color-violet-1)",violet2:"var(--mantine-color-violet-2)",violet3:"var(--mantine-color-violet-3)",violet4:"var(--mantine-color-violet-4)",violet5:"var(--mantine-color-violet-5)",violet6:"var(--mantine-color-violet-6)",violet7:"var(--mantine-color-violet-7)",violet8:"var(--mantine-color-violet-8)",violet9:"var(--mantine-color-violet-9)",violet:"var(--mantine-color-violet-6)",indigo0:"var(--mantine-color-indigo-0)",indigo1:"var(--mantine-color-indigo-1)",indigo2:"var(--mantine-color-indigo-2)",indigo3:"var(--mantine-color-indigo-3)",indigo4:"var(--mantine-color-indigo-4)",indigo5:"var(--mantine-color-indigo-5)",indigo6:"var(--mantine-color-indigo-6)",indigo7:"var(--mantine-color-indigo-7)",indigo8:"var(--mantine-color-indigo-8)",indigo9:"var(--mantine-color-indigo-9)",indigo:"var(--mantine-color-indigo-6)",blue0:"var(--mantine-color-blue-0)",blue1:"var(--mantine-color-blue-1)",blue2:"var(--mantine-color-blue-2)",blue3:"var(--mantine-color-blue-3)",blue4:"var(--mantine-color-blue-4)",blue5:"var(--mantine-color-blue-5)",blue6:"var(--mantine-color-blue-6)",blue7:"var(--mantine-color-blue-7)",blue8:"var(--mantine-color-blue-8)",blue9:"var(--mantine-color-blue-9)",blue:"var(--mantine-color-blue-6)",cyan0:"var(--mantine-color-cyan-0)",cyan1:"var(--mantine-color-cyan-1)",cyan2:"var(--mantine-color-cyan-2)",cyan3:"var(--mantine-color-cyan-3)",cyan4:"var(--mantine-color-cyan-4)",cyan5:"var(--mantine-color-cyan-5)",cyan6:"var(--mantine-color-cyan-6)",cyan7:"var(--mantine-color-cyan-7)",cyan8:"var(--mantine-color-cyan-8)",cyan9:"var(--mantine-color-cyan-9)",cyan:"var(--mantine-color-cyan-6)",teal0:"var(--mantine-color-teal-0)",teal1:"var(--mantine-color-teal-1)",teal2:"var(--mantine-color-teal-2)",teal3:"var(--mantine-color-teal-3)",teal4:"var(--mantine-color-teal-4)",teal5:"var(--mantine-color-teal-5)",teal6:"var(--mantine-color-teal-6)",teal7:"var(--mantine-color-teal-7)",teal8:"var(--mantine-color-teal-8)",teal9:"var(--mantine-color-teal-9)",teal:"var(--mantine-color-teal-6)",green0:"var(--mantine-color-green-0)",green1:"var(--mantine-color-green-1)",green2:"var(--mantine-color-green-2)",green3:"var(--mantine-color-green-3)",green4:"var(--mantine-color-green-4)",green5:"var(--mantine-color-green-5)",green6:"var(--mantine-color-green-6)",green7:"var(--mantine-color-green-7)",green8:"var(--mantine-color-green-8)",green9:"var(--mantine-color-green-9)",green:"var(--mantine-color-green-6)",lime0:"var(--mantine-color-lime-0)",lime1:"var(--mantine-color-lime-1)",lime2:"var(--mantine-color-lime-2)",lime3:"var(--mantine-color-lime-3)",lime4:"var(--mantine-color-lime-4)",lime5:"var(--mantine-color-lime-5)",lime6:"var(--mantine-color-lime-6)",lime7:"var(--mantine-color-lime-7)",lime8:"var(--mantine-color-lime-8)",lime9:"var(--mantine-color-lime-9)",lime:"var(--mantine-color-lime-6)",yellow0:"var(--mantine-color-yellow-0)",yellow1:"var(--mantine-color-yellow-1)",yellow2:"var(--mantine-color-yellow-2)",yellow3:"var(--mantine-color-yellow-3)",yellow4:"var(--mantine-color-yellow-4)",yellow5:"var(--mantine-color-yellow-5)",yellow6:"var(--mantine-color-yellow-6)",yellow7:"var(--mantine-color-yellow-7)",yellow8:"var(--mantine-color-yellow-8)",yellow9:"var(--mantine-color-yellow-9)",yellow:"var(--mantine-color-yellow-6)",orange0:"var(--mantine-color-orange-0)",orange1:"var(--mantine-color-orange-1)",orange2:"var(--mantine-color-orange-2)",orange3:"var(--mantine-color-orange-3)",orange4:"var(--mantine-color-orange-4)",orange5:"var(--mantine-color-orange-5)",orange6:"var(--mantine-color-orange-6)",orange7:"var(--mantine-color-orange-7)",orange8:"var(--mantine-color-orange-8)",orange9:"var(--mantine-color-orange-9)",orange:"var(--mantine-color-orange-6)",primary0:"var(--mantine-primary-color-0)",primary1:"var(--mantine-primary-color-1)",primary2:"var(--mantine-primary-color-2)",primary3:"var(--mantine-primary-color-3)",primary4:"var(--mantine-primary-color-4)",primary5:"var(--mantine-primary-color-5)",primary6:"var(--mantine-primary-color-6)",primary7:"var(--mantine-primary-color-7)",primary8:"var(--mantine-primary-color-8)",primary9:"var(--mantine-primary-color-9)",primary:"var(--mantine-primary-color-filled)",primaryLight:"var(--mantine-primary-color-light)"}},72305:(e,t,n)=>{"use strict";n.d(t,{t:()=>c});var o=n(50016),r=n(63092);const a="ActionLink_root__Mzize",l="ActionLink_label__uGxRH",i="ActionLink_section__SqtUO";var s=n(92374);const c=(0,o.forwardRef)(((e,t)=>{let{leftSection:n,rightSection:c,children:d,className:u,disabled:m,onClick:p,...g}=e;return o.createElement(r.M,Object.assign({ref:t,className:(0,s.A)(a,u),underline:"never","data-disabled":m||void 0,onClick:e=>{null===p||void 0===p||p(e),e.stopPropagation(),e.preventDefault()}},g),n&&o.createElement("span",{className:i,"data-position":"left"},n),d&&o.createElement("span",{className:l},d),c&&o.createElement("span",{className:i,"data-position":"right"},c))}
1));c.displayName="ActionLink"},38176:(e,t,n)=>{"use strict";n.d(t,{c:()=>d});var o=n(50016),r=n(95011),a=n(78614),l=n(50767),i=n(92374);const s="Expander_root__dzo1R",c="Expander_expander__+pqaU",d=e=>{let{initialState:t,state:n,className:d,onToggle:u,...m}=e;const[p,g]=(0,r.j)(t);return(0,o.useEffect)((()=>{void 0!==n&&(n?g.open():g.close())}),[n,g]),o.createElement(l.a,Object.assign({className:s},m),o.createElement(a.A,{className:(0,i.A)(c,d),"data-expanded":p,onClick:e=>{g.toggle(),null===u||void 0===u||u(!p),e.stopPropagation()}}))}},88811:(e,t,n)=>{"use strict";n.d(t,{g:()=>m});var o=n(40871),r=n(95778),a=n(71139),l=n(84414),i=n(51599),s=n(27008),c=n(50016);const d={displayValue:"BaseSelect_displayValue__yagja",checkIcon:"BaseSelect_checkIcon__Wwf4y"},u=300;function m(e){let{options:t,value:n,placeholder:m,label:p,required:g,disabled:h,readOnly:v,testId:y,dropdownOpened:b,initiallyOpen:f=!1,maxDropdownHeight:E=u,comboboxProps:C,size:A="md",styles:S,renderDisplayValue:w,onDropdownOpen:P,onDropdownClose:I,onOptionSelect:x,renderOption:D,...T}=e;const[k,B]=(0,c.useState)(f),F=null!==b&&void 0!==b?b:k,_=(0,c.useMemo)((()=>new Map(t.map((e=>[e.value,e])))),[t]),N=w((0,c.useMemo)((()=>n.map((e=>_.get(e))).filter((e=>Boolean(e)))),[_,n])),R=(0,o.B)({opened:F,onOpenedChange:e=>{void 0===b&&B(e)},onDropdownOpen:()=>{n.length>0?R.updateSelectedOptionIndex("selected"):R.selectFirstOption(),null===P||void 0===P||P()},onDropdownClose:()=>{R.resetSelectedOption(),null===I||void 0===I||I()}}),L={closeDropdown:()=>R.closeDropdown(),openDropdown:()=>R.openDropdown(),toggleDropdown:()=>R.toggleDropdown()};return c.createElement(r.G,Object.assign({},C,{store:R,onOptionSubmit:e=>{const t=_.get(e);t&&!t.disabled&&(null===x||void 0===x||x(t,L))},transitionProps:{duration:1}}),c.createElement(r.G.Target,{targetType:"button"},c.createElement(a.O,Object.assign({},T,{styles:S,label:p,required:g,component:"button","data-testid":y,disabled:h,pointer:!0,rightSection:c.createElement(r.G.Chevron,null),rightSectionPointerEvents:"none",type:"button",size:A,onClick:()=>{h||v||R.toggleDropdown()}}),N?c.createElement("span",{className:d.displayValue},N):c.createElement(l.p.Placeholder,null,m))),c.createElement(r.G.Dropdown,{hidden:!t.length},c.createElement(r.G.Options,{mah:E,style:{overflowY:"auto"}},t.map((e=>{const t=n.includes(e.value);return c.createElement(r.G.Option,{key:e.value,active:t,disabled:e.disabled,selected:t,value:e.value},D?D(e,t):function(e,t){return c.createElement(i.Y,{flex:"1",gap:"xs",justify:"space-between",wrap:"nowrap"},c.createElement("span",null,e.label),t?c.createElement(s.A,{className:d.checkIcon,size:16}):null)}(e,t))})))))}},5685:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var o=n(50016),r=n(88811);function a(e){let{value:t,allowDeselect:n=!1,closeOnSelect:a=!0,renderDisplayValue:l,onChange:i,onOptionSelect:s,...c}=e;const d=null!==l&&void 0!==l?l:e=>{var t;let[n]=e;return null!=n?null!==(t=n.displayLabel)&&void 0!==t?t:n.label:null};return o.createElement(r.g,Object.assign({},c,{value:null!=t?[t]:[],renderDisplayValue:d,onOptionSelect:(e,o)=>{if(!1===(null===s||void 0===s?void 0:s(e,o)))return;if(!n&&t===e.value)return;const r=n&&t===e.value;i(r?null:e.value,r?null:e),a&&o.closeDropdown()}}))}},84563:(e,t,n)=>{"use strict";n.d(t,{Y:()=>y});var o=n(50016),r=n(29458),a=n(67769),l=n(36883),i=n(50767),s=n(3704),c=n(41436),d=n(56480),u=n(95011);const m={root:"PropertyGrid_root__j03pw",table:"PropertyGrid_table__b938R",label:"PropertyGrid_label__7oOzM",labelCell:"PropertyGrid_labelCell__yXUC4",value:"PropertyGrid_value__0hqOZ",valueCell:"PropertyGrid_valueCell__xlmkl"};var p=n(92374),g=n(38176);const h="PropertyGrid",v={alignValue:"right"},y=(0,r.P9)((e=>{const t=(0,a.Y)(h,v,e),{items:n,withLastDivider:r,alignValue:c,variant:d,...u}=t,p=(0,l.I)({name:h,classes:m,props:t,...u});return null!==n&&void 0!==n&&n.filter(Boolean).length?o.createElement(i.a,Object.assign({variant:d},p("root"),u),o.createElement(s.X,{className:m.table,mod:{"last-divider":r}},o.createElement(s.X.Tbody,null,n.map(((e,t)=>e?o.createElement(o.Fragment,{key:t},o.createElement(b,{item:e,styles:p,alignValue:c})):null))))):null})),b=e=>{var t;let{item:n,styles:r,alignValue:a,level:l=0}=e;const[h,v]=(0,u.j)(!1),y=null!=n.children&&n.children.length>0;return o.createElement(o.Fragment,null,o.createElement(s.X.Tr,null,o.createElement(s.X.Td,r("labelColumn"),o.createElement(i.a,Object.assign({},r("labelCell"),{style:{"--pg-level":l}}),o.createElement(c.o,{inline:!0,style:{gap:4}},y&&o.createElement(g.c,{initialState:h,onToggle:v.toggle}
1),"string"===typeof n.label?o.createElement(d.E,Object.assign({},n.labelProps,r("label",{className:(0,p.A)(m.label,n.labelClassName)}),{"data-has-children":y,onClick:y?()=>v.toggle():void 0}),n.label):n.label))),o.createElement(s.X.Td,r("valueColumn"),o.createElement(i.a,Object.assign({},r("valueCell",{className:m.valueCell}),{"data-align-value":a}),"string"===typeof n.value||"number"===typeof n.value?o.createElement(d.E,Object.assign({},n.valueProps,r("value",{className:n.valueClassName})),n.value):n.value))),h&&(null===(t=n.children)||void 0===t?void 0:t.map(((e,t)=>o.createElement(b,{key:t,item:e,level:l+1,styles:r,alignValue:a})))))};y.displayName=h,y.classes=m},76223:(e,t,n)=>{"use strict";n.d(t,{J:()=>l});var o=n(50016),r=n(75226),a=n(56480);const l=e=>{let{loading:t,children:n}=e;return o.createElement(r.E,{visible:t,h:24,w:"100%"},"string"===typeof n?o.createElement(a.E,null,n):n)}},3295:(e,t,n)=>{"use strict";n.d(t,{Y:()=>d});var o=n(50016),r=n(29458),a=n(67769),l=n(36883),i=n(76682);const s={root:"BaseAlert_root__3fROL",body:"BaseAlert_body__fz8-9",icon:"BaseAlert_icon__U1Tkt",label:"BaseAlert_label__rF29L",message:"BaseAlert_message__bjDjo"},c="BaseAlert",d=(0,r.P9)((e=>{const t=(0,a.Y)(c,{},e),{classNames:n,...r}=t,d=(0,l.I)({name:c,classes:s,props:t,...t});return o.createElement(i.F,Object.assign({variant:"filled",classNames:{root:d("root").className,body:d("body").className,icon:d("icon").className,label:d("label").className,message:d("message").className}},r))}));d.displayName=c,d.classes=s},40013:(e,t,n)=>{"use strict";n.d(t,{W:()=>l});var o=n(50016),r=n(3295),a=n(41082);const l=r.Y.withProps({icon:o.createElement(a.A,null),color:"var(--mantine-color-red-0)",styles:{icon:{color:"var(--mantine-color-red-filled)"}}})},83572:(e,t,n)=>{"use strict";n.d(t,{kv:()=>v,aC:()=>y,W_:()=>o.W,Z0:()=>i,pM:()=>C});var o=n(40013),r=n(50016),a=n(3295),l=n(25104);const i=a.Y.withProps({icon:r.createElement(l.A,null),color:"var(--mantine-primary-color-0)",styles:{icon:{color:"var(--mantine-primary-color-filled)"}}});var s=n(29458),c=n(67769),d=n(36883),u=n(9015),m=n(25183);const p={root:"AllocationBar_root__Xvuc2"},g="AllocationBar",h={colors:["#00A0F3","#DB2424","#FF7926"],size:8,radius:9},v=(0,s.P9)(((e,t)=>{const n=(0,c.Y)(g,h,e),{total:o,values:a,colors:l,...i}=n,s=(0,d.I)({name:g,classes:p,props:n,...i}),v=l;return r.createElement(u.k.Root,Object.assign({ref:t},s("root"),i),a.map(((e,t)=>{if(!e)return null;const n="number"===typeof e?e:e.value,a="object"===typeof e?e.tooltip:"",l=o?100*n/o:0;if(l<=0)return null;const i=t%v.length;return r.createElement(m.m,{key:t,label:a,disabled:!a},r.createElement(u.k.Section,Object.assign({value:l,color:v[i]},s("segment"))))})))}));v.displayName=g,v.classes=p;const y=n(74655).a.withProps({type:"bars",size:"lg"});var b=n(50767),f=n(92374);const E="Shaky_root__+pEPL",C=(0,r.forwardRef)(((e,t)=>{let{className:n,...o}=e;return r.createElement(b.a,Object.assign({ref:t,component:"span",className:(0,f.A)(E,n)},o))}));C.displayName="Shaky"},65518:(e,t,n)=>{"use strict";n.d(t,{G:()=>s,N:()=>g});var o=n(50016),r=n(62490),a=n(27008),l=n(41082),i=n(25104);const s=e=>{let{type:t="info",children:n,color:s,...c}=e,d=n,u=s;return u||("success"===t?u="green":"alert"===t?u="orange":"info"===t?u="blue":"danger"===t&&(u="red")),d||("success"===t?d=o.createElement(a.A,{size:46}):"alert"===t?d=o.createElement(l.A,{size:34}):"info"===t?d=o.createElement(i.A,{size:36}):"danger"===t&&(d=o.createElement(l.A,{size:34}))),o.createElement(r.L,Object.assign({size:72,radius:"xl",variant:"light",color:u},c),d)};var c=n(25183),d=n(50767),u=n(30193),m=n(92374);const p="HelpIcon_root__opwe7",g=e=>{let{label:t,className:n,...r}=e;return o.createElement(c.m,{label:t},o.createElement(d.a,Object.assign({component:"span",display:"inline-flex",className:(0,m.A)(p,n)},r),o.createElement(u.A,{size:18})))}},81330:(e,t,n)=>{"use strict";n.d(t,{t5:()=>st.t,M3:()=>Ct,wP:()=>yt,kv:()=>O.kv,cZ:()=>en,Vm:()=>q.Vm,GK:()=>q.GK,yi:()=>it.yi,Py:()=>Kt,aC:()=>O.aC,GQ:()=>yn.G,Rw:()=>q.Rw,bT:()=>ft,Sp:()=>Ae,pB:()=>Z,UG:()=>tn.U,W_:()=>O.W_,bQ:()=>j,Ot:()=>Vt,Ly:()=>q.Ly,pu:()=>Tt,rM:()=>_,c6:()=>ut.c,u7:()=>ht,Qn:()=>_e,fh:()=>vn,i2:()=>dt,A5:()=>Ye,NT:()=>yn.N,sS:()=>re,Z0:()=>O.Z0,$Z:()=>ie,X4:()=>G,HD:()=>q.HD,mo:()=>ln,KF:()=>Ft,oR:()=>et,v7:()=>nt,LR:()=>cn,x1:()=>ge,YX:()=>Ue.Y,U$:()=>it.U$,Lw:()=>Ve,O5:()=>Ie,f_:()=>gn,pM:()=>O.pM,LH:()=>at,Sg:()=>q.Sg,Z:()=>kt.Z,Bl:()=>it.Bl,a3:()=>se.a,Ju:()=>lt.J,V6:()=>u,pA:()=>it.pA});var o=n(50016),r=n(38325),a=n(38117),l=n(7371),i=n(62468),s=n(96554),c=n(20803),d=n(92374);function u(e){return{kind:"merged",rows:e.map((e=>function(e){return!!e&&"object"===typeof e&&("content"in e||"skip"in e||"rowSpan"in e||"colSpan"in e||"classNames"in e||"style"in e)}(e)?e:{content:e}))}}function m(e){return!!e&&"object"===typeof e&&"merged"===e.kind}function p(e){const t=e.reduce(((e,t)=>m(t.content)?Math.max(e,g(t.content.rows)):e),1),n=Array.from({length:t},(()=>[])),o=Array.from({length:t},(()=>Array.from({length:e.length},(()=>!1))));return e.forEach(((e,r)=>{if(!m(e.content))return void h({rows:n,occupiedSlots:o,rowIndex:0,columnIndex:r,cell:{key:e.key,content:e.content,rowSpan:t,colSpan:1,classNames:e.classNames,style:e.style}});const a=e.content.rows,l=Math.max(t-g(a),0);let i=0;a.forEach(((t,s)=>{var c,u;const m=s===a.length-1,p=(null!==(c=t.rowSpan)&&void 0!==c?c:1)+(m?l:0);var g,y,b,f,E;t.skip?function(e){const{occupiedSlots:t,rowIndex:n,columnIndex:o,rowSpan:r,key:a}=e;v({occupiedSlots:t,rowIndex:n,columnIndex:o,rowSpan:r,colSpan:1,key:a});for(let l=n;l<n+r;l+=1)if(!t[l][o])throw new Error('Merged cell "'.concat(a,'" is skipped without a covering colspan'))}({occupiedSlots:o,rowIndex:i,columnIndex:r,rowSpan:p,key:"".concat(e.key,"-").concat(s)}):h({rows:n,occupiedSlots:o,rowIndex:i,columnIndex:r,cell:{key:"".concat(e.key,"-").concat(s),content:t.content,rowSpan:p,colSpan:null!==(g=t.colSpan)&&void 0!==g?g:1,classNames:e.classNames||t.classNames?{cell:(0,d.A)(null===(y=e.classNames)||void 0===y?void 0:y.cell,null===(b=t.classNames)||void 0===b?void 0:b.cell)||void 0,text:(0,d.A)(null===(f=e.classNames)||void 0===f?void 0:f.text,null===(E=t.classNames)||void 0===E?void 0:E.text)||void 0}:void 0,style:e.style||t.style?{...e.style,...t.style}:void 0}});i+=null!==(u=t.rowSpan)&&void 0!==u?u:1}))})),n}function g(e){return e.reduce(((e,t)=>{var n;return e+(null!==(n=t.rowSpan)&&void 0!==n?n:1)}),0)}function h(e){const{rows:t,occupiedSlots:n,rowIndex:o,columnIndex:r,cell:a}=e;v({occupiedSlots:n,rowIndex:o,columnIndex:r,rowSpan:a.rowSpan,colSpan:a.colSpan,key:a.key});for(let l=o;l<o+a.rowSpan;l+=1)for(let e=r;e<r+a.colSpan;e+=1)if(n[l][e])throw new Error('Merged cell "'.concat(a.key,'" overlaps an existing spanning cell'));for(let l=o;l<o+a.rowSpan;l+=1)for(let e=r;e<r+a.colSpan;e+=1)n[l][e]=!0;t[o].push(a)}function v(e){var t,n;const{occupiedSlots:o,rowIndex:r,columnIndex:a,rowSpan:l,colSpan:i,key:s}=e,c=o.length,d=null!==(t=null===(n=o[0])||void 0===n?void 0:n.length)&&void 0!==t?t:0;if(r+l>c)throw new Error('Merged cell "'.concat(s,'" exceeds the available row count'));if(a+i>d)throw new Error('Merged cell "'.concat(s,'" exceeds the available column count'))}const y={tableWrapper:"DataTable_tableWrapper__SBRSV",table:"DataTable_table__c7Ap5",headerCell:"DataTable_headerCell__HIAW2",bodyCell:"DataTable_bodyCell__8yfDY",rowGroup:"DataTable_rowGroup__CH7Wa",pagination:"DataTable_pagination__NVYMN",expandedRow:"DataTable_expandedRow__xA4EE",expandRow:"DataTable_expandRow__ZUQ0e"};var b=n(41436),f=n(51599),E=n(74655),C=n(43258),A=n(56480),S=n(27705),w=n(50767),P=n(29731),I=n(25104),x=n(49349),D=n(70764),T=n(8416);const k="EmptyResult_iconCircle__xoqAG",B="EmptyResult_header__GasXc",F="EmptyResult_text__sRYJT",_=e=>{let{header:t,text:n}=e;const{t:r}=(0,P.Bd)("global"),a=(0,x.xd)();return o.createElement(D.B,{mt:42,mb:60,align:"center"},o.createElement("div",{className:k,style:{backgroundColor:(0,T.B)(a.colors.blue[4],.06)}},o.createElement(I.A,{size:32,color:a.colors.blue[4]})),o.createElement(A.E,{className:B},t||r("emptyResult.header")),o.createElement(A.E,{className:F},n||r("emptyResult.text")))};var N=n(78614),R=n(34777),L=n(17331),M=n(64413),O=n(83572);const z=25;
1function j(e){let{columns:t,data:n,idField:r,page:a,pageSize:l=z,totalCount:d,childrenField:u,loading:m,testID:g,columnVisibility:h,initialState:v,emptyResult:w,onPageChange:I,onRowClick:x,sortCol:D,sortDir:T,onSortChange:k,classNames:B,meta:F,isInfinite:N=!1}=e;const[R,L]=(0,o.useState)({pageIndex:0,pageSize:l}),[M,j]=(0,o.useState)({}),U=!!I,G=!!k,Y=(0,o.useMemo)((()=>D?[{id:D,desc:"desc"===T}]:[]),[D,T]),Q=(0,i.N4)({columns:t,data:n,meta:F,initialState:v,enableSorting:G,sortDescFirst:!1,defaultColumn:{size:0,minSize:0,maxSize:0},getCoreRowModel:(0,s.HT)(),getExpandedRowModel:(0,s.D0)(),manualPagination:U||N,...U||N?{}:{getPaginationRowModel:(0,s.kW)()},...u?{getSubRows:e=>function(e,t){const n=e[t];return Array.isArray(n)&&n.length>0?n:void 0}(e,u)}:{},...r?{getRowId:(e,t,n)=>function(e,t,n,o){const r=e[o];if(null===r||void 0===r)return n?"".concat(n,".").concat(t):String(t);return String(r)}(e,t,null===n||void 0===n?void 0:n.id,r)}:{},onExpandedChange:j,onPaginationChange:L,onSortingChange:e=>{if(!k)return;const t="function"===typeof e?e(Y):e;t.length>0?k(t[0].id,t[0].desc?"desc":"asc"):k(null,null)},manualSorting:G,paginateExpandedRows:U||N,state:{expanded:M,pagination:R,...void 0!==h?{columnVisibility:h}:{},...G?{sorting:Y}:{}}}),{t:q}=(0,P.Bd)("global"),K=U?Math.ceil(d/l):Math.max(Q.getPageCount(),1),J=U?(null!==a&&void 0!==a?a:1)-1:R.pageIndex,Z=J*l+1,X=Math.min((J+1)*l,d),$=x?y.rowGroup:void 0,ee=N&&n.length<d,te=N&&!!m&&n.length>0,ne=Math.ceil(n.length/l)+1,{ref:oe,entry:re}=(0,c.v)({threshold:0,rootMargin:"200px"}),ae=(0,o.useRef)(!1);return(0,o.useEffect)((()=>{const e=!(null===re||void 0===re||!re.isIntersecting);e&&!ae.current&&ee&&!m&&(null===I||void 0===I||I(ne)),ae.current=e}),[null===re||void 0===re?void 0:re.isIntersecting,ee,m,I,ne]),!m||N&&0!==n.length?Q.getRowModel().rows.length?o.createElement("div",{"data-testid":g},o.createElement("div",{className:y.tableWrapper},o.createElement("table",{className:y.table},o.createElement("colgroup",null,Q.getHeaderGroups()[0].headers.map((e=>o.createElement("col",{key:e.id,style:V(e.column.columnDef)})))),o.createElement("thead",null,Q.getHeaderGroups().map((e=>o.createElement("tr",{key:e.id},e.headers.map((e=>o.createElement("th",{key:e.id,className:y.headerCell,style:V(e.column.columnDef),colSpan:e.colSpan},e.isPlaceholder?null:o.createElement(f.Y,{gap:2,onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,style:{alignItems:"flex-start",flexWrap:"nowrap",cursor:e.column.getCanSort()?"pointer":"default"}},function(e){if("string"===typeof e||"number"===typeof e)return o.createElement(A.E,{fw:600},e);return e}((0,i.Kv)(e.column.columnDef.header,e.getContext())),e.column.getCanSort()&&o.createElement(H,{direction:e.column.getIsSorted()}))))))))),Q.getRowModel().rows.map((e=>{const t=p(e.getVisibleCells().map((e=>{var t,n;return{key:e.id,content:W(e),classNames:(null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.classNames)||{cell:null===(n=e.column.columnDef.meta)||void 0===n?void 0:n.className},style:V(e.column.columnDef)}}))),n=e.depth>0,r="function"===typeof(null===B||void 0===B?void 0:B.row)?B.row(e.original):null===B||void 0===B?void 0:B.row,a=[$,r].filter(Boolean).join(" ")||void 0;return o.createElement("tbody",{key:e.id,className:a,onClick:x?()=>x(e.original):void 0},t.map(((t,r)=>o.createElement("tr",{key:"".concat(e.id,"-").concat(r),className:n?y.expandedRow:void 0},t.map(((t,a)=>{var l,i;return o.createElement("td",{key:t.key,className:null!==(l=t.classNames)&&void 0!==l&&l.cell?"".concat(y.bodyCell," ").concat(t.classNames.cell):y.bodyCell,style:t.style,colSpan:t.colSpan,rowSpan:t.rowSpan,"data-expanded-mark":!(!n&&!e.getIsExpanded()||0!==r||0!==a)||void 0},function(e,t){if(!e)return o.createElement(A.E,{className:t},"\xa0");if("string"===typeof e||"number"===typeof e)return o.createElement(A.E,{className:t},e);return e}(t.content,null===(i=t.classNames)||void 0===i?void 0:i.text))}))))))})))),N?(ee||te)&&o.createElement(b.o,{ref:oe,mt:16},o.createElement(E.a,{type:"dots"})):o.createElement(C.s,{className:y.pagination,mt:16},o.createElement(A.E,{c:"dimmed"},q("common.table.pagination",{from:Z,to:X,total:d})),K>1&&o.createElement(S.d,{withEdges:!0,total:K,value:U?null!==a&&void 0!==a?a:1:R.pageIndex+1,onChange:U?e=>I(e):e=>Q.setPageIndex(e-1)}))):void 0!==w?w:o.createElement(_,null):o.createElement(b.o,null,o.createElement(O.aC,null))}function W(e){return function(e){const{render:t,context:n,getValue:o}=e;return t?"function"===typeof t?t(n):t:o()}({render:e.column.columnDef.cell,context:e.getContext(),getValue:e.getValue})}function V(e){return{...e.size?{width:e.size}:{},...e.minSize?{minWidth:e.minSize}:{},...e.maxSize?{maxWidth:e.maxSize}:{}}}function H(e){let{direction:t}=e;const n="asc"===t?o.createElement(N.A,{size:16,color:M.F.gray9}):"desc"===t?o.createElement(R.A,{size:16,color:M.F.gray9}):o.createElement(L.A,{size:16,color:M.F.gray5});return o.createElement(w.a,{style:{flexShrink:0,marginTop:4}},n)}const U=[{id:"inv-1001",number:"INV-1001",customerName:"Northwind Builders",status:"Processing",processingAmou
1nt:12500,paidAmount:5400,remainingAmount:7100,dueDate:"03/22/2026",childInvoices:[{id:"inv-1001-a",number:"INV-1001-A",customerName:"Northwind Builders",status:"Scheduled",processingAmount:3200,paidAmount:0,remainingAmount:3200,dueDate:"03/28/2026"},{id:"inv-1001-b",number:"INV-1001-B",customerName:"Northwind Builders",status:"Processing",processingAmount:1800,paidAmount:450,remainingAmount:1350,dueDate:"03/30/2026"}]},{id:"inv-1002",number:"INV-1002",customerName:"Lakeside Electric",status:"Partial",processingAmount:8400,paidAmount:3e3,remainingAmount:5400,dueDate:"03/26/2026"},{id:"inv-1003",number:"INV-1003",customerName:"Atlas Roofing",status:"Past Due",processingAmount:6700,paidAmount:1200,remainingAmount:5500,dueDate:"03/10/2026",childInvoices:[{id:"inv-1003-a",number:"INV-1003-A",customerName:"Atlas Roofing",status:"Disputed",processingAmount:900,paidAmount:0,remainingAmount:900,dueDate:"03/17/2026"}]},{id:"inv-1004",number:"INV-1004",customerName:"Greenline Plumbing",status:"Paid",processingAmount:4200,paidAmount:4200,remainingAmount:0,dueDate:"03/01/2026"},{id:"inv-1005",number:"INV-1005",customerName:"Hilltop Concrete",status:"Processing",processingAmount:15350,paidAmount:4e3,remainingAmount:11350,dueDate:"03/29/2026"},{id:"inv-1006",number:"INV-1006",customerName:"Summit HVAC",status:"Partial",processingAmount:9100,paidAmount:2600,remainingAmount:6500,dueDate:"04/02/2026"}];function G(){const e=(0,o.useMemo)((()=>[{accessorKey:"number",header:"Invoice #",cell:e=>{let{getValue:t,row:n}=e;return o.createElement(Y,{canExpand:n.getCanExpand(),depth:n.depth,invoiceNumber:t(),isExpanded:n.getIsExpanded(),onToggle:n.getToggleExpandedHandler()})}},{accessorKey:"customerName",header:"Customer",cell:e=>e.getValue()},{id:"amounts",header:"Amounts",cell:e=>{let{row:t}=e;return u(["Processing: ".concat(Q(t.original.processingAmount)),"Paid: ".concat(Q(t.original.paidAmount)),{content:"Remaining: ".concat(Q(t.original.remainingAmount)," due ").concat(t.original.dueDate),rowSpan:2,colSpan:2}])}},{id:"timeline",header:"Timeline",cell:e=>{let{row:t}=e;return u([{content:"Status: ".concat(t.original.status),rowSpan:2},{skip:!0,rowSpan:2}])}}]),[]);return o.createElement(l.A,{style:{width:"100%"}},o.createElement(a.A,{style:{color:"#2F4858",fontFamily:"Inter, sans-serif",fontSize:24,fontWeight:"600",marginBottom:8}},"TanStack invoice table demo"),o.createElement(a.A,{style:{color:"#5F788A",fontFamily:"Inter, sans-serif",fontSize:14,marginBottom:16}},"Expand parent invoices to reveal child invoices beneath them. Amounts and timeline still use grouped cells with custom row spans and a merged two-column summary row."),o.createElement(j,{columns:e,childrenField:"childInvoices",data:U,totalCount:U.length,idField:"id",pageSize:3,testID:"invoice-table-demo"}))}function Y(e){let{canExpand:t,depth:n,invoiceNumber:a,isExpanded:l,onToggle:i}=e;return"web"!==r.A.OS?"".concat("  ".repeat(n)).concat(t?l?"\u25be ":"\u25b8 ":"").concat(a):o.createElement("div",{style:{alignItems:"center",display:"flex",gap:8,paddingLeft:16*n}},t?o.createElement("button",{"aria-label":l?"Collapse ".concat(a):"Expand ".concat(a),onClick:i,style:{background:"transparent",border:"none",color:"#2F4858",cursor:"pointer",fontSize:14,padding:0},type:"button"},l?"\u25be":"\u25b8"):o.createElement("span",{"aria-hidden":"true",style:{display:"inline-block",width:8}}),o.createElement("span",null,a))}function Q(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2}).format(e)}var q=n(74967);const K="CornerBadge_root__leQBK",J="CornerBadge_label__ZUIyx",Z=n(69267).E.withProps({classNames:{root:K,label:J}});var X=n(29458),$=n(67769),ee=n(36883);const te={root:"IconLabel_root__DN2Gc",icon:"IconLabel_icon__c8QrT",label:"IconLabel_label__wXGt6"},ne="IconLabel",oe={size:"md",iconPosition:"left"},re=(0,X.P9)(((e,t)=>{const n=(0,$.Y)(ne,oe,e),{icon:r,iconPosition:a,size:l,labelProps:i,children:s,classNames:c,...u}=n,m=(0,ee.I)({name:ne,classes:te,classNames:c,props:n,...u}),p=o.isValidElement(r)?o.cloneElement(r,{"data-size":l,...m("icon"),className:(0,d.A)(r.props.className,m("icon").className),style:{...r.props.style,...m("icon").style}}):r;return o.createElement(w.a,Object.assign({ref:t,w:"fit-content"},u),o.createElement(f.Y,Object.assign({wrap:"nowrap",mod:{size:l}},m("root"),{grow:!1}
1),p&&"left"===a&&p,o.createElement(A.E,Object.assign({span:!0,size:l},i,m("label")),s),p&&"right"===a&&p))}));re.displayName=ne;const ae="InfoLabel_root__+vGMz",le="InfoLabel_icon__qH4Tn",ie=e=>{let{children:t,...n}=e;return o.createElement(re,Object.assign({icon:o.createElement(I.A,null),classNames:{root:ae,icon:le}},n),t)};var se=n(43873),ce=n(89077),de=n(1664);const ue={icon:"PhoneLabel_icon__ZSlrX",label:"PhoneLabel_label__uY4gm"},me="PhoneLabel",pe={mode:"icon"},ge=(0,X.P9)(((e,t)=>{const n=(0,$.Y)(me,pe,e),{phone:r,mode:a,classNames:l,styles:i,unstyled:s,vars:c,attributes:d,className:u,style:m,...p}=n,g=(0,ee.I)({name:me,classes:ue,props:n,className:u,style:m,classNames:l,styles:i,unstyled:s,vars:c,attributes:d}),h=(e=>{if(!e)return null;const t=(0,ce.L)(e,"US").formatInternational().slice(3);return"(".concat(t.slice(0,3),")").concat(t.slice(3))})(r);if(!h)return null;const v=()=>window.location.href="tel:".concat(r);if("text"===a){const e=g("root");return o.createElement(A.E,Object.assign({ref:t,component:"div"},p,{onClick:v,className:e.className,style:{...e.style,cursor:"pointer"}}),h)}const y=g("label");return o.createElement(re,Object.assign({ref:t,icon:o.createElement(de.A,Object.assign({size:18},g("icon")))},g("root"),p),o.createElement(A.E,{span:!0,onClick:v,className:y.className,style:{...y.style,cursor:"pointer"}},h))}));ge.displayName=me,ge.classes=ue;var he=n(57194),ve=n(25183),ye=n(23588),be=n(27008),fe=n(89947);const Ee="CopyLabel_root__O+5iu",Ce="CopyLabel_icon__xV3lA",Ae=e=>{let{value:t,displayValue:n,className:r,...a}=e;const{t:l}=(0,P.Bd)("global");return t?o.createElement(A.E,Object.assign({component:"div",fw:500,className:(0,d.A)(Ee,r)},a),null!==n&&void 0!==n?n:t,o.createElement(he.i,{value:t,timeout:4e3},(e=>{let{copied:t,copy:n}=e;return o.createElement(ve.m,{label:l(t?"common.copyLink.copied":"common.copyLink.copy"),w:"max-content",position:"top"},o.createElement(ye.M,{color:t?"teal":"gray",variant:"subtle",onClick:n,size:"xs",className:Ce},t?o.createElement(be.A,{size:18}):o.createElement(fe.A,{size:18})))}))):null};var Se=n(95011),we=n(92087),Pe=n(7294);const Ie=e=>{let{value:t,...n}=e;const[r,{toggle:a}]=(0,Se.j)(!1);return t?o.createElement(f.Y,{gap:4,wrap:"nowrap"},o.createElement(A.E,n,r?t:"\u2022".repeat(t.length)),o.createElement(ye.M,{variant:"subtle",color:"gray",size:"sm",onClick:a,"aria-label":r?"Hide":"Show"},r?o.createElement(we.A,{size:16}):o.createElement(Pe.A,{size:16}))):null},xe="FilterBar_root__s09Vd",De="FilterBar_item__p9sj-",Te="FilterBar_growItem__L3G3o",ke="FilterBar_sticky__m9qtd",Be="FilterBar_stuck__kKCne",Fe="FilterBar_stickyGuard__SzioX",_e=e=>{let{children:t,sticky:n=!1,className:r,...a}=e;const[l,i]=o.useState(null),s=o.useRef(null),{ref:u,entry:m}=(0,c.v)({root:l,threshold:0,rootMargin:"0px 0px 0px 0px"}),p=n&&null!=m&&!m.isIntersecting;return o.useEffect((()=>{n&&s.current?i(Re(s.current)):i(null)}),[n]),o.createElement(o.Fragment,null,n&&o.createElement("div",{ref:u,className:Fe}),o.createElement(C.s,Object.assign({ref:s,direction:"row",wrap:"wrap",className:(0,d.A)(xe,n&&ke,n&&p&&Be,r),mod:{stuck:p}},a),o.Children.toArray(t).map(((e,t)=>{const n=Ne(e),r=(0,o.isValidElement)(e)&&null!=e.key?e.key:t;return o.createElement("div",{key:r,className:(0,d.A)(De,n&&Te)},e)}))))},Ne=e=>!!o.isValidElement(e)&&Boolean(e.props["data-filter-grow"]),Re=e=>{let t=e.parentElement;for(;t;){const{overflowY:e}=window.getComputedStyle(t);if("auto"===e||"scroll"===e||"overlay"===e)return t;t=t.parentElement}return null};var Le=n(22899),Me=n(19003),Oe=n(93427),ze=n(55816);const je="SearchField_input__5rpkO",We="SearchField_icon__iTIwd",Ve=e=>{let{value:t,placeholder:n,iconPosition:r="left",onChange:a,...l}=e;const i=(0,o.useRef)(null),[s,c]=(0,o.useState)(t),[d]=(0,Me.o)(s,700);(0,Oe.C)((()=>{a(d)}),[d]);const u=o.createElement(ze.A,{size:21,onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.focus()},className:We});
1return o.createElement(Le.k,Object.assign({autoFocus:!0,type:"search",autoComplete:"off",ref:i,value:s,placeholder:n,classNames:{input:je},leftSection:"left"===r?u:void 0,leftSectionPointerEvents:"left"===r?"all":void 0,rightSection:"right"===r?u:void 0,rightSectionPointerEvents:"right"===r?"all":void 0,onChange:e=>c(e.currentTarget.value)},l))},He={root:"GroupedPropertyGrid_root__qRZtL",sectionHeader:"GroupedPropertyGrid_sectionHeader__ZE9IJ",labelCell:"GroupedPropertyGrid_labelCell__v91nL",propertyGridSidebarJagged:"GroupedPropertyGrid_propertyGridSidebarJagged__Al8HR",labelColumnSidebarJagged:"GroupedPropertyGrid_labelColumnSidebarJagged__Zk1rh",valueColumnSidebarJagged:"GroupedPropertyGrid_valueColumnSidebarJagged__AfhFc"};var Ue=n(84563);const Ge="GroupedPropertyGrid";const Ye=(0,X.P9)((e=>{const t=(0,$.Y)(Ge,null,e),{groups:n,withLastDivider:r,variant:a,propertyGridProps:l,...i}=t,s=(0,ee.I)({name:Ge,classes:He,props:t,...i});return o.createElement(w.a,Object.assign({},s("root"),i),n.map(((e,t)=>{if(!e)return null;const i=t===n.length-1;return o.createElement("div",{key:t},o.createElement(A.E,{variant:a,className:He.sectionHeader},e.title),"content"in e?e.content:o.createElement(w.a,Object.assign({variant:a},s("group")),o.createElement(Ue.Y,Object.assign({items:e.items,withLastDivider:!i||r,alignValue:"sidebar"===a?"left":void 0},l,{classNames:{..."sidebar"===a?{root:He.propertyGridSidebarJagged,labelColumn:He.labelColumnSidebarJagged,valueColumn:He.valueColumnSidebarJagged}:{labelCell:He.labelCell},...null===l||void 0===l?void 0:l.classNames}}))))})))}));var Qe=n(97219),qe=n(75226),Ke=n(38656);const Je="OverviewCard_card__8bZOG",Ze="OverviewCard_container__rRkTd",Xe="OverviewCard_label__FGjqN",$e="OverviewCard_value__FRpq9",et=e=>{let{item:t,loading:n}=e;const r=t.icon;return o.createElement(Qe.Z,{withBorder:!0,className:Je},o.createElement(f.Y,{className:Ze},o.createElement(D.B,{gap:0},o.createElement(se.a,{label:t.label,tooltip:t.tooltip,className:Xe,tooltipPosition:"top-end"}),n&&!t.isStatic?o.createElement(qe.E,{height:20,mt:16}):o.createElement(A.E,Object.assign({className:$e,mt:8},t.valueProps),t.value)),r&&o.createElement(r,Object.assign({size:24,color:Ke.J.primaryColor},t.iconProps))))};var tt=n(65190);const nt=e=>{let{items:t,loading:n,...r}=e;return o.createElement(tt.I,r,t.map((e=>e?o.createElement(et,{key:e.label,item:e,loading:n}):null)))},ot="SidebarPropertyGroup_labelColumn__rREVG",rt="SidebarPropertyGroup_valueColumn__sWEaD",at=Ue.Y.withProps({classNames:{valueColumn:rt,labelColumn:ot},alignValue:"left",withLastDivider:!0,mb:32});var lt=n(76223),it=n(62551),st=n(72305),ct=n(36684);const dt=e=>{let{onClick:t,label:n,...r}=e;const{t:a}=(0,P.Bd)("global");return o.createElement(st.t,Object.assign({leftSection:o.createElement(w.a,{mt:-1},o.createElement(ct.A,{size:20})),onClick:t},r),null!==n&&void 0!==n?n:a("goBack"))};var ut=n(38176),mt=n(85683);const pt={root:"ExpanderLink_root__aEtWP",expander:"ExpanderLink_expander__5FUcP"},gt="ExpanderLink",ht=(0,X.P9)(((e,t)=>{const n=(0,$.Y)(gt,null,e),{children:r,expanded:a,defaultExpanded:l,onToggle:i,left:s,disabled:c,classNames:d,styles:u,unstyled:m,vars:p,attributes:g,className:h,style:v,...y}=n,b=(0,ee.I)({name:gt,classes:pt,props:n,className:h,style:v,classNames:d,styles:u,unstyled:m,vars:p,attributes:g}),[f,E]=(0,mt.Z)({value:a,defaultValue:l,finalValue:!1,onChange:i}),C=o.createElement(ut.c,{state:f,onToggle:E,className:b("expander").className});return o.createElement(st.t,Object.assign({ref:t},b("root"),y,{disabled:c,leftSection:s?C:void 0,rightSection:s?void 0:C,onClick:()=>E(!f)}),r)}));ht.displayName=gt,ht.classes=pt;var vt=n(40252);const yt=(0,o.forwardRef)(((e,t)=>{let{right:n,children:r,...a}=e;const l=o.createElement(vt.A,{size:16,stroke:3,style:{marginTop:1}});return o.createElement(st.t,Object.assign({ref:t,leftSection:n?void 0:l,rightSection:n?l:void 0},a),r)}));yt.displayName="AddLink";var bt=n(58876);const ft=e=>{let{email:t,...n}=e;const{t:r}=(0,P.Bd)("global"),a=t?"mailto:".concat(t):bt._g.support;return o.createElement(st.t,Object.assign({href:a,target:"_blank",rel:"noopener noreferrer"},n),t||r("contact-email"))};var Et=n(4557);const Ct=(0,o.forwardRef)(((e,t)=>{let{left:n,right:r,children:a,variant:l="light",...i}=e;const s=o.createElement(vt.A,{size:16,stroke:3});return o.createElement(Et.$,Object.assign({ref:t,variant:l,leftSection:n?s:void 0,rightSection:r?s:void 0},i),a)}));Ct.displayName="AddButton";var At=n(83639),St=n(95199),wt=n(48711);const Pt="v2-file",It=(e,t)=>
1(0,St.j)({queryKey:[Pt,"invoiceDocument",e],queryFn:()=>wt.A.invoiceDocument(e),...t});var xt=n(12344),Dt=n(38767);const Tt=e=>{let{invoiceId:t,fileName:n,children:r,disabled:a,withIcon:l=!0,...i}=e;const{data:s,isFetching:c,refetch:d}=(0,xt.I)({...It({invoiceId:t||""}),enabled:!1});return(0,o.useEffect)((()=>{null!==s&&void 0!==s&&s.url&&(0,Dt.mm)(s.url,{},null!==n&&void 0!==n?n:void 0)}),[s,n]),t?o.createElement(st.t,Object.assign({leftSection:l&&o.createElement(w.a,{mt:-2},o.createElement(At.A,{size:20})),onClick:()=>d(),disabled:a||c||!t},i),null!==r&&void 0!==r?r:n):null};Tt.displayName="DownloadLink";var kt=n(5685),Bt=n(88811);function Ft(e){let{value:t,options:n,closeOnSelect:r=!1,renderDisplayValue:a,onChange:l,onOptionSelect:i,...s}=e;const c=null!==a&&void 0!==a?a:e=>e.map((e=>{var t;return null!==(t=e.displayLabel)&&void 0!==t?t:e.label})).join(", ");return o.createElement(Bt.g,Object.assign({},s,{options:n,value:t,renderDisplayValue:c,onOptionSelect:(e,o)=>{if(!1===(null===i||void 0===i?void 0:i(e,o)))return;const a=t.includes(e.value)?t.filter((t=>t!==e.value)):[...t,e.value];l(a,n.filter((e=>a.includes(e.value)))),r&&o.closeDropdown()}}))}var _t=n(23233),Nt=n(75626),Rt=n(83186),Lt=n(90213),Mt=n.n(Lt),Ot=n(31604),zt=n.n(Ot);const jt="MM/DD/YYYY",Wt="custom",Vt=e=>{let{items:t,selectedIndex:n=0,withCustomRange:r,minDate:a,maxDate:l,testId:i,onSelect:s,...c}=e;const{t:d}=(0,P.Bd)("global"),[u,m]=(0,o.useState)(n.toString()),[p,g]=(0,o.useState)(!1),[h,v]=(0,o.useState)(null),[y,b]=(0,o.useState)(null),[E,C]=(0,o.useState)(d("common.dateRangeSelect.customDates")),A=[...t.map(((e,t)=>{const{amount:n,absAmount:o,dateRangeKind:r}=Ht(e),a=n>0?"next":"last";let l="";return 1===o&&("years"===r?l=d("common.dateRangeSelect.".concat(a,"-year")):"months"===r&&(l=d("common.dateRangeSelect.".concat(a,"-month")))),l||(l=d("common.dateRangeSelect.".concat(a,"-n-").concat(r),{[r]:o})),{value:t.toString(),label:l}}))];r&&A.push({value:Wt,label:d("common.dateRangeSelect.customDates"),displayLabel:E});const S=()=>g(!1);return o.createElement(_t.A,{opened:!!r&&p,onDismiss:S,position:"bottom-start",offset:4,shadow:"md",zIndex:300,middlewares:{flip:!0,shift:{padding:8}},transitionProps:{duration:0}},o.createElement(_t.A.Target,null,o.createElement("div",null,o.createElement(kt.Z,Object.assign({comboboxProps:{withinPortal:!0},maxDropdownHeight:800,options:A,testId:i,value:u,miw:180},c,{onDropdownOpen:()=>{g(!1)},onOptionSelect:(e,t)=>e.value!==Wt||(t.closeDropdown(),g(!0),!1),onChange:e=>{if(null===e)return;m(e);const n=parseInt(e,10),o=t[n],{amount:r,dateRangeKind:a}=Ht(o),l=Mt()().toDate(),i=Mt()().add(r,a).toDate(),c=r>0?{from:l,to:i}:{from:i,to:l},d={from:Mt()(c.from).format(jt),to:Mt()(c.to).format(jt)};s({index:n,item:o,range:c,formattedRange:d})}})))),o.createElement(_t.A.Dropdown,{p:"md"},o.createElement(D.B,{gap:"sm",w:300},o.createElement(Ut,{value:h,label:d("TabTransactions.from"),maxDate:null!==y&&void 0!==y?y:l,onChange:e=>v(e?Mt()(e).toDate():null)}),o.createElement(Ut,{value:y,label:d("TabTransactions.to"),minDate:null!==h&&void 0!==h?h:a,maxDate:l,onChange:e=>b(e?Mt()(e).toDate():null)}),o.createElement(f.Y,{justify:"flex-end",gap:"xs",mt:16},o.createElement(Et.$,{variant:"subtle",color:"gray",size:"compact-md",onClick:S},d("cancel")),o.createElement(Et.$,{size:"compact-md",disabled:!h&&!y,onClick:()=>{const e=null!==h&&void 0!==h?h:a,n=null!==y&&void 0!==y?y:l,o=e?Mt()(e).format(jt):"",r=n?Mt()(n).format(jt):"",i="".concat(o||"..."," \u2013 ").concat(r||"...");C(i),m(Wt),g(!1),s({index:t.length,item:0,range:{from:e,to:n},formattedRange:{from:e?Mt()(e).format(jt):"",to:n?Mt()(n).format(jt):""}})}},d("TabTransactions.apply_dates"))))))},Ht=e=>{const t=zt()(e)?e:e[0];return{amount:t,absAmount:Math.abs(t),dateRangeKind:zt()(e)?"days":e[1]}},Ut=Nt.t.withProps({clearable:!0,valueFormat:jt,popoverProps:{withinPortal:!1,shadow:"md"},rightSection:o.createElement(Rt.A,{size:"24"})});var Gt=n(40871),Yt=n(95778);const Qt={empty:"AsyncAutocomplete_empty__Y7mP-",footer:"AsyncAutocomplete_footer__xlQiP"},qt=300;function Kt(e){var t;let{value:n,displayValue:r,inputRef:a,rightSection:l,maxDropdownHeight:i=qt,comboboxProps:s,fetchOptions:c,getOptionValue:d,renderOption:u,onBlur:m,onFocus:p,onSelect:g,onSearchChange:h,onTextChange:v,debounceMs:y=500,minQueryLength:b=3,initialFetchOnOpen:f=!1,dropdownFooter:C,emptyMessage:S,clearOnSelect:w=!1,...P}=e;const{disabled:I,readOnly:x,autoFocus:D,...T}=P,k=(0,Gt.B)({onDropdownClose:()=>k.resetSelectedOption()}),B=null!==(t=null!==r&&void 0!==r?r:n)&&void 0!==t?t:"",[F,_]=(0,o.useState)(B),[N,R]=(0,o.useState)([]),[L,M]=(0,o.useState)(!1),[O,z]=(0,o.useState)(!1),[j]=(0,Me.o)(F,y),W=(0,o.useRef)(!1),V=(0,o.useRef)(c);V.current=c,(0,o.useEffect)((()=>{W.current||_(B)}),[B]),(0,o.useEffect)((()=>{null===h||void 0===h||h(j)}),[j,h]),(0,o.useEffect)((()=>
1{if(!k.dropdownOpened)return;const e=j.trim(),t=f&&""===e;if(e.length<b&&!t)return R([]),void z(!1);let n=!1;return M(!0),V.current(e).then((e=>{n||R(e)})).catch((()=>{n||R([])})).finally((()=>{n||(M(!1),z(!0))})),()=>{n=!0}}),[j,k.dropdownOpened,b,f]);const H=(0,o.useMemo)((()=>new Map(N.map((e=>[d(e),e])))),[N,d]),U=j.trim(),G=!L&&0===N.length&&U.length>=b&&!!S,Y=!!C&&O,Q=!(N.length>0)&&!G&&!Y;return o.createElement(Yt.G,Object.assign({},s,{store:k,onOptionSubmit:e=>{const t=H.get(e);t&&(g(e,t),_(w?"":e),k.closeDropdown())},transitionProps:{duration:1}}),o.createElement(Yt.G.Target,null,o.createElement(Le.k,Object.assign({size:"md"},T,{"data-autofocus":D||void 0,ref:a,rightSection:L?o.createElement(E.a,{size:"xs"}):l,value:F,onChange:e=>{const t=e.currentTarget.value;_(t),null===v||void 0===v||v(t),x||I||(k.openDropdown(),k.updateSelectedOptionIndex())},onFocus:e=>{W.current=!0,x||I||k.openDropdown(),null===p||void 0===p||p(e)},onBlur:e=>{W.current=!1,k.closeDropdown(),_(B),null===m||void 0===m||m(e)}}))),o.createElement(Yt.G.Dropdown,{hidden:Q},o.createElement(Yt.G.Options,{mah:i,style:{overflowY:"auto"}},N.map((e=>{const t=d(e);return o.createElement(Yt.G.Option,{key:t,value:t},u?u(e):o.createElement(A.E,null,t))})),G&&o.createElement("div",{className:Qt.empty},S)),Y&&o.createElement(Yt.G.Footer,{className:Qt.footer,onMouseDown:e=>e.preventDefault()},C)))}var Jt,Zt=n(84297);const Xt=null===(Jt=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))||void 0===Jt?void 0:Jt.set,$t=/[MDYHmsA]/;function en(e){let{valueFormat:t="MM/DD/YYYY",placeholder:n,onKeyDown:r,onBlur:a,onChange:l,fixOnBlur:i=!1,...s}=e;const c=(0,o.useMemo)((()=>function(e){const t=[];let n="/";for(let o=0;o<e.length;o++){const r=e[o];$t.test(r)||(t.push(o),n=r)}return{positions:t,separator:n}}(t)),[t]);return o.createElement(Zt.J,Object.assign({valueFormat:t,placeholder:null!==n&&void 0!==n?n:t,highlightToday:!0,defaultDate:new Date,fixOn
1Blur:i},s,{onChange:l,onKeyDown:e=>{if(null===r||void 0===r||r(e),e.defaultPrevented)return;if(e.ctrlKey||e.metaKey||e.altKey)return;if(1!==e.key.length||!/[0-9]/.test(e.key))return;const t=e.currentTarget,{selectionStart:n,selectionEnd:o,value:a}=t;if(null==n||null==o)return;if(n!==o)return;if(n!==a.length)return;if(!c.positions.includes(n))return;e.preventDefault();const l="".concat(a).concat(c.separator).concat(e.key);null===Xt||void 0===Xt||Xt.call(t,l),t.dispatchEvent(new Event("input",{bubbles:!0})),t.setSelectionRange(l.length,l.length)},onBlur:e=>{if(null===a||void 0===a||a(e),!1===i){const n=e.currentTarget.value;if(n){const e=Mt()(n,t,!0);null===l||void 0===l||l(e.isValid()?e.format("YYYY-MM-DD"):null)}else null===l||void 0===l||l(null)}}}))}var tn=n(52085),nn=n(73243),on=n(73478);const rn="MM/YYYY",an="YYYY-MM-DD",ln=(0,o.forwardRef)(((e,t)=>{let{value:n,defaultValue:r,onChange:a,placeholder:l,onFocus:i,onBlur:s,onClick:c,onKeyDown:d,minDate:u,maxDate:m,...p}=e;const[g,h]=(0,mt.Z)({value:null!==n&&void 0!==n?n:void 0,defaultValue:null!==r&&void 0!==r?r:void 0,finalValue:"",onChange:a}),[v,{open:y,close:b}]=(0,Se.j)(!1),f=o.useMemo((()=>{const e=Mt()(g,rn,!0);return e.isValid()?e.format(an):null}),[g]),E=o.useMemo((()=>{if(f)return f;let e=Mt()();return u&&e.isBefore(u,"month")&&(e=Mt()(u)),m&&e.isAfter(m,"month")&&(e=Mt()(m)),e.format(an)}),[f,u,m]);return o.createElement(_t.A,{opened:v,position:"bottom-start",offset:4,trapFocus:!1,withinPortal:!0},o.createElement("div",null,o.createElement(_t.A.Target,null,o.createElement("div",null,o.createElement(on.K9,Object.assign({format:"##/####",customInput:Le.k,getInputRef:t,value:g,placeholder:null!==l&&void 0!==l?l:rn,onValueChange:e=>h(e.formattedValue),onFocus:e=>{null===i||void 0===i||i(e),y()},onClick:e=>{null===c||void 0===c||c(e),y()},onBlur:e=>{null===s||void 0===s||s(e),b()},onKeyDown:e=>{null===d||void 0===d||d(e),"Escape"===e.key&&b()}},p))))),o.createElement(_t.A.Dropdown,{p:0,onMouseDown:e=>e.preventDefault()},o.createElement(nn.B,{value:f,defaultDate:E,onChange:e=>{e&&h(Mt()(e,an).format(rn)),b()},minDate:u,maxDate:m})))}));ln.displayName="MonthYearInput";var sn=n(37525);const cn=(0,o.forwardRef)(((e,t)=>{let{format:n="###-###-####",value:r,defaultValue:a,onChange:l,onPaste:i,...s}=e;const[c,d]=(0,o.useState)((()=>dn(void 0===r?a:r)));(0,o.useEffect)((()=>{void 0!==r&&d(dn(r))}),[r]);const u=e=>{d(e),null===l||void 0===l||l(e?"+1".concat(e):"")};return o.createElement(on.K9,Object.assign({format:n,customInput:Le.k,type:"tel",getInputRef:t,valueIsNumericString:!0,value:c,onValueChange:(e,t)=>
1{let{event:n}=t;n&&u(e.value)},onPaste:e=>{null===i||void 0===i||i(e);const t=e.clipboardData.getData("text");if(t.replace(/\D/g,"").length<=10)return;const n=(0,sn.l)(t,"US");"1"===(null===n||void 0===n?void 0:n.countryCallingCode)&&n.isPossible()&&(e.preventDefault(),u(n.nationalNumber))}},s))}));function dn(e){if(null===e||void 0===e)return"";const t=String(e).trim(),n=t.replace(/\D/g,"");return t.startsWith("+")?n.replace(/^1/,""):11===n.length&&n.startsWith("1")?n.slice(1):n}cn.displayName="PhoneInput";var un=n(69607);const mn="SecuredNumberInput_input__jGUCR";var pn=n(30277);const gn=(0,o.forwardRef)(((e,t)=>{let{onChange:n,...r}=e;const[a,l]=(0,pn.e)([!0,!1]);return o.createElement(Le.k,Object.assign({ref:t,inputMode:"numeric",rightSectionPointerEvents:"all",rightSectionWidth:(0,un.D)(36)},r,{onChange:e=>{e.currentTarget.value=e.currentTarget.value.replace(/\D/g,""),null===n||void 0===n||n(e)},mod:{masked:a},classNames:{input:mn},rightSection:o.createElement(ye.M,{variant:"subtle",color:"gray",tabIndex:-1,onClick:()=>l(),"aria-label":a?"Hide":"Show"},a?o.createElement(Pe.A,{size:20}):o.createElement(we.A,{size:20}))}))}));gn.displayName="SecuredNumberInput";const hn="FormRow_root__42dTc",vn=e=>{let{children:t,...n}=e;return o.createElement(w.a,Object.assign({className:hn},n),t)};var yn=n(65518)},52085:(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n(41513),r=n(50016),a=n(39013),l=n(85683),i=n(82273);const s=r.forwardRef(((e,t)=>{let{mode:n="shift",value:s,defaultValue:u,onChange:m,onKeyDown:p,...g}=e;const[h,v]=(0,l.Z)({value:s,defaultValue:u,onChange:m}),y=(0,r.useRef)(null),b=(0,i.pc)(y,t),f="shift"===n&&null==h?0:null!==h&&void 0!==h?h:"";return r.createElement(o.Q,Object.assign({},g,{ref:b,value:f,onChange:e=>{const t="number"===typeof e?e:parseFloat(e)||0;v(t)},onKeyDown:e=>{var t,o;if(null===p||void 0===p||p(e),e.defaultPrevented||"shift"!==n)return;const r=function(e){if(e.ctrlKey||e.metaKey||e.altKey)return null;if(1===e.key.length&&e.key>="0"&&e.key<="9")return{kind:"insert",digit:e.key};return"Backspace"===e.key?{kind:"delete-back"}:"Delete"===e.key?{kind:"delete-forward"}:null}(e);if(!r)return;const l=e.currentTarget,i=l.value,s=null!==(t=l.selectionStart)&&void 0!==t?t:0,u=null!==(o=l.selectionEnd)&&void 0!==o?o:0,m=Math.round(100*Number(f||0)),h=String(m).padStart(3,"0").split(""),b=c(i,i.length)>0,E=b?c(i,s):h.length,C=b?c(i,u):h.length;let A;if("insert"===r.kind)h.splice(E,C-E,r.digit),A=E+1;else if("delete-back"===r.kind)if(E!==C)h.splice(E,C-E),A=E;else{if(!(E>0))return;h.splice(E-1,1),A=E-1}else if(E!==C)h.splice(E,C-E),A=E;else{if(!(E<h.length))return;h.splice(E,1),A=E}e.preventDefault();const S=parseInt(h.join("")||"0",10)||0,w=S/100,{min:P,max:I}=g;if("number"===typeof I&&w>I)return;if("number"===typeof P&&w<P)return;const x=String(S).padStart(3,"0"),D=x.length-h.length,T=Math.max(0,Math.min(x.length,A+D));(0,a.flushSync)((()=>{v(S/100)}));const k=y.current;if(!k)return;const B=d(k.value,T);k.setSelectionRange(B,B),setTimeout((()=>{if(y.current!==k)return;const e=d(k.value,T);k.selectionStart===e&&k.selectionEnd===e||k.setSelectionRange(e,e)}),0)},prefix:"$",thousandSeparator:",",decimalScale:2,fixedDecimalScale:"shift"===n,allowNegative:!1,hideControls:!0}))}));function c(e,t){let n=0;const o=Math.min(t,e.length);for(let r=0;r<o;r++){const t=e[r];t>="0"&&t<="9"&&n++}return n}function d(e,t){if(t<=0){for(let t=0;t<e.length;t++){const n=e[t];if(n>="0"&&n<="9")return t}return e.length}let n=0;for(let o=0;o<e.length;o++){const r=e[o];if(r>="0"&&r<="9"&&(n++,n===t))return o+1}return e.length}},43873:(e,t,n)=>{"use strict";n.d(t,{a:()=>v});var o=n(50016),r=n(29458),a=n(49349),l=n(67769),i=n(36883),s=n(56480),c=n(25183),d=n(51599),u=n(25104);const m={label:"TooltipLabel_label__T9ycx"};var p=n(6330);const g="TooltipLabel",h={iconSize:14,nowrap:!1,iconPosition:"right",tooltipPosition:"top"},v=(0,r.P9)((e=>{const t=(0,a.xd)(),n=(0,l.Y)(g,h,e),r=(0,p.k)(),{label:v,nowrap:y,tooltip:b,iconSize:f,iconColor:E,iconPosition:C,tooltipPosition:A="top",className:S,fw:w,...P}=n,I=(0,i.I)({name:g,classes:m,props:n,...P}),x=o.createElement(s.E,Object.assign({span:!0,mod:{nowrap:y,"has-tooltip":!!b},fw:w},I("label",{className:S})),v);
1if(!b)return x;let D=A;r&&("top-end"===A||"top-start"===A?D="top":"bottom-end"!==A&&"bottom-start"!==A||(D="bottom"));const T=o.createElement(u.A,{size:f,color:E||t.colors.gray[6],cursor:"pointer"});return o.createElement(c.m,{label:b,position:D,events:{hover:!0,touch:!0,focus:!1}},o.createElement(d.Y,Object.assign({wrap:y?"nowrap":void 0,gap:4,style:{display:"inline-flex",width:"fit-content"}},P),"left"===C&&T,x,"right"===C&&T))}));v.displayName=g},65190:(e,t,n)=>{"use strict";n.d(t,{I:()=>o});const o=n(43258).s.withProps({wrap:"wrap",direction:"row",gap:16})},62551:(e,t,n)=>{"use strict";n.d(t,{yi:()=>A,U$:()=>v,Bl:()=>P,pA:()=>g});n(65190);var o=n(50016),r=n(60563),a=n(51599),l=n(73984),i=n(50767);const s="ScrollablePageContent_scrollArea__HEAxO",c="ScrollablePageContent_titleGroup__BLWCN",d="ScrollablePageContent_title__qfUsl",u="ScrollablePageContent_content__L0r7k",m=(0,o.createContext)(null),p=e=>{let{children:t,scrollViewRef:n}=e;const r=(0,o.useCallback)((()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollTo({top:0,left:0,behavior:"smooth"})}),[n]),a=(0,o.useMemo)((()=>({scrollViewRef:n,scrollToTop:r})),[n,r]);return o.createElement(m.Provider,{value:a},t)};function g(){const e=(0,o.useContext)(m);if(!e)throw new Error("useScrollablePageContext must be used within a ScrollablePageProvider");return e}const h=e=>{let{title:t,children:n,viewportRef:m}=e;const{scrollToTop:p}=g();return(0,o.useEffect)((()=>{p()}),[p]),o.createElement(r.F,{className:s,viewportRef:m},!!t&&o.createElement(a.Y,{className:c},o.createElement(l.h,{order:1,className:d},t)),o.createElement(i.a,{className:u},n))},v=e=>{const t=(0,o.useRef)(null);return o.createElement(p,{scrollViewRef:t},o.createElement(h,Object.assign({},e,{viewportRef:t})))};var y=n(43159);const b="AppTabs_root__E4r2p",f="AppTabs_list__ImSKE",E="AppTabs_tab__uZ7aQ",C="AppTabs_panel__Jc7sO",A=y.t.withProps({variant:"unstyled",classNames:{root:b,list:f,tab:E,panel:C}});A.List=y.t.List,A.Tab=y.t.Tab,A.Panel=y.t.Panel;var S=n(17695);const w={root:"TabSwitcher_root__hb1KR"};function P(e){let{value:t,options:n,onChange:r,...a}=e;return o.createElement(i.a,Object.assign({w:"100%"},a),o.createElement(S.I,{classNames:{root:w.root},w:"100%",data:n,value:t,onChange:e=>r(e)}))}},41042:(e,t,n)=>{"use strict";n.d(t,{y:()=>s});var o=n(50016),r=n(50767),a=n(23759);const l="AppLoadingOverlay_root__ewRbC",i="AppLoadingOverlay_loader__ymh2N",s=e=>{let{visible:t,children:n}=e;return o.createElement(r.a,{pos:"relative"},o.createElement(a.p,{visible:!!t,overlayProps:{blur:.8,opacity:.9},loaderProps:{type:"bars",size:"lg"},classNames:{root:l,loader:i}}),n)};s.displayName="AppLoadingOverlay"},86919:(e,t,n)=>{"use strict";n.d(t,{V:()=>w});var o=n(50016),r=n(29458),a=n(67769),l=n(36883),i=n(15333),s=n(41436),c=n(73984),d=n(50767),u=n(60563),m=n(51599),p=n(92374);const g={inner:"AppModal_inner__+vY67",content:"AppModal_content__X18bi",header:"AppModal_header__HeKD4",overlayButton:"AppModal_overlayButton__N4P1c",body:"AppModal_body__88UrG",contentArea:"AppModal_contentArea__VkctR",contentAreaViewport:"AppModal_contentAreaViewport__LhmK1",footer
1:"AppModal_footer__DxDyU"};var h=n(10972),v=n(41042),y=n(83572);const b="AppModal",f=(0,o.createContext)({}),E={size:620,opened:!0},C=(0,r.P9)((e=>{const t=(0,a.Y)(b,E,e),{title:n,disabled:r,loading:s,isSubmitting:c,opened:d,keepMounted:u,size:m,centeredTitle:p,testId:h,children:v,classNames:y,styles:C,unstyled:w,className:P,style:I,vars:x,attributes:D,onClose:T,onBack:k,...B}=t,F=(0,l.I)({name:b,classes:g,props:t,className:P,style:I,classNames:y,styles:C,unstyled:w,vars:x,attributes:D});return o.createElement(f.Provider,{value:{isSubmitting:c,bodyStyles:F("body")}},o.createElement(i.a.Root,{classNames:{root:F("root").className,inner:F("inner").className},styles:{root:F("root").style,inner:F("inner").style},opened:d,keepMounted:u,onClose:()=>null===T||void 0===T?void 0:T(),size:m,centered:!0,transitionProps:{transition:"pop",duration:0}},o.createElement(i.a.Overlay,{backgroundOpacity:.3}),o.createElement(i.a.Content,Object.assign({classNames:{content:F("content").className},styles:{content:F("content").style}},B,{"data-test-id":h}),!!(n||k||T)&&o.createElement(S,{title:n,centered:p,styles:F,onBack:k,onClose:T,disabled:r,isSubmitting:c}),s?o.createElement(A,null):v)))})),A=()=>o.createElement(s.o,{pb:120,pt:56},o.createElement(y.aC,null)),S=e=>{let{title:t,centered:n,onBack:r,onClose:a,disabled:l,isSubmitting:i,styles:s}=e;const u=s("title"),m=s("header"),p="string"===typeof t?o.createElement(c.h,{order:3,className:u.className,style:u.style},t):o.createElement(d.a,null,t);return o.createElement("div",{className:m.className,style:m.style},r?o.createElement(h.$,{type:"back","data-submitting":i,className:g.overlayButton,onClick:i?void 0:r}):n?o.createElement(d.a,{w:16}):null,o.createElement(d.a,{ta:r?"center":"left"},p),!!a&&o.createElement(h.$,{type:"close",disabled:l,"data-submitting":i,className:g.overlayButton,onClick:i?void 0:a}))},w=Object.assign(C,{Content:e=>{var t;let{children:n,className:r,hideScrollbar:a,...l}=e;const{isSubmitting:i,bodyStyles:s}=(0,o.useContext)(f);return o.createElement(u.F,Object.assign({className:(0,p.A)(g.contentArea,r),classNames:{viewport:g.contentAreaViewport},type:a?"never":"hover",offsetScrollbars:!0},l),o.createElement(v.y,{visible:i},o.createElement("div",{className:null!==(t=null===s||void 0===s?void 0:s.className)&&void 0!==t?t:g.body,style:null===s||void 0===s?void 0:s.style},n)))},Buttons:e=>{let{justify:t="flex-end",children:n,className:r,...a}=e;return o.createElement(m.Y,Object.assign({className:(0,p.A)(g.footer,r),justify:t},a),n)}});w.displayName=b,w.classes=g},68616:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o=n(50016),r=n(6922),a=n(29731),l=n(65518);const i=e=>{let{title:t,okLabel:n,cancelLabel:i,onConfirm:s,onClose:c,children:d,...u}=e;const{t:m}=(0,a.Bd)("global");return o.createElement(r.H,Object.assign({icon:o.createElement(l.G,{type:"alert"}),title:t,buttons:[i||m("cancel"),{label:n||m("yes"),onClick:()=>{s(),c()}}],onClose:c},u),d)}},89199:(e,t,n)=>{"use strict";n.d(t,{C:()=>s});var o=n(50016),r=n(73819),a=n(41436),l=n(70764),i=n(56480);const s=e=>{let{text:t,onClose:n}=e;return o.createElement(r.Vm,{onClose:n,size:360},o.createElement(r.Vm.Content,null,o.createElement(a.o,{pt:16,pb:72},o.createElement(l.B,{gap:16,align:"center"},o.createElement(r.aC,null),o.createElement(i.E,null,t)))))}},6922:(e,t,n)=>{"use strict";n.d(t,{H:()=>b});var o=n(50016),r=n(86919),a=n(29458),l=n(67769),i=n(36883),s=n(70764),c=n(41436),d=n(56480),u=n(50767),m=n(74655),p=n(4557);const g={header:"MessageModal_header__VjiFn",title:"MessageModal_title__A45c5",text:"MessageModal_text__9CUDs",button:"MessageModal_button__lHuBU"};var h=n(65518);const v="MessageModal",y={testId:"MessageModal",icon:o.createElement(h.G,{type:"info"})},b=(0,a.P9)((e=>{const t=(0,l.Y)(v,y,e),{icon:n,title:a,loading:h,children:b,buttons:f,size:E,testId:C,onClose:A,classNames:S,...w}=t,P=(0,i.I)({name:v,classes:g,classNames:S,props:t,...w}),I=f.map((e=>"string"===typeof e?{label:e}:e)),x=o.Children.toArray(b);return o.createElement(r.V,{opened:!0,testId:C,size:E,styles:{header:{paddingBottom:0}},onClose:A},o.createElement(r.V.Content,null,o.createElement(s.B,{align:"center",gap:32,pb:16}
1,o.createElement(c.o,null,n),a&&o.createElement(d.E,P("title",{className:g.title}),a),b&&o.createElement(u.a,{ta:"center",px:32},x.map(((e,t)=>o.createElement(d.E,Object.assign({key:t,component:"div"},P("text",{className:g.text})),e)))))),o.createElement(r.V.Buttons,{justify:"center",mb:8},h?o.createElement(c.o,null,o.createElement(m.a,null)):I.map(((e,t)=>{const n=t===f.length-1,r=e.onClick||A;return o.createElement(p.$,Object.assign({key:t,variant:n?"filled":"default",disabled:h,onClick:r,style:e.style,className:g.button,"data-test-id":"".concat(C,".Button").concat(t)},e.props),e.label)}))))}))},10972:(e,t,n)=>{"use strict";n.d(t,{$:()=>c});var o=n(23588),r=n(36684),a=n(8724),l=n(50016);const i="OverlayButton_headerButton__OkMo9";var s=n(92374);const c=e=>{let{type:t,disabled:n,variant:c="gray",className:d,onClick:u,...m}=e;const p="back"===t?l.createElement(r.A,{size:24}):"close"===t?l.createElement(a.A,{size:24}):null;return p?l.createElement(o.M,Object.assign({variant:c,className:(0,s.A)(i,d),onClick:u,color:"dark",disabled:n},m),p):null}},74967:(e,t,n)=>{"use strict";n.d(t,{Vm:()=>I.V,GK:()=>P,Rw:()=>D.R,tz:()=>N,Ly:()=>L,HD:()=>x.H,Sg:()=>b});var o=n(29458),r=n(67769),a=n(36883),l=n(93024),i=n(50767),s=n(95264),c=n(41436),d=n(73984),u=n(70764),m=n(51599),p=n(50016);const g={header:"AppSidebar_header__1jJAC",close:"AppSidebar_close__1SKXC",backButton:"AppSidebar_backButton__UBOd9",contentWrapper:"AppSidebar_contentWrapper__lk31k",scrollArea:"AppSidebar_scrollArea__mu4+Y",footer:"AppSidebar_footer__9ovKW"};var h=n(92374),v=n(10972);const y=(0,p.createContext)(null),b=e=>{let{children:t}=e;const[n,o]=(0,p.useState)([]),r=(0,p.useCallback)((e=>o((t=>t.includes(e)?t:[...t,e]))),[]),a=(0,p.useCallback)((e=>o((t=>t.filter((t=>t!==e))))),[]),l=(0,p.useMemo)((()=>({register:r,unregister:a,activeId:n.length?n[n.length-1]:null,indexOf:e=>n.indexOf(e)})),[n,r,a]);return p.createElement(y.Provider,{value:l},t)};var f=n(41042);const E="AppSidebar",C=(0,p.createContext)(null),A={opened:!0,size:680},S=(0,o.P9)((e=>{const t=(0,r.Y)(E,A,e),{title:n,onBack:o,onClose:i,children:s,withOverlay:c,opened:d,onKeyDown:u,classNames:m,styles:h,vars:v,attributes:b,...f}=t,S=(0,a.I)({name:E,classes:g,props:t,...f}),P=(0,p.useContext)(y),I=(0,p.useId)();(0,p.useLayoutEffect)((()=>(null===P||void 0===P||P.register(I),()=>null===P||void 0===P?void 0:P.unregister(I))),[I]);const x=!P||P.activeId===I;return p.createElement(C.Provider,{value:{title:n,onBack:o,onClose:i,children:s,styles:S}},p.createElement(l._,Object.assign({},f,{opened:d,position:"right",withOverlay:x&&c,trapFocus:x,lockScroll:x,closeOnEscape:!1,onClose:i,onKeyDown:e=>{"Escape"===e.key&&x&&(e.stopPropagation(),i()),null===u||void 0===u||u(e)},transitionProps:{duration:0},classNames:{header:g.header,close:g.close},scrollAreaComponent:w})))})),w=()=>{const{title:e,onBack:t,onClose:n,children:o,styles:r}=(0,p.useContext)(C);return p.createElement(i.a,{className:g.contentWrapper},p.createElement(s.B,null,p.createElement(c.o,{inline:!0,className:g.backButton},t&&p.createElement(v.$,{type:"back",variant:"white",onClick:t,ml:-12}),"string"===typeof e?p.createElement(d.h,Object.assign({order:5},r("title")),e):e),p.createElement(v.$,{type:"close",onClick:n})),o)},P=Object.assign(S,{Content:e=>{let{children:t,className:n}=e;return p.createElement(u.B,{gap:0,className:(0,h.A)(g.scrollArea,n)},t)},Footer:e=>{let{children:t,className:n}=e;return p.createElement(m.Y,{className:(0,h.A)(g.footer,n)},t)},LoadingOverlay:f.y});P.displayName=E,P.classes=g;var I=n(86919),x=n(6922),D=n(68616),T=n(79043),k=n(56480),B=n(26356);const F="ContextMenu_root__fGS-3",_="ContextMenu_optionText__gz3hy",N=e=>{let{options:t}=e;return t&&0!==t.length?p.createElement(i.a,{className:F,onClick:e=>e.stopPropagation(),"data-testid":"dropdown_box"},p.createElement(T.W,{withinPortal:!0,position:"bottom-end",shadow:"sm"},p.createElement(T.W.Target,null,p.createElement(B.A,{size:20})),p.createElement(T.W.Dropdown,null,t.map(((e,t)=>p.createElement(T.W.Item,{key:t,"data-testid":e.testId,onClick:e.onClick},p.createElement(k.E,{className:_},e.label))))))):null};var R=n(29731);const L=e=>{let{onDiscard:t,onClose:n,children:o,...r}=e;const{t:a}=(0,R.Bd)("global");return p.createElement(D.R,Object.assign({title:a("common.discardChangesConfirmation.title"),okLabel:a("common.discardChangesConfirmation.ok"),onConfirm:t,onClose:n},r),o)}},73819:(e,t,n)=>{"use strict";n.d(t,{t5:()=>o.t5,M3:()=>o.M3,wP:()=>o.wP,kv:()=>o.kv,cZ:()=>o.cZ,Vm:()=>o.Vm,GK:()=>o.GK,yi:()=>o.yi,Py:()=>o.Py,aC:()=>o.aC,GQ:()=>o.GQ,Rw:()=>o.Rw,bT:()=>o.bT,Sp:()=>o.Sp,pB:()=>o.pB,UG:()=>o.UG,W_:()=>o.W_,bQ:()=>o.bQ,Ot:()=>o.Ot,Ly:()=>o.Ly,pu:()=>o.pu,c6:()=>o.c6,u7:()=>o.u7,Qn:()=>o.Qn,fh:()=>o.fh,i2:()=>o.i2,A5:()=>o.A5,NT:()=>o.NT,sS:()=>o.sS,Z0:()=>o.Z0,$Z:()=>o.$Z,X4:()=>o.X4,FU:()=>E.F,HD:()=>o.HD,mo:()=>o.mo,KF:()=>o.KF,oR:()=>o.oR,v7:()=>o.v7,LR:()=>o.LR,x1:()=>o.x1,YX:()=>o.YX,U$:()=>o.U$,Lw:()=>o.Lw,O5:()=>o.O5,f_:()=>o.f_,pM:()=>o.pM,LH:()=>o.LH,Sg:()=>o.Sg,Z:()=>o.Z,Bl:()=>o.Bl,a3:()=>o.a3,Ju:()=>o.Ju,V6:()=>o.V6,Dm:()=>h,Z6:()=>v,$U:()=>g,tp:()=>p,az:()=>y.a,Sf:()=>s,v:()=>b,qg:()=>f,pA:()=>o.pA});var o=n(81330),r=n(61477),a=n(57187),l=n(50016),i=n(19462);function s(e){const t=(0,a.C)(),n=(0,r.m)({mode:"uncontrolled",validateInputOnChange:!0,validateInputOnBlur:!0,...e,initialValues:c(null===e||void 0===e?void 0:e.initialValues),enhanceGetInputProps:n=>{var o;const r=(null===e||void 0===e||null===(o=e.enhanceGetInputProps)||void 0===o?void 0:o.call(e,n))||{},a=n.inputProps.onBlur,l=r.onBlur;return{...r,onBlur:e=>{null===a||void 0===a||a(e),null===l||void 0===l||l(e),t()},error:n.form.isTouched(n.field)?n.form.errors[n.field]:null}}});(0,l.useEffect)((()=>{n.validate()}),[]);const o=n.setValues;n.setValues=e=>o(c(e));const i=n.initialize;n.initialize=e=>i(c(e));
1const s=0===Object.values(n.errors).filter(Boolean).length;return{form:n,isValid:s}}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(!e||"object"!==typeof e)return e;if((0,i.isStateTreeNode)(e))return c((0,i.getSnapshot)(e),t);if(t.has(e))return t.get(e);if(Array.isArray(e)){const n=e.map((e=>c(e,t)));return t.set(e,n),n}if("[object Object]"===Object.prototype.toString.call(e)){const n={};t.set(e,n);for(const[o,r]of Object.entries(e))n[o]=c(r,t);return n}return e}var d=n(90213),u=n.n(d),m=n(12709);function p(e){return t=>(0,m.validateUSPhoneNumber)(String(null!==t&&void 0!==t?t:""))?null:null===e||void 0===e||e}function g(e){return t=>{const n=String(null!==t&&void 0!==t?t:"").trim();return n?(0,m.validateUSPhoneNumber)(n)?null:null===e||void 0===e||e:null}}function h(){let{required:e=!1,format:t="MM/DD/YYYY",min:n,max:o,error:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a=>{const l=String(null!==a&&void 0!==a?a:"").trim();if(!l)return e?null===r||void 0===r||r:null;const i=u()(l,t,!0);if(!i.isValid())return null===r||void 0===r||r;const s=e=>null==e?null:u()("function"===typeof e?e():e),c=s(n);if(c&&i.isBefore(c))return null===r||void 0===r||r;const d=s(o);return d&&i.isAfter(d)?null===r||void 0===r||r:null}}function v(e){return t=>(0,m.validateEmail)(String(null!==t&&void 0!==t?t:""))?null:null===e||void 0===e||e}var y=n(38656);const b=e=>{let{onClose:t,onBack:n}=e;const[o,r]=(0,l.useState)("none"),a=(0,l.useCallback)((e=>{"close"===e?t():"back"===e&&(n?n():t()),r("none")}),[r,t,n]),i=(0,l.useCallback)(((e,n)=>{"none"!==n?e?r(n):a(n):t()}),[t,r,a]);return(0,l.useMemo)((()=>({tryClose:i,showDiscardModal:"none"!==o,discardProps:{onDiscard:()=>a(o),onClose:()=>r("none")}})),[i,o,a])},f=e=>0===Object.values(e.errors).filter(Boolean).length;var E=n(64413)},38656:(e,t,n)=>{"use strict";n.d(t,{J:()=>K,a:()=>J});var o=n(26712),r=n(69607),a=n(69267),l=n(4557),i=n(97219),s=n(64513),c=n(95778),d=n(93024),u=n(71139),m=n(86488),p=n(52816),g=n(41513),h=n(23233),v=n(18529),y=n(46697),b=n(77838),f=n(17695),E=n(89310),C=n(56480),A=n(31124),S=n(22899),w=n(68377),P=n(73984),I=n(25183);const x="theme_badgeLabel__ppvj5",D="theme_card__tYrXZ",T="theme_text__BMT3a",k="theme_title__9spXW",B="theme_defaultBorder__vOnBZ",F="theme_comboboxOption__bYQNA",_="theme_calendarHeaderLevel__Clppd",N="theme_button__8Olaw",R="theme_inputWrapperRoot__siCKU",L="theme_inputWrapperLabel__JVIii",M="theme_inputWrapperError__vywZn",O="theme_radio__2SeVo",z="theme_radioLabel__BlrCb",j="theme_radioRoot__WimqQ",W="theme_checkboxLabel__4l+ac",V="theme_notificationRoot__mwPzd",H="theme_notificationDescription__PlF54",U="theme_tooltip__-ip4X";var G=n(84297),Y=n(75626),Q=n(92374),q=n(10375);const K={primaryColor:"var(--mantine-primary-color-filled)",primaryColorLight:"var(--mantine-primary-color-light)"},J=(0,o.a)({white:"#FFF",black:"#001929",primaryColor:"blue",defaultRadius:"sm",fontFamily:"Inter, sans-serif",fontSizes:{xs:(0,r.D)(10),sm:(0,r.D)(12),md:(0,r.D)(14),lg:(0,r.D)(16),xl:(0,r.D)(18),xxl:(0,r.D)(20)},lineHeights:{xs:(0,r.D)(18),sm:(0,r.D)(20),md:(0,r.D)(22),lg:(0,r.D)(26),xl:(0,r.D)(30),xxl:(0,r.D)(32)},headings:{sizes:{h1:{fontSize:"32px"},h3:{fontSize:"24px"},h4:{fontSize:"20px",fontWeight:"600"},h5:{fontSize:"18px",fontWeight:"600",lineHeight:"28px"},h6:{fontSize:"16px",fontWeight:"600",lineHeight:"26px"}},fontWeight:"700"},colors:{dark:["#c9c9c9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#FFECF0","#FFE3E8","#FFC9D2","#FFABB9","#FF8096","#FF4D66","#EC002A","#C70023","#A3001C","#7A0014"],green:["#EBFBEE","#D3F9D8","#B2F2BB","#8CE99A","#69DB7C","#51CF66","#40C057","#37B24D","#2F9E44","#2b8A3E"],blue:["#F2F8FF","#D9EEFF","#BFE3FF","#74CDFF","#4DBEFF","#24AFFF","#00A0F3","#0087CC","#006DA6","#004F80"],yellow:["#FFF6E6","#FFEED1","#FFE2B3","#FFD38F","#FFC56B","#FFCC66","#FFBF4D","#FFA233","#EE8E29","#E57B0B"],orange:["#FFF1E8","#FFE6D8","#FFD6C0","#FFC3A4","#FFAD83","#FF9158","#FF7926","#FF5E1A","#E0440F","#B83208"]}
1,components:{Badge:a.E.extend({defaultProps:{size:"md",classNames:{label:x}}}),Button:l.$.extend({defaultProps:{size:"md"},classNames:{root:N}}),Card:i.Z.extend({defaultProps:{radius:"md",withBorder:!0,classNames:{root:D}}}),Checkbox:s.S.extend({defaultProps:{classNames:{input:B,label:W}}}),Combobox:c.G.extend({defaultProps:{size:"md",shadow:"md"},classNames:{option:F}}),DateInput:G.J.extend({defaultProps:{size:"md",valueFormat:"MM/DD/YYYY"},classNames:{input:B,calendarHeaderLevel:_}}),DatePickerInput:Y.t.extend({defaultProps:{size:"md"},classNames:{input:B,calendarHeaderLevel:_}}),Drawer:d._.extend({defaultProps:{lockScroll:!1}}),InputBase:u.O.extend({classNames:{input:B}}),InputWrapper:m.o.extend({classNames:{root:R,label:L,error:M}}),Notification:p.E.extend({classNames:{root:V,description:H}}),Notifications:q.$.extend({defaultProps:{autoClose:6e3,position:"bottom-right"}}),NumberInput:g.Q.extend({defaultProps:{size:"md",allowNegative:!1,hideControls:!0},classNames:{input:B}}),Popover:h.A.extend({classNames:{dropdown:B}}),Radio:v.s.extend({classNames:{root:j,radio:(0,Q.A)(B,O),label:z}}),RadioGroup:y.z.extend({defaultProps:{size:"md"}}),RadioIndicator:b.T.extend({classNames:{indicator:(0,Q.A)(B,O)}}),SegmentedControl:f.I.extend({defaultProps:{size:"md"}}),Select:E.l.extend({defaultProps:{size:"md"},classNames:{dropdown:B,input:B}}),Text:C.E.extend({defaultProps:{classNames:{root:T}}}),Textarea:A.T.extend({defaultProps:{size:"md",minRows:4,autosize:!0,maxLength:2e3},classNames:{input:B}}),TextInput:S.k.extend({defaultProps:{size:"md",maxLength:1024},classNames:{input:B}}),Timeline:w.K.extend({defaultProps:{lineWidth:2}}),Title:P.h.extend({classNames:{root:k}}),Tooltip:I.m.extend({defaultProps:{openDelay:200,closeDelay:100,arrowSize:8,radius:4,multiline:!0,withArrow:!0},classNames:{tooltip:U}})},other:{colors:{accent:"#DD4A2C",border:{light:"#9BAEBC"},list:{hover:"#F4F9FD"},table:{header:"#F9FBFC",tinted:"#F4F9FD"},text:{primary:"#2F4858"}}}})},34956:(e,t,n)=>{"use strict";n.d(t,{gf:()=>l.g,qM:()=>o.q,kU:()=>s.k,mu:()=>a,gL:()=>i.g});var o=n(21746),r=n(83613);const a=()=>r.A.screensStore.paymentMethodsStore;n(50016);var l=n(79148),i=n(73622),s=n(6330)},79148:(e,t,n)=>{"use strict";n.d(t,{g:()=>r});var o=n(50016);function r(e,t){let{api:n,params:r,onSuccess:a,onError:l,suppressError:i=!1,transform:s,autofetch:c=!0,autofetchWhen:d}=e;const[u,m]=(0,o.useState)(null),[p,g]=(0,o.useState)(!1),[h,v]=(0,o.useState)(null),y=(0,o.useRef)(!0),b=(0,o.useRef)(void 0),f=(0,o.useMemo)((()=>r),null!==t&&void 0!==t?t:[r]),E=(0,o.useCallback)((async e=>{const t=void 0!==e?e:f;y.current&&g(!0);try{const e=await n(t),o=s?s(e):e;return y.current&&(m(o),v(null)),null===a||void 0===a||a(o),o}catch(o){y.current&&(v(o),m(null)),null===l||void 0===l||l(o);if(!(!0===(null===o||void 0===o?void 0:o.silent)||i)&&y.current)throw o;return null}finally{y.current&&g(!1)}}),[f,n,s,a,l,i]);return(0,o.useEffect)((()=>{if(c){var e;(null===(e=null===d||void 0===d?void 0:d(b.current,f))||void 0===e||e)&&E()}b.current=f}),[c,f]),(0,o.useEffect)((()=>()=>{y.current=!1}),[]),{response:u,loading:p,error:h,callApi:E}}},21746:(e,t,n)=>{"use strict";n.d(t,{q:()=>a});var o=n(50016),r=n(77079);function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{initialStep:n,onStepChange:a}=t,[l,i]=(0,o.useState)(null),s=(0,o.useMemo)((()=>l&&l.length>0?l:(0,r.w5)(e)),[e,l]),c=s[0],d=null!==n&&void 0!==n?n:c,[u,m]=(0,o.useState)(d),p=(0,o.useMemo)((()=>s.indexOf(u)),[s,u]);(0,o.useEffect)((()=>{-1===p&&s.length>0&&m(s[0])}),[p,s]);const g=0===p,h=p===s.length-1,v=s.length,y=(0,o.useCallback)((e=>{m(e),null===a||void 0===a||a(e)}),[a]),b=(0,o.useCallback)((()=>{if(!h){const e=s[p+1];y(e)}}),[h,s,p,y]),f=(0,o.useCallback)((()=>{if(!g){const e=s[p-1];y(e)}}),[g,s,p,y]),E=(0,o.useCallback)((()=>{y(d)}),[d,y]);return{step:u,goNext:b,goBack:f,goTo:y,resetFlow:E,setFlow:i,isFirst:g,isLast:h,stepIndex:p,totalSteps:v}}},88459:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n(97976);const r=()=>(0,o.P)().userStore.isAuthenticated},6330:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});var o=n(72139);const r=()=>(0,o.U)("(max-width: 36em)")},73622:(e,t,n)=>{"use strict";n.d(t,{g:()=>l});var o=n(50016),r=n(17439),a=n(82997);function l(e){const[t,n]=(0,o.useState)(""),[l,i]=(0,o.useState)(""),[s,c]=(0,o.useState)(!1),d=(0,o.useCallback)((e=>{var t;i(null!==(t=null===e||void 0===e?void 0:e.bankAccountId)&&void 0!==t?t:""),c(!0),a.JZ.py.createLinkToken(null===e||void 0===e?void 0:e.routingNumber,null===e||void 0===e?void 0:e.bankAccountId).then((e=>n(e.link_token))).catch((e=>console.error("Error creating link token:",e))).finally((()=>c(!1)))}),[]),u=(0,o.useCallback)((async(t,n)=>{c(!0),console.log("SUCCESS: ".concat(JSON.stringify(n)," ").concat(t));try{l?await a.JZ.py.healthCheck(l):await a.JZ.py.exchangePublicToken(t),e&&e()}catch(o){console.error("Error during Plaid success handling:",o)}finally{c(!1)}}),[e,l]),m=(0,o.useMemo)((()=>({token:t,onSuccess:u,onExit:(e,t)=>
1{c(!1),console.log("Error: ".concat(JSON.stringify(e),", metadata: ").concat(JSON.stringify(t)))},onEvent:(e,t)=>{console.log("Event ".concat(e,", metadata: ").concat(JSON.stringify(t)))}})),[u,t]),{open:p,ready:g}=(0,r.usePlaidLink)(m);return(0,o.useEffect)((()=>{g&&p()}),[g,p]),{isInitializing:s,connectPlaid:d}}},23851:(e,t,n)=>{"use strict";n.d(t,{O6:()=>i,Nn:()=>s});var o=n(52993);const r={flex:1,alignSelf:"stretch"},a={...r,alignItems:"center",alignContent:"flex-start"},l=e=>({container:r,containerCentered:a,containerPage:{padding:e.paddings.large},minimized:{flex:void 0},leftAligned:{alignItems:"flex-start"},buttonDense:{marginVertical:0,marginHorizontal:4},button:{padding:10}}),i=()=>(0,o.Qc)(l),s=()=>(0,o.Qc)((e=>({accent:{color:e.colors.accentText,fontSize:e.fontSizes.regular+2,lineHeight:e.lineHeights.large,width:"100%",textAlign:"center"},bodySecondary:{fontSize:e.fontSizes.regular,marginTop:e.paddings.small},centerText:{textAlign:"center"},mediumHeading:{fontSize:e.fontSizes.regular,...e.fonts.medium},heading:{...e.fonts.bold,fontSize:e.fontSizes.large,lineHeight:e.lineHeights.extraLarge},titleSecondary:{...e.fonts.thin,fontSize:e.fontSizes.larger,lineHeight:e.fontSizes.larger},denseSubHeading:{...e.fonts.boldest,fontSize:e.fontSizes.medium}})))},68532:(e,t,n)=>{"use strict";n.d(t,{y:()=>c});var o=n(50016),r=n(29731),a=n(49727),l=n(68215),i=n(95390),s=n(67869);const c=e=>{let{navigation:t,testID:n="link",dontNavigate:c}=e;console.log("here dont",c);const{t:d}=(0,r.Bd)("auth");return o.createElement(a.A,{style:{fontSize:16,fontWeight:"500",color:l.commonColors.textLight,marginTop:20,alignSelf:"center"}},d("signUp.existingQuestion"),o.createElement(i.N,{textStyle:{fontSize:16,fontWeight:"500"},title:d("SignIn"),color:l.commonColors.accentText,onPress:()=>c?c(!0):t.navigate(s.f0.Auth._self,{screen:s.f0.Auth.SignIn}),testID:n}))}},68096:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>y,N:()=>v});var o=n(82345),r=n(4670),a=n(38117),l=n(50016),i=n(97076),s=n(67869),c=n(61289),d=n(29731),u=n(68215),m=n(17171),p=n(20282),g=n(97976);const h=e=>l.createElement(r.A,{style:{alignItems:"center",justifyContent:"center",height:56,width:56,borderRadius:56,backgroundColor:"#F4F9FD"},onPress:e.onPress,testID:e.testID},l.createElement(i.CP6,{width:16,height:16})),v=e=>{let{onPress:t,testID:n}=e;const{t:o}=(0,d.Bd)("global");return l.createElement(r.A,{onPress:t,style:{flexDirection:"row",alignItems:"center"},testID:n},l.createElement(i.CP6,{width:16,height:16}),l.createElement(a.A,{style:{fontWeight:"500",color:u.commonColors.accentText,marginLeft:5}},o("back")))},y=e=>{const{sm:t}=(0,m.Qs)();let n;try{n=(0,o.useNavigation)()}catch(a){n=c}const r=()=>{e.onPress?e.onPress():n.canGoBack()?n.goBack():n.navigate(e.toScreen||s.f0.Auth.SignIn)};return t?l.createElement(l.Fragment,null,l.createElement(h,Object.assign({},e,{onPress:r})),l.createElement(p.hK,{height:40})):g.A.branding?l.createElement(l.Fragment,null,l.createElement(v,Object.assign({},e,{onPress:r})),l.createElement(p.hK,{height:10})):null}},33346:(e,t,n)=>{"use strict";n.d(t,{K:()=>s});var o=n(29731),r=n(41538),a=n(75143),l=n(67869),i=n(50016);const s=e=>{let{error:t,onPress:n,testID:s=""}=e;const{t:c}=(0,o.Bd)("errors");return t?"email-already-in-use"===t||"phone-already-in-use"===t?i.createElement(r.A,{testID:s},i.createElement(o.x6,{i18nKey:t,t:c},"This phone number already exists. Click here to",i.createElement(a.A,{onPress:n,screen:l.f0.Auth.SignIn,style:{fontSize:15,fontWeight:"600"}},"login"))):i.createElement(r.A,{testID:s},c(t)):null}}
1,41538:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var o=n(50016),r=n(11695),a=n(91099);const l=e=>{let{children:t,color:n,style:l={},testID:i="error-text"}=e;return t?o.createElement(r.A,{color:n||a.q.accent,style:l,testID:i},t):null}},11695:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var o=n(50016),r=n(78267),a=n(49727),l=n(38542),i=n(91099);const{composeStyle:s}=l.helpers,c=r.A.create({label:{fontSize:15,fontWeight:"400",lineHeight:24}});function d(e){const{color:t,style:n}=e,r=(0,o.useMemo)((()=>s(c.label,{color:t||i.q.secondaryDark},n)),[t,n]);return o.createElement(a.A,{style:r,testID:e.testID},e.children)}},62033:(e,t,n)=>{"use strict";n.d(t,{A:()=>x});var o=n(50016),r=n(17171),a=n(40046),l=n(38117),i=n(4670),s=n(7371),c=n(71003),d=n(97076),u=n(20282),m=n(29731),p=n(78267);const g=p.A.create({layoutRootView:{flexGrow:1,flexDirection:"column",backgroundColor:"white",overflowY:"auto",height:"100%"}});var h=n(38767),v=n(82345);const y=e=>{let{onBackPress:t}=e;const n=(0,v.useNavigation)();return o.createElement(i.A,{style:b.button,onPress:()=>{t?t():n.goBack()}},o.createElement(d.CP6,{width:13.33,height:11.67}))},b=p.A.create({button:{width:40,height:40,borderRadius:4,backgroundColor:"#F5F7F8",justifyContent:"center",alignItems:"center",position:"absolute",bottom:10,left:20}});var f=n(4419),E=n(97976),C=n(58876);const A=e=>{let{showsBackButton:t,onBackPress:n}=e;const{sm:l}=(0,r.Qs)(),{branding:s}=E.A;return o.createElement(i.A,{onPress:()=>!s&&a.A.openURL(C.DS.BT),style:(0,h.composeStyle)({alignItems:"center",paddingVertical:23},l?{}:{width:"100%",alignItems:"center",paddingVertical:20,borderBottomWidth:1,borderColor:"#E6EBEE"})},!l&&t?o.createElement(y,{onBackPress:n}):null,s?o.createElement(f.A,{source:{uri:null===s||void 0===s?void 0:s.logoUrl},style:{width:468,height:164},resizeMode:"contain"}):o.createElement(d.gkA,{width:l?163:122,height:l?20:16}))};var S=n(93894);const w=()=>{const{t:e}=(0,m.Bd)("auth");return o.createElement(s.A,{style:{alignItems:"center",justifyContent:"flex-start"},testID:"poweredByBluetape"},o.createElement(l.A,{style:{fontFamily:"Inter, sans-serif",fontWeight:"400",fontSize:16,lineHeight:19,color:"#003353"}},e("poweredBy")),o.createElement(u.hK,{height:10}),o.createElement(i.A,{onPress:()=>a.A.openURL(C.DS.BT)},o.createElement(d.gkA,{width:167})),o.createElement(u.hK,{height:60}))},P=e=>{let{showsBackButton:t,onBackPress:n,children:a,contentWidth:l,contentStyle:i}=e;const{sm:d}=(0,r.Qs)();return o.createElement(c.A,{style:{flex:1,backgroundColor:"white"}},o.createElement(s.A,{style:g.layoutRootView},d?o.createElement(A,{showsBackButton:t,onBackPress:n}):o.createElement(S.X,null),o.createElement(s.A,{style:(0,h.composeStyle)({marginTop:d?20:28,flexGrow:1},i)},o.createElement(s.A,{style:{width:l,alignSelf:"center",flexGrow:1}},a),o.createElement(u.hK,{height:d?20:28}),d&&o.createElement(w,null))))},I=o.memo((e=>{let{children:t,showsBackButton:n=!0,onBackPress:a,contentWidth:l}=e;const{sm:i}=(0,r.Qs)();return o.createElement(s.A,{style:g.layoutRootView},o.createElement(A,{showsBackButton:n,onBackPress:a}),o.createElement(s.A,{style:{marginVertical:i?100:28,flexGrow:1}},o.createElement(s.A,{style:{width:l,alignSelf:"center"}},t)))}));const x=(0,n(63680).PA)((e=>{var t;const{sm:n,screenWidth:a}=(0,r.Qs)(),l=null!==(t=e.contentWidth)&&void 0!==t?t:a<500?"90%":n?500:400;return E.A.branding?o.createElement(P,Object.assign({},e,{contentWidth:l}),e.children):o.createElement(I,Object.assign({},e,{contentWidth:l}),e.children)}))},75143:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var o=n(82345),r=n(50016),a=n(40046),l=n(49727);const i={color:n(91099).q.accentText,fontSize:14,fontWeight:"400",lineHeight:17};function s(e){let{children:t,url:n,screen:s,params:c,onPress:d,style:u,testID:m=""}=e;const p=(0,o.useNavigation)(),g=(0,r.useCallback)((()=>{s&&p.navigate(s,c),n&&a.A.canOpenURL(n).then((()=>a.A.openURL(n)))}),[s,p,c,n]);return r.createElement(l.A,{onPress:d||g,style:[i,u],testID:m},t)}},26977:(e,t,n)=>{"use strict";n.d(t,{D:()=>c});var o=n(49727),r=n(41538),a=n(7371),l=n(50016),i=n(68215),s=n(29731);const c=e=>{let{passwordValidation:t,testID:n=""}=e;const{t:c}=(0,s.Bd)("auth"),d={fontWeight:"400",fontSize:14,lineHeight:24};return l.createElement(a.A,{style:{flexDirection:"row"},testID:n},l.createElement(o.A,null,l.createElement(s.x6,{i18nKey:"passwordHint",t:c}
1,"Must be"," ",l.createElement(r.A,{color:t?t.length?i.commonColors.accentText:i.commonColors.accent:i.commonColors.textLight,style:d},"8 characters"),", include"," ",l.createElement(r.A,{color:t?t.uppercase?i.commonColors.accentText:i.commonColors.accent:i.commonColors.textLight,style:d},"1 uppercase")," ","and"," ",l.createElement(r.A,{color:t?t.number?i.commonColors.accentText:i.commonColors.accent:i.commonColors.textLight,style:d},"1 number"))))}},62712:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var o=n(50016),r=n(78267),a=n(7371),l=n(49727),i=n(68215),s=n(43872);function c(e){let{value:t="",onChangeText:n,editable:r=!0,onSubmitEditing:c,newPassword:u,confirmation:m=!1,showEye:p,inputRef:g=null,testID:h="password",...v}=e;const[y,b]=(0,o.useState)(!1),{accentText:f}=i.commonColors,E=u||m?"new-password":"current-password",C=m?"Both passwords must match":"8 characters, 1 uppercase, 1 number";return o.createElement(a.A,null,o.createElement(s.A,Object.assign({testID:h,name:m?"password-confirm":E,value:t,onChangeText:n,editable:r,placeholder:C,onSubmitEditing:c,secureTextEntry:!y,autoComplete:E,ref:g},v)),p&&o.createElement(a.A,{style:d.iconWrapper},o.createElement(l.A,{style:{fontWeight:"500",fontSize:14,color:f},onPress:()=>b((e=>!e)),testID:"show-link"},y?"HIDE":"SHOW")))}const d=r.A.create({iconWrapper:{position:"absolute",bottom:17,left:void 0,height:20,right:15,justifyContent:"center"}})},5878:(e,t,n)=>{"use strict";n.d(t,{A:()=>S});var o=n(82345),r=n(50016),a=n(49727),l=n(62033),i=n(56543),s=n(5438),c=n(63957),d=n(13569),u=n(83613),m=n(44399),p=n(7435),g=n(95390),h=n(68215),v=n(20282),y=n(67869),b=n(29731),f=n(33346),E=n(78886),C=n(82997),A=n(21319);const S=(0,s.PA)((e=>{var t;let{navigation:n,dontNavigate:s,route:S}=e;(0,E.A)(S.params);const{login:w,isValidEmail:P,canSubmit:I,canAskOtp:x,errors:D,codeVerifier:T,isValidLogin:k,setCanAskPassword:B,setIsNewUser:F}=d.A,{isBusy:_}=u.A,{t:N}=(0,b.Bd)("auth"),R=(0,m.A)("signin");(0,r.useEffect)((()=>{u.A.initRouteParams(null===S||void 0===S?void 0:S.params)}),[null===S||void 0===S?void 0:S.params]);const L=(0,o.useIsFocused)(),{verifier:M,createVerifier:O}=R;(0,r.useEffect)((()=>{L&&!M&&O()}),[M,O,L]);const z=(0,r.useCallback)((async()=>{let e=!1;try{e=(await C.Vv.kQ.check({login:w.toLowerCase()})).exists,F(!e)}catch(t){}if(P){if(B(!0),!s){const e=(0,y.oh)((0,y.wl)("Auth.SignInPassword"));n.navigate(e.name,e.params)}}else if(I)return e?d.A.signIn(M).then((()=>{u.A.routeParams.loanid&&n.navigate(y.f0.Console.Credit.LoanDetails,{id:u.A.routeParams.loanid})})).catch((()=>{})):(A.A.setUpAutoPhoneSignup(w,null,null),void(s?s(!1):n.navigate(y.f0.Auth.SignUpForm)))}),[P,I,M,B,s,n,w,F]);return(0,r.useEffect)((()=>{d.A.removeError("login"),x&&!s&&n.navigate(y.f0.Auth.SignInVerify)}),[x,s,n,T]),r.createElement(l.A,{showsBackButton:!1},r.createElement(p.A,null,N("signIn.title")),r.createElement(p.t,{style:{marginTop:20}},N("subTitle")),r.createElement(v.hK,{height:40}),r.createElement(i.p,{testID:"login",value:w,onChangeText:d.A.setLogin,label:N("signIn.loginLabel"),autoFocus:!0,mandatory:!0}),r.createElement(f.K,{error:null===(t=D.get("login"))||void 0===t?void 0:t.message}),r.createElement(v.hK,{height:32}),r.createElement(c.A,{onPress:z,disabled:!k||_,loading:_},N("signIn.submitLabel")),r.createElement(v.hK,{height:40}),r.createElement(a.A,{style:{fontFamily:"Inter, sans-serif",fontSize:16,fontWeight:"500",color:h.commonColors.textLight,alignSelf:"center"},testID:"link-to-signup"},"".concat(N("signIn.signUpQuestion")," "),r.createElement(g.N,{textStyle:{fontSize:16,fontWeight:"500"},title:N("SignUp"),color:h.commonColors.accentText,testID:"signup_link",onPress:()=>s?s(!1):n.replace(y.f0.Auth.SignUpHome)})))}))},30649:(e,t,n)=>{"use strict";n.d(t,{A:()=>E});var o=n(50016),r=n(38117),a=n(62033),l=n(5438),i=n(63957),s=n(13569),c=n(83613),d=n(7435),u=n(95390),m=n(68215),p=n(20282),g=n(75143),h=n(62712),v=n(67869),y=n(29731),b=n(33346),f=n(68096);const E=(0,l.PA)((e=>{var t;let{navigation:n,dontNavigate:l}=e;const{login:E,password:C,canSubmit:A,errors:S,setCanAskPassword:w,removeError:P}=s.A,{isBusy:I}=c.A,{t:x}=(0,y.Bd)(["auth"]),D=(0,o.useCallback)((async()=>
1{if(A)try{await s.A.signIn(),w(!1),c.A.userStore.redirectFromLoginPage(n)}catch(e){console.log(e)}}),[A,n,w]),T=()=>{var e;null!==(e=S.get("login"))&&void 0!==e&&e.message&&P("login"),w(!1),n.canGoBack()?n.goBack():n.navigate(v.f0.Auth.SignIn)};return o.createElement(a.A,{onBackPress:T},o.createElement(f.Ay,{onPress:T}),o.createElement(d.A,null,x("auth:signIn.passwordTitle")),o.createElement(d.t,{style:{marginTop:16}},o.createElement(y.x6,{t:x,i18nKey:"auth:signIn.caption",components:{styled:o.createElement(r.A,{style:{color:"#00A0F3"}})},values:{login:E}})),o.createElement(h.A,{testID:"password",label:x("auth:signIn.passwordLabel"),value:C,onChangeText:e=>s.A.setPassword(e),onSubmitEditing:D,newPassword:!0,showEye:!0,mandatory:!0}),o.createElement(p.hK,null),o.createElement(b.K,{error:null===(t=S.get("login"))||void 0===t?void 0:t.message}),o.createElement(p.hK,{height:40}),o.createElement(g.A,{screen:v.f0.Auth.SignInForgotPassword,testID:"forgot-password",style:{color:"#668598",fontSize:14}},o.createElement(y.x6,{t:x,i18nKey:"auth:signIn.forgotLink",components:{styled:o.createElement(r.A,{style:{color:"#00A0F3"},testID:"forgot_password_link"})},values:{login:"Click Here"}})),o.createElement(p.hK,{height:20}),o.createElement(i.A,{onPress:D,disabled:!A||I,loading:I},x("auth:signIn.loginButtonLabel")),o.createElement(p.hK,{height:40}),o.createElement(r.A,{style:{fontSize:16,fontWeight:"500",color:m.commonColors.textLight,alignSelf:"center"},testID:"link-to-signup"},"".concat(x("auth:signIn.signUpQuestion")," "),o.createElement(u.N,{textStyle:{fontSize:16,fontWeight:"500"},title:x("auth:SignUp"),color:m.commonColors.accentText,testID:"signup_link",onPress:()=>l?l(!1):n.replace(v.f0.Auth.SignUpHome)})))}))},83149:(e,t,n)=>{"use strict";n.d(t,{A:()=>w});var o=n(50016),r=n(49727),a=n(62033),l=n(4726),i=n(8219),s=n(68215),c=n(95390),d=n(13569),u=n(7435),m=n(63957),p=n(83613),g=n(5438),h=n(61208),v=n(68096),y=n(67869),b=n(29731),f=n(33346),E=n(44399),C=n(17171),A=n(89240),S=n(21319);const w=(0,g.PA)((e=>{var t;let{navigation:n,dontNavigate:g,route:w,setGoToForm:P}=e;const[I,x]=(0,o.useState)(""),{login:D,errors:T,removeError:k,canAskOtp:B,isNewUser:F,newUserSignInVerify:_,codeVerifier:N}=d.A,{isBusy:R}=p.A,{sm:L}=(0,C.Qs)(),M=(0,E.A)("signin-verify");(0,o.useEffect)((()=>{p.A.initRouteParams(null===w||void 0===w?void 0:w.params)}),[null===w||void 0===w?void 0:w.params]),(0,o.useEffect)((()=>{M.createVerifier()}),[]);const O=(0,o.useCallback)((async()=>{d.A.signIn(M.verifier).catch((e=>console.log(e)))}),[M.verifier]),z=(0,o.useCallback)((()=>{6===I.length&&(F?_(I).then((e=>{const{user:t}=e||{};S.A.setUpAutoPhoneSignup(D,N,t),g?(g(!1),P(!0)):n.navigate(y.f0.Auth.SignUpForm)})).catch((()=>{})):d.A.signInVerifyPhone(I).then((()=>{var e;p.A.routeParams.loanid&&n.navigate(y.f0.Console.Credit.LoanDetails,{id:p.A.routeParams.loanid}),"request-credit"===(null===(e=p.A.routeParams)||void 0===e?void 0:e.action)&&n.navigate(y.f0.Console._self,{screen:y.f0.Console.Credit._self}),A.A.get("screen").then((e=>{if(e){A.A.remove("screen");const t=(0,y.oh)((0,y.wl)(e.screen),e.params);n.replace(t.name,t.params)}})),setTimeout((()=>{d.A.setCodeVerifier(!1)}),3e3)})).catch((()=>{})))}),[n,I,N,_,F,D]);(0,o.useEffect)((()=>{6===I.length&&z()}),[I,z]);const j=()=>{d.A.setCodeVerifier(null),g||n.navigate(y.f0.Auth.SignIn)};(0,o.useLayoutEffect)((()=>{B||n.replace(y.f0.Auth.SignIn)}),[B,n]);const{t:W}=(0,b.Bd)("auth");return o.createElement(a.A,{onBackPress:j},o.createElement(v.Ay,{onPress:j,testID:"back-button-to-login"}),o.createElement(u.A,{testID:"code-title"},W("codeTitle")),o.createElement(l.A,{height:16}),o.createElement(u.t,{testID:"code-subtitle"},W("codeSubTitle"),o.createElement(r.A,{style:{color:s.commonColors.accentText}},"****",D.slice(-4))),o.createElement(l.A,{height:40}),o.createElement(i.A,{otp:I,onChange:e=>{x(e),T.get("verify")&&k("verify")},testID:"six-digit-code-component"}),o.createElement(l.A,null),o.createElement(f.K,{error:null===(t=T.get("verify"))||void 0===t?void 0:t.message}),o.createElement(l.A,{height:20}),o.createElement(r.A,{style:{fontSize:14,color:s.commonColors.textLight,marginVertical:20,textAlign:L?void 0:"center"},testID:"codeQuestion"},W("codeQuestion"),o.createElement(c.N,{title:W("resendCode"),color:"#00A0F3",onPress:O,testID:"resend-code
1-link"})),o.createElement(h.nu,null,(()=>o.createElement(m.A,{disabled:R||6!==I.length||!!T.get("verify"),onPress:z,loading:p.A.isBusy},W("signIn.loginButtonLabel")))),o.createElement(r.A,{style:{color:s.commonColors.textLight,marginTop:40,fontWeight:"500",fontSize:16},testID:"signup-question"},W("signIn.signUpQuestion"),o.createElement(c.N,{textStyle:{fontWeight:"500",fontSize:16},title:W("SignUp"),color:"#00A0F3",onPress:()=>g?g(!1):n.replace(y.f0.Auth.SignUp),testID:"signup-link"})),o.createElement(l.A,null))}))},29073:(e,t,n)=>{"use strict";n.d(t,{A:()=>k});var o=n(50016),r=n(78267),a=n(4670),l=n(7371),i=n(14329),s=n(56543),c=n(68096),d=n(5438),u=n(63957),m=n(4726),p=n(62033),g=n(7435),h=n(21319),v=n(97976),y=n(67869),b=n(29731),f=n(17171),E=n(68532),C=n(33346),A=n(77356),S=n(58876),w=n(8922),P=n(68215),I=n(38117),x=n(75143),D=n(83613);const T=e=>{let{navigation:t}=e;const{t:n}=(0,b.Bd)("auth");return D.A.isBusy?null:o.createElement(I.A,{style:{fontSize:16,fontWeight:"500",color:P.commonColors.textLight,marginVertical:10}},o.createElement(b.x6,{i18nKey:"signUp.accountFound",t:n,components:{loginLink:o.createElement(x.A,{onPress:()=>{t.navigate(y.f0.Auth._self,{screen:y.f0.Auth.SignIn})},style:{fontSize:16,fontWeight:"500"},testID:"SignUp.Error.LoginLink"})}}))},k=(0,d.PA)((e=>{var t,n,r;let{navigation:d,onBack:P,dontNavigate:I,onSuccessSignUp:x}=e;const{firstName:D,lastName:k,setValue:F,phone:_,canSignUp:N,canSubmit:R,isValidLogin:L,isValidEmail:M,signUp:O,errors:z,referalCode:j,company_name:W,setIsBusiness:V,isBusiness:H,signupInvoiceId:U,isInvitationOrInvoiceLinkSignup:G,invitationType:Y,isInvitation:Q,isWithinCompanyInvitation:q,factoringSupplierId:K}=h.A,{isBusy:J}=v.A,{t:Z}=(0,b.Bd)("auth"),{sm:X}=(0,f.Qs)(),$=(0,o.useCallback)((async()=>{x?x():Q&&K&&Y===S.zI.SUPPLIER_INVITE_CUSTOMER&&v.A.initRouteParams({factoringSupplierId:K,invitationType:Y})}),[Q,Y,K,x]),ee=(0,o.useCallback)((async()=>{await O(U).then((()=>{$()}))}),[O,U,$]);(0,o.useEffect)((()=>h.A.removeError("signup")),[]),(0,o.useEffect)((()=>{N&&Q&&q&&O().then((()=>{Y===S.zI.GETPAID_INVITE?d.replace(y.f0.GetPaidApplication):Y===S.zI.CREDIT_INVITE&&d.navigate(y.f0.CreditApplication),v.A.initRouteParams({})}))}),[N,Q,Y,O,q,d]),(0,o.useLayoutEffect)((()=>{L?R||d.replace(y.f0.Auth.SignUpPassword):d.replace(y.f0.Auth.SignUp)}),[R,M,L,d]);const te=()=>P?P():d.goBack(),ne=null===(t=z.get("signup"))||void 0===t?void 0:t.message;return N&&Q&&q&&(null===(n=z.get("signup"))||void 0===n||!n.message)?o.createElement(A.A,null):o.createElement(p.A,{onBackPress:te,contentStyle:{marginTop:X?0:20}},o.createElement(c.Ay,{onPress:te,testID:"signupFormBack"}),o.createElement(g.A,{style:{alignSelf:void 0}},Z("signUp.formTitle")),o.createElement(m.A,{height:16}),o.createElement(g.t,{style:{alignSelf:void 0}},Z("signUp.formSubTitle")),o.createElement(l.A,{style:{flexDirection:X?"row":"column"}},o.createElement(l.A,{style:{flex:1}},o.createElement(s.p,{testID:"firstName",value:D,onChangeText:e=>F("firstName",e),label:Z("signUp.firstNameLabel"),mandatory:!0,autoFocus:!0})),X&&o.createElement(m.A,{width:20}),o.createElement(l.A,{style:{flex:1}},o.createElement(s.p,{testID:"lastName",value:k,onChangeText:e=>F("lastName",e),label:Z("signUp.lastNameLabel"),mandatory:!0}))),o.createElement(w.A,{testID:"phone",label:Z("signUp.loginLabelPhone"),value:_,onChangeText:e=>{F("phone",e)},mandatory:!0}),o.createElement(C.K,{error:null===(r=z.get("login"))||void 0===r?void 0:r.message}),o.createElement(s.p,{testID:"businessNameInput",value:W,label:Z("businessName"),onChangeText:e=>F("company_name",e),disabled:!H,mandatory:!0}),G&&o.createElement(a.A,{style:B.checkboxWrapper,onPress:V,activeOpacity:.7},o.createElement(i.BtCheckBox,{style:B.checkbox,checked:!H,onPress:V}),o.createElement(i.BtText,{style:B.checkboxLabel},Z("signUp.ImNotABusiness"))),o.createElement(s.p,{testID:"referalInput",value:j,label:Z("referalCode"),onChangeText:e=>F("referalCode",e)}),ne?o.createElement(o.Fragment,null,o.createElement(m.A,{height:30}),o.createElement(C.K,{error:ne}),["auth/email-already-in-use","auth/user-already-exists","email-already-in-use","phone-already-in-use"].includes(ne)&&o.createElement(T,{navigation:d}),o.createElement(m.A,{height:10})):o.createElement(m.A,{height:45}),o.createElement(u.A,{onPress:ee,disabled:!N||J,loading:J,testID:"continue-button"},Z("signUp.formSubmitLabel")),o.createElement(m.A,{height:40}),o.createElement(E.y,{navigation:d,testID:"login-link",dontNavigate:I}))})),B=r.A.create({checkboxWrapper:{flexDirection:"row",marginTop:16},checkbox:{width:20,height:20,marginRight:11},checkboxLabel:{fontWeight:"400",fontSize:14,lineHeight:20,color:"#668598"}})},86419:(e,t,n)=>{"use strict";n.d(t,{A:()=>P});var o=n(50016),r=n(4670),a=n(7371),l=n(78267),i=n(14329),s=n(62033),c=n(67869),d=n(20282),u=n(29731),m=n(7435),p=n(68532),g=n(78886),h=n(17171),v=n(21319),y=n(56543),b=n(5438),f=n(13569),E=n(44859),C=n(63957),A=n(44399),S=n(33346),w=function(e){return e.PHONE="code",e.EMAIL="password",e}(w||{});const P=(0,b.PA)((e=>{var t;let{navigation:n,route:l,dontNavigate:b,onContinue:P,onUserExists:x}=e;const{t:D}=(0,u.Bd)("auth");(0,g.A)(l.params);const{sm:T}=(0,h.Qs)(),k=(0,A.A)("signup"),{login:B,setLogin:F,type:_,isValidLogin:N,isEmailLocked:R,opt_for_marketing_messages:L,errors:M}=v.A,{canAskOtp:O}=f.A;(0,o.useEffect)((()=>{O&&n.navigate(c.f0.Auth.SignInVerify)}),[O,n]);const z=(0,o.useCallback)((()=>{x&&x({type:_,login:B,isNewUser:!1,verifier:k.verifier})}),[x,_,B,k.verifier]),j=(0,o.useCallback)((async()=>{N&&v.A.checkUserSignUp(k.verifier).then((e=>P?P():n.navigate(c.f0.Auth.SignUpPassword))).catch((e=>{f.A.setLogin(B),"email-already-in-use"===e&&(P||n.navigate(c.f0.Auth.SignInPassword),z())}))}),[N,k.verifier,n,P,B,z]),W=(0,o.useMemo)((()=>o.createElement(y.p,{testID:"signUp_email_input",value:B,onChangeText:e=>{F(e),v.A.removeError("login")},autoFocus:!R,editable:!R,disabled:R,label:D("signUp.loginLabelEmail"),mandatory:!0})),[B,F,D,R]),V=()=>{v.A.setValue("opt_for_marketing_messages",!L)};return(0,o.useEffect)((()=>{v.A.removeError("login"),v.A.removeError("verify"),k.createVerifier(),v.A.setValue("type",w.EMAIL)}),[]),(0,o.useEffect)((()=>{v.A.removeError("login")}),[_]),o.createElement(s.A,{showsBackButton:!1},o.createElement(m.A,{testID:"signUp_title",style:{color:"#003353"}},D("signUp.title")),o.createElement(a.A,{style:{marginTop:T?40:24}},o.createElement(i.BtText,{style:[I.captionLabel,{marginTop:0,fontSize:T?18:15}]},D("emailSignupCaption")),W,o.createElement(d.hK,{height:8}),P&&o.createElement(S.K,{error:null===(t=M.get("login"))||void 0===t?void 0:t.message,onPress:()=>{b?b(!0):(f.A.setLogin(B),n.replace(c.f0.Auth.SignIn))},testID:"signUp_error_message"}),o.createElement(r.A,{style:[I.checkBoxWrapper,{marginTop:T?41:21}],onPress:V,activeOpacity:.7},o.createElement(i.BtCheckBox,{style:{width:20,height:20},checked:L,onPress:V}),o.createElement(i.BtText,{style:[I.checkBoxLabel,{fontSize:T?14:12}]},D("agreeToReceiveSms"))),o.createElement(E.Ay,null),o.createElement(C.A,{onPress:j,disabled:!N,testID:"signUp_submit_button"},D("signUp.submitLabel2")),T&&o.createElement(d.hK,{height:20}),o.createElement(p.y,{navigation:n,dontNavigate:b,testID:"signup_screen_link_to_login"})))})),I=l.A.create({captionLabel:{color:"#668598",lineHeight:30},checkBoxWrapper:{flexDirection:"row",alignItems:"center",marginBottom:26},checkBoxLabel:{lineHeight:17,color:"#668598",marginLeft:11}})},72753:(e,t,n)=>{"use strict";n.d(t,{A:()=>y});var o=n(50016),r=n(68096),a=n(63957),l=n(4726),i=n(62033),s=n(62712),c=n(21319),d=n(5438),u=n(67869),m=n(26977),p=n(29731),g=n(7435),h=n(68532),v=n(97976);const y=(0,d.PA)((e=>{let{navigation:t,onContinue:n,dontNavigate:d,onBack:y}=e;const{password:b,type:f,setPassword:E,canSubmit:C,isValidLogin:A,passwordValidation:S}=c.A,{isBusy:w}=v.A,{t:P}=(0,p.Bd)("auth");(0,o.useLayoutEffect)((()=>{A&&"password"===f||t.replace(u.f0.Auth.SignUp)}),[A,t,f]);const I=()=>{y?y():t.navigate(u.f0.Auth.SignUp)};return o.createElement(i.A,{onBackPress:I},o.createElement(r.Ay,{onPress:I,testID:"back-button"}),o.createElement(g.A,null,P("signUp.passwordTitle")),o.createElement(l.A,null),o.createElement(s.A,{testID:"password",label:P("signUp.passwordLabel"),value:b,onChangeText:E,newPassword:!0,showEye:!0,mandatory:!0,onSubmitEditing:void 0}),o.createElement(l.A,null),o.createElement(m.D,{passwordValidation:S,testID:"password-rules"}),o.createElement(l.A,{height:39}),o.createElement(a.A,{onPress:()=>n?n():t.navigate(u.f0.Auth.SignUpForm),disabled:!C||w,testID:"signup-button",loading:w},P("signUp.submitLabel")),o.createElement(l.A,{height:40}),o.createElement(h.y,{navigation:t,dontNavigate:d}))}))},63957:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var o=n(91396),r=n.n(o),a=n(50016),l=n(78267),i=n(73917),s=n(56475),c=n(68215);const d=l.A.create({wrapper:{borderRadius:8},content:{height:54,padding:16,borderRadius:0,alignItems:"center",justifyContent:"center"},label:{fontSize:18,lineHeight:22,marginVertical:0}});function u(e){let{onPress:t=(()=>null),loading:n=!1,disabled:o=!1,uppercase:l=!1,buttonColor:u,style:m,testID:p="submit-button",rest:g,children:h}=e;const{backgroundColor:v,color:y}=(0,a.useMemo)((()=>{const e=u||c.commonColors.accentText;return{backgroundColor:o?r()(e).alpha(.2).rgb().string():e,color:i.d4.
1secondary100}}),[u,o]);return a.createElement(s.A,Object.assign({uppercase:l,onPress:t,disabled:o,loading:n,mode:"contained",style:[d.wrapper,{backgroundColor:v},m],contentStyle:d.content,labelStyle:[d.label,{color:y}],testID:p},g),h)}},44859:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>y,ye:()=>b});var o=n(38542),r=n(50016),a=n(40046),l=n(78267),i=n(38117),s=n(49727),c=n(16148),d=n(68215),u=n(29731),m=n(58876),p=n(48328);const{composeStyle:g}=o.helpers,h=l.A.create({label:{lineHeight:20,marginVertical:16,paddingBottom:8},integrationLabel:{lineHeight:20,fontSize:12,fontWeight:"500",fontFamily:"Inter",color:"#001929"}}),v=e=>{c.HZ?window.open(e,"_blank"):a.A.openURL(e)};function y(e){let{style:t,testID:n}=e;const{t:o}=(0,u.Bd)("auth"),{textLight:a,accentText:l}=d.commonColors,i=(0,r.useMemo)((()=>g(h.label,t,{color:a})),[a,t]),c=(0,r.useMemo)((()=>g(h.label,t,{color:l})),[l,t]);return r.createElement(s.A,{style:i,testID:n},r.createElement(u.x6,{t:o,i18nKey:"terms"},"By continuing, you agree to our"," ",r.createElement(s.A,{style:c,onPress:()=>v(m.DS.TC)},"Terms & Conditions"),", and"," ",r.createElement(s.A,{style:c,onPress:()=>v(m.DS.PP)},"Privacy Policy")))}function b(){const{t:e}=(0,u.Bd)("global"),{accentText:t}=d.commonColors,n=(0,r.useMemo)((()=>g(h.integrationLabel,{color:t,textDecorationLine:"underline"})),[t]);return r.createElement(i.A,{style:h.integrationLabel},r.createElement(u.x6,{t:e,i18nKey:"integrations.pay-terms-and-conditions",components:{CA:r.createElement(i.A,{style:n,onPress:p.A.downloadCustomerAgreement}),terms:r.createElement(i.A,{style:n,onPress:()=>v(m.DS.TC)}),privacy:r.createElement(i.A,{style:n,onPress:()=>v(m.DS.PP)})}}))}},7435:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,t:()=>c});var o=n(50016),r=n(38542),a=n(49727),l=n(17171);const{composeStyle:i}=r.helpers,s=e=>{let{style:t,children:n,testID:r="title",...s}=e;const{sm:c}=(0,l.Qs)();return o.createElement(a.A,Object.assign({style:i({fontFamily:"Inter, sans-serif",fontWeight:"600",fontSize:c?32:24,lineHeight:39,textAlign:c?void 0:"center",alignSelf:"center",color:"#003353"},t)},s,{testID:r}),n)},c=e=>{let{style:t,children:n,testID:r="subtitle"}=e;const{sm:s}=(0,l.Qs)();return o.createElement(a.A,{style:i({fontFamily:"Inter, sans-serif",fontSize:s?18:15,fontWeight:"400",color:"#668598",lineHeight:s?30:24,textAlign:s?void 0:"center",alignSelf:"center"},t),testID:r},n)}},13569:(e,t,n)=>{"use strict";n.d(t,{A:()=>A});var o=n(12709),r=n(89077),a=n(19462),l=n(82997),i=n(74161),s=n.n(i),c=n(97976),d=n(6652),u=n(39708),m=n(92920),p=n(25944),g=n(74841),h=n.n(g),v=n(37149),y=n(44985),b=n(72839),f=n(48697);function E(e){const t=encodeURIComponent("login-attempts:".concat(e));return parseInt(v.A.get(t)||"0")||0}const C=a.types.compose(a.types.model({login:""}).volatile((()=>({password:"",codeVerifier:null,passwordConfirm:"",canAskPassword:!1,isNewUser:!1}))).views((function(e){const t=e;return{get isValidLogin(){return t.isValidEmail||t.isValidPhone},get isValidEmail(){return(0,o.validateEmail)(t.login)},get isValidPhone(){return(0,o.validateUSPhoneNumber)(t.login)},get isValidPassword(){const e=(0,p.A)(t.password);return e.length&&e.uppercase&&e.number},get passwordValidation(){return(0,p.A)(t.password)},get canSubmit(){return t.isValidEmail&&(0,p.A)(t.password).length||t.isValidPhone},get phoneNumber(){try{return(0,r.L)(t.login,"US").number}catch{return""}},get canAskOtp(){return!!t.codeVerifier},get isPasswordConfirmed(){return this.isValidPassword&&t.password===t.passwordConfirm},get showVerifyPage(){return t.isValidPhone&&null!==t.codeVerifier||t.isValidEmail&&t.canAskPassword}}})).actions((function(e){const t=e,n=new Array,o=new Array;return{afterCreate(){},beforeDestroy(){n.forEach((e=>e()))},setLogin(e){t.login=e},setIsNewUser(e){t.isNewUser=e},setPassword(e){t.password=e},setCanAskPassword(e){t.canAskPassword=e},async checkIsExist(){c.A.setBusy(!0);try{const{exists:e}=await l.Vv.kQ.check({login:t.login.toLowerCase()});if(!e){const e=t.isValidEmail?"user-email-not-found":"user-phone-not-found";throw new l.z2.LogicalError(e)}return c.A.setBusy(!1),t.removeError("login"),!0}catch(e){return t.setError("login","error",e.code),c.A.setBusy(!1),!1}},async signIn(e){if(!t.canSubmit){const e=new l.z2.LogicalError("error/not-filled");return t.setError("login","error",e.code),Promise.reject(e)}t.removeError("login");try{t.checkLoginAttempts()}catch(o){return t.setError("login","error",o.code),Promise.reject(o)}let n;return await c.A.userStore.waitForPendingLogOut(),t.isValidEmail?n=t.signInWithEmail():t.isValidPhone&&(n=t.signInWithPhone(e)),n.then((e=>l.Vv.kQ.webAuth({idToken:e}))).then((async()=>{t.setPassword("");const e=await c.A.userStore.setAuthState(d.A.auth().currentUser);return l.JZ.kQ.conversion({lastLogin:(0,f.W)()}),e})).catch((e=>{const n="auth/user-not-found"===e.code?t.isValidEmail?"auth/wrong-password":"auth/invalid-verification-code":e.code;return t.setError("login","error",n),"auth/user-not-found"===n&&c.A.userStore.logOut(),Promise.reject(e)})).finally((()=>c.A.setBusy(!1)))}
1,signInWithPhone:async e=>d.A.auth().signInWithPhoneNumber(t.phoneNumber,e).then((e=>(t.setCodeVerifier(e),c.A.setBusy(!1),new Promise(((e,t)=>{o.unshift({resolve:e,reject:t})}))))),async newUserSignInVerify(e){if(t.codeVerifier)return c.A.setBusy(!0),t.removeError("verify"),t.codeVerifier.confirm(e).catch(t.onSingInError).catch((e=>(t.setError("verify","error",e.code),Promise.reject(e)))).finally((()=>c.A.setBusy(!1)))},async signInVerifyPhone(e){if(t.codeVerifier)return c.A.setBusy(!0),t.removeError("verify"),t.codeVerifier.confirm(e).catch(t.onSingInError).then((e=>{let{user:t}=e;return null===t||void 0===t?void 0:t.getIdToken()})).then((e=>{(0,y.W)(b.I.signIn_with_phone),o[0].resolve(e)})).catch((e=>(console.log("code verify",e),t.setError("verify","error",e.code),Promise.reject(e)))).finally((()=>c.A.setBusy(!1)))},signInWithEmail:async()=>d.A.auth().signInWithEmailAndPassword(t.login,t.password).catch(t.onSingInError).then((e=>{var t;return(0,y.W)(b.I.signIn_wih_email),null===(t=e.user)||void 0===t?void 0:t.getIdToken()})),setCodeVerifier(e){t.removeError("verify"),console.log("verifier",e),t.codeVerifier=e},sendPasswordResetEmail:async()=>(t.removeError("forgot"),c.A.setBusy(!0),t.isValidLogin?d.A.auth().sendPasswordResetEmail(t.login).catch((e=>"auth/user-not-found"!==e.code?(t.setError("forgot","error",e.code),Promise.reject(e)):Promise.resolve())).finally((()=>c.A.setBusy(!1))):t.setError("forgot","error","auth/invalid-email")),verifyResetCode:async e=>d.A.auth().verifyPasswordResetCode(e).then((e=>t.setLogin(e))).catch((e=>t.setError("forgot","error",e.code))),resetPassword:async e=>(t.removeError("forgot"),t.isPasswordConfirmed?c.A.logOut().catch((()=>Promise.resolve())).then((()=>d.A.auth().confirmPasswordReset(e,t.password))).catch((e=>t.setError("forgot","error",e.code))):t.setError("forgot","error","auth/password-not-valid")),checkLoginAttempts(){if(!(E(t.login)<5))throw new l.z2.LogicalError("auth/too-many-requests")},async onSingInError(e){if(null===e||void 0===e||!e.code)throw e;try{!function(e){const t=encodeURIComponent("login-attempts:".concat(e)),n=E(e)+1;v.A.set(t,n.toString(),{maxAge:s()().add(1,"day").diff(s()(),"seconds")})}(t.login)}catch{}throw e}}})),(0,l.E2)(),(0,m.A)("BT_SIGNIN",!0),(0,u.F)(["login","verify","forgot"],!1)).named("SignInStore").create({});h()(C);const A=C},44399:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var o=n(50016),r=n(38325),a=n(6652);function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"recaptcha";const[t]=(0,o.useState)(e),[n,l]=(0,o.useState)(null),i=(0,o.useCallback)((()=>{if(console.log("cleaned ".concat(t)),n)try{n.clear()}catch(o){console.log(o)}finally{l(null)}if("web"===r.A.OS){var e;const n=document.getElementById(t);n&&(null===(e=n.parentNode)||void 0===e||e.removeChild(n))}}),[t,n]),s=(0,o.useCallback)((()=>{if(i(),console.log("recaptcha created ".concat(t)),"web"===r.A.OS){const e=document.createElement("div");e.id=t,document.body.appendChild(e);const n=new a.A.auth.RecaptchaVerifier(t,{size:"invisible"});l(n)}}),[i,t]);return(0,o.useEffect)((()=>{if("signin"!==t)return i}),[]),(0,o.useMemo)((()=>({verifier:n,createVerifier:s,cleanVerifier:i})),[n,s,i])}},78886:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var o=n(50016),r=n(37149),a=n(25128);function l(e){(0,o.useEffect)((()=>{if((0,a.XW)(e))r.A.set("conversion",JSON.stringify((0,a.Zl)(e)));else{r.A.get("conversion")||(""!==document.referrer?r.A.set("conversion",JSON.stringify({bt_referer:document.referrer})):r.A.set("conversion",JSON.stringify({utm_source:"direct-traffic",utm_medium:"bt-web"})))}}),[e])}},50180:(e,t,n)=>{"use strict";n.d(t,{h:()=>s});var o=n(4557),r=n(57967),a=n(50016),l=n(29731);const i="PaymentButtonAccessory_button__jhi20",s=e=>{let{disabled:t,type:n="pay",variant:s="default"}=e;const{t:c}=(0,l.Bd)("global");let d;return d="pay"===n?c("common.paymentMethods.pay"):"add"===n?c("common.paymentMethods.add"):"update"===n?c("common.paymentMethods.update"):"",a.createElement(o.$,{size:"compact-sm",disabled:t,className:i,"data-accessory-variant":s,rightSection:a.createElement(r.A,{size:16})},d)}}
1,75488:(e,t,n)=>{"use strict";n.d(t,{y:()=>b});var o=n(50016),r=n(29458),a=n(67769),l=n(36883),i=n(50767),s=n(89673),c=n(51599),d=n(41436),u=n(70764),m=n(56480),p=n(28535);const g={root:"PaymentMethodButton_root__yuqVv",badge:"PaymentMethodButton_badge__b91zc",button:"PaymentMethodButton_button__peCNR",group:"PaymentMethodButton_group__yWRzq",stack:"PaymentMethodButton_stack__nLKXv",superTitle:"PaymentMethodButton_superTitle__PPURT",title:"PaymentMethodButton_title__3zFgd",subtitle:"PaymentMethodButton_subtitle__kj0HL"};var h=n(64413);const v="PaymentMethodListButton",y={},b=(0,r.P9)(((e,t)=>{const n=(0,a.Y)(v,y,e),{onClick:r,leftIcon:b,title:f,subtitle:E,rightIcon:C,badge:A,disabled:S,superTitle:w,className:P,...I}=n,x=(0,l.I)({name:v,classes:g,props:n,className:P,...I}),D=void 0!==C?C:r?o.createElement(p.A,{color:h.F.primary,size:28}):null;return o.createElement(i.a,Object.assign({ref:t},x("root"),I),A&&o.createElement("div",{className:g.badge},A),o.createElement(s.N,Object.assign({"data-disabled":S||void 0,"data-no-action":!r||void 0},x("button"),{onClick:e=>{!S&&r&&(r(),e.preventDefault())}}),o.createElement(c.Y,{gap:0,className:g.group},b&&o.createElement(d.o,{mr:16},b),o.createElement(u.B,{gap:0,className:g.stack},w&&o.createElement(m.E,x("superTitle"),w),f&&o.createElement(m.E,x("title"),f),E&&o.createElement(m.E,x("subtitle"),E)),D&&o.createElement(d.o,null,D))))}))},39797:(e,t,n)=>{"use strict";n.d(t,{$:()=>c});var o=n(50016),r=n(62490),a=n(73819),l=n(15501),i=n(9326),s=n(40252);const c=e=>{let t,{type:n}=e;return t="card"===n?o.createElement(l.A,null):"bank"===n?o.createElement(i.A,null):"add"===n?o.createElement(s.A,null):null,o.createElement(r.L,{color:a.FU.primary,variant:"light",size:44,radius:"xl"},t)}},44302:(e,t,n)=>{"use strict";n.d(t,{T:()=>b,v:()=>y});var o=n(50016),r=n(69267),a=n(29731),l=n(58876),i=n(75488),s=n(91162),c=n(87053);const d="PaymentMethodListItem_reconnectionBadge__pifHA",u="PaymentMethodListItem_reconnectionButton__gxXlW";var m=n(34956),p=n(83613),g=n(50180),h=n(39797),v=function(e){return e[e.None=0]="None",e[e.ReconnectCard=1]="ReconnectCard",e}(v||{});const y=o.forwardRef(((e,t)=>{var n,r,y;let{paymentMethod:E,badge:C,onClick:A,owner:S,onRefetchPaymentMethods:w,...P}=e;const{t:I}=(0,a.Bd)("global"),{connectPlaid:x}=(0,m.gL)((()=>{p.A.screensStore.paymentMethodsStore.fetchPaymentMethods()})),[D,T]=(0,o.useState)(v.None),k=E.paymentMethodType===l.mf.Card,B=E.paymentMethodType===l.mf.Bank,F=k&&!(null!==(n=E.rainforest)&&void 0!==n&&n.paymentMethodId),_=B&&(null===(r=E.plaid)||void 0===r?void 0:r.status)===l.lR.DISCONNECTED,N=B&&(null===(y=E.plaid)||void 0===y?void 0:y.status)===l.lR.EXPIRED,R=_||N||F,L=R?o.createElement(b,{className:d},I("common.paymentMethods.disconnectedMethod")):C;return o.createElement(o.Fragment,null,o.createElement(i.y,Object.assign({ref:t,title:s.A.getShortName(E),subtitle:f(I,E),badge:L,leftIcon:o.createElement(h.$,{type:k?"card":"bank"}),rightIcon:R?null:o.createElement(g.h,{variant:"light"}),"data-testid":"payment-method-".concat(E.id),classNames:{button:R?u:void 0},onClick:R?()=>{F?T(v.ReconnectCard):_?x({routingNumber:E.routingNumber}):N?x({bankAccountId:E.id}):null===A||void 0===A||A()}:A},P)),D===v.ReconnectCard&&o.createElement(c.v,{oldAccountId:E.id,owner:S,onRefetchPaymentMethods:w,onClose:()=>T(v.None),onSuccess:()=>T(v.None)}))})),b=r.E.withProps({color:"primary",radius:4});function f(e,t){const n=s.A.escapeAccountNumber(t);return t.paymentMethodType===l.mf.Bank?"".concat("savings"===t.accountType?e("PaymentMethodsListing.business-saving",{accNum:n}):e("PaymentMethodsListing.business-checking",{accNum:n})):"".concat("Debit"===(null===(o=t.cardMetadata)||void 0===o?void 0:o.type)?e("PaymentMethodsListing.debit-card",{accNum:n}):e("PaymentMethodsListing.credit-card",{accNum:n}));var o}},94951:(e,t,n)=>{"use strict";n.d(t,{B:()=>h});var o=n(50016),r=n(5438),a=n(82997),l=n(58876),i=n(83613),s=n(75488),c=n(44302),d=n(70764),u=n(29731),m=n(2745),p=n(39797),g=n(50180);const h=(0,r.PA)((e=>{let{invoice:t,withBanks:n,withCards:r=!0,onSelect:h,onAddPaymentMethod:v}=e;const{t:y}=(0,u.Bd)("global"),b=i.A.screensStore.paymentMethodsStore,f=i.A.userStore.isAuthenticated,E=(0,o.useRef)(f);(0,o.useEffect)((()=>{f&&!E.current&&b.fetchPaymentMethods(),E.current=f}),[f,b]);const C=(null===t||void 0===t?void 0:t.type)!==a.tD.QUOTE&&(null===t||void 0===t?void 0:t.status)!==l.uR.draft,A=r&&i.A.remoteConfig.acceptCards,S=C&&(n||A),w=[...n?b.banks:[],...A?b.cards:[]];return o.createElement(d.B,{gap:16,mt:8},w.map((e=>o.createElement(c.v,{key:e.id,paymentMethod:e,onClick:()=>C?h((0,m.toJS)(e)):void 0}))),S&&o.createElement(s.y,{title:y("InvoiceDetails.add-new-payment-method"),leftIcon:o.createElement(p.$,{type:"add"}),rightIcon:o.createElement(g.h,{type:"add",variant:"light"}),onClick:v}))}))},86277:(e,t,n)=>{"use strict";n.d(t,{j:()=>Y});var o=n(50016),r=n(29731),a=n(82997),l=n(73819),i=n(83613),s=n(17439);const c=e=>{let{config:t}=e;const{open:n,ready:r}=(0,s.usePlaidLink)(t);return(0,o.useEffect)((()=>{r&&n()}),[r,n]),null};var d=n(75488),u=n(74655),m=n(41436),p=n(70764),g=n(56480),h=n(39797);const v=(0,o.memo)((e=>{let{onClose:t,onSuccess:n,onError:s,onLinkBankManually:v}=e;const{t:y}=(0,r.Bd)(),[b,f]=(0,o.useState)(!1),[E,C]=(0,o.useState)(null),A=(0,o.useCallback)((async(e,t)=>{console.log("ONSUCCESS: Metadata ".concat(JSON.stringify(t)," ").concat(e)),f(!0);try{var o,r;const t=await a.JZ.py.exchangePublicToken(e);await(null===(o=i.A.screensStore)||void 0===o?void 0:o.paymentMethodsStore.fetchPaymentMethods()),n&&n(null!==(r=t.bankAccountIds)&&void 0!==r?r:[])}catch(l){s&&s(),console.log(l)}finally{f(!1)}}),[n,s]),S=(0,o.useCallback)((async()=>{f(!0);try{const e={token:(await a.JZ.py.createLinkToken()).link_token,onSuccess:A,onExit:(e,t)=>
1{console.log("Exited early. Error: ".concat(JSON.stringify(e)," Metadata: ").concat(JSON.stringify(t)))},onEvent:(e,t)=>{console.log("Event ".concat(e,", Metadata: ").concat(JSON.stringify(t)))}};C(e)}catch(e){s&&s(),console.error(e)}finally{f(!1)}}),[s,A]);return o.createElement(o.Fragment,null,!!E&&o.createElement(c,{config:E}),o.createElement(l.Vm,{onClose:t,testId:"add-new-bank-account-modal-idle"},o.createElement(l.Vm.Content,null,o.createElement(d.y,{title:y("ConnectYourBank"),subtitle:y("forFasterCheckout"),leftIcon:o.createElement(h.$,{type:"bank"}),rightIcon:b?o.createElement(u.a,{size:"sm"}):void 0,disabled:b,"data-testid":"add-plaid-bank-account",onClick:S}),o.createElement(m.o,{mt:24,mb:8},o.createElement(p.B,{gap:0},o.createElement(l.t5,{c:"gray.6",onClick:v,disabled:b},y("linkBankManually")),o.createElement(g.E,{fz:12,c:"gray.6",ta:"center"},y("takes2BusinessDays")))))))}));var y=n(50767),b=n(18529),f=n(51599),E=n(22899),C=n(4557),A=n(76448),S=n(71877),w=n.n(S),P=n(97976);const I=n.p+"static/media/LinkBankAccount.d538b6d57324d7953718ed718b3c824c.svg",x="AddManualBankAccountModal_bankAccountCard__k2+4q",D="AddManualBankAccountModal_bankAccountImage__w8M3n";var T=n(91409),k=n(30855);const B=(0,o.memo)((e=>{let{onClose:t}=e;const{t:n}=(0,r.Bd)("global");return o.createElement(l.HD,{icon:o.createElement(l.GQ,{type:"alert"}),title:n("Wallet.account_alert_title"),buttons:[n("Wallet.account_alert_button")],testId:"add-new-bank-account-error-message",onClose:t},n("Wallet.account_alert_text"))}));var F=n(18731),_=n(84846),N=n(82703),R=n(97076);const L="VoidedCheckUpload_root__pxtgu",M="VoidedCheckUpload_inner__t0jBh";var O=n(28535);const z=e=>{let{onDrop:t}=e;const{t:n}=(0,r.Bd)("global");return o.createElement(_.mR,{onDrop:t,maxSize:10485760,maxFiles:1,multiple:!1,activateOnClick:!0,accept:[N.Z$.pdf,N.Z$.jpeg,N.Z$.png],classNames:{root:L,inner:M}},o.createElement(f.Y,{justify:"space-between",wrap:"nowrap",align:"center",w:"100%"},o.createElement(f.Y,{gap:12,wrap:"nowrap",align:"center"},o.createElement(R.MIV,null),o.createElement(g.E,{fz:"lg"},o.createElement(r.x6,{t:n,i18nKey:"Wallet.upload-voided-check",components:{styled:o.createElement(g.E,{span:!0,inherit:!0,fw:600,c:"blue.6"})}}))),o.createElement(O.A,{size:28,color:"var(--mantine-primary-color-6)"})))};var j=n(34956);const W=e=>{let{onClose:t,onSuccess:n}=e;const{t:i}=(0,r.Bd)("global"),{remoteConfig:s}=(0,P.P)(),{fetchPaymentMethods:c}=(0,j.mu)(),[d,u]=(0,o.useState)(""),[m,g]=(0,o.useState)(!1),{form:h,isValid:v}=(0,l.Sf)({initialValues:{accountType:"checking",accountholderName:"",bankName:"",routingNumber:"",accountNumber:""},validate:{bankName:(0,T.h)(i("fieldRequired")),accountholderName:(0,T.h)(i("fieldRequired")),routingNumber:(0,k.c)(/^\d{9}$/,i("common.paymentMethods.manualBankAccountModal.invalidRoutingNumber")),accountNumber:(0,k.c)(/^\d{6,}$/,i("common.paymentMethods.manualBankAccountModal.invalidAccountNumber"))}}),[S,_]=(0,o.useState)(null),[N,R]=(0,o.useState)(F.A.Idle),[L,M]=(0,o.useState)(0),O=(0,o.useCallback)((async e=>a.JZ.QN.allInstitutions({search:e,limit:10,onlyFinicity:"false"})),[]),{mutate:W,isPending:V}=(0,A.n)({mutationFn:e=>a.JZ.QN.addBankAccount({name:e.bankName,accountholderName:e.accountholderName,routingNumber:e.routingNumber,accountNumber:e.accountNumber,accountType:e.accountType,voidedCheck:d,isManualEntry:!0}),onSuccess:async e=>{await c(),"ok"===e.result&&n(e.id)},onError:e=>{"operation/denied"===e.code&&g(!0)}});return o.createElement(o.Fragment,null,o.createElement(l.Vm,{title:i("Wallet.link_a_bank"),onClose:t,isSubmitting:V},o.createElement(l.Vm.Content,null,o.createElement(p.B,{gap:0},o.createElement(y.a,{mb:24,className:x},o.createElement("img",{src:I,alt:"",className:D})),o.createElement(y.a,{mb:24},S?o.createElement(F.N,{fileName:S.name,fileSize:S.size,filePath:d||null,status:N,progress:L,onClear:()=>{_(null),R(F.A.Idle),M(0),u("")}}):o.createElement(z,{onDrop:async e=>{if(0===e.length)return;const t=e[0];_(t),M(0),R(F.A.Uploading);try{const{results:e}=await a.JZ.NJ.upload([t.name]),n=e.find((e=>e.file===t.name));if(null===n||void 0===n||!n.url)return void R(F.A.Failed);const o=w().create({url:n.url,method:"PUT",data:t});if(200!==(await o.put(n.url,t,{onUploadProgress:e=>{e.total&&M(Math.round(e.loaded/e.total*100))}})).status)return void R(F.A.Failed);R(F.A.Uploaded),u(n.key)}catch{R(F.A.Failed)}}})),o.createElement(p.B,{gap:8,mb:24},o.createElement(b.s.Group,Object.assign({key:h.key("accountType"),label:i("Wallet.account_type"),"data-testid":"AddManualBankAccountModal.AccountType"},h.getInputProps("accountType")),o.createElement(f.Y,{gap:32,mt:8},o.createElement(b.s,{value:"checking",label:i("Wallet.checking")}),o.createElement(b.s,{value:"savings",label:i("Wallet.saving")})))),o.createElement(l.fh,null,o.createElement(l.Py,Object.assign({value:h.getValues().bankName,label:i("Wallet.search_bank"),autoFocus:!0,required:!0,"data-testid":"AddManualBankAccountModal.Search",getOptionValue:e=>e.name,fetchOptions:async e=>(await O(e)).items||[],onSelect:(e,t)=>
1{h.setFieldValue("bankName",(null===t||void 0===t?void 0:t.name)||""),null!==t&&void 0!==t&&t.isBlocked&&g(!0)}},h.getInputProps("bankName")))),o.createElement(l.fh,null,o.createElement(E.k,Object.assign({label:i("Wallet.name_an_account"),required:!0,autoComplete:"off"},h.getInputProps("accountholderName")))),o.createElement(l.fh,null,o.createElement(l.f_,Object.assign({label:i("Wallet.routing_number"),required:!0,maxLength:9,autoComplete:"off","data-testid":"AddManualBankAccountModal.RoutingNumber"},h.getInputProps("routingNumber"))),o.createElement(l.f_,Object.assign({key:h.key("accountNumber"),label:i("Wallet.account_number"),required:!0,maxLength:17,autoComplete:"off","data-testid":"AddManualBankAccountModal.AccountNumber"},h.getInputProps("accountNumber")))))),o.createElement(l.Vm.Buttons,null,o.createElement(C.$,{onClick:()=>{if(h.validate().hasErrors||!d)return;const e=h.getValues().routingNumber;s.checkIfRoutingNumberIsBlocked(e)?g(!0):W(h.getValues())},disabled:!v||!d||V,miw:150,"data-testid":"AddManualBankAccountModal.Submit"},i("Wallet.agree")))),m&&o.createElement(B,{onClose:()=>g(!1)}))};var V=n(38117),H=n(38146);const U=(0,o.memo)((e=>{let{onClose:t}=e;return o.createElement(H.s,{visible:!0,exitable:!1,onDismiss:t,contentContainerStyle:{marginHorizontal:40},title:"Bank account linked",textContentBottomMargin:33,icon:o.createElement(R.F3K,null),message:o.createElement(V.A,{testID:"add-new-bank-account-success-message"},"Your bank account has been successfully linked to your BlueTape account."),buttonData:{title:"Done",onPress:t,style:{width:150}}})}));var G=function(e){return e[e.Options=0]="Options",e[e.Success=1]="Success",e[e.Error=2]="Error",e[e.ManualLink=3]="ManualLink",e}(G||{});const Y=(0,o.memo)((e=>{let{onClose:t,onSuccess:n,onFinish:r}=e;const[a,l]=(0,o.useState)(G.Options);return o.createElement(o.Fragment,null,a===G.Options&&o.createElement(v,{onClose:t,onSuccess:e=>{n&&n(e),l(G.Success)},onError:()=>l(G.Error),onLinkBankManually:()=>{l(G.ManualLink)}}),a===G.Error&&o.createElement(B,{onClose:t}),a===G.Success&&o.createElement(U,{onClose:r}),a===G.ManualLink&&o.createElement(W,{onClose:()=>l(G.Options),onSuccess:e=>{n&&n([e]),l(G.Success)}}))}))},87053:(e,t,n)=>{"use strict";n.d(t,{v:()=>R});var o=n(50016),r=n(63680),a=n(21746),l=n(76448),i=n(44575),s=n(31612),c=n(29731),d=n(73819),u=n(12344),m=n(95199);const p="v2-card",g=e=>(0,m.j)({queryKey:[p,"newCardSession"],queryFn:()=>i.A.newCardSession(),...e}),h="LinkCardModal_rainforestContainer__PzIOu";var v=n(41436),y=n(33373);const b=(0,r.PA)((e=>{let{opened:t,cardRequest:n,onClose:r,onNext:a}=e;const{t:l}=(0,c.Bd)("global"),[i,s]=(0,o.useState)(!1),[m,p]=(0,o.useState)(!1),b=(0,o.useRef)(null),C=(0,o.useRef)(a),{data:A,error:S}=(0,u.I)(g());return(0,o.useEffect)((()=>{C.current=a}),[a]),(0,o.useEffect)((()=>{if(S)return s(!0),void y.A.clientError({message:"New Card Session Error",withSlack:!0,error:S});if(!A||!b.current)return;let e=!1,t=null;const o=async e=>{var t,o,r;const a=E(e),l=null===a||void 0===a||null===(t=a.data)||void 0===t?void 0:t.payment_method_id;if(!l)return y.A.clientError({message:"Payment method ID missing from approved payment event",withSlack:!0,error:a}),void s(!0);n.paymentMethodId=l,n.billingAddress.zipCode=null===(o=a.data)||void 0===o||null===(r=o.billing_contact)||void 0===r?void 0:r.postal_code,C.current()},r=e=>{const t=E(e);y.A.clientError({message:"Card declined",withSlack:!0,error:t}),s(!0)},a=e=>{const t=E(e);y.A.clientError({message:"Add Card error",withSlack:!0,error:t}),s(!0)},l=()=>{p(!0)};return f(A.paymentScriptUrl).then((()=>{!e&&b.current&&(b.current.innerHTML="",t=document.createElement("rainforest-payment"),t.setAttribute("payment-method-config-id",A.paymentMethodConfigId),t.setAttribute("session-key",A.sessionKey),t.setAttribute("allowed-methods","CARD"),t.setAttribute("style-container-padding","0px"),t.addEventListener("approved",o),t.addEventListener("declined",r),t.addEventListener("error",a),t.addEventListener("loaded",l),b.current.appendChild(t))})).catch((t=>{y.A.clientError({message:"Failed to load payment script",withSlack:!0,error:t.message}),e||s(!0)})),()=>{e=!0,t&&(t.removeEventListener("approved",o),t.removeEventListener("declined",r),t.removeEventListener("error",a),t.removeEventListener("loaded",l))}}),[A,S,n]),o.createElement(d.Vm,{opened:t,onClose:r,title:l("common.paymentMethods.addCard.linkCard"),size:500},o.createElement(d.Vm.Content,null,!m&&!i&&o.createElement(v.o,{pb:112,pt:56},o.createElement(d.aC,null)),o.createElement("div",{ref:b,className:h,style:{display:m?"block":"none"}}),i&&o.createElement(d.W_,{mb:24,"data-testid":"common.paymentMethods.addCard.error"},l("common.paymentMethods.addCard.error"))))})),f=e=>new Promise(((t,n)=>{if(document.querySelector('script[src="'.concat(e,'"]')))return void t();const o=document.createElement("script");o.type="module",o.src=e,o.onload=()=>t(),o.onerror=()=>n(new Error("Failed to load script: ".concat(e))),document.head.appendChild(o)})),E=e=>{const t=e.detail;return Array.isArray(t)?t[0]:t};
1var C=n(70764),A=n(18529),S=n(56480),w=n(22899),P=n(4557),I=n(91818);const x=(0,r.PA)((e=>{let{cardRequest:t,onClose:n,onBack:r,onNext:a}=e;const{t:l}=(0,c.Bd)("global"),{form:i}=(0,d.Sf)({initialValues:{accountType:t.cardholder.accountType,firstName:t.cardholder.firstName,lastName:t.cardholder.lastName,businessName:t.cardholder.businessName},validate:{firstName:(e,t)=>t.accountType!==I.s.Personal||e.trim()?null:l("common.paymentMethods.addCard.fieldRequired"),lastName:(e,t)=>t.accountType!==I.s.Personal||e.trim()?null:l("common.paymentMethods.addCard.fieldRequired"),businessName:(e,t)=>t.accountType!==I.s.Business||e.trim()?null:l("common.paymentMethods.addCard.fieldRequired")}});i.watch("accountType",i.validate);const s=(0,d.qg)(i),u=i.getValues().accountType,m=(0,o.useRef)(null),p=(0,o.useRef)(null),g=(0,o.useRef)(!0);return(0,o.useEffect)((()=>{if(g.current)return void(g.current=!1);const e=setTimeout((()=>{var e;if(u===I.s.Personal)null===(e=m.current)||void 0===e||e.focus();else if(u===I.s.Business){var t;null===(t=p.current)||void 0===t||t.focus()}}),0);return()=>clearTimeout(e)}),[u]),o.createElement(d.Vm,{opened:!0,onClose:n,onBack:r,title:l("common.paymentMethods.addCard.title"),size:500},o.createElement(d.Vm.Content,null,o.createElement(C.B,{gap:0},o.createElement(d.fh,null,o.createElement(A.s.Group,Object.assign({label:o.createElement(S.E,{fw:600,c:"dark.6"},l("common.paymentMethods.addCard.accountType")),"data-testid":"common.paymentMethods.addCard.accountType"},i.getInputProps("accountType")),o.createElement(C.B,{gap:8,my:16},o.createElement(A.s,{value:I.s.Personal,label:l("common.paymentMethods.addCard.personalAccount"),"data-testid":"common.paymentMethods.addCard.personalAccount"}),o.createElement(A.s,{value:I.s.Business,label:l("common.paymentMethods.addCard.businessAccount"),"data-testid":"common.paymentMethods.addCard.businessAccount"})))),u===I.s.Personal&&o.createElement(o.Fragment,null,o.createElement(d.fh,null,o.createElement(w.k,Object.assign({ref:m,key:i.key("firstName"),label:l("common.paymentMethods.addCard.firstName"),"data-testid":"common.paymentMethods.addCard.firstName","data-autofocus":!0,withAsterisk:!0},i.getInputProps("firstName")))),o.createElement(d.fh,null,o.createElement(w.k,Object.assign({key:i.key("lastName"),label:l("common.paymentMethods.addCard.lastName"),"data-testid":"common.paymentMethods.addCard.lastName",withAsterisk:!0},i.getInputProps("lastName"))))),u===I.s.Business&&o.createElement(d.fh,null,o.createElement(w.k,Object.assign({"data-autofocus":!0,ref:p,key:i.key("businessName"),label:l("common.paymentMethods.addCard.nameOnCard"),"data-testid":"common.paymentMethods.addCard.nameOnCard",withAsterisk:!0},i.getInputProps("businessName")))))),o.createElement(d.Vm.Buttons,{mt:0},o.createElement(P.$,{miw:150,onClick:()=>{i.validate().hasErrors||(t.cardholder=i.getValues(),a())},disabled:!s,"data-testid":"common.paymentMethods.addCard.next"},l("common.paymentMethods.addCard.next"))))}));var D=n(89310),T=n(82997),k=n(91409);const B=(0,r.PA)((e=>{let{cardRequest:t,isSubmitting:n,onClose:r,onBack:a,onSubmit:l}=e;const{t:i}=(0,c.Bd)("global"),{form:s}=(0,d.Sf)({initialValues:{addressLine1:t.billingAddress.addressLine1,addressLine2:t.billingAddress.addressLine2,city:t.billingAddress.city,stateCode:t.billingAddress.stateCode},validate:{addressLine1:(0,k.h)(i("common.paymentMethods.addCard.fieldRequired")),city:(0,k.h)(i("common.paymentMethods.addCard.fieldRequired")),stateCode:(0,k.h)(i("common.paymentMethods.addCard.fieldRequired"))}}),u=(0,d.qg)(s);return o.createElement(d.Vm,{opened:!0,onClose:r,onBack:a,isSubmitting:n,title:i("common.paymentMethods.addCard.addressTitle"),size:500},o.createElement(d.Vm.Content,null,o.createElement(C.B,{gap:0},o.createElement(d.fh,null,o.createElement(w.k,Object.assign({key:s.key("addressLine1"),label:i("common.paymentMethods.addCard.streetAddress"),"data-testid":"common.paymentMethods.addCard.streetAddress","data-autofocus":!0,withAsterisk:!0},s.getInputProps("addressLine1")))),o.createElement(d.fh,null,o.createElement(w.k,Object.assign({key:s.key("addressLine2"),label:i("common.paymentMethods.addCard.aptSteBldg"),"data-testid":"common.paymentMethods.addCard.aptSteBldg"},s.getInputProps("addressLine2")))),o.createElement(d.fh,null,o.createElement(w.k,Object.assign({key:s.key("city"),label:i("common.paymentMethods.addCard.city"),"data-testid":"common.paymentMethods.addCard.city",withAsterisk:!0},s.getInputProps("city")))),o.createElement(d.fh,null,o.createElement(D.l,Object.assign({key:s.key("stateCode"),label:i("common.paymentMethods.addCard.state"),"data-testid":"common.paymentMethods.addCard.state",withAsterisk:!0,data:T.bx.xj,searchable:!0},s.getInputProps("stateCode")))))),o.createElement(d.Vm.Buttons,{mt:0},o.createElement(P.$,{miw:150,onClick:async()=>
1{if(s.validate().hasErrors)return;const e=s.getValues();t.billingAddress.addressLine1=e.addressLine1,t.billingAddress.addressLine2=e.addressLine2,t.billingAddress.city=e.city,t.billingAddress.stateCode=e.stateCode,l()},disabled:!u||n,"data-testid":"common.paymentMethods.addCard.submit"},i("common.paymentMethods.addCard.submit"))))})),F=e=>{let{successMessage:t,onClose:n}=e;const{t:r}=(0,c.Bd)("global");return o.createElement(d.HD,{icon:o.createElement(d.GQ,{type:"success"}),title:r("common.paymentMethods.addCard.successTitle"),buttons:[r("common.paymentMethods.addCard.done")],testId:"AddCreditCard.SuccessModal",onClose:n},t||r("common.paymentMethods.addCard.successCommon"))};var _=n(83613),N=function(e){return e[e.LinkCard=0]="LinkCard",e[e.Cardholder=1]="Cardholder",e[e.Address=2]="Address",e[e.Success=3]="Success",e}(N||{});const R=(0,r.PA)((e=>{let{owner:t,oldAccountId:n,successMessage:d,onClose:u,onRefetchPaymentMethods:m,onSuccess:p}=e;const{t:g}=(0,c.Bd)("global"),[h,v]=(0,o.useState)(""),[y,f]=(0,o.useState)(!1),{step:E,goNext:C,goBack:A,goTo:S}=(0,a.q)(N),w=(0,r.iz)((()=>({paymentMethodId:"",cardholder:{accountType:I.s.Personal,firstName:"",lastName:"",businessName:""},billingAddress:{addressLine1:"",addressLine2:"",city:"",stateCode:"",zipCode:""}}))),{mutateAsync:P}=(0,l.n)({mutationFn:e=>i.A.saveCard(e)});return o.createElement(o.Fragment,null,E===N.LinkCard&&o.createElement(b,{cardRequest:w,onClose:u,onNext:C}),E===N.Cardholder&&o.createElement(x,{cardRequest:w,onClose:u,onBack:A,onNext:C}),E===N.Address&&o.createElement(B,{cardRequest:w,onClose:u,onBack:A,onSubmit:async()=>{const e={paymentMethodId:w.paymentMethodId,cardholder:w.cardholder,billingAddress:w.billingAddress,oldAccountId:n,owner:t};f(!0);try{const t=await P(e);m?await m():await _.A.screensStore.paymentMethodsStore.fetchPaymentMethods(),v(t.cardId),S(N.Success)}catch(r){var o;s.$e.show({variant:"error",message:null!==(o=r.message)&&void 0!==o?o:g("system-failure")})}finally{f(!1)}},isSubmitting:y}),E===N.Success&&o.createElement(F,{successMessage:d,onClose:()=>p({cardId:h})}))}))},77343:(e,t,n)=>{"use strict";n.d(t,{Zb:()=>_,NX:()=>A,Mf:()=>g});var o=n(50016),r=n(5438),a=n(29731),l=n(91162),i=n(83613),s=n(5685),c=n(70764),d=n(74655),u=n(56480),m=n(58876);const p=(0,r.PA)((e=>{let{method:t,loading:n,showPrimary:r}=e;const{t:s}=(0,a.Bd)("global"),p=i.A.screensStore.paymentMethodsStore,g=p.primaryMethod,h=t.paymentMethodType===m.mf.Bank,v=s("common.paymentMethods.methodName",{name:l.A.getShortName(t),number:l.A.escapeAccountNumber(t)}),y=t===g,b=s(h?"common.paymentMethods.select.defaultBank":"common.paymentMethods.select.defaultCard");return o.createElement(c.B,{h:r?38:26,justify:"center",gap:0},n||p.loading?o.createElement(d.a,{size:"xs"}):o.createElement(o.Fragment,null,o.createElement(u.E,null,v),r&&y&&o.createElement(u.E,{fz:12,c:"gray.6"},b)))})),g=(0,r.PA)((e=>{let{paymentMethods:t,value:n,onSelect:r,label:c,placeholder:d,required:u=!1,disabled:m,loading:g=!1,showPrimary:h=!0,testID:v="payment-method-select",initiallyOpen:y=!1}=e;const{t:b}=(0,a.Bd)("global"),f=i.A.screensStore.paymentMethodsStore,E=f.primaryMethod,C=void 0!==t?t:i.A.remoteConfig.acceptCards?f.paymentMethods:f.banks,A=C.includes(E),S=C.filter(Boolean).map((e=>({value:e.id,label:b("common.paymentMethods.methodName",{name:l.A.getShortName(e),number:l.A.escapeAccountNumber(e)}),meta:e}))),w=h&&A,P=w?56:42;return o.createElement(s.Z,{options:S,value:n,onChange:e=>{if(e){const t=C.find((t=>t.id===e));t&&r(t)}else r(null)},label:c||b("common.paymentMethods.select.label"),placeholder:d,required:u,disabled:m||f.loading||g,testId:v,initiallyOpen:y,styles:{input:{height:P}},renderDisplayValue:e=>{let[t]=e;return null!==t&&void 0!==t&&t.meta?o.createElement(p,{method:t.meta,loading:g,showPrimary:w}):null},renderOption:e=>o.createElement(p,{method:e.meta,loading:g,showPrimary:w})})}));var h=n(50767),v=n(69267),y=n(89673),b=n(51599);const f="DefaultPaymentMethodCard_badge__mAfZu",E="DefaultPaymentMethodCard_button__QSRun";var C=n(97076);const A=(0,r.PA)((e=>{let{onPress:t}=e;const{t:n}=(0,a.Bd)("global"),r=i.A.screensStore.paymentMethodsStore,s=r.primaryMethod,p=(null===s||void 0===s?void 0:s.paymentMethodType)===m.mf.Bank,g=s?n(p?"common.paymentMethods.defaultMethodCard.bankAccount":"common.paymentMethods.defaultMethodCard.card",{number:l.A.escapeAccountNumber(s)}):null;return o.createElement(h.a,{pos:"relative"},o.createElement(v.E,{color:"green",classNames:{root:f}},n("common.paymentMethods.defaultMethodCard.defaultBadge")),o.createElement(y.N,{className:E,"data-testid":"DefaultPaymentMethodCard",onClick:t},r.loading?o.createElement(d.a,{size:"xs"}):o.createElement(b.Y,{justify:"space-between",align:"center",wrap:"nowrap"},o.createElement(c.B,{gap:2},o.createElement(u.E,{fw:600,fz:16},g),s&&o.createElement(u.E,{fz:12,c:"dimmed"},l.A.getShortName(s))),s&&(p?o.createElement(C.P9R,null):o.createElement(C.Xlz,null)))))}));var S=n(63680),w=n(73819),P=n(75488),I=n(39797);const x=(0,S.PA)((e=>{let{title:t,description:n,withBanks:r=!0,withCards:l=!0,onConnectBank:s,onLinkCard:d,onClose:m,onBack:p}=e;const{t:g}=(0,a.Bd)("global"),h=l&&i.A.remoteConfig.acceptCards;return o.createElement(w.Vm,{title:null!==t&&void 0!==t?t:g("common.paymentMethods.addPaymentMethodFlow.title"),"data-testid":"add-new-payment-method-modal",onClose:m,onBack:p},o.createElement(w.Vm.Content,null,o.createElement(c.B,{gap:16},o.createElement(u.E,{fz:16,mb:16},g((null!==n&&void 0!==n?n:h)?"common.paymentMethods.addPaymentMethodFlow.description":"common.paymentMethods.addPaymentMethodFlow.descriptionNoCards")),o.createElement(P.y,{title:g("ConnectYourBank"),subtitle:g("ConnectionsAreEncrypted"),leftIcon:o.createElement(I.$,{type:"bank"}),disabled:!r,"data-testid":"add-bank-account",onClick:s}),o.createElement(P.y,{title:g("LinkYourCard"),subtitle:g("CardDetail
1sAreTokenized"),leftIcon:o.createElement(I.$,{type:"card"}),disabled:!h,"data-testid":"add-card",mb:16,onClick:d}))))}));var D=n(86277),T=n(87053),k=n(34956),B=n(2745),F=function(e){return e[e.AddPaymentMethod=0]="AddPaymentMethod",e[e.AddBankAccount=1]="AddBankAccount",e[e.AddCard=2]="AddCard",e}(F||{});const _=e=>{let{title:t,description:n,withBanks:r=!0,withCards:a=!0,onAdded:l,onClose:i,onBack:s}=e;const[c,d]=(0,o.useState)(F.AddPaymentMethod),{paymentMethods:u}=(0,k.mu)(),p=()=>d(F.AddPaymentMethod);return o.createElement(o.Fragment,null,c===F.AddPaymentMethod&&o.createElement(x,{title:t,description:n,withBanks:r,withCards:a,onLinkCard:()=>d(F.AddCard),onConnectBank:()=>d(F.AddBankAccount),onClose:i,onBack:s}),c===F.AddBankAccount&&o.createElement(D.j,{onClose:p,onSuccess:e=>{l({account:(0,B.toJS)(u.find((t=>t.id===e[0]))),type:m.mf.Bank,id:e[0]})},onFinish:i}),c===F.AddCard&&o.createElement(T.v,{onClose:p,onSuccess:e=>{let{cardId:t}=e;l({account:(0,B.toJS)(u.find((e=>e.id===t))),type:m.mf.Card,id:t})}}))}},18731:(e,t,n)=>{"use strict";n.d(t,{A:()=>w,N:()=>I});var o=n(50016),r=n(51599),a=n(70764),l=n(56480),i=n(9015),s=n(23588),c=n(47450),d=n(14344),u=n(24509),m=n(83639),p=n(8724),g=n(64870),h=n(82997),v=n(38767),y=n(29731),b=n(97076);const f="UploadedFile_filePanel__X5F0o",E="UploadedFile_fileName__+ZaqK",C="UploadedFile_fileSize__CKwKw",A="UploadedFile_statusText__xaELE",S="UploadedFile_progress__YCX3x";let w=function(e){return e[e.Idle=0]="Idle",e[e.Uploading=1]="Uploading",e[e.Uploaded=2]="Uploaded",e[e.Failed=3]="Failed",e}({});const P={pdf:b.GVE,jpg:b.gM5,jpeg:b.gM5,png:b.$4B},I=e=>{let{fileName:t,fileSize:n,filePath:b,status:I,progress:x=0,showCompletedBadge:D=!0,onClear:T,...k}=e;const{t:B}=(0,y.Bd)("global"),F=(e=>{var t,n,o;const r=null!==(t=null===e||void 0===e||null===(n=e.split(".").pop())||void 0===n?void 0:n.toLowerCase())&&void 0!==t?t:"";return null!==(o=P[r])&&void 0!==o?o:c.A})(t);return o.createElement(r.Y,Object.assign({className:f,justify:"space-between",align:"flex-start",wrap:"nowrap"},k),o.createElement(r.Y,{gap:"md",wrap:"nowrap",align:"center",style:{minWidth:0}},o.createElement(F,{size:40,style:{flexShrink:0}}),o.createElement(a.B,{gap:2,style:{minWidth:0}},o.createElement(l.E,{className:E,truncate:!0},t),o.createElement(r.Y,{gap:"xs",wrap:"nowrap",align:"center"},!!n&&o.createElement(l.E,{className:C},"".concat((n/1048576).toFixed(1)," MB")),I===w.Uploading&&o.createElement(o.Fragment,null,o.createElement(i.k,{value:x,size:"sm",className:S}),o.createElement(l.E,{className:A},x,"%")),I===w.Uploaded&&D&&o.createElement(o.Fragment,null,o.createElement(d.A,{size:16,color:"var(--mantine-color-green-6)"}),o.createElement(l.E,{className:A},B("receivables.sidebar.edit.upload.completed"))),I===w.Failed&&o.createElement(o.Fragment,null,o.createElement(u.A,{size:16,color:"var(--mantine-color-red-6)"}),o.createElement(l.E,{className:A,c:"red"},B("receivables.sidebar.edit.upload.failed")))))),o.createElement(r.Y,{gap:4,wrap:"nowrap"},!!b&&o.createElement(s.M,{variant:"subtle",c:"gray.7",onClick:()=>h.Vv.NJ.uploadedDocument({key:b}).then((e=>(0,v.mm)(e.url,{},t)))},o.createElement(m.A,{size:20,title:B("receivables.sidebar.edit.upload.download")})),o.createElement(s.M,{variant:"subtle",c:"gray.7",onClick:T},I===w.Uploading?o.createElement(p.A,{size:20,title:B("receivables.sidebar.edit.upload.cancel")}):o.createElement(g.A,{size:20,title:B("receivables.sidebar.edit.upload.delete")}))))}},70813:(e,t,n)=>{"use strict";n.d(t,{d:()=>s});var o=n(50016),r=n(29731),a=n(7371),l=n(78267),i=n(49727);const s=e=>{let{headerMessage:t=!1}=e;const{t:n}=(0,r.Bd)("global");return o.createElement(a.A,{style:t?c.viewStyleForHeader:c.viewStyle},o.createElement(i.A,{style:t?c.textStyleForHeader:c.textStyle},n("PayNowWithVirtualCard.expired")))},c=l.A.create({viewStyle:{width:"100%",height:76,backgroundColor:"rgba(246, 174, 45, 0.2)",borderRadius:8,paddingVertical:16,paddingHorizontal:16},viewStyleForHeader:{height:76,backgroundColor:"rgba(246, 174, 45, 0.2)",paddingVertical:14,paddingHorizontal:20,marginHorizontal:-16},textStyle:{fontWeight:"600",fontSize:14,lineHeight:22,color:"#003353"},textStyleForHeader:{fontWeight:"600",fontSize:16,lineHeight:24,color:"#003353"}})},19190:(e,t,n)=>{"use strict";n.d(t,{A:()=>O});var o=n(38767),r=n(82997),a=n(58876),l=n(70918),i=n(19462);const s=i.types.model("VirtualCardLimit",{cycleType:i.types.enumeration(["PER_TRANSACTION","DAY","MONTH","YEAR","LIFE_TIME"]),remaining:i.types.string,type:i.types.enumeration(["VOLUME","COUNT"]),value:i.types.string}),c=i.types.model("VirtualCard",{cardExpiryDate:i.types.string,cardId:"",cardLimit:"",cardMaskNumber:"",cardName:"",cardNumber:i.types.string,cardStatus:i.types.enumeration(["ACTIVATED","EXPIRED_CARD","TEMPORARY_BLOCKED_BY_CLIENT"]),cardType:"",mccGroupId:"",countryGroupId:"",createdDate:"",limits:i.types.array(s),singleUseCard:"",cvv:i.types.string}).views((e=>({get expiry(){const t=e.cardExpiryDate;return"".concat(t.slice(4),"/").concat(t.slice(0,4))},get expiryByTwoLetters(){const t=e.cardExpiryDate;return"".concat(t.slice(4),"/").concat(t.slice(2,4))},get ccNumber(){var t;return null===(t=e.cardNumber.match(/.{1,4}/g))||void 0===t?void 0:t.join(" ")},get status(){const t=e.cardStatus;switch(t){case a.q_.ACTIVE:return"Active";case a.q_.EXPIRED:return"Expired";case a.q_.TEMPORARY_BLOCKED_BY_CLIENT:return"Temporary Blocked";default:return t}},get approvedAmount(){return+e.limits[0].value}}))),d=i.types.model("CardHolder",{addressLine1:"",addressLine2:"",cardHolderId:"",city:"",country:"",emailId:"",firstName:"",phoneNumber:"",state:"",zipCode:""}).views((e=>({get businessAddress(){return"".concat(e.addressLine1,"\n").concat(e.city,", ").concat(e.state," ").concat(e.zipCode)}})));var u=n(93976),m=n.n(u),p=n(74841),g=n.n(p),h=n(74161),v=n.n(h),y=(n(47059),n(81914),n(40046)),b=n(97976),f=n(16148),E=n(67869);const C={manyPastdueLoans:{message:"PastdueAlert.manyPastdueLoans",buttonLabel:"PastdueAlert.go-to-credit-page",onPress:e=>{e.navigate(E.f0.Console.Credit._self)}},manyPastdueWithLatefee:{message:"PastdueAlert.manyPastdueWithLatefee",buttonLabel:"PastdueAlert.go-to-credit-page",onPress:e=>{e.navigate(E.f0.Console.Credit._self)}},singlePastDueLoan:{message:"PastdueAlert.singlePastDueLoan",buttonLabel:"PastdueAlert.make-payment",onPress:null},singlePastDueLoanWithLateFee:{message:"PastdueAlert.singlePastDueLoanWithLateFee",buttonLabel:"PastdueAlert.pay-loan-now",onPress:null}};var A=n(2745),S=n(25606),w=n(47822),P=n(61390),I=n(91162);const{PAST_DUE_LATE:x,PAST_DUE:D,DUE_NEXT:T,PAST_DUE_LATE_AND_INTEREST:k,PAST_DUE_PENALTY:B}=l.Vi,{LATE_FEE:F,EXTENSION_FEE:_}
1=l.MR,{POSTPONED:N,RESCHEDULED:R}=l.Mu,L={creditAppliedInvoices:i.types.maybeNull(i.types.array(i.types.frozen())),virtualCard:i.types.maybeNull(c),cardHolder:i.types.maybeNull(d),loansWithUnusedCards:i.types.optional(i.types.array(i.types.frozen()),[]),approvedLoans:i.types.optional(i.types.array(i.types.frozen()),[]),authorizedQuotes:i.types.optional(i.types.array(i.types.frozen()),[]),loading:i.types.optional(i.types.boolean,!1),loan:i.types.maybeNull(i.types.frozen()),company:i.types.maybeNull(i.types.frozen()),supplier:i.types.maybeNull(i.types.frozen()),overdueLoans:i.types.optional(i.types.array(i.types.frozen()),[]),supplierRepays:i.types.optional(i.types.boolean,!1),loanApplication:i.types.maybeNull(i.types.frozen()),alertData:i.types.maybeNull(i.types.frozen())};const M=i.types.compose(i.types.model(L).views((function(e){return{get hasUnusedVirtualCard(){return!!e.loansWithUnusedCards.length},get unusedActiveCards(){return e.loansWithUnusedCards.filter((t=>{var n;return!e.isExpired(null===(n=t.card)||void 0===n?void 0:n.status)}))},get hasUnsedActiveCards(){return!!e.unusedActiveCards.length},get isPrequalifiedApplication(){const e=b.A.userStore.document;return!(null!==e&&void 0!==e&&e.invoice_id)},get shouldGoToCreditHome(){return e.hasUnusedVirtualCard&&!e.hasUnsedActiveCards&&!e.approvedLoans.length&&![a.r7.APPROVED,a.r7.EXPIRED].find((e=>{var t;return(null===(t=b.A.userStore.document)||void 0===t?void 0:t.loanStatus)===e}))},get isPaidOff(){var t;return(null===(t=e.loan)||void 0===t?void 0:t.status)===l.sG.CLOSED},get creditDecisionMade(){const{settings:e,document:t}=b.A.userStore;return e.get("previouslyApproved")||(null===t||void 0===t?void 0:t.loanStatus)===a.r7.REJECTED},get previousLoans(){return e.approvedLoans.filter((e=>{var t;return[l.sG.CLOSED,l.sG.REFINANCED].includes(null===(t=e.lms)||void 0===t?void 0:t.status)}))},get activeLoans(){return e.approvedLoans.filter((e=>{var t;return![l.sG.CLOSED,l.sG.CANCELED,l.sG.REFINANCED].includes(null===(t=e.lms)||void 0===t?void 0:t.status)}))},get totalExtensionFee(){var t;return null===(t=e.loan.activeReceivables)||void 0===t?void 0:t.reduce(((e,t)=>t.type===l.y9.EXTENSION_FEE?e+t.expectedAmount:e),0)},get numberOfInstallments(){var t;const n=null===(t=e.loan)||void 0===t?void 0:t.loanTemplate,o=n.installmentsNumber>1?"Payments":"Payment";return n.changeType===l.UY.RESCHEDULE||1===n.installmentsNumber?"".concat(n.installmentsNumber," ").concat(o):"".concat(n.installmentsNumber," weekly payments")},get penaltySum(){return this.activeLoans.reduce(((e,t)=>{var n,o;return e+(null===(n=t.lms)||void 0===n||null===(o=n.loanDetails)||void 0===o?void 0:o.totalDailyPenaltyInterest)||0}),0)},get processingSum(){return this.activeLoans.reduce(((e,t)=>{var n,o;return e+(null===(n=t.lms)||void 0===n||null===(o=n.loanDetails)||void 0===o?void 0:o.totalProcessingPaymentsAmount)||0}),0)},get totalPastDueAmount(){return this.activeLoans.reduce(((e,t)=>{var n,o;return e+(null===(n=t.lms)||void 0===n||null===(o=n.loanDetails)||void 0===o?void 0:o.lateAmount)||0}),0)},get bankAccountValue(){return I.A.getLongName(b.A.screensStore.paymentMethodsStore.primaryCreditMethod)}}})).actions((function(e){return{setLoan:t=>{e.loan=t},setCompany:t=>{e.company=t},setSupplier:t=>{e.supplier=t},setLoading:t=>{e.loading=t},setLoanApplication:t=>{e.loanApplication=t},isExpired:e=>e===r.bx.q_.EXPIRED,createLoanApp(e){r.Vv.kQ.loanApplication().then((()=>{b.A.userStore.fetchDocument(P.X.Credit),e&&e()}))},setSupplierPays(t){e.supplierRepays=t},setCreditAppliedInvoices:t=>{const n=[...Array.isArray(t)?t:[t]];e.creditAppliedInvoices=n,e.setLoading(!1)},setVirtualCard:t=>{e.virtualCard=c.create(t)},setCardHolder:t=>{e.cardHolder=d.create(t)},setLoansWithUnusedCards:t=>{e.loansWithUnusedCards=t},setApprovedLoans:t=>{e.approvedLoans=t},setAuthorizedQuotes:t=>{e.authorizedQuotes=t},setAlertData:t=>{e.alertData=t},getPastdueAlertType:async()=>{const t=e.overdueLoans.filter((e=>{var t;return(null===(t=e.lms)||void 0===t?void 0:t.currentStatus)===x}));if(t.length>1){let n=0;t.forEach((t=>n+=e.totalUnpaidLatefee(t.lms))),e.setAlertData({...C.manyPastdueWithLatefee,lateFee:n})}else if(e.overdueLoans.length>1)e.setAlertData(C.manyPastdueLoans);else{var n;const t=e.totalUnpaidLatefee(null===(n=e.overdueLoans[0])||void 0===n?void 0:n.lms);t?e.setAlertData({...C.singlePastDueLoanWithLateFee,lateFee:t}):e.setAlertData(C.singlePastDueLoan)}},fetchCreditAppliedInvoices:async t=>{var n;const o=t||(null===(n=b.A.userStore.document)||void 0===n?void 0:n.invoice_id);if(o){const t=await r.JZ.rN.show({id:o});e.setCreditAppliedInvoices(t.invoices)}},fetchVirtualCard:async t=>{e.setLoading(!0);try{const n=await r.Vv.Nr.getVirtualCard({cardId:t});return e.setVirtualCard(n.card),n}
1finally{e.setLoading(!1)}},fetchLoans:async()=>{var t,n;e.setLoading(!0);const o=await r.JZ.IE.loans({page:1,pageSize:75}),i=null!==(t=o.loans)&&void 0!==t?t:[],s=null!==(n=o.totalCount)&&void 0!==n?n:i.length,c=Math.ceil(s/75),d=await Promise.all(Array.from({length:c-1},((e,t)=>r.JZ.IE.loans({page:t+2,pageSize:75})))),u={loans:[...i,...d.flatMap((e=>{var t;return null!==(t=e.loans)&&void 0!==t?t:[]}))]},m=u.loans.filter((e=>{var t;return(null===(t=e.invoiceDetails)||void 0===t?void 0:t.cardId)&&e.card&&!e.card.useDate}));e.setLoansWithUnusedCards(m);const p=await Promise.all(m.map((async e=>{var t;if((null===(t=e.card)||void 0===t?void 0:t.status)===a.q_.EXPIRED)return e;try{var n;const t=await r.Vv.Nr.getVirtualCard({cardId:null===(n=e.invoiceDetails)||void 0===n?void 0:n.cardId});return{...e,cbwCardInfo:t.card,holder:t.holder,invoice:e.invoices[0]}}catch(o){return e}})));e.setLoansWithUnusedCards(p);const g=u.loans.filter((t=>e.isLoanIdExists(t))).sort(((e,t)=>{var n,o,r,l;const i=(null===(n=e.metadata)||void 0===n||null===(o=n.repayment)||void 0===o?void 0:o.autoTradeCreditEnabled)&&e.status===a.r7.PROCESSING,s=(null===(r=t.metadata)||void 0===r||null===(l=r.repayment)||void 0===l?void 0:l.autoTradeCreditEnabled)&&t.status===a.r7.PROCESSING;return i&&!s?-1:!i&&s?1:v()(t.createdAt).diff(v()(e.createdAt))})),h=u.loans.filter((e=>e.status===a.r7.AUTHORIZED)),y=u.loans.filter((e=>{var t,n;return[D,x,k,B].includes(null===(t=e.lms)||void 0===t?void 0:t.currentStatus)&&![l.sG.CLOSED,l.sG.CANCELED].includes(null===(n=e.lms)||void 0===n?void 0:n.status)}));e.setOverDueLoans(y),y.length&&await e.getPastdueAlertType(),e.setApprovedLoans(g),e.setAuthorizedQuotes(h),e.setLoading(!1)},getLoan:t=>e.loansWithUnusedCards.find((e=>{const n=e.invoiceDetails.invoiceId;return m()(n)?n.includes(t):e.invoiceDetails.invoiceId===t})),findLoanSetVirtualCard:t=>{const n=e.getLoan(t);n&&e.setVirtualCard(n.cbwCardInfo),n&&(e.setVirtualCard(n.cbwCardInfo),e.setCardHolder(n.holder))},isLoanIdExists:e=>(null===e||void 0===e?void 0:e.lms_id)||(null===e||void 0===e?void 0:e.loanpro_id),fetchLoan:t=>(e.setLoading(!0),r.JZ.IE.loan(t.lms_id||t.loanpro_id).then((n=>{var o,r,l,i;n.loan&&e.setLoan({...n.loan,cardId:null===(i=t.card)||void 0===i?void 0:i.cardId});n.company&&e.setCompany({...n.company}),e.setSupplierPays((null===(o=n.loanApplication)||void 0===o||null===(r=o.metadata)||void 0===r||null===(l=r.repayment)||void 0===l?void 0:l.loanPaymentCollection)===a.wg.SUPPLIER),n.loanApplication&&n.loanApplication.invoiceDetails&&(e.setLoanApplication(n.loanApplication),e.fetchCreditAppliedInvoices(n.loanApplication.invoiceDetails.invoiceId))})).finally((()=>e.setLoading(!1)))),totalLoanAmountPaid:e=>(null===e||void 0===e?void 0:e.loanDetails.totalPaid)||0,canPay:e=>{const{totalProcessingPaymentsAmount:t,totalLoanAmount:n,totalPaid:o}=(null===e||void 0===e?void 0:e.loanDetails)||{};return(0,w.a)(t+o)<n},totalLoanPastDueScheduledPayment:e=>{var t;return null===e||void 0===e||null===(t=e.activeReceivables)||void 0===t?void 0:t.reduce(((e,t)=>t.type===l.y9.INSTALLMENT&&t.status===l.mu.LATE?e+(t.expectedAmount-t.processingAmount-t.paidAmount):e),0)},totalLoanPastDueExtensionFee:e=>{var t;return null===e||void 0===e||null===(t=e.activeReceivables)||void 0===t?void 0:t.reduce(((e,t)=>t.type===l.y9.EXTENSION_FEE&&t.status===l.mu.LATE?e+(t.expectedAmount-t.processingAmount-t.paidAmount):e),0)},totalLoanExtensionFee:e=>{var t;return null===e||void 0===e||null===(t=e.activeReceivables)||void 0===t?void 0:t.reduce(((e,t)=>t.type===l.y9.EXTENSION_FEE&&t.status===l.mu.DUENEXT?e+(t.expectedAmount-t.processingAmount-t.paidAmount):e),0)},totalLoanPastDueFee:e=>{var t;return(null===e||void 0===e||null===(t=e.activeReceivables)||void 0===t?void 0:t.filter((e=>[l.y9.LATE_FEE,l.y9.MANUAL_LATE_FEE].includes(e.type)))).reduce(((e,t)=>e+(t.expectedAmount-t.processingAmount-t.paidAmount)),0)},totalUnpaidLatefee:e=>{var t;return null===e||void 0===e||null===(t=e.activeReceivables)||void 0===t?void 0:t.reduce(((e,t)=>[l.y9.LATE_FEE,l.y9.MANUAL_LATE_FEE].includes(t.type)&&[l.mu.PENDING,l.mu.LATE].includes(t.status)?e+(t.expectedAmount-t.paidAmount):e),0)},setOverDueLoans(t){e.overdueLoans=t},onClickLink(e){f.HZ?window.open(e,"_blank"):y.A.openURL(e)},onClickMasterLink(){r.JZ.IE.makeAgreement({agreement_type:"master"}).then((e=>{null!==e&&void 0!==e&&e.url&&(f.HZ?(0,o.mm)(e.url,{},e.fileName):y.A.openURL(e.url))}))},bankAccountLabel(e){var t,n,o,r;const a=null===(t=(0,A.toJS)(e))||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.get("bank"))||void 0===o||null===(r=o.items.find((e=>"details"===e.identifier)))||void 0===r?void 0:r.content;return"Bank account ".concat(null===a||void 0===a?void 0:a.accountNumber)},getLatestPastDueReceivable(e){var t,n;const o=v()().utc().startOf("day");return(null!==e&&void 0!==e&&null!==(t=e.lms)&&void 0!==t&&t.activeReceivables?[...null===e||void 0===e||null===(n=e.lms)||void 0===n?void 0:n.activeReceivables]:[]).reverse().find((e=>{const t=v().tz(e.expectedDate,"UTC");return[l.mu.PENDING,l.mu.LATE].includes(e.status)&&t.isBefore(o,"day")}))},getDaysDifference:e=>v()().utc().startOf("day").businessDiff(e),getPastDue:(e,t)=>
1e===T?0:t,getPenalty:(e,t)=>[k,B].includes(e)?t:0,lateFeePending(){var t;return!!(null===(t=e.loan)||void 0===t?void 0:t.activeReceivables.find((e=>e.type===l.y9.LATE_FEE&&[l.mu.PENDING,l.mu.LATE].includes(e.status))))},penaltyInterestPending(){var t;return!!(null===(t=e.loan)||void 0===t?void 0:t.activeReceivables.find((e=>e.type===l.y9.PENALTY_INTEREST_FEE&&[l.mu.PENDING,l.mu.LATE].includes(e.status))))},getPartialProcessingDetails(e,t){const{totalProcessingPaymentsAmount:n,totalDailyPenaltyInterest:o}=e,r={loanReceivableId:"",amount:0};if((0,S.L)(n)>0){let e=(0,S.L)(n)-(0,S.L)(o);[...t.filter((e=>[F,_].includes(e.itemType)&&![N,R].includes(e.dueStatus))),...t.filter((e=>e.itemType===l.MR.INSTALLMENT&&![N,R].includes(e.dueStatus)))].forEach((n=>{e>=n.amount?(e=(0,S.L)(e-n.amount),t.map((e=>(e.loanReceivableId===n.loanReceivableId&&(e.dueStatus=l.mu.PROCESSING),e)))):!r.loanReceivableId&&e&&(r.loanReceivableId=n.loanReceivableId,r.amount=e,t.map((t=>(t.loanReceivableId===n.loanReceivableId&&(t.amount=(0,S.L)(t.amount-e)),t))))}))}return r}}}
1)),(0,r.E2)()).named("CreditStore").create({});g()(M);const O=M},47711:(e,t,n)=>{"use strict";n.d(t,{H:()=>c});var o=n(50016),r=n(29731),a=n(78267),l=n(38117),i=n(19925),s=n(10150);const c=e=>{let{visible:t,setVisible:n}=e;const{t:a}=(0,r.Bd)("global"),{sm:c}=(0,i.Qs)();return o.createElement(s.A,{visible:t,height:c?"25%":"40%",width:c?400:void 0,onClose:()=>n(!1),title:o.createElement(l.A,{style:d.title},a("CreditTab.why-penalty-is-charged-title"))},o.createElement(l.A,{style:d.subtitle},a("CreditTab.why-penalty-is-charged-message")))},d=a.A.create({title:{fontWeight:"700",fontSize:20,lineHeight:28,color:"#003353",marginLeft:-30,flex:1},subtitle:{fontWeight:"500",fontSize:14,lineHeight:22,color:"#003353"}})},47822:(e,t,n)=>{"use strict";n.d(t,{a:()=>a});var o=n(21786),r=n.n(o);const a=e=>Number(r()(e).format({mantissa:2}))},85926:(e,t,n)=>{"use strict";n.d(t,{A:()=>T,U:()=>D});var o=n(82345),r=n(5438),a=n(50016),l=n(29731),i=n(74907),s=n(78267),c=n(7371),d=n(49727),u=n(38767),m=n(68215),p=n(82997),g=n(97081),h=n(20282),v=n(51567),y=n(71744),b=n(35118),f=n(67869),E=n(49606),C=n(70813),A=n(19190),S=n(4834),w=n(23600),P=n(93976),I=n.n(P),x=n(67956);const D=(0,r.PA)((e=>{var t,n,r,s,S,P,D;let{style:T,mobileView:B=!1,data:F}=e;const{isExpired:_}=A.A,{t:N}=(0,l.Bd)("global"),R=(0,o.useNavigation)(),L=(0,a.useMemo)((()=>{var e;return _(null===(e=F.card)||void 0===e?void 0:e.status)}),[F,_]);return a.createElement(c.A,{style:(0,u.composeStyle)(k.rootView,{minHeight:B&&195},T)},a.createElement(c.A,{style:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}},a.createElement(d.A,{numberOfLines:1,ellipsizeMode:"tail",style:{maxWidth:130,fontWeight:"500",fontSize:16,lineHeight:24,color:m.commonColors.textDark}},(null===F||void 0===F||null===(t=F.invoices[0])||void 0===t||null===(n=t.supplierInvitationDetails)||void 0===n?void 0:n.name)||(null===F||void 0===F||null===(r=F.company)||void 0===r?void 0:r.name)),a.createElement(d.A,{style:{fontWeight:"500",fontSize:16,lineHeight:24,color:"#003353"}},"$ ",(0,b.f)(null===F||void 0===F?void 0:F.approvedAmount))),a.createElement(c.A,{style:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}},a.createElement(d.A,{style:{fontWeight:"500",fontSize:12,lineHeight:20,color:m.commonColors.textLight}},"Due on ".concat((0,x.jr)((null===(s=F.invoices[0])||void 0===s?void 0:s.invoice_due_date)||""))),L&&a.createElement(y.n,{label:null===(S=g.Od[p.bx.uR.expired])||void 0===S?void 0:S.label,textColor:"#F25A68"})),a.createElement(h.hK,{height:14}),L&&a.createElement(a.Fragment,null,a.createElement(C.d,null),a.createElement(h.hK,{height:14})),!L&&a.createElement(c.A,{style:{flexDirection:"row",justifyContent:"space-between"}},a.createElement(c.A,null,a.createElement(i.A,{source:{uri:w},resizeMode:"contain",style:k.imageBackground},a.createElement(d.A,{style:{position:"absolute",left:6,top:24,fontWeight:"700",fontSize:9,color:"white"}},null===(P=F.cbwCardInfo)||void 0===P||null===(D=P.cardNumber)||void 0===D?void 0:D.slice(12)))),a.createElement(d.A,{style:{fontWeight:"500",fontSize:14,lineHeight:18,color:"#003353",alignSelf:"center",marginLeft:13}},N("PayNowWithVirtualCard.message"))),(()=>{let e;return e=L?a.createElement(E.l,{navigation:R},a.createElement(c.A,{style:k.uploadButton},a.createElement(d.A,{style:k.buttonText},N("PayNowWithVirtualCard.upload-new-invoice")))):a.createElement(v.P,{buttonStyle:{marginTop:12,width:"100%",borderRadius:4},contentStyle:{height:41},onPress:()=>{return R.navigate(f.f0.Console.Credit._self,{screen:f.f0.Console.Credit.VirtualCard,params:{id:(e=F.invoiceDetails.invoiceId,I()(e)?e[0]:e)}});var e}},N("PayNowWithVirtualCard.see-card-details")),e})())})),T=e=>{let{mobileView:t=!1,dontShowExpired:n=!1}=e;const{t:o}=(0,l.Bd)("global");
1return a.createElement(c.A,{style:k.rootView2},a.createElement(d.A,{style:k.heading},o("PayNowWithVirtualCard.ready-to-pay")),a.createElement(h.hK,{height:20}),a.createElement(S.M,{spacer:13,dontShowExpired:n,mobileView:t}))},k=s.A.create({rootView:{marginHorizontal:5,borderRadius:8,borderColor:"#E6EBEE",borderWidth:1,alignSelf:"center",shadowColor:"rgb(21, 41, 82)",backgroundColor:"white",shadowOpacity:.03,shadowRadius:20,paddingHorizontal:20,paddingTop:19,paddingBottom:17},rootView2:{minHeight:282,backgroundColor:"#F4F9FD",paddingHorizontal:20,paddingVertical:25,marginHorizontal:-16,marginBottom:20},heading:{fontWeight:"600",fontSize:16,lineHeight:22},uploadButton:{height:41,backgroundColor:m.commonColors.accentText,width:"100%",borderRadius:4,alignItems:"center",justifyContent:"center"},buttonText:{fontWeight:"500",fontSize:16,lineHeight:24,color:"white"},imageBackground:{padding:25}})},63146:(e,t,n)=>{"use strict";n.d(t,{M:()=>p});var o=n(50016),r=n(29731),a=n(78267),l=n(7371),i=n(38117),s=n(4670),c=n(97076),d=n(47711),u=n(38767),m=n(67956);const p=e=>{let{isMobile:t,amount:n}=e;const{t:a}=(0,r.Bd)("tradeCredit"),[p,h]=(0,o.useState)(!1),v=t?(0,u.composeStyle)(g.text,g.mobileText):g.text,y=t?(0,u.composeStyle)(g.message,g.mobileMessage):g.message,b=t?(0,u.composeStyle)(g.amount,g.mobileAmount):g.amount;return o.createElement(l.A,{style:g.layoutContainer},o.createElement(l.A,{style:g.headerView},o.createElement(l.A,{style:g.penaltyTitleContainer},o.createElement(i.A,{style:v},a("tradeCredit.drawDetails.activitySummary.penaltyInterestTitle")),o.createElement(s.A,{style:t?g.mobileInfo:g.info,onPress:()=>h(!0)},o.createElement(c.Zxu,{style:{width:18,height:18}}))),o.createElement(l.A,{style:g.amountContainer},o.createElement(i.A,{style:b},(0,m.Wl)(n)))),o.createElement(l.A,{style:g.infoContainer},o.createElement(i.A,{style:y},a("tradeCredit.drawDetails.activitySummary.penaltyInterestInfo"))),o.createElement(d.H,{visible:p,setVisible:h}))},g=a.A.create({layoutContainer:{flexDirection:"column",paddingHorizontal:16,marginBottom:12,minWidth:343,backgroundColor:"#F8F9F9",border:0,borderRadius:8,paddingVertical:16},headerView:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",marginBottom:10},penaltyTitleContainer:{flexDirection:"row",alignItems:"center"},amountContainer:{alignItems:"flex-end"},infoContainer:{flexDirection:"row"},text:{fontWeight:"700",fontFamily:"Inter",fontSize:20,letterSpacing:-.1,lineHeight:20,color:"#172B4D"},mobileText:{fontSize:14},mobileMessage:{fontSize:12,lineHeight:18},mobileAmount:{fontSize:16,lineHeight:20},message:{fontWeight:"500",fontSize:14,fontFamily:"Inter",lineHeight:20,color:"#172B4D"},amount:{fontWeight:"700",fontFamily:"Inter",fontSize:20,lineHeight:24,color:"#FF7926"},info:{marginLeft:11,marginTop:1},mobileInfo:{marginLeft:8,marginBottom:1}})},4834:(e,t,n)=>{"use strict";n.d(t,{M:()=>g});var o=n(63680),r=n(50016),a=n(29731),l=n(7371),i=n(38117),s=n(78267),c=n(20282),d=n(55502),u=n(94435),m=n(19190),p=n(85926);const g=(0,o.PA)((e=>{let{spacer:t=0,mobileView:n=!1,dontShowExpired:o=!1,asCarousel:s=!1,asDesktopCards:g=!1}=e;const{loansWithUnusedCards:v,isExpired:y,unusedActiveCards:b}=m.A,{t:f}=(0,a.Bd)("global"),E=g?{marginVertical:20}:null,C=(e,a,i)=>{var s;return o&&y(null===(s=e.card)||void 0===s?void 0:s.status)?null:r.createElement(l.A,{style:a},r.createElement(p.U,{data:e,mobileView:n,style:i&&{alignSelf:"stretch",marginBottom:20}}),!!t&&r.createElement(c.hK,{height:t}))};return s&&b.length>1?r.createElement(l.A,{style:h.mobileSection},r.createElement(i.A,{style:h.mobileSectionTitle},f("PayNowWithVirtualCard.title")),r.createElement(u.FN,null,v.map((e=>C(e,E))))):g&&b.length>1?r.createElement(r.Fragment,null,v.map((e=>{const t=C(e,E);return t?r.createElement(d.fv,{xs:12,sm:12,md:6,xl:6},t):null}))):g||s?r.createElement(d.fv,{xs:12,sm:12,md:12,xl:6},v.map((e=>C(e,E,!0)))):r.createElement(r.Fragment,null,v.map((e=>C(e,E))))})),h=s.A.create({mobileSection:{backgroundColor:"#F8F9F9",height:250,paddingLeft:20,paddingVertical:17,marginHorizontal:-16,marginVertical:10},mobileSectionTitle:{fontWeight:"700",fontSize:18,lineHeight:24,color:"#003353",marginBottom:16}})},97186:(e,t,n)=>{"use strict";n.d(t,{_:()=>u});var o=n(50016),r=n(29731),a=n(5438),l=n(97976),i=n(73819),s=n(56480
1),c=n(14344),d=n(91162);const u=(0,a.PA)((()=>{var e,t;const{t:n}=(0,r.Bd)("global"),{userStore:a,screensStore:u}=l.A,m=null===(e=a.company)||void 0===e||null===(t=e.settings)||void 0===t?void 0:t.inHouseCredit,p=(null===m||void 0===m?void 0:m.isAutoPayEnabledByCompanyUser)||!1,g=(null===m||void 0===m?void 0:m.isAutoPayRequired)||!1,h=(u.paymentMethodsStore.paymentMethods||[]).find((e=>e.isPrimaryForIHCAutoPay&&!e.isDeactivated));return p&&h?o.createElement(i.Z0,{title:n("PaymentHistoryInvoice.customerReview.autoPayInfo.on.title"),icon:o.createElement(c.A,null)},o.createElement(s.E,null,o.createElement(r.x6,{i18nKey:"PaymentHistoryInvoice.customerReview.autoPayInfo.on.message",values:{paymentMethod:d.A.getLongName(h)},components:{bold:o.createElement(s.E,{span:!0,inherit:!0,fw:700})}}))):o.createElement(i.W_,{title:n(g?"PaymentHistoryInvoice.customerReview.autoPayInfo.offRequired.title":"PaymentHistoryInvoice.customerReview.autoPayInfo.offNotRequired.title")},n(g?"PaymentHistoryInvoice.customerReview.autoPayInfo.offRequired.message":"PaymentHistoryInvoice.customerReview.autoPayInfo.offNotRequired.message"))}))},61328:(e,t,n)=>{"use strict";n.d(t,{e:()=>m});var o=n(50016),r=n(29731),a=n(50767),l=n(23759),i=n(56480),s=n(73819),c=n(76448),d=n(38767),u=n(82997);const m=e=>{let{invoiceIds:t,paymentPlan:n,makeAgreementFn:m}=e;const{t:p}=(0,r.Bd)("global"),{mutate:g,isPending:h}=(0,c.n)({mutationFn:m||(()=>u.JZ.IE.makeAgreement({invoiceIds:t,paymentPlan:n})),onSuccess:e=>(0,d.mm)(null===e||void 0===e?void 0:e.url,{},null===e||void 0===e?void 0:e.fileName)});return o.createElement(a.a,{pos:"relative"},o.createElement(l.p,{visible:h,zIndex:1e3,overlayProps:{radius:"sm",blur:1},loaderProps:{size:"sm"}}),o.createElement(i.E,{style:{whiteSpace:"pre-wrap"}},o.createElement(r.x6,{t:p,i18nKey:"payInvoice.payment-terms-conditions-text",components:{url:o.createElement(s.t5,{onClick:()=>g()})}})))}},57619:(e,t,n)=>{"use strict";n.d(t,{r:()=>l});var o=n(50016),r=n(29731),a=n(73819);const l=()=>{const{t:e}=(0,r.Bd)("global");return o.createElement(a.$Z,{size:"sm"},e("PaymentPlanCard.dates-finalized-when-loan-disbursed"))}},92049:(e,t,n)=>{"use strict";n.d(t,{K:()=>v});var o=n(70764),r=n(56480);const a="PaymentPlanDetails_labelAmount__mRSVZ",l="PaymentPlanDetails_icon__tJvBK";var i=n(61699),s=n(50016),c=n(29731),d=n(58876),u=n(61774),m=n(33119),p=n(24326),g=n(73819),h=n(34956);const v=e=>{let{paymentOption:t,downPayment:n}=e;const{t:v}=(0,c.Bd)("global"),{getRepaymentProcessingFee:y}=(0,h.mu)(),b=t.downPayment.amount,f=(null===n||void 0===n?void 0:n.method)===u.G.Card&&n.accountId?y(b,n.accountId).fee:0,E=b+f;return s.createElement(o.B,{gap:8},E>0&&s.createElement(g.sS,{icon:s.createElement(m.A,null),size:"sm",classNames:{icon:l}},s.createElement(c.x6,{t:v,i18nKey:(null===n||void 0===n?void 0:n.method)===u.G.Card&&f?"PaymentPlanCard.down-payment-amount-with-fee-line":"PaymentPlanCard.down-payment-amount-line",components:{styled:s.createElement(r.E,{span:!0,className:a})},values:{paymentAmount:(0,i.zQ)(E)}})),s.createElement(g.sS,{icon:s.createElement(p.A,null),size:"sm",classNames:{icon:l}},t.metadata.frequency===d.X7.SINGLE?s.createElement(c.x6,{t:v,i18nKey:"PaymentPlanCard.one-time-payment-amount-line",components:{styled:s.createElement(r.E,{span:!0,className:a})},values:{paymentAmount:(0,i.zQ)(t.installmentAmount),days:t.metadata.days}}):1===t.metadata.term?s.createElement(c.x6,{t:v,i18nKey:"PaymentPlanCard.single-payment-amount-line",components:{styled:s.createElement(r.E,{span:!0,className:a})},values:{paymentAmount:(0,i.zQ)(t.installmentAmount),days:t.metadata.days}}):s.createElement(c.x6,{t:v,i18nKey:t.balloonAmount?2===t.metadata.term?"PaymentPlanCard.two-installments-balloon-payment-amount-line":"PaymentPlanCard.multiple-installments-balloon-payment-amount-line":"PaymentPlanCard.multiple-payments-amount-line",components:{styled:s.createElement(r.E,{span:!0,className:a})},values:{paymentAmount:(0,i.zQ)(t.installmentAmount),balloonAmount:t.balloonAmount?(0,i.zQ)(t.balloonAmount):null,days:t.metadata.days,term:t.balloonAmount?t.metadata.term-1:t.metadata.term}})))}},94727:(e,t,n)=>{"use strict";n.d(t,{z:()=>N,g:()=>R});var o=n(50016),r=n(18529),a=n(36238),l=n(70764),i=n(51599),s=n(56480
1),c=n(69267),d=n(38554),u=n(29731),m=n(61699),p=n(57619),g=n(92049),h=n(61774),v=n(92374),y=n(73819),b=n(90213),f=n.n(b);const E="PaymentPlanRadio_radioCard__+wtzW",C="PaymentPlanRadio_selectedCard__d9ep2",A="PaymentPlanRadio_disabledCard__hpc0I",S="PaymentPlanRadio_summaryCard__6nVof",w="PaymentPlanRadio_mainText__MVOcV",P="PaymentPlanRadio_detailsStack__GxslC",I="PaymentPlanRadio_feeBadge__Jhd03",x="PaymentPlanRadio_dueDateBadge__MHmcB",D="PaymentPlanRadio_sampleScheduleLink__66ZKD",T="PaymentPlanRadio_sampleScheduleExpander__4i1La",k="PaymentPlanRadio_scheduleDatesPanel__ww04g",B="PaymentPlanRadio_scheduleDatesPanelSummary__C8Ix9";var F=n(20803),_=n(82273);const N=e=>{let{paymentPlan:t,badgeText:n,selected:a,disabled:l,scheduleType:i="sample",showDueDateHint:s,onClick:c}=e;const[d,u]=(0,o.useState)(!1),m=(0,o.useRef)(null),{ref:p,entry:g}=(0,F.v)({threshold:1}),h=(0,_.pc)(m,p);return o.createElement(r.s.Card,{checked:a,pos:"relative",onClick:()=>{setTimeout((()=>{var e;(null===g||void 0===g?void 0:g.isIntersecting)&&1===g.intersectionRatio||(null===(e=m.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"nearest"}))}),100),l||c(t)},className:(0,v.A)(E,a&&C,l&&A),ref:h},n&&o.createElement(y.pB,null,n),o.createElement("div",null,o.createElement(L,{paymentPlan:t,scheduleType:i,expanded:d,selected:a,disabled:l,withRadio:!0,onExpandSchedule:u}),o.createElement(M,{paymentDates:t.paymentDates,expanded:d,showDueDateHint:s})))},R=e=>{let{paymentPlan:t,downPayment:n,scheduleType:r="sample",showDueDateHint:l=!0}=e;const{t:i}=(0,u.Bd)("global"),[s,c]=(0,o.useState)(!1),{paymentDates:d}=t;return o.createElement(o.Fragment,null,o.createElement(a.t,{mb:8,className:S},o.createElement(L,{paymentPlan:t,downPayment:n,scheduleType:r,expanded:s,selected:!0,withRadio:!1,onExpandSchedule:c}),o.createElement(M,{paymentDates:d,expanded:s,showDueDateHint:!1,className:B})),l&&o.createElement(p.r,null),(null===n||void 0===n?void 0:n.method)===h.G.Card&&o.createElement(y.$Z,{size:"sm"},i("PaymentPlanCard.down-payment-card-fee-hint")))},L=e=>{let{paymentPlan:t,downPayment:n,scheduleType:a,expanded:d,selected:p,disabled:h,withRadio:v,onExpandSchedule:b}=e;const{t:f}=(0,u.Bd)("global");return o.createElement(l.B,{p:20,gap:16},o.createElement(i.Y,{justify:"space-between"},o.createElement(i.Y,{gap:12},v&&o.createElement(r.s.Indicator,{disabled:h}),o.createElement(s.E,{className:w},f("PaymentPlanCard.radio-days",{days:t.metadata.days}))),o.createElement(s.E,{className:w},(0,m.zQ)(t.grossAmount))),o.createElement(l.B,{className:P,mod:{"with-radio":v}},o.createElement(g.K,{paymentOption:t,downPayment:n}),o.createElement(i.Y,{justify:"space-between"},o.createElement(c.E,{className:I,mod:{selected:p}},f("PaymentPlanCard.fee",{fee:(0,m.e8)(t.monthlyFeePercentage)})),o.createElement(i.Y,{gap:1,onClick:()=>b(!d)},o.createElement(s.E,{className:D},f("current"===a?"PaymentPlanCard.current-schedule":"new"===a?"PaymentPlanCard.new-schedule":"PaymentPlanCard.sample-schedule")),o.createElement(y.c6,{className:T,state:d,onToggle:b})))))},M=e=>{let{expanded:t,paymentDates:n,showDueDateHint:r=!0,className:a}=e;return o.createElement(d.S,{in:t,transitionDuration:100,transitionTimingFunction:"ease"},o.createElement("div",{className:(0,v.A)(k,a)},o.createElement(i.Y,{gap:8,mt:8,mb:16},n.map((e=>o.createElement(c.E,{className:x,key:e.toString()},f()(e).format("MMM DD"))))),r&&o.createElement(p.r,null)))}},19195:(e,t,n)=>{"use strict";n.d(t,{$:()=>s});var o=n(50016),r=n(22899),a=n(34777),l=n(29731),i=n(91162);const s=e=>{let{paymentMethod:t,onClick:n,...s}=e;const{t:c}=(0,l.Bd)("global");return o.createElement(r.k,Object.assign({label:c("payInvoice.payment-method"),value:i.A.getLongName(t),required:!0,readOnly:!0,rightSection:o.createElement(a.A,{size:16}),styles:{input:{cursor:"pointer"}},onClick:n},s))}}
1,52474:(e,t,n)=>{"use strict";n.d(t,{O:()=>c});var o=n(50016),r=n(4557),a=n(29731),l=n(40013),i=n(87053),s=n(58876);const c=e=>{var t;let{paymentMethod:n,owner:c,onRefetchPaymentMethods:d,onSuccess:u,...m}=e;const{t:p}=(0,a.Bd)("global"),[g,h]=(0,o.useState)(null),v=(null===n||void 0===n?void 0:n.paymentMethodType)===s.mf.Card&&!(null!==(t=n.rainforest)&&void 0!==t&&t.paymentMethodId);if(!v&&!g)return null;return o.createElement(o.Fragment,null,v&&o.createElement(l.W,Object.assign({title:p("common.paymentMethods.unsupportedCardWarning.title"),my:16},m),o.createElement("div",null,p("common.paymentMethods.unsupportedCardWarning.message")),o.createElement(r.$,{mt:16,color:"red",onClick:()=>h(n.id)},p("common.paymentMethods.unsupportedCardWarning.reconnectButton"))),!!g&&o.createElement(i.v,{owner:c,oldAccountId:g,onRefetchPaymentMethods:d,onClose:()=>h(null),onSuccess:e=>{let{cardId:t}=e;h(null),u(t)}}))}},4109:(e,t,n)=>{"use strict";n.d(t,{l:()=>w});var o=n(61774),r=n(50016),a=n(29731),l=n(56480),i=n(63092),s=n(48328);const c="DownPaymentWireOptions_root__8Y1TN",d=()=>{const{t:e}=(0,a.Bd)("global");return r.createElement("div",{className:c},r.createElement(l.E,{mb:8,fw:700},e("DownPaymentModal.wireHintTitle")),r.createElement(l.E,{span:!0},r.createElement(a.x6,{t:e,i18nKey:"DownPaymentModal.wireHint",components:{downloadLink:r.createElement(i.M,{fw:700,onClick:s.A.downloadWiringInstructions}),email:r.createElement(i.M,{fw:700,onClick:()=>{window.location.href="mailto:[email protected]"}})}})))};var u=n(63680),m=n(5685),p=n(83613),g=n(58876),h=n(73819),v=n(87053),y=n(52474);const b=(0,u.PA)((e=>{var t;let{cardAccountId:n,onChange:o}=e;const{t:l}=(0,a.Bd)("global"),[i,s]=r.useState(!1),{paymentMethods:c,loading:d}=null===(t=p.A.screensStore)||void 0===t?void 0:t.paymentMethodsStore,u=null===c||void 0===c?void 0:c.filter((e=>e.paymentMethodType===g.GG.CARD)),b=null===u||void 0===u?void 0:u.find((e=>e.id===n));(0,r.useEffect)((()=>{!n&&null!==u&&void 0!==u&&u.length&&o(u[0].id)}),[u,n,o]);return r.createElement(r.Fragment,null,r.createElement(m.Z,{value:n,onChange:e=>!!e&&o(e),options:(u||[]).map((e=>({value:e.id,label:"".concat(e.name," ***").concat(String(e.accountNumber||"").slice(-4))}))),disabled:d||i,testId:"down-payment-modal-cards-select",mb:16}),r.createElement(y.O,{paymentMethod:b,onSuccess:e=>e&&o(e)}),r.createElement(h.wP,{disabled:d||i,"data-test-id":"down-payment-modal-add-new-card",onClick:()=>s(!0)},l("DownPaymentModal.addNewCard")),i&&r.createElement(v.v,{onSuccess:e=>{let{cardId:t}=e;o(t),s(!1)},onClose:()=>s(!1)}))}));var f=n(61699),E=n(18529),C=n(51599);const A="DownPaymentForm_title__+m8hi";var S=n(34956);const w=e=>{var t;let{downPayment:n,paymentMethod:i,onChange:s}=e;const{t:c}=(0,a.Bd)("global"),{getRepaymentProcessingFee:u}=(0,S.mu)(),m=(0,r.useCallback)((e=>{var t;s({method:e,accountId:e===o.G.Wire?"":null!==(t=null===i||void 0===i?void 0:i.accountId)&&void 0!==t?t:""})}),[s,null===i||void 0===i?void 0:i.accountId]),g=p.A.remoteConfig.acceptCards;return(0,r.useEffect)((()=>{i||m(g?o.G.Card:o.G.Wire)}),[g,m,i]),r.createElement(r.Fragment,null,r.createElement(l.E,{className:A,mb:24},c("DownPaymentModal.title")),r.createElement(h.YX,{variant:"gray",mb:24,items:[{label:c("DownPaymentModal.invoiceAmount"),value:(0,f.zQ)(n.totalAmount)},{label:c("DownPaymentModal.downPaymentPercentage"),value:(0,f.e8)(n.percentage)},{label:c("DownPaymentModal.downPaymentAmount"),value:(0,f.zQ)(n.amount)}]}),r.createElement(h.a3,{label:c("DownPaymentModal.selectPaymentMethod"),tooltipPosition:"top-end",mb:16,tooltip:r.createElement(a.x6,{t:c,i18nKey:"DownPaymentModal.paymentMethodTooltip",components:{strong:r.createElement(l.E,{fw:700})}})}),r.createElement(E.s.Group,{value:null===i||void 0===i?void 0:i.method,onChange:e=>m(e),name:"down-payment-type",mb:24},r.createElement(C.Y,{gap:24},P(g,c).map((e=>r.createElement(E.s,{key:e.value,value:e.value,label:e.label,"data-testid":"down-payment-type-".concat(e.value)}))))),(null===i||void 0===i?void 0:i.method)===o.G.Wire?r.createElement(d,null):r.createElement(b,{cardAccountId:null!==(t=null===i||void 0===i?void 0:i.accountId)&&void 0!==t?t:"",onChange:e=>{const t=u(n.amount,e).fee;s({method:o.G.Card,accountId:e,cardFee:t})}}))},P=(e,t)=>{const n=[];return e&&n.push({label:t("DownPaymentModal.payWithCard"),value:o.G.Card}),n.push({label:t("DownPaymentModal.payWithWire"),value:o.G.Wire}),n}},88634:(e,t,n)=>{"use strict";n.d(t,{k:()=>u});var o=n(5438),r=n(50016),a=n(29731),l=n(61774),i=n(4109),s=n(4557),c=n(73819),d=n(34956);const u=(0,o.PA)((e=>{let{downPayment:t,paymentMethod:n,onChange:o,onBack:u,onClose:m,onContinue:p}=e;const{t:g}=(0,a.Bd)("global"),{canUsePaymentMethod:h}=(0,d.mu)(),v=(null===n||void 0===n?void 0:n.method)===l.G.Wire||h(null===n||void 0===n?void 0:n.accountId);return r.createElement(c.Vm,{onBack:u,onClose:m},r.createElement(c.Vm.Content,null,r.createElement(i.l,{downPayment:t,paymentMethod:n,onChange:o})),r.createElement(c.Vm.Buttons,null,r.createElement(s.$,{disabled:!v,onClick:p,"data-test-id":"down-payment-modal-continue-button"},g("DownPaymentModal.continue"))))}))}
1,12743:(e,t,n)=>{"use strict";n.d(t,{N:()=>u});var o=n(5438),r=n(50016),a=n(29731),l=n(82997),i=n(45143),s=n(97976),c=n(83613),d=n(4557);const u=(0,o.PA)((e=>{let{invoiceIds:t,paymentPlan:n,downPayment:o,paymentOptions:u,navigation:m,onPay:p,onSuccess:g,onFailure:h}=e;const{t:v}=(0,a.Bd)("global"),[y,b]=(0,r.useState)(!1),{submitCreditApplication:f,payAndSubmitApplication:E}=i.Ay,{userStore:C}=(0,s.P)();return r.createElement(d.$,{disabled:c.A.isBusy||!t.length||y,onClick:()=>{var e;E?f((null===(e=C.document)||void 0===e?void 0:e.loanApplicationId)||"",o,m):(b(!0),p?p().then(g).catch((e=>h?h(e):()=>console.log(e))).finally((()=>b(!1))):l.Vv.kQ.loanApplication({invoiceId:t,paymentPlan:n.id,cardId:void 0}).then((e=>{l.JZ.IE.callDecisionEngine(e.id,o).then((()=>{u.isDirectTerms?l.JZ.rN.inviteSupplierSchedulePay(t,"credit").then(g):g()}))})).catch((e=>h?h(e):()=>console.log(e))).finally((()=>b(!1))))},miw:200},v("payInvoice.agree-and-pay"))}))},70618:(e,t,n)=>{"use strict";n.d(t,{J:()=>h});var o=n(63680),r=n(29731),a=n(50016),l=(n(97186),n(61328)),i=(n(57619),n(92049),n(94727)),s=n(61699),c=n(61774),d=n(54223),u=n(22899),m=n(91162),p=n(83613),g=n(73819);const h=(0,o.PA)((e=>{var t,n;let{invoiceIds:o,paymentOptions:h,paymentPlan:v,downPaymentMethod:y,onPreviewAgreement:b}=e;const{t:f}=(0,r.Bd)("global"),E=p.A.screensStore.paymentMethodsStore.primaryCreditMethod,C=E?f("common.paymentMethods.methodName",{name:m.A.getShortName(E),number:m.A.escapeAccountNumber(E)}):"",A=v.grossAmount+(null!==(t=null===y||void 0===y?void 0:y.cardFee)&&void 0!==t?t:0);return a.createElement(a.Fragment,null,a.createElement(i.g,{paymentPlan:v,downPayment:y}),a.createElement(d.$,{h:16}),a.createElement(g.YX,{items:[{label:f("payInvoice.To"),value:h.supplier.name},{label:f("payInvoice.invoice-amount"),value:(0,s.zQ)(h.totalInvoiceAmount)},{label:f("payInvoice.loan-fee"),value:(0,s.zQ)(v.feeAmount)},(null===y||void 0===y?void 0:y.method)===c.G.Card?{label:f("payInvoice.down-payment-card-fee"),value:(0,s.zQ)(null!==(n=y.cardFee)&&void 0!==n?n:0)}:null,{label:f(y?"payInvoice.total-amount-with-down-payment":"payInvoice.total-amount"),value:(0,s.zQ)(A)}],styles:{labelColumn:{width:"unset"},valueColumn:{width:"unset"}}}),a.createElement(d.$,{h:16}),a.createElement(u.k,{label:f("payInvoice.select-autodebit-account"),value:C,disabled:!0,styles:{input:{color:"var(--mantine-color-black)",fontWeight:500}}}),a.createElement(d.$,{h:24}),a.createElement(l.e,{invoiceIds:o,paymentPlan:v,makeAgreementFn:b}))}))},63288:(e,t,n)=>{"use strict";n.d(t,{I:()=>s});var o=n(29731),r=n(50016),a=n(70618),l=n(12743),i=n(73819);const s=e=>{let{invoiceIds:t,paymentOptions:n,paymentPlan:s,downPayment:c,navigation:d,onBack:u,onClose:m,onPay:p,onSuccess:g,onFailure:h,onPreviewAgreement:v}=e;const{t:y}=(0,o.Bd)("global");return r.createElement(i.Vm,{title:y("payInvoice.pay-invoice"),onBack:u,onClose:m},r.createElement(i.Vm.Content,null,r.createElement(a.J,{invoiceIds:t,paymentOptions:n,paymentPlan:s,downPaymentMethod:c,onPreviewAgreement:v})),r.createElement(i.Vm.Buttons,null,r.createElement(l.N,{invoiceIds:t,paymentPlan:s,downPayment:c,paymentOptions:n,navigation:d,onPay:p,onSuccess:g,onFailure:h})))}},65700:(e,t,n)=>{"use strict";n.d(t,{N:()=>p});var o=n(50016),r=n(7371),a=n(29731),l=n(58876),i=n(38938),s=n(73819),c=n(4557),d=n(73984),u=n(56480);const m="PaymentPlanModal_subtitle__rMtED",p=e=>{let{selectedPlan:t,paymentOptions:n,onChange:r,onContinue:l,onClose:d}=e;const{t:u}=(0,a.Bd)("global");return o.createElement(s.Vm,{title:o.createElement(g,{paymentPlans:n.plans}),onClose:d},o.createElement(s.Vm.Content,null,o.createElement(i.x,{paymentPlans:n.plans,selectedPlan:t,downPaymentSettings:n.downPaymentSettings,onSelect:r})),o.createElement(s.Vm.Buttons,null,o.createElement(c.$,{onClick:l,disabled:!t,"data-test-id":"payment-plan-modal-continue-button"},u("DownPaymentModal.continue"))))},g=e=>{let{paymentPlans:t}=e;const{t:n}=(0,a.Bd)("application"),i=null===t||void 0===t?void 0:t.some((e=>e.metadata.frequency===l.X7.SINGLE));return o.createElement(r.A,null,o.createElement(d.h,{order:3},n("CreditRequestPaymentPlan.mobileTitle")),!i&&null!==t&&void 0!==t&&t.length?o.createElement(u.E,{fz:12,className:m},o.createElement(a.x6,{t:n,i18nKey:"CreditRequestPaymentPlan.NoPaymentDueFirst30days",components:{styled:o.createElement(u.E,{span:!0})}})):null)}}
1,38938:(e,t,n)=>{"use strict";n.d(t,{x:()=>d});var o=n(50016),r=n(94727),a=n(29731),l=n(63680),i=n(57619),s=n(70764),c=n(56480);const d=(0,l.PA)((e=>{let{paymentPlans:t,selectedPlan:n,downPaymentSettings:l,onSelect:d}=e;const{t:u}=(0,a.Bd)("global"),m=e=>{d(e)};return o.createElement(o.Fragment,null,o.createElement(s.B,{gap:16,mb:8},t.map((e=>o.createElement(o.Fragment,{key:e.id},o.createElement(r.z,{onClick:m,paymentPlan:e,selected:(null===n||void 0===n?void 0:n.id)===e.id}))))),null!==l&&void 0!==l&&l.isRequired?o.createElement(c.E,{fz:12},o.createElement(a.x6,{t:u,i18nKey:"PaymentPlanCard.down-payment-required-message",values:{percentage:l.downPaymentPercentage},components:{styled:o.createElement(c.E,{span:!0,inherit:!0,fw:700})}})):o.createElement(i.r,null))}))},97009:(e,t,n)=>{"use strict";n.d(t,{Z:()=>N});var o=n(50016),r=n(94951),a=n(77343),l=n(13459),i=n(32260),s=n(82997),c=n(86919),d=n(73819),u=n(4557),m=n(50767),p=n(56480),g=n(29731),h=n(84563),v=n(61699),y=n(48328),b=n(58876),f=n(19195),E=n(76223),C=n(76448),A=n(83613),S=n(77079);const w=e=>{var t;let{invoices:n,paymentMethod:r,paymentInfo:a,onClose:l,onSuccess:i,onError:d,onChangePaymentMethod:m}=e;const p=n[0],{t:y}=(0,g.Bd)("global"),{mutateAsync:w,isPending:I}=(0,C.n)({mutationFn:e=>s.Vv.Ji.invoicePayment(e).then((()=>{A.A.screensStore.notificationStore.fetchNotifications(),i()})),onError:e=>{console.error(e),d(e.message||"")}}),x=n.reduce(((e,t)=>e+t.total_amount),0),D=(null===r||void 0===r?void 0:r.paymentMethodType)===b.mf.Bank,T=(0,S.By)(D?x-((null===a||void 0===a?void 0:a.discount)||0):x+((null===a||void 0===a?void 0:a.fee)||0)),k=D&&(null===a||void 0===a?void 0:a.discount)&&a.discount>0,B=a&&!I&&x>0;return o.createElement(o.Fragment,null,o.createElement(c.V,{opened:!0,title:y("payInvoice.pay-invoice"),onClose:l,isSubmitting:I},o.createElement(c.V.Content,null,o.createElement(h.Y,{variant:"gray",mb:24,items:[{label:y("payInvoice.To"),value:null===(t=p.company)||void 0===t?void 0:t.name},{label:y("payInvoice.invoice-amount"),value:(0,v.zQ)(x)},k?{label:y("payInvoice.discount"),value:o.createElement(E.J,{loading:!a},"-".concat((0,v.zQ)(null===a||void 0===a?void 0:a.discount)))}:{label:y("payInvoice.servicing_fee"),value:o.createElement(E.J,{loading:!a},(0,v.zQ)(Number((null===a||void 0===a?void 0:a.fee)||0)))},{label:y("payInvoice.total-amount"),value:o.createElement(E.J,{loading:!a},(0,v.zQ)(T))}]}),o.createElement(f.$,{paymentMethod:r,onClick:m,mb:24}),o.createElement(P,null)),o.createElement(c.V.Buttons,null,o.createElement(u.$,{miw:200,disabled:!B,onClick:async()=>{if(!r)return;const e=n.map((e=>e._id));await w({invoiceIds:e,bankAccountId:r.id})}},B?y("payInvoice.agree-and-pay-amount",{amount:(0,v.zQ)(T)}):y("payInvoice.agree-and-pay")))))},P=()=>{const{t:e}=(0,g.Bd)("global");return o.createElement(m.a,null,o.createElement(p.E,{style:{whiteSpace:"pre-wrap"}},o.createElement(g.x6,{t:e,i18nKey:"integrations.pay-terms-and-conditions",components:{CA:o.createElement(d.t5,{onClick:y.A.downloadCustomerAgreement}),terms:o.createElement(d.t5,{onClick:()=>window.open(b.DS.TC,"_blank")}),privacy:o.createElement(d.t5,{onClick:()=>window.open(b.DS.PP,"_blank")})}})))};var I=n(44290),x=n(70582),D=n(86843),T=n(96557),k=n(73413),B=function(e){return e[e.Pay=0]="Pay",e[e.SelectPaymentMethod=1]="SelectPaymentMethod",e[e.AddPaymentMethod=2]="AddPaymentMethod",e[e.Success=3]="Success",e[e.Error=4]="Error",e}(B||{});const F=e=>{let{invoices:t,paymentMethod:n,withBanks:r,withCards:c,autoCloseOnSuccess:d,navigation:u,onSuccess:m,onError:p,onClose:g,route:h}=e;const[v,y]=(0,o.useState)(B.Pay),[f,E]=(0,o.useState)(""),[C,A]=(0,o.useState)(n),[S,P]=(0,o.useState)(null),F=(0,l.jE)(),_=(0,k.Q)(),N=t.map((e=>e._id)).join(",");(0,o.useEffect)((()=>{var e;if(!N||null===C||void 0===C||!C.id)return;P(null);if(C.paymentMethodType===b.mf.Bank&&null!==(e=t[0])&&void 0!==e&&e.achPriceResolved){const e=t.reduce(((e,t)=>e+Number(t.achDiscount||0)),0);P({fee:0,discount:e})}else s.Vv.SU.getPricingPackageFee({invoiceIds:N.split(","),accountId:C.id}).then((e=>{var t;P(null!==(t=e.pricingPackage)&&void 0!==t?t:null)}))}),[N,null===C||void 0===C?void 0:C.id,null===C||void 0===C?void 0:C.paymentMethodType]);const R=t.reduce(((e,t)=>e+Number(t.total_amount||0)-Number(t.achDiscount||0)),0),L=t[0].company.name||t[0].company.legalName||"";return o.createElement(T.A,{invoice:t[0],visible:!0,onClose:g,navigation:u,route:h},v===B.Pay&&o.createElement(w,{invoices:t,paymentMethod:C,paymentInfo:S,navigation:u,onClose:g,onSuccess:()=>{_(),t.forEach((e=>{let{_id:t}=e;F.invalidateQueries(i.o.paymentDetails({id:t}))})),F.invalidateQueries({queryKey:[i.o.all[0],"unpaidSupplierInvoices"]}),y(B.Success)},onError:e=>{E(e),y(B.Error)},onChangePaymentMethod:()=>y(B.SelectPaymentMethod)}),v===B.SelectPaymentMethod&&o.createElement(I.H,{invoice:t[0],withBanks:r,withCards:c,onAddPaymentMethod:()=>y(B.AddPaymentMethod),onSelected:e=>{e.id!==(null===C||void 0===C?void 0:C.id)&&(P(null),A(e)),y(B.Pay)},onClose:()=>y(B.Pay)}),v===B.AddPaymentMethod&&o.createElement(a.Zb,{withBanks:r,withCards:c,onAdded:e=>{e.account&&(P(null),A(e.account)),y(B.Pay)},onClose:()=>y(B.Pay)}),v===B.Success&&o.createElement(D.L,{amount:R,supplierName:L,autoClose:d,onClose:()=>{g(),null===m||void 0===m||m()}}),v===B.Error&&o.createElement(x.Q,{error:f,onClose:()=>{p?(g(),p()):y(B.Pay)}}))};var _=function(e){return e[e.None=0]="None",e[e.Pay=1]="Pay",e[e.AddAccount=2]="AddAccount",e}(_||{});const N=e=>{let{invoices:t,withBanks:n,withCards:l,autoCloseOnSuccess:i,navigation:s,route:c,onSuccess:d,onError:u}=e;const[m,p]=(0,o.useState)(_.None),[g,h]=(0,o.useState)(null);return o.createElement(o.Fragment,null,o.createElement(r.B,{invoice:t[0],withBanks:n,withCards:l,onSelect:e=>{e&&(h(e),p(_.Pay))},onAddPaymentMethod:()=>p(_.AddAccount)}),!!g&&m===_.Pay&&o.createElement(F,{invoices:t,paymentMethod:g,withBanks:n,withCards:l,autoCloseOnSuccess:i,navigation:s,route:c,onSuccess:d,onError:u,onClose:()=>p(_.None)}),m===_.AddAccount&&o.createElement(a.Zb,{withBanks:n,withCards:l,onAdded:e=>{var t;h(null!==(t=e.account)&&void 0!==t?t:null),p(_.Pay)},onClose:()=>p(_.None)}))}},70582:(e,t,n)=>{"use strict";n.d(t,{Q:()=>l});var o=n(50016),r=n(73819),a=n(29731);const l=e=>{let{error:t,onClose:n}=e;const{t:l}=(0,a.Bd)("global");return o.createElement(r.HD,{icon:o.createElement(r.GQ,{type:"danger"}),title:l("receivables.modals.regularPaymentError.title"),buttons:[l("receivables.modals.regularPaymentError.tryAgain")],onClose:n},t||l("system-failure"))}}
1,86843:(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n(50016),r=n(73819),a=n(29731),l=n(74027),i=n(61699);const s=e=>{let{amount:t,supplierName:n,autoClose:s,onClose:c}=e;const{t:d}=(0,a.Bd)("global");return o.createElement(r.HD,{icon:o.createElement(r.GQ,{type:"success"}),title:d("receivables.modals.regularPaymentSuccess.title"),buttons:[d("close")],onClose:c},d("receivables.modals.regularPaymentSuccess.message",{amount:(0,i.zQ)(t),supplierName:n}),o.createElement(l.i,{autoRedirect:s,onRedirect:c}))}},12276:(e,t,n)=>{"use strict";n.d(t,{R:()=>B});var o=n(50016),r=n(29731),a=n(94727),l=n(10272);let i=function(e){return e[e.None=0]="None",e[e.Update=1]="Update",e[e.Extend=2]="Extend",e}({}),s=function(e){return e.ExtensionImpossible="EXTENSION_IMPOSSIBLE",e.ExtensionFailed="EXTENSION_FAILED",e.ProcessingAmountExists="PROCESSING_AMOUNT_EXISTS",e.WithinGracePeriod="WITHIN_GRACE_PERIOD",e}({});var c=n(73819),d=n(56480),u=n(70764),m=n(4557);const p=e=>{let{newPlan:t,extensionOptions:n,onSelect:s,onContinue:p,onClose:g}=e;const{t:h}=(0,r.Bd)("global"),{plans:v,hasPastDuePayments:y,currentPlanId:b,extensionType:f}=n,E=f===i.Extend,C=E?"new":"sample";return o.createElement(c.Vm,{title:h(E?"InvoicePayment.termsExtension.termsSelectorModal.extendTerms.header":"InvoicePayment.termsExtension.termsSelectorModal.updateTerms.header"),onClose:g},o.createElement(c.Vm.Content,null,o.createElement(d.E,{span:!0},o.createElement(r.x6,{t:h,i18nKey:E?"InvoicePayment.termsExtension.termsSelectorModal.extendTerms.description":"InvoicePayment.termsExtension.termsSelectorModal.updateTerms.description",components:{bold:o.createElement(d.E,{span:!0,inherit:!0,fw:700})}})),y&&o.createElement(d.E,{c:l.B.service.red100c,mt:12},h("InvoicePayment.termsExtension.termsSelectorModal.hasPastDuePayments")),o.createElement(u.B,{gap:24,mt:24},v.map(((e,n)=>{const r=b===e.id;return o.createElement("div",{key:n},o.createElement(a.z,{onClick:s,paymentPlan:e,selected:r||(null===t||void 0===t?void 0:t.id)===e.id,disabled:r,badgeText:r?h("InvoicePayment.termsExtension.termsSelectorModal.currentTerms"):void 0,scheduleType:r&&E?"current":C,showDueDateHint:f===i.Update}))})))),o.createElement(c.Vm.Buttons,null,o.createElement(m.$,{onClick:p,"data-testID":"ExtendTerms.TermSelector.Continue",disabled:!t,miw:150},h("InvoicePayment.termsExtension.termsSelectorModal.continueButton"))))};var g=n(21746),h=n(89199),v=n(82997),y=n(97186);const b=e=>{let{mode:t,error:n,onClose:a}=e;const{t:l}=(0,r.Bd)("global");let i="preview"===t?{title:"InvoicePayment.termsExtension.errorWarning.general.title",description:"InvoicePayment.termsExtension.errorWarning.general.description"}:{title:"InvoicePayment.termsExtension.errorWarning.extensionFailed.title",description:"InvoicePayment.termsExtension.errorWarning.extensionFailed.description"};const u=null===n||void 0===n?void 0:n.validationErrors;return Array.isArray(u)&&u.some((e=>e.code===s.ProcessingAmountExists))&&(i={title:"InvoicePayment.termsExtension.errorWarning.paymentProcessing.title",description:"InvoicePayment.termsExtension.errorWarning.paymentProcessing.description"}),o.createElement(c.HD,{icon:o.createElement(c.GQ,{type:"alert"}),title:l(i.title),buttons:[l("InvoicePayment.termsExtension.errorWarning.okButton")],testId:"TermsExtension.ErrorWarning",onClose:a},o.createElement(d.E,{size:"lg",ta:"center"},o.createElement(r.x6,{t:l,i18nKey:i.description,components:{email:o.createElement(c.bT,{fz:16})}})))};var f=n(61699),E=n(61774),C=n(54223),A=n(64513),S=n(76448);const w=e=>{let{extensionOptions:t,newPlan:n,onBack:l,onClose:s,onConfirm:u}=e;const{t:p}=(0,r.Bd)("global"),[g,h]=(0,o.useState)(!1),{extensionType:f,invoice:E}=t,{mutate:w,isPending:I,error:x}=(0,S.n)({mutationFn:()=>v.Vv._8.extendInvoiceTerms({invoiceId:E.id,paymentPlanId:n.id}),onSuccess:()=>u()}),D=f===i.Extend;return x?o.createElement(b,{mode:"replan",error:x.data,onClose:s}):o.createElement(c.Vm,{title:p(D?"InvoicePayment.termsExtension.confirmationModal.extendTerms.title":"InvoicePayment.termsExtension.confirmationModal.updateTerms.title"),onBack:l,onClose:s},o.createElement(c.Vm.Content,null,o.createElement(d.E,{mb:24},p(D?"InvoicePayment.termsExtension.confirmationModal.extendTerms.description":"InvoicePayment.termsExtension.confirmationModal.updateTerms.description")),o.createElement(a.g,{paymentPlan:n,showDueDateHint:!1,scheduleType:D?"new":"sample"}),o.createElement(C.$,{h:16}),o.createElement(P,{extensionOptions:t,newPlan:n}),o.createElement(C.$,{h:24}),E.paymentType===v.mn.FACTORING&&o.createElement(o.Fragment,null,o.createElement(y._,null),o.createElement(C.$,{h:32})),o.createElement(A.S,{checked:g,onChange:e=>h(e.currentTarget.checked),label:p("InvoicePayment.termsExtension.confirmationModal.termsConsentLabel"),"data-test-id":"TermsExtension.ConfrmationModal.TermsConsentCheckbox"})),o.createElement(c.Vm.Buttons,null,o.createElement(m.$,{onClick:()=>w(),disabled:!g||I,loading:I,miw:150,"data-test-id":"TermsExtension.ConfrmationModal.ConfirmButton"},p(D?"InvoicePayment.termsExtension.confirmationModal.extendTerms.c
1onfirmButton":"InvoicePayment.termsExtension.confirmationModal.updateTerms.confirmButton"))))},P=e=>{var t,n,a;let{extensionOptions:l,newPlan:s}=e;const{t:d}=(0,r.Bd)("global"),u=l.plans.find((e=>e.id===l.currentPlanId)),m=l.extensionType===i.Extend?Math.max(s.metadata.fee-(null!==(t=null===u||void 0===u?void 0:u.metadata.fee)&&void 0!==t?t:0),0):s.metadata.fee,p=l.outstandingAmount,g=Math.round(p*m)/100,h=p+g,v=l.downPaymentMethod,y=[{label:d("InvoicePayment.termsExtension.confirmationModal.paymentInfo.to"),value:l.supplier.companyName},{label:d("InvoicePayment.termsExtension.confirmationModal.paymentInfo.remainingBalance"),value:(0,f.zQ)(p)},{label:d("InvoicePayment.termsExtension.confirmationModal.paymentInfo.financingFee"),value:(0,f.zQ)(g)},(null===v||void 0===v?void 0:v.method)===E.G.Card?{label:d("payInvoice.down-payment-card-fee"),value:(0,f.zQ)(null!==(n=v.cardFee)&&void 0!==n?n:0)}:null,{label:d("InvoicePayment.termsExtension.confirmationModal.paymentInfo.totalRepaymentAmount"),value:(0,f.zQ)(h+(null!==(a=null===v||void 0===v?void 0:v.cardFee)&&void 0!==a?a:0))}];return o.createElement(c.YX,{items:y,withLastDivider:!0})},I="ExtensionCompleteAlert_pastDueAlert__pKLrv",x=e=>{let{extensionOptions:t,onClose:n}=e;const{t:a}=(0,r.Bd)("global");return t.hasPastDuePayments?o.createElement(c.HD,{icon:o.createElement(c.GQ,{type:"success"}),title:a("InvoicePayment.termsExtension.successModal.extendTerms.title"),classNames:{text:I},buttons:[{label:a("InvoicePayment.termsExtension.successModal.makePayment"),onClick:()=>n({forceMakePayment:!0})}],onClose:n,testId:"TermsExtension.SuccessModalForPastDue"},a("InvoicePayment.termsExtension.successModal.extendTerms.pastDueAlert")):o.createElement(c.HD,{icon:o.createElement(c.GQ,{type:"success"}),title:t.extensionType===i.Extend?a("InvoicePayment.termsExtension.successModal.extendTerms.title"):a("InvoicePayment.termsExtension.successModal.updateTerms.title"),buttons:[a("InvoicePayment.termsExtension.successModal.okGotIt")],onClose:n,testId:"TermsExtension.SuccessModal"},t.extensionType===i.Extend?a("InvoicePayment.termsExtension.successModal.extendTerms.description"):a("InvoicePayment.termsExtension.successModal.updateTerms.description"))};var D=n(12344),T=n(31652),k=function(e){return e[e.Loading=0]="Loading",e[e.Error=1]="Error",e[e.TermSelection=2]="TermSelection",e[e.Confirmation=3]="Confirmation",e[e.Complete=4]="Complete",e}(k||{});const B=e=>{let{invoiceId:t,onClose:n,onComplete:a}=e;const{t:l}=(0,r.Bd)("global"),{step:i,goNext:s,goBack:c,goTo:d}=(0,g.q)(k),[u,m]=(0,o.useState)(null),{data:v,error:y,isError:f}=(0,D.I)(T.y.extensionOptions({invoiceId:t},{retry:!1}));(0,o.useEffect)((()=>{v&&d(k.TermSelection)}),[v,d]),(0,o.useEffect)((()=>{f&&d(k.Error)}),[f,d]);return o.createElement(o.Fragment,null,i===k.Loading&&o.createElement(h.C,{text:l("InvoicePayment.termsExtension.termsSelectorModal.LoadingTerms"),onClose:n}),i===k.Error&&o.createElement(b,{mode:"preview",error:null===y||void 0===y?void 0:y.data,onClose:n}),!!v&&o.createElement(o.Fragment,null,i===k.TermSelection&&o.createElement(p,{newPlan:u,extensionOptions:v,onSelect:m,onContinue:s,onClose:n}),i===k.Confirmation&&!!u&&o.createElement(w,{newPlan:u,extensionOptions:v,onBack:c,onConfirm:s,onClose:n}),i===k.Complete&&o.createElement(x,{extensionOptions:v,onClose:e=>{n(),a&&a(e)}})))}},96557:(e,t,n)=>{"use strict";n.d(t,{c:()=>F,A:()=>B});var o=n(50016),r=n(5438),a=n(97976),l=n(91855),i=n(13569),s=n(21319),c=n(71003),d=n(32572),u=n(7371),m=n(49727),p=n(17171),g=n(38767),h=n(20282),v=n(68215),y=n(69102),b=n(29731),f=n(93894),E=n(6951),C=n(2745),A=n(50112);const S=(0,r.PA)((()=>{var e;const{md:t,screenHeight:n}=(0,p.Qs)(),[r,l]=o.useState(!1),i=(0,a.P)(),{setItem:s,item:S,skip:P}=y.A,{t:I}=(0,b.Bd)("onboarding"),x=(0,g.composeStyle)({flexGrow:1,backgroundColor:"#F8FBFE",minHeight:"100%"},t&&n>850?{justifyContent:"center",alignItems:"center",paddingVertical:60}:t&&n<=850?{alignItems:"center"}:{}),D=(0,g.composeStyle)({backgroundColor:"white"},t?{maxWidth:740,padding:30,borderRadius:8,...w}:{flex:1,padding:20}),T=S?S.id:null,k=(0,o.useMemo)((()=>o.createElement(E.A,{onPress:e=>{s((0,C.toJS)(e)),console.log({val:e})},selectedId:T})),[T,s]);return null!==i&&void 0!==i&&null!==(e=i.userStore)&&void 0!==e&&e.userInfoReady?o.createElement(c.A,{style:{backgroundColor:"white",flex:1},testID:"onboardingContainer"},a.A.branding?o.createElement(f.X,null):o.createElement(A.OnboardingHeader,{md:t}),o.createElement(d.A,{contentContainerStyle:x},o.createElement(u.A,{style:D},o.createElement(u.A,{style:{width:"100%",justifyContent:"space-between",flexDirection:"row"}},o.createElement(u.A,null),o.createElement(m.A,{style:{backgroundColor:"#F4F9FD",borderRadius:8,paddingHorizontal:10,paddingVertical:5,color:v.commonColors.accentText}},I("step")," 1/1")),o.createElement(h.hK,{height:20}),k,o.createElement(u.A,{style:{width:"100%",alignItems:"flex-end",paddingHorizontal:t?15:0}},o.createElement(h.eF,{buttonStyle:{alignSelf:"right",marginTop:20,opacity:S?1:.1},onPress:()=>{l(!0),P().then((()=>
1{a.A.initRouteParams({}),l(!1)}))},testID:"onboarding_continue_button",nativeID:"chosen-category=".concat(null===S||void 0===S?void 0:S.id),loading:r},I("Continue")),!t&&o.createElement(h.hK,{height:20}))))):null})),w={shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:1.41,elevation:2};var P=n(83149),I=n(30649),x=n(86419),D=n(5878),T=n(72753),k=n(29073);const B=(0,r.PA)((function(e){let{invoice:t,visible:n,onClose:r,children:i,navigation:s,route:c}=e;const d=(0,a.P)(),u=d.userStore.isAuthenticated,m=!!d.userStore.settings.get("onboarding"),p=!!u;return(0,o.useEffect)((()=>{!i&&p&&n&&m&&r()}),[p,n,r,i,m]),o.createElement(o.Fragment,null,p&&m?i||null:n&&o.createElement(l.A,{visible:n,onClose:r,style:{flex:1,width:"100%",height:"100%",margin:0}},o.createElement(F,{invoice:t,onClose:r,navigation:s,route:c})))})),F=(0,r.PA)((e=>{let{invoice:t,onClose:n,navigation:r,route:l}=e;const{canAskOtp:s,setCodeVerifier:c,canAskPassword:d}=i.A,u=(0,a.P)(),m=u.userStore.isAuthenticated,p=!!u.userStore.settings.get("onboarding"),[g,h]=(0,o.useState)(!1),[v,y]=(0,o.useState)(!1),[b,f]=(0,o.useState)(!1);if(m&&!p)return o.createElement(S,null);if(m&&p)return null;const E=e=>{c(!1),y(!0),h(e)};return t.login&&i.A.setLogin(t.login||t.phone),!s&&!g&&!d&&v||g&&!s&&!d?b?o.createElement(k.A,{navigation:r,onBack:()=>f(!1)}):o.createElement(R,{invoice:t,isSignIn:g,dontNavigate:E,onClose:n,route:l,navigation:r,setGoToForm:f}):s?o.createElement(P.A,{navigation:r,dontNavigate:E,route:l,setGoToForm:f}):null!==t&&void 0!==t&&t.existingCustomer||d?o.createElement(I.A,{navigation:r,dontNavigate:E}):b?o.createElement(k.A,{navigation:r,onBack:()=>f(!1)}):o.createElement(N,{navigation:r,route:l,invoice:t,dontNavigate:E,setGoToForm:f})})),_=e=>{const[t,n]=(0,o.useState)(!1);return t?o.createElement(T.A,Object.assign({},e,{onContinue:()=>e.setGoToForm(!0),onBack:()=>n(!1)})):o.createElement(x.A,Object.assign({},e,{onContinue:()=>n(!0)}))},N=(0,r.PA)((e=>{const{invoice:t}=e,{setValue:n,setLogin:r}=s.A,[a]=(0,o.useState)("password");return(0,o.useEffect)((()=>{var e,o,a,l,i;const s=t.email||(null===t||void 0===t||null===(e=t.customer)||void 0===e?void 0:e.email)||"";n("firstName",(null===t||void 0===t?void 0:t.firstName)||(null===t||void 0===t||null===(o=t.customer)||void 0===o?void 0:o.first_name)||""),n("lastName",t.lastName||(null===t||void 0===t||null===(a=t.customer)||void 0===a?void 0:a.last_name)||""),n("email",s),n("company_name",t.company_name||(null===t||void 0===t||null===(l=t.customer)||void 0===l?void 0:l.name)||""),n("phone",null!==t&&void 0!==t&&null!==(i=t.customer)&&void 0!==i&&i.phone?t.customer.phone.slice(2):""),s&&r(s)}),[]),(0,o.useEffect)((()=>{a&&(n("type",a),"password"===a&&s.A.email&&r(s.A.email))}),[a,r,n]),o.createElement(_,e)})),R=e=>{let{navigation:t,route:n,isSignIn:r,dontNavigate:a,...l}=e;return r?o.createElement(D.A,{navigation:t,dontNavigate:a,route:n}):o.createElement(N,Object.assign({navigation:t,route:n,dontNavigate:a},l))}},93018:(e,t,n)=>{"use strict";n.d(t,{W:()=>g});var o=n(50016),r=n(7371),a=n(78267),l=n(38117),i=n(97976),s=n(5438),c=n(58876),d=n(14329),u=n(29731),m=n(19925),p=n(38767);const g=(0,s.PA)((()=>{const{sm:e}=(0,m.Qs)(),{onlineConnectedBanks:t}=i.A.screensStore.paymentMethodsStore,n=t.filter((e=>e.connectionType===c.FP.FINICITY));return o.createElement(r.A,{style:{marginTop:25,flexDirection:e?"row":"column",justifyContent:"space-between"},testID:"disconnected-bank-accounts-list"},n.map((e=>o.createElement(h,{bank:e}))))})),h=e=>{let{bank:t}=e;const{t:n}=(0,u.Bd)("global"),{sm:a}=(0,m.Qs)(),{getAccTypeAndNumber:s}=i.A.screensStore.paymentMethodsStore,c=a?{width:216}:{minWidth:216};return o.createElement(r.A,{style:(0,p.composeStyle)({height:91},c),testID:"disconnected-bank-item"},o.createElement(v,null),o.createElement(r.A,{style:(0,p.composeStyle)(y.itemContainer,c)},o.createElement(l.A,{style:y.itemName},t.name),o.createElement(l.A,{style:y.itemName2},s(t.accountType,t.accountNumber,n))))},v=()=>{const{t:e}=(0,u.Bd)("global");return o.createElement(r.A,{style:y.badge},o.createElement(d.BtText,{style:y.text},e("ConnectBankWithPlaid.disconnected-badge")))},y=a.A.create({itemContainer:{height:80,backgroundColor:"#FFE8E8",borderWidth:0,borderRadius:8,marginTop:10,paddingHorizontal:20,paddingVertical:20},text:{fontWeight:"500",fontSize:12,color:"white",lineHeight:20},badge:{height:22,maxWidth:210,position:"absolute",top:0,right:10,zIndex:1,borderRadius:5,paddingHorizontal:8,flex:2,backgroundColor:"#DB2424"},itemName:{fontWeight:"500",fontSize:16,color:"#335C75",marginBottom:5},itemName2:{fontWeight:"500",fontSize:12,color:"#668598"}})},79732:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var o=n(50016),r=n(40046),a=n(78267),l=n(7371),i=n(14329),s=n(97076),c=n(67956),d=n(89077),u=n(2252),m=n(10272),p=n(20282);
1function g(e){let{company:t,totalAmount:n,style:a,companyFontSize:m=18,amountLabel:g,amountLabelStyles:v={marginTop:4,color:"#758590"},status:y="",showInvoiceStatus:b=!1}=e;const f=null!==t&&void 0!==t&&t.phone?(0,d.L)(t.phone,"US").formatInternational().slice(3):null,E=f?"(".concat(f.slice(0,3),")").concat(f.slice(3)):null;return o.createElement(l.A,{style:a},o.createElement(l.A,{style:h.leftContainer},o.createElement(i.BtText,{size:m,style:h.companyName,weight:"600",numberOfLines:1,ellipsizeMode:"tail"},null===t||void 0===t?void 0:t.name),o.createElement(p.hK,{height:8}),b?o.createElement(l.A,{style:h.statusContainer},o.createElement(u.p,{status:y})):E&&o.createElement(l.A,{style:h.phoneContainer},o.createElement(s.Oh,null),o.createElement(i.BtText,{style:h.phoneText,weight:"500",onPress:()=>{null!==t&&void 0!==t&&t.phone&&r.A.openURL("tel:".concat(t.phone))}},E))),o.createElement(l.A,{style:h.rightContainer},o.createElement(i.BtText,{weight:"700",size:18,style:h.totalAmount},(0,c.Wl)(n)),o.createElement(p.hK,{height:8}),o.createElement(i.BtText,{style:[v,h.amountLabel],weight:"500"},g)))}const h=a.A.create({leftContainer:{flex:1},companyName:{lineHeight:28,letterSpacing:.2,color:m.B.text.black,fontFamily:"Inter"},statusContainer:{marginTop:4,justifyContent:"center",alignItems:"center",alignSelf:"flex-start"},phoneContainer:{flexDirection:"row",alignItems:"center",marginTop:5},phoneIcon:{alignSelf:"center",width:13,height:13,marginTop:2},phoneText:{color:m.B.blue.blue400,marginLeft:5},rightContainer:{alignItems:"flex-end"},totalAmount:{color:m.B.text.black,lineHeight:28,letterSpacing:.2,fontFamily:"Inter"},amountLabel:{lineHeight:21,fontFamily:"Inter"},normalText:{fontSize:14,fontWeight:"500",lineHeight:21,color:m.B.text.grey500,fontFamily:"Inter"},statusValue:{maxWidth:"50%"}})},68198:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var o=n(50016),r=n(7371),a=n(38117),l=n(78267),i=n(29731),s=n(67956),c=n(63680);const d=e=>{let{label:t,value:n}=e;return o.createElement(r.A,{style:m.row},o.createElement(a.A,{style:m.label},t),o.createElement(a.A,{style:m.value},n))},u=(0,c.PA)((e=>{let{statistics:t}=e;const{t:n}=(0,i.Bd)("payables"),{totalDueInvoices:a,availableCredit:l,creditLimit:c,totalDueSum:u}=t,p=[{label:n("payables.header.totalBalanceDue"),value:(0,s.Wl)(u)},{label:n("payables.header.availableCredit"),value:(0,s.Wl)(l)},{label:n("payables.header.inHouseCreditLimit"),value:(0,s.Wl)(c)},{label:n("payables.header.numberOfDueInvoices"),value:a}];return o.createElement(r.A,{style:m.container},p.map(((e,t)=>o.createElement(d,{key:t,label:e.label,value:e.value}))))})),m=l.A.create({container:{paddingBottom:16},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottomWidth:1,borderBottomColor:"#E6EBEE",paddingVertical:14},label:{fontSize:14,color:"#99ADBA",lineHeight:21,fontWeight:"500",fontFamily:"Inter"},value:{fontSize:14,lineHeight:21,color:"#335C75",fontWeight:"700",fontFamily:"Inter"}}),p=u},28207:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>W,Sn:()=>z});var o=n(50016),r=n(82345),a=n(7371),l=n(14945),i=n(82997),s=n(7007),c=n(77356),d=n(58876),u=n(219),m=n(5438),p=n(14329),g=n(78267),h=n(97076),v=n(97976),y=n(82047),b=n(17171),f=n(20282),E=n(67869),C=n(88917);
1function A(e){let{company:t,navigation:n,showCompanyName:r=!0}=e;const{userStore:l,branding:i}=v.A,s=C.lJ,c=l.isAuthenticated,{screenWidth:d,sm:u}=(0,b.Qs)();return o.createElement(a.A,{style:[S.header,{marginBottom:d>450?20:0,justifyContent:r?"space-between":"center"}]},c?o.createElement(y.A,{icon:o.createElement(h.tTe,{height:"20",width:"20"}),onPress:()=>{s.resetVendor(),1===C.GO.vendorsLength?n.navigate(E.f0.Home._self):n.canGoBack()?n.goBack():n.replace(E.f0.Home._self,{screen:E.f0.Console.Payables._self,params:{screen:E.f0.Console.Payables.home}})}}):u&&!i?o.createElement(h.gkA,{width:160}):o.createElement(y.A,{icon:o.createElement(h.sJ3,{height:"16",width:"16"}),onPress:()=>{s.resetVendor(),n.replace(E.f0.Console._self)}}),r&&o.createElement(o.Fragment,null,o.createElement(p.BtText,{style:{fontWeight:"600",fontSize:18,marginLeft:10,flex:1,textAlign:"center"},numberOfLines:1,ellipsizeMode:"tail"},(null===t||void 0===t?void 0:t.name)||(null===t||void 0===t?void 0:t.legalName)),o.createElement(f.hK,{width:c?40:u&&!i?160:40})))}const S=g.A.create({header:{height:64,flexDirection:"row",alignItems:"center",paddingHorizontal:10,justifyContent:"space-between",backgroundColor:"#FFFFFF",borderBottomWidth:1,borderBottomColor:"#E6EBEE",elevation:1}});var w=n(79732),P=n(29731),I=n(49158),x=n(68198),D=n(38117),T=n(83068),k=n(86088),B=n(72776),F=n(38804),_=n(66187),N=n(49755);const R=(0,m.PA)((function(e){let{companyInvoices:t}=e;const n=(0,r.useNavigation)(),[l,s]=(0,o.useState)([]),[d,m]=(0,o.useState)("All"),[g,v]=(0,o.useState)(!1),[y,b]=(0,o.useState)(null),[E,S]=(0,o.useState)(null),[R,L]=(0,o.useState)(null),[M,O]=(0,o.useState)(T.dm.INVOICES),[z,j]=(0,N.r)(),{t:W}=(0,P.Bd)("payables"),V=C.lJ;(0,o.useEffect)((()=>{var e;s(t),b(null===(e=t[0])||void 0===e?void 0:e.company)}),[t]),(0,o.useEffect)((()=>{(async()=>{if(null!==y&&void 0!==y&&y._id){V.setVendor(y._id,y.name,y.phone,y.isInvited||!1);try{if(null!==y&&void 0!==y&&y.isInvited)S(!1),V.setIsFactoring(!1,!1),L(!0);else{const e=await i.JZ.QN.isFactoringEnabled({supplierId:y._id});V.setIsFactoring(e.inHouseCreditIsEnabled,e.arAdvanceIsEnabled),S(e.arAdvanceIsEnabled&&e.inHouseCreditIsEnabled),L(!1)}}catch(e){console.error("Error fetching data:",e)}}})()}),[y]),(0,o.useEffect)((()=>{E&&V.fetchStatisticsData()}),[E]);const H=(0,o.useMemo)((()=>{if(y&&"boolean"===typeof E&&null!==l&&void 0!==l&&l.length){let e;e="All"===d?E?l.filter((e=>e.type===i.tD.INVOICE)):l:l.filter((e=>{const t=e.status===d.split(" ").join("").toUpperCase();return E?t&&e.type===i.tD.INVOICE:t}));const t=M===T.dm.REFI;return t&&(e=e.filter((e=>{var t;return null===(t=e.refinance)||void 0===t?void 0:t.isRefinanced}))),o.createElement(o.Fragment,null,E&&o.createElement(o.Fragment,null,o.createElement(T.ij,{active:M,options:[T.dm.INVOICES,T.dm.REFI],onPress:O}),o.createElement(f.hK,{height:16})),e.length>0?o.createElement(B.F,{invoices:e,viewMode:t?"refi":"all",navigation:n,isFactoring:E||!1,disabled:!(E||R)}):o.createElement(k.l,null))}return null}),[y,E,l,d,M,n,R]);return!y||"boolean"!==typeof E||V.isStatisticsLoading?o.createElement(c.A,null):o.createElement(o.Fragment,null,o.createElement(u.A,{toolbar:o.createElement(A,{company:y,navigation:n,showCompanyName:!1})},o.createElement(w.A,{company:y,totalAmount:E?V.vendorsStatistics.totalDueSum:0,style:I.R.invoicesListHeader,amountLabel:W(E?"payables.mobile.totalBalanceDue":"payables.mobile.amountDue"),amountLabelStyles:E?{marginTop:4,color:"#668598"}:{color:"#99ADBA",marginTop:4}}),E&&(V.isStatisticsLoading?o.createElement(c.A,null):o.createElement(o.Fragment,null,o.createElement(x.A,{statistics:V.vendorsStatistics}),o.createElement(a.A,{style:I.M.factoringFilter},o.createElement(D.A,{style:I.M.filterText,onPress:()=>v(!0)},o.createElement(h.YGH,null)," ",W("payables.mobile.filters"))))),z.showAutoPayWarning&&E&&o.createElement(a.A,{style:{marginBottom:15}},o.createElement(F.A,{onActionPress:()=>j({type:N.U.SHOW_IHC_SETUP_FLOW}),onClose:()=>j({type:N.U.HIDE_WARNING}),key:z.refreshKey,isAutoPayIhcFlowOpened:z.showAutoPayFlow})),!E&&o.createElement(p.BtText,{size:18,weight:"600",style:{width:"100%",textAlign:"center",marginVertical:14,lineHeight:24}},W("payables.mobile.allPayables")),H,o.createElement(T.dJ,{t:W,onPress:e=>m(e),filterStatus:d,onClose:()=>v(!1),visible:g})),z.showAutoPayFlow&&o.createElement(_.i,{onClose:()=>j({type:N.U.HIDE_IHC_SETUP_FLOW}),onSuccess:()=>j({type:N.U.AUTO_PAY_IHC_SETUP_SUCCESS})}))}));var L=n(77593),M=n(34956);const O={InvoiceDetails:l.Qi,SelectInvoices:l.Nk,CompanyInactiveInvoices:R,PayableView:L.Q,NoInvoices:k.l},z=[d.uR.pastDue,d.uR.due,d.uR.placed,d.uR.paymentFailed,d.uR.applicationCancelled,d.uR.applicationRejected],j=e=>{var t;const n=!!e.loanApp&&d.$D.includes(null===(t=e.loanApp)||void 0===t?void 0:t.status);return["invoice","sales_order"].includes(e.type)&&e.company&&z.includes(e.status)&&!n&&e.totalRemainingAmou
1nt},W=(0,m.PA)((function(){var e,t,n,l,d,u,m,p;const g=(0,r.useRoute)(),h=(0,r.useNavigation)(),y=(0,M.kU)(),[b,f]=(0,o.useState)([]),[E,C]=(0,o.useState)(!0),[A,S]=(0,o.useState)([]),[w,P]=(0,o.useState)(null),[I,x]=(0,o.useState)(!1),[D,T]=(0,o.useState)(!1),[k,B]=(0,o.useState)(null),[F,_]=(0,o.useState)(null),{routeParams:{action:N}}=v.A,R=(0,o.useCallback)((()=>{var e,t,n;C(!0),i.JZ.rN.companyInvoices(null===(e=g.params)||void 0===e?void 0:e.id,null===(t=g.params)||void 0===t?void 0:t.companyId,null===(n=g.params)||void 0===n?void 0:n.invoicesIds).then((e=>{var t;const n=[];var o,r;if(null!==(t=g.params)&&void 0!==t&&t.id?e.invoices.forEach((e=>{var t;j(e)?(e.paymentType===i.mn.FACTORING&&T(!0),n.push({...e,selected:!0})):(null===(t=g.params)||void 0===t?void 0:t.id)===e._id&&(e.paymentType===i.mn.FACTORING?T(!0):x(!0))})):e.invoices.forEach((e=>{["invoice","sales_order"].includes(e.type)&&e.company&&n.push({...e,selected:!0})})),n.length>0)f(n),S({...e.customer,invoiceId:null===(o=n[0])||void 0===o?void 0:o._id});else if(e.invoices.length>0)if(null!==(r=g.params)&&void 0!==r&&r.id){const t=e.invoices.find((e=>{var t;return e._id.toString()===(null===(t=g.params)||void 0===t?void 0:t.id)}));f(t?[t]:[e.invoices[0]])}else f(e.invoices)})).finally((()=>C(!1)))}),[f,S,g.params]);return(0,o.useEffect)((()=>{"reloadInvoices"===N&&(R(),v.A.initRouteParams({}))}),[N,R]),(0,o.useEffect)((()=>{R()}),[g.params,R]),(0,o.useEffect)((()=>{(async()=>{var e,t,n,o;if(null!==(e=g.params)&&void 0!==e&&e.companyId||null!==(t=g.params)&&void 0!==t&&t.account)try{var r;let e;var a,l;if(null!==(r=g.params)&&void 0!==r&&r.companyId)e=await i.JZ.QN.isFactoringEnabled({supplierId:null===(a=g.params)||void 0===a?void 0:a.companyId});else e=await i.JZ.QN.isFactoringEnabledForCustomer({customerAccountId:null===(l=g.params)||void 0===l?void 0:l.account});P(e.arAdvanceIsEnabled&&e.inHouseCreditIsEnabled)}catch(s){console.error("Error fetching data:",s)}else null!==(n=g.params)&&void 0!==n&&n.invoicesIds&&null!==(o=g.params)&&void 0!==o&&o.isInvited&&P(!1)})()}),[null===(e=g.params)||void 0===e?void 0:e.companyId,null===(t=g.params)||void 0===t?void 0:t.account,null===(n=g.params)||void 0===n?void 0:n.isInvited,null===(l=g.params)||void 0===l?void 0:l.invoicesIds]),(0,o.useEffect)((()=>{var e;if(!E&&("boolean"===typeof w||null===(e=g.params)||void 0===e||!e.companyId)){var t;const e=null===b||void 0===b?void 0:b.reduce(((e,t)=>j(t)?e+t.totalRemainingAmount:e),0);if(w&&null!==(t=g.params)&&void 0!==t&&t.account)B("PayableView");else if(b.length){var n,o;if(w||null!==(n=g.params)&&void 0!==n&&n.invoicesIds&&(null===(o=g.params)||void 0===o||!o.isInvited))B("CompanyInactiveInvoices");else if(D)B("PayableView");else if(I)B("InvoiceDetails");else if(b.length>0&&0===e)B("CompanyInactiveInvoices");else if(b.length>1){const e=b.filter((e=>{var t;return j(e)&&(null===(t=e.customer)||void 0===t?void 0:t.type)!==s.i.IHC&&e.paymentType!==i.mn.FACTORING}));e.length>0?(_(e[0]._id),B("SelectInvoices")):B("CompanyInactiveInvoices")}else B("InvoiceDetails")}else B("NoInvoices")}}),[b,E,h,I,D,w,null===(d=g.params)||void 0===d?void 0:d.companyId,null===(u=g.params)||void 0===u?void 0:u.invoicesIds,null===(m=g.params)||void 0===m?void 0:m.account,null===(p=g.params)||void 0===p?void 0:p.isInvited]),(0,o.useMemo)((()=>{var e,t;if(!k)return o.createElement(c.A,null);const n=O[k],r="SelectInvoices"===k?{...g,params:{...g.params,id:null!==(e=null===(t=g.params)||void 0===t?void 0:t.id)&&void 0!==e?e:F}}:"InvoiceDetails"!==k||I||1!==b.length?g:{...g,params:{...g.params,id:b[0]._id}};return o.createElement(a.A,{style:{flex:1,alignSelf:"center",width:y?"100%":void 0}},o.createElement(n,{navigation:h,route:r,companyInvoices:b,customer:A}))}),[A,b,h,g,k,F,I,y])}))},90336:(e,t,n)=>{"use strict";n.d(t,{O:()=>m});var o=n(50016),r=n(29731),a=n(1923),l=n(38117),i=n(7371),s=n(78267),c=n(82997),d=n(65319),u=n(10272);const m=e=>{let{addressType:t,address:n,attention:s,invoice_document:u}=e;const{t:m}=(0,r.Bd)("global");if(!t||t!==c.nT.DELIVERY)return null;const g=!!u;return o.createElement(o.Fragment,null,o.createElement(i.A,{style:p.infoRow},o.createElement(i.A,{style:p.labelWithTooltip},o.createElement(l.A,{style:p.labelText},m("InvoiceDetails.deliver-to")),g&&o.createElement(d.E,{tooltip:o.createElement(r.x6,{t:m,i18nKey:"InvoiceDetails.deliver-tooltip",components:{bold:o.createElement(l.A,{style:{fontWeight:"700"}})}}),iconName:"help-circle-outline",containerStyle:p.tooltipContainer,size:19,tooltipWidth:275})),n&&o.createElement(l.A,{style:p.valueText},n)),s&&o.createElement(o.Fragment,null,o.createElement(a.A,{style:p.divider}),o.createElement(i.A,{style:p.infoRow},o.createElement(l.A,{style:p.labelText},m("InvoiceDetails.attention-to")),o.createElement(l.A,{style:p.valueText},s))),o.createElement(a.A,{style:p.divider}))},p=s.A.create({infoRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},labelText:{fontSize:14,fontFamily:"Inter",fontWeight:"500",lineHeight:21,color:u.B.text.grey500,maxWidth:"50%"},valueText:{fontSize:14,fontFamily:"Inter",fontWeight:"500",lineHeight:21,color:u.B.text.black,textAlign:"right",maxWidth:"50%"},labelWithTooltip:{flexDirection:"row",alignItems:"center",gap:4,width:"50%"},tooltipContainer:{alignItems:"center",marginTop:3},divider:{marginTop:14,marginBottom:14}})},97900:(e,t,n)=>{"use strict";n.d(t,{N:()=>a});var o=n(32260),r=n(58319);function a(e,t){e.forEach((e=>{r.q.setQueryData(o.o.paymentDetails({id:e}).queryKey,(e=>e?{...e,invoice:{...e.invoice,projectId:t}}:e))}))}},49158:(e,t,n)=>{"use strict";n.d(t,{M:()=>a,R:()=>r});var o=n(78267);const r=o.A.create({invoicesListHeader:{backgroundColor:"#f5f5f5",marginHorizontal:-20,padding:20,flexDirection:"row",marginBottom:20},payInvoiceHeader:{paddingVertical:20,flexDirection:"row",borderBottomWidth:1,borderBottomColor:"#E6EBEE",marginBottom:14}}),a=o.A.create({container:{padding:16},centeredContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:16},header:{flexDirection:"row",justifyContent:"space-between",marginBottom:16},title:{fontSize:18,fontWeight:"600"},centeredTitle:{color:"#335C75",fontSize:16,fontWeight:"700",lineHeight:24},filterText:{fontSize:15,lineHeight:21,fontWeight:"500",color:"#335C75"},factoringFilter:{height:40,alignItems:"flex-end",marginTop:10}})},13673:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var o=n(19462),r=n(82997),a=n(83613),l=n(67869),i=n(48321),s=n(61390);const c={groupedInvoiceProjectWarning:o.types.optional(o.types.boolean,!1),reconnectCreditBank:o.types.optional(o.types.boolean,!1)},d=o.types.compose("InvoiceActionStore",o.types.model(c).actions((e=>({setResumeApplyingForLoan(t){e.resumeApplyingForLoan=t},setGroupedInvoiceProjectWarning(t){e.groupedInvoiceProjectWarning=t},setReconnectCreditBank(t){e.reconnectCreditBank=t},projectNavigation(e,t){a.A.userStore.projectAdded?e.navigate(l.f0.Console.Payables.SelectProject,{ids:t}):e.navigate(l.f0.Console.Payables.NewProject,{ids:t})},singleInvoiceNavigation(t,n,o){t.project_id?e.resumeApplyingForLoan():e.projectNavigation(o,t._id,n)},groupedInvoiceProjectNavigation(t){t&&(i.Ay.isProjectMissingOnAllInvoices(t)?e.setGroupedInvoiceProjectWarning(!0):i.Ay.areInvoicesFromSameProject(t)?e.resumeApplyingForLoan():e.setGroupedInvoiceProjectWarning(!0))},takeUserToCreditApp:(e,t,n,o,i)=>{e(!0);const c=r.q7.create({invoiceId:null!==i&&void 0!==i?i:[o._id]});r.Vv.kQ.loanApplication(c).then((()=>
1{const e=(null===t||void 0===t?void 0:t.name)!==l.f0.Console.Payables.Vendor?{i:null===o||void 0===o?void 0:o._id}:{},r=(0,l.oh)((0,l.wl)("CreditApplication"),e);n.replace(r.name,r.params),a.A.userStore.fetchDocument(s.X.Credit)})).catch((e=>{console.log(e)})).finally((()=>{e(!1)}))}}))).volatile((()=>({resumeApplyingForLoan:()=>{}}))),(0,r.E2)()).create({})},86088:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var o=n(50016),r=n(4419),a=n(29731),l=n(6903),i=n(66950);const s=()=>{const{t:e}=(0,a.Bd)("global");return o.createElement(l.i,{image:o.createElement(r.A,{style:{marginHorizontal:70,width:302,height:230,alignSelf:"center"},source:{uri:i.A}}),style:void 0,heading:e("InvoiceListing.no-invoices"),subHeading:e("InvoiceListing.no-invoices-message")})}},28437:(e,t,n)=>{"use strict";n.d(t,{s:()=>j});var o=n(219),r=n(50016),a=n(38117),l=n(7371),i=n(97076),s=n(82345),c=n(95090),d=n(67976),u=n(98593),m=n(36913),p=n(77356),g=n(19190),h=n(85926),v=n(29731),y=n(5438),b=n(83068),f=n(86088),E=n(97976),C=n(58623),A=n(78267),S=n(74161),w=n.n(S),P=n(58876),I=n(82997),x=n(17720),D=n(35118),T=n(67869),k=n(67956);const B=A.A.create({container:{},item:{marginBottom:10},emptyResult:{justifyContent:"center",marginBottom:60}}),F=e=>{let{invoices:t,viewMode:n,isFactoring:o,navigation:a}=e;const{t:i}=(0,v.Bd)("global"),s=[P.uR.pastDue,P.uR.due,P.uR.placed,P.uR.paymentFailed,P.uR.applicationCancelled,P.uR.applicationRejected,P.uR.pendingDisbursement,P.uR.creditApplied,P.uR.applicationProcessing],c=[P.uR.paid,P.uR.collected,P.uR.creditApplied],d=e=>{if(e.type===I.tD.QUOTE){if(e.authorization_deadline){const t=w()(e.authorization_deadline).tz("America/Chicago").format("MM/DD/YYYY");return i("Receivables.expires-on",{date:t})}return""}{const t=(0,k.jr)(e.invoice_due_date);return i("Receivables.due-on",{date:t})}};return r.createElement(C.A,{data:t,renderItem:e=>{var t,l;let{item:i}=e;return r.createElement(x.H,{key:i._id,onPress:()=>(e=>{var t;if(e.paymentType===I.mn.FACTORING&&e.type===I.tD.INVOICE){var o;const t=(0,T.oh)((0,T.wl)("Console.Payables.PaymentHistory"),{id:e._id,mode:"all"===n&&null!==(o=e.refinance)&&void 0!==o&&o.isRefinanced?"refinanced":void 0});a.replace(t.name,t.params)}else if(c.includes(e.invoiceStatus)){const t=(0,T.oh)((0,T.wl)("Console.Payables.Receipt"),{id:e._id});a.replace(t.name,t.params)}else!s.includes(e.invoiceStatus)||null!==(t=e.supplierInvitationDetails)&&void 0!==t&&t.paymentMethodId||e.totalProcessingAmount||a.navigate(T.f0.Console.Payables.Invoice,{id:e._id})})(i),title:i.supplierInvitationDetails?null===(t=i.supplierInvitationDetails)||void 0===t?void 0:t.name:null===(l=i.company)||void 0===l?void 0:l.name,subtitle:d(i),status:i.invoiceStatus,type:i.type,isFactoring:o,amount:(0,D.f)(i.total_amount),style:{marginBottom:10,marginHorizontal:0}})},keyExtractor:e=>e._id,contentContainerStyle:B.container,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:20,ListEmptyComponent:r.createElement(l.A,{style:B.emptyResult},r.createElement(f.l,null))})};var _=n(88917),N=n(79732),R=n(49158),L=n(68198),M=n(38804),O=n(66187),z=n(49755);const j=(0,y.PA)((e=>{var t,n;let{navigation:y,route:C}=e;const{t:A}=(0,v.Bd)("payables"),[S,w]=(0,r.useState)(!1),[P,x]=(0,r.useState)([]),[D,k]=(0,r.useState)(""),[B,j]=(0,r.useState)(!0),[V,H]=(0,z.r)(),[U,G]=(0,r.useState)(b.dm.INVOICES),{open:Y,acceptedFiles:Q,getInputProps:q,fileRejections:K}=(0,c.VB)(u.on),{hasUnsedActiveCards:J,fetchLoans:Z}=g.A,{fetchInvoiceToPay:X}=(0,m.fv)(),{setMessage:$}=(0,d.JX)(),ee=E.A.userStore.settings.get("canUploadInvoice"),{routeParams:{action:te}}=E.A,ne=_.GO,oe=_.lJ,re=!(null===(t=oe.currentVendor)||void 0===t||!t.supplierName||!oe.isFactoring);(0,r.useEffect)((()=>{"reloadInvoices"===te&&E.A.initRouteParams({})}),[te]),(0,r.useEffect)((()=>{Z()}),[Z]),(0,r.useEffect)((()=>{re&&oe.fetchStatisticsData()}),[re,oe]),(0,s.useFocusEffect)((0,r.useCallback)((()=>{if(!ne.isLoading&&ne.dataLoaded&&1===ne.vendorsLength){const e=setTimeout((()=>{var e,t;y.navigate(T.f0.Console.Payables.Vendor,{companyId:null===(e=ne.tableData)||void 0===e||null===(t=e.items[0])||void 0===t?void 0:t.id})}),0);return()=>clearTimeout(e)}}
1),[ne.isLoading,ne.dataLoaded,ne.vendorsLength,null===(n=ne.tableData)||void 0===n?void 0:n.items,y])),(0,s.useFocusEffect)((0,r.useCallback)((()=>{const e=re?[I.tD.INVOICE]:[I.tD.QUOTE,I.tD.INVOICE,I.tD.SALE_ORDER];X({types:e}).then((e=>{x(e.items),k("All"),j(!1)})).catch((e=>{j(!1),console.log(e)}))}),[x,k,j,X,re])),(0,r.useEffect)((()=>{Q.length<1||(0,u.Ms)(y,Q)}),[Q,y]),(0,r.useEffect)((()=>{K.length>0&&(0,u.RM)(K,$)}),[K,$]);const ae=(0,r.useMemo)((()=>{let e;e="All"===D?P:P.filter((e=>e.invoiceStatus===D.split(" ").join("").toUpperCase()));const t=U===b.dm.REFI;return t&&(e=e.filter((e=>{var t;return null===(t=e.refinance)||void 0===t?void 0:t.isRefinanced}))),0!==e.length||B?U===b.dm.VENDORS?r.createElement(b.Zq,{invoices:e}):r.createElement(F,{invoices:e,isFactoring:re,viewMode:t?"refi":"all",navigation:y,route:C}):r.createElement(f.l,null)}),[D,P,B,y,C,U,re]);return B||oe.isStatisticsLoading?r.createElement(p.A,null):r.createElement(r.Fragment,null,r.createElement(o.A,{toolbar:r.createElement(W,{onPress:()=>w(!0),t:A,switcher:U,setSwitcher:G,vendorsLength:ne.vendorsLength,isFactoring:re,showRefiTab:P.some((e=>{var t;return null===(t=e.refinance)||void 0===t?void 0:t.isRefinanced}))})},J&&r.createElement(h.A,{mobileView:!0,dontShowExpired:!0}),re&&r.createElement(r.Fragment,null,r.createElement(N.A,{company:{name:oe.currentVendor.supplierName,phone:oe.currentVendor.supplierPhone},totalAmount:oe.vendorsStatistics.totalDueSum,style:R.R.invoicesListHeader,amountLabel:A("payables.mobile.totalBalanceDue"),amountLabelStyles:{marginTop:4,color:"#668598"}}),r.createElement(L.A,{statistics:oe.vendorsStatistics}),1===ne.vendorsLength&&r.createElement(l.A,{style:R.M.factoringFilter},r.createElement(a.A,{style:R.M.filterText,onPress:()=>w(!0)},r.createElement(i.YGH,null)," ",A("payables.mobile.filters")))),V.showAutoPayWarning&&r.createElement(l.A,{style:{marginBottom:15}},r.createElement(M.A,{key:V.refreshKey,onActionPress:()=>H({type:z.U.SHOW_IHC_SETUP_FLOW}),onClose:()=>H({type:z.U.HIDE_WARNING}),isAutoPayIhcFlowOpened:V.showAutoPayFlow})),ae,r.createElement("input",q()),r.createElement(b.dJ,{t:A,onPress:e=>k(e),filterStatus:D,onClose:()=>w(!1),visible:S})),!!ee&&r.createElement(b.Mw,{onPress:Y}),V.showAutoPayFlow&&r.createElement(O.i,{onClose:()=>H({type:z.U.HIDE_IHC_SETUP_FLOW}),onSuccess:()=>H({type:z.U.AUTO_PAY_IHC_SETUP_SUCCESS})}))})),W=e=>{let{onPress:t,t:n,switcher:o,setSwitcher:s,vendorsLength:c,isFactoring:d,showRefiTab:u}=e;return d&&1===c?r.createElement(l.A,{style:R.M.centeredContainer},r.createElement(a.A,{style:R.M.centeredTitle},n("payables.allPayables"))):r.createElement(l.A,{style:R.M.container},r.createElement(l.A,{style:R.M.header},r.createElement(a.A,{style:R.M.title},n("payables.mobilePayables")),r.createElement(a.A,{style:R.M.filterText,onPress:t},r.createElement(i.YGH,null)," ",n("payables.mobile.filters"))),r.createElement(b.ij,{active:o,options:u?[b.dm.INVOICES,b.dm.REFI,b.dm.VENDORS]:[b.dm.INVOICES,b.dm.VENDORS],onPress:s}))}},83068:(e,t,n)=>{"use strict";n.d(t,{Mw:()=>k,Zq:()=>P,dJ:()=>T,dm:()=>w,ij:()=>x});var o=n(78267),r=n(7371),a=n(50016),l=n(63680),i=n(58876),s=n(14329),c=n(25891),d=n(429),u=n(1923),m=n(18739),p=n(10150),g=n(68215),h=n(97076),v=n(29731),y=n(86088),b=n(82345),f=n(67869),E=n(28207),C=n(79732),A=n(19925);const S={All:"All",Paid:i.uR.paid,Collected:i.uR.collected,Due:i.uR.due,"Past Due":i.uR.pastDue,"Trade Credit Request Submitted":i.uR.applicationProcessing,"Authorization in Review":i.uR.authorizationInReview,Authorized:i.uR.authorized,Invoiced:i.uR.invoiced,"Credit Applied":i.uR.creditApplied,Cancelled:i.uR.cancelled,Expired:i.uR.expired,"Invoice Rejected":i.uR.rejected,Placed:i.uR.placed,Failed:i.uR.paymentFailed,"Review Required":i.uR.reviewRequired,"Terms Requested":i.uR.termsRequested};let w=function(e){return e.INVOICES="invoices",e.VENDORS="vendors",e.REFI="refi",e}({});const P=e=>{let{invoices:t}=e;if(null===t||void 0===t||!t.length)return a.createElement(y.l,null);const n=[];return t.filter((e=>{var t;return!(null===(t=e.company)||void 0===t||!t._id)})).forEach((e=>{const t=(e=>{const t=!!e.loanAppStatus&&i.$D.some((t=>t===e.loanAppStatus));return["invoice","sales_order"].includes(e.type)&&e.company&&E.Sn.includes(e.invoiceStatus)&&!t&&(e.company.isInvited||e.customer_account_id)})(e),o=e.company,r=n.find((e=>e._id===o._id));
1r?(r.totalAmount+=t?e.totalRemainingAmount:0,r.invoiceCount=r.invoiceCount+1,r.invoicesIds.push(e._id)):n.push({...o,totalAmount:t?e.totalRemainingAmount:0,invoiceCount:1,invoicesIds:[e._id]})})),0===n.length?a.createElement(y.l,null):a.createElement(a.Fragment,null,n.sort(((e,t)=>t.totalAmount-e.totalAmount)).map(((e,t)=>a.createElement(I,{company:e,key:t}))))},I=e=>{let{company:t}=e;const n=(0,b.useNavigation)(),{t:o}=(0,v.Bd)("global");return a.createElement(c.dY,{style:{borderColor:"#E6EBEE",borderWidth:1,borderRadius:8,marginBottom:10},onPress:()=>{t.isInvited?n.navigate(f.f0.Console.Payables.Vendor,{invoicesIds:t.invoicesIds,companyId:void 0,isInvited:!0}):(0!==t.totalAmount||t.isInvited)&&1===t.invoiceCount?n.navigate(f.f0.Console.Payables.Invoice,{id:t.invoicesIds[0]}):n.navigate(f.f0.Console.Payables.Vendor,{companyId:t._id})}},a.createElement(C.A,{company:t,totalAmount:t.totalAmount,style:{flexDirection:"row",padding:15},companyFontSize:16,amountLabel:o("TabInvoice.amount_due")}))},x=e=>{let{active:t,onPress:n,options:o}=e;return a.createElement(r.A,{style:B.switchContainer},o.map((e=>a.createElement(D,{key:e,active:t,onPress:n,type:e}))))},D=e=>{let{active:t,onPress:n,type:o}=e;return a.createElement(s.BtText,{onPress:()=>n(o),style:[B.switchItem,t===o&&B.switchItemActive]},o===w.INVOICES?"Invoices":o===w.REFI?"Refi":"Vendors")},T=e=>{let{visible:t,onClose:n,onPress:o,filterStatus:l,t:i}=e;const{sm:s}=(0,A.Qs)();return a.createElement(p.A,{visible:t,height:s?"70%":"80%",title:i("InvoiceListing.filters"),onClose:n},Object.keys(S).map((e=>a.createElement(c.dY,{key:e,onPress:()=>{n(),o(S[e])}},a.createElement(r.A,{style:{flexDirection:"row",justifyContent:"space-between"}},a.createElement(d.A,{key:e,title:e}),l===S[e]&&a.createElement(h.NKr,{style:{alignSelf:"center",width:25,height:15}})),a.createElement(u.A,null)))))},k=(0,l.PA)((e=>{let{onPress:t}=e;const{mobileWidth:n}=(0,A.Qs)();return a.createElement(m.A,{style:{position:"absolute",width:48,height:48,left:.83*n,bottom:74,backgroundColor:g.commonColors.accentText,alignItems:"center",justifyContent:"center",borderRadius:24},icon:()=>a.createElement(h.K3Z,{style:{alignSelf:"center",marginTop:2}}),onPress:t})})),B=o.A.create({companyItemContainer:{},switchContainer:{width:"100%",flexDirection:"row",height:40,alignItems:"center",backgroundColor:"#f0f6fa",borderRadius:9,padding:4},switchItem:{width:"50%",height:"100%",borderRadius:9,backgroundColor:"transparent",textAlign:"center",paddingTop:7,color:"#335C75",fontWeight:"500"},switchItemActive:{backgroundColor:"white",color:"#00A0F3",fontWeight:"600"}})},2635:(e,t,n)=>{"use strict";n.d(t,{c:()=>A});var o,r=n(60034),a=n(50016),l=n(22759),i=n(40046),s=n(38117),c=n(82997),d=n(77356),u=n(97076),m=n(82047),p=n(16148),g=n(83959),h=n.n(g),v=n(82345),y=n(29731),b=n(98357),f=n(19925),E=n(67869),C=n(43723);const A=e=>{var t;let{navigation:n}=e;const o=(0,v.useRoute)(),{t:r}=(0,y.Bd)("global"),{id:c,token:h}=null!==(t=o.params)&&void 0!==t?t:{},[b,C]=(0,a.useState)(null),[A,P]=(0,a.useState)(!0),{mobileWidth:x}=(0,f.Qs)();(0,a.useEffect)((()=>{let e=!1;return P(!0),S(h,c).then((t=>{e||C(t)})).catch((e=>{console.log(e.message)})).finally((()=>{e||P(!1)})),()=>{e=!0}}),[c,h]);const D=(0,a.useMemo)((()=>b?a.createElement(I,{key:b.url,documents:[{uri:b.url,fileType:w(b.fileName),fileName:b.fileName}],style:{height:"100%",width:"100%",backgroundColor:"white"},pluginRenderers:[g.JPGRenderer,g.PNGRenderer,g.MSDocRenderer,g.PDFRenderer],config:{header:{disableHeader:!1,disableFileName:!0}}}):null),[b]);return A?a.createElement(d.A,null):a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",height:"100vh"}},a.createElement(l.M,{centerComponent:a.createElement(s.A,{style:{fontSize:16,fontWeight:"500"}},r("previewInvoice")),leftComponent:a.createElement(l.I,{icon:a.createElement(m.A,{icon:a.createElement(u.tTe,{height:"20",width:"20"}),onPress:()=>{n.canGoBack()?n.goBack():n.replace(E.f0.Console._self,{screen:E.f0.Console.Credit._self})}})}),rightComponent:a.createElement(m.A,{icon:a.createElement(u.s3U,{height:"20",width:"20"}),onPress:()=>{b&&(p.HZ?window.open(b.url,"_blank"):i.A.openURL(b.url))}}),headerStyle:{width:x}}),D)},S=async(e,t)=>{if(e){const{url:t,fileName:n}=await c.Vv.NJ.invoiceDocument({token:e});return{url:t,fileName:n}}if(null!==t&&void 0!==t&&t.length){const{url:e,fileName:n}=await c.Vv.NJ.invoiceDocument({invoiceId:t});return{url:e,fileName:n}}const n=JSON.parse(await b.Ay.getItem("invoice_document")||"null");if(null===n||void 0===n||!n.key)throw new Error("no document to preview");const{url:o}=await c.Vv.NJ.uploadedDocument({key:n.key});return{url:o,fileName:P(n.key)}},w=e=>e.split(".").reverse()[0],P=e=>e.split("/").pop()||e,I=(0,C.default)(h())(o||(o=(0,r.A)(["\n  & #image-renderer {\n    background-image: unset;\n  }\n\n  /* Fix header buttons becoming non-clickable when scrolling */\n  & #pdf-control
1s {\n    position: sticky;\n    top: 0;\n    left: 0;\n    right: 0;\n    z-index: 10;\n    pointer-events: auto;\n  }\n"])))},72776:(e,t,n)=>{"use strict";n.d(t,{F:()=>g});var o=n(50016),r=n(58876),a=n(17720),l=n(67869),i=n(35118),s=n(82997),c=n(7007),d=n(74161),u=n.n(d),m=n(29731),p=n(67956);const g=e=>{let{invoices:t,viewMode:n,navigation:d,setModal:g,isFactoring:h,disabled:v}=e;const y=[r.uR.pastDue,r.uR.due,r.uR.placed,r.uR.paymentFailed,r.uR.applicationCancelled,r.uR.applicationRejected,r.uR.pendingDisbursement,r.uR.creditApplied,r.uR.applicationProcessing],{t:b}=(0,m.Bd)("global"),f=[r.uR.paid,r.uR.collected,r.uR.creditApplied],E=e=>{if(e.type===s.tD.QUOTE){var t,n;const o=u()(null===(t=e.quoteDetails)||void 0===t?void 0:t.authorization_deadline).tz("America/Chicago").format("MM/DD/YYYY");return null!==(n=e.quoteDetails)&&void 0!==n&&n.authorization_deadline?b("Receivables.expires-on",{date:o}):""}{const t=(0,p.jr)(e.invoice_due_date);return b("Receivables.due-on",{date:t})}};return t.map((e=>{var t,r;return o.createElement(a.H,{key:e._id,onPress:()=>(e=>{var t,o,r;g&&g(!1),e.paymentType===s.mn.FACTORING||(null===(t=e.customer)||void 0===t?void 0:t.type)===c.i.IHC?d.navigate(l.f0.Console.Payables.PaymentHistory,{id:e._id,mode:"all"===n&&null!==(r=e.refinance)&&void 0!==r&&r.isRefinanced?"refinanced":void 0}):f.includes(e.status)?d.navigate(l.f0.Console.Payables.Receipt,{id:e._id}):!y.includes(e.status)||null!==(o=e.supplierInvitationDetails)&&void 0!==o&&o.paymentMethodId||e.totalProcessingAmount||d.navigate(l.f0.Console.Payables.Invoice,{id:e._id})})(e),title:e.supplierInvitationDetails?null===(t=e.supplierInvitationDetails)||void 0===t?void 0:t.name:null===(r=e.company)||void 0===r?void 0:r.name,subtitle:E(e),status:e.status,type:e.type,disabled:v,isFactoring:h,amount:(0,i.f)(e.total_amount),style:{marginBottom:10}})}))}},89566:(e,t,n)=>{"use strict";n.d(t,{G:()=>_});var o=n(50016),r=n(19925),a=n(38117),l=n(7371),i=n(78267),s=n(32572),c=n(4670),d=n(97076),u=n(32553),m=n(67869),p=n(29731),g=n(82997),h=n(77356),v=n(69873),y=n(38767),b=n(48321),f=n(13673),E=n(97900);const{isSearchScoreMoreThanThreshold:C}=b.Ay,A=e=>{let{matchScore:t,t:n}=e;const{sm:i}=(0,r.Qs)();return C(t)?o.createElement(l.A,{style:i?P.suggested:P.suggestedMobile},o.createElement(a.A,{style:{fontWeight:"600",fontSize:12,color:"#00A0F3"}},n("SelectProject.suggested"))):null},S=e=>{var t;let{route:n,navigation:a}=e;const{resumeApplyingForLoan:i}=f.A,{t:s}=(0,p.Bd)("global"),{sm:d}=(0,r.Qs)(),[m,b]=(0,o.useState)(""),S=[{cell:e=>{var t;return o.createElement(l.A,{style:{marginBottom:20,marginTop:20,width:"100%"}},!d&&o.createElement(A,{t:s,matchScore:e.matchScore}),o.createElement(l.A,{style:{flexDirection:"row"}},o.createElement(l.A,{style:{flexDirection:"row",flex:1}},o.createElement(u.u8,{style:(0,y.composeStyle)(P.rowsLabel,!d&&P.rowsLabelMobile)},e.data?(e=>{let{streetAddress:t,city:n,state:o,zip:r}=e;return"".concat(t,", ").concat(n,", ").concat(o,", ").concat(r)})(null===(t=e.data)||void 0===t?void 0:t.propertyAddress.items[0].content):e.address),d&&o.createElement(A,{t:s,matchScore:e.matchScore})),o.createElement(c.A,{style:{width:d?126:84,height:34,borderRadius:8,backgroundColor:C(e.matchScore)?"#00A0F3":"#F5F7F8",alignItems:"center",justifyContent:"center"},onPress:()=>(e=>{var t;const o=null===(t=n.params)||void 0===t?void 0:t.ids.split(",");b(e._id),g.Vv.Cv.addInvoices(e._id,{invoices:o}).then((()=>{(0,E.N)(o,e._id),a.goBack(),i()})).catch((e=>{console.log(e),b("")}))})(e)},m===e._id?o.createElement(h.A,null):o.createElement(u.u8,{style:{fontWeight:"700",fontSize:14,color:C(e.matchScore)?"white":"#003353"}},s("SelectProject.select-button-label")))))}}];return o.createElement(v.r,{cols:S,params:null===(t=n.params)||void 0===t?void 0:t.ids})},w=e=>{const{t:t}=(0,p.Bd)("global"),{navigation:n,route:r}=e;return o.createElement(s.A,{style:P.wrapper},o.createElement(c.A,{testID:"projects-detail-back",onPress:()=>{n.goBack()},style:P.backBtnContainer},o.createElement(d.ATo,null),o.createElement(u.u8,{style:P.backBtnText},t("SelectProject.back-to-invoice-details"))),o.createElement(a.A,{style:P.title},t("SelectProject.title")),o.createElement(a.A,{style:P.subtitle},t("SelectProject.subtitle")),o.createElement(c.A,{style:P.button,activeOpacity:.8,onPress:()=>{var e;n.navigate(m.f0.Console.Payables.NewProject,{ids:null===(e=r.params)||void 0===e?void 0:e.ids})},testID:"projects-add-button"},o.createElement(u.u8,{style:P.addButtonLabel},t("Projects.add_new_project")),o.createElement(d.GD8,{width:16,height:16})),o.createElement(S,e))},P=i.A.create({wrapper:{maxWidth:680,alignSelf:"center"},title:{fontWeight:"700",fontSize:32,lineHeight:40,marginBottom:10},subtitle:{fontWeight:"500",fontSize:18,lineHeight:28,marginBottom:20,color:"#19262F"},button:{border:"none",borderRadius:4,backgroundColor:"#00A0F3",flexDirection:"row",alignItems:"center",paddingHorizontal:24,paddingVertical:16,maxWidth:220,maxHeight:48,marginTop:15,marginBottom:40},addButtonLabel:{color:"#FFF",fontSize:16,fontWeight:"700",lineHeight:24,marginRight:24},rowsLabel:{fontWeight:"500",fontSize:14,color:"#003353",lineHeight:20},rowsLabelMobile:{maxWidth:260},suggested:{height:22,width:129,backgroundColor:"#F4F9FD",paddingHorizontal:10,borderRadius:5,marginLeft:10,justifyContent:"center"},suggestedMobile:{height:22,width:129,backgroundColor:"#F4F9FD",paddingHorizontal:10,borderRadius:5,justifyContent:"center",marginBottom:10},backBtnContainer:{flexDirection:"row",alignItems:"center",marginTop:70,marginBottom:20},backBtnText:{fontWeight:"600",color:"#335C75",fontSize:16,marginLeft:15}});var I=n(82047),x=n(22759),D=n(219),T=n(25207);const k=e=>{let{navigation:t}=e;return o.createElement(x.I,{icon:o.createElement(I.A,{icon:o.createElement(d.tTe,{height:"20",width:"20"}),onPress:()=>t.goBack()})})},B=e=>{const{t:t}=(0,p.Bd)("global"),{navigation:n,route:r}=e;return o.createElement(D.A,{toolbar:o.createElement(x.M,{headerStyle:{marginBottom:0,borderBottomWidth:1,borderBottomColor:"#E6EBEE"},leftComponent:o.createElement(k,{navigation:n})}),footer:o.createElement(l.A,{style:F.buttonContainer},o.createElement(T.A,{label:t("SelectProject.create-new-project"),onPress:()=>{var e;n.navigate(m.f0.Console.Payables.NewProject,{ids:null===(e=r.params)||void 0===e?void 0:e.ids})},buttonStyle:F.createProjectButton,textStyle:F.createProjectButtonLabel}))},o.createElement(a.A,{style:F.title},t("SelectProject.title-mobile")),o.createElement(a.A,{style:F.subtitle},t("SelectProject.subtitle-mobile")),o.createElement(s.A,null,o.createElement(S,e)))},F=i.A.create({title:{marginTop:16,fontWeight:"700",fontSize:20,lineHeight:28,marginBottom:10},subtitle:{fontWeight:"400",fontSize:14,lineHeight:20,marginBottom:15,color:"#19262F"},link:{fontSize:14,fontWeight:"600",lineHeight:20,color:"#00A0F3",textDecorationLine:"underline",marginBottom:15},buttonContainer:{paddingHorizontal:20,width:"100%",shadowOffset:{width:0,height:-4},shadowOpacity:.06,shadowRadius:12,elevation:4},createProjectButton:{backgroundColor:"#F8F9F9",marginVertical:16},createProjectButtonLabel:{color:"#001929",fontWeight:"700",fontSize:16,lineHeight:24,fontFamily:"Inter"}}),_=e=>{const{sm:t}=(0,r.Qs)();return t?o.createElement(w,e):o.createElement(B,e)}},49606:(e,t,n)=>{"use strict";n.d(t,{l:()=>c,u:()=>s});var o=n(50016),r=n(95090),a=n(4670),l=n(98593),i=n(67976);const s=o.createContext({onPress:()=>{}}),c=e=>{let{children:t,navigation:n,onSuccess:c}=e;const{open:d,acceptedFiles:u,getInputProps:m,fileRejections:p}=(0,r.VB)(l.on),{setMessage:g}=(0,i.JX)();(0,o.useEffect)((()=>{u.length<1||(0,l.Ms)(n,u,c)}),[u]),(0,o.useEffect)((()=>{p.length>0&&(0,l.RM)(p,g)}),[p]);const h=(0,o.useMemo)((()=>({onPress:d})),[d]);return o.createElement(o.Fragment,null,o.createElement("input",m()),o.createElement(a.A,{onPress:d},o.createElement(s.Provider,{value:h},t)))}},13435:(e,t,n)=>{"use strict";n.d(t,{g:()=>F});var o=n(50016),r=n(219),a=n(40046),l=n(78267),i=n(38117),s=n(4670),c=n(7371),d=n(10237),u=n(95390),m=n(97976),p=n(2745),g=n(82997),h=n(19462),v=n(30404),y=n(82345),b=n(97076),f=n(82047),E=n(3241),C=n(56543),A=n(17171),S=n(29731),w=n(12709),P=n(66760),I=n(5438),x=n(38767),D=n(16148),T=n(68215);const k=h.types.compose(h.types.model({sub:h.types.maybeNull(h.types.string),name:h.types.maybeNull(h.types.string),login:h.types.maybeNull(h.types.string),firstName:h.types.maybeNull(h.types.string),lastName:h.types.maybeNull(h.types.string),companyName:h.types.maybeNull(h.types.string),email:h.types.maybeNull(h.types.string),phone:h.types.maybeNull(h.types.string)}),(0,g.E2)()).views((e=>({get isDisabled(){return(0,w.validateEmail)(e.email||void 0)&&(0,w.validateUSPhoneNumber)(e.phone||void 0)}}))),B=()=>{const{t:e}=(0,S.Bd)("global"),t=(0,y.useNavigation)();return o.createElement(c.A,{style:{height:v.u,flexDirection:"row",alignItems:"center",backgroundColor:"#FFFFFF",paddingHorizontal:20,borderBottomWidth:1,borderBottomColor:"#F5F7F8",width:400}},o.createElement(f.A,{icon:o.createElement(b.tTe,{height:"16",width:"16"}),onPress:()=>(e=>{e.canGoBack()?e.goBack():e.navigate("More")})(t)}),o.createElement(c.A,{style:{flex:1,alignItems:"center"}},o.createElement(i.A,{style:{fontWeight:"500",fontSize:16}},e("Profile.profile"))))},F=(0,I.PA)((()=>{const{t:e}=(0,S.Bd)("global"),{userStore:t}=(0,m.P)(),{user:n,company:l,credit:i}=t,{screenHeight:s}=(0,A.Qs)(),[h,v]=(0,o.useState)(null),[y,b]=(0,o.useState)(!1);(0,o.useEffect)((()=>{Promise.all([g.JZ.IE.hasPersonalGuarantorAgreement(),null!==i&&void 0!==i&&i.LoCnumber?Promise.resolve():t.fetchUser()]).then((e=>{let[t,n]=e;return b(t.hasAgreement)}
1)).catch((e=>console.log(e)))}),[]),(0,o.useEffect)((()=>{var e;const t=(0,p.toJS)(n),o=(null===t||void 0===t||null===(e=t.phone)||void 0===e?void 0:e.replace(/^\+[0-9]/,"").trim())||"",r=(0,d.r)(o,"US"),a={...t,phone:r,companyName:(null===l||void 0===l?void 0:l.legalName)||(null===l||void 0===l?void 0:l.name)};v(k.create((0,p.toJS)(a)))}),[null===l||void 0===l?void 0:l.legalName,null===l||void 0===l?void 0:l.name,n]);return o.createElement(r.A,{toolbar:o.createElement(B,null)},o.createElement(c.A,{style:{backgroundColor:"white",flexDirection:"column",justifyContent:"space-between",flex:1}},o.createElement(c.A,{style:{backgroundColor:"white",height:s-200}},o.createElement(C.p,{value:((null===h||void 0===h?void 0:h.firstName)||"")+" "+((null===h||void 0===h?void 0:h.lastName)||""),label:e("Account.full_name"),onChangeText:()=>{},disabled:!0}),o.createElement(E.F,{model:h,editable:!1,label:e("Account.business-name"),name:"companyName"}),o.createElement(E.F,{model:h,editable:!1,label:e("Account.email"),name:"email",mandatory:!0,validateInput:e=>(0,w.validateEmail)(e)?"":"Invalid email"}),o.createElement(E.F,{model:h,editable:!1,label:e("Account.cell-phone-number"),name:"phone",mandatory:!0,validateInput:e=>(0,w.validateUSPhoneNumber)(e)?"":"Invalid phone number"}),!(null===i||void 0===i||!i.LoCnumber)&&o.createElement(_,{downloadFile:()=>g.JZ.IE.tryGetMasterAgreement().then((e=>{D.HZ?window.open(e.url,"_blank"):a.A.openURL(e.url)})),title:e("Account.click-here-to-download-LoC")}),y&&o.createElement(_,{downloadFile:()=>g.JZ.IE.downloadPersonalGuarantorAgreements().then((e=>(0,x.mm)(e.url,{},e.fileName,"application/zip"))),title:e("Account.click-here-to-download-PGA")})),o.createElement(c.A,{style:{paddingVertical:25}},o.createElement(u.N,{title:e("Account.to_deactivate_account"),color:"#99ADBA",textStyle:{fontSize:15,textAlign:"center"},onPress:()=>null}))))})),_=e=>{let{downloadFile:t,title:n}=e;const[r,a]=(0,o.useState)(!1);return o.createElement(o.Fragment,null,r?o.createElement(P.A,{style:N.agreementLoadingIndicator,color:T.commonColors.accentText}):o.createElement(s.A,{onPress:()=>{a(!0),t().finally((()=>a(!1)))}},o.createElement(i.A,{style:N.agreementLink},n)))},N=l.A.create({agreementLink:{fontWeight:"600",fontSize:16,lineHeight:24,color:"#00A0F3",textAlign:"center",marginTop:40,width:250,alignSelf:"center"},agreementLoadingIndicator:{color:"#00A0F3",marginLeft:10,marginTop:40}})},66187:(e,t,n)=>{"use strict";n.d(t,{i:()=>B});var o=n(50016),r=n(5438),a=n(76448),l=n(82997),i=n(56480),s=n(70764),c=n(4557),d=n(86919),u=n(29731),m=n(63680),p=n(83613),g=n(73819),h=n(91162),v=n(52474),y=n(58876),b=n(3180),f=n(2745);const E=(0,m.PA)((e=>{var t,n,r,m;let{options:E,onSuccess:C,onDisable:A,onClose:S,onAddPaymentMethod:w}=e;const{t:P}=(0,u.Bd)("global"),I=p.A.screensStore.paymentMethodsStore,{paymentMethods:x,loanRepaymentSettings:D,loading:T}=I,k=null!==(t=I.find(E.paymentMethodId))&&void 0!==t?t:null,{mutate:B,isPending:F}=(0,a.n)({mutationFn:e=>l.JZ.IE.ihcAutoPayEnable(e),onSuccess:(e,t)=>C(t)}),_=null===(n=p.A.userStore.company)||void 0===n||null===(r=n.settings)||void 0===r?void 0:r.inHouseCredit,N=!(null===_||void 0===_||!_.isAutoPayRequired),R=E.hasAutoPayMethod?P("autoPayIHCFlow.updatePaymentMethod.title"):P("autoPayIHCFlow.addOrSelectPaymentMethod.title"),L=E.hasAutoPayMethod?P("autoPayIHCFlow.updatePaymentMethod.subtitle"):P("autoPayIHCFlow.addOrSelectPaymentMethod.subtitle"),M=k&&k.paymentMethodType===y.mf.Card,O=M?(0,b.w)(k,D):0,z=e=>{(0,f.runInAction)((()=>{E.paymentMethodId=e}))};return o.createElement(d.V,{title:R,onClose:S,loading:null===E.hasAutoPayMethod},o.createElement(d.V.Content,null,o.createElement(i.E,{mb:16},L),o.createElement(s.B,{gap:0},o.createElement(g.Z,{required:!0,label:P("autoPayIHCFlow.paymentMethodLabel"),options:[...x].map((e=>({value:e.id,label:h.A.getLongName(e)}))),value:null!==(m=null===k||void 0===k?void 0:k.id)&&void 0!==m?m:null,disabled:T,onChange:z,maxDropdownHeight:200,allowDeselect:!1}),o.createElement(v.O,{mt:16,mb:0,paymentMethod:k,onSuccess:e=>e&&z(e)}),o.createElement(g.wP,{disabled:T,onClick:w,mt:16},P("autoPayIHCFlow.addNewPaymentMethod")),M&&o.createElement(g.Z0,{title:P("autoPayIHCFlow.processingFeeNote",{processingFee:O}),mt:16}))),o.createElement(d.V.Buttons,null,!N&&E.hasAutoPayMethod&&A&&o.createElement(c.$,{color:"red",onClick:A,disabled:F},P("autoPayIHCFlow.updatePaymentMethod.turnOff")),o.createElement(c.$,{onClick:()=>{k&&B(k.id)},disabled:!k||!I.canUsePaymentMethod(E.paymentMethodId)||F,loading:F},E.hasAutoPayMethod?P("autoPayIHCFlow.updatePaymentMethod.save"):P("autoPayIHCFlow.addOrSelectPaymentMethod.buttonText"))))}));var C=n(77343),A=n(97537);const S=(0,m.PA)((e=>{var t;let{options:n,onClose:r}=e;const{t:a}=(0,u.Bd)("global"),l=null!==(t=p.A.screensStore.paymentMethodsStore.find(n.paymentMethodId))&&void 0!==t?t:null,s=!n.hasAutoPayMethod;return o.createElement(g.HD,{icon:o.createElement(g.GQ,{type:"success"}),title:a(s?"autoPayIHCFlow.success.enabled.title":"autoPayIHCFlow.success.updated.title"),buttons:[a("autoPayIHCFlow.success.doneButton")],"data-testid":"done_setup_auto_pay_btn",onClose:r},o.createElement(u.x6,{t:a,i18nKey:s?"autoPayIHCFlow.success.enabled.subtitle":"autoPayIHCFlow.success.updated.subtitle",components:{bold:o.createElement(i.E,{span:!0,inherit:!0,fw:700})},values:{paymentMethod:w(l)}}),a(s?"autoPayIHCFlow.success.enabled.additionalInfo":"autoPayIHCFlow.success.updated.additionalInfo"))})),w=e=>{var t,n;const o=A.Ay.getFixedT(null,"global");var r,a,l,i;return"card"===(null===e||void 0===e?void 0:e.paymentMethodType)?o("autoPayIHCFlow.success.cardTitle",{typeOfCard:null!==(r=null===e||void 0===e||null===(a=e.cardMetadata)||void 0===a?void 0:a.type)&&void 0!==r?r:"",accountNumber:null!==(l=null===e||void 0===e||null===(i=e.cardMetadata)||void 0===i?void 0:i.lastFour)&&void 0!==l?l:"****"}):o("autoPayIHCFlow.success.bankAccountTitle",{accountNumber:null!==(t=null===e||void 0===e||null===(n=e.accountNumber)||void 0===n?void 0:n.slice(-4))&&void 0!==t?t:"****"})};var P=n(34956),I=n(6330);const x=e=>{let{onClose:t,onKeepAutoPayEnabled:n,onSuccess:r}=e;const{t:i}=(0,u.Bd)("global"),s=(0,I.k)(),{mutate:c,isPending:d}=(0,a.n)({mutationFn:()=>l.JZ.IE.ihcAutoPayDisable(),onSuccess:r});return o.createElement(g.HD,{icon:o.createElement(g.GQ,{type:"alert"}),title:i("autoPayIHCFlow.turnOff.title"),loading:d,buttons:[{label:i(s?"autoPayIHCFlow.turnOff.keepAutoPayButton":"autoPayIHCFlow.turnOff.keepAutoPayEnabledButton"),onClick:n},{label:i("autoPayIHCFlow.turnOff.turnOffButton"),onClick:()=>c(),props:{color:"red"}}],onClose:t}
1,i("autoPayIHCFlow.turnOff.subtitle"))},D=e=>{let{onClose:t}=e;const{t:n}=(0,u.Bd)("global");return o.createElement(g.HD,{icon:o.createElement(g.GQ,{type:"info"}),title:n("autoPayIHCFlow.success.disabled.title"),buttons:[n("autoPayIHCFlow.success.doneButton")],"data-testid":"done_disabled_auto_pay_btn",onClose:t},n("autoPayIHCFlow.success.disabled.subtitle"),n("autoPayIHCFlow.success.disabled.additionalInfo"))};var T=n(89199),k=function(e){return e[e.None=0]="None",e[e.Configure=1]="Configure",e[e.ConfigureSuccess=2]="ConfigureSuccess",e[e.Disable=3]="Disable",e[e.DisableSuccess=4]="DisableSuccess",e[e.AddPaymentMethod=5]="AddPaymentMethod",e}(k||{});const B=(0,r.PA)((e=>{let{onClose:t,onSuccess:n}=e;const{t:r}=(0,u.Bd)("global"),{step:a,goTo:l}=(0,P.qM)(k),i=p.A.screensStore.paymentMethodsStore,s=(0,m.iz)((()=>({paymentMethodId:null,hasAutoPayMethod:!1,hasPaymentMethods:!1})));return(0,o.useEffect)((()=>(0,f.when)((()=>!i.loading),(()=>{const e=i.paymentMethods.find((e=>e.isPrimaryForIHCAutoPay));(0,f.runInAction)((()=>{var t,n,o;s.hasAutoPayMethod=!!e,s.paymentMethodId=null!==(t=null!==(n=null===e||void 0===e?void 0:e.id)&&void 0!==n?n:null===(o=i.paymentMethods[0])||void 0===o?void 0:o.id)&&void 0!==t?t:null,s.hasPaymentMethods=!!i.paymentMethods.length})),i.paymentMethods.length?l(k.Configure):l(k.AddPaymentMethod)}))),[]),a===k.None?o.createElement(T.C,{text:r("autoPayIHCFlow.loadingPaymentMethods"),onClose:t}):o.createElement(o.Fragment,null,a===k.Configure&&o.createElement(E,{options:s,onAddPaymentMethod:()=>l(k.AddPaymentMethod),onSuccess:()=>{i.fetchPaymentMethods(),l(k.ConfigureSuccess)},onDisable:()=>l(k.Disable),onClose:t}),a===k.ConfigureSuccess&&o.createElement(S,{options:s,onClose:n}),a===k.Disable&&o.createElement(x,{onKeepAutoPayEnabled:()=>l(k.Configure),onSuccess:()=>{i.fetchPaymentMethods(),l(k.DisableSuccess)},onClose:t}),a===k.DisableSuccess&&o.createElement(D,{onClose:n}),a===k.AddPaymentMethod&&o.createElement(C.Zb,{title:s.hasPaymentMethods?void 0:r("autoPayIHCFlow.addNewMethod.title"),description:s.hasPaymentMethods?void 0:r("autoPayIHCFlow.addNewMethod.subtitle"),onAdded:e=>{s.paymentMethodId=e.id,l(k.Configure)},onBack:()=>l(k.Configure),onClose:t}))}))},49755:(e,t,n)=>{"use strict";n.d(t,{U:()=>r,r:()=>i});var o=n(50016);let r=function(e){return e.HIDE_WARNING="HIDE_WARNING",e.SHOW_IHC_SETUP_FLOW="SHOW_IHC_SETUP_FLOW",e.HIDE_IHC_SETUP_FLOW="HIDE_IHC_SETUP_FLOW",e.AUTO_PAY_IHC_SETUP_SUCCESS="AUTO_PAY_IHC_SETUP_SUCCESS",e}({});const a=(e,t)=>{switch(t.type){case r.HIDE_WARNING:return{...e,showAutoPayWarning:!1};case r.SHOW_IHC_SETUP_FLOW:return{...e,showAutoPayFlow:!0};case r.HIDE_IHC_SETUP_FLOW:return{...e,showAutoPayFlow:!1};case r.AUTO_PAY_IHC_SETUP_SUCCESS:return{...e,showAutoPayFlow:!1,refreshKey:e.refreshKey+1};default:return e}},l={showAutoPayWarning:!0,showAutoPayFlow:!1,refreshKey:0},i=()=>(0,o.useReducer)(a,l)},3180:(e,t,n)=>{"use strict";n.d(t,{w:()=>a});var o=n(58876),r=n(35119);const a=(e,t)=>{if(!e||e.paymentMethodType===o.mf.Bank||!t)return"";const n=(0,r.P)(e.cardMetadata,t),a=(null===n||void 0===n?void 0:n.percentage)||0;return a?a.toString():""}},30272:(e,t,n)=>{"use strict";n.d(t,{t:()=>D,y:()=>T});var o=n(50016),r=n(97976),a=n(4419),l=n(6903),i=n(63680);const s=n.p+"static/media/MoreWallet.95fc12ae44b5216e0b8d400f2e1ff17a.svg";var c=n(20282),d=n(25891),u=n(29731),m=n(78573),p=n(44302),g=n(70764),h=n(73984);const v=o.memo((0,i.PA)((function(){const{t:e}=(0,u.Bd)("global"),t=(0,o.useRef)(null),{screensStore:n}=(0,r.P)(),{isBanksEmpty:a,onlineConnectedBanks:l,manuallyAddedBanks:i}=n.paymentMethodsStore;return o.createElement(d.BM,{style:{backgroundColor:"white"}},a?o.createElement(y,null):o.createElement(o.Fragment,null,o.createElement(g.B,{gap:16,mt:16},l.map((t=>o.createElement(p.v,{key:t.id,paymentMethod:t,badge:o.createElement(p.T,{bg:"blue.6"},e("Wallet.online-connected")),rightIcon:null,mx:8})))),!!i.length&&o.createElement(o.Fragment,null,o.createElement(h.h,{order:6,mt:16,mb:8,ta:"center"},e("Wallet.manually-added-bank")),o.createElement(g.B,{gap:16},i.map((e=>o.createElement(p.v,{key:e.id,paymentMethod:e,rightIcon:null,mx:8}))))),o.createElement(m.R,{ref:t})),o.createElement(c.hK,{height:50}))}))),y=()=>{const{t:e}=(0,u.Bd)("global");return o.createElement(l.i,{image:o.createElement(a.A,{style:{width:202,height:152,marginLeft:"auto",marginRight:"auto"},source:s}),heading:e("Wallet.no_bank_conected"),subHeading:e("Wallet.tap_the_plus")})};var b=n(32572),f=n(5438);const E=n.p+"static/media/MoreCards.6153e077e3ef68e60d4ed7c60584088f.svg";var C=n(64870),A=n(74655),S=n(73819);const w=(0,f.PA)((function(){const{t:e}=(0,u.Bd)("global"),[t,n]=(0,o.useState)(null),[a,l]=(0,o.useState)(null),{screensStore:i}=(0,r.P)(),{cards:s,cardsEmpty:d}=i.paymentMethodsStore;return o.createElement(o.Fragment,null,o.createElement(b.A,{style:{backgroundColor:"white"}},d?o.createElement(P,null):o.createElement(g.B,{gap:16,mt:16},s.map((e=>{const t=e.id===a;return o.createElement(p.v,{key:e.id,mx:8,disabled:t,paymentMethod:e,rightIcon:t?o.createElement(A.a,{size:"sm"}):o.createElement(C.A,{onClick:t=>{t.stopPropagation(),n(e)},color:"var(--mantine-color-red-6)",style:{cursor:"pointer"}})})}))),o.createElement(c.hK,{height:50})),t&&o.createElement(S.Rw,{title:e("Wallet.please_confirm_to_delete"),okLabel:e("Wallet.yes_delete"),cancelLabel:e("Wallet.go_back"),onConfirm:async()=>{const e=t.id;l(e),await i.paymentMethodsStore.setPaymentMethod({...t,action:"delete"}),l(null)},onClose:()=>n(null)}))})),P=()=>{const{t:e}=(0,u.Bd)("global");return o.createElement(l.i,{image:o.createElement(a.A,{style:{width:202,height:152,marginLeft:"auto",marginRight:"auto"},source:E}),heading:e("Wallet.no_card_linked_yet"),subHeading:e("Wallet.tap_to_link_your_card")})};var I=n(50767),x=n(17695);let D=function(e){return e.BANKS="Banks",e.CARDS="Cards",e}({});const T=e=>{let{setTab:t,initialTab:n=D.BANKS}=e;const{t:a}=(0,u.Bd)("global"),l=(0,r.P)(),[i,s]=(0,o.useState)(n),d=l.remoteConfig.acceptCards;(0,o.useEffect)((()=>{l.screensStore.paymentMethodsStore.fetchPaymentMethods()}),[l]);return d?o.createElement(o.Fragment,null,o.createElement(I.a,{mb:16,w:"100%"},o.createElement(x.I,{w:"100%",size:"lg",value:i,data:[{label:a("Wallet.bank"),value:D.BANKS},{label:a("Wallet.cards"),value:D.CARDS}],onChange:e=>{return s(n=e),void t(n);var n}})),i===D.BANKS?o.createElement(v,null):o.createElement(w,null)):o.createElement(o.Fragment,null,o.createElement(c.hK,{height:16}),o.createElement(v,null))}},90120:(e,t,n)=>{"use strict";n.d(t,{A:()=>G});var o=n(50016),r=n(67337),a=n(67869),l=n(78267),i=n(38117),s=n(7371),c=n(97076),d=n(219),u=n(17171),m=n(30272),p=n(18739),g=n(83613),h=n(87053),v=n(86277),y=function(e){return e[e.None=0]="None",e[e.AddCard=1]="AddCard",e[e.AddBank=2]="AddBank",e}(y||{});const b=e=>{let{closePrevious:t,tab:n}=e;const[r,a]=(0,o.useState)(y.None);return n!==m.t.CARDS||g.A.remoteConfig.acceptCards?o.createElement(o.Fragment,null,o.createElement(p.A,{style:{position:"absolute",right:10,bottom:74,backgroundColor:"#00A0F3"},icon:"plus",onPress:()=>{n===m.t.BANKS?(t&&t(n),a(y.AddBank)):a(y.AddCard)}}),r===y.AddBank&&o.createElement(v.j,{onClose:()=>a(y.None),onFinish:()=>a(y.None),onSuccess:()=>{a(y.None),t&&t(n)}}),r===y.AddCard&&o.createElement(h.v,{onClose:()=>a(y.None),onSuccess:()=>{a(y.None),t&&t(n)}})):null};var f=n(82345),E=n(82047),C=n(30404),A=n(29731);const S=()=>{const e=(0,f.useNavigation)(),{t:t}=(0,A.Bd)("global");return o.createElement(s.A,{style:{height:C.u,flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:"#FFFFFF",paddingHorizontal:20,borderBottomColor:"#F5F7F8",borderBottomWidth:1,width:430}},o.createElement(E.A,{icon:o.createElement(c.tTe,{height:"16",width:"16"}),onPress:()=>(e=>{e.canGoBack()?e.goBack():e.dispatch({...f.CommonActions.reset({index:0,routes:[{name:"More"}]})})})(e)}),o.createElement(i.A,{style:{fontWeight:"500",fontSize:16}},t("Wallet.header")),o.createElement(s.A,{style:{width:40}}))};var w,P=n(60034),I=n(43723),x=n(32572),D=n(71003),T=n(5438),k=n(14329);const B=(0,T.PA)((()=>{const{t:e}=(0,A.Bd)("global");return o.createElement(s.A,{style:R.breadcrumbsContainer},o.createElement(k.BtText,{style:R.breadcrumbText},e("Menu.Accounts")))})),F=(0,T.PA)((()=>{const{t:e}=(0,A.Bd)("global");return o.createElement(s.A,{style:R.topBarView},o.createElement(s.A,{style:R.topBar},o.createElement(B,null),o.createElement(k.BtText,{style:R.topBarTitle},e("Wallet.header"))))})),_=(0,T.PA)((e=>{let{children:t}=e,n=null;const r=(0,o.useCallback)((()=>{n&&n.scrollTo({x:0,y:0,animated:!0})}),[n]);return(0,o.useEffect)((()=>{r()}),[!0,r]),o.createElement(D.A,{style:R.rootView},o.createElement(F,null),o.createElement(x.A,{style:[{flex:1}],contentContainerStyle:{flexGrow:1},ref:e=>{n=e}},o.createElement(s.A,{style:{flex:1}},o.createElement(N,null,t))))})),N=I.default.div(w||(w=(0,P.A)(["\n  margin: 24px 36px 31px 36px;\n  font-family: 'Inter', sans-serif;\n  flex: 1;\n  display: flex;\n  flex-direction: column;\n"]))),R=l.A.create({topBarView:{height:77,width:"100%",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",borderBottomWidth:1,borderBottomColor:"#E6EBEE",paddingHorizontal:36},rootView:{backgroundColor:"white",flex:1,width:"100%"},topBar:{display:"flex",flexDirection:"column",justifyContent:"space-around",alignItems:"flex-start",height:52},topBarTitle:{fontSize:16,fontWeight:"700",lineHeight:22.4,color:"#19262F",fontFamily:"Inter"},breadcrumbsContainer:{flexDirection:"row"},breadcrumbText:{fontFamily:"Inter",fontWeight:"400",fontSize:12,lineHeight:18,color:"#758590"}});var L=n(68215),M=n(38804),O=n(66187),z=n(91663),j=n(97976);const W=()=>{const e=(0,f.useRoute)(),t=e.params,n=null===t||void 0===t?void 0:t.tab,[r,a]=(0,o.useState)(null!==n&&void 0!==n?n:m.t.BANKS),[l,p]=(0,o.useState)(!1),[g,h]=(0,o.useState)(0),{md:v}=(0,u.Qs)(),{t:y}=(0,A.Bd)("global"),E=(0,f.useNavigation)(),{screensStore:C}=(0,j.P)(),{paymentMethodsStore:w}=C;(0,o.useEffect)((()=>{const t=e.params;"true"===(null===t||void 0===t?void 0:t.showAutoPayFlow)&&(p(!0),E.setParams({showAutoPayFlow:void 0}))}),[e.params,E,w]);const P=(0,o.useMemo)((()=>r===m.t.BANKS?y("Wallet.bank-delete-footer"):""),[r,y]);return v?o.createElement(_,null,o.createElement(M.A,{key:g,onActionPress:()=>{p(!0)},origin:z.Fr.Account,marginBottom:20,isAutoPayIhcFlowOpened:l}),o.createElement(s.A,{style:V.desktopContainer},o.createElement(m.y,{setTab:a,initialTab:n}),o.createElement(s.A,{style:V.desktopFooter},P&&o.createElement(o.Fragment,null,o.createElement(c.iQw,null),o.createElement(i.A,{style:V.footerText},P)),o.createElement(b,{tab:r}))),l&&o.createElement(O.i,{onClose:()=>{p(!1)},onSuccess:()=>{p(!1),h((e=>e+1))}})):o.createElement(o.Fragment,null,o.createElement(d.A,{contentContainerStyle:{paddingHorizontal:0},toolbar:o.createElement(S,null)},o.createElement(M.A,{key:g,onActionPress:()=>{p(!0)},origin:z.Fr.Account,marginBottom:5,marginTop:20,isAutoPayIhcFlowOpened:l}),o.createElement(m.y,{setTab:a,initialTab:n})),o.createElement(s.A,{style:V.mobileFooter},P&&o.createElement(o.Fragment,null,o.createElement(c.iQw,null),o.createElement(i.A,{style:V.footerText},P)),o.createElement(b,{tab:r})),o.createElement(s.A,{style:V.mobileFooter},o.createElement(c.iQw,null),o.createElement(i.A,{style:V.footerText},P),o.createElement(b,{tab:r})),l&&o.createElement(O.i,{onClose:()=>{p(!1)},onSuccess:()=>{p(!1),h((e=>e+1))}}))}
1,V=l.A.create({desktopContainer:{flex:1,justifyContent:"space-between",width:420},desktopFooter:{flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:"auto",backgroundColor:"white"},mobileFooter:{flexDirection:"row",alignItems:"center",justifyContent:"center",position:"absolute",bottom:0,left:0,right:0,backgroundColor:"white",height:60,paddingHorizontal:16},footerText:{fontWeight:"500",fontSize:12,lineHeight:20,color:L.commonColors.textLight,marginLeft:8}});var H=n(16148);const U=(0,r.A)(),G=()=>o.createElement(U.Navigator,{headerMode:H.Hu,initialRouteName:a.f0.Console.More.ListMethods,mode:"modal",screenOptions:H.pc},o.createElement(U.Screen,{name:a.f0.Console.More.ListMethods,component:W}))},30404:(e,t,n)=>{"use strict";n.d(t,{u:()=>T,A:()=>F});var o=n(50016),r=n(67337),a=n(219),l=n(4419),i=n(38117),s=n(7371),c=n(95390),d=n(97976),u=n(17171),m=n(25891),p=n(16148);const g=n.p+"static/media/Wallet.e0fe6a534168b74a934f1db9f00fefa8.svg";const h=n.p+"static/media/Account.cdc78ab73eb8cb992e01c0713e5562c2.svg";const v=n.p+"static/media/TermsConditions.15c72a3114f47e9d78cc16e514cf227d.svg";var y=n(68215),b=n(67869),f=n(29731),E=n(58876),C=n(79074);const A=[{name:"Wallet",icon:g},{name:"Account",icon:h},{name:"Terms & Conditions",icon:v,action:()=>{p.HZ&&window.open(E.DS.TC,"_blank")}}],S=()=>{const{t:e}=(0,f.Bd)("global");return o.createElement(s.A,{style:{padding:20,justifyContent:"center",alignItems:"center"}},o.createElement(i.A,{style:{fontWeight:"600",fontSize:18}},e("More.more")))},w=e=>{let{navigation:t,page:n}=e;return o.createElement(m.dY,{onPress:()=>n.action?n.action():t.push(n.path||b.f0.Console.More[n.name]),style:{width:98,height:98,border:n.name&&"1px solid #E6EBEE",borderRadius:12,alignItems:"center",marginTop:15}},o.createElement(s.A,null,o.createElement(l.A,{style:{width:32,height:32,marginTop:18,marginBottom:6},source:n.icon})),o.createElement(i.A,{style:{fontSize:12,textAlign:"center",paddingTop:5,fontWeight:"500",lineHeight:15,color:y.commonColors.textDark}},n.name))},P=e=>{let{navigation:t}=e;const{t:n}=(0,f.Bd)("global"),{screenHeight:r}=(0,u.Qs)(),l=(0,d.P)(),[i,m]=(0,o.useState)(!1);return o.createElement(a.A,{toolbar:o.createElement(S,null)},o.createElement(s.A,{style:{flexDirection:"row",justifyContent:"space-evenly",marginTop:35,width:"100%",flexWrap:"wrap"}},A.map(((e,n)=>o.createElement(w,{key:e.name,navigation:t,page:e})))),o.createElement(s.A,{style:{marginTop:r-500}},o.createElement(c.N,{title:n("More.log_out"),color:"#DA515E",textStyle:{fontSize:15},onPress:()=>m(!0)})),o.createElement(C.R,{visible:i,onConfirm:()=>l.logOut(),onClose:()=>m(!1)}))};var I=n(13435),x=n(90120),D=n(82345);const T=58,{Navigator:k,Screen:B}=(0,r.A)(),F=e=>{let{navigation:t,route:n}=e;return o.useLayoutEffect((()=>{var e;const o=null!==(e=(0,D.getFocusedRouteNameFromRoute)(n))&&void 0!==e?e:"",r=![b.f0.Console.More.Wallet].includes(o);t.setOptions({tabBarVisible:r})}),[t,n]),o.createElement(k,{headerMode:p.Hu,screenOptions:p.pc,initialRouteName:b.f0.Console.More.MoreHome},o.createElement(B,{name:b.f0.Console.More.MoreHome,component:P}),o.createElement(B,{name:b.f0.Console.More.Account,component:I.g}),o.createElement(B,{name:b.f0.Console.More.Wallet,component:x.A}))}},77593:(e,t,n)=>{"use strict";n.d(t,{Q:()=>Dn});var o=n(50016),r=n(77356),a=n(2745),l=n(82997),i=n(58876),s=n(7007),c=n(39001);class d{constructor(){this._invoice=null,this._loan=null,this._loading=!1,this._transactions=[],this._loanReceivables=[],this._paymentScheduleLoading=!1,(0,a.makeAutoObservable)(this,{},{autoBind:!0})}get invoice(){return this._invoice}get loan(){return this._loan}get loading(){return this._loading}get transactions(){return this._transactions}get loanReceivables(){return this._loanReceivables}get paymentScheduleLoading(){return this._paymentScheduleLoading}get isFactoring(){var e,t;return(null===(e=this._invoice)||void 0===e||null===(t=e.paymentDetails)||void 0===t?void 0:t.paymentType)===l.mn.FACTORING}get isIhcCustomer(){var e,t;return(null===(e=this._invoice)||void 0===e||null===(t=e.customer)||void 0===t?void 0:t.type)===s.i.IHC}get canPayRegularInvoice(){var e,t;return!this.isFactoring&&this.isIhcCustomer&&i.Sn.includes(null===(e=this._invoice)||void 0===e?void 0:e.status)&&!(null===(t=this._invoice)||void 0===t||!t.totalRemainingAmou
1nt)}get isFactoringApproved(){var e,t;return this.isFactoring&&(null===(e=this._invoice)||void 0===e||null===(t=e.paymentDetails)||void 0===t?void 0:t.arAdvanceStatus)===i.MU.Approved}get isReviewRequired(){var e;const t=null===(e=this._invoice)||void 0===e?void 0:e.paymentDetails;if(!t)return!1;const n=t.arAdvanceStatus===i.MU.AwaitingCustomerReview,o=!!t.loanPlanId;return this.isFactoring&&n&&!o&&(t.isCustomerReviewRequired||t.isDownPaymentRequired)}get isTermsRequested(){var e;return(null===(e=this._invoice)||void 0===e?void 0:e.status)===i.uR.termsRequested}get isIhcDownPaymentMethodSelected(){var e;const t=null===(e=this._invoice)||void 0===e?void 0:e.paymentDetails;return(null===t||void 0===t?void 0:t.isDownPaymentRequired)&&(null===t||void 0===t?void 0:t.loanPlanId)&&(null===t||void 0===t?void 0:t.arAdvanceStatus)===i.MU.InReview}get isAwaitingCustomerReviewApproval(){return this.isTermsRequested||this.isIhcDownPaymentMethodSelected}get isPaid(){var e;const t=null===(e=this._invoice)||void 0===e?void 0:e.status;return t&&c.iA.includes(t)}get isPendingDisbursement(){var e;const t=null===(e=this._invoice)||void 0===e?void 0:e.status;return t&&c.BT.includes(t)}get isRefi(){var e;return null===(e=this._loan)||void 0===e?void 0:e.isRefi}get allowAchPayment(){var e,t,n,o,r,a;return!1!==(null===(e=this._invoice)||void 0===e||null===(t=e.company)||void 0===t||null===(n=t.settings)||void 0===n?void 0:n.acceptAchPayment)&&!1!==(null===(o=this._invoice)||void 0===o||null===(r=o.customer)||void 0===r||null===(a=r.settings)||void 0===a?void 0:a.acceptAchPayment)}get allowCardPayment(){var e,t,n,o;const r=null===(e=this._invoice)||void 0===e||null===(t=e.company)||void 0===t?void 0:t.settings;return!!this.isFactoringApproved||!(null===r||void 0===r||!r.cardPricingPackageId)&&"optOut"!==(null===r||void 0===r?void 0:r.cardPricingPackageId)&&!(null===r||void 0===r||null===(n=r.rainforest)||void 0===n||null===(o=n.merchantId)||void 0===o||!o.trim())}async getInvoice(e,t,n){this._loading=!0,this._transactions=[],this._loanReceivables=[],this._invoice=null;try{const o=await l.JZ.rN.showReceipt(e,t,n);(0,a.runInAction)((()=>{this._invoice=o.invoice,this._loan=o.loan,this._transactions=o.transactions||[]}))}catch(o){console.log(o.message)}finally{(0,a.runInAction)((()=>this._loading=!1))}}async reloadInvoice(){var e,t;const n=null===(e=this._invoice)||void 0===e?void 0:e._id;return n?Promise.all([this.getInvoice(n,null===(t=this._loan)||void 0===t?void 0:t.id),this.isFactoringApproved?this.getPaymentSchedule(n):Promise.resolve()]):Promise.resolve()}async getPaymentSchedule(e){this._paymentScheduleLoading=!0;try{const t=await l.JZ.rN.paymentSchedule(e);(0,a.runInAction)((()=>{"ok"===t.result&&(this._loanReceivables=t.loanReceivables||[])}))}catch(t){console.log("Error fetching payment schedule:",t.message),(0,a.runInAction)((()=>{this._loanReceivables=[]}))}finally{(0,a.runInAction)((()=>{this._paymentScheduleLoading=!1}))}}}const u=(0,o.createContext)(null),m=()=>{const e=(0,o.useContext)(u);if(!e)throw new Error("usePayableView must be used within a ReceiptProvider");return e},p=e=>{let{children:t}=e;const[n]=(0,o.useState)((()=>new d));return o.createElement(u.Provider,{value:n},t)};var g=n(63680),h=n(78267),v=n(5438),y=n(29731),b=n(1923),f=n(38117),E=n(7371),C=n(38767),A=n(9855),S=n.n(A),w=n(74161),P=n.n(w),I=n(67956),x=n(4557),D=n(82345),T=n(67869),k=n(73819),B=n(16724);const F=(0,g.PA)((e=>{let{onView:t,onClose:n}=e;const{t:r}=(0,y.Bd)("global"),a=(0,D.useNavigation)(),{loan:l}=m(),i=(null===l||void 0===l?void 0:l.payables)||[];return o.createElement(k.Vm,{title:r("TabInvoice.OtherInvoiceInfo.ViewInvoicesModal.title"),onClose:n},o.createElement(k.Vm.Content,null,o.createElement(k.YX,{items:i.map(((e,l)=>({label:r("TabInvoice.OtherInvoiceInfo.ViewInvoicesModal.invoiceLabel",{number:e.number}),value:e.document?o.createElement(k.t5,{onClick:()=>{return o=e.id,null===t||void 0===t||t(),a.navigate(T.f0.Console.Payables.AttachmentPreview,{id:o}),void n();var o},leftSection:o.createElement(B.A,{size:20}),"data-testid":"ViewInvoicesModal.ViewAttachment.".concat(l)},r("TabInvoice.OtherInvoiceInfo.ViewInvoicesModal.viewAttachment")):null})))})),o.createElement(k.Vm.Buttons,null,o.createElement(x.$,{onClick:n,"data-testid":"ViewInvoicesModal.CloseButton"},r("TabInvoice.OtherInvoiceInfo.ViewInvoicesModal.close"))))}));var _=n(97076),N=n(10272),R=n(32553),L=n(4670);const M=e=>{let{label:t,theme:n="blue",rightIcon:r,disabled:a,style:l,linkStyle:i,onClick:s}=e;const c="blue"===n?O.blueLink:O.grayLink;return o.createElement(E.A,null,o.createElement(L.A,{onPress:s,style:[O.wrapper,l],disabled:a},o.createElement(R.QG,{style:[O.link,c,i]},t),r))}
1,O=h.A.create({wrapper:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:5},link:{display:"flex",fontWeight:"700"},blueLink:{color:N.B.blue.blue400},grayLink:{color:N.B.text.grey500}});var z=n(14329);const j=e=>{let{invoice:t,navigation:n}=e;const{t:r}=(0,y.Bd)("global");return o.createElement(L.A,{style:W.container,onPress:()=>{n.navigate(T.f0.Console.Payables.AttachmentPreview,{id:t._id})}},o.createElement(E.A,{style:W.attachmentIconContainer},o.createElement(_.bpr,{height:16,width:16})),o.createElement(z.BtText,{style:W.text},t.type===l.tD.QUOTE?r("InvoiceDetails.view-quote-attachment"):r("InvoiceDetails.view-invoice-attachment")),o.createElement(_.XRT,{width:16,height:16}))},W=h.A.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:120},attachmentIconContainer:{marginBottom:1},text:{fontSize:12,lineHeight:24,color:"#00A0F3",fontFamily:"Inter",fontWeight:"700",letterSpacing:0,marginRight:4}});var V=n(90336);const H=e=>{var t,n;let{isMobile:r,navigation:a}=e;const{t:i}=(0,y.Bd)("global"),{invoice:s,loan:c}=m(),[d,u]=(0,o.useState)(!1),p=r?"100%":360,g=P()(s.invoice_due_date).format("MM/DD/YYYY"),h=s.type===l.tD.INVOICE?i("Receivables.due-on",{date:g}):"",v=null!==(t=null===c||void 0===c?void 0:c.amount)&&void 0!==t?t:s.total_amount,f=(null===c||void 0===c||null===(n=c.payables)||void 0===n?void 0:n.length)>1;return o.createElement(E.A,{style:{width:p,paddingHorizontal:5}},o.createElement(E.A,{style:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}},o.createElement(R.QG,{style:(0,C.composeStyle)(G.normalText,{maxWidth:"50%"})},f?i("TabInvoice.OtherInvoiceInfo.multipleInvoices"):"".concat(S()(null===s||void 0===s?void 0:s.type).replace("_"," ")," #").concat(s.invoice_number)),o.createElement(R.QG,{style:G.valueText},h)),f?o.createElement(M,{label:i("TabInvoice.OtherInvoiceInfo.viewInvoicesLink"),onClick:()=>u(!0),rightIcon:o.createElement(_.XRT,{width:16,height:16}),style:G.viewInvoicesLink}):s.invoice_document&&o.createElement(E.A,{style:G.viewInvoiceContainer},o.createElement(j,{invoice:s,navigation:a})),o.createElement(b.A,{style:G.divider}),o.createElement(U,{amount:v,label:i("TabInvoice.InvoiceAmount")}),o.createElement(b.A,{style:G.divider}),o.createElement(V.O,{address:s.address,addressType:s.addressType,attention:s.attention,invoice_document:s.invoice_document}),d&&o.createElement(F,{onClose:()=>u(!1)}))},U=e=>{let{amount:t,label:n,valueStyle:r={}}=e;return o.createElement(E.A,{style:G.amountTypeContainer},o.createElement(f.A,{style:(0,C.composeStyle)(G.normalText,{maxWidth:"50%"})},n),o.createElement(f.A,{style:[G.valueText,r]},(0,I.Wl)(t)))},G=h.A.create({normalText:{fontWeight:"500",color:N.B.text.grey500},valueText:{fontWeight:"500",maxWidth:"50%",textAlign:"right"},statusValue:{maxWidth:"50%"},amountTypeContainer:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",height:26},divider:{marginTop:14,marginBottom:14},labelStyle:{color:N.B.text.grey400,marginTop:7},viewInvoicesLink:{marginTop:10},viewInvoiceContainer:{marginTop:10,flexDirection:"row",justifyContent:"flex-start",alignItems:"flex-start"}});var Y=n(53941),Q=n(31604),q=n.n(Q),K=n(79732);const J=(0,v.PA)((e=>{var t,n,r,a,l;let{invoiceOverrides:i,navigation:s}=e;const{t:c}=(0,y.Bd)("global"),d=(0,Y.A)(),{invoice:u,loan:p}=m(),g=!(null===u||void 0===u||!u.supplierInvitationDetails)?{phone:null===u||void 0===u||null===(t=u.supplierInvitationDetails)||void 0===t?void 0:t.phone,name:null===(n=u.supplierInvitationDetails)||void 0===n?void 0:n.name}:{phone:null===u||void 0===u||null===(r=u.company)||void 0===r?void 0:r.phone,name:null===(a=u.company)||void 0===a?void 0:a.name},h=q()(null===i||void 0===i?void 0:i.remainingAmount)?null===i||void 0===i?void 0:i.remainingAmount:null!==(l=null===p||void 0===p?void 0:p.remainingAmount)&&void 0!==l?l:u.totalRemainingAmount;return o.createElement(o.Fragment,null,o.createElement(K.A,{company:g,totalAmount:h,style:[Z.companyHeader,{width:d?"100%":360}],amountLabel:c("PaymentHistoryInvoice.totalAmountDue"),status:(null===i||void 0===i?void 0:i.status)||u.status,showInvoiceStatus:!0,amountLabelStyles:{color:N.B.text.grey500,marginTop:4}}),o.createElement(b.A,{style:{marginBottom:14,width:d?"100%":360}}),o.createElement(H,{isMobile:d,navigation:s}))})),Z=h.A.create({text:{fontSize:18,fontWeight:"600",color:"#335C75"},companyHeader:{backgroundColor:"#FFFFFF",paddingHorizontal:5,paddingTop:20,flexDirection:"row",marginBottom:14}});var X=n(49727),$=n(68215);const ee=(0,o.memo)((e=>{let{shouldHideLine:t,status:n}=e,r=te.processing,a={};return n===i.cm.SUCCESS?a=te.completedVertical:[i.cm.ERROR,i.cm.CANCELED].includes(n)&&(r=te.failed),o.createElement(E.A,{style:{alignItems:"center"}},o.createElement(E.A,{style:(0,C.composeStyle)(te.circleStyles,r)}),!t&&o.createElement(E.A,{style:(0,C.composeStyle)(te.verticalLineStyles,a)}))})),te=h.A.create({circleStyles:{width:10,height:10,borderRadius:5,borderWidth:2,backgroundColor:$.commonColors.backgroundLight,borderColor:$.commonColors.borderLight},verticalLineStyles:{flex:1,borderLeftWidth:2,borderLeftColor:"#CCD6DD",borderLeftStyle:"dashed"},completedCircle:{backgroundColor:$.commonColors.accentText,borderColor:$.commonColors.accentText},completedVertical:{borderLeftColor:$.commonColors.accentText,borderLeftStyle:"solid"},failed:{borderColor:"#DB081C"},processing:{borderColor:$.commonColors.accentText}});
1var ne,oe,re,ae=n(55502),le=n(60034),ie=n(80232),se=n(43723);const ce=e=>{let{status:t}=e;return o.createElement(ie.V,{status:t,statusOptionsProvider:de})};function de(e){var t;const n=(null===(t=i.eg[e])||void 0===t?void 0:t.label)||e;switch(e){case i.cm.SUCCESS:return{label:n,icon:o.createElement(_.nJm,null),style:(0,se.css)(ne||(ne=(0,le.A)(["\n          color: #0ec06b;\n          font-weight: 600;\n          font-size: 12px;\n          line-height: 20px;\n        "]))),gap:4};case i.cm.PENDING:case i.cm.PROCESSING:case i.cm.PLACED:case i.cm.SCHEDULED:return{label:n,icon:o.createElement(_.WSm,null),style:(0,se.css)(oe||(oe=(0,le.A)(["\n          color: #ff7926;\n          font-weight: 600;\n          font-size: 12px;\n          line-height: 20px;\n        "]))),gap:4};case i.cm.ERROR:case i.cm.CANCELED:return{label:n,icon:o.createElement(_.n7P,null),style:(0,se.css)(re||(re=(0,le.A)(["\n          color: #ec002a;\n          font-weight: 600;\n          font-size: 12px;\n          line-height: 20px;\n        "]))),gap:4};default:return{label:e}}}let ue=function(e){return e[e.Payment=0]="Payment",e[e.Refinance=1]="Refinance",e}({});const me="#19262F",pe=e=>{let{isFullPayment:t,transaction:n}=e;const{t:r}=(0,y.Bd)("global"),a=n.type===ue.Refinance?r("PaymentHistoryInvoice.refinanced"):r(t?"PaymentHistoryInvoice.payment":"PaymentHistoryInvoice.partialPayment");return o.createElement(X.A,{style:be.labelStyle},a)},ge=e=>{let{transaction:t}=e;const{t:n}=(0,y.Bd)("global"),{manualPaymentData:r,payment_method:a}=t,l=(0,o.useMemo)((()=>t.subtype===i.YE.Merchant?n("PaymentHistoryInvoice.supplierPayment"):null!==r&&void 0!==r&&r.manual_payment_method||t.type===ue.Refinance?n("PaymentHistoryInvoice.externalPayment"):null!==r&&void 0!==r&&r.userId&&"ach"===a?n("PaymentHistoryInvoice.manualPaymentByBluetape"):n("PaymentHistoryInvoice.manualPayment")),[null===r||void 0===r?void 0:r.manual_payment_method,null===r||void 0===r?void 0:r.userId,a,n,t.subtype,t.type]);return o.createElement(X.A,{style:{fontWeight:"400",fontSize:14,color:me,lineHeight:20,fontFamily:"Inter"}},l)},he=e=>{let{date:t}=e;return o.createElement(X.A,{style:be.date},P()(t).format("MM/DD/YYYY")," ","  ")},ve=e=>{let{transaction:t}=e;const{status:n,amount:r=0,fee:a=0}=t,l=[i.cm.CANCELED,i.cm.ERROR].some((e=>e===n)),s=(0,o.useMemo)((()=>{let e=me;return l&&(e="#EC002A"),e}),[l]);return o.createElement(X.A,{style:(0,C.composeStyle)(be.amount,{color:s})},(0,I.Wl)(r+a))},ye=e=>{let{transaction:t,isLastTransaction:n,oneTransaction:r,isFullPayment:a}=e;const{date:l}=t,i=(0,Y.A)();return o.createElement(E.A,{style:[be.timelineItemContainer,{width:i?"100%":345}]},!r&&o.createElement(ee,{shouldHideLine:n,status:t.status}),o.createElement(ae.fv,{style:[be.itemColStyle,!n&&be.itemColSpacingStyle]},o.createElement(ae.fI,{style:be.itemRowStyle},o.createElement(pe,{transaction:t,isFullPayment:a}),o.createElement(ve,{transaction:t})),o.createElement(z.Spacer,{height:3}),o.createElement(ae.fI,{style:be.itemRowStyle},o.createElement(ge,{transaction:t}),o.createElement(he,{date:l})),o.createElement(z.Spacer,{height:12}),t.type!==ue.Refinance&&o.createElement(E.A,{style:be.statusContainer},o.createElement(ce,{status:t.status}))))},be=h.A.create({date:{fontWeight:"500",fontSize:14,lineHeight:20,marginBottom:2,marginRight:-10,color:"#19262F",textAlign:"right"},amount:{fontWeight:"700",fontSize:14,textAlign:"right",lineHeight:24,fontFamily:"Inter"},itemRowStyle:{flex:1,flexDirection:"row",justifyContent:"space-between",alignItems:"center"},itemColStyle:{flex:1,flexDirection:"column",justifyContent:"space-between",marginLeft:13,marginTop:-8},itemColSpacingStyle:{marginBottom:20},statusContainer:{alignSelf:"flex-start",alignItems:"flex-start",marginLeft:-14},labelStyle:{fontWeight:"700",fontSize:14,color:"#19262F",lineHeight:20,fontFamily:"Inter"},timelineItemContainer:{flexDirection:"row",width:350}}),fe=(0,v.PA)((()=>{var e,t,n;const{t:r}=(0,y.Bd)("global"),{loan:a,invoice:l,transactions:s}=m(),c=(0,o.useMemo)((()=>{var e,t;const n=[...s];var o;(null===a||void 0===a?void 0:a.status)===i.sG.REFINANCED&&null!==l&&void 0!==l&&null!==(e=l.refinance)&&void 0!==e&&e.isRefinanced&&null!==l&&void 0!==l&&null!==(t=l.refinance)&&void 0!==t&&t.date&&n.push({id:"refinanced",fee:0,manualPaymentData:null,amount:null===l||void 0===l||null===(o=l.refinance)||void 0===o?void 0:o.refinancedAmount,payment_method:"ach",date:l.refinance.date,type:ue.Refinance,status:i.cm.SUCCESS});const r=new Map,c=[];for(const a of n){const e=a.transactionNumber;if(e)if(r.has(e)){const t=r.get(e);t.amount+=a.amount||0,t.fee+=a.fee||0;const n=new Date(t.date).getTime();new Date(a.date).getTime()<n&&(t.date=a.date)}else r.set(e,{...a}
1);else c.push(a)}return c.push(...r.values()),c.sort(((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime()))}),[s,null===a||void 0===a?void 0:a.status,null===(e=l.refinance)||void 0===e?void 0:e.isRefinanced,null===(t=l.refinance)||void 0===t?void 0:t.refinancedAmount,null===(n=l.refinance)||void 0===n?void 0:n.date]);if(null===c||void 0===c||!c.length)return null;const d=1===(null===c||void 0===c?void 0:c.length)&&0===(null===a||void 0===a?void 0:a.remainingAmount);return o.createElement(o.Fragment,null,o.createElement(E.A,{style:{paddingLeft:5}},o.createElement(f.A,{style:Ee.title},r("PaymentHistoryInvoice.paymentHistory")),o.createElement(z.Spacer,{height:20}),o.createElement(E.A,{style:Ee.transactionsLayout},c.map(((e,t)=>o.createElement(ye,{key:t,oneTransaction:-1===c.length,transaction:e,isLastTransaction:c.length===t,isFullPayment:d}))))))})),Ee=h.A.create({title:{fontFamily:"Inter",fontWeight:"700",fontSize:16,lineHeight:28,color:"#19262F"},transactionsLayout:{marginBottom:30}});var Ce=n(61699),Ae=n(33469),Se=n(15525),we=n(21786),Pe=n.n(we);const Ie="InvoiceDetailsModal_label__3tSDh",xe="InvoiceDetailsModal_strong__3znlb",De=(0,v.PA)((e=>{var t,n;let{invoice:r,loan:a,transactions:l,onClose:i}=e;const{t:s}=(0,y.Bd)("global");if(!a)return null;const c=l.filter((e=>e.status===Se.cm.PROCESSING||e.status===Se.cm.SUCCESS)).reduce(((e,t)=>e+(t.fee||0)),0),d=(null===a||void 0===a||null===(t=a.payables)||void 0===t?void 0:t.length)>1,u={invoiceAmount:s(d?"payables.modals.invoiceDetails.totalInvoiceAmount":"payables.modals.invoiceDetails.invoiceAmount"),customerFee:d||a.extensionFee?s("payables.modals.invoiceDetails.totalCustomerFee"):s("payables.modals.invoiceDetails.customerFee"),lateFee:d||a.waivedLateFee?s("payables.modals.invoiceDetails.totalLateFee"):s("payables.modals.invoiceDetails.lateFee")},m=[{title:s("payables.modals.invoiceDetails.supplierDetails"),items:[{label:s("payables.modals.invoiceDetails.supplier"),value:Ae.h.getCompanyName(r.company)},{label:s("payables.modals.invoiceDetails.supplierPhoneNumber"),value:o.createElement(k.x1,{phone:null===r||void 0===r||null===(n=r.company)||void 0===n?void 0:n.phone,mode:"text"})}]},{title:s("payables.modals.invoiceDetails.invoiceDetails"),items:[{label:u.invoiceAmount,value:(0,Ce.zQ)(a.amount)},...null!==a&&void 0!==a&&a.extensionFee||null!==a&&void 0!==a&&a.waivedLateFee?[{label:o.createElement(k.a3,{label:s("payables.modals.invoiceDetails.financingAmount"),tooltip:s("payables.modals.invoiceDetails.financingAmountTooltip"),tooltipPosition:"top-end",fw:700}),value:(0,Ce.zQ)(a.amount+a.customerFee),valueClassName:xe},{label:u.customerFee,value:(0,Ce.zQ)(a.customerFee),children:a.extensionFee?[{label:s("payables.modals.invoiceDetails.customerFee"),value:(0,Ce.zQ)(a.loanFee)},{label:s("payables.modals.invoiceDetails.extensionFee"),value:(0,Ce.zQ)(a.extensionFee),valueClassName:xe,labelClassName:xe}]:[]},{label:u.lateFee,value:(0,Ce.zQ)(a.lateFee),valueClassName:xe,labelClassName:xe,children:a.waivedLateFee?[{label:s("payables.modals.invoiceDetails.lateFee"),value:(0,Ce.zQ)(a.lateFee)},{label:s("payables.modals.invoiceDetails.waivedLateFee"),value:"$(".concat(Pe()(a.waivedLateFee).format({thousandSeparated:!0,mantissa:2}),")")}]:[]}]:[{label:u.customerFee,value:(0,Ce.zQ)(a.customerFee)},{label:u.lateFee,value:(0,Ce.zQ)(a.lateFee)}],{label:s("payables.modals.invoiceDetails.totalAmount"),value:(0,Ce.zQ)(a.totalLoanAmount),valueClassName:xe,labelClassName:xe}]},{title:s("payables.modals.invoiceDetails.invoicePaymentDetails"),items:[{label:s("payables.modals.invoiceDetails.paidAmount"),value:(0,Ce.zQ)(a.paidAmount)},{label:s("payables.modals.invoiceDetails.cardProcessingFee"),value:(0,Ce.zQ)(c)},{label:s("payables.modals.invoiceDetails.processingAmount"),value:(0,Ce.zQ)(a.processingAmount)},{label:s("payables.modals.invoiceDetails.outstandingBalance"),value:(0,Ce.zQ)(a.remainingAmount),valueClassName:xe,labelClassName:xe}]}];return o.createElement(k.Vm,{title:s("payables.modals.invoiceDetails.title"),onClose:i},o.createElement(k.Vm.Content,null,o.createElement(k.A5,{groups:m,mb:8,propertyGridProps:{classNames:{label:Ie}}})))}));var Te=n(20282),ke=n(22759),Be=n(82047),Fe=n(88459);const _e=()=>{const{t:e}=(0,y.Bd)("global");return o.createElement(f.A,{style:Le.toolbarHeading},e("PaymentHistoryInvoice.details"))},Ne=e=>{let{navigation:t}=e;return o.createElement(ke.I,{icon:o.createElement(Be.A,{icon:o.createElement(_.tTe,{height:"20",width:"20"}),onPress:()=>{t.canGoBack()?t.goBack():t.replace(T.f0.Home._self,{screen:T.f0.
1Console.Payables._self,params:{screen:T.f0.Console.Payables.home}})}})})},Re=e=>{let{navigation:t,isMobile:n,styles:r}=e;const a=(0,Fe.X)();return o.createElement(ke.M,{centerComponent:o.createElement(_e,null),leftComponent:a?o.createElement(Ne,{navigation:t}):o.createElement(E.A,null),rightComponent:o.createElement(E.A,{style:{width:40}}),containerStyle:[{borderBottomWidth:1,borderBottomColor:"#E6EBEE",height:60},n?r.mobile:r.desktop]})},Le=h.A.create({toolbarHeading:{fontSize:16,fontWeight:"500",lineHeight:24,fontFamily:"Inter",color:"#001929"}}),Me=h.A.create({desktop:{width:375,paddingHorizontal:15},mobile:{width:"100%"},mobileFooterWrapper:{width:"100%",marginLeft:0,paddingHorizontal:20},footerButtonContainer:{height:80,paddingVertical:10,marginLeft:18,justifyContent:"center"},footerButton:{flex:1}});var Oe=n(219),ze=n(83613);const je=(0,g.PA)((e=>{let{footer:t,children:n,navigation:r}=e;const{isMobile:a}=ze.A,{invoice:l}=m();return o.createElement(Oe.A,{styleWidth:a?"100%":375,toolbar:o.createElement(Re,{navigation:r,invoice:l,isMobile:a,styles:Me}),footer:t,contentContainerStyle:a?Me.mobile:Me.desktop,containerStyle:a?{}:{marginBottom:10}},n)}));var We=function(e){return e[e.None=0]="None",e[e.InvoiceDetails=1]="InvoiceDetails",e}(We||{});const Ve=(0,g.PA)((e=>{let{navigation:t}=e;const{t:n}=(0,y.Bd)("global"),[r,a]=o.useState(We.None),{isMobile:l}=ze.A,{invoice:s,loan:c,transactions:d}=m();return o.createElement(je,{navigation:t},o.createElement(J,{invoiceOverrides:{remainingAmount:0,status:i.uR.refinanced},navigation:t}),o.createElement(M,{label:n("PaymentHistoryInvoice.viewMoreDetails"),onClick:()=>a(We.InvoiceDetails),style:{marginLeft:l?0:5}}),o.createElement(Te.hK,{height:20}),o.createElement(fe,null),r===We.InvoiceDetails&&o.createElement(De,{invoice:s,loan:c,transactions:d,onClose:()=>a(We.None)}))}));var He=n(42461),Ue=n(97976),Ge=n(88044),Ye=n(25207),Qe=n(91162);const qe=(0,v.PA)((e=>{var t,n,r;let{onClick:a}=e;const{userStore:l,screensStore:{paymentMethodsStore:{paymentMethods:i}}}=(0,Ue.P)(),s=(0,Y.A)();if(!((null===(t=l.suppliers)||void 0===t?void 0:t.some((e=>e.isFactoringEnabled)))||!1))return null;const c=null===(n=l.company)||void 0===n||null===(r=n.settings)||void 0===r?void 0:r.inHouseCredit,d=null===c||void 0===c?void 0:c.isAutoPayEnabledByCompanyUser,u=(null===c||void 0===c?void 0:c.isAutoPayRequired)||!1,m=i.find((e=>e.isPrimaryForIHCAutoPay));return o.createElement(E.A,{style:{width:s?"100%":350,marginLeft:s?0:5}},o.createElement(z.Spacer,{height:30}),d&&m?o.createElement(Ke,{onActionPress:a,primaryIHCAutoPayMethod:m}):o.createElement(Je,{onActionPress:a,isAutoPayRequired:u}),o.createElement(z.Spacer,{height:5}))})),Ke=(0,v.PA)((e=>{var t;let{onActionPress:n,primaryIHCAutoPayMethod:r}=e;const{t:a}=(0,y.Bd)("global"),l=!(null!==r&&void 0!==r&&null!==(t=r.autoPay)&&void 0!==t&&t.isAutoPayPaused),i=o.createElement(E.A,{style:Ze.titleContainer},o.createElement(f.A,{style:[Ze.texts,Ze.title]},a("PaymentHistoryInvoice.autoPayIHCAlert.on.title")+" "),l?o.createElement(f.A,{style:[Ze.texts,Ze.title,Ze.onText]},a("PaymentHistoryInvoice.autoPayIHCAlert.on.enabled")):o.createElement(f.A,{style:[Ze.texts,Ze.title,Ze.onHoldText]},a("PaymentHistoryInvoice.autoPayIHCAlert.on.onHold"))),s=o.createElement(E.A,null,o.createElement(f.A,{style:[Ze.texts,Ze.accountText]},Qe.A.getLongName(r)));return o.createElement(o.Fragment,null,o.createElement(Ge.A,{title:i,message:s,buttonText:a("PaymentHistoryInvoice.autoPayIHCAlert.on.button"),onActionPress:n,status:"info",testID:"ihc_invoice_autopay_enabled_banner",buttonStyle:Ze.button,buttonTextStyle:{color:N.B.blue.blue400},containerStyle:l?void 0:{backgroundColor:N.B.service.red000,borderColor:N.B.service.red100c,borderWidth:2}}))})),Je=(0,v.PA)((e=>{let{onActionPress:t,isAutoPayRequired:n}=e;const{t:r}=(0,y.Bd)("global"),a=o.createElement(E.A,null,o.createElement(f.A,{style:[Ze.texts,Ze.accountText]},r(n?"PaymentHistoryInvoice.autoPayIHCAlert.offRequired.message":"PaymentHistoryInvoice.autoPayIHCAlert.offNotRequired.message")),o.createElement(z.Spacer,{height:10}),o.createElement(Ye.A,{onPress:t,testID:"ihc_invoice_autopay_off_action_button",textStyle:Ze.buttonTextOff,buttonStyle:Ze.button,label:r(n?"PaymentHistoryInvoice.autoPayIHCAlert.offRequired.button":"PaymentHistoryInvoice.autoPayIHCAlert.offNotRequired.button")}));return o.createElement(Ge.A,{title:r(n?"PaymentHistoryInvoice.autoPayIHCAlert.offRequired.title":"PaymentHistoryInvoice.autoPayIHCAlert.offNotRequired.title"),message:a,status:"error",buttonText:"",icon:o.createElement(_.RYv,{width:20,height:22}),testID:"ihc_invoice_autopay_off_banner"})})),Ze=h.A.create({titleContainer:{flexDirection:"row",alignItems:"center",marginBottom:4},title:{fontSize:14,lineHeight:20,fontWeight:"700"},onText:{color:N.B.service.green},onHoldText:{color:N.B.service.red100c},accountText:{fontSize:14,lineHeight:20,fontWeight:"500"},texts:{fontFamily:"Inter",color:N.B.text.black,letterSpacing:-.3},button:{backgroundColor:"transparent",height:20,paddingHorizontal:0},buttonTextOff:{fontWeight:"700",fontSize:14,lineHeight:24,fontFamily:"Inter",color:N.B.service.red100c,textAlign:"left",alignSelf:"flex-start"}});var Xe=n(67920),$e=n(70918),et=n(77095);const tt=(0,v.PA)((e=>{let{loanReceivables:t,loading:n}=e;const{t:r}=(0,y.Bd)("global"),a=null!==t&&void 0!==t&&t.length?[...t].filter((e=>e.status!==$e.mu.CANCELED&&e.type!==$e.y9.PENALTY_INTEREST_FEE)).sort(((e,t)=>new Date(e.expectedDate).getTime()-new Date(t.expectedDate).getTime())):[];return n?o.createElement(E.A,{style:{paddingLeft:5}},o.createElement(f.A,{style:nt.title},r("PaymentHistoryInvoice.paymentScheduleSummary")),o.createElement(z.Spacer,{height:20}),o.createElement(E.A,{style:nt.loadingContainer},o.createElement(Xe.A,{size:"large",color:"#00A0F3"}))):o.createElement(o.Fragment,null,o.createElement(E.A,{style:{paddingLeft:5}},o.createElement(f.A,{style:nt.title},r("PaymentHistoryInvoice.paymentScheduleSummary")),o.createElement(z.Spacer,{height:20}),o.createElement(E.A,{style:nt.paymentsLayout},a.length>0?a.map(((e,t)=>o.createElement(et.lO,{key:t,installment:e,context:et.BA.IHC_INVOICE}))):o.createElement(E.A,{style:nt.emptyContainer},o.createElement(f.A,{style:nt.emptyText},r("PaymentHistoryInvoice.noPaymentSchedule"))))))}
1)),nt=h.A.create({title:{fontFamily:"Inter",fontWeight:"700",fontSize:16,lineHeight:28,color:"#19262F"},paymentsLayout:{marginBottom:30},loadingContainer:{alignItems:"center",justifyContent:"center",paddingVertical:40},emptyContainer:{alignItems:"center",justifyContent:"center",paddingVertical:40},emptyText:{fontFamily:"Inter",fontSize:14,color:"#668598",textAlign:"center"}});var ot=n(63146);const rt=e=>{let{active:t,onPress:n,tab:r}=e;return o.createElement(z.BtText,{onPress:()=>n(r.name),style:[lt.switchItem,t===r.name&&lt.switchItemActive]},r.options.title)},at=e=>{var t;let{tabs:n,initialTab:r}=e;const[a,l]=(0,o.useState)(r),i=(0,Y.A)(),s=e=>{l(e)},c=null===(t=n.find((e=>e.name===a)))||void 0===t?void 0:t.component;return o.createElement(E.A,{style:[lt.container,!i&&{marginLeft:5}]},o.createElement(E.A,{style:[lt.switchContainer,!i&&{marginRight:-7}]},n.map((e=>o.createElement(rt,{key:e.name,active:a,onPress:s,tab:e})))),o.createElement(E.A,{style:lt.contentContainer},c&&o.createElement(c)))},lt=h.A.create({container:{flex:1,width:"100%"},switchContainer:{height:45,flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:2,marginBottom:24,paddingHorizontal:4,paddingVertical:4,backgroundColor:"#EFF5F9",borderRadius:9},switchItem:{paddingVertical:8,fontSize:14,width:"49%",textAlign:"center",borderRadius:8,fontWeight:"500",color:"#335C75",fontFamily:"Inter",lineHeight:21},switchItemActive:{color:"#00A0F3",fontWeight:"600",backgroundColor:"#FFFFFF"},contentContainer:{flex:1}}),it="PaymentHistory",st="PaymentSchedule",ct=(0,g.PA)((()=>{const{t:e}=(0,y.Bd)("global"),{isMobile:t}=ze.A,{invoice:n,loanReceivables:r,isFactoringApproved:a,getPaymentSchedule:l,paymentScheduleLoading:i}=m(),s=(0,Fe.X)(),c=(e=>(0,o.useMemo)((()=>{const t=(null===e||void 0===e?void 0:e.filter((e=>e.type===$e.y9.PENALTY_INTEREST_FEE&&(e.status!==$e.mu.PAID&&(e.status!==$e.mu.CANCELED&&(e.expectedAmount-(e.paidAmount||0)-(e.processingAmount||0)>0&&[$e.mu.PENDING,$e.mu.LATE,$e.mu.PASTDUE,$e.mu.PROCESSING,$e.mu.FAILED].includes(e.status)))))))||[];if(0===t.length)return null;const n=t.reduce(((e,t)=>e+(t.expectedAmount-(t.paidAmount||0)-(t.processingAmount||0))),0);return{items:t,count:t.length,unpaidAmount:n}}),[e]))(r);return(0,o.useEffect)((()=>{a&&null!==n&&void 0!==n&&n._id&&s&&l(null===n||void 0===n?void 0:n._id)}),[a,null===n||void 0===n?void 0:n._id,l,s]),o.createElement(o.Fragment,null,!!c&&o.createElement(E.A,{style:{width:t?"100%":350,marginLeft:t?0:5,marginTop:8,marginBottom:-16}},o.createElement(ot.M,{isMobile:!0,amount:c.unpaidAmount})),o.createElement(z.Spacer,{height:20}),s&&!a&&o.createElement(fe,null),s&&a&&o.createElement(at,{initialTab:it,tabs:[{name:it,options:{title:e("PaymentHistoryInvoice.paymentHistory")},component:()=>o.createElement(fe,null)},{name:st,options:{title:e("PaymentHistoryInvoice.paymentsSchedule")},component:()=>o.createElement(tt,{loanReceivables:r,loading:i})}]}))})),dt=e=>{var t,n,r,a,l,i,s,c;let{invoice:d,loan:u,onClose:m}=e;const{t:p}=(0,y.Bd)("global"),[g,h]=(0,o.useState)(!1),v=null===u||void 0===u||null===(t=u.payables)||void 0===t?void 0:t.reduce(((e,t)=>e+t.amount),0),b={refinancedData:null!==(n=null===(r=u.metadata)||void 0===r||null===(a=r.refinance)||void 0===a?void 0:a.refinancedData)&&void 0!==n?n:{},refiData:null!==(l=null===(i=u.metadata)||void 0===i||null===(s=i.refinance)||void 0===s?void 0:s.refiData)&&void 0!==l?l:{}},f=[{title:p("PaymentHistoryInvoice.RefiDetailsModal.supplierDetails"),items:[{label:p("PaymentHistoryInvoice.RefiDetailsModal.supplier"),value:Ae.h.getCompanyName(d.company)},{label:p("PaymentHistoryInvoice.RefiDetailsModal.supplierPhone"),value:o.createElement(k.x1,{phone:d.company.phone,mode:"text"})}]},{title:p("PaymentHistoryInvoice.RefiDetailsModal.invoiceDetails"),items:[{label:p("PaymentHistoryInvoice.RefiDetailsModal.invoiceNumber"),value:1===(null===u||void 0===u||null===(c=u.payables)||void 0===c?void 0:c.length)?u.payables[0].number:o.createElement(k.t5,{onClick:()=>h(!0)},p("PaymentHistoryInvoice.RefiDetailsModal.viewInvoices"))},{label:p("PaymentHistoryInvoice.RefiDetailsModal.totalInvoiceAmount"),value:(0,Ce.zQ)(v)},{label:p("PaymentHistoryInvoice.RefiDetailsModal.totalCustomerFee"),value:(0,Ce.zQ)(b.refinancedData.loanFeesAmount)},{label:p("PaymentHistoryInvoice.RefiDetailsModal.totalLateFees"),value:(0,Ce.zQ)(b.refinancedData.lateFeesAmount)},{label:p("PaymentHistoryInvoice.RefiDetailsModal.totalPayments"),value:(0,Ce.zQ)(b.refinancedData.paidAmount)}]},{title:p("PaymentHistoryInvoice.RefiDetailsModal.refiDetails"),items:[{label:o.createElement(k.a3,{label:p("PaymentHistoryInvoice.RefiDetailsModal.totalOutstandingBalance"),tooltip:p("PaymentHistoryInvoice.RefiDetailsModal.totalOutstandingBalanceTooltip"),tooltipPosition:"top-end"}),value:(0,Ce.zQ)(b.refiData.outstandingAmount)},{label:p("PaymentHistoryInvoice.RefiDetailsModal.refiPrincipalAmount"),value:(0,Ce.zQ)(b.refiData.netPrincipalAmount)},{label:p("PaymentHistoryInvoice.RefiDetailsModal.refiFeePercentage"),value:(0,Ce.e8)(b.refiData.feesPercentage)},{label:p("PaymentHistoryInvoice.RefiDetailsModal.refiFeeAmount"),value:(0,Ce.zQ)(b.refiData.feesAmount)},{label:p("PaymentHistoryInvoice.RefiDetailsModal.financedAmount"),value:(0,Ce.zQ)(b.refiData.financedAmount)}]}];return o.createElement(o.Fragment,null,o.createElement(k.Vm,{title:p("PaymentHistoryInvoice.RefiDetailsModal.title"),onClose:m},o.createElement(k.Vm.Content,null,o.createElement(k.A5,{groups:f,mb:8,variant:"modal"}))),g&&o.createElement(F,{onView:m,onClose:()=>h(!1)}))};var ut=n(12276),mt=n(88917),pt=n(12162);const gt=(0,g.PA)((e=>{var t,n;let{disabled:r,onPay:a,onExtendTerms:l,onViewRefiDetails:i}=e;const{t:s}=(0,y.Bd)("global"),{isMobile:c}=ze.A,{invoice:d,loan:u,allowAchPayment:p,allowCardPayment:g,isAwaitingCustomerReviewApproval:h,isPaid:v,isPendingDisbursement:b,isRefi:f}
1=m(),C=!v&&!b&&(null===u||void 0===u?void 0:u.remainingAmount)>0,A=(h||C)&&!f&&pt.G.canExtendIhcInvoice(null===d||void 0===d||null===(t=d.customer)||void 0===t?void 0:t.settings,null===d||void 0===d||null===(n=d.company)||void 0===n?void 0:n.settings);return C||A||f?o.createElement(E.A,{style:[Me.footerButtonContainer,c?Me.mobileFooterWrapper:Me.desktop]},o.createElement(E.A,{style:ht.buttonWrapper},f&&o.createElement(z.BtButton,{status:"basic",style:Me.footerButton,onPress:i},s("PaymentHistoryInvoice.viewRefiDetails")),A&&o.createElement(z.BtButton,{disabled:r,status:C?"basic":"primary",style:Me.footerButton,onPress:l},s(h?"PaymentHistoryInvoice.updatePaymentTerm":"PaymentHistoryInvoice.extendTerms")),C&&o.createElement(z.BtButton,{disabled:r||!g&&!p,style:Me.footerButton,onPress:a},s("PaymentHistoryInvoice.makePayment")))):null})),ht=h.A.create({buttonContainer:{height:80,paddingVertical:10,marginLeft:18,justifyContent:"center"},buttonWrapper:{flexDirection:"row",gap:6}});var vt=n(73413),yt=n(86843),bt=n(70582),ft=n(34956),Et=n(76448),Ct=n(50767),At=n(73984),St=n(18529),wt=n(70764),Pt=n(51599),It=n(56480);const xt="PaymentOptionsSelector_radioGroup__jkVI5",Dt="PaymentOptionsSelector_optionRow__uv10Y",Tt="PaymentOptionsSelector_optionLabel__7Lq7Y",kt="PaymentOptionsSelector_optionAmount__GliB0",Bt="PaymentOptionsSelector_errorText__E9iW4",Ft=(0,g.PA)((e=>{let{options:t}=e;const{t:n}=(0,y.Bd)("global"),{getRepaymentProcessingFee:r}=(0,ft.mu)(),l=(0,o.useRef)(null),{paymentInfo:i,paymentMethod:s}=t,c=t.type===Wt.Partial;if(!i||!s)return null;const d=e=>{e===Wt.Full?(0,a.runInAction)((()=>{t.type=Wt.Full,t.amount=Math.max(i.outstandingGrossAmount,0),t.processingFee=r(i.outstandingGrossAmount,s).fee})):((0,a.runInAction)((()=>{t.type=Wt.Partial,t.amount=0,t.processingFee=0})),setTimeout((()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()}),0))};return o.createElement(Ct.a,{mt:32},o.createElement(At.h,{order:6,mb:8},n("payIhcInvoice.selectOptionToPay.title")),o.createElement(St.s.Group,{value:t.type,onChange:d},o.createElement(wt.B,{gap:0},o.createElement(Ct.a,{className:Dt,mod:{selected:!c}},o.createElement(Pt.Y,{className:xt},o.createElement(St.s,{value:Wt.Full,label:n("payIhcInvoice.selectOptionToPay.payRemainingAmount"),classNames:{label:Tt}}),o.createElement(It.E,{fw:700,className:kt,onClick:()=>d(Wt.Full)},(0,Ce.zQ)(t.amount)))),o.createElement(Ct.a,{className:Dt,mod:{selected:c}},o.createElement(Pt.Y,{className:xt},o.createElement(St.s,{value:Wt.Partial,label:n("payIhcInvoice.selectOptionToPay.payPartialAmount"),classNames:{label:Tt}}),c&&o.createElement(k.UG,{ref:l,value:t.amount,w:140,styles:{input:{textAlign:"right"}},onChange:e=>{(0,a.runInAction)((()=>{const n=null!==e&&void 0!==e?e:0;t.amount=n,t.processingFee=r(n,s).fee}))}}))),o.createElement(It.E,{className:Bt,mod:{visible:t.amount>i.outstandingGrossAmount}},n("CreditTab.amountError")))))}));var _t=n(19195),Nt=n(48697);const Rt="FactoringPaymentModal_lateFeeText__eNUfs",Lt=(0,g.PA)((e=>{let{options:t,loading:n,onSuccess:r,onError:a,onChangePaymentMethod:i,onAddNewPaymentMethod:s,onClose:c}=e;const{t:d}=(0,y.Bd)("global"),{mutateAsync:u,isPending:m}=(0,Et.n)({mutationFn:e=>l.Vv.Ji.factoringPayment(e),onSuccess:()=>r(),onError:e=>a(e)}),{paymentInfo:p,paymentMethod:g}=t,h=!!p&&!(null===g||void 0===g||!g.id)&&t.amount>0&&t.amount<=(null===p||void 0===p?void 0:p.outstandingGrossAmount),v=!(null===p||void 0===p||!p.lateFee),b=t.amount+t.processingFee;return o.createElement(k.Vm,{title:d("payIhcInvoice.makePayment"),loading:n,"data-testid":"'payIhcInvoice.makePayment'",onClose:c,isSubmitting:m},o.createElement(k.Vm.Content,null,p&&o.createElement(wt.B,{gap:0},o.createElement(k.YX,{variant:"gray",items:[{label:d("payIhcInvoice.invoiceData.dueDate"),value:(0,Nt.Y)(p.invoice.dueDate),labelClassName:v?Rt:void 0,valueClassName:v?Rt:void 0},{label:d("payIhcInvoice.invoiceData.outstandingAmount"),value:(0,Ce.zQ)(p.outstandingNetAmount)},!!v&&{label:d("payIhcInvoice.invoiceData.lateInterestCharge"),value:(0,Ce.zQ)(p.lateFee),labelClassName:Rt,valueClassName:Rt}]}),o.createElement(_t.$,{paymentMethod:g,onClick:i,mt:24,mb:8}),o.createElement(k.wP,{onClick:s},d("payIhcInvoice.paymentMethod.addNewPaymentMethod")),o.createElement(Ft,{options:t}),o.createElement(k.YX,{mt:16,withLastDivider:!0,items:[{label:d("payIhcInvoice.processingFee"),value:(0,Ce.zQ)(t.processingFee)},{label:d("payIhcInvoice.totalAmountToPay"),value:(0,Ce.zQ)(b)}]}))),o.createElement(k.Vm.Buttons,null,o.createElement(x.$,{miw:150,disabled:n||m||!h,"data-testid":"pay-factoring-invoice-button",onClick:async()=>{h&&await u({loanId:p.loanId,bankAccountId:g.id,amount:t.amount})}},d("payIhcInvoice.agree-and-pay",{amount:(0,Ce.zQ)(b)}))))}));var Mt=n(12344),Ot=n(32260),zt=n(44290),jt=n(77343);let Wt=function(e){return e.Full="full",e.Partial="partial",e}({});var Vt=function(e){return e[e.PaymentMethodSelection=0]="PaymentMethodSelection",e[e.AddPaymentMethod=1]="AddPaymentMethod",e[e.Options=2]="Options",e[e.Success=3]="Success",e[e.Error=4]="Error",e}(Vt||{});const Ht=(0,g.PA)((e=>{let{invoiceId:t,onSuccess:n,onClose:r}=e;const{step:l,goTo:i}=(0,ft.qM)(Vt),{getRepaymentProcessingFee:s}=(0,ft.mu)(),[c,d]=(0,o.useState)(null),u=(0,g.iz)((()=>({type:Wt.Full,amount:0,processingFee:0}))),{data:m,isFetching:p}=(0,Mt.I)(Ot.o.getIhcPaymentInfo({invoiceId:t}));(0,o.useEffect)((()=>{m&&(0,a.runInAction)((()=>{u.paymentInfo=m,u.type=Wt.Full,u.amount=m.outstandingGrossAmount,u.processingFee=s(m.outstandingGrossAmount,u.paymentMethod).fee}))}),[m,u,s]);const h=()=>{u.paymentMethod?i(Vt.Options):r()},v=e=>{(0,a.runInAction)((()=>{u.paymentMethod=e,u.processingFee=s(u.amount,u.paymentMethod).fee})),i(Vt.Options)};return o.createElement(o.Fragment,null,l===Vt.PaymentMethodSelection&&o.createElement(zt.H,{onAddPaymentMethod:()=>i(Vt.AddPaymentMethod),onSelected:v,onClose:h}),l===Vt.AddPaymentMethod&&o.createElement(jt.Zb,{onAdded:e=>{var t;return v(null!==(t=e.account)&&void 0!==t?t:null)},onClose:h}),l===Vt.Options&&u.paymentMethod&&o.createElement(Lt,{options:u,loading:p,onClose:r,onChangePaymentMethod:()=>i(Vt.PaymentMethodSelection),onAddNewPaymentMethod:()=>i(Vt.AddPaymentMethod),onSuccess:()=>i(Vt.Success),onError:e=>{d(e),i(Vt.Error)}}),l===Vt.Success&&o.createElement(yt.L,{amount:u.amount||0,supplierName:(null===m||void 0===m?void 0:m.company.name)||"",onClose:n}),l===Vt.Error&&c&&o.createElement(bt.Q,{error:c.message,onClose:r}))}));var Ut=function(e){return e[e.None=0]="None",e[e.Pay=1]="Pay",e[e.ExtendTerms=2]="ExtendTerms",e[e.ViewRefi=3]="ViewRefi",e[e.InvoiceDetails=4]="InvoiceDetails",e}(Ut||{});const Gt=(0,g.PA)((e=>{let{navigation:t}=e;const{t:n}=(0,y.Bd)("global"),[r,a]=(0,o.useState)(Ut.None),[l,i]=(0,o.useState)(!1),s=(0,vt.Q)(),{isMobile:c}=ze.A,{invoice:d,loan:u,transactions:p,isAwaitingCustomerReviewApproval:g,reloadInvoice:h}=m(),v=e=>{i(!0),a(Ut.None),setTimeout((()=>{h().then((()=>{null!==e&&void 0!==e&&e.forceMakePayment&&a(Ut.Pay)})),i(!1)}),1e3),setTimeout((()=>{mt.lJ.vendorId&&mt.lJ.refreshData(),mt.GO.refreshData(),s()}),1500)};return o.createElement(o.Fragment,null,o.createElement(je,{navigation:t,footer
1:o.createElement(gt,{disabled:l,onPay:()=>a(Ut.Pay),onExtendTerms:()=>a(Ut.ExtendTerms),onViewRefiDetails:()=>a(Ut.ViewRefi)})},o.createElement(J,{navigation:t}),o.createElement(Te.hK,{height:5}),!g&&o.createElement(o.Fragment,null,o.createElement(M,{label:n("PaymentHistoryInvoice.viewMoreDetails"),onClick:()=>a(Ut.InvoiceDetails),style:{marginLeft:c?0:5}}),o.createElement(qe,{onClick:()=>{c?t.navigate(T.f0.Console.More._self,{screen:T.f0.Console.More.Wallet}):t.navigate(T.f0.Console.Accounts._self)}}),o.createElement(ct,null))),r===Ut.Pay&&o.createElement(Ht,{invoiceId:d.id,onSuccess:v,onClose:()=>a(Ut.None)}),r===Ut.ExtendTerms&&o.createElement(ut.R,{invoiceId:d._id,onComplete:v,onClose:()=>a(Ut.None)}),r===Ut.InvoiceDetails&&o.createElement(De,{loan:u,invoice:d,transactions:p,onClose:()=>a(Ut.None)}),r===Ut.ViewRefi&&o.createElement(dt,{loan:u,invoice:d,onClose:()=>a(Ut.None)}))})),Yt=(0,g.PA)((e=>{let{onPay:t}=e;const{t:n}=(0,y.Bd)("global"),{isMobile:r}=ze.A,{allowAchPayment:a,allowCardPayment:l}=m();return o.createElement(E.A,{style:[Me.footerButtonContainer,r?Me.mobileFooterWrapper:Me.desktop]},o.createElement(E.A,{style:Qt.buttonWrapper},o.createElement(z.BtButton,{onPress:t,disabled:!l&&!a,style:Me.footerButton},n("PaymentHistoryInvoice.makePayment"))))})),Qt=h.A.create({buttonContainer:{height:80,paddingVertical:10,marginLeft:18,justifyContent:"center"},buttonWrapper:{flexDirection:"row",gap:10}});var qt=n(96557);const Kt=(0,v.PA)((e=>{let{invoice:t,visible:n,onClose:r,navigation:a,route:l}=e;const{getInvoice:i}=m(),s=(0,Ue.P)(),{id:c}=l.params,d=s.userStore.isAuthenticated,u=s.userStore.userInfoReady?!!s.userStore.settings.get("onboarding"):null;return o.useEffect((()=>{d&&n&&u&&(r(),i(c))}),[d,n,r,i,c,u]),o.createElement(qt.A,{invoice:t,visible:n&&(!d||!u&&null!==u),onClose:r,navigation:a,route:l},o.createElement(E.A,null))})),Jt=(0,g.PA)((e=>{let{navigation:t,route:n}=e;const[r,a]=(0,o.useState)(!1),{invoice:l}=m();return o.createElement(je,{navigation:t,footer:o.createElement(Yt,{onPay:()=>a(!0)})},o.createElement(J,{navigation:t}),r&&o.createElement(Kt,{invoice:l,visible:!0,onClose:()=>a(!1),navigation:t,route:n}))}));var Zt=n(18394);const Xt=e=>{let{title:t,subtitle:n,onPress:r,disabled:a=!1,testID:l="in-house-credit-item"}=e;return o.createElement(E.A,{testID:"".concat(l,"-container")},o.createElement(Zt.c,{disabled:a,style:$t.container,otherStyles:{title:$t.title,subTitle:$t.subtitle,frontIcon:{width:38,height:38,marginTop:19}},onPress:r,icon:o.createElement(E.A,{style:$t.frontIconContainer},o.createElement(_.OM8,null)),endIcon:o.createElement(_.wUc,{style:{height:25.2,width:25.2}}),title:t,subtitle:n,testID:l}))},$t=h.A.create({title:{fontWeight:"600",fontSize:16,lineHeight:28,letterSpacing:0,color:N.B.blue.blue400,fontFamily:"Inter"},subtitle:{fontWeight:"500",fontSize:12,lineHeight:20,color:N.B.caption.grey500,fontFamily:"Inter",letterSpacing:0},container:{alignSelf:"center",backgroundColor:"white",marginBottom:0,height:76,borderWidth:1,borderColor:N.B.elements.grey300,borderRadius:8,shadowColor:"black",shadowOpacity:.06,shadowRadius:10},frontIconContainer:{width:34,height:34,borderRadius:17,backgroundColor:N.B.background.grey200,justifyContent:"center",alignItems:"center"}});var en=n(94435);const tn="or Pay Now with options below",nn=e=>{let{text:t=tn}=e;return o.createElement(en.gn,{color:N.B.elements.grey300,containerStyle:{marginVertical:12}},o.createElement(f.A,{style:on.text},t))},on=h.A.create({text:{fontSize:12,lineHeight:21,fontWeight:"400",fontFamily:"Inter",letterSpacing:0,color:N.B.text.grey400}});var rn=n(76466);var an=n(97009);const ln=(0,g.PA)((e=>{var t,n,r,l,i;let{navigation:s,route:c,onPaymentSuccess:d,onCustomerReview:u}=e;const{t:p}=(0,y.Bd)("global"),g=(0,Y.A)(),{invoice:h,allowAchPayment:v,allowCardPayment:b,isReviewRequired:f}=m(),{paymentMethods:C,loading:A}=ze.A.screensStore.paymentMethodsStore,S=C?(0,a.toJS)(C):[],{filteredMethods:w}=(e=>{let{paymentMethods:t,acceptAchPayment:n,acceptCards:r}=e;const a=(0,o.useMemo)((()=>{if(!t)return[];let e=Array.from(t);return n||(e=e.filter((e=>"bank"!==e.paymentMethodType))),r||(e=e.filter((e=>"card"!==e.paymentMethodType))),e}),[n,r,t]);return{filteredMethods:a,hasPaymentMethods:!!a.length,hasBankMethods:a.some((e=>"bank"===e.paymentMethodType)),hasCardMethods:a.some((e=>"card"===e.paymentMethodType))}})({paymentMethods:S,acceptAchPayment:v,acceptCards:b}),P=!!w.length,I=1===(null===h||void 0===h||null===(t=h.customer)||void 0===t||null===(n=t.settings)||void 0===n||null===(r=n.inHouseCredit)||void 0===r||null===(l=r.review)||void 0===l||null===(i=l.factoringTerms)||void 0===i?void 0:i.length);return A?o.createElement(E.A,{style:[sn.loadingContainer,{width:g?"100%":360}]},o.createElement(rn.y,{size:"large",status:"primary",style:sn.spinner})):o.createElement(E.A,{style:[sn.container,{width:g?"100%":360}]},(f||P)&&o.createElement(z.BtText,{style:sn.header},p("PaymentHistoryInvoice.chooseMethod")),f&&o.createElement(Xt,{title:p("PaymentHistoryInvoice.ihcContainerTitle"),subtitle:p(I?"PaymentHistoryInvoice.ihcContainerSubtitleForSinglePlan":"PaymentHistoryInvoice.ihcContainerSubtitle"),onPress:u,testID:"ihc-payment-option"}),f&&P&&o.createElement(nn,{text:p("PaymentHistoryInvoice.payNowDivider")}),o.createElement(an.Z,{invoices:[h],withBanks:v,withCards:b,navigation:s,route:c,onSuccess:d}))})),sn=h.A.create({container:{marginVertical:10},header:{fontSize:16,lineHeight:21,fontFamily:"Inter",letterSpacing:0,fontWeight:"600",color:N.B.text.mainSecondary,marginBottom:16,textAlign:"center"},loadingContainer:{marginVertical:20,alignItems:"center",justifyContent:"center",minHeight:120},spinner:{marginVertical:10}});var cn=n(24586),dn=n(94727),un=n(41436);const mn=e=>
1{let{paymentPlans:t,selectedPlan:n,downPaymentSettings:r,onSelect:a,onContinue:l,onClose:i}=e;const{t:s}=(0,y.Bd)("global"),c=1===t.length;return o.createElement(k.Vm,{title:s(c?"PaymentHistoryInvoice.customerReview.viewPaymentTerm":"PaymentHistoryInvoice.customerReview.choosePaymentPlan"),onClose:i},o.createElement(k.Vm.Content,null,t.length?o.createElement(o.Fragment,null,!c&&o.createElement(It.E,{mb:24},s("PaymentHistoryInvoice.customerReview.selectPaymentTerms")),o.createElement(wt.B,{gap:16},t.map((e=>o.createElement("div",{key:e.id},o.createElement(dn.z,{paymentPlan:e,selected:(null===n||void 0===n?void 0:n.id)===e.id,onClick:a})))))):o.createElement(un.o,null,o.createElement(It.E,{fz:16,p:50},s("PaymentHistoryInvoice.customerReview.noPlansAvailable"))),(null===r||void 0===r?void 0:r.isRequired)&&o.createElement(It.E,{fz:12,mt:8},o.createElement(y.x6,{t:s,i18nKey:"PaymentPlanCard.down-payment-required-message",values:{percentage:r.downPaymentPercentage},components:{styled:o.createElement(It.E,{span:!0,inherit:!0,fw:700})}}))),o.createElement(k.Vm.Buttons,null,o.createElement(x.$,{onClick:l,"data-test-id":"customer-review-payment-plan-continue-button",disabled:!n},s("DownPaymentModal.continue"))))};var pn=n(97186),gn=n(61328),hn=n(54223);const vn=e=>{var t;let{invoice:n,paymentPlan:r,downPayment:a,onBack:i,onClose:s,onContinue:c}=e;const{t:d}=(0,y.Bd)("global"),{mutate:u,isPending:m}=(0,Et.n)({mutationFn:()=>l.Vv.KF.requestIhcTerms({invoiceId:n._id,paymentPlanId:r.id,downPayment:a}),onSuccess:()=>c()});return o.createElement(k.Vm,{title:d("PaymentHistoryInvoice.customerReview.payInvoiceWithIHC"),onBack:i,onClose:s},o.createElement(k.Vm.Content,null,o.createElement(Ct.a,{my:8},o.createElement(dn.g,{paymentPlan:r,downPayment:a,showDueDateHint:!1})),o.createElement(k.YX,{mb:24,items:[{label:d("PaymentHistoryInvoice.customerReview.to"),value:null===n||void 0===n||null===(t=n.company)||void 0===t?void 0:t.name},{label:d("PaymentHistoryInvoice.customerReview.invoiceAmount"),value:(0,Ce.zQ)(n.total_amount)},{label:d("PaymentHistoryInvoice.customerReview.financingFee"),value:(0,Ce.zQ)(r.feeAmount)},{label:d("PaymentHistoryInvoice.customerReview.totalRepaymentAmount"),value:(0,Ce.zQ)(r.grossAmount)}]}),o.createElement(pn._,null),o.createElement(hn.$,{h:24}),o.createElement(gn.e,{invoiceIds:[n._id],paymentPlan:r})),o.createElement(k.Vm.Buttons,null,o.createElement(x.$,{onClick:()=>u(),disabled:m,loading:m},d("PaymentHistoryInvoice.customerReview.agreeAndPay"))))},yn=e=>{let{onClose:t}=e;const{t:n}=(0,y.Bd)("global");return o.createElement(k.HD,{icon:o.createElement(k.GQ,{type:"success"}),title:n("PaymentHistoryInvoice.customerReview.processingRequest"),buttons:[n("PaymentHistoryInvoice.customerReview.okGotIt")],testId:"CustomerReview.SuccessModal",onClose:t},n("PaymentHistoryInvoice.customerReview.processingDescription"),o.createElement(hn.$,{h:24}),n("PaymentHistoryInvoice.customerReview.additionalInfoContact"))};var bn=n(89199),fn=n(88634),En=n(77079),Cn=function(e){return e[e.PlanSelection=0]="PlanSelection",e[e.DownPayment=1]="DownPayment",e[e.Confirmation=2]="Confirmation",e[e.Success=3]="Success",e}(Cn||{});const An=(0,g.PA)((e=>{var t;let{onClose:n,onSuccess:r,invoice:a,navigation:l,route:i}=e;const{t:s}=(0,y.Bd)("global"),[c,d]=(0,o.useState)(null),[u,m]=(0,o.useState)(null),{step:p,goNext:g,goBack:h,goTo:v,setFlow:b}=(0,ft.qM)(Cn),{data:f,isFetching:E}=(0,Mt.I)(cn.C.customerReviewPlans({invoiceId:a._id},{enabled:!(null===a||void 0===a||!a._id)}));return(0,o.useEffect)((()=>{if(f){const e=f.downPaymentSettings.isRequired,t=(0,En.w5)(Cn);b(e?t:t.filter((e=>e!==Cn.DownPayment)))}}),[f,v,b]),E||!f?o.createElement(bn.C,{text:s("PaymentHistoryInvoice.customerReview.loadingPaymentPlans"),onClose:n}):o.createElement(qt.A,{invoice:a,visible:!0,onClose:n,navigation:l,route:i},p===Cn.PlanSelection&&f&&o.createElement(mn,{paymentPlans:null!==(t=f.plans)&&void 0!==t?t:[],selectedPlan:c,downPaymentSettings:f.downPaymentSettings,onSelect:d,onContinue:g,onClose:n}),p===Cn.DownPayment&&c&&o.createElement(fn.k,{downPayment:c.downPayment,paymentMethod:u,onChange:m,onBack:h,onClose:n,onContinue:g}),p===Cn.Confirmation&&c&&o.createElement(vn,{invoice:a,paymentPlan:c,downPayment:u,onBack:h,onClose:n,onContinue:g}),p===Cn.Success&&o.createElement(yn,{onClose:r}))}));var Sn=function(e){return e[e.None=0]="None",e[e.Pay=1]="Pay",e[e.CustomerReview=2]="CustomerReview",e}(Sn||{});const wn=(0,g.PA)((e=>{let{navigation:t,route:n}=e;const[r,a]=(0,o.useState)(Sn.None),l=(0,vt.Q)(),{invoice:i,reloadInvoice:s}=m(),c=()=>{mt.lJ.vendorId&&mt.lJ.refreshData(),mt.GO.refreshData(),l()};return o.createElement(o.Fragment,null,o.createElement(je,{navigation:t},o.createElement(J,{navigation:t}),o.createElement(Te.hK,{height:5}),o.createElement(ln,{navigation:t,route:n,onPaymentSuccess:()=>{setTimeout(c,1500);const e=(0,T.oh)((0,T.wl)("Console.Payables.home"));t.replace(e.name,e.params)},onCustomerReview:()=>a(Sn.CustomerReview)})),r===Sn.CustomerReview&&o.createElement(An,{onClose:()=>a(Sn.None),invoice:i,navigation:t,onSuccess:()=>{a(Sn.None),setTimeout((()=>s()),1e3),setTimeout(c,1500)},route:n}))})),Pn=(0,g.PA)((e=>{let{navigation:t}=e;return o.createElement(je,{navigation:t},o.createElement(J,{navigation:t}))}));var In=n(11492);const xn=(0,g.PA)((e=>{let{route:t,navigation:n}=e;const{id:a,lmsId:l,mode:i}=t.params,{getInvoice:s,loading:c,invoice:d,isAwaitingCustomerReviewApproval:u,isFactoring:p,isFactoringApproved:g,isPaid:h,isPendingDisbursement:v,canPayRegularInvoice:y}=m(),b=(0,Fe.X)(),f=ze.A.userStore.userInfoReady?!!ze.A.userStore.settings.get("onboarding"):null;if((0,o.useEffect)((()=>{s(a,l,i)}),[a,l,i,s]),(0,o.useEffect)((()=>{ze.A.screensStore.paymentMethodsStore.fetchPaymentMethods()}),[b]),!d||c)return o.createElement(r.A,null);if(!b||!f&&null!==f)return o.createElement(Jt,{navigation:n,route:t});
1if(p){const e=u||g||h||v||!d.totalRemainingAmount,r=!In.n.includes(d.status)&&!e;if((null===i||void 0===i?void 0:i.toLowerCase())===He.p.Refinanced)return o.createElement(Ve,{navigation:n});if(r)return o.createElement(wn,{navigation:n,route:t});if(e)return o.createElement(Gt,{navigation:n,route:t})}return y?o.createElement(wn,{navigation:n,route:t}):o.createElement(Pn,{navigation:n})})),Dn=e=>{let{route:t,navigation:n}=e;return o.createElement(p,null,o.createElement(xn,{route:t,navigation:n}))}},42461:(e,t,n)=>{"use strict";n.d(t,{p:()=>o});let o=function(e){return e.Refinanced="refinanced",e}({})},44290:(e,t,n)=>{"use strict";n.d(t,{H:()=>c});var o=n(50016),r=n(29731),a=n(63680),l=n(73819),i=n(94951),s=n(34956);const c=(0,a.PA)((e=>{let{invoice:t,withCards:n=!0,withBanks:a=!0,onSelected:c,onAddPaymentMethod:d,onClose:u}=e;const{t:m}=(0,r.Bd)("global"),{loading:p,paymentMethods:g}=(0,s.mu)();return(0,o.useEffect)((()=>{p||g.length||d()}),[]),o.createElement(o.Fragment,null,o.createElement(l.Vm,{title:m("PaymentHistoryInvoice.choosePaymentMethod"),loading:p,mih:600,mah:"min(800px, 100vh)",onClose:u},o.createElement(l.Vm.Content,{mb:24},o.createElement(i.B,{invoice:t,withBanks:a,withCards:n,onSelect:c,onAddPaymentMethod:d}))))}))},11492:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h,n:()=>s.nY});var o=n(74161),r=n.n(o),a=n(82997),l=n(37458),i=n(54030),s=n(58876),c=n(61144),d=n(7007),u=n(39001),m=n(61699),p=n(97537),g=n(48697);class h extends l.h{constructor(){super(),this.exportFileName="invoices_payables",this.vendorId=null,this.vendorIsInvited=!1,this.isFactoring=!1,this.hasPayableInvoices=!1,this.totalSelectedCount=0,this.totalAmount=0,this.filter={search:"",dateFrom:r()().subtract(60,"days").format("MM/DD/YYYY"),dateTo:r()().format("MM/DD/YYYY"),dateFromIndex:1,statuses:[""]},this.initObservable()}get hasFactoringInvoices(){return this.tableData.items.some((e=>e.paymentType===a.mn.FACTORING))}get hasRefinancedInvoices(){return this.tableData.items.some((e=>e.meta.isRefinanced))}get hasCustomerReviewRequiredInvoices(){return this.tableData.items.some((e=>e.meta.isCustomerReviewRequired))}get allSelected(){const e=this.tableData.items.filter((e=>e.meta.isPayable));return e.length>0&&e.every((e=>e.selected))}get someSelected(){const e=this.tableData.items.filter((e=>e.meta.isPayable));return e.some((e=>e.selected))&&!e.every((e=>e.selected))}resetFilter(){this.filter={search:"",dateFrom:r()().subtract(60,"days").format("MM/DD/YYYY"),dateTo:r()().format("MM/DD/YYYY"),dateFromIndex:1,statuses:[""]},this.resetPage(),this.resetSort()}setVendor(e,t){this.vendorId=e,this.vendorIsInvited=t,this.hasPayableInvoices=!1}setIsFactoring(e){this.isFactoring=e}setTotalSelectedCount(e){this.totalSelectedCount=e}setSelectedTotalAmount(e){this.totalAmount=e}getQueryOptions(e){return i.o.payablesInvoices({supplierId:this.vendorId,supplierIsInvited:this.vendorIsInvited||void 0,...e},{staleTime:3e4})}handleDataFetched(){this.totalSelectedCount=0,this.totalAmount=0,this.hasPayableInvoices=this.tableData.items.some((e=>e.meta.isPayable))}formatTableItem(e){var t,n,o,r,l;const i=s.Sn.includes(e.invoiceStatus)&&e.paymentType!==a.mn.FACTORING&&e.customerType!==d.i.IHC&&e.allowedForGroupPayment&&!!e.totalRemainingAmount,c=!(null===(t=e.refinance)||void 0===t||!t.isRefinanced),p=e.paymentType===a.mn.FACTORING,h=e.customerType===d.i.IHC,v=!!e.supplierInvitationDetails;let y,b,f,E,C,A;var S,w,P;c?(C=0,A=0,y=0,f=0,E=0,b=null!==(S=null===(w=e.refinance)||void 0===w?void 0:w.paidAmount)&&void 0!==S?S:e.totalPaidAmount):(C=e.customerFee||0,A=e.lateFee||0,b=e.totalPaidAmount&&p?e.totalPaidAmount:u.iA.includes(e.invoiceStatus)?e.total_amount:0,f=p?null!==(P=e.totalProcessingAmount)&&void 0!==P?P:0:u.BT.includes(e.invoiceStatus)||e.invoiceStatus===s.uR.paymentProcessing||e.invoiceStatus===s.uR.due&&(v||e.totalProcessingAmount)?e.total_amount:0,E=u.BT.includes(e.invoiceStatus)||u.iA.includes(e.invoiceStatus)?0:e.totalRemainingAmount,y=e.totalAmountDue);return{_id:e._id,invoiceNumber:e.invoice_number,totalAmount:(0,m.zQ)(e.total_amount),totalAmountDue:(0,m.zQ)(y),totalPaidAmount:(0,m.zQ)(b,0),totalProcessingAmou
1nt:(0,m.zQ)(f,0),totalRemainingAmount:(0,m.zQ)(E,0),customerFee:(0,m.zQ)(C||null,"-"),lateFee:(0,m.zQ)(A||null,"-"),dueDate:(0,g.Y)(e.invoice_due_date),paymentDate:e.payment_date?(0,g.Y)(e.payment_date):"-",status:e.invoiceStatus,supplierId:(null===(n=e.company)||void 0===n?void 0:n._id)||"",supplierPhone:(null===(o=e.company)||void 0===o?void 0:o.phone)||"-",supplierName:(null===(r=e.company)||void 0===r?void 0:r.name)||"-",selected:!1,paymentType:e.paymentType,payerId:e.payer_id,meta:{isRefinanced:c,isPayable:i,isFactoring:p||h,refiLoanId:(null===(l=e.refinance)||void 0===l?void 0:l.refiLoanId)||null,isCustomerReviewRequired:!!e.isReviewRequired,hasProcessingAmount:f>0,hasRemainingAmount:E>0,invoice:e}}}formatExportItem(e){const t=p.Ay.getFixedT(null,"payables");return{[t("payables.tabInvoices.table.VendorName")]:e.supplierName,[t("payables.tabInvoices.table.InvoiceNumber")]:e.invoiceNumber,[t("payables.tabInvoices.table.DueDate")]:e.dueDate,[t("payables.tabInvoices.table.Status")]:(0,c.O)(e.status).label,[t("payables.tabInvoices.table.Amount")]:e.totalAmount,[t("payables.tabInvoices.table.CustomerFee")]:e.customerFee,[t("payables.tabInvoices.table.LateFee")]:e.lateFee,[t("payables.tabInvoices.table.PaidAmount")]:e.totalPaidAmount,[t("payables.tabInvoices.table.ProcessingAmount")]:e.totalProcessingAmount,[t("payables.tabInvoices.table.RemainingAmount")]:e.totalRemainingAmount}}}},64565:(e,t,n)=>{"use strict";n.d(t,{HU:()=>l,V1:()=>i,xh:()=>s});var o=n(50016),r=n(5565);const a=(0,o.createContext)(null),l=()=>{const e=(0,o.useContext)(a);if(!e)throw new Error("usePayables must be used within a PayablesProvider");return e},i=()=>(0,o.useContext)(a),s=e=>{let{children:t}=e;const[n]=(0,o.useState)((()=>new r.P));return o.createElement(a.Provider,{value:n},t)}},5565:(e,t,n)=>{"use strict";n.d(t,{P:()=>P,W:()=>S});var o=n(82997),r=n(2745),a=n(83613),l=n(11492),i=n(74161),s=n.n(i),c=n(67956),d=n(97537),u=n(37458),m=n(54030),p=n(61144),g=n(61699);class h extends u.h{resetFilter(){this.filter={search:"",dateFrom:s()().subtract(30,"days").format("MM/DD/YYYY"),dateTo:s()().format("MM/DD/YYYY"),dateFromIndex:0,statuses:[""]},this.resetPage(),this.resetSort()}setVendorId(e){this.vendorId=e}constructor(){super(),this.exportFileName="quotes_payables",this.vendorId=null,this.filter={search:"",dateFrom:s()().subtract(30,"days").format("MM/DD/YYYY"),dateTo:s()().format("MM/DD/YYYY"),dateFromIndex:0,statuses:[""]},this.initObservable()}getQueryOptions(e){return m.o.payablesInvoices({types:[o.tD.QUOTE],supplierId:this.vendorId,...e})}formatTableItem(e){var t,n,o;return{_id:e._id,quoteNumber:e.invoice_number,totalAmount:(0,g.zQ)(e.total_amount),expirationDate:e.authorization_deadline?(0,c.jr)(e.authorization_deadline):"-",status:e.invoiceStatus,supplierId:(null===(t=e.company)||void 0===t?void 0:t._id)||"-",supplierPhone:(null===(n=e.company)||void 0===n?void 0:n.phone)||"-",supplierName:(null===(o=e.company)||void 0===o?void 0:o.name)||"-"}}formatExportItem(e){const t=d.Ay.getFixedT(null,"payables");return{[t("payables.tabQuotes.table.VendorName")]:e.supplierName,[t("payables.tabQuotes.table.QuoteNumber")]:e.quoteNumber,[t("payables.tabQuotes.table.Amount")]:e.totalAmount,[t("payables.tabQuotes.table.ExpDate")]:e.expirationDate,[t("payables.tabQuotes.table.Status")]:(0,p.O)(e.status).label}}}var v=n(24586),y=n(48697),b=n(93186);class f extends u.h{resetFilter(){this.filter={search:"",paymentStatus:"",dateFrom:s()().subtract(30,"days").format("MM/DD/YYYY"),dateFromIndex:0},this.resetPage(),this.resetSort()}constructor(){super(),this._t=d.Ay.getFixedT(null,"payables"),this.exportFileName="refi",this.filter={search:"",sortColumn:"",sortDirection:"",paymentStatus:"",dateFrom:s()().subtract(30,"days").format("MM/DD/YYYY"),dateFromIndex:0},this.initObservable()}getQueryOptions(e){return v.C.refiDraws({search:e.search,paymentStatus:e.paymentStatus,dateFrom:e.dateFrom,sortColumn:e.sortColumn,sortDirection:e.sortDirection,pageNumber:e.page,pageSize:e.pageSize})}formatTableItem(e){return{loanId:e.loanId,supplierName:e.supplierName,invoiceNumber:e.invoices.length>1?this._t("payables.tabRefi.multipleInvoices"):e.invoices[0].number,financingAmou
1nt:(0,g.zQ)(e.financingAmount),nextPaymentDate:(0,y.Y)(e.nextPaymentDate),nextPaymentAmount:(0,g.zQ)(e.nextPaymentAmount),amountDue:(0,g.zQ)(e.amountDue),status:e.status,raw:e}}formatExportItem(e){return{[this._t("payables.tabRefi.table.supplier")]:e.supplierName,[this._t("payables.tabRefi.table.invoiceNumber")]:e.invoiceNumber,[this._t("payables.tabRefi.table.financingAmount")]:e.financingAmount,[this._t("payables.tabRefi.table.nextPaymentDate")]:e.nextPaymentDate,[this._t("payables.tabRefi.table.nextPaymentAmount")]:e.nextPaymentAmount,[this._t("payables.tabRefi.table.amountDue")]:e.amountDue,[this._t("payables.tabRefi.table.status")]:(0,b.t)(e.status)}}}var E=n(58876),C=n(92349);class A extends u.h{constructor(){super(),this.exportFileName="vendors_payables",this.filter={search:""},this.initObservable(),this.resetSort()}resetFilter(){this.filter={search:""},this.resetPage(),this.resetSort()}getDefaultSort(){return{column:E.j7.CREATED_AT,direction:C.j.DESC}}getQueryOptions(e){return m.o.vendorsList(e)}formatTableItem(e){var t;return{...e,totalDue:(0,g.zQ)(e.totalDueSum),totalPastDue:(0,g.zQ)(e.totalPastDueSum),invoicesPastDue:String(null!==(t=e.totalPastDueInvoices)&&void 0!==t?t:0),downPayment:(0,g.e8)(e.downPaymentPercentage)}}formatExportItem(e){const t=d.Ay.getFixedT(null,"payables");return{[t("payables.tabVendors.table.VendorName")]:e.supplierName,[t("payables.tabVendors.table.TotalDue")]:e.totalDue,[t("payables.tabVendors.table.TotalPastDue")]:e.totalPastDue,[t("payables.tabVendors.table.InvoicesPastDue")]:e.invoicesPastDue,[t("payables.tabVendors.table.DownPayment")]:e.downPayment}}}let S=function(e){return e.Invoices="invoices",e.Quotes="quotes",e.Refinanced="refinanced",e.Vendors="vendors",e}({});const w={totalDueSum:0,availableCredit:0,creditLimit:0,outstandingCredit:0,downPaymentPercentage:0};class P{constructor(){this.invoices=new l.Z,this.quotes=new h,this.refi=new f,this.vendors=new A,this.activeTab=S.Invoices,this.activeSupplier=null,this.isFactoring=!1,this.suppliersCount=0,this.singleSupplier=null,this.decisionLoaded=!1,this.decisionLoading=!1,this.initialized=!1,this.dataStale=!1,this.isStatisticsLoading=!1,this.statistics={...w},this.suppliersInfoLoadedAt=null,this.cachedSuppliersCount=0,this.cachedSupplier=null,(0,r.makeAutoObservable)(this)}get isSingleSupplierCustomer(){return 1===this.suppliersCount}get hasSuppliers(){return this.suppliersCount>0}get activeSupplierId(){var e,t;return null!==(e=null===(t=this.activeSupplier)||void 0===t?void 0:t.id)&&void 0!==e?e:null}get canShowRefi(){return!!a.A.userStore.hasApprovedIhcApps&&(!this.activeSupplier||this.isFactoring)}setActiveTab(e){this.activeTab=e}selectSupplier(e){this.activeSupplier=e,this.activeTab=S.Invoices,this.isFactoring=e.inHouseCreditIsEnabled&&e.arAdvanceIsEnabled;const t=!this.isSingleSupplierCustomer;this.invoices.setVendor(t?e.id:null,t&&e.supplierIsInvited),this.invoices.setIsFactoring(this.isFactoring),this.quotes.setVendorId(e.id),this.refreshStatistics(),this.refreshInvoices(),this.canShowRefi&&this.refreshRefi(),this.isFactoring||e.supplierIsInvited||this.refreshQuotes()}clearSupplier(){this.activeSupplier=null,this.isFactoring=!1,this.invoices.setVendor(null,!1),this.invoices.setIsFactoring(!1),this.quotes.setVendorId(null)}returnToMultiView(){this.clearSupplier(),this.activeTab=S.Vendors,this.refreshMultiView({skipVendors:!0})}async loadDecision(){if(null!==this.suppliersInfoLoadedAt&&Date.now()-this.suppliersInfoLoadedAt<=3e4)this.applyDecision(this.cachedSuppliersCount,this.cachedSupplier);else{this.decisionLoading=!0;try{const{count:e,supplier:t}=await o.Vv.z7.suppliersInfo();(0,r.runInAction)((()=>{this.cachedSuppliersCount=e,this.cachedSupplier=null!==t&&void 0!==t?t:null,this.suppliersInfoLoadedAt=Date.now(),this.applyDecision(e,null!==t&&void 0!==t?t:null),this.decisionLoading=!1}))}catch(e){(0,r.runInAction)((()=>{this.applyDecision(0,null),this.decisionLoading=!1})),console.log(e)}}}applyDecision(e,t){this.suppliersCount=e,this.singleSupplier=t,this.decisionLoaded=!0,1===e&&t?this.selectSupplier({id:t.id,supplierName:t.supplierName,supplierPhone:t.supplierPhone,supplierIsInv
1ited:!1,inHouseCreditIsEnabled:t.inHouseCreditIsEnabled,arAdvanceIsEnabled:t.arAdvanceIsEnabled}):e>1&&this.refreshMultiView()}initialize(){this.initialized=!0,this.resetView(),this.prefetchInvoices(),this.loadDecision()}markNeedsReload(){this.initialized=!1}markDataStale(){this.dataStale=!0}refreshIfStale(){if(this.dataStale){this.dataStale=!1,this.refreshStatistics();for(const e of[this.invoices,this.quotes,this.refi,this.vendors])e.dataLoaded&&e.fetchData()}}refreshMultiView(){let{skipVendors:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.refreshStatistics(),this.refreshInvoices(),this.refreshQuotes(),this.canShowRefi&&this.refreshRefi(),e||this.refreshVendors()}refreshStatistics(){var e;this.isStatisticsLoading=!0;const t=this.activeSupplierId;this.isFactoring&&o.JZ.QN.inHouseCreditInfo({supplierId:t}).then((e=>(0,r.runInAction)((()=>{this.statistics.availableCredit=e.totalAvailableCredit,this.statistics.creditLimit=e.totalCreditLimit,this.statistics.outstandingCredit=e.totalOutstandingCredit})))).catch((e=>console.log(e))),o.JZ.rN.invoicesVendorsStatistics({supplierId:t,supplierIsInvited:(null===(e=this.activeSupplier)||void 0===e?void 0:e.supplierIsInvited)||void 0}).then((e=>(0,r.runInAction)((()=>{this.statistics.totalDueSum=e.totalDueSum||0,this.statistics.downPaymentPercentage=e.downPaymentPercentage||0})))).catch((e=>console.log(e))).finally((()=>(0,r.runInAction)((()=>this.isStatisticsLoading=!1))))}refreshInvoices(){this.invoices.resetFilter(),this.invoices.fetchData()}refreshQuotes(){this.quotes.resetFilter(),this.quotes.fetchData()}refreshRefi(){this.refi.resetFilter(),this.refi.fetchData()}refreshVendors(){this.vendors.resetFilter(),this.vendors.fetchData()}prefetchInvoices(){this.invoices.resetFilter(),this.invoices.prefetch()}resetView(){this.clearSupplier(),this.activeTab=S.Invoices,this.decisionLoaded=!1,this.invoices.invalidate(),this.quotes.invalidate(),this.refi.invalidate(),this.vendors.invalidate()}}},88917:(e,t,n)=>{"use strict";n.d(t,{GO:()=>u,lJ:()=>m});var o=n(82997),r=n(2745),a=n(80608),l=n(67869),i=n(58876),s=n(92349);const c={totalDueSum:0,totalDueInvoices:0,availableCredit:0,creditLimit:0,outstandingCredit:0,downPaymentPercentage:0};class d{constructor(){this.vendorId=null,this.singleSupplier=null,this.isMobile=!1,this.isFactoring=!1,this.initialRoute=null,this.isLoading=!1,this.isStatisticsLoading=!1,this.dataLoaded=!1,this.suppliersInfoLoadedAt=null,this.cachedSuppliersCount=0,this.cachedSupplier=null,this.request=void 0,this.vendorsLength=0,this.page=1,this.sortColumn="",this.sortDirection="",this.vendorsStatistics=c,this.tableData={items:[],count:0},this.filter={search:""},this.currentVendor={id:"",supplierName:"",supplierPhone:"",supplierIsInvited:!1},(0,r.makeAutoObservable)(this)}setVendor(e,t,n,o){this.vendorId=e,this.currentVendor={id:e,supplierName:t,supplierPhone:n,supplierIsInvited:o}}setIsFactoring(e,t){this.isFactoring=e&&t}setIsMobile(e){this.isMobile=e}resetVendor(){this.currentVendor={id:"",supplierName:"",supplierPhone:"",supplierIsInvited:!1},this.vendorsStatistics=c}resetSort(){this.sortColumn=i.j7.CREATED_AT,this.sortDirection=s.j.DESC}resetFilter(){this.filter={search:""},this.resetSort(),this.page=1}resetDataLoaded(){this.dataLoaded=!1,this.vendorsLength=0,this.singleSupplier=null,this.initialRoute=null}setPage(e){this.page=e,this.callApi()}setSort(e,t){this.sortColumn=e,this.sortDirection=t,this.callApi()}setFilter(e){this.filter=e,this.callApi()}callApi(){this.isLoading=!0,o.JZ.rN.vendorsList({...this.filter,page:this.page,pageSize:a.md,sortColumn:this.sortColumn,sortDirection:this.sortDirection}).then((e=>{(0,r.runInAction)((()=>{e.items.length||1===this.page?this.tableData={items:e.items,count:e.count}:this.setPage(1)}))})).catch((e=>console.log(e))).finally((()=>(0,r.runInAction)((()=>this.isLoading=!1))))}fetchStatisticsData(){this.isStatisticsLoading=!0,this.isFactoring&&o.JZ.QN.inHouseCreditInfo({supplierId:this.vendorId}).then((e=>(0,r.runInAction)((()=>{this.vendorsStatistics.availableCredit=e.totalAvailableCredit,this.vendorsStatistics.creditLimit=e.totalCreditLimit,this.vendorsStatistics.outstandingCredit=e.totalOutstandingCredit})))).catch((e=>console.log(e))),this.currentVendor?o.JZ.rN.invoicesVendorsStatistics({supplierId:this.vendorId,supplierIsInv
1ited:this.currentVendor.supplierIsInvited||void 0}).then((e=>(0,r.runInAction)((()=>{this.vendorsStatistics.totalDueInvoices=e.totalDueInvoices||0,this.vendorsStatistics.totalDueSum=e.totalDueSum||0,this.vendorsStatistics.downPaymentPercentage=e.downPaymentPercentage||0})))).catch((e=>console.log(e))).finally((()=>(0,r.runInAction)((()=>this.isStatisticsLoading=!1)))):(this.vendorsStatistics.totalDueInvoices=0,this.vendorsStatistics.totalDueSum=0,this.isStatisticsLoading=!1)}async loadSuppliersInfo(){if(null!==this.suppliersInfoLoadedAt&&Date.now()-this.suppliersInfoLoadedAt<=3e4)this.applySuppliersInfo(this.cachedSuppliersCount,this.cachedSupplier);else{this.isLoading=!0;try{const{count:e,supplier:t}=await o.Vv.z7.suppliersInfo();(0,r.runInAction)((()=>{this.cachedSuppliersCount=e,this.cachedSupplier=null!==t&&void 0!==t?t:null,this.suppliersInfoLoadedAt=Date.now(),this.applySuppliersInfo(e,null!==t&&void 0!==t?t:null),this.isLoading=!1}))}catch(e){(0,r.runInAction)((()=>{this.applySuppliersInfo(0,null),this.isLoading=!1})),console.log(e)}}}applySuppliersInfo(e,t){this.vendorsLength=e,this.singleSupplier=t,this.initialRoute=1!==e||this.isMobile?l.f0.Console.Payables.home:l.f0.Console.Payables.Vendor,this.dataLoaded=!0}refreshData(){this.fetchStatisticsData()}}const u=new d,m=new d},39001:(e,t,n)=>{"use strict";n.d(t,{BT:()=>o.BT,ej:()=>a,iA:()=>o.iA});var o=n(58876),r=function(e){return e.All="All Status",e.Paid="Paid",e.PaymentProcessing="Payment Processing",e.Due="Due",e.PastDue="Past Due",e.Authorized="Authorized",e.Invoiced="Invoiced",e.CreditApplied="Credit Applied",e.Cancelled="Cancelled",e.Expired="Expired",e.InvoiceRejected="Invoice Rejected",e.Placed="Placed",e.Seen="Seen",e.ReviewRequired="Review Required",e.TermsRequested="Terms Requested",e.Refinanced="Refinanced",e.AuthorizationInReview="Authorization in Review",e.ApplicationProcessing="Trade Credit Request Submitted",e.ApplicationCanceled="Application Cancelled",e.PendingDisbursement="Pending Disbursement",e.Failed="Failed",e.PaymentError="Payment Error",e.Collected="Collected",e.Dismissed="Dismissed",e}(r||{});const a=[{label:r.All,value:""},{label:r.Due,value:o.uR.due},{label:r.PastDue,value:o.uR.pastDue},{label:r.Placed,value:o.uR.placed},{label:r.Paid,value:o.uR.paid},{label:r.PaymentProcessing,value:o.uR.paymentProcessing},{label:r.ApplicationProcessing,value:o.uR.applicationProcessing},{label:r.Authorized,value:o.uR.authorized},{label:r.Invoiced,value:o.uR.invoiced},{label:r.CreditApplied,value:o.uR.creditApplied},{label:r.Cancelled,value:o.uR.cancelled},{label:r.Expired,value:o.uR.expired},{label:r.InvoiceRejected,value:o.uR.rejected},{label:r.AuthorizationInReview,value:o.uR.authorizationInReview},{label:r.Failed,value:o.uR.paymentFailed},{label:r.Collected,value:o.uR.collected},{label:r.ApplicationCanceled,value:o.uR.applicationCancelled},{label:r.ReviewRequired,value:o.uR.reviewRequired},{label:r.TermsRequested,value:o.uR.termsRequested},{label:r.Refinanced,value:o.uR.refinanced}]},53941:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var o=n(50016);const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:575;const[t,n]=(0,o.useState)(window.innerWidth<=e),r=(0,o.useCallback)((()=>{n(window.innerWidth<=e)}),[e]);return(0,o.useEffect)((()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)})),[r]),t}},73413:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n(50016),r=n(64565);const a=()=>{const e=(0,r.V1)();return(0,o.useCallback)((()=>null===e||void 0===e?void 0:e.markDataStale()),[e])}},74930:(e,t,n)=>{"use strict";n.d(t,{Q:()=>N});var o=n(50016),r=n(97219),a=n(70764),l=n(51599),i=n(56480),s=n(31378),c=n(4557),d=n(47450),u=n(29731),m=n(82997),p=n(61699),g=n(48697),h=n(2252),v=n(73819),y=n(25183),b=n(82345),f=n(13459),E=n(32260),C=n(67869),A=n(15137),S=n(61884),w=function(e){return e[e.None=0]="None",e[e.PickProject=1]="PickProject",e}(w||{});const P=e=>{let{invoiceId:t,projectId:n,projectAddress:r,className:a}=e;const{t:l}=(0,u.Bd)("global"),i=(0,b.useNavigation)(),s=(0,f.jE)(),[d,m]=(0,o.useState)(w.None);return o.createElement(o.Fragment,null,n?o.createElement(y.m,{label:r,disabled:!r},o.createElement(c.$,{className:a,variant:"default",leftSection:o.createElement(S.A,{size:16}),onClick:()=>i.navigate(C.f0.Console.Projects._self,{screen:C.f0.Console.Projects.Details,params:{projectId:n,fromInvoiceId:t}})},l("payables.invoiceCard.viewProject"))):o.createElement(c.$,{className:a,variant:"default",leftSection:o.createElement(S.A,{size:16}),onClick:()=>m(w.PickProject)},l("payables.invoiceCard.addToProject")),d===w.PickProject&&o.createElement(A.f,{invoiceId:t,onClose:()=>m(w.None),onAdded:()=>{s.invalidateQueries({queryKey:E.o.paymentDetails({id:t}).queryKey}),m(w.None)},onCreateNew:()=>{m(w.None),i.navigate(C.f0.Console.Payables.NewProject,{ids:t})}}))},I="InvoiceDetailsCard_divider__HHOAL",x="InvoiceDetailsCard_eyebrow__xNWQY",D="InvoiceDetailsCard_label__NFTc8",T="InvoiceDetailsCard_value__ZEA-U",k="InvoiceDetailsCard_vendorName__4FY7j",B="InvoiceDetailsCard_amount__Hi3lp",F="InvoiceDetailsCard_footerButton__Bwmdq";var _=n(34956);const N=e=>{let{supplier:t,invoice:n,onViewAttachment:y,withProjects:b}=e;const{t:f}=(0,u.Bd)("global"),E=(0,_.kU)(),C=n.type===m.tD.QUOTE,A=b&&!E&&!C,{status:S,amountDue:w,invoiceNumber:T,dueDate:N,addressType:M,address:O,attention:z,hasAttachment:j}=n,W=L(M,O,z,f);return o.createElement(r.Z,{shadow:"xs"},o.createElement(a.B,{gap:32},o.createElement(a.B,{gap:20},o.createElement(l.Y,{justify:"space-between",align:"flex-start",wrap:"nowrap"},o.createElement(a.B,{gap:12},o.createElement(i.E,{className:x},f("payables.invoiceCard.vendor")),o.createElement(i.E,{className:k},t.name)),o.createElement(a.B,{gap:12,align:"flex-end"},o.createElement(h.p,{status:S}),o.createElement(v.x1,{phone:t.phone}))),o.createElement(s.c,{className:I}),o.createElement(a.B,{gap:8},o.createElement(i.E,{className:D},f("payables.invoiceCard.totalAmountDue")),o.createElement(i.E,{className:B},(0,p.zQ)(w))),o.createElement(s.c,{className:I}),o.createElement(l.Y,{gap:18,align:"flex-start",wrap:"nowrap",grow:!0},o.createElement(R,{label:f(n.type===m.tD.QUOTE?"payables.invoiceCard.quoteNumber":"payables.invoiceCard.invoiceNumber"),value:T}),n.quoteNumber&&o.createElement(R,{label:f("payables.invoiceCard.quoteNumber"),value:n.quoteNumber}),N&&o.createElement(R,{label:f("payables.invoiceCard.dueDate"),value:(0,g.Y)(N)}),W.length>0&&o.createElement(a.B,{gap:12},W.map((e=>o.createElement(R,{key:e.label,label:e.label,value:e.value})))))),(A||j)&&o.createElement(l.Y,{gap:12},j&&o.createElement(c.$,{className:F,variant:"default",leftSection:o.createElement(d.A,{size:16}),onClick:y},f("payables.invoiceCard.viewAttachment")),A&&o.createElement(P,{invoiceId:n.id,projectId:n.projectId,projectAddress:n.projectAddress,className:F}))))},R=e=>{let{label:t,value:n}=e;return o.createElement(a.B,{gap:8},o.createElement(i.E,{className:D},t),!!n&&o.createElement(i.E,{className:T},n))},L=(e,t,n,o)=>{switch(e){case m.nT.DELIVERY:{const e=[{label:o("payables.invoiceCard.deliverTo"),value:null!==t&&void 0!==t?t:void 0}];return n&&e.push({label:o("payables.invoiceCard.attentionTo"),value:n}),e}case m.nT.PICKUP:return[{label:o("payables.invoiceCard.pickUp")}];case m.nT.SERVICE:return[{label:o("payables.invoiceCard.service")}];default:return[]}}},96057:(e,t,n)=>{"use strict";n.d(t,{V:()=>c});
1var o=n(41436),r=n(70764),a=n(56480),l=n(73819),i=n(50016),s=n(29731);const c=e=>{let{children:t,...n}=e;const{t:c}=(0,s.Bd)("global");return i.createElement(o.o,Object.assign({mt:48},n),i.createElement(r.B,{align:"center"},i.createElement(l.aC,null),null!==t&&void 0!==t?t:i.createElement(a.E,null,c("payables.payment.loadingInvoice"))))}},15137:(e,t,n)=>{"use strict";n.d(t,{f:()=>D});var o=n(50016),r=n(70764),a=n(22899),l=n(41436),i=n(56480),s=n(18529),c=n(50767),d=n(51599),u=n(69267),m=n(4557),p=n(19003),g=n(55816),h=n(29731),v=n(12344),y=n(76448),b=n(31612),f=n(82997),E=n(24574),C=n(73819);const A="ProjectPickerModal_row__nYhLD",S="ProjectPickerModal_labelWrapper__61yGu",w="ProjectPickerModal_label__pQVLL",P="ProjectPickerModal_optionLabel__yNyWP",I="ProjectPickerModal_suggestedBadge__p-UZ7",x="ProjectPickerModal_emptyText__6gIZe",D=e=>{var t;let{invoiceId:n,onClose:D,onAdded:T,onCreateNew:k}=e;const{t:B}=(0,h.Bd)("global"),[F,_]=(0,o.useState)(""),[N]=(0,p.o)(F,300),[R,L]=(0,o.useState)(""),{data:M,isPending:O}=(0,v.I)(E.c.linkCandidates({invoiceId:n,search:N||void 0})),{mutate:z,isPending:j}=(0,y.n)({mutationFn:e=>f.Vv.Cv.addInvoices(e,{invoices:[n]}),onSuccess:()=>{b.$e.show({variant:"info",message:B("payables.modals.projectPicker.addedToProject")}),T()},onError:e=>b.$e.show({variant:"error",message:null===e||void 0===e?void 0:e.message})}),W=null!==(t=null===M||void 0===M?void 0:M.items)&&void 0!==t?t:[],V=N.trim().length>0,H=!O&&0===W.length;return o.createElement(C.Vm,{title:B("payables.modals.projectPicker.title"),isSubmitting:j,mih:"min(480px, 100vh)",onClose:D},o.createElement(C.Vm.Content,null,o.createElement(r.B,{gap:16},o.createElement(a.k,{"data-autofocus":!0,leftSection:o.createElement(g.A,{size:16}),placeholder:B("payables.modals.projectPicker.searchPlaceholder"),value:F,onChange:e=>_(e.currentTarget.value)}),O?o.createElement(l.o,{py:40},o.createElement(C.aC,null)):H?o.createElement(r.B,{align:"center",gap:16,py:40},o.createElement(C.GQ,{type:"info"}),o.createElement(i.E,{px:32,className:x},B(V?"payables.modals.projectPicker.noProjects":"payables.modals.projectPicker.noProjectsHint"))):o.createElement(s.s.Group,{value:R,onChange:L},o.createElement(r.B,{gap:4},W.map((e=>{const t=("string"===typeof e.address?e.address.trim():"")||e.name||B("payables.modals.projectPicker.untitled"),n=e.matchScore>=.1;return o.createElement(c.a,{key:e._id,className:A,onClick:()=>!j&&L(e._id)},o.createElement(s.s,{value:e._id,disabled:j,classNames:{labelWrapper:S,label:w},label:o.createElement(d.Y,{className:P},o.createElement(i.E,null,t),n&&o.createElement(u.E,{color:"green",className:I},B("payables.modals.projectPicker.suggested")))}))})))))),o.createElement(C.Vm.Buttons,null,o.createElement(m.$,{variant:"default",mr:"auto",disabled:j,onClick:k},B("payables.modals.projectPicker.createNew")),o.createElement(m.$,{miw:150,disabled:!R,loading:j,onClick:()=>R&&z(R)},B("payables.modals.projectPicker.select"))))}},14945:(e,t,n)=>{"use strict";n.d(t,{xI:()=>yn,d2:()=>vn,NK:()=>hn,Nk:()=>gn,cS:()=>pn,Qi:()=>mn});var o=n(50016),r=n(67869),a=n(50767),l=n(56480),i=n(60563),s=n(29731),c=n(82345),d=n(73819),u=n(10972);const m="InvoicePaymentShell_content__346Qw",p="InvoicePaymentShell_consoleRoot__6aQty",g="InvoicePaymentShell_desktopRoot__4Bd4w",h="InvoicePaymentShell_consoleScroll__3KJQD",v="InvoicePaymentShell_footer__jYOdr",y="InvoicePaymentShell_desktopContent__FmGwW",b="InvoicePaymentShell_goBack__UDp6v",f="InvoicePaymentShell_header__bid+R",E="InvoicePaymentShell_back__AcxEr",C="InvoicePaymentShell_headerTitle__9uwjf";var A=n(34956);const S=e=>{let{children:t,footer:n,title:S}=e;const{t:w}=(0,s.Bd)("global"),P=(0,c.useNavigation)(),I=()=>{P.canGoBack()?P.goBack():P.replace(r.f0.Home._self,{screen:r.f0.Console.Payables._self,params:{screen:r.f0.Console.Payables.home}})};return(0,A.kU)()?o.createElement(a.a,{className:p},o.createElement(a.a,{className:f},o.createElement(u.$,{type:"back",className:E,onClick:I}),o.createElement(l.E,{className:C},null!==S&&void 0!==S?S:w("payables.payment.paymentDetailsTitle"))),o.createElement(i.F,{className:h},o.createElement(a.a,{className:m},t)),!!n&&o.createElement(a.a,{className:v},n)):o.createElement(a.a,{className:g},o.createElement(i.F,{className:h},o.createElement(a.a,{className:"".concat(m," ").concat(y)},o.createElement(d.i2,{className:b,onClick:I}),t)),!!n&&o.createElement(a.a,{className:v},n))};var w=n(76333);const P=e=>
1{let{children:t,footer:n}=e;const l=(0,c.useNavigation)();return o.createElement(w.w,{onClose:()=>l.navigate(r.f0.Home._self),footer:n},o.createElement(a.a,{className:m},t))};var I=n(63680),x=n(70764),D=n(12344),T=n(82997),k=n(58876),B=n(32260),F=n(97976),_=n(19925),N=n(45143),R=n(13673),L=n(48321);function M(e){var t;let{invoice:n,invoiceIds:r,selectedInvoices:a,status:l="",navigation:i,route:s,setLoading:c=(()=>{}),onOpenPaymentFlow:d}=e;const u=(0,F.P)(),{sm:m}=(0,_.Qs)(),p=u.userStore.settings.get("previouslyApproved"),{setPayAndSubmitApplication:g,shouldReconnectBank:h}=N.Ay,{takeUserToCreditApp:v,setResumeApplyingForLoan:y,groupedInvoiceProjectNavigation:b,singleInvoiceNavigation:f,setReconnectCreditBank:E,setGroupedInvoiceProjectWarning:C}=R.A,A=u.userStore.shouldSelectPurchaseType&&(r?!(null===a||void 0===a||!a.length)&&L.Ay.isProjectMissingOnAllInvoices(a):!(null!==n&&void 0!==n&&n.project_id)),S=(0,o.useCallback)((e=>{g(!1),d(e)}),[g,d]),w=(0,o.useCallback)((()=>{var e;([k.r7.APPROVED,k.r7.AUTHORIZED,k.r7.PROCESSING].some((e=>e===l))||l===k.r7.CANCELED&&p)&&!(null===(e=u.userStore.credit)||void 0===e||!e.LoCnumber)?S({requirePurchaseType:!1}):v(c,s,i,n,r)}),[l,p,null===(t=u.userStore.credit)||void 0===t?void 0:t.LoCnumber,S,v,c,s,i,n,r]),P=(0,o.useCallback)((()=>{r?b(a):f(n,m,i)}),[r,b,f,m,a,n,i]);return{resumeCreditApplication:(0,o.useCallback)((()=>{y(w),h&&!["",k.r7.NEW].includes(l)?E(!0):u.userStore.shouldSelectPurchaseType?A?S():r&&null!==a&&void 0!==a&&a.length&&!L.Ay.areInvoicesFromSameProject(a)?C(!0):w():u.userStore.isPurchaseForProject?P():w()}),[l,r,a,A,u.userStore.isPurchaseForProject,u.userStore.shouldSelectPurchaseType,w,y,P,S,C,E,h]),projectFlow:P}}function O(e,t){return{_id:e.id,invoice_number:e.invoiceNumber,invoice_due_date:e.dueDate,type:e.type,status:e.pastDue?k.uR.pastDue:k.uR.placed,total_amount:e.amountDue,achDiscount:e.achDiscount,quoteId:!1,invoice_document:e.hasAttachment,supplierInvitationDetails:!1,company:{name:t.name,phone:t.phone}}}var z=n(32572),j=n(78267),W=n(38117),V=n(7371),H=n(23049);const U=()=>{const{t:e}=(0,s.Bd)("global"),{sm:t}=(0,_.Qs)(),{setReconnectCreditBank:n}=R.A;return o.createElement(V.A,{style:{height:t?80:70,padding:t?22:17,borderBottomColor:"#EBEEEF",borderBottomWidth:1,flexDirection:"row",justifyContent:"space-between"}},o.createElement(H.Ay,{name:"close",color:"#003353",size:14,style:{backgroundColor:"#F5F7F8",padding:10,alignItems:"center",justifyContent:"center",borderRadius:5},onPress:()=>n(!1),testID:"close"}),o.createElement(W.A,{style:{alignSelf:"center",fontWeight:"600",fontSize:t?20:15}},e("ConnectBankWithPlaid.header")),o.createElement(V.A,null))};var G=n(93018),Y=n(78573),Q=n(14329),q=n(76036),K=n(5438),J=n(2745),Z=n(20282),X=n(38767),$=n(91855),ee=n(61390);const te=(0,K.PA)((e=>{let{recheckConditionsBeforeApplyingCredit:t}=e;const{t:n}=(0,s.Bd)("global"),{sm:r}=(0,_.Qs)(),{reconnectCreditBank:a,setReconnectCreditBank:l}=R.A,{onlineConnectedBanks:i}=F.A.screensStore.paymentMethodsStore,c=F.A.userStore.document,d=(0,o.useRef)(null),[u,m]=(0,o.useState)(!1),[p,g]=(0,o.useState)(null),[h,v]=(0,o.useState)(""),y=i.filter((e=>e.connectionType===k.FP.PLAID)),b=(0,o.useMemo)((()=>p&&p.connectionType===k.FP.PLAID),[p]),f=F.A.userStore.isAuthenticated;(0,o.useEffect)((()=>{f&&a&&F.A.userStore.fetchDocument(ee.X.Credit)}),[f,a]);const E=o.createElement(Q.BtButton,{onPress:()=>{var e;return null===(e=d.current)||void 0===e?void 0:e.createToken()},loading:u&&!h,appearance:"outline",disabled:F.A.isBusy},n("ConnectBankWithPlaid.connect-bank-account")),C=e=>{var t;if(e.isExpiredPlaidBank)v(e._id),null===(t=d.current)||void 0===t||t.createToken(e._id);else if(e.isDisconnectedPlaidBank){var n;null===(n=d.current)||void 0===n||n.createToken("",e.routingNumber)}else g(e)};return a?o.createElement($.A,{style:{flex:1,margin:0,backgroundColor:"white"},visible:a,onClose:()=>{},animationIn:"zoomIn",coverScreen:!0},o.createElement(U,null),o.createElement(z.A,{style:(0,X.composeStyle)({alignSelf:"center"},r?{maxWidth:670}:{width:"100%",padding:20})},o.createElement(W.A,{style:ne.message1Desktop},n("ConnectBankWithPlaid.reconnect-all-banks")),o.createElement(G.W,null),null!==y&&void 0!==y&&y.length?o.createElement(o.Fragment,null,o.createElement(W.A,{style:{fontWeight:"600",fontSize:r?24:20,lineHeight:r?36:30,marginTop:40}},n("ConnectBankWithPlaid.banks-connected")),o.createElement(W.A,{style:(0,X.composeStyle)(ne.connectedText,{fontSize:r?18:16})},n("ConnectBankWithPlaid.connected-accounts-shown-below")),o.createElement(W.A,{style:(0,X.composeStyle)(ne.selectPrimaryText,{fontSize:r?18:16})},n("ConnectBankWithPlaid.select-primary-for-loan-payment")),o.createElement(V.A,{style:{flexDirection:r?"row":"column"}},y.map((e=>{var t;return o.createElement(V.A,{style:{flexDirection:"column"},key:e._id},o.createElement(q.L,{bankAccount:e,selectedBankAccountId:null!==(t=null===p||void 0===p?void 0:p._id)&&void 0!==t?t:"",onPress:C,loadingBankId:h,showDisconnectedBadge:!0}),(null===p||void 0===p?void 0:p._id)===e.id&&o.createElement(W.A,{style:{fontWeight:"400",fontSize:12,color:"#668598",marginTop:10}},n("ConnectBankWithPlaid.selected-as-primary")),!r&&o.createElement(Z.hK,{height:20}))}))),o.createElement(V.A,{style:{height:1,borderRadius:2,width:"100%",backgroundColor:"#CCD6DD",marginTop:r?30:15}}),o.createElement(W.A,{style:{fontWeight:"600",fontSize:r?24:20,lineHeight:36,marginTop:r?20:10}},n("ConnectBankWithPlaid.or-connect-new-bank")),o.createElement(Z.hK,{height:r?30:25}),E):o.createElement(o.Fragment,null,o.createElement(W.A,{style:(0,X.composeStyle)(ne.message2,!r&&ne.mobileMessage2)},n("ConnectBankWithPlaid.connect-accounts")),o.createElement(W.A,{style:(0,X.composeStyle)(ne.message3,!r&&ne.mobileMessage3)},n("ConnectBankWithPlaid.to-review-business-cashflow")),E),o.createElement(Y.R,{ref:d,setLoa
1ding:m,onConnectSuccess:()=>{h&&v("")}}),o.createElement(Q.BtButton,{style:{width:133,alignSelf:"flex-end",marginTop:30},onPress:()=>{if(p&&c){const e=(0,J.toJS)(T.c2.create({...(0,J.toJS)(p),isPrimaryForCredit:!0}));T.JZ.QN.addBankAccount(e).then((async()=>{c.setData("details",e,"","bank","BankDetails",!0),await F.A.screensStore.paymentMethodsStore.fetchPaymentMethods(),l(!1),t()}))}},disabled:!b||F.A.isBusy},n("ConnectBankWithPlaid.continue-button")))):null})),ne=j.A.create({message1Desktop:{fontWeight:"700",fontSize:18,lineHeight:28,alignSelf:"center",marginTop:25,textAlign:"center"},message2:{fontWeight:"600",fontSize:24,marginTop:40,lineHeight:48},mobileMessage2:{fontSize:20,lineHeight:30},message3:{fontWeight:"500",fontSize:18,color:"#626D75",lineHeight:30,marginBottom:30},mobileMessage3:{fontSize:16,lineHeight:28},selectPrimaryText:{fontWeight:"600",fontSize:18,marginBottom:35},connectedText:{fontWeight:"500",fontSize:18,lineHeight:30,color:"#626D75",marginBottom:20}});var oe=n(13459),re=n(18529),ae=n(4557);const le="PurchaseTypeModal_row__7IP1B",ie=[{value:k.P_.INVENTORY,labelKey:"SelectPurchaseType.inventory"},{value:k.P_.PROJECT,labelKey:"SelectPurchaseType.specific-project"}],se=e=>{let{value:t,onChange:n,onContinue:r,onClose:l}=e;const{t:i}=(0,s.Bd)("global");return o.createElement(d.Vm,{title:i("SelectPurchaseType.title"),size:400,onClose:l},o.createElement(d.Vm.Content,null,o.createElement(re.s.Group,{value:null!==t&&void 0!==t?t:"",onChange:e=>n(e)},o.createElement(x.B,{gap:4},ie.map((e=>o.createElement(a.a,{key:e.value,className:le,onClick:()=>n(e.value)},o.createElement(re.s,{value:e.value,label:i(e.labelKey)}))))))),o.createElement(d.Vm.Buttons,null,o.createElement(ae.$,{disabled:!t,onClick:r,"data-test-id":"purchase-type-modal-continue-button"},i("DownPaymentModal.continue"))))};var ce=n(65700),de=n(88634),ue=n(49757),me=n(97076),pe=n(38146);const ge=(0,I.PA)((e=>{let{builderCreatedInvoice:t,navigation:n,companyName:a}=e;const{addProjectSuccessModalVisibility:l,setAddProjectSuccessModalVisibility:i,selectedProject:c}=(0,ue.cS)(),{t:d}=(0,s.Bd)("global"),{md:u}=(0,_.Qs)();return o.createElement(pe.s,{visible:l,onDismiss:()=>{i(!1),n.navigate(r.f0.Console.Payables.home)},title:d("AddedToProjectAlert.title"),icon:o.createElement(me.F3K,{style:{width:108,height:108}}),message:t?o.createElement(s.x6,{t:d,i18nKey:"AddedToProjectAlert.for-uploaded-invoice",values:{projectName:c.name},components:{styled:o.createElement(W.A,{style:{fontWeight:"600"}}),simple:o.createElement(W.A,null)}}):o.createElement(s.x6,{t:d,i18nKey:"AddedToProjectAlert.for-received-invoice",values:{companyName:a,projectName:c.name},components:{styled:o.createElement(W.A,{style:{fontWeight:"600"}}),simple:o.createElement(W.A,null)}}),buttonData:{title:"View Project",contentStyle:{width:"100%"},style:{width:"90%"},onPress:()=>{i(!1),u?n.navigate(r.f0.Console.Projects._self,{screen:r.f0.Console.Projects.Details,params:{project:c}}):n.navigate(r.f0.Console.More._self,{screen:r.f0.Console.Projects._self,params:{screen:r.f0.Console.Projects.Details,params:{project:c}}})}}})})),he=e=>{let{onClose:t}=e;const{t:n}=(0,s.Bd)("global");return o.createElement(d.HD,{icon:o.createElement(me.F3K,null),title:n("CreditApplication.submit-success-messages.with-invoice-previously-approved.title"),buttons:[n("CreditApplication.submit-success-messages.confirmButton")],testId:"DrawCreated.SuccessModal",onClose:t},n("CreditApplication.submit-success-messages.with-invoice-previously-approved.message"))};var ve=n(63288),ye=n(89199),be=n(73413),fe=function(e){return e[e.PurchaseType=0]="PurchaseType",e[e.PaymentPlan=1]="PaymentPlan",e[e.DownPayment=2]="DownPayment",e[e.Pay=3]="Pay",e[e.Success=4]="Success",e}(fe||{});const Ee=e=>{var t;let{invoices:n,paymentOptions:a,loadingPaymentOptions:l,notifySuccess:i=!0,requirePurchaseType:c,onSelectProject:d,navigation:u,onClose:m}=e;const{t:p}=(0,s.Bd)("global"),{userStore:g}=(0,F.P)(),h=(0,oe.jE)(),v=(0,be.Q)(),y=(0,o.useMemo)((()=>n.map((e=>e._id)).filter(Boolean)),[n]),b=null!==c&&void 0!==c?c:g.shouldSelectPurchaseType&&n.length>0&&n.every((e=>!e.project_id)),{step:f,goTo:E,goNext:C,goBack:S}=(0,A.qM)(fe,{initialStep:b?fe.PurchaseType:fe.PaymentPlan}),[w,P]=(0,o.useState)(null),[I,x]=(0,o.useState)(null),[D,T]=(0,o.useState)(null),_=()=>
1{v(),y.forEach((e=>{h.invalidateQueries(B.o.paymentDetails({id:e}))})),h.invalidateQueries({queryKey:[B.o.all[0],"unpaidSupplierInvoices"]})},N=null===a||void 0===a||null===(t=a.downPaymentSettings)||void 0===t?void 0:t.isRequired;return l&&f!==fe.PurchaseType?o.createElement(ye.C,{text:p("CreditApplication.LoadingPlans"),onClose:m}):o.createElement(o.Fragment,null,f===fe.PurchaseType&&o.createElement(se,{value:w,onChange:P,onClose:m,onContinue:()=>{w===k.P_.INVENTORY?E(fe.PaymentPlan):w===k.P_.PROJECT&&(null===d||void 0===d||d(),m())}}),f===fe.PaymentPlan&&a&&o.createElement(ce.N,{paymentOptions:a,selectedPlan:I,onChange:x,onContinue:()=>{E(N?fe.DownPayment:fe.Pay)},onClose:m}),f===fe.DownPayment&&a&&I&&o.createElement(de.k,{downPayment:I.downPayment,paymentMethod:D,onChange:T,onContinue:C,onBack:S,onClose:m}),f===fe.Pay&&a&&I&&o.createElement(ve.I,{paymentPlan:I,downPayment:D,paymentOptions:a,invoiceIds:y,navigation:u,onBack:()=>{E(N?fe.DownPayment:fe.PaymentPlan)},onClose:m,onSuccess:()=>{_(),i?E(fe.Success):m()}}),f===fe.Success&&o.createElement(he,{onClose:()=>{g.fetchDocument(ee.X.Credit),u.replace(r.f0.Console._self)}}))};var Ce=n(74930),Ae=n(97219);const Se="InvoiceStatusCard_title__4N7l-",we="InvoiceStatusCard_subtitle__tRpwM",Pe=e=>{let{icon:t,title:n,subtitle:r,children:a}=e;return o.createElement(Ae.Z,{shadow:"xs"},o.createElement(x.B,{gap:32,align:"center"},t,o.createElement(x.B,{gap:8,align:"center"},o.createElement(l.E,{className:Se},n),r&&o.createElement(l.E,{className:we},r)),a))};var Ie=n(31378),xe=n(12276),De=n(75488),Te=n(50180),ke=n(61699);let Be=function(e){return e.SupplierOptedOut="supplierOptedOut",e.BelowMinAmount="belowMinAmount",e}({});const Fe=(0,I.PA)((e=>{let{invoiceIds:t,totalAmount:n,loanAppStatus:a="",canExtendTerms:i,navigation:u,setModal:m,onPress:p,disabled:g,creditBlockReason:h}=e;const{t:v}=(0,s.Bd)(),{remoteConfig:y}=(0,F.P)(),b=(0,c.useRoute)(),f=(0,A.mu)(),E=k.Vi.some((e=>e===a)),C=k.$D.some((e=>e===a)),S=n<y.minCreditAmount,w=i?void 0:S?Be.BelowMinAmount:h,[P,I]=(0,o.useState)(!1),x=i?v("payWithCreditButton.app-processing"):w===Be.BelowMinAmount?o.createElement(l.E,{c:d.FU.red,fw:600},v("payables.payment.regular.credit.minAmount",{amount:(0,ke.zQ)(y.minCreditAmount)})):w===Be.SupplierOptedOut?o.createElement(l.E,{c:d.FU.red,fw:600},v("payables.payment.regular.credit.supplierOptedOut")):v("payables.payment.regular.credit.noFees"),D=f.loading||g||C&&!i||E||!!w;return o.createElement(o.Fragment,null,o.createElement(De.y,{title:v(C?i?"payWithCreditButton.update-terms":"payWithCreditButton.app-processing":"payables.payment.regular.credit.pay"),subtitle:x,disabled:D,leftIcon:D?o.createElement(me.OM8,null):o.createElement(me.IiJ,null),rightIcon:D?null:o.createElement(Te.h,{type:C&&i?"update":"pay"}),onClick:()=>{if(m&&m(!1),i)return void I(!0);if(p)return void p();const e=(0,r.oh)((0,r.wl)("Console.Credit.CreditApplication"));u.navigate(e.name,e.params)}}),P&&o.createElement(xe.R,{invoiceId:t[0],onClose:()=>I(!1),onComplete:()=>{I(!1),u.replace(b.name,b.params)}}))}));var _e=n(97009),Ne=n(87053),Re=n(86277),Le=n(39797),Me=function(e){return e[e.None=0]="None",e[e.AddCard=1]="AddCard",e[e.AddBank=2]="AddBank",e}(Me||{});const Oe=e=>{let{withCards:t,withBanks:n}=e;const{t:r}=(0,s.Bd)("global"),[a,l]=(0,o.useState)(Me.None);return o.createElement(o.Fragment,null,o.createElement(x.B,{gap:16},n&&o.createElement(De.y,{leftIcon:o.createElement(Le.$,{type:"bank"}),title:r("ConnectYourBank"),subtitle:r("ConnectionsAreEncrypted"),onClick:()=>l(Me.AddBank)}),t&&o.createElement(De.y,{leftIcon:o.createElement(Le.$,{type:"card"}),title:r("LinkYourCard"),subtitle:r("CardDetailsAreTokenized"),onClick:()=>l(Me.AddCard)})),a===Me.AddBank&&o.createElement(Re.j,{onClose:()=>l(Me.None),onSuccess:()=>l(Me.None),onFinish:()=>l(Me.None)}),a===Me.AddCard&&o.createElement(Ne.v,{onClose:()=>l(Me.None),onSuccess:()=>l(Me.None)}))};var ze=n(51599),je=n(31681);const We="AchDiscountBanner_alert__NWDZs",Ve="AchDiscountBanner_icon__FuakT",He="AchDiscountBanner_text__b4-eR",Ue=e=>{let{single:t}=e;const{t:n}=(0,s.Bd)("global");return o.createElement(ze.Y,{className:We,gap:8,align:"center",wrap:"nowrap"},o.createElement(je.A,{size:16,className:Ve}),o.createElement(l.E,{className:He},n(t?"payables.payment.regular.single.achDiscount":"payables.payment.regular.grouped.achDiscount")))},Ge="RegularPaymentMethodsCard_title__Ny90e",Ye=e=>{let{title:t,children:n}=e;return o.createElement(Ae.Z,{shadow:"xs"},o.createElement(x.B,{gap:24},t&&o.createElement(l.E,{className:Ge},t),o.createElement(x.B,{gap:16},n)))},Qe=(0,I.PA)((e=>{let{invoices:t,loanAppStatusStatus:n,options:r,onApplyCredit:a,onPaySuccess:l,creditDisabled:i,navigation:c,route:d}=e;const{t:u}=(0,s.Bd)("global"),m=(0,A.mu)(),p=m.initialized,g=m.paymentMethods.length>0,h=r.acceptCredit||r.canExtendTerms,v=r.acceptCard||r.acceptAch;return h||v?o.createElement(Ye,{title:v?u("payables.payment.chooseMethodTitle"):void 0},h&&o.createElement(o.Fragment,null,o.createElement(Fe,{invoiceIds:t.map((e=>e._id)),totalAmount:t.reduce(((e,t)=>e+(t.total_amount||0)),0),loanAppStatus:n,canExtendTerms:r.canExtendTerms,creditBlockReason:r.creditBlockReason,onPress:a,navigation:c,disabled:i}),v&&p&&o.createElement(Ie.c,{label:u("payables.payment.orPayNow"),labelPosition:"center",styles:{label:{fontSize:"var(--mantine-font-size-md)"}}})),v&&p&&o.createElement(o.Fragment,null,r.achDiscountEligible&&1===t.length&&o.createElement(Ue,{single:!0}),g?o.createElement(_e.Z,{invoices:t,withBanks:r.acceptAch,withCards:r.acceptCard,autoCloseOnSuccess:!0,navigation:c,route:d,onSuccess:l}):o.createElement(Oe,{withBanks:r.acceptAch,withCards:r.acceptCard}))):null}));var qe=n(62490),Ke=n(74655),Je=n(25104),Ze=n(57368);const Xe="GroupedInvoicesBanner_banner__x8DAT",$e="GroupedInvoicesBanner_body__oIHku",et="GroupedInvoicesBanner_title__Q7HOE",tt="GroupedInvoicesBanner_subtitle__ny9bw",nt="GroupedInvoicesBanner_action__kFKJL",ot=r.f0.Console.Payables.SelectInvoices,rt=e=>{let{count:t,loading:n,invoiceId:r,navigation:i}=e;const{t:c}=(0,s.Bd)("global");return n||t?o.createElement(a.a,{className:Xe},o.createElement(ze.Y,{className:$e},o.createElement(qe.L,{radius:"xl",size:44,variant:"white"},o.createElement(Je.A,{size:24})),o.createElement(x.B,{gap:4},o.createElement(l.E,{className:et},n?c("payables.payment.regular.grouped.titleLoading"):o.createElement(s.x6,{t:c,i18nKey:"payables.payment.regular.grouped.title",values:{count:t},components:{counter:o.createElement(d.pM,null)}})),o.createElement(l.E,{className:tt},c("payables.payment.regular.grouped.subtitle")))),n?o.createElement(Ke.a,{type:"dots"}):o.createElement(ae.$,{disabled:n,className:nt,rightSection:o.createElement(Ze.A,{size:16}),"data-testid":"payables.payment.regular.grouped.payMultiple",onClick:()=>i.navigate(ot,{id:r})},c("payables.payment.regular.grouped.payMultiple"))):null};var at=n(96057);const lt=r.f0.Console.Payables.AttachmentPreview,it=r.f0.Console.Payables.PaymentHistory,st=[k.uR.paid,k.uR.collected,k.uR.paymentPosted,k.uR.paymentProcessing],ct=[k.uR.cancelled,k.uR.dismissed,k.uR.expired],dt=(0,I.PA)((e=>{var t,n,a,i;let{navigation:c,route:d}=e;const{t:u}=(0,s.Bd)("global"),{screensStore:{notificationStore:m}}
1=(0,F.P)(),{paymentMethods:p,fetchPaymentMethods:g}=(0,A.mu)(),h=!!F.A.userStore.settings.get("onboarding"),v=null===d||void 0===d||null===(t=d.params)||void 0===t?void 0:t.id,[y,b]=(0,o.useState)(!1),{data:f,isPending:E,isFetching:C,isError:S}=(0,D.I)(B.o.paymentDetails({id:null!==v&&void 0!==v?v:""},{enabled:!!v})),{data:w,isPending:P,isFetching:I}=(0,D.I)(B.o.unpaidSupplierInvoices({id:null!==v&&void 0!==v?v:""},{enabled:!!v})),_=(0,o.useMemo)((()=>f&&function(e){const{invoice:t,supplier:n}=e;return{_id:t.id,invoice_number:t.invoiceNumber,invoice_due_date:t.dueDate,type:t.type,status:t.status,total_amount:t.totalAmount,achDiscount:t.achDiscount,achPriceResolved:!0,quoteId:!!t.quoteNumber,quote_number:t.quoteNumber,invoice_document:t.hasAttachment,addressType:t.addressType,address:t.address,attention:t.attention,project_id:t.projectId,supplierInvitationDetails:t.isDirectTerms,company:{name:n.name,phone:n.phone}}}(f)),[f]),[N,R]=(0,o.useState)(null),L=(0,o.useCallback)((e=>R(null!==e&&void 0!==e?e:{})),[]),{resumeCreditApplication:O,projectFlow:z}=M({invoice:_,status:null!==(n=null===f||void 0===f?void 0:f.credit.locStatus)&&void 0!==n?n:"",navigation:c,route:d,setLoa
1ding:b,onOpenPaymentFlow:L});if((0,o.useEffect)((()=>{null!==f&&void 0!==f&&f.invoice.isFactoring&&c.replace(it,{id:f.invoice.id})}),[f,c]),(0,o.useEffect)((()=>{p.length||g()}),[g,p.length]),(0,o.useEffect)((()=>{h&&f&&f.invoice.id===v&&T.JZ.Ew.markAsViewed({key:"metadata.invoice_id",value:v,types:[k.fK.invoice,k.fK.quotePlaced],alertTypes:["due","expiring","sent"]}).then((()=>m.fetchNotifications())).catch((e=>console.log(e)))}),[v,f,m,h]),!v||S)return o.createElement(ut,null);if(E||y)return o.createElement(at.V,null);if(!f||!_||f.invoice.isFactoring)return null;const{supplier:j,options:W,credit:V}=f,H=f.invoice.status,U=st.includes(H),G=ct.includes(H),Y=H===k.uR.creditApplied;return o.createElement(o.Fragment,null,o.createElement(x.B,{gap:16},o.createElement(Ce.Q,{supplier:j,invoice:{...f.invoice,amountDue:f.invoice.totalAmount},onViewAttachment:()=>c.navigate(lt,{id:f.invoice.id}),withProjects:!0}),C?o.createElement(at.V,{mt:24},o.createElement(l.E,null,u("payables.payment.loadingPaymentDetails"))):o.createElement(o.Fragment,null,W.hasMoreUnpaidInvoices&&o.createElement(rt,{count:null!==(a=null===w||void 0===w?void 0:w.invoices.length)&&void 0!==a?a:0,loading:I||P,invoiceId:f.invoice.id,navigation:c}),H===k.uR.refinanced?o.createElement(pt,null):G?o.createElement(yt,{status:H}):Y?o.createElement(ht,null):W.paymentProcessing?o.createElement(gt,null):U?o.createElement(mt,null):W.hasDrawApproval&&!W.canExtendTerms?o.createElement(vt,null):o.createElement(Qe,{invoices:[_],loanAppStatusStatus:V.loanAppStatus,options:W,onApplyCredit:O,onPaySuccess:()=>{const e=(0,r.oh)((0,r.wl)("Console.Payables.home"));c.replace(e.name,e.params)},navigation:c,route:d}))),N&&o.createElement(Ee,{invoices:[_],paymentOptions:null!==(i=V.paymentOptions)&&void 0!==i?i:null,requirePurchaseType:N.requirePurchaseType,onSelectProject:z,navigation:c,onClose:()=>R(null)}),o.createElement(te,{recheckConditionsBeforeApplyingCredit:O}))})),ut=()=>{const{t:e}=(0,s.Bd)("global");return o.createElement(Pe,{icon:o.createElement(d.GQ,{type:"alert"}),title:e("payables.payment.statusCards.loadErrorTitle"),subtitle:e("payables.payment.statusCards.loadErrorMessage")})},mt=()=>{const{t:e}=(0,s.Bd)("global");return o.createElement(Pe,{icon:o.createElement(d.GQ,{type:"success"}),title:e("payables.payment.statusCards.paidTitle"),subtitle:e("payables.payment.statusCards.paidSubtitle")})},pt=()=>{const{t:e}=(0,s.Bd)("global");return o.createElement(Pe,{icon:o.createElement(d.GQ,{type:"success"}),title:e("payables.payment.statusCards.refinancedTitle"),subtitle:e("payables.payment.statusCards.refinancedSubtitle")})},gt=()=>{const{t:e}=(0,s.Bd)("global");return o.createElement(Pe,{icon:o.createElement(d.GQ,{type:"info"}),title:e("payables.payment.statusCards.paymentProcessingTitle"),subtitle:e("payables.payment.statusCards.paymentProcessingSubtitle")})},ht=()=>{const{t:e}=(0,s.Bd)("global");return o.createElement(Pe,{icon:o.createElement(d.GQ,{type:"success"}),title:e("payables.payment.statusCards.creditAppliedTitle"),subtitle:e("payables.payment.statusCards.creditAppliedSubtitle")})},vt=()=>{const{t:e}=(0,s.Bd)("global");return o.createElement(Pe,{icon:o.createElement(d.GQ,{type:"info"}),title:e("payables.payment.statusCards.applicationProcessingTitle"),subtitle:e("payables.payment.statusCards.applicationProcessingSubtitle")})},yt=e=>{let{status:t}=e;const{t:n}=(0,s.Bd)("global");return o.createElement(Pe,{icon:o.createElement(d.GQ,{type:"alert"}),title:n("payables.payment.statusCards.".concat(t.toLowerCase())),subtitle:n("payables.payment.statusCards.contactSupplier")})};var bt=n(41436),ft=n(45481),Et=n(36913),Ct=n(64513),At=n(25183),St=n(23588),wt=n(47450),Pt=n(48697);const It="SelectorInvoiceRow_row__JFOIP",xt="SelectorInvoiceRow_borderless__D4SrU",Dt="SelectorInvoiceRow_number__iTsrS",Tt="SelectorInvoiceRow_amountCell__PkAWM",kt="SelectorInvoiceRow_achIcon__fBvoW",Bt="SelectorInvoiceRow_amount__WwufQ",Ft="SelectorInvoiceRow_dueDate__x153Z";var _t=n(92374);const Nt=r.f0.Console.Payables.AttachmentPreview,Rt=e=>{let{invoice:t,selected:n,onToggle:r,borderless:a}=e;const{t:i}=(0,s.Bd)("global"),d=(0,c.useNavigation)(),u=t.dueDate?i(t.pastDue?"payables.payment.regular.grouped.pastDue":"payables.payment.regular.grouped.due",{date:(0,Pt.Y)(t.dueDate)}):"";return o.createElement(Ae.Z,{className:(0,_t.A)(It,a&&xt),withBorder:!a,onClick:()=>r(t.id)},o.createElement(ze.Y,{justify:"space-between",wrap:"nowrap",gap:12},o.createElement(ze.Y,{gap:12,align:"center",wrap:"nowrap",flex:1},o.createElement(Ct.S,{readOnly:!0,checked:n,"data-testid":"invoice.".concat(t.id,".checkbox")}
1),o.createElement(x.B,{gap:4},o.createElement(ze.Y,{gap:4,wrap:"nowrap"},o.createElement(l.E,{className:Dt,truncate:"end"},t.invoiceNumber),t.hasAttachment&&t.attachmentToken&&o.createElement(At.m,{label:i("payables.invoiceCard.viewAttachment")},o.createElement(St.M,{variant:"subtle",color:"blue",size:"sm",onClick:e=>{e.stopPropagation(),d.navigate(Nt,{token:t.attachmentToken})},"data-testid":"invoice.".concat(t.id,".attachment")},o.createElement(wt.A,{size:18})))),u&&o.createElement(l.E,{className:Ft,"data-past-due":!!t.pastDue},u))),o.createElement(ze.Y,{className:Tt},t.achDiscount>0&&o.createElement(At.m,{label:i("payables.payment.regular.single.achDiscount")},o.createElement(je.A,{size:18,className:kt})),o.createElement(l.E,{className:Bt},(0,ke.zQ)(t.amountDue)))))},Lt="GroupedPaymentSelectorView_eyebrow__MGLRD",Mt="GroupedPaymentSelectorView_vendorName__G-jhs",Ot="GroupedPaymentSelectorView_divider__UKIUr",zt="GroupedPaymentSelectorView_totalLabel__IVQuh",jt="GroupedPaymentSelectorView_totalAmount__dwz1f",Wt="GroupedPaymentSelectorView_sectionTitle__salSf",Vt="GroupedPaymentSelectorView_payBar__LB1ou",Ht="GroupedPaymentSelectorView_footerLabel__m3bS2",Ut="GroupedPaymentSelectorView_footerTotal__KUV+v",Gt="GroupedPaymentSelectorView_pay__OT8lG",Yt="GroupedPaymentSelectorView_card__wjovB",Qt=e=>{var t,n;let{navigation:r,route:a,Shell:i,routes:c}=e;const{t:u}=(0,s.Bd)("global"),{setSelectedToPay:m}=(0,Et.fv)(),p=null===a||void 0===a||null===(t=a.params)||void 0===t?void 0:t.id,{data:g}=(0,D.I)(B.o.paymentDetails({id:null!==p&&void 0!==p?p:""},{enabled:!!p,retry:!1})),{data:h,isPending:v,isError:y}=(0,D.I)(B.o.unpaidSupplierInvoices({id:null!==p&&void 0!==p?p:""},{enabled:!!p,retry:!1})),b=null!==(n=null===h||void 0===h?void 0:h.invoices)&&void 0!==n?n:[],[f,E]=(0,o.useState)(new Set),[C,A]=(0,o.useState)(!1);(0,o.useEffect)((()=>{h&&!C&&(E(new Set(h.invoices.map((e=>e.id)))),A(!0))}),[h,C]);const S=e=>E((t=>{const n=new Set(t);return n.delete(e)||n.add(e),n})),w=u("payables.payment.regular.grouped.selectTitle");if(!p||y)return o.createElement(i,{title:w},o.createElement(Pe,{icon:o.createElement(d.GQ,{type:"danger"}),title:u("payables.payment.statusCards.loadErrorTitle"),subtitle:u("payables.payment.statusCards.loadErrorMessage")}));if(v)return o.createElement(i,{title:w},o.createElement(bt.o,{mih:"60vh"},o.createElement(d.aC,null)));const P=qt(b),I=qt(b.filter((e=>f.has(e.id)))),T=b.some((e=>e.achDiscount>0)),k=o.createElement(ze.Y,{className:Vt,justify:"space-between",wrap:"nowrap"},o.createElement(x.B,{gap:4},o.createElement(l.E,{className:Ht},u("TabInvoice.TotalAmount")),o.createElement(l.E,{className:Ut,"data-testid":"payTotalAmount"},(0,ke.zQ)(I))),o.createElement(ae.$,{className:Gt,"data-testid":"payTotal",disabled:I<=0,onClick:()=>{var e;const t=null!==(e=null===g||void 0===g?void 0:g.supplier.id)&&void 0!==e?e:"";if(I<=0)return;const n=b.filter((e=>f.has(e.id)));1!==n.length?(m(n.map((e=>({_id:e.id,supplierId:t,selected:!0})))),r.navigate(c.grouped)):r.navigate(c.invoice,{id:n[0].id})}},u("TabInvoice.PayTotal")));return o.createElement(i,{title:w,footer:k},o.createElement(x.B,{gap:16},o.createElement(Ae.Z,{className:Yt,radius:"md",withBorder:!0},o.createElement(x.B,{gap:20},o.createElement(ze.Y,{justify:"space-between",align:"flex-start",wrap:"nowrap"},o.createElement(x.B,{gap:12},o.createElement(l.E,{className:Lt},u("payables.invoiceCard.vendor")),o.createElement(l.E,{className:Mt,truncate:"end"},null===g||void 0===g?void 0:g.supplier.name)),o.createElement(d.x1,{phone:null===g||void 0===g?void 0:g.supplier.phone})),o.createElement(Ie.c,{className:Ot}),o.createElement(x.B,{gap:8},o.createElement(l.E,{className:zt},u("payables.invoiceCard.totalAmountDue")),o.createElement(l.E,{className:jt},(0,ke.zQ)(P))))),o.createElement(Ae.Z,null,o.createElement(x.B,{gap:16},o.createElement(ze.Y,{justify:"space-between",align:"center",wrap:"nowrap",mb:8},o.createElement(l.E,{className:Wt},u("payables.payment.regular.grouped.selectInvoices")),o.createElement(d.t5,{onClick:()=>E((e=>e.size>0?new Set:new Set(b.map((e=>e.id)))))},f.size>0?u("payables.payment.regular.grouped.unselectAll"):u("payables.payment.regular.grouped.selectAll"))),T&&o.createElement(Ue,null),o.createElement(x.B,{gap:12},b.map((e=>o.createElement(Rt,{key:e.id,invoice:e,selected:f.has(e.id),onToggle:S}))))))))},qt=e=>(0,ft.B)(e.reduce(((e,t)=>e+t.amountDue),0));var Kt=n(38554),Jt=n(65919),Zt=n(31652),Xt=n(17171);const $t=(0,I.PA)((e=>{let{selectedInvoices:t}=e;const{t:n}=(0,s.Bd)("global"),r=(0,c.useNavigation)(),{sm:a}=(0,Xt.Qs)(),{isProjectMissingOnAllInvoices:l,areInvoicesFromSameProject:i}=L.Ay,{groupedInvoiceProjectWarning:d,setGroupedInvoiceProjectWarning:u,projectNavigation:m,resumeApplyingForLoan:p}=R.A,g=(0,o.useMemo)((()=>t.map((e=>e._id)).join(",")),[t]),h=(0,o.useMemo)((()=>l(t)),[t,l]),v=()=>{u(!1)},y=[{label:"Go Back",appearance:"outline",style:a&&en.singleButtonDesktop,onPress:v}];return o.createElement(Q.BtAlert,{visible:d,onClose:v,buttons:i(t)||h?[{label:"Go Back",appearance:"outline",style:a&&en.buttonDesktop,onPress:v},{label:"Continue",style:a&&en.buttonDesktop,onPress:()=>{h?m(r,g):p(),v()}}]:y,margins:a?void 0:18,width:a&&650,buttonsContainerStyle:a&&{justifyContent:"center"},verticalButtons:!a},o.createElement(W.A,{style:a?en.desktopTitleStyle:en.mobTitleStyle},n("GroupedInvoicesProjectWarning.title")),o.createElement(W.A,{style:a?en.desktopBody:en.mobBody},n("GroupedInvoicesProjectWarning.subtitle")))}
1)),en=j.A.create({desktopTitleStyle:{fontWeight:"700",fontSize:28,lineHeight:36,color:"#003353",marginBottom:10,width:493,textAlign:"center"},mobTitleStyle:{fontWeight:"600",fontSize:18,lineHeight:28,color:"#003353",textAlign:"center",marginBottom:11},boldDesktop:{fontWeight:"600",color:"#003353"},boldMob:{fontWeight:"500",color:"#335C75",lineHeight:24},desktopBody:{fontWeight:"500",fontSize:16,lineHeight:22,color:"#003353",textAlign:"center",width:464,marginBottom:30},mobBody:{fontWeight:"400",fontSize:16,lineHeight:26,color:"#668598",textAlign:"center"},buttonDesktop:{width:210,marginBottom:40,marginRight:5,marginLeft:5},singleButtonDesktop:{width:300,marginBottom:40,marginRight:5,marginLeft:5}}),tn="GroupedSupplierHeader_label__hUi41",nn="GroupedSupplierHeader_value__o-BYd",on=e=>{let{name:t,phone:n,totalAmount:r}=e;const{t:a}=(0,s.Bd)("global");return o.createElement(ze.Y,{justify:"space-between",align:"flex-start",wrap:"nowrap"},o.createElement(x.B,{gap:8},o.createElement(l.E,{className:tn},a("payables.invoiceCard.vendor")),o.createElement(l.E,{className:nn,truncate:"end"},t),o.createElement(d.x1,{phone:n})),o.createElement(x.B,{gap:8,align:"flex-end"},o.createElement(l.E,{className:tn},a("payables.invoiceCard.amountDue")),o.createElement(l.E,{className:nn},(0,ke.zQ)(r))))},rn="GroupedPaymentView_divider__8MxI7",an="GroupedPaymentView_sectionTitle__f7NPJ",ln="GroupedPaymentView_warn__QC-A2",sn=(0,I.PA)((e=>{var t,n,a;let{navigation:i,route:c}=e;const{t:u}=(0,s.Bd)("global"),{selectedToPay:m,onSelect:p,achDiscountEligibility:g,totalInvoiceAmount:h,calculateTotals:v,setSelectedToPay:y,selectedInvoices:b}=(0,Et.fv)(),[f,E]=(0,o.useState)(!1),[C,A]=(0,o.useState)(!1),[S,w]=(0,o.useState)(!1),[P]=(0,o.useState)((()=>{var e,t,n;const o=(0,J.toJS)(m).filter((e=>e.selected)),r=(null===(e=o[0])||void 0===e?void 0:e.supplierId)||(null===(t=o[0])||void 0===t||null===(n=t.company)||void 0===n?void 0:n._id)||"";return{...Jt.uZ.safeParse(r).success?{supplierId:r}:{},invoiceIds:o.map((e=>e._id)).filter(Boolean)}})),I=P.invoiceIds.length>0,{data:T,isPending:k,isFetching:_,isError:N}=(0,D.I)(B.o.groupedPaymentDetails(P,{enabled:I,retry:!1})),R=(null===(t=b[0])||void 0===t?void 0:t._id)||"",{data:L,isFetching:z}=(0,D.I)(Zt.y.creditPaymentOptions({invoiceId:R,totalAmount:h},{enabled:!!R})),j=b.map((e=>null===e||void 0===e?void 0:e._id)).filter(Boolean),W=new Set(j),[V,H]=(0,o.useState)(null),U=(0,o.useCallback)((e=>H(null!==e&&void 0!==e?e:{})),[]),{resumeCreditApplication:G,projectFlow:Y}=M({invoice:b[0],invoiceIds:j,selectedInvoices:b,status:null!==(n=null===T||void 0===T?void 0:T.credit.locStatus)&&void 0!==n?n:"",navigation:i,route:c,setLoading:E,onOpenPaymentFlow:U});(0,o.useEffect)((()=>{if(I)return;const e=(0,r.oh)((0,r.wl)("Console.Payables.home"));i.replace(e.name,e.params)}),[I,i]),(0,o.useEffect)((()=>{if(!T)return;const e=T.invoices.map((e=>({...O(e,T.supplier),selected:!0})));y(e),v(e),A(!0)}),[T,y,v]),(0,o.useEffect)((()=>{const{paymentMethodsStore:e}=F.A.screensStore;e.paymentMethods.length||e.fetchPaymentMethods()}),[]);if(N&&!T)return o.createElement(cn,null);if(k||!T||!C||f)return o.createElement(at.V,null,o.createElement(l.E,null,u("payables.payment.loadingPaymentDetails")));const{supplier:Q,options:q}=T,K=T.invoices.some((e=>e.achDiscount>0));return o.createElement(x.B,{gap:16},o.createElement(Ae.Z,null,o.createElement(x.B,{gap:16},o.createElement(on,{name:Q.name,phone:Q.phone,totalAmount:h}),o.createElement(Ie.c,{className:rn}),o.createElement("div",null,o.createElement(ze.Y,{justify:"space-between",wrap:"nowrap"},o.createElement(l.E,{className:an},b.length," ",u("InvoiceDetails.Invoices")),o.createElement(d.u7,{expanded:S,onToggle:w},u("InvoiceDetails.viewAllInvoices"))),o.createElement(Kt.S,{in:S},o.createElement(x.B,{gap:20,mt:20},K&&o.createElement(Ue,null),T.invoices.map((e=>o.createElement(Rt,{key:e.id,invoice:e,selected:W.has(e.id),onToggle:p,borderless:!0})))))))),_?o.createElement(at.V,{mt:24},o.createElement(l.E,null,u("payables.payment.loadingPaymentDetails"))):o.createElement(o.Fragment,null,0===b.length&&o.createElement(l.E,{className:ln},u("InvoiceDetails.SelectAtLeastOneInvoice")),o.createElement(Qe,{invoices:b,options:{acceptCredit:q.acceptCredit&&(z||!(null===L||void 0===L||null===(a=L.plans)||void 0===a||!a.length)),creditBlockReason:q.creditBlockReason,acceptAch:q.acceptAch,acceptCard:q.acceptCard,achDiscountEligible:g.some,canExtendTerms:!1},creditDisabled:0===b.length||z,onApplyCredit:G,onPaySuccess:()=>{const e=(0,r.oh)((0,r.wl)("Console.Payables.home"));i.replace(e.name,e.params)},navigation:i,route:c})),V&&o.createElement(Ee,{invoices:b,paymentOptions:null!==L&&void 0!==L?L:null,loadingPaymentOptions:z,requirePurchaseType:V.requirePurchaseType,onSelectProject:Y,onClose:()=>H(null),navigation:i}),o.createElement(ge,{navigation:i,companyName:null===Q||void 0===Q?void 0:Q.name}),o.createElement($t,{selectedInvoices:b}),o.createElement(te,{recheckConditionsBeforeApplyingCredit:G}))})),cn=()=>{const{t:e}=(0,s.Bd)("global");return o.createElement(Pe,{icon:o.createElement(d.GQ,{type:"alert"}),title:e("payables.payment.statusCards.loadErrorGroupTitle"),subtitle:e("payables.payment.statusCards.loadErrorGroupMessage")})},dn={invoice:r.f0.Console.Payables.Invoice,grouped:r.f0.Console.Payables.Pay},un={invoice:r.f0.InvoiceLink.Invoice,grouped:r.f0.Console.Payables.Pay},mn=e=>
1o.createElement(S,null,o.createElement(dt,e)),pn=e=>o.createElement(P,null,o.createElement(dt,e)),gn=e=>o.createElement(Qt,Object.assign({},e,{Shell:S,routes:dn})),hn=e=>o.createElement(Qt,Object.assign({},e,{Shell:P,routes:un})),vn=e=>o.createElement(S,null,o.createElement(sn,e)),yn=e=>o.createElement(P,null,o.createElement(sn,e))},49757:(e,t,n)=>{"use strict";n.d(t,{$U:()=>C,cS:()=>E});var o=n(99069),r=n(50016);const a=(0,r.createContext)([]),l={setInvoiceStatusModalVisibility:(0,o.VP)("SET_INVOICE_STATUS_MODAL_VISIBILITY"),setInvoicePaymentStatus:(0,o.VP)("SET_INVOICE_PAYMENT_STATUS"),setInvoicePaymentMethod:(0,o.VP)("SET_INVOICE_PAYMENT_METHOD"),setProjectSelectionModalVisibility:(0,o.VP)("SET_PROJECT_LIST_MODAL_VISIBILITY"),setPaymentProcessingModal:(0,o.VP)("SET_PAYMENT_PROCESSING_MODAL"),setInviteSuccessModal:(0,o.VP)("SET_PAYMENT_SUCCESS_MODAL"),setFoundProject:(0,o.VP)("SET_FOUND_PROJECT"),setAddProjectSuccessModalVisibility:(0,o.VP)("SET_ADD_PROJECT_SUCCESS_MODAL_VISIBILITY"),setSelectedProject:(0,o.VP)("SET_SELECTED_PROJECT"),setPayInvoiceModal:(0,o.VP)("SET_PAY_INVOICE_MODAL"),setBankSuccess:(0,o.VP)("SET_BANK_SUCCESS"),setCardSuccess:(0,o.VP)("SET_CARD_SUCCESS")};function i(e,t){return{...e,invoiceStatusModalVisibility:t.payload||!1}}function s(e,t){return{...e,invoicePaymentStatus:t.payload||!1}}function c(e,t){return{...e,invoicePaymentMethod:t.payload||{}}}function d(e,t){return{...e,projectSelectionModalVisibility:t.payload||!1}}function u(e,t){return{...e,paymentProcessingModal:t.payload||!1}}function m(e,t){return{...e,inviteSuccessModal:t.payload||!1}}function p(e,t){return{...e,foundProject:t.payload||{}}}function g(e,t){return{...e,addProjectSuccessModalVisibility:t.payload||!1}}function h(e,t){return{...e,selectedProject:t.payload||{}}}function v(e,t){return{...e,payInvoiceModal:t.payload||!1}}function y(e,t){return{...e,bankSuccess:t.payload||!1}}function b(e,t){return{...e,cardSuccess:t.payload||!1}}const f=(0,o.vy)({},(function(e){e.addCase(l.setInvoiceStatusModalVisibility,i),e.addCase(l.setInvoicePaymentStatus,s),e.addCase(l.setInvoicePaymentMethod,c),e.addCase(l.setProjectSelectionModalVisibility,d),e.addCase(l.setPaymentProcessingModal,u),e.addCase(l.setInviteSuccessModal,m),e.addCase(l.setFoundProject,p),e.addCase(l.setAddProjectSuccessModalVisibility,g),e.addCase(l.setSelectedProject,h),e.addCase(l.setPayInvoiceModal,v),e.addCase(l.setBankSuccess,y),e.addCase(l.setCardSuccess,b)}));function E(){const e=(0,r.useContext)(a),[t,n]=e,{invoiceStatusModalVisibility:o=!1,invoicePaymentStatus:i="",invoicePaymentMethod:s={},addToProjectModalVisibility:c=!1,projectSelectionModalVisibility:d=!1,paymentProcessingModal:u=!1,inviteSuccessModal:m=!1,foundProject:p={},addProjectSuccessModalVisibility:g=!1,selectedProject:h={},payInvoiceModal:v=!1,bankSuccess:y=!1,cardSuccess:b=!1}=t,{setInvoiceStatusModalVisibility:f,setInvoicePaymentStatus:E,setInvoicePaymentMethod:C,setProjectSelectionModalVisibility:A,setPaymentProcessingModal:S,setInviteSuccessModal:w,setFoundProject:P,setAddProjectSuccessModalVisibility:I,setSelectedProject:x,setPayInvoiceModal:D,setBankSuccess:T,setCardSuccess:k}=(0,r.useMemo)((()=>({setInvoiceStatusModalVisibility(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n(l.setInvoiceStatusModalVisibility(e))},setInvoicePaymentStatus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";n(l.setInvoicePaymentStatus(e))},setInvoicePaymentMethod(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(l.setInvoicePaymentMethod(e))},setProjectSelectionModalVisibility(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n(l.setProjectSelectionModalVisibility(e))},setPaymentProcessingModal(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n(l.setPaymentProcessingModal(e))},setInviteSuccessModal(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n(l.setInviteSuccessModal(e))},setFoundProject(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(l.setFoundProject(e))},setAddProjectSuccessModalVisibility(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n(l.setAddProjectSuccessModalVisibility(e))},setSelectedProject(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(l.setSelectedProject(e))},setPayInvoiceModal(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n(l.setPayInvoiceModal(e))},setBankSuccess(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n(l.setBankSuccess(e))},setCardSuccess(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n(l.setCardSuccess(e))}})),[n]);return{invoiceStatusModalVisibility:o,invoicePaymentStatus:i,invoicePaymentMethod:s,addToProjectMod
1alVisibility:c,projectSelectionModalVisibility:d,paymentProcessingModal:u,inviteSuccessModal:m,foundProject:p,addProjectSuccessModalVisibility:g,selectedProject:h,payInvoiceModal:v,bankSuccess:y,cardSuccess:b,setInvoiceStatusModalVisibility:f,setInvoicePaymentStatus:E,setInvoicePaymentMethod:C,setProjectSelectionModalVisibility:A,setPaymentProcessingModal:S,setInviteSuccessModal:w,setFoundProject:P,setAddProjectSuccessModalVisibility:I,setSelectedProject:x,setPayInvoiceModal:D,setBankSuccess:T,setCardSuccess:k}}function C(e){let{children:t}=e;const[n,o]=(0,r.useReducer)(f,{}),l=(0,r.useMemo)((()=>[n,o]),[n,o]);return r.createElement(a.Provider,{value:l},t)}},219:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var o=n(50016),r=n(32572),a=n(7371),l=n(38767),i=n(77356),s=n(17171),c=n(53941);const d=e=>{let{children:t,toolbar:n,toolbarStyle:d={},containerStyle:u,contentContainerStyle:m,contentStyle:p,toTopScroller:g=!0,loading:h=!1,onLayout:v,styleWidth:y,footer:b}=e;const{mobileWidth:f,sm:E}=(0,s.Qs)(),C=(0,c.A)(),A=(null===m||void 0===m?void 0:m.backgroundColor)||"white",S=(0,o.useRef)(null),w=y||f,P=(0,o.useMemo)((()=>n?o.createElement(a.A,{style:[{width:"100%",backgroundColor:A,paddingHorizontal:16},d]},n):null),[A,n,d]);(0,o.useEffect)((()=>{S.current?S.current.scrollTo({x:0,y:0,animated:!0}):window.scrollTo(0,0)}),[g]);const I=h?o.createElement(i.A,null):t;return o.createElement(a.A,{style:(0,l.composeStyle)({backgroundColor:"white",flex:1},u),testID:"content-wrapper"},o.createElement(a.A,{testID:"header-container",style:{width:C?f:"100%"}},P),o.createElement(r.A,{contentContainerStyle:(0,l.composeStyle)({width:"100%",flexGrow:1},m),ref:S,showsVerticalScrollIndicator:!1,onLayout:v,scrollEnabled:!0,testID:"content-scroll-container"},o.createElement(a.A,{testID:"content-screen",style:(0,l.composeStyle)(E&&{width:w},{paddingHorizontal:16},p)},I)),o.createElement(a.A,{testID:"footer-container",style:{width:w}},b))}},50763:(e,t,n)=>{"use strict";n.d(t,{N:()=>Rt});var o=n(45143),r=n(50016),a=n(5438),l=n(52628),i=n.n(l),s=n(19462);function c(e,t,n,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,l=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0;const d=(0,r.useMemo)((()=>{try{var o;const r=null===e||void 0===e||null===(o=e.data.get(t))||void 0===o?void 0:o.get(n,!0),l=(0,s.getSnapshot)(r).content;return c?l?c.create(r.content):c.create({}):r&&null!==l&&void 0!==l?l:a}catch{return a}}),[e,t,n,a,c]),[u,m]=(0,r.useState)((()=>d));return(0,r.useEffect)((()=>{const e=i().isObject(u)&&!i().isArray(u)?(0,s.getSnapshot)(u):u;o&&o({value:e,filled:l?l(u):!!u,group:t,identifier:n})}),[l,u,o,t,n]),(0,r.useMemo)((()=>({value:u,setValue(e,t){m(t)}})),[u,m])}var d=n(29731),u=n(82997),m=n(14329),p=n(78267),g=n(7371),h=n(17439);const v=(0,r.forwardRef)(((e,t)=>{let{onConnectSuccess:n,text:o,disabled:a,highlightRountingNumber:l,...i}=e;const[s,c]=(0,r.useState)(""),d=(0,r.useCallback)((()=>{u.JZ.py.createLinkToken(l).then((e=>{c(e.link_token)}))}),[l]);(0,r.useImperativeHandle)(t,(()=>({createToken:d})),[d]);const p=(0,r.useCallback)((e=>{u.JZ.py.exchangePublicToken(e).then((()=>{n&&n()})).catch((e=>console.log(e)))}),[]),v=(0,r.useMemo)((()=>({token:s,onSuccess:p,onExit:(e,t)=>{console.log("Exited early. Error: ".concat(JSON.stringify(e)," Metadata: ").concat(JSON.stringify(t)))}})),[s,p]),{open:y}=(0,h.usePlaidLink)(v);return(0,r.useEffect)((()=>{y&&y()}),[y]),r.createElement(g.A,null,r.createElement(m.BtButton,Object.assign({onPress:()=>d(),disabled:a},i,{testID:"PlaidConnectButton"}),(e=>r.createElement(m.BtText,e,o))))}));var y=n(2745),b=n(17171),f=n(20282),E=n(83613),C=n(64504),A=n(77356),S=n(58876),w=n(60923),P=n(19925);const I=e=>{var t;let{model:n,review:o,onChange:a}=e;const{t:l}=(0,d.Bd)("application"),{sm:i}=(0,P.Qs)(),s=e=>t=>{a&&a({...n,[e]:t})},c=e=>()=>{a&&a({...n,accountType:e})};return r.createElement(g.A,{style:{minWidth:i?500:void 0}},i?r.createElement(r.Fragment,null,r.createElement(f.hK,{height:o?24:16}),r.createElement(m.KS,null)):r.createElement(m.BtText,{style:{fontSize:20,fontWeight:"700"}}
1,l("Bank.EnterBankDetailsManually")),r.createElement(f.hK,{height:16}),r.createElement(m.C0,{value:n.name,maxLength:70,testID:"BankName",disabled:o,validate:()=>n.name?"":l("Bank.BankNameInvalid"),label:l("Bank.BankName"),onChangeText:s("name")}),r.createElement(f.hK,{height:o?24:16}),r.createElement(m.C0,{value:null!==(t=null===n||void 0===n?void 0:n.accountholderName)&&void 0!==t?t:"",label:l("Bank.HolderName"),disabled:o,validate:()=>n.accountholderName?"":l("Bank.HolderNameInvalid"),testID:"BankHolderName",maxLength:70,onChangeText:s("accountholderName")}),r.createElement(f.hK,{height:o?24:16}),r.createElement(m.sy,{value:n.accountNumber,label:l("Bank.AccountNumber"),disabled:o,validate:()=>n.accountNumber.length>=6?"":l("Bank.AccountNumberInvalid"),format:"################",testID:"BankAccountNumber",keyboardType:S.ui.NumberPad,onChangeText:s("accountNumber")}),r.createElement(f.hK,{height:o?24:16}),r.createElement(m.sy,{value:n.routingNumber,label:l("Bank.RoutingNumber"),disabled:o,validate:()=>9===n.routingNumber.length?"":l("Bank.RoutingNumberInvalid"),format:"#########",testID:"BankRoutingNumber",keyboardType:S.ui.NumberPad,onChangeText:s("routingNumber")}),r.createElement(f.hK,{height:o?24:16}),r.createElement(g.A,{style:{flexDirection:"row",alignItems:"center"}},r.createElement(m.BtRadioButton,{label:l("Bank.BusinessChecking"),checked:n.accountType===w.e.Checking,disabled:o,onPress:c(w.e.Checking)}),r.createElement(f.hK,{width:30}),r.createElement(m.BtRadioButton,{label:l("Bank.BusinessSaving"),checked:n.accountType===w.e.Savings,disabled:o,onPress:c(w.e.Savings)})))};var x=n(76036);const D=e=>{let{isVisible:t,message:n,onClose:o}=e;const{t:a}=(0,d.Bd)("application"),{sm:l}=(0,P.Qs)();return r.createElement(m.BtAlert,{type:"warning",visible:t,width:l?500:330,buttons:[{testID:"BankWarningClose",label:a("Close"),onPress:o}],onClose:o},r.createElement(m.BtText,{style:{fontSize:18,color:"#335C75",textAlign:"center"},testID:"BankWarningMessage"},n))},T={name:"",accountType:w.e.Checking,accountNumber:"",accountholderName:"",routingNumber:"",isManualEntry:!0};var k=n(97076);const B=e=>{let{isVisible:t,isLoanApplication:n,onClose:o,onLoginToBank:a,onEnterManually:l}=e;const{t:i}=(0,d.Bd)("application"),{sm:s}=(0,P.Qs)();return r.createElement(C.Fc,{icon:r.createElement(r.Fragment,null,r.createElement(k.nyr,null),r.createElement(f.hK,{height:26})),visible:t,onClose:o,title:i("Bank.SkipConnectTitle"),buttons:[{testID:"BankConfirmationGoBack",label:i(s?"Bank.SkipConnectEnterManually":"Bank.AddManually"),onPress:l},{testID:"BankConfirmationContinue",label:i(s?"Bank.SkipConnectLoginToBank":"Bank.SearchBank"),onPress:a}],buttonsContainerStyle:s?{width:"90%",alignSelf:"center"}:void 0},r.createElement(f.hK,{height:10}),r.createElement(m.BtText,{style:{fontSize:16,color:"#335C75",textAlign:"center",width:s?430:300,lineHeight:26},testID:"BankConfirmationSubTitle"},i(n?"Bank.SkipConnectLoanDescription":"Bank.SkipConnectDescription")),r.createElement(f.hK,{height:10}))},F=e=>{let{isVisible:t,isLoading:n,onClose:o,onConfirm:a}=e;const{t:l}=(0,d.Bd)("application"),{sm:i}=(0,P.Qs)();return r.createElement(C.Fc,{icon:r.createElement(r.Fragment,null,r.createElement(k.nyr,null),r.createElement(f.hK,{height:26})),visible:t,onClose:o,title:l("Bank.DeleteModalTitle"),buttons:[{testID:"BankDeleteKeep",label:l(i?"Bank.DeleteModalCancel":"Bank.DeleteModalCancelShort"),onPress:o},{testID:"BankDeleteConfirm",label:l(i?"Bank.DeleteModalConfirm":"Bank.DeleteModalConfirmShort"),loading:n,disabled:n,onPress:a}],buttonsContainerStyle:i?{width:"90%",alignSelf:"center"}:void 0},r.createElement(f.hK,{height:10}),r.createElement(m.BtText,{style:{fontSize:16,color:"#335C75",textAlign:"center",width:i?430:300,lineHeight:26},testID:"BannkDeletionSubTitle"},l("Bank.DeleteModalDescription")))};var _=n(14425);const N=()=>{const{sm:e}=(0,b.Qs)(),{t:t}=(0,d.Bd)("application");return r.createElement(m.BtText,{style:e?R.text:R.mobileText},r.createElement(d.x6,{t:t,i18nKey:"Bank.GetPaid.NotSelected.Description",components:{bold:r.createElement(m.BtText,{style:[e?R.text:R.mobileText,R.boldText]})}}))},R=p.A.create({mobileText:{fontFamily:"Inter, sans-serif",fontSize:14,fontWeight:"500",color:"#626D75",lineHeight:20,letterSpacing:0,marginBottom:28,marginTop:16},text:{fontFamily:"Inter, sans-serif",fontSize:18,fontWeight:"500",color:"#626D75",lineHeight:26,letterSpacing:0,marginTop:24,marginBottom:38},boldText:{fontWeight:"700",color:"#626D75"}}),L=()=>{const{sm:e}=(0,b.Qs)(),{t:t}=(0,d.Bd)("application");return r.createElement(g.A,{style:e?M.container:M.containerMobile},r.createElement(m.BtText,{style:e?M.description:[M.description,M.descriptionMobile]},t("Bank.IHC.NotSelected.Description")),r.createElement(g.A,{style:M.benefitsContainer},["Bank.IHC.NotSelected.Benefits.0","Bank.IHC.NotSelected.Benefits.1","Bank.IHC.NotSelected.Benefits.2","Bank.IHC.NotSelected.Benefits.3"].map(((e,n)=>r.createElement(g.A,{key:n,style:M.benefitRow},r.createElement(k.LXS,{width:20,height:20}),r.createElement(m.BtText,{style:[M.description,M.benefitsText]},t(e)))))))},M=p.A.create({containerMobile:{marginBottom:24},container:{marginBottom:24},descriptionMobile:{fontSize:14,lineHeight:20},description:{fontFamily:"Inter, sans-serif",fontSize:16,fontWeight:"500",color:"#001929",lineHeight:28,letterSpacing:0}
1,benefitsContainer:{marginTop:8},benefitRow:{flexDirection:"row",alignItems:"flex-start",marginTop:16,gap:10},benefitsText:{fontSize:14,lineHeight:20}}),O={component:(0,a.PA)((e=>{let{doc:t,item:n,group:a,review:l,onValueUpdate:i,setNavigationVisible:s}=e;const{t:p}=(0,d.Bd)("application"),{sm:h}=(0,b.Qs)(),{bankValidator:S,isInHouseCreditApplication:w,isGetPaidApplication:P}=o.Ay,k=c(t,a,n,i,null,S,u.br),[R,M]=(0,r.useState)(),[O,j]=(0,r.useState)(T),[W,V]=(0,r.useState)(),[H,U]=(0,r.useState)(""),[G,Y]=(0,r.useState)(!1),[Q,q]=(0,r.useState)(!1),[K,J]=(0,r.useState)(!1),[Z,X]=(0,r.useState)(!1),[$,ee]=(0,r.useState)(),te=(0,r.useRef)(null),ne="supplier_application"!==t.type,{userStore:oe,screensStore:{paymentMethodsStore:re},isBusy:ae}=E.A,le=re.paymentMethods.filter((e=>"bank"===e.paymentMethodType)),ie=e=>{k.setValue("account",e?u.br.create((0,y.toJS)(e)):null)},se=e=>e.search.length>=3?u.JZ.py.searchInstitution(e.search).then((e=>e.items)):Promise.resolve([]),ce=e=>{U(e),e||M(void 0)},de=e=>{ie(e),o.Ay.setIsPrimaryBankAccountChanged(!0)},ue=e=>{M(e),U(e.name)},me=async()=>{Y(!0);try{await oe.fetchUser(),await(async()=>{const e=()=>{var e;return null===(e=re.paymentMethods)||void 0===e?void 0:e.filter((e=>!e.isManualEntry))},t=e();await re.fetchPaymentMethods();const n=e().find((e=>!t.some((t=>t._id===e._id))));n?(ie(n),o.Ay.setIsPrimaryBankAccountChanged(!0)):V(p("Bank.UnsupportedAccountsWarning"))})(),M(void 0),U("")}catch(e){console.error(e)}finally{Y(!1)}},pe=()=>{V(void 0)},ge=()=>{s(!0),J(!1),j(T)},he=async()=>{s(!0),J(!1);try{const e=o.Ay.isCreditApplication?{isPrimaryForCredit:!0}:{isPrimary:!0},t=await u.JZ.QN.addBankAccount({...O,...e,isManualEntry:!0});await re.fetchPaymentMethods();const n=re.manuallyAddedBanks.find((e=>e.id===t.id));n&&ie((0,y.toJS)(n)),j({...T,name:H}),M(void 0),U("")}catch(e){console.error(e)}},ve=()=>{Ie&&!o.Ay.isInHouseCreditApplication?X(!0):be()},ye=()=>{X(!1)},be=()=>{s(!1),J(!0),X(!1),j((e=>({...e,name:H})))},fe=()=>{var e;X(!1),null===(e=te.current)||void 0===e||e.createToken()},Ee=e=>{j(e)},Ce=e=>{ee(e)},Ae=()=>{ee(void 0)},Se=async()=>{if($)try{q(!0),await u.JZ.QN.removeBankAccount($),await re.fetchPaymentMethods(),ie(null),o.Ay.clearBankAccount()}catch(e){console.error(e)}finally{q(!1),ee(void 0)}},we=()=>{const e={selectedBank:R,hasAccountAdded:xe};return P?(e=>{let{selectedBank:t,hasAccountAdded:n}=e;return n?{title:"Bank.GetPaid.Connected.Title",description:"Bank.GetPaid.Connected.Description",accountList:{title:"Bank.GetPaid.Connected.AccountList.Title",description:"Bank.GetPaid.Connected.AccountList.Description"}}:t?{title:"Bank.GetPaid.Selected.Title",description:"Bank.GetPaid.Selected.Description"}:{title:"Bank.GetPaid.NotSelected.Title",description:r.createElement(N,null)}})(e):w?(e=>{let{selectedBank:t,hasAccountAdded:n}=e;return n?{title:"Bank.IHC.Connected.Title",description:"Bank.IHC.Connected.Description",accountList:{title:"Bank.IHC.Connected.AccountList.Title"}}:t?{title:"Bank.IHC.Selected.Title",description:"Bank.IHC.Selected.Description"}:{title:"Bank.IHC.NotSelected.Title",description:r.createElement(L,null)}})(e):(e=>{let{selectedBank:t,hasAccountAdded:n}=e;return n?{title:"Bank.LOC.Connected.Title",description:"Bank.LOC.Connected.Description",accountList:{title:"Bank.LOC.Connected.AccountList.Title",description:"Bank.LOC.Connected.AccountList.Description"}}:t?{title:"Bank.LOC.Selected.Title",description:"Bank.LOC.Selected.Description",accountList:{title:"Bank.LOC.Selected.AccountList.Title",description:"Bank.LOC.Selected.AccountList.Description"}}:{title:"Bank.LOC.NotSelected.Title",description:"Bank.LOC.NotSelected.Description"}})(e)},Pe=(0,r.useMemo)((()=>u.br.create((0,y.toJS)(O)).isFilled),[O]),Ie=(null===R||void 0===R?void 0:R.name)===H,xe=le.length>0;if(G)return r.createElement(g.A,{style:{height:100}},r.createElement(A.A,null));if(l)return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:24}),r.createElement(x.Y,{bankAccounts:le,selectedBankAccountId:k.value._id,onSelect:de}));if(!h&&K)return r.createElement(r.Fragment,null,r.createElement(I,{review:l,model:O,onChange:Ee}),r.createElement(f.hK,{height:16}),r.createElement(m.BtButton,{testID:"BankAccountFormAdd",disabled:!Pe,onPress:he},p("Bank.AcceptManual")),r.createElement(f.hK,{height:16}),r.createElement(m.BtButton,{testID:"BankAccountFormCancel",status:"basic",onPress:ge},p("Bank.CancelManual")));{var De,Te,ke;const e=we();return r.createElement(g.A,null,r.createElement(g.A,null,r.createElement(C.vN,{t:p,sm:h,title:e.title}),r.createElement(C.VY,{description:e.description,sm:h,t:p}),(null===(De=e.accountList)||void 0===De?void 0:De.title)&&r.createElement(m.BtText,{style:{fontFamily:"Inter, sans-serif",color:"#335C75",fontSize:h?18:16,fontWeight:"600"}},p(e.accountList.title)),null!==(Te=e.accountList)&&void 0!==Te&&Te.description?r.createElement(m.BtText,{style:{fontFamily:"Inter, sans-serif",color:"#335C75",fontSize:h?16:14,marginTop:10,marginBottom:30}},p(e.accountList.description)):r.createElement(f.hK,{height:30})),r.createElement(x.Y,{bankAccounts:le,selectedBankAccountId:null===k||void 0===k||null===(ke=k.value)||void 0===ke?void 0:ke._id,onSelect:de,onDelete:Ce}),xe&&r.createElement(r.Fragment,null,r.createElement(_.Divider,{style:{backgroundColor:"#CCD6DD",marginTop:10,marginBottom:20}}),r.createElement(m.BtText,{style:{color:"#335C75",fontSize:h?24:16,fontWeight:"600",marginBottom:18}},p("Bank.AddMoreAccounts"))),r.createElement(m.Dy,{size:"large",disabled:ae,value:H,label:p(P?"Bank.GetPaid.SearchBankLabel":"Bank.SearchBankLabel"),testID:"bank_details_search",InputComponent:m.hr,labelSelector:e=>e.name,placeholder:p("Bank.DetailsPlaceHolder"),searchParams:{limit:25,onlyFinciity:!0},placement:"bottom end",apiSearchFn:se,onSelect:ue,onChangeText:ce,defaultSearchText:"AAA"}),r.createElement(f.hK,{height:24}),!!H&&r.createElement(g.A,{style:{alignItems:"center"}},Ie&&r.createElement(r.Fragment,null,r.createElement(v,{style:{marginTop:20},ref:te,disabled:ae,text:p("Bank.LoginToBankAccount"),onConnectSuccess:me,highlightRountingNumber:R.routing_numbers[
10]}),r.createElement(f.hK,{height:10})),r.createElement(m.b_,{disabled:ae,title:p("Bank.EnterBankDetailsManually"),testID:"EnterBankDetailsManually",onPress:ve,textStyle:ae?[z.linkText,z.disabledLinkText]:z.linkText},p("Bank.EnterBankDetailsManually"))),r.createElement(C.Fc,{title:p("Bank.EnterBankDetailsManually"),visible:K,buttons:[{testID:"BankAccountFormCancel",label:p("Bank.CancelManual"),onPress:ge},{testID:"BankAccountFormAdd",label:p("Bank.AcceptManual"),disabled:!Pe,onPress:he}],onClose:ge},r.createElement(I,{review:l,model:O,onChange:Ee})),r.createElement(B,{isVisible:Z,isLoanApplication:ne,onLoginToBank:fe,onEnterManually:be,onClose:ye}),r.createElement(D,{message:W,isVisible:!!W,onClose:pe}),r.createElement(F,{isVisible:!!$,isLoading:Q,onConfirm:Se,onClose:Ae}))}}))},z=p.A.create({linkText:{marginTop:10,marginBottom:20,fontWeight:"600",fontSize:14,lineHeight:24},disabledLinkText:{color:"#99ADBA"}});var j=n(55502);const W=(0,a.PA)((e=>{let{model:t,collapsible:n=!1,label:o="",testID:a,review:l,onModelUpdate:i}=e;const{t:s}=(0,d.Bd)("application"),{sm:c}=(0,P.Qs)(),u=()=>!n||!!t.address||!!t.state||!!t.city||!!t.zip,[p,g]=(0,r.useState)(u),h=(0,r.useRef)(null),v=(e,n)=>{e&&t.setValue(e,n),i&&i()};return r.createElement(r.Fragment,null,r.createElement(j.fI,null,r.createElement(j.fv,{xs:12},r.createElement("div",{ref:h,style:{marginTop:l?24:4}},r.createElement(m.WG,{value:p?t.address:[t.address,t.city,t.state,t.zip].filter((e=>!!e)).join(", "),onChange:e=>{e?p&&v("address",e):(t.setValue("address",""),t.setValue("state",""),t.setValue("city",""),t.setValue("zip",""),i&&i())},onSelect:e=>{t.setValue("address",e.address),t.setValue("state",e.state),t.setValue("city",e.city),t.setValue("zip",e.zip),g(!0),i&&i()},onFocus:()=>{var e;c||(null===h||void 0===h||null===(e=h.current)||void 0===e||e.scrollIntoView())},onBlur:()=>{u()||g(!1)},label:p?s("Business.StreetAddressLabel"):o||s("Business.HomeAddressLabel"),testID:"".concat(a,".address")})))),p&&r.createElement(r.Fragment,null,r.createElement(j.fI,null,r.createElement(j.fv,{xs:12},r.createElement(m.sy,{value:t.zip,onChangeText:e=>v("zip",e),style:V.textBox,label:s("Business.ZipLabel"),testID:"".concat(a,".zip"),format:"#####",disabled:!0}))),r.createElement(j.fI,null,r.createElement(j.fv,{xs:12},r.createElement(m.BtInput,{value:t.city,onChangeText:e=>v("city",e),style:V.textBox,label:s("Business.CityLabel"),testID:"".concat(a,".city"),disabled:!0}))),r.createElement(j.fI,null,r.createElement(j.fv,{xs:12},r.createElement(m.BtInput,{value:t.state,onChangeText:e=>v("state",e),style:V.textBox,label:s("Business.StateLabel"),testID:"".concat(a,".state"),disabled:!0})))))})),V=p.A.create({textBox:{marginTop:24}}),H=s.types.compose(u.pV,(0,u.E2)()).named("AddressStore");function U(e){return!(null===e||void 0===e||!e.allFilled)}function G(e){const{doc:t,group:n,item:o,onValueUpdate:a,testID:l,review:i}=e,{t:s}=(0,d.Bd)("application"),m=c(t,n,o,a,null,U,u.pV),p=(0,r.useMemo)((()=>m.value?H.create((0,y.toJS)(m.value)):H.create({})),[m.value]);return r.createElement(W,{model:p,label:s("Business.StreetAddressLabel"),testID:l,review:i,onModelUpdate:()=>{m.setValue("address",p)}})}const Y={title:"Business.Address",description:"Business.AddressDescription",component:(0,a.PA)((e=>r.createElement(G,Object.assign({},e,{testID:"business_address"}))))},Q=s.types.model("BusinessName",{legalName:"",dba:""}),q=s.types.compose(Q,(0,u.E2)()).named("BusinessNameStore"),K={title:"Business.Name",description:"Business.NameDescription",component:(0,a.PA)((e=>{var t,n;let{doc:o,group:a,item:l,review:i,sm:s,onValueUpdate:u}=e;const{t:p}=(0,d.Bd)("application"),[g,h]=(0,r.useState)(q.create({legalName:"",dba:""})),v=c(o,a,l,u,null,(e=>!(null===e||void 0===e||!e.legalName)),Q);(0,r.useEffect)((()=>{var e,t;!v.value||(null===(e=v.value)||void 0===e?void 0:e.legalName)===g.legalName&&(null===(t=v.value)||void 0===t?void 0:t.dba)===g.dba||h(q.create((0,y.toJS)(v.value)))}),[]);const b=e=>t=>{g.setValue(e,t),v.setValue(l,g)};return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:i?24:4}),r.createElement(m.BtInput,{size:"large",testID:"BusinessNameInput",value:(null===(t=v.value)||void 0===t?void 0:t.legalName)||"",label:p("Business.NameLabel"),onChangeText:b("legalName")}),r.createElement(f.hK,{height:i?24:4}),!i&&r.createElement(C.VY,{description:"Business.DbaTitle",style:{marginTop:24},sm:s,t:p}),r.createElement(m.BtInput,{size:"large",testID:"DbaInput",value:(null===(n=v.value)||void 0===n?void 0:n.dba)||"",label:p("Business.DbaLabel"),onChangeText:b("dba")}))}))};var J=n(12709),Z=n(16824);const X=e=>{let{doc:t,group:n,item:o,onValueUpdate:a,testID:l,label:i}=e;const{t:s}=(0,d.Bd)("application"),u=(0,r.useCallback)((e=>(0,J.validateUSPhoneNumber)(e)?"":s("ValidationErrors.InvalidPhone")),[s]),m=(0,r.useCallback)((e=>(0,J.validateUSPhoneNumber)(e||"")),[]),p=c(t,n,o,a,"",m);return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:22}),r.createElement(Z.v,{value:p.value,testID:l,label:s(i),validate:u,onChangeText:e=>{p.setValue(o,e.parsed)}}))},$={title:"Business.Phone",component:(0,a.PA)((e=>r.createElement(X,Object.assign({},e,{testID:"BusinessPhoneInput",label:"Business.PhoneLabel"}))))};var ee=n(92279);function te(e){return!!e&&e.length>0}const ne=[];const oe={title:"Business.Category",component:(0,a.PA)((function(e){const{doc:t,group:n,item:o,onValueUpdate:a,review:l}=e,i=c(t,n,o,a,ne,te),{t:s}=(0,d.Bd)("application"),{t:u}=(0,d.Bd)("onboarding"),p=[{value:ee.In.SUB_CONTRACTOR,label:u("subContractor")},{value:ee.In.GENERAL_CONTRACTOR,label:u("generalContractor")},{value:ee.In.DEALER_RETAILER_SUPPLIER,label:u("dealerRetailerSupplier")},{value:ee.In.MANUFACTURER_DISTRIBUTOR,label:u("manufacturerDistributor")},{value:ee.In.ARCHITECT_INTERIOR_DESIGNER,label:u("architectInteriorDesigner")},{value:ee.In.ENGINEER_CONSULTANT,label:u("engineerConsultant")},{value:ee.In.DEVELOPER_PROPERTY_OWNER,label:u("developerPropertyOwner")},{value:ee.In.OTHER,label:u("other")}];return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:l?24:18}),r.createElement(m.BtSelect,{model:i,label:s("Business.CategoryLabel"),placeholder:s("Business.CategoryPlaceholder"),options:p,keyName:"value",labelName:"label",onCh
1ange:e=>i.setValue("value",e.value),name:"value",testID:"BusinessCategoryInput"}))})),showFooterMessage:!0},re=e=>{let{doc:t,group:n,item:o,review:a,onValueUpdate:l,testID:i}=e;const{t:s}=(0,d.Bd)("application"),u=c(t,n,o,l,"",(0,r.useCallback)((e=>9===(null===e||void 0===e?void 0:e.length)),[]));return r.createElement(g.A,{style:{marginTop:a?24:18}},r.createElement(m.pb,{size:"large",label:s("Business.TaxIdLabel"),value:u.value,validate:()=>{var e;return 9!==(null===(e=u.value)||void 0===e?void 0:e.length)?s("ValidationErrors.InvalidTaxID"):""},onChangeText:e=>{/^\d*$/.test(e)&&u.setValue("value",e)},testID:i}))},ae={title:"Business.TaxId",component:(0,a.PA)((e=>r.createElement(re,Object.assign({},e,{testID:"businessInfo_ein"}))))},{validateEmail:le}=u.validators;function ie(e){return le(e)}const se={title:"Business.Email",component:(0,a.PA)((function(e){const{t:t}=(0,d.Bd)("application"),{doc:n,group:o,item:a,onValueUpdate:l}=e,i=c(n,o,a,l,"",ie);return r.createElement(m.BtInput,{model:i,name:"value",label:t("Business.EmailLabel"),testID:"BusinessEmailInput"})})),showFooterMessage:!0},ce={title:"Business.Start",component:(0,a.PA)((e=>{let{doc:t,item:n,group:o,review:a,onValueUpdate:l}=e;const{t:i}=(0,d.Bd)("application"),s=c(t,o,n,l,"",(0,r.useCallback)((e=>!!e&&(0,J.validateMonthAndYear)(e,1900)),[]));return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:a?24:18}),r.createElement(m.f3,{size:"large",format:"MM/YYYY",value:s.value,validate:e=>7!==e.length||(0,J.validateMonthAndYear)(e,1900)?"":i("ValidationErrors.InvalidDate"),testID:"BusinessStartDateInput",label:i("Business.StartLabel"),onChangeText:e=>{s.setValue("value",e)}}))}))};function de(e){return!!e&&e.length>0}const ue=["Electrical, Solar, Low Voltage","Plumbing, Pipeline, and Fire Protection","Framing and Rough Carpentry Contractor","Roofing and Waterproofing","Countertop fabricator and Installation","Landscaping, Paving, Earthwork","Finish Carpentry, Cabinet and Millwork","Drywall and Plaster","Concrete and Foundation","Insulation and Acoustical","Appliance Installation","Ceramic and Mosaic Tile","Flooring and Floor Covering","Lathing and Plastering","Masonry","Painting and Decorating","Structural Steel, Reinforcing Steel, and Sheet Meta","Swimming Pool","Glazing, Glass and Mirror","Elevator","Other"],me=[];const pe={title:"Business.Trade",description:"Business.TradeDescription",showFooterMessage:!0,component:(0,a.PA)((function(e){const{t:t}=(0,d.Bd)("application"),{doc:n,group:o,item:a,onValueUpdate:l,review:i}=e,s=c(n,o,a,l,me,de);return r.createElement(m.BtSelect,{model:s,placeholder:t("Business.TradePlaceholder"),label:t("Business.TradeLabel"),options:ue,primitiveArray:!0,multiSelect:!0,size:"large",name:"value",testID:"BusinessTradeInput",style:{marginTop:i?24:0}})}))},ge="Other",he=["Sole Proprietorship","Partnership","LLC","Corporation (S or C)",ge],ve=s.types.model("BusinessType",{selectedType:"",other:""}),ye=s.types.compose(ve,(0,u.E2)()).named("BusinessTypeStore"),be={title:"Business.Type",component:(0,a.PA)((e=>{var t,n,o;let{doc:a,item:l,group:i,review:s,onValueUpdate:u}=e;const{t:p}=(0,d.Bd)("application"),g=(0,r.useCallback)((e=>(null===e||void 0===e?void 0:e.selectedType)===ge?!(null===e||void 0===e||!e.other):!(null===e||void 0===e||!e.selectedType)),[]),h=c(a,i,l,u,ye.create({selectedType:"",other:""}),g,ve);return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:s?24:18}),r.createElement(m.BtSelect,{size:"large",options:he,testID:"BusinessTypeInput",label:p("Business.TypeLabel"),value:null===h||void 0===h||null===(t=h.value)||void 0===t?void 0:t.selectedType,placeholder:p("Business.TypePlaceholder"),onChange:e=>{var t;h.setValue("value",ye.create({selectedType:e,other:e===ge?null===h||void 0===h||null===(t=h.value)||void 0===t?void 0:t.other:""}))},primitiveArray:!0}),(null===h||void 0===h||null===(n=h.value)||void 0===n?void 0:n.selectedType)===ge&&r.createElement(r.Fragment,null,r.createElement(f.hK,{height:s?24:18}),r.createElement(m.C0,{size:"large",value:null===h||void 0===h||null===(o=h.value)||void 0===o?void 0:o.other,label:p("Business.OtherTypeLabel"),onChangeText:e=>{var t;h.setValue("value",ye.create({selectedType:null===h||void 0===h||null===(t=h.value)||void 0===t?void 0:t.selectedType,other:e}))}})))}))},fe={title:()=>o.Ay.isOwner||o.Ay.isAuthorised?"Owner.HomeAddress":"Owner.AuthorizedHomeAddress",component:(0,a.PA)((e=>r.createElement(r.Fragment,null,!e.review&&r.createElement(f.hK,{height:14}),r.createElement(G,Object.assign({},e,{testID:"user_address"})))))};var Ee=n(24594);const Ce=e=>{let{value:t,maxValue:n=100,label:o,testID:a,onChangeText:l,validate:i}=e;return r.createElement(Ee.Tr,{inputMask:"999",value:t?t.toString():void 0,testID:a,keyboardType:"numeric",label:o,placeholder:"%",onChangeText:e=>{const t=Number(e);t<=n&&l(t)}
1,validateInput:i,validateInputOnBlur:!0})},Ae={title:"Owner.OwnerPercentage",component:(0,a.PA)((e=>{const{t:t}=(0,d.Bd)("application"),{doc:n,group:a,item:l,onValueUpdate:i,review:s}=e,u=c(n,a,l,i,"",(e=>!!e&&Number(e)<=o.Ay.availableOwnerPercentage()));return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:s?24:18}),r.createElement(Ce,{value:u.value,onChangeText:e=>u.setValue("ownershipPercentage",e),validate:e=>{const n=Number(e),r=o.Ay.availableOwnerPercentage();return n>r?t("ValidationErrors.InvalidMaximumPercentage",{maxPercent:r}):""},label:t("Owner.PercentageLabel"),testID:"OwnershipPercentage"}))}))};var Se=n(49009),we=n(97537);const{validateUSPhoneNumber:Pe,validateEmail:Ie}=u.validators,xe=s.types.compose(s.types.model({firstName:"",lastName:"",email:"",phone:"",invited:s.types.optional(s.types.boolean,!1)}),(0,Se.E)()).views((e=>(e=>({get validPhone(){return Pe(e.phone)},validateEmail:()=>Ie(e.email)?o.Ay.coOwnersEmails.some((t=>t.email===e.email))?we.Ay.t("application:ValidationErrors.DuplicatedEmail"):"":we.Ay.t("application:ValidationErrors.InvalidEmail"),get allMandatoryFilled(){return(0,J.validateLetterAndWhiteSpace)(e.firstName)&&(0,J.validateLetterAndWhiteSpace)(e.lastName)&&""===e.validateEmail()&&e.validPhone}}))(e))),De=e=>{let{user:t,review:n,onChange:o}=e;const{t:a}=(0,d.Bd)("application"),l=(0,r.useCallback)((e=>(0,J.validateUSPhoneNumber)(e)?"":a("ValidationErrors.InvalidPhone")),[a]);return r.createElement(r.Fragment,null,r.createElement(j.fI,null,r.createElement(j.fv,{xs:12,sm:12,md:6,xl:6},r.createElement(m.BtInput,{model:t,name:"firstName",label:a("Finance.FirstnameLabel"),validateInput:e=>(0,J.validateLetterAndWhiteSpace)(e||"")?"":a("Finance.FirstNameError"),disabled:n,style:{marginTop:n?24:30},maxLength:70,onChange:()=>o(t),autoCapitalize:S.qK.Words,testID:"invitee_first_name"})),r.createElement(j.fv,{xs:12,sm:12,md:6,xl:6},r.createElement(m.BtInput,{model:t,name:"lastName",label:a("Finance.LastnameLabel"),validateInput:e=>(0,J.validateLetterAndWhiteSpace)(e||"")?"":a("Finance.LastNameError"),disabled:n,style:{marginTop:n?24:30},maxLength:70,onChange:()=>o(t),autoCapitalize:S.qK.Words,testID:"invitee_lasr_name"}))),r.createElement(f.hK,{height:n?24:30}),r.createElement(Z.v,{value:t.phone,label:a("Finance.PhoneLabel"),validate:l,disabled:n,onChangeText:e=>{t.setValue?t.setValue("phone",e.parsed):t.phone=e.parsed,o(t)},testID:"invitee_phone"}),r.createElement(m.BtInput,{model:t,name:"email",label:a("Finance.EmailLabel"),disabled:n,style:{marginTop:n?24:30},validateInput:()=>t.validateEmail(),validateInputOnBlur:!0,maxLength:255,onChange:()=>o(t),keyboardType:S.ui.EmailAddress,testID:"invitee_email"}))};function Te(e){return e.allMandatoryFilled}const ke=(0,a.PA)((e=>{const{sm:t}=(0,P.Qs)(),{doc:n,group:o,item:a,onValueUpdate:l,review:i,reviewLabel:s}=e,d=c(n,o,a,l,"",Te,xe),u=(0,r.useMemo)((()=>d.value?xe.create((0,y.toJS)(d.value)):xe.create({})),[d.value]);return r.createElement(r.Fragment,null,i?r.createElement(C.vd,null,s):t?r.createElement(C.gQ,null):null,r.createElement(De,{user:u,review:i,onChange:e=>{d.setValue(a,e)}}),!t&&!i&&r.createElement(r.Fragment,null,r.createElement(f.hK,{height:30}),r.createElement(C.gQ,null)),i&&r.createElement(r.Fragment,null,r.createElement(f.hK,{height:20}),r.createElement(C.Mj,{document:n})))})),Be={title:"Finance.AuthorisedDetails",component:(0,a.PA)((e=>{const{t:t}=(0,d.Bd)("application");return r.createElement(ke,Object.assign({},e,{reviewLabel:t("Finance.AuthDetailsReviewTitle")}))}))},Fe=e=>{let{doc:t,item:n,group:o,review:a,onValueUpdate:l,testID:i}=e;const{t:s}=(0,d.Bd)("application"),u=c(t,o,n,l,"",(0,r.useCallback)((e=>!!e&&(0,J.validateDate)(e,1900)),[]));return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:a?24:18}),r.createElement(m.f3,{size:"large",format:"MM/DD/YYYY",value:u.value,validate:e=>10!==e.length||(0,J.validateDate)(e,1900)?"":s("ValidationErrors.InvalidDate"),testID:i,label:s("Owner.BirthdayLabel"),onChangeText:e=>{u.setValue("value",e)}}))},_e={title:()=>o.Ay.isOwner||o.Ay.isAuthorised?"Owner.Birthdate":"Owner.AuthorizedBirthdate",component:(0,a.PA)((e=>r.createElement(Fe,Object.assign({},e,{testID:"user_birthdate"}))))};var Ne=n(59898);function Re(e){return!!e}const Le={title:"Finance.Authorized",component:(0,a.PA)((function(e){const{t:t}=(0,d.Bd)("application"),{doc:n,group:o,item:a,onValueUpdate:l,decidingQuestion:i,review:s}=e,u=c(n,o,a,l,"",Re),p=(0,r.useMemo)((()=>{const e=[{label:t("Owner.AuthorizedLabelYes"),value:"Yes"},{label:t("Owner.AuthorizedLabelNo"),value:"No"}];return r.createElement(m.HN,{disabled:i,model:u,name:"value",options:e,radioStyle:{marginRight:32},groupStyle:{flexDirection:"row"},testID:"businessOwner_isAuthorized"})}),[i,u,t]);return s?r.createElement(r.Fragment,null,r.createElement(f.hK,{height:24}),r.createElement(Ne.l,null,t("Finance.AuthorizedReviewTitle")),r.createElement(g.A,null,p)):p})),decidingQuestion:!0}
1;function Me(e){return!!e}const Oe={title:"Finance.Owner",component:(0,a.PA)((function(e){const{t:t}=(0,d.Bd)("application"),{doc:n,group:o,item:a,onValueUpdate:l,decidingQuestion:i,review:s}=e,u=c(n,o,a,l,"",Me,null),p=(0,r.useMemo)((()=>{const e=[{label:t("Finance.OwnerLabelYes"),value:"Yes"},{label:t("Finance.OwnerLabelNo"),value:"No"}];return r.createElement(m.HN,{disabled:i,model:u,name:"value",options:e,radioStyle:{marginRight:32},groupStyle:{flexDirection:"row"},testID:"businessOwner_isOwner"})}),[i,u,t]);return s?r.createElement(r.Fragment,null,r.createElement(f.hK,{height:s?24:4}),r.createElement(Ne.l,null,t("Finance.OwnerReviewTitle")),r.createElement(g.A,null,p)):p})),decidingQuestion:!0},ze=e=>{let{doc:t,group:n,item:o,review:a,testID:l,onValueUpdate:i}=e;const{t:s}=(0,d.Bd)("application"),u=c(t,n,o,i,"",(0,r.useCallback)((e=>{const t=e||"";return 9===(null===t||void 0===t?void 0:t.length)}),[]));return r.createElement(g.A,{style:{marginTop:a?24:22}},r.createElement(m.ZI,{size:"large",label:s("Finance.SSNlabel"),value:u.value,validate:()=>{var e;return 9!==(null===(e=u.value)||void 0===e?void 0:e.length)?s("ValidationErrors.InvalidSSN"):""},onChangeText:e=>{/^\d*$/.test(e)&&u.setValue("value",e)},testID:l}))},je={title:()=>o.Ay.isOwner||o.Ay.isAuthorised?"Owner.SSN":"Owner.AuthorizedSSN",component:(0,a.PA)((e=>r.createElement(ze,Object.assign({},e,{testID:"businessOwner_ssn"}))))};function We(e){return!!e}const Ve={title:"Finance.Debt",component:(0,a.PA)((function(e){const{t:t}=(0,d.Bd)("application"),{doc:n,group:o,item:a,onValueUpdate:l,review:i}=e,s=c(n,o,a,l,"",We);return r.createElement(r.Fragment,null,r.createElement(m.Spacer,{height:i?24:18}),r.createElement(m.m,{size:"large",label:t("Finance.DebtLabel"),value:s.value,onChangeText:e=>{s.setValue("value",e)}}))}))};function He(e){return!!e}const Ue={title:"Finance.Credit",component:(0,a.PA)((function(e){const{t:t}=(0,d.Bd)("application"),{doc:n,group:o,item:a,onValueUpdate:l,review:i}=e,s=c(n,o,a,l,"",He);return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:i?24:18}),r.createElement(m.m,{size:"large",label:t("Finance.CreditLabel"),value:s.value,onChangeText:e=>{s.setValue("value",e)}}))}))};function Ge(e){return!!e}const Ye={title:"Finance.AnnualRevenue",canSkip:!1,component:(0,a.PA)((function(e){const{t:t}=(0,d.Bd)("application"),{doc:n,group:o,item:a,onValueUpdate:l,decidingQuestion:i,review:s}=e,u=c(n,o,a,l,"",Ge);return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:s?16:18}),r.createElement(m.m,{size:"large",label:t("Finance.RevenueLabel"),value:u.value,disabled:i,onChangeText:e=>{u.setValue("value",e)},testID:"finance_revenue"}))})),decidingQuestion:!0};var Qe=n(68215),qe=n(88626),Ke=n(75187),Je=n(97976),Ze=n(38542);const Xe=e=>{let{isOwnerFilled:t=!0}=e;return r.createElement(_.Icon,{fill:t?Ze.theme.Tj.accent.secondary:Ze.theme.Tj.tertiary.light,style:{marginTop:12},width:20,height:20,name:"person"})},$e=p.A.create({container:{flexDirection:"row",alignItems:"flex-start",marginTop:15},properties:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",marginLeft:10,marginTop:9,width:"80%"},ownerName:{fontSize:16,fontWeight:"700"},propertyText:{fontSize:16,lineHeight:26},editButtonContainer:{marginLeft:"auto",flex:1,maxWidth:70,marginRight:-10}});var et=n(32553);const tt=e=>{let{value:t}=e;const[n,o]=(0,r.useState)(!0);return r.createElement(et.u8,{size:16,weight:"700",style:{lineHeight:26},onPress:()=>o(!n)},n?"*".repeat(t.length):t)},nt=e=>{let{label:t,value:n,secured:o=!1}=e;return r.createElement(j.fI,null,r.createElement(j.fv,{style:{flex:1}},r.createElement(m.BtText,{weight:"500",style:$e.propertyText},t)),r.createElement(j.fv,{style:{flex:2}},o&&n?r.createElement(tt,{value:n}):r.createElement(m.BtText,{weight:"700",style:{lineHeight:26}},n)))};var ot=n(89077);function rt(e){return e?(0,ot.L)(e,"US").formatNational().replace(/[()]/g,"").trim().replace(" ","-"):""}const at=e=>{let{draft:t,flowController:n}=e;const{t:a}=(0,d.Bd)("application"),{sm:l}=(0,b.Qs)(),i=e=>
1o.Ay.handleDocumentUpdate(e.value,e.identifier,e.group,e.filled,(0,qe.I)(e.group)||""),s=(e,o)=>({doc:t,group:"businessOwner",item:e,decidingQuestion:!1,onValueUpdate:i,flowController:n,sm:l,review:!0,testID:o}),c=(0,r.useMemo)((()=>{var e,r,a,l,i;return{firstName:null===(e=Je.A.userStore.user)||void 0===e?void 0:e.firstName,lastName:null===(r=Je.A.userStore.user)||void 0===r?void 0:r.lastName,email:(null===(a=Je.A.userStore.user)||void 0===a?void 0:a.email)||"",phone:(null===(l=Je.A.userStore.user)||void 0===l||null===(i=l.phone)||void 0===i?void 0:i.slice(2))||"",percentOwned:t.get("businessOwner","ownershipPercentage")||0,address:t.get("businessOwner","address"),birthdate:t.get("businessOwner","birthdate"),ssn:t.get("businessOwner","ssn"),isOwner:o.Ay.isOwner,isAuthorised:o.Ay.isAuthorised,isFilled:()=>{const e=n.getGroupSteps("businessOwner");return o.Ay.allStepsFilled(e)}}}),[t,n]);return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:25}),r.createElement(m.BtText,{size:12,weight:"500"},a("Preview.OwnerTitle")),r.createElement(m.HN,{value:c.isOwner,disabled:!0,options:[{label:a("Owner.AuthorizedLabelYes"),value:!0},{label:a("Owner.AuthorizedLabelNo"),value:!1}],radioStyle:{marginRight:32},groupStyle:{flexDirection:"row"}}),c.isOwner?null:r.createElement(r.Fragment,null,r.createElement(f.hK,{height:10}),r.createElement(m.BtText,{size:12,weight:"500"},a("Preview.AuthorizedSignerTitle")),r.createElement(m.HN,{value:c.isAuthorised,disabled:!0,options:[{label:a("Owner.AuthorizedLabelYes"),value:!0},{label:a("Owner.AuthorizedLabelNo"),value:!1}],radioStyle:{marginRight:32},groupStyle:{flexDirection:"row"}})),o.Ay.isOwner?r.createElement(g.A,{style:$e.container},r.createElement(Xe,{isOwnerFilled:c.isFilled()}),r.createElement(g.A,{style:$e.properties},c.firstName||c.lastName?r.createElement(m.BtText,{style:$e.ownerName},"".concat(c.firstName," ").concat(c.lastName)):null,r.createElement(g.A,{style:{width:"100%"}},r.createElement(nt,{label:a("Preview.Owner"),value:a("Preview.Percentage",{percentage:c.percentOwned})}),r.createElement(nt,{label:a("CoOwners.HomeAddress"),value:(0,Ke.M)(c.address)}),r.createElement(nt,{label:a("CoOwners.Birthday"),value:c.birthdate}),r.createElement(nt,{label:a("CoOwners.SSN"),value:c.ssn,secured:!0}),r.createElement(nt,{label:a("CoOwners.PhoneNumber"),value:rt(c.phone)}),r.createElement(nt,{label:a("CoOwners.EmailAddress"),value:c.email})),r.createElement(f.hK,{height:25}))):o.Ay.isAuthorised?r.createElement(g.A,null,r.createElement(G,s("address","preview_auth_address")),r.createElement(Fe,s("birthdate","preview_auth_birthdate")),r.createElement(ze,s("ssn","preview_auth_ssn")),r.createElement(f.hK,{height:25})):r.createElement(r.Fragment,null,r.createElement(f.hK,{height:15}),r.createElement(C.Mj,{document:t})),r.createElement(_.Divider,null))};const lt={title:"Preview.Heading",canMoveNext:!1,canSkip:!1,component:(0,a.PA)((function(e){const{t:t}=(0,d.Bd)("application"),{doc:n}=e,{showVerifyEmail:a,setShowVerifyEmail:l}=o.Ay,i=(0,r.useMemo)((()=>new Rt(n)),[n]),s=(0,r.useCallback)((e=>{o.Ay.handleDocumentUpdate(e.value,e.identifier,e.group,e.filled,(0,qe.I)(e.group)||"")}),[]),c=i.getFlowSteps();return r.createElement(r.Fragment,null,i.getFlowGroups().map((e=>{var a;const l=null===n||void 0===n||null===(a=n.data)||void 0===a?void 0:a.get(e);return l?r.createElement(r.Fragment,null,r.createElement(f.hK,{height:25}),r.createElement(g.A,{style:{flexDirection:"row",justifyContent:"space-between"}},r.createElement(m.BtText,{style:it.sectionTitle,key:null===l||void 0===l?void 0:l.title},t(null===l||void 0===l?void 0:l.title)),r.createElement(m.b_,{title:t("Review.Edit"),textStyle:it.linkText,disabled:o.Ay.buttonLoading,onPress:()=>{i.editSection(l.group)}})),r.createElement(f.hK,{height:4}),"businessOwner"===e?r.createElement(at,{draft:n,flowController:i}):l.items.map((e=>{if(!c.includes("".concat(l.group,".").concat(e.identifier)))return null;const t=i.findComponent(l.group,e.identifier);if(!t)return null;const{component:o,decidingQuestion:a}=t;return r.createElement(o,{doc:n,group:l.group,item:e.identifier,decidingQuestion:a,onValueUpdate:s,flowController:i,review:!0})}))):null})),r.createElement(C.w8,{close:a,setClose:l}),o.Ay.isCreditApplication&&r.createElement(C.RS,null))})),showFooterMessage:!0},it=p.A.create({sectionTitle:{fontWeight:"600",fontSize:20,lineHeight:26},linkText:{color:Qe.commonColors.accentText,fontWeight:"600",fontSize:16,lineHeight:24}});var st=n(38767),ct=n(38117);const dt=e=>{let{style:t}=e;const{t:n}=(0,d.Bd)("application");return r.createElement(g.A,{style:[ut.wrapper,t]},r.createElement(k.eUD,{width:40,style:ut.icon}),r.createElement(m.BtText,{style:ut.message},r.createElement(d.x6,{t:n,i18nKey:"CoOwners.AgreementWarning",components:{styled:r.createElement(ct.A,{style:{fontWeight:"700"}})}})))},ut={wrapper:{width:"100%",borderRadius:12,backgroundColor:"#F5F7F8",padding:15,flexDirection:"row"},icon:{marginLeft:10,marginRight:20,marginTop:5},message:{fontFamily:"Inter",color:"#003353",fontSize:16,lineHeight:24,fontWeight:"500"}};var mt=n(30928),pt=n(10272);const gt=(0,n(63680).PA)((e=>{let{style:t}=e;const{t:n}=(0,d.Bd)("application");if(!o.Ay.hasSubmissionRights)return null;const a=o.Ay.coOwnerWithApplicantEmail;return a?r.createElement(g.A,{style:[ht.wrapper,t]},r.createElement(_.Icon,{name:"alert-triangle-outline",fill:"red",width:22,style:ht.icon}),r.createElement(m.BtText,{style:ht.message},r.createElement(d.x6,{t:n,i18nKey:"CoOwners.DuplicatedEmailWarning",values:{coOwnerName:a.name},components:{styled:r.createElement(ct.A,{style:{fontWeight:"700"}})}}))):null})),ht=p.A.create({wrapper:{width:"100%",borderRadius:12,backgroundColor:"rgba(236, 0, 42, 0.05)",padding:15,marginBottom:20,flexDirection:"row"},icon:{marginLeft:10,marginRight:20,marginTop:5},message:{fontFamily:"Inter",color:pt.B.text.mainSecondary,fontSize:16,lineHeight:24,fontWeight:"500"}});const vt={title:"Review.Heading",canSkip:!1,canMoveNext:!1,showFooterMessage:!0,component:(0,a.PA)((function(e){const{t:t}=(0,d.Bd)("application"),{doc:n,flowController:a}=e,{sm:l}=(0,P.Qs)(),{showVerifyEmail:i,setShowVerifyEmail:s,isInvitedOwner:c,isInHouseCreditApplication:u,isCreditApplication:p,hasOwnerPersonalInformation:h,hasSubmissionRights:v,authorisedInvitee:y,buttonLoading:b,agreementsAccepted:E}=o.Ay,A=a.getFlowGroups(),S=a.getFlowSteps(),w=o.Ay.canSubmit(S),I=e=>{o.Ay.buttonLoading||a.editSection(e,!1)},x=e=>{let{section:n}=e;return r.createElement(g.A,{style:yt.listView},r.createElement(k.v3G,{style:{width:16,height:12}}),r.createElement(m.BtText,{style:yt.listText},t((0,qe.I)(n))),r.createElement(m.b_,{title:t("Review.Edit"),textStyle:yt.linkText,onPress:()=>I(n),disabled:o.Ay.buttonLoading}))},D=e=>{let{section:n}=e;const l=a.getGroupSteps(n),i=!o.Ay.allRequiredStepsFilled(l);return r.createElement(g.A,{style:(0,st.composeStyle)(yt.listView,i&&{height:96,paddingTop:23,alignItems:"flex-start"})},r.createElement(k.jNK,{style:{width:16,height:12,marginTop:7}}),r.createElement(g.A,{style:yt.childView},r.createElement(m.BtText,{style:(0,st.composeStyle)(yt.listText,{marginLeft:0})},t((0,qe.I)(n))),i&&r.createElement(m.BtText,{style:yt.warningText},t("Review.IncompleteSectionText"))),r.createElement(m.b_,{title:t("Review.Edit"),textStyle:yt.linkText,onPress:()=>I(n),disabled:o.Ay.buttonLoading}))},T=()=>r.createElement(g.A,{style:{backgroundColor:Qe.commonColors.backgroundColor,borderRadius:12,padding:16}},r.createElement(g.A,{style:{flexDirection:"row"}},r.createElement(k.zUe,{style:{height:18,width:18,marginTop:4}}),r.createElement(m.BtText,{style:{fontSize:16,marginLeft:12,marginBottom:12}},t("Review.PersonalInformationPrompt"))),r.createElement(g.A,null,r.createElement(m.BtButton,{size:"small",style:{marginLeft:30,maxWidth:217},onPress:()=>{o.Ay.setEditMode(o.WF.SKIP_FILLED_STRICT),a.editSection("businessOwner",!1)}},t("Review.CompleteApplication"))));return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:22}),c&&!h&&!u&&r.createElement(T,null),A.map((e=>{const t=a.getGroupSteps(e);return t.length?o.Ay.allStepsFilled(t)?r.createElement(x,{key:e,section:e}):r.createElement(D,{key:e,section:e}):null})),r.createElement(f.hK,{height:12}),!v&&null!==y&&void 0!==y&&y.invited?r.createElement(r.Fragment,null,r.createElement(f.hK,{height:17}),r.createElement(C.Mj,{document:n})):r.createElement(f.hK,{height:20}),r.createElement(gt,null),o.Ay.isCreditApplication&&o.Ay.hasCoOwners?r.createElement(dt,null):null,l&&r.createElement(g.A,{style:{alignItems:"center"}},o.Ay.hasSubmissionRights?r.createElement(r.Fragment,null,r.createElement(mt.y,{canSubmit:w,document:n,style:{marginBottom:12,backgroundColor:"#FFF"}}),p?r.createElement(m.BtButton,{disabled:!w||b||!E||Je.A.isBusy,style:{width:320,marginBottom:36},onPress:()=>n.setSection("review.agreement"),testID:"ApplicationContinueToAgreementButton",loading:b},t("Review.Continue")):r.createElement(C.b7,{t:t,canSubmit:w})):r.createElement(f.hK,{height:20}),r.createElement(m.b_,{disabled:Je.A.isBusy||o.Ay.buttonLoading,title:t("Review.ReviewButton"),textStyle:Je.A.isBusy?yt.disabledLinkText:yt.linkText,onPress:()=>n.setSection("review.preview"),testID:"ApplicationReviewButton"})),r.createElement(C.w8,{close:i,setClose:s}),p&&r.createElement(C.RS,null))}))},yt=p.A.create({listView:{height:76,flexDirection:"row",alignItems:"center",borderBottomColor:"#CCD6DD",borderBottomWidth:1},listText:{marginLeft:24,fontWeight:"600",fontSize:20,lineHeight:26,color:"#335C75",flex:1},linkText:{color:Qe.commonColors.accentText,fontWeight:"600",fontSize:16,lineHeight:24},childView:{flex:1,marginLeft:15},warningText:{marginTop:9,color:"#FE8134",fontWeight:"500",fontSize:14,lineHeight:16},disabledLinkText:{color:"#99ADBA",fontWeight:"700",fontSize:16,lineHeight:24}});var bt=n(35866);
1const ft=s.types.model({id:"",type:s.types.optional(s.types.enumeration(Object.values(bt.H)),bt.H.INDIVIDUAL),percentOwned:0,address:"",city:"",state:"",zip:"",phone:"",email:"",firstName:"",lastName:"",birthday:"",ssn:"",entityName:"",ein:"",key:""}).views((e=>({get isFilled(){const t=[e.firstName,e.lastName,e.percentOwned,e.address,e.city,e.state,e.zip,e.phone,e.email].concat(e.type===bt.H.INDIVIDUAL?[e.birthday,e.ssn]:[e.entityName,e.ein]).every((e=>e)),n=e.type===bt.H.INDIVIDUAL&&(0,J.validateSsn)(e.ssn)&&(0,J.validateDate)(e.birthday,1900),r=e.type===bt.H.ENTITY&&(0,J.validateSsn)(e.ein);return o.uP<=e.percentOwned&&e.percentOwned<=100&&t&&(0,J.validateEmail)(e.email)&&(0,J.validateUSPhoneNumber)(e.phone)&&(0,J.validateZip)(e.zip)&&(n||r)}}))).actions((e=>({setType:t=>{t===bt.H.ENTITY?(e.firstName="",e.lastName="",e.birthday="",e.ssn=""):(e.entityName="",e.ein=""),e.type=t},setPercentage:t=>e.percentOwned=t,setPhone:t=>e.phone=t,setEmail:t=>e.email=t,setFirstName:t=>e.firstName=t,setLastName:t=>e.lastName=t,setBirthday:t=>e.birthday=t,setSSN:t=>e.ssn=t,setEntityName:t=>e.entityName=t,setEIN:t=>e.ein=t,setKey:t=>e.key=t}))),Et=s.types.compose(ft,(0,u.E2)()),Ct=s.types.model({coOwners:s.types.optional(s.types.array(Et),[])}).views((e=>({get isFilled(){const t=new Set(e.coOwners.map((e=>e.email))).size===e.coOwners.length;return(0===e.coOwners.length||e.coOwners.every((e=>e.isFilled)))&&t&&o.Ay.totalOwnershipPercentage<=100},get hasCoOwners(){return e.coOwners.length>0},get coOwnersCount(){return e.coOwners.length},get:t=>e.coOwners[t]}))).actions((e=>
1({fill(t){e.coOwners.clear();[1,2,3,4].map((e=>null===t||void 0===t?void 0:t.get("coOwnerInfo","coOwner".concat(e)))).filter((e=>e)).forEach((e=>this.add(e)))},add(t){e.coOwners.push(t);const n=e.coOwners.length-1;return e.coOwners[n].key=n+(new Date).getTime().toString(),n},removeAt(t){e.coOwners.splice(t,1)},updateAt(t,n){e.coOwners[t]=n},updateDraft(){const t=E.A.userStore.document;null===t||void 0===t||t.setContent("coOwnerInfo","coOwners",e.hasCoOwners,e.isFilled);for(let n=e.coOwners.length+1;n<=4;n++)null===t||void 0===t||t.clearItems(["coOwnerInfo.coOwner".concat(n)]);for(let n=0;n<e.coOwners.length;n++){const o=e.coOwners[n],r=(0,s.getSnapshot)(o);null===t||void 0===t||t.setContent("coOwnerInfo","coOwner".concat(n+1),{...r,key:void 0},o.isFilled)}}}))),At=(0,r.createContext)(Ct.create());function St(){return(0,r.useContext)(At)}const wt=(0,a.PA)((e=>{let{coOwner:t,onSave:n,onCancel:a}=e;const{t:l}=(0,d.Bd)("application"),{sm:i}=(0,P.Qs)(),s=St(),c=e=>{const t=Number(e),n=o.Ay.availableCoOwnerPercentage(o.Ay.currentCoOwnerIndex);return t<o.uP?l("ValidationErrors.InvalidMinimumPercentage"):t>n?l("ValidationErrors.InvalidMaximumPercentage",{maxPercent:n}):""},u=e=>{const n=o.Ay.applicantEmail===e,r=s.coOwners.some((n=>t.id!==n.id&&n.email===e));return(0,J.validateEmail)(e)?n||r?l("ValidationErrors.DuplicatedEmail"):"":l("ValidationErrors.InvalidEmail")};return r.createElement(r.Fragment,null,r.createElement(f.hK,{height:16}),r.createElement(m.KS,null),r.createElement(f.hK,{height:25}),r.createElement(m.HN,{value:null===t||void 0===t?void 0:t.type,onCh
1ange:e=>t.setType(e),options:[{label:l("CoOwners.IndividualOwner"),value:bt.H.INDIVIDUAL},{label:l("CoOwners.EntityOwner"),value:bt.H.ENTITY}],radioStyle:{marginRight:32},groupStyle:{flexDirection:"row"},testID:"coOwner_type"}),r.createElement(f.hK,{height:15}),r.createElement(Ce,{value:(null===t||void 0===t?void 0:t.percentOwned)||0,onChangeText:e=>null===t||void 0===t?void 0:t.setPercentage(e),validate:c,label:l("CoOwners.OwnershipPercentage"),testID:"coOwner_percentage"}),(null===t||void 0===t?void 0:t.type)===bt.H.INDIVIDUAL?r.createElement(g.A,{style:{flexDirection:i?"row":"column",marginTop:22}},r.createElement(m.BtInput,{value:(null===t||void 0===t?void 0:t.firstName)||"",onChangeText:e=>null===t||void 0===t?void 0:t.setFirstName(e),label:l("CoOwners.FirstName"),style:{flexGrow:1},testID:"coOwner_firstName"}),i?r.createElement(f.hK,{width:15}):r.createElement(f.hK,{height:15}),r.createElement(m.BtInput,{value:(null===t||void 0===t?void 0:t.lastName)||"",onChangeText:e=>null===t||void 0===t?void 0:t.setLastName(e),label:l("CoOwners.LastName"),style:{flexGrow:1},testID:"coOwner_lastName"})):r.createElement(r.Fragment,null,r.createElement(m.BtInput,{value:(null===t||void 0===t?void 0:t.entityName)||"",onChangeText:e=>null===t||void 0===t?void 0:t.setEntityName(e),style:{marginTop:22},label:l("CoOwners.EntityName"),testID:"coOwner_entityName"}),r.createElement(g.A,{style:{flexDirection:i?"row":"column",marginTop:22}},r.createElement(m.BtInput,{value:(null===t||void 0===t?void 0:t.firstName)||"",onChangeText:e=>null===t||void 0===t?void 0:t.setFirstName(e),label:l("CoOwners.AuthorizedRepresentativeFirstName"),style:{flexGrow:1},testID:"coOwner_entityAuthfirstName"}),i?r.createElement(f.hK,{width:15}):r.createElement(f.hK,{height:15}),r.createElement(m.BtInput,{value:(null===t||void 0===t?void 0:t.lastName)||"",onChangeText:e=>null===t||void 0===t?void 0:t.setLastName(e),label:l("CoOwners.AuthorizedRepresentativeLastName"),style:{flexGrow:1},testID:"coOwner_entityAuthlastName"}))),r.createElement(f.hK,{height:15}),r.createElement(W,{model:t,label:(null===t||void 0===t?void 0:t.type)===bt.H.INDIVIDUAL?l("CoOwners.HomeAddress"):l("CoOwners.EntityAddress"),testID:"coOwner_address",collapsible:!0}),r.createElement(f.hK,{height:25}),(null===t||void 0===t?void 0:t.type)===bt.H.INDIVIDUAL?r.createElement(r.Fragment,null,r.createElement(m.f3,{value:null===t||void 0===t?void 0:t.birthday,onChangeText:e=>null===t||void 0===t?void 0:t.setBirthday(e),format:"MM/DD/YYYY",validate:e=>10!==e.length||(0,J.validateDate)(e,1900)?"":l("ValidationErrors.InvalidDate"),testID:"coOwner_birthday",label:l("CoOwners.Birthday")}),r.createElement(f.hK,{height:15})):null,(null===t||void 0===t?void 0:t.type)===bt.H.INDIVIDUAL?r.createElement(m.ZI,{value:null===t||void 0===t?void 0:t.ssn,onChangeText:e=>null===t||void 0===t?void 0:t.setSSN(e),label:l("CoOwners.SSN"),validationError:l("ValidationErrors.InvalidSSN"),testID:"coOwner_ssn"}):r.createElement(m.pb,{value:t.ein,onChangeText:e=>t.setEIN(e),label:l("CoOwners.EIN"),validationError:l("ValidationErrors.InvalidTaxID"),testID:"coOwner_ein"}),r.createElement(f.hK,{height:25}),r.createElement(Z.v,{value:null===t||void 0===t?void 0:t.phone,onChangeText:e=>null===t||void 0===t?void 0:t.setPhone(e.parsed),label:l("CoOwners.PhoneNumber"),validationError:l("ValidationErrors.InvalidPhone"),testID:"coOwner_phone"}),r.createElement(f.hK,{height:25}),r.createElement(m.BtInput,{value:null===t||void 0===t?void 0:t.email,onChangeText:e=>null===t||void 0===t?void 0:t.setEmail(e),validateInput:e=>u(e),label:l("CoOwners.EmailAddress"),testID:"coOwner_email"}),o.Ay.isCreditApplication?r.createElement(dt,{style:{marginTop:30}}):null,r.createElement(g.A,{style:{flexDirection:"row",justifyContent:"flex-end",marginTop:30}},r.createElement(m.BtButton,{onPress:a,appearance:"ghost",status:"basic",style:{marginRight:20},testID:"coOwner_cancel"},l("CoOwners.Cancel")),r.createElement(m.BtButton,{onPress:()=>n(t),disabled:!(!c(t.percentOwned)&&(!t.email||!u(t.email))),style:{width:150},testID:"coOwner_save"}
1,l("CoOwners.Save"))))})),Pt=(0,a.PA)((e=>{let{coOwners:t,doc:n,flowController:a}=e;const{t:l}=(0,d.Bd)("application");return r.createElement(r.Fragment,null,t.map(((e,t)=>r.createElement(r.Fragment,null,r.createElement(g.A,{style:$e.container,key:e.key},r.createElement(Xe,{isOwnerFilled:e.isFilled}),r.createElement(g.A,{style:$e.properties},e.firstName||e.lastName||e.entityName?r.createElement(m.BtText,{style:$e.ownerName},e.type===bt.H.INDIVIDUAL?"".concat(e.firstName," ").concat(e.lastName):e.entityName):null,r.createElement(g.A,null,r.createElement(nt,{label:l("Preview.CoOwner"),value:l("Preview.Percentage",{percentage:e.percentOwned})}),r.createElement(nt,{label:l(e.type===bt.H.INDIVIDUAL?"CoOwners.HomeAddress":"Preview.LegalAddress"),value:(0,Ke.M)(e)}),e.type===bt.H.INDIVIDUAL&&r.createElement(nt,{label:l("CoOwners.Birthday"),value:e.birthday}),e.type===bt.H.INDIVIDUAL&&r.createElement(nt,{label:l("CoOwners.SSN"),value:e.ssn,secured:!0}),e.type===bt.H.ENTITY&&r.createElement(nt,{label:l("Preview.EIN"),value:e.ein,secured:!0}),r.createElement(nt,{label:l("CoOwners.PhoneNumber"),value:rt(e.phone)}),r.createElement(nt,{label:l("CoOwners.EmailAddress"),value:e.email}),e.type===bt.H.ENTITY&&r.createElement(nt,{label:l("Preview.AuthorizedRepresentative"),value:"".concat(e.firstName," ").concat(e.lastName)}))),r.createElement(g.A,{style:$e.editButtonContainer},r.createElement(m.BtButton,{appearance:"ghost",size:"small",status:"basic",onPress:()=>{o.Ay.setPreviousStep(n.current),o.Ay.setCurrentCoOwnerIndex(t),a.editSection("coOwnerInfo")},iconLeft:"edit-outline"},l("Review.Edit")))),r.createElement(f.hK,{height:20}),r.createElement(_.Divider,null)))))})),It=e=>{let{onPress:t}=e;const{t:n}=(0,d.Bd)("application"),{sm:a}=(0,b.Qs)();return r.createElement(r.Fragment,null,o.Ay.canHaveCoOwners?r.createElement(m.BtButton,{size:"small",appearance:"ghost",status:"basic",onPress:t,style:a?{marginLeft:"auto"}:{marginTop:20,width:180,alignSelf:"center"},iconLeft:"plus-outline"},n("CoOwners.AddCoOwner")):null)};var xt=n(63913);const Dt=p.A.create({coOwnersList:{flexDirection:"row",alignItems:"flex-start",marginTop:15},coOwnerDetails:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",marginLeft:10,marginTop:10},footer:{flexDirection:"row",paddingTop:20,paddingBottom:25},coOwnerType:{fontSize:14,fontWeight:"400",color:"gray"},ownerName:{fontSize:16,fontWeight:"700",marginTop:5},coOwnerPercentage:{fontSize:16,fontWeight:"500",marginTop:5,marginBottom:10},coOwnerButtons:{flexDirection:"row",marginLeft:"auto"},totalPercentageContainer:{flexDirection:"row",marginTop:5},percentageAmount:{fontSize:16,fontWeight:"700"}}),Tt={title:()=>o.Ay.currentCoOwnerIndex<0?"CoOwners.Title":"CoOwners.CoOwnerDetailsTitle",description:"",component:(0,a.PA)((e=>{let{doc:t,flowController:n,onValueUpdate:a,setNavigationVisible:l,review:i}=e;const{t:c}=(0,d.Bd)("application"),{sm:u}=(0,b.Qs)(),p=St();(0,r.useEffect)((()=>{p.fill(t),y()}),[t]),(0,r.useEffect)((()=>{l&&(o.Ay.currentCoOwnerIndex<0?l(!0):l(!1))}),[o.Ay.currentCoOwnerIndex]);const h=()=>{v(p.coOwnersCount)},v=e=>{o.Ay.setCurrentCoOwnerIndex(e),l(!1)},y=()=>a({value:p.hasCoOwners,filled:p.isFilled,group:"coOwnerInfo",identifier:"coOwners"});return r.createElement(r.Fragment,null,i?r.createElement(Pt,{coOwners:p.coOwners,doc:t,flowController:n}):r.createElement(r.Fragment,null,o.Ay.currentCoOwnerIndex<0&&r.createElement(r.Fragment,null,r.createElement(gt,{style:{marginVertical:16}}),p.coOwners.map(((e,t)=>r.createElement(r.Fragment,null,r.createElement(g.A,{style:Dt.coOwnersList,key:e.key},r.createElement(Xe,{isOwnerFilled:e.isFilled}),r.createElement(g.A,{style:Dt.coOwnerDetails},r.createElement(m.BtText,{style:Dt.coOwnerType,onPress:()=>v(t)},e.type===bt.H.INDIVIDUAL?c("CoOwners.IndividualOwner"):c("CoOwners.EntityOwner")),e.firstName||e.lastName||e.entityName?r.createElement(m.BtText,{style:Dt.ownerName,onPress:()=>v(t)},e.type===bt.H.INDIVIDUAL?"".concat(e.firstName," ").concat(e.lastName):e.entityName):null,r.createElement(m.BtText,{style:Dt.coOwnerPercentage,onPress:()=>v(t)},"".concat(e.percentOwned,"% ").concat(c("CoOwners.OwnerPercentagePostfix")))),r.createElement(g.A,{style:Dt.coOwnerButtons},r.createElement(m.BtButton,{appearance:"ghost",size:"small",status:"basic",onPress:()=>v(t),iconLeft:"edit-outline"},c("Review.Edit")),r.createElement(m.BtButton,{size:"small",appearance:"ghost",status:"basic",onPress:()=>(e=>{p.removeAt(e),p.updateDraft(),y()})(t),iconLeft:"trash-2-outline"},c("Bank.DeleteManualButton")))),r.createElement(_.Divider,null)))),r.createElement(g.A,{style:Dt.footer},r.createElement(g.A,{style:Dt.totalPercentageContainer},r.createElement(m.BtText,{style:Dt.percentageAmount},c("CoOwners.TotalPercentage")),r.createElement(m.BtText,{size:16,color:o.Ay.totalOwnershipPercentage>100?"#DB081C":""},o.Ay.totalOwnershipPercentage,"%")),u&&r.createElement(It,{onPress:()=>h()})),r.createElement(_.Divider,null),!u&&r.createElement(It,{onPress:()=>h()})),o.Ay.currentCoOwnerIndex>=0&&r.createElement(wt,{coOwner:(()=>{const e=p.get(o.Ay.currentCoOwnerIndex),t=e?(0,s.getSnapshot)(e):{id:(0,xt.A)()};return Et.create(t)})(),onSave:e=>{o.Ay.currentCoOwnerIndex===p.coOwnersCount?p.add(e):p.updateAt(o.Ay.currentCoOwnerIndex,e),p.updateDraft(),o.Ay.setCurrentCoOwnerIndex(-1),o.Ay.tryGoBackToReview(),l(!0),y()},onCancel:()=>{o.Ay.setCurrentCoOwnerIndex(-1),o.Ay.tryGoBackToReview(),l(!0)}})))})),handleBack:()=>o.Ay.currentCoOwnerIndex>=0&&(o.Ay.setCurrentCoOwnerIndex(-1),o.Ay.tryGoBackToReview(),!0)};function kt(e){return!!e}const Bt={title:"Finance.ArAdvanceRequestedLimit",description:"Finance.ArAdvanceRequestedLimitDescription",component:(0,a.PA)((function(e){const{t:t}=(0,d.Bd)("application"),{doc:n,group:o,item:a,onValueUpdate:l,review:i}=e,s=c(n,o,a,l,"",kt);return r.createElement(r.Fragment,null,r.createElement(m.Spacer,{height:i?24:18}),r.createElement(m.m,{size:"large",label:t("Finance.ArAdvanceRequestedLimitLabel"),value:s.value,onChangeText:e=>{s.setValue("value",e)}}))}))};var Ft=n(60236);let _t=null;const Nt={title:"Agreement.Heading",titleWrapperStyle:{textAlign:"center"},canMoveNext:!1,canSkip:!1,component:(0,a.PA)((function(){const{t:e}=(0,d.Bd)("application"),[t,n]=(0,r.useState)(null),[a,l]=(0,r.useState)(!0),[i,s]=(0,r.useState)(!1),{showVerifyEmail:c,setShowVerifyEmail:u,isGetPaidApplication:m,isCreditApplication:p}=o.Ay,h=(0,r.useRef)(!1);return(0,r.useEffect)((()=>
1{if(h.current)return;return(async()=>{l(!0);const e=await(async()=>(_t||(_t=(async()=>{try{const{url:e}=o.Ay.isGetPaidApplication?await o.Ay.getInvoicePurchaseAgreement():o.Ay.isCreditApplication?await o.Ay.getMasterAgreement():{url:null};return e}catch(e){return console.error("Failed to download agreement:",e),null}})()),_t))();n(e),l(!1),h.current=!0})(),()=>{h.current=!1,_t=null}}),[m,p]),m||p?a?r.createElement(A.A,null):t?r.createElement(r.Fragment,null,r.createElement(g.A,{style:{alignItems:"center"}},r.createElement(g.A,{style:{marginTop:20,marginBottom:44}},r.createElement(Ft.A,{pdfUrl:t,onReachedAgreementEnd:()=>{s(!0)}})),r.createElement(C.b7,{t:e,canSubmit:i})),r.createElement(C.w8,{close:c,setClose:u})):r.createElement(g.A,null,"Error loading document."):null})),showFooterMessage:!1};class Rt{constructor(e){this.document=void 0,this.flow={businessInfo:{firstStepChoice:()=>o.Ay.firstQuestion,email:{editor:se,beforeMoveNext:()=>o.Ay.updateUserEmail()},category:{editor:oe,beforeMoveNext:()=>o.Ay.updateCompanyCategory()},categoryChoice:()=>o.Ay.isSubContractor?"businessInfo.trade":"businessInfo.businessName",trade:pe,businessName:K,businessPhone:$,businessAddress:Y,startDate:ce,type:be,ein:ae},finance:{revenue:Ye,debt:Ve,debtChoice:()=>o.Ay.isGetPaidApplication?"finance.arAdvanceRequestedLimit":"finance.howMuchCredit",howMuchCredit:Ue,howMuchCreditChoice:()=>o.Ay.isInHouseCreditApplication?"bank.details":"businessOwner.alreadySubmittedChoice",arAdvanceRequestedLimit:Bt},businessOwner:{alreadySubmittedChoice:()=>o.Ay.isGetPaidSubmitted?o.Ay.isOwner||o.Ay.isAuthorised?"businessOwner.address":"businessOwner.authorisedDetails":"businessOwner.isOwner",isOwner:{editor:Oe,onSkip:"bank.details"},isOwnerChoice:()=>o.Ay.isOwner?"businessOwner.ownershipPercentage":"businessOwner.isAuthorised",ownershipPercentage:Ae,goto:()=>"businessOwner.address",isAuthorised:{editor:Le,onSkip:"bank.details"},isAuthorisedChoice:()=>o.Ay.isAuthorised?"businessOwner.address":o.Ay.isGetPaidApplication?"coOwnerInfo.coOwnersChoice":"businessOwner.authorisedDetails",authorisedDetails:{editor:Be,beforeMoveNext:()=>o.Ay.inviteUser("authorisedDetails")},address:fe,birthdate:_e,ssn:je},coOwnerInfo:{coOwnersChoice:()=>o.Ay.canHaveCoOwners||o.Ay.hasCoOwners?"coOwnerInfo.coOwners":"bank.details",coOwners:Tt},bank:{details:{editor:O,beforeMoveNext:()=>o.Ay.updatePrimaryBankAccount()}},review:{review:vt,preview:lt,agreement:Nt}},this.document=e}moveToNextStep(e,t){this.updateDocument(e,t),this.doTransitionLogic();const n=this.findNextStep(this.document.current);n&&this.updateDocumentCurrentPath(n)}skipToNextStep(e,t){this.updateDocument(e,t);const n=this.findStepByPath(this.document.current);if(n&&"onSkip"in n){const e=n.onSkip;if(e instanceof Function){const t=e();t&&this.document.setCurrent(t)}else e&&this.document.setCurrent(e)}else{const e=this.findNextStep(this.document.current);e&&this.updateDocumentCurrentPath(e)}}moveToPreviousStep(e,t){this.updateDocument(e,t);const n=this.getFlowSteps(!0),o=n.indexOf(this.document.current);o>0&&"review.agreement"!==this.document.current?this.document.setCurrent(n[o-1]):this.document.setCurrent("review.review")}canMoveToPreviousStep(){var e,t,n,o,r,a,l,i,s;const c=(null===(e=this.document)||void 0===e||null===(t=e.data)||void 0===t||null===(n=t.get("review"))||void 0===n||null===(o=n.items)||void 0===o?void 0:o.some((e=>"review"===e.identifier)))||(null===(r=this.document)||void 0===r||null===(a=r.filled)||void 0===a?void 0:a.includes("review.review"));return"review.review"!==(null===(l=this.document)||void 0===l?void 0:l.current)&&(c||(null===(i=this.document)||void 0===i?void 0:i.current)&&(null===(s=this.document)||void 0===s?void 0:s.current)!==this.getInitialStep())}editSection(e){var t;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=null===(t=this.document)||void 0===t?void 0:t.data.get(e),a=this.getFirstGroupStep(e);if(n||!r||r.allFilled)o.Ay.goToQuestion(a,this.document);else{var l;const t=o.Ay.firstSkipped(e);null===(l=this.document)||void 0===l||l.setSection("".concat(e,".").concat(t))}}
1updateDocument(e,t){o.Ay.handleDocumentUpdate(e.value,e.identifier,e.group,e.filled,t)}getInitialStep(){const e=Object.keys(this.flow)[0];return this.getFirstGroupStep(e)}getCurrentStep(e){return(null===e||void 0===e?void 0:e.current)||this.getInitialStep()}findNextStep(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const[n,r]=e.split("."),a=this.flow[n],l=Object.keys(a),i=l.indexOf(r);let s,c=n;if(i<l.length-1)s=l[i+1];else{const e=Object.keys(this.flow),t=e.indexOf(n);t<e.length-1&&(c=e[t+1],s=Object.keys(this.flow[c])[0])}if(!s)return"";const d=this.tryHandleConditionalJumps(c,s),u=[o.WF.SKIP_FILLED,o.WF.SKIP_FILLED_STRICT].includes(o.Ay.editMode);if(t&&u&&(o.Ay.editMode===o.WF.SKIP_FILLED_STRICT||!["finance.debt","finance.howMuchCredit","bank.details"].includes(d))){const[e,t]=d.split(".");if(o.Ay.isFilled(e,t))return this.findNextStep(d)}return d}findComponent(e,t){return this.findComponentByPath("".concat(e,".").concat(t))}findComponentByPath(e){const t=this.findStepByPath(e);return void 0===t||t instanceof Function?void 0:"editor"in t?t.editor:t}getProgress(){const e=this.getFlowSteps();return e.reduce(((e,t)=>{const[n,r]=t.split(".");return o.Ay.isFilled(n,r)?e+1:e}),0)/e.length}getFlowGroups(){const e=this.getFlowSteps().map((e=>{const[t,n]=e.split(".");return t})),t=new Set(e);return Array.from(t)}getFirstGroupStep(e){const t=Object.keys(this.flow[e])[0];return this.tryHandleConditionalJumps(e,t)}getFlowSteps(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=o.Ay.firstQuestion;const n=[];for(;t&&(e||"review.review"!==t);)n.push(t),t=this.findNextStep(t,!1);return n}getGroupSteps(e){let t=this.getFirstGroupStep(e);const n=[];for(;t&&t.startsWith("".concat(e,"."));)n.push(t),t=this.findNextStep(t,!1);return n}updateDocumentCurrentPath(e){var t;"review.review"===e&&o.Ay.setEditMode(o.WF.NORMAL),null===(t=this.document)||void 0===t||t.setCurrent(e)}tryHandleConditionalJumps(e,t){const n=this.flow[e][t];if(n instanceof Function){const e=n(),[t,o]=e.split(".");return this.tryHandleConditionalJumps(t,o)}return"".concat(e,".").concat(t)}doTransitionLogic(){const e=this.findStepByPath(this.document.current);e&&"beforeMoveNext"in e&&e.beforeMoveNext&&e.beforeMoveNext()}findStepByPath(e){const[t,n]=e.split(".");return this.flow[t][n]}}},64504:(e,t,n)=>{"use strict";n.d(t,{Fc:()=>O,Mj:()=>G,O4:()=>k,Q4:()=>Q,RS:()=>J,VY:()=>R,Y9:()=>D,ZJ:()=>z,b7:()=>F,gQ:()=>H,hE:()=>T,me:()=>_,oq:()=>B,vN:()=>N,vd:()=>L,w8:()=>W,z2:()=>M});var o=n(50016),r=n(78267),a=n(38117),l=n(4670),i=n(7371),s=n(14329),c=n(8289),d=n(97076),u=n(17171),m=n(82345),p=n(29731),g=n(5438),h=n(82997),v=n(67976),y=n(45143),b=n(24038),f=n(20282),E=n(67869),C=n(83613),A=n(97976),S=n(66760),w=n(30928),P=n(33469),I=n(77095),x=n(40701);const D=e=>{let{sm:t,t:n,onClose:r,skip:a,onSkip:u,title:m}=e;return o.createElement(i.A,{style:{width:"100%",height:t?72:54,justifyContent:"space-between",alignItems:"center",flexDirection:"row",borderBottomColor:"#EBEEEF",borderBottomWidth:1,paddingHorizontal:t?20:10}},o.createElement(l.A,{onPress:r,disabled:y.Ay.buttonLoading,style:(0,c.i_)({borderColor:"#E6EBEE",borderRadius:6,borderWidth:1,alignItems:"center",justifyContent:"center",width:40,height:40},!t&&{borderWidth:0,borderRadius:8,backgroundColor:"#F5F7F8"})},o.createElement(d.tz0,{width:12,height:12})),o.createElement(s.BtTitle,{style:{flex:1,textAlign:"center",fontSize:t?20:16,fontWeight:t?"600":"500"}},m||n("SetUpAccount")),!t&&a?o.createElement(s.BtText,{style:{color:"#335C75",fontWeight:"500",marginRight:10},onPress:u},n("Skip")):o.createElement(f.hK,{width:50}))},T=e=>{let{text:t}=e;const{sm:n}=(0,u.Qs)();return t&&n?o.createElement(i.A,{style:{padding:20}},o.createElement(s.BtTitle,{style:{color:b.Tj.accentText},testID:"ApplicationTitle"},t)):null},k=(0,g.PA)((e=>{var t;let{next:n,skip:r,sm:a,document:l,t:c,currentItem:d,onNext:u,disableNext:m,isBusy:p}=e;if(!a)return null;const g="authorisedDetails"===d?y.Ay.inviteButton(a):void 0,h=null===(t=y.Ay.previousStep)||void 0===t?void 0:t.includes("review");return o.createElement(i.A,{style:{flexDirection:"row",width:"100%",justifyContent:"flex-end",marginTop:20}},r?o.createElement(s.BtButton,{onPress:()=>
1{if(h)l.setCurrent(y.Ay.previousStep),y.Ay.setPreviousStep("");else if("function"===typeof r){const e=r();e&&l.setCurrent(e)}else l.setCurrent(r)},appearance:"ghost",style:{marginRight:20},testID:"ApplicationSkipButton",disabled:p},(()=>o.createElement(s.BtText,{style:{fontWeight:"700",fontSize:16,color:"#668598"}},c(h?"GoToReviewPage":g?"Next":"SkipForNow")))):null,n?o.createElement(s.BtButton,{disabled:p||m,onPress:u,style:{width:g?238:150},testID:"ApplicationNextButton"},g||c("Next")):null)})),B=(0,g.PA)((e=>{let{t:t,sm:n,onPress:r}=e;const a=n?b.Tj.accentText:b.Tj.primary;return o.createElement(l.A,{style:{flexDirection:"row",alignItems:"center"},onPress:r,disabled:y.Ay.buttonLoading,testID:"ApplicationBackButton"},n?o.createElement(d.CP6,{stroke:a}):o.createElement(d.abY,{stroke:a,style:{height:20}}),o.createElement(s.BtText,{style:{fontWeight:n?"500":"700",color:a,marginTop:-2,marginLeft:n?15:5}},t("Back")))})),F=(0,g.PA)((e=>{let{t:t,canSubmit:n}=e;const r=(0,m.useNavigation)(),{agreeAndSubmit:a,buttonLoading:l,agreementsAccepted:i}=y.Ay;return o.createElement(s.BtButton,{disabled:!n||l||!i||C.A.isBusy,style:{width:320,marginBottom:36},onPress:()=>{a(r)},testID:"ApplicationSubmitButton",loading:y.Ay.buttonLoading},t("Review.AgreeSubmit"))})),_=(0,g.PA)((e=>{let{sm:t,t:n,document:r,next:a,onNext:l,onBack:c,currentItem:d,canSubmit:u,showFooterMessage:p,disableNext:g,isBusy:h,isReview:v}=e;const b=(0,m.useNavigation)(),f=(null===r||void 0===r?void 0:r.filled.length)&&(null===r||void 0===r?void 0:r.filled.length)>0,{inviteButton:E,agreeAndSubmit:A,buttonLoading:S,agreementsAccepted:P,isGetPaidApplication:I,isCreditApplication:x}=y.Ay,D="authorisedDetails"===d?E(t):void 0;return o.createElement("div",{style:{position:"sticky",bottom:0,alignSelf:"baseline",width:"100%",backgroundColor:"white"}},!(t&&v)&&p&&o.createElement(w.y,{canSubmit:u,document:r}),t?null:o.createElement(i.A,{style:{flexDirection:"row",justifyContent:"space-between",width:"100%",borderTopWidth:1,borderTopColor:"#CCD6DD",padding:20}},f&&"review"!==d?o.createElement(B,{t:n,sm:t,onPress:c}):null,a&&"review"!==d?o.createElement(s.BtButton,{disabled:h||g,onPress:l,style:{width:f?D?174:t?160:85:"100%"},testID:"ApplicationNextButton"},D||n("Next")):null,"review"===d&&o.createElement(s.BtButton,{onPress:()=>r.setSection("review.preview"),style:{width:160},testID:"ApplicationReviewButton",disabled:h,status:"basic"},(()=>o.createElement(s.BtText,{style:{color:"#335C75",fontWeight:"700",fontSize:16}},n("Review.ReviewButton")))),y.Ay.hasSubmissionRights&&["review","preview"].includes(d)&&(I||x?o.createElement(s.BtButton,{disabled:!u||S||!P||C.A.isBusy,style:{width:160},onPress:()=>r.setSection("review.agreement"),testID:"ApplicationContinueToAgreementButton",loading:S},n("Review.Continue")):o.createElement(s.BtButton,{disabled:!u||S||C.A.isBusy,onPress:()=>{A(b)},testID:"ApplicationSubmitButton"},n("Review.AgreeSubmit")))))})),N=e=>{let{title:t,sm:n,t:r}=e;if(!t)return null;const a=t instanceof Function?t():t;return o.createElement(s.BtText,{style:(0,c.i_)({fontFamily:"Inter, sans-serif",fontSize:24,fontWeight:"600",color:"#003353",lineHeight:n?36:26,marginBottom:10},!n&&{fontSize:18,color:"#003353"})},r(a))},R=e=>{let{description:t,sm:n,t:r,style:a=null}=e;return t?"string"!==typeof t?t:o.createElement(s.BtText,{style:(0,c.i_)({fontFamily:"Inter, sans-serif",fontSize:16,fontWeight:"600",color:"#335C75",marginBottom:24,lineHeight:n?30:22},!n&&{fontSize:16,marginBottom:12},a)},r(t)):null},L=e=>{let{children:t}=e;return o.createElement(s.BtText,{style:{fontWeight:"700",fontSize:12,lineHeight:16,color:"#668598",marginTop:16}},t)},M=e=>{let{progress:t}=e;const n=1-t;return o.createElement(i.A,{style:{width:"100%",flexDirection:"row",height:3}},o.createElement(i.A,{style:{flex:t,height:"100%",backgroundColor:b.Tj.accentText}}),o.createElement(i.A,{style:{flex:n,height:"100%",backgroundColor:"#CCD6DD"}}))},O=e=>{const{sm:t}=(0,u.Qs)(),n={minWidth:t?230:142};return o.createElement(s.BtAlert,Object.assign({},e,{buttons:[{status:"basic",style:n,...e.buttons[0]},{style:n,...e.buttons[1]}],width:t?650:356,titleStyle:r.A.flatten([t?j.desktopAlertTitle:j.mobileAlertTitle,e.titleStyle])}),e.children)},z=e=>{var t;let{onCloseAlert:n,onCloseApplication:r}=e;const{sm:a}=(0,u.Qs)(),l=(0,m.useNavigation)(),{t:i}=(0,p.Bd)("application");return o.createElement(O,{visible:!0,title:i("CloseAlert.Title"),onClose:n,buttons:[{label:i("CloseAlert.SaveForLater"),onPress:()=>{r&&r(),l.replace(E.f0.Console._self)}},{label:i(a?"CloseAlert.ContinueApplication":"CloseAlert.Continue"),onPress:()=>n()}],icon:o.createElement(d.XJM,{style:{marginBottom:a?33:18}}),buttonsContainerStyle:a?j.buttonsContainer:void 0},a&&o.createElement(f.hK,{height:16}),o.createElement(s.BtText,{style:(0,c.i_)(a?j.desktopAlertText:j.mobileAlertText,j.alertTextCommonStyle)},o.createElement(p.x6,{t:i,i18nKey:y.Ay.isCreditApplication?"CloseAlert.CreditRequestMessage":y.Ay.isInHouseCreditApplication?"CloseAlert.InHouseCreditMessage":"CloseAlert.GetPaidApplicationMessage",values:{supplierName:P.h.getCompanyName(null===(t=C.A.userStore.suppliers)||void 0===t?void 0:t.find((e=>e.id===y.Ay.supplierId)))}})),a&&o.createElement(f.hK,{height:25}))},j=r.A.create({mobileAlertText:{fontSize:16,width:292},desktopAlertText:{fontWeight:"500",fontSize:18,width:397},alertTextCommonStyle:{lineHeight:26,color:"#668598",textAlign:"center"},mobileAlertTitle:{fontWeight:"600",fontSize:18,lineHeight:28,color:"#003353",width:210},desktopAlertTitle:{fontWeight:"700",fontSize:28,lineHeight:36,color:"#003353",width:340},buttonsContainer:{width:"80%",alignSelf:"center"}}),W=e=>{var t;let{close:n,setClose:r}=e;const{sm:a}=(0,u.Qs)(),{setMessage:l}=(0,v.JX)(),{t:d}=(0,p.Bd)("application"),{userStore:m}=C.A,g=(e,t)=>a?e:t,y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,c.i_)(g(V.desktopAlertText,V.mobileAlertText),V.alertTextCommonStyle,e)},b=()=>o.createElement(s.BtText,{style:y({fontWeight:"700"})});return o.createElement(O,{visible:n,onClose:()=>r(!n),title:d("VerifyEmailAlert.Title"),buttons:[{label:d("VerifyEmailAlert.GoBackToApplication"),onPress:()=>r(!n),status:"basic",style:{minWidth:a?240:void 0}},{label:d("VerifyEmailAlert.SendAgain"),onPress:()=>{h.JZ.kQ.sendVerificationEmail().then((()=>l(v.$z.SUCCESS,"The link for verification is sent, please check your email")),r(!n))},style:{minWidth:a?240:void 0}}],height:a?477:402,titleStyle:g(V.desktopAlertTitle,V.mobileAlertTitle),buttonsContainerStyle:g(V.buttonsContainer,V.mobileButtonsContainer),width:a?void 0:375},o.createElement(i.A,{style:g(V.desktopContainer,V.mobileContainer)},o.createElement(f.hK,{height:a?10:4}),o.createElement(s.BtText,{style:y()},o.createElement(p.x6,{t:d,i18nKey:"VerifyEmailAlert.Message",components:{bold:b()}})),o.createElement(f.hK,{height:20}),o.createElement(s.BtText,{style:y()},d("VerifyEmailAlert.Steps")),o.createElement(s.BtText,{style:y()},o.createElement(p.x6,{t:d,i18nKey:"VerifyEmailAlert.Step1",values:{email:null===(t=m.user)||void 0===t?void 0:t.email}
1,components:{styled:b()}})),o.createElement(s.BtText,{style:y()},d("VerifyEmailAlert.Step2")),o.createElement(s.BtText,{style:y()},o.createElement(p.x6,{t:d,i18nKey:"VerifyEmailAlert.Step3",components:{bold:b()}})),o.createElement(s.BtText,{style:y()},d("VerifyEmailAlert.Step4")),o.createElement(f.hK,{height:20})))},V=r.A.create({desktopContainer:{width:530,alignSelf:"center"},mobileContainer:{width:"95%",alignSelf:"center"},desktopAlertText:{fontWeight:"400",fontSize:18,lineHeight:26,letterSpacing:0},mobileAlertText:{fontSize:16,lineHeight:24},mobileAlertTitle:{fontWeight:"700",fontSize:20,lineHeight:24,color:"#003353",width:270},alertTextCommonStyle:{color:"#082131",textAlign:"left",fontFamily:"Inter"},desktopAlertTitle:{fontWeight:"700",letterSpacing:.2,color:"#003353",fontSize:28,lineHeight:36,width:450,fontFamily:"Inter"},buttonsContainer:{width:"86%",alignSelf:"center",gap:5},mobileButtonsContainer:{width:"96%",alignSelf:"center",gap:5}}),H=()=>{const{t:e}=(0,p.Bd)("application"),{sm:t}=(0,u.Qs)();return o.createElement(i.A,{style:U.rootView},o.createElement(d.m2l,{style:{height:t?27:40,width:t?27:40}}),o.createElement(s.BtText,{style:(0,c.i_)(U.text,!t&&{fontSize:12,lineHeight:18})},e("Finance.AuthorisedInfo")))},U=r.A.create({rootView:{width:"100%",height:76,flexDirection:"row",paddingVertical:11,paddingHorizontal:26,marginTop:10,backgroundColor:"#F5F7F8",borderRadius:12,alignItems:"center"},text:{fontWeight:"500",fontSize:14,lineHeight:22,color:"#003353",marginLeft:18}}),G=e=>{var t;let{document:n}=e;const{t:r}=(0,p.Bd)("application"),{email:a,firstName:l,lastName:m}=null!==(t=y.Ay.authorisedInvitee)&&void 0!==t?t:{},{sm:g}=(0,u.Qs)(),h=e=>(0,c.i_)(e,!g&&Y.mobileFont);return a?o.createElement(i.A,{style:Y.view1},o.createElement(d.m2l,{style:{marginLeft:3,marginRight:20,marginTop:3}}),o.createElement(i.A,{style:Y.view3},o.createElement(p.x6,{t:r,i18nKey:"Review.InviteSent",values:{name:"".concat(l," ").concat(m)},components:{styled:o.createElement(s.QG,{style:h(Y.boldText)}),simple:o.createElement(s.QG,{style:h(Y.text)})}}),o.createElement(i.A,{style:Y.view4},o.createElement(s.QG,{style:h(Y.boldText)},a),o.createElement(s.b_,{title:r("Review.Edit"),textStyle:h(Y.linkText),onPress:()=>{y.Ay.setPreviousStep(n.current),n.setSection("businessOwner.authorisedDetails")}})))):o.createElement(o.Fragment,null)},Y=r.A.create({view1:{width:"100%",borderRadius:12,backgroundColor:"#F5F7F8",padding:16,marginBottom:45,flexShrink:1,flexDirection:"row"},text:{fontWeight:"500",fontSize:16,lineHeight:22,width:"100%"},boldText:{fontWeight:"600",fontSize:16,lineHeight:22,color:"#003353"},view3:{flexShrink:1},view4:{marginTop:12,flexDirection:"row"},linkText:{color:b.Tj.accentText,fontWeight:"500",fontSize:14,lineHeight:22,marginLeft:15},mobileFont:{fontSize:14}}),Q=(0,g.PA)((()=>{const{t:e}=(0,p.Bd)("application"),t=(0,m.useNavigation)(),{successAlertData:n,setSuccessAlertData:r}=y.Ay;return n.message?o.createElement(I.rp,{icon:o.createElement(x.G,{name:"checkmark-outline",theme:"green"}),title:e(n.title),buttons:[e("SubmitSuccessButton")],testID:"TermsExtension.SuccessModal",onClose:()=>{r({}),t.navigate(E.f0.Console._self)}},e(n.message)):null})),q=(0,g.PA)((e=>{let{agreementAlert:t,onClose:n,generating:r,agree:l,onLink:i}=e;const{sm:m}=(0,u.Qs)(),{t:g}=(0,p.Bd)("application"),h=(0,o.useMemo)((()=>{var e;return!(null===(e=C.A.userStore.credit)||void 0===e||!e.LoCnumber)}),[]);return o.createElement(O,{visible:t,onClose:n,noCloseIcon:r,title:g("LoCAgreementAlert.Title"),buttons:[{label:"",onPress:()=>{}},{label:g("LoCAgreementAlert.Agree&Continue"),onPress:l,disabled:r,testID:"agree"}],icon:o.createElement(d.sjq,{style:{marginBottom:m?33:18,marginTop:r?20:void 0}}),buttonsContainerStyle:m?j.buttonsContainer:void 0},m&&o.createElement(f.hK,{height:16}),o.createElement(s.BtText,{style:(0,c.i_)(m?Z.desktopAlertText:j.mobileAlertText,Z.alertTextCommonStyle)},o.createElement(p.x6,{t:g,i18nKey:h?"LoCAgreementAlert.UpdatedAgreementMessage":"LoCAgreementAlert.NewAgreementMessage",values:{application:y.Ay.isCreditApplication?g("CreditRequest").toLowerCase():g("GetPaidApplication").toLowerCase()},components:{bold:o.createElement(a.A,{style:{fontWeight:"700"}}),agreementLink:o.createElement(a.A,{style:Z.link,onPress:i})}}),r?o.createElement(S.A,{style:{marginLeft:10}}):null),m&&o.createElement(f.hK,{height:25}))})),K=e=>{let{close:t,setClose:n,setAgreementAlert:r}=e;const a=(0,m.useNavigation)(),{sm:l}=(0,u.Qs)(),{t:i}=(0,p.Bd)("application");return o.createElement(O,{visible:t,noCloseIcon:!0,title:i("LoCAgreementAlertClose.Title"),buttons:[{label:i("LoCAgreementAlertClose.GoToHome"),onPress:()=>{n(!t),a.navigate(E.f0.Console._self)}},{label:i("LoCAgreementAlertClose.GoBack"),onPress:()=>{n(!t),r(!0)},testID:"goBack"}],icon:o.createElement(d.nyr,{style:{marginBottom:l?32:10,marginTop:30}}),height:l?430:402,buttonsContainerStyle:l?Z.buttonsContainer:void 0,verticalButtons:!l},o.createElement(f.hK,{height:l?10:4}),o.createElement(s.BtText,{style:(0,c.i_)(l?Z.desktopConfirmMessage:j.mobileAlertText,Z.alertTextCommonStyle)},o.createElement(p.x6,{t:i,i18nKey:"LoCAgreementAlertClose.Message"})),o.createElement(f.hK,{height:20}))},J=(0,g.PA)((()=>{const{userStore:e}=(0,A.P)(),{setAgreementAlert:t,agreementAlert:n}=y.Ay,[r,a]=(0,o.useState)(!1),[l,i]=(0,o.useState)(!1),s=(0,m.useNavigation)();return o.createElement(o.Fragment,null,o.createElement(q,{onClose:()=>{t(!n),a(!0)},agreementAlert:n,agree:async()=>{await y.Ay.submit(s),e.fetchUser(),t(!1)},onLink:async()=>{i(!0),await y.Ay.previewMasterAgreement(),i(!1)},generating:l}),o.createElement(K,{close:r,setClose:a,setAgreementAlert:t}))}
1)),Z=r.A.create({desktopAlertText:{fontWeight:"500",fontSize:18,width:580},alertTextCommonStyle:{lineHeight:24,color:"#003353",textAlign:"center"},link:{color:"#00A0F3",textDecorationLine:"underline"},desktopConfirmMessage:{color:"#003353",fontWeight:"500",fontSize:18,lineHeight:24,width:515},buttonsContainer:{width:"85%",alignSelf:"center"}})},30928:(e,t,n)=>{"use strict";n.d(t,{y:()=>y});var o=n(83613),r=n(45143),a=n(78267),l=n(38117),i=n(7371),s=n(14329),c=n(29731),d=n(8289),u=n(55502),m=n(50016),p=n(64504),g=n(17171),h=n(5438),v=n(58876);const y=(0,h.PA)((e=>{var t,n;let{canSubmit:a,document:l,style:h}=e;const{t:v}=(0,c.Bd)("application"),{sm:y}=(0,g.Qs)(),{buttonLoading:f,hasSubmissionRights:E,isCreditApplication:C,agreementsAccepted:S}=r.Ay,w="review.preview"===(null===(t=o.A.userStore)||void 0===t||null===(n=t.document)||void 0===n?void 0:n.current);return m.createElement(i.A,{style:(0,d.i_)(A.container,h)},w&&E?m.createElement(u.fI,null,m.createElement(u.fv,{xs:y?8:12},m.createElement(b,null)),y&&m.createElement(u.fv,{xs:3},C?m.createElement(s.BtButton,{disabled:!a||f||!S||o.A.isBusy,style:{width:320,marginBottom:36},onPress:()=>l.setSection("review.agreement"),testID:"ApplicationContinueToAgreementButton",loading:f},v("Review.Continue")):m.createElement(p.b7,{t:v,canSubmit:a}))):m.createElement(b,null))})),b=(0,h.PA)((()=>{var e,t;const{t:n}=(0,c.Bd)("application"),a=null===(e=o.A.userStore)||void 0===e||null===(t=e.document)||void 0===t?void 0:t.current,l=()=>null!==a&&void 0!==a&&a.startsWith("review")?r.Ay.isCreditApplication?m.createElement(f,null):r.Ay.isInHouseCreditApplication?m.createElement(E,null):m.createElement(C,null):m.createElement(s.BtText,{style:A.agreement},n("ToComplyWithFederalLaws"));return m.createElement(i.A,{style:{flexDirection:"row"}},r.Ay.hasSubmissionRights?m.createElement(s.BtCheckBox,{style:A.acceptAgreementsCheckbox,checked:r.Ay.agreementsAccepted,onPress:r.Ay.setAgreementsAccepted}):null,m.createElement(l,null))})),f=(0,h.PA)((()=>{const{t:e}=(0,c.Bd)("application"),{onClickLink:t,previewMasterAgreement:n}=r.Ay;return m.createElement(s.BtText,{style:A.creditAgreement},m.createElement(c.x6,{t:e,i18nKey:"TermsAndConditionsMessage",components:{terms:m.createElement(l.A,{style:A.link,onPress:()=>t(v.DS.TC)}),privacy:m.createElement(l.A,{style:A.link,onPress:()=>t(v.DS.PP)}),PGA:m.createElement(l.A,{style:(0,d.i_)(A.link,{textDecorationLine:"underline"}),onPress:()=>r.Ay.previewPersonalGuarantorAgreement()}),TCA:m.createElement(l.A,{style:(0,d.i_)(A.link,{textDecorationLine:"underline"}),onPress:n})}}))})),E=(0,h.PA)((()=>{const{t:e}=(0,c.Bd)("application");return m.createElement(s.BtText,{style:A.agreement},m.createElement(c.x6,{t:e,i18nKey:"InHouseCreditConsentStatement",components:{terms:m.createElement(l.A,{style:A.link,onPress:()=>r.Ay.onClickLink(v.DS.TC)}),privacy:m.createElement(l.A,{style:A.link,onPress:()=>r.Ay.onClickLink(v.DS.PP)})}}))})),C=(0,h.PA)((()=>{const{t:e}=(0,c.Bd)("application");return m.createElement(s.BtText,{style:A.agreement},m.createElement(c.x6,{t:e,i18nKey:"SupplierConsentStatement",components:{terms:m.createElement(l.A,{style:A.link,onPress:()=>r.Ay.onClickLink(v.DS.TC)}),privacy:m.createElement(l.A,{style:A.link,onPress:()=>r.Ay.onClickLink(v.DS.PP)})}}))})),A=a.A.create({container:{width:"100%",backgroundColor:"#F5F7F8",padding:20,alignItems:"center",alignSelf:"baseline"},agreement:{maxWidth:615,textAlign:"justify",color:"#668598",lineHeight:21},preview:{maxWidth:720,textAlign:"center",color:"#668598",lineHeight:21},creditAgreement:{maxWidth:720,textAlign:"center",color:"#668598",fontSize:12,fontWeight:"400",lineHeight:14},link:{color:"#00A0F3"},acceptAgreementsCheckbox:{width:20,height:20,marginTop:2,marginRight:10}})},76036:(e,t,n)=>{"use strict";n.d(t,{L:()=>C,Y:()=>E});var o=n(50016),r=n(66760),a=n(7371),l=n(4670),i=n(19925),s=n(14329),c=n(29731),d=n(60923),u=n(14425),m=n(78267),p=n(97076),g=n(20282),h=n(78573);const v=(0,n(5438).PA)((e=>{let{visible:t,onClose:n,finicityBankId:r=""}=e;const{sm:a}=(0,i.Qs)(),{t:l}=(0,c.Bd)("global"),d=(0,o.useRef)(null),[u,m]=(0,o.useState)(!1);return o.createElement(o.Fragment,null,o.createElement(s.BtAlert,{visible:t,icon:o.createElement(p.tgK,{width:48,height:48,style:{marginBottom:a?35:20}}),width:a?610:365,type:"danger",onClose:n,buttons:[{label:"Connect Bank Account",onPress:()=>{var e;null===(e=d.current)||void 0===e||e.createToken()},style:{marginBottom:a?20:0,width:310,borderRadius:4},loading:u}]},o.createElement(s.BtText,{style:a?y.titleDesktop:y.titleMobile},l("Wallet.connection-error")),o.createElement(g.hK,null),o.createElement(s.BtText,{style:a?y.messageDesktop:y.messageMobile},l("Wallet.connection-error-text"))),o.createElement(h.R,{ref:d,setLoa
1ding:m,onConnectSuccess:n}))})),y=m.A.create({titleDesktop:{color:"#003353",fontSize:28,fontWeight:"700"},titleMobile:{color:"#003353",fontSize:18,fontWeight:"600"},messageDesktop:{fontSize:18,fontWeight:"400",lineHeight:26,textAlign:"center",color:"#082131",width:450,marginBottom:20},messageMobile:{fontSize:14,fontWeight:"400",lineHeight:21,textAlign:"center",color:"#668598",width:250,marginBottom:15}});var b=n(45143),f=n(38767);const E=e=>{let{bankAccounts:t,selectedBankAccountId:n,onSelect:r,onDelete:l}=e;const{t:d}=(0,c.Bd)("application"),{sm:u}=(0,i.Qs)(),[m,p]=(0,o.useState)(!1),g=(0,o.useRef)(null),{isCreditApplication:y}=b.Ay,[f,E]=(0,o.useState)(""),A=()=>p(!1),S=(e,t)=>{var n;return null===(n=g.current)||void 0===n?void 0:n.createToken(e,t)},w=e=>{var t;E(e._id),e.isReconnectionRequired&&y?e.isFinicityConnectedBank?p(!0):e.isExpiredPlaidBank?S(e._id):e.isDisconnectedPlaidBank&&S("",e.routingNumber):(t=e,r&&r(t))};return t&&0!==t.length?o.createElement(a.A,{style:{flex:1,flexWrap:"wrap",flexDirection:u?"row":"column"}},t.map((e=>o.createElement(a.A,{style:{position:"relative",marginBottom:20}},o.createElement(C,{bankAccount:e,selectedBankAccountId:n,onPress:w,onDelete:l,showDisconnectedBadge:y}),o.createElement(v,{visible:m&&f===e._id,onClose:A,finicityBankId:e._id}),o.createElement(h.R,{ref:g}),n===e.id&&o.createElement(s.BtText,{size:12,color:"#668598"},d("Bank.SelectedAsPrimaryCaption")))))):null},C=e=>{let{bankAccount:t,selectedBankAccountId:n,onPress:m,onDelete:p,loadingBankId:g,showDisconnectedBadge:h=!1}=e;const{t:v}=(0,c.Bd)("application"),{sm:y}=(0,i.Qs)();return o.createElement(l.A,{key:t.id,onPress:()=>m(t),testID:"bank-account-item",style:(0,f.composeStyle)({flexDirection:"row",alignItems:"flex-start",borderRadius:8,borderColor:"#CCD6DD",borderWidth:1,marginRight:y?10:0,height:85,paddingHorizontal:20,paddingVertical:15,backgroundColor:g?"rgba(224, 220, 220, 0.5)":"white"},y?{width:216}:{minWidth:216}),disabled:!!g},g===t._id?o.createElement(r.A,{size:18,style:{marginRight:8}}):o.createElement(s.BtRadioButton,{containerStyle:{paddingVertical:0},checked:n===t._id,onPress:()=>m(t),labelStyle:{marginLeft:15}}),o.createElement(a.A,{style:{flex:1}},o.createElement(s.BtText,{style:{fontSize:16,color:"#335C75",fontWeight:"500",overflow:"hidden"},numberOfLines:1},t.name.split("/")[0]),o.createElement(s.BtText,{style:{fontWeight:"500",fontSize:12,color:"#668598",marginTop:5},numberOfLines:1},t.accountType===d.e.Savings?v("Bank.SavingAccount"):v("Bank.CheckingAccount"),"...",t.accountNumber.substring(t.accountNumber.length-4)),t.isManualEntry&&p&&o.createElement("div",{style:{display:"inline-flex",flexDirection:"row",alignItems:"center",marginTop:5},onClick:()=>p(t.id)},o.createElement(u.Icon,{style:{height:15,marginRight:5},fill:"black",name:"trash-2-outline"}),o.createElement(s.BtText,{color:"#003353",numberOfLines:1,weight:"600",size:12},v("Bank.DeleteManualButton")))),!t.isManualEntry&&h&&o.createElement(a.A,{style:{position:"absolute",backgroundColor:t.isReconnectionRequired?"#DB2424":"#33B3F5",paddingVertical:3,paddingHorizontal:10,borderRadius:5,top:-15,right:-3}},o.createElement(s.BtText,{size:12,style:{color:"white"}},t.isReconnectionRequired?v("Bank.Disconnected"):v("Bank.ConnectedViaOnlineBanking"))))}},60923:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});let o=function(e){return e.Savings="savings",e.Checking="checking",e}({})},88626:(e,t,n)=>{"use strict";n.d(t,{I:()=>r});const o=new Map([["businessInfo","BusinessDetails"],["finance","BusinessFinancialDetails"],["businessOwner","BusinessOwner"],["coOwners","BusinessCoOwners"],["coOwnerInfo","BusinessCoOwners"],["bank","BankDetails"],["review","Review.SectionTitle"]]),r=e=>o.get(e)||""},74027:(e,t,n)=>{"use strict";n.d(t,{i:()=>s});var o=n(50016),r=n(44943),a=n(50767),l=n(56480),i=n(29731);const s=e=>{let{autoRedirect:t,onRedirect:n,wrapperStyle:s}=e;const{t:c}=(0,i.Bd)("global"),d=new URLSearchParams(window.location.search).get("mode"),[u,m]=o.useState(5),p=t||d===r.K.REDIRECT||d===r.K.POPUP;return(0,o.useEffect)((()=>{if(p){const e=setInterval((()=>{m((e=>e-1))}),1e3),t=setTimeout((()=>{n()}),5e3);return()=>{clearInterval(e),clearTimeout(t)}}}),[p,d,n]),p?o.createElement(a.a,{mt:16,style:null!==s&&void 0!==s?s:{}},o.createElement(l.E,{c:"gray.6"},u>0?c("generic.paid-invoice-redirection-label",{redirectDelay:u}):c("generic.paid-invoice-redirecting-label"))):null}}
1,44943:(e,t,n)=>{"use strict";n.d(t,{K:()=>o});let o=function(e){return e.REDIRECT="redirect",e.POPUP="popup",e}({})},25207:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n(50016),r=n(4670),a=n(38117);const l=n(78267).A.create({button:{paddingVertical:12,paddingHorizontal:16,backgroundColor:"#00A0F3",alignItems:"center",justifyContent:"center",borderRadius:8,height:48},buttonText:{color:"#FFFFFF",fontWeight:"700",fontSize:16,lineHeight:24,fontFamily:"Inter"},disabledButton:{backgroundColor:"#DEE5EB"},disabledButtonText:{color:"#99ADBA"}}),i=e=>{let{onPress:t,label:n,buttonStyle:i,textStyle:s,disabled:c,testID:d}=e;return o.createElement(r.A,{style:[l.button,i,c&&l.disabledButton],onPress:t,disabled:c,testID:d},o.createElement(a.A,{style:[l.buttonText,s,c&&l.disabledButtonText]},n))}},79746:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var o=n(50016),r=n(82997),a=n(68215),l=n(4726),i=n(41538),s=n(21319),c=n(62033),d=n(67869),u=n(63957),m=n(29731),p=n(83613),g=n(58876),h=n(92093),v=n(89077),y=n(7007),b=n(12709);const f=e=>{var t;let{navigation:n,route:f}=e;const E=null===(t=f.params)||void 0===t?void 0:t.code,{setLogin:C}=s.A,{t:A}=(0,m.Bd)("auth"),[S,w]=(0,o.useState)({message:"Please wait...",color:a.commonColors.primary}),P=(0,o.useCallback)((async()=>{await p.A.logOut(),r.JZ.m9.check(E).then((e=>{if("expired"===e.result)w({color:a.commonColors.accent,message:"Invitation has expired"});else{const{email:l,firstName:i,lastName:c,login:u,type:m,phone:f,metadata:C,company:A,company_id:S,account:P}=e.invitation;s.A.setValue("type","password");const I=!(0,b.validateEmail)(u),x=l||(I?"":u);var t,o,r;if(s.A.setLogin(x),s.A.setValue("email",l),s.A.setValue("phone",(0,h.g)(f||"","US")?(0,v.L)(f,"US").nationalNumber:""),s.A.setValue("firstName",i),s.A.setValue("lastName",c),s.A.setValue("invitation",E),s.A.setValue("isInvitation",!0),s.A.setValue("invitationType",m),null!==C&&void 0!==C&&C.businessName&&s.A.setValue("company_name",C.businessName),[g.zI.GETPAID_INVITE,g.zI.CREDIT_INVITE].includes(m))s.A.setValue("company_name",null===(t=e.invitation.company)||void 0===t?void 0:t.name);if(m===g.zI.SUPPLIER_INVITE_CUSTOMER)(null===P||void 0===P?void 0:P.type)===y.i.IHC&&null!==A&&void 0!==A&&null!==(o=A.settings)&&void 0!==o&&null!==(r=o.arAdvance)&&void 0!==r&&r.isEnabled&&S&&s.A.setValue("factoringSupplierId",S);p.A.initRouteParams({invitationType:m}),w({message:"",color:a.commonColors.accent});const D=(0,d.oh)((0,d.wl)("Auth.SignUp"));n.replace(D.name,D.params)}})).catch((e=>{var t;console.log(e),w({message:(null===(t=e.data)||void 0===t?void 0:t.message)||"Wrong invitation data",color:a.commonColors.accent})}))}),[E,n]);return(0,o.useEffect)((()=>{E?P():w({message:"Invitation unsuccessful",color:a.commonColors.accent})}),[E,P,C]),o.createElement(o.Fragment,null,S.message&&o.createElement(c.A,null,o.createElement(l.A,null),o.createElement(i.A,{color:S.color},S.message),o.createElement(l.A,null),o.createElement(u.A,{onPress:()=>n.replace(d.f0.Home._self)},A("goToHomePage"))))}},76321:(e,t,n)=>{"use strict";n.d(t,{A:()=>ce});var o=n(67337),r=n(82345),a=n(50016),l=n(63680),i=n(7371),s=n(16148),c=n(2635),d=n(67869),u=n(28437),m=n(14945),p=n(12344),g=n(32260),h=n(92147),v=n(13459),y=n(82997),b=n(91855),f=n(97976),E=n(37149),C=n(13569),A=n(21319),S=n(96557),w=n(92985);const P={flex:1,width:"100%",height:"100%",margin:0},I=(0,l.PA)((e=>{let{payment:t,opened:n,onClose:o,navigation:r,route:l}=e;const i=(0,f.P)(),c=(0,v.jE)(),d=E.A.get("session"),u=!!(s.HZ&&d||i.userStore.isAuthenticated),m=!!i.userStore.settings.get("onboarding"),p=i.userStore.userInfoReady,{customerPrefill:h,options:I,invoice:x,paymentType:D}=t;(0,a.useEffect)((()=>{n&&(C.A.setCodeVerifier(!1),C.A.setCanAskPassword(!1),w.Y.canOfferSignIn(h,I.customerHasAccount)?C.A.setLogin(h.email):A.A.setUpInvoiceLinkSignup(w.Y.toSignupCustomer(x.id,h)))}),[n,I.customerHasAccount,h,x.id]),(0,a.useEffect)((()=>{n&&u&&D!==y.mn.FACTORING&&w.Y.canOfferSignIn(h,I.customerHasAccount)&&c.prefetchQuery(g.o.paymentDetails({id:x.id}))}),[n,u,D,x.id,h,I.customerHasAccount,c]),(0,a.useEffect)((()=>{n&&u&&m&&w.Y.performHandoff({paymentType:D,invoiceId:x.id},{navigate:(e,t)=>
1null===r||void 0===r?void 0:r.replace(e,t),prefetchInvoice:e=>c.prefetchQuery(g.o.paymentDetails({id:e}))})}),[n,u,m,D,x.id,r,c]);return n&&(!u||p&&!m)?a.createElement(b.A,{visible:!0,onClose:o,style:P},a.createElement(S.c,{invoice:w.Y.toWizardInvoice(x.id,h,I.customerHasAccount),onClose:o,navigation:r,route:l})):null}));var x=n(70764),D=n(51599),T=n(43258),k=n(4557),B=n(29731),F=n(73819),_=n(76333),N=n(58876),R=n(74930);const L="PublicSingleInvoiceView_content__038gz";var M=n(96057);const O=e=>{let{payment:t,onViewAttachment:n,onPay:o,onWhatIsBlueTape:r,authenticating:l}=e;const{t:i}=(0,B.Bd)("global"),{supplier:s,invoice:c,options:d}=t,u=N.Sn.includes(c.status);return a.createElement(_.w,null,a.createElement(x.B,{className:L},a.createElement(R.Q,{supplier:s,invoice:c,onViewAttachment:n}),l?a.createElement(M.V,null):u?a.createElement(D.Y,{justify:"space-between"},a.createElement(T.s,null,!d.customerHasAccount&&a.createElement(F.t5,{onClick:r},i("InvoiceDetails.what-is-bt"))),a.createElement(k.$,{onClick:o},i("payables.payment.makePayment"))):a.createElement(D.Y,{justify:"flex-end"},a.createElement(k.$,{w:150,onClick:o},i("payables.public.signIn")))))};var z=n(83296);const j=n.p+"static/media/whatIsBTC.72f0de060907272c30273b7c280c46d3.svg",W="WhatIsBlueTapeModal_image__lrxav",V=e=>{let{canUseCredit:t,onRequestCredit:n,onClose:o}=e;const{t:r}=(0,B.Bd)("global");return a.createElement(F.HD,{icon:a.createElement(z._,{src:j,alt:"",className:W}),title:r("payables.modals.whatIsBlueTape.alertTitle"),buttons:[{label:r("payables.modals.whatIsBlueTape.requestCredit"),props:{disabled:!t},onClick:n}],onClose:o},r("payables.modals.whatIsBlueTape.title"),r("payables.modals.whatIsBlueTape.subtitle"))};let H=function(e){return e.Pay="pay",e.UseCredit="use-credit",e.AddPaymentMethod="add-payment-method",e}({});var U=n(88459);const G=(0,l.PA)((e=>{let{route:t,navigation:n}=e;const o=Y(null===t||void 0===t?void 0:t.params),r=(0,U.X)(),[l,i]=(0,a.useState)(),[s,c]=(0,a.useState)(!1),{data:u,isPending:m,isError:v}=(0,p.I)(g.o.publicInvoiceView(null!==o&&void 0!==o?o:{},{enabled:!!o,retry:!1}));if((0,a.useEffect)((()=>{if(!u||!r)return;const e=w.Y.handoffTarget(u.paymentType,u.invoice.id);null===n||void 0===n||n.replace(e.name,e.params)}),[u]),!o||v)return a.createElement(h.G,null);if(m||!u||r&&!l)return a.createElement(M.V,null);const y=r,b=e=>i(e),f=u.invoice.attachmentToken;return a.createElement(a.Fragment,null,a.createElement(O,{payment:u,authenticating:y,onViewAttachment:()=>f&&(e=>null===n||void 0===n?void 0:n.navigate(d.f0.InvoiceLink.AttachmentPreview,{token:e}))(f),onPay:()=>b(H.Pay),onWhatIsBlueTape:()=>c(!0)}),!y&&s&&a.createElement(V,{canUseCredit:u.options.acceptCredit,onRequestCredit:()=>{c(!1),b(H.UseCredit)},onClose:()=>c(!1)}),a.createElement(I,{payment:u,opened:!!l,onClose:()=>i(void 0),navigation:n,route:t}))})),Y=e=>null!==e&&void 0!==e&&e.token?{token:e.token}:null!==e&&void 0!==e&&e.id?e.account?{id:e.id,account:e.account}:{id:e.id}:null;var Q=n(93894),q=n(89566),K=n(53941),J=n(71995),Z=n(88333),X=n(77593),$=n(34956);const ee=(0,o.A)(),te={animation:"timing",config:{duration:200}},ne={cardStyleInterpolator:e=>{let{current:t}=e;return{cardStyle:{opacity:t.progress}}},transitionSpec:{open:te,close:te}},oe=function(e){let{requireOnboarded:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(0,l.PA)((n=>{let{route:o,navigation:r}=n;const l=(0,f.P)(),i=(0,U.X)(),s=!!l.userStore.settings.get("onboarding"),c=i&&(!t||s);return(0,a.useEffect)((()=>{c||null===r||void 0===r||r.navigate(d.f0.Home._self)}),[c,r]),c?a.createElement(e,{route:o,navigation:r}):null}));return n.displayName="withAuthRequired(".concat(e.displayName||e.name||"Screen",")"),n},re=e=>{let{route:t,navigation:n}=e;return(0,K.A)()?a.createElement(J.w,{route:t,navigation:n}):a.createElement(Z.m,{route:t,navigation:n})},ae=oe(m.cS,{requireOnboarded:!0}),le=oe((e=>{let{route:t,navigation:n}=e;const o=(0,$.kU)();return a.createElement(i.A,{style:{flex:1,alignSelf:"center",width:o?"100%":void 0}},a.createElement(X.Q,{route:t,navigation:n}))})),ie=oe(m.NK,{requireOnboarded:!0}),se=oe(m.xI,{requireOnboarded:!0}),ce=e=>{let{navigation:t,route:n}=e;const o=n?(0,r.getFocusedRouteNameFromRoute)(n):void 0;return a.createElement(a.Fragment,null,a.createElement(Q.X,{onClose:o===d.f0.InvoiceLink.Invoice?()=>null===t||void 0===t?void 0:t.navigate(d.f0.Home._self):void 0}),a.createElement(ee.Navigator,{initialRouteName:d.f0.InvoiceLink.Listing,screenOptions:s.pc,headerMode:s.Hu},a.createElement(ee.Screen,{name:d.f0.InvoiceLink.Listing,component:u.s}),a.createElement(ee.Screen,{name:d.f0.InvoiceLink.Details,component:G}),a.createElement(ee.Screen,{name:d.f0.InvoiceLink.Secure,component:G}),a.createElement(ee.Screen,{name:d.f0.InvoiceLink.Invoice,component:ae,options:ne}),a.createElement(ee.Screen,{name:d.f0.InvoiceLink.PaymentHistory,component:le,options:ne}),a.createElement(ee.Screen,{name:d.f0.Console.Payables.SelectInvoices,component:ie}),a.createElement(ee.Screen,{name:d.f0.Console.Payables.Pay,component:se}),a.createElement(ee.Screen,{name:d.f0.InvoiceLink.AttachmentPreview,component:c.c}),a.createElement(ee.Screen,{name:d.f0.InvoiceLink.SelectProject,component:q.G}),a.createElement(ee.Screen,{name:d.f0.Console.Payables.NewProject,component:re})))}},77356:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var o=n(50016),r=n(66760),a=n(78267),l=n(7371),i=n(38767);const s=a.A.create({wrapper:{...a.A.absoluteFillObject,alignItems:"center",justifyContent:"center"}});function c(e){let{style:t,children:n}=e;return o.createElement(l.A,{style:(0,i.composeStyle)(s.wrapper,t)},o.createElement(r.A,{testID:"indicator"}),n)}},19226:(e,t,n)=>{"use strict";n.d(t,{$:()=>c});var o=n(50016),r=n(29731),a=n(4670),l=n(38117),i=n(97076),s=n(17171);const c=e=>{let{item:t,onPress:n}=e;const{t:c}=(0,r.Bd)("onboarding"),{sm:d}=(0,s.Qs)();return o.createElement(a.A,{onPress:()=>n(t.id),style:{marginTop:d?25:10,width:152,height:d?33:28,borderRadius:4,paddingHorizontal:8,flexDirection:"row",alignItems:"center",justifyContent:"space-evenly",borderWidth:1,backgroundColor:"#00A0F3",borderColor:"#00A0F3"},testID:t.id},o.createElement(l.A,{style:{color:"#fff",fontWeight:"500"}},c(t.action||"")),o.createElement(i.LXe,{width:24,height:24}))}}
1,69102:(e,t,n)=>{"use strict";n.d(t,{A:()=>E});var o=n(19462),r=n(82997),a=n(97976),l=n(74841),i=n.n(l),s=n(92279),c=n(67869),d=n(19190),u=n(61390),m=n(58876);const p=[{id:s.In.SUB_CONTRACTOR,icon:"IconContractors",subItems:[s.ID.RECEIVABLE_FINANCING,s.ID.MATERIAL_AND_SERVICE_FINANCING,s.ID.ACCEPT_ACH_CARD]},{id:s.In.GENERAL_CONTRACTOR,icon:"IconProperty",subItems:[s.ID.OFFER_EARLY_PAYMENT,s.ID.MATERIAL_AND_SERVICE_FINANCING,s.ID.RECEIVABLE_FINANCING,s.ID.ACCEPT_ACH_CARD]},{id:s.In.DEALER_RETAILER_SUPPLIER,icon:"IconDealers",subItems:[s.ID.OFFER_TRADE_CREDIT,s.ID.RECEIVABLE_FINANCING,s.ID.MATERIAL_AND_SERVICE_FINANCING,s.ID.ACCEPT_ACH_CARD]},{id:s.In.MANUFACTURER_DISTRIBUTOR,icon:"IconDistributors",subItems:[s.ID.OFFER_TRADE_CREDIT,s.ID.RECEIVABLE_FINANCING,s.ID.MATERIAL_AND_SERVICE_FINANCING,s.ID.ACCEPT_ACH_CARD,s.ID.OFFER_EARLY_PAYMENT]},{id:s.In.ARCHITECT_INTERIOR_DESIGNER,icon:"IconArchitects",subItems:[s.ID.RECEIVABLE_FINANCING,s.ID.ACCEPT_ACH_CARD]},{id:s.In.ENGINEER_CONSULTANT,icon:"IconEngineers",subItems:[s.ID.RECEIVABLE_FINANCING,s.ID.ACCEPT_ACH_CARD,s.ID.OFFER_EARLY_PAYMENT]},{id:s.In.DEVELOPER_PROPERTY_OWNER,icon:"IconHomeOwner",subItems:[s.ID.OFFER_EARLY_PAYMENT,s.ID.MATERIAL_AND_SERVICE_FINANCING,s.ID.RECEIVABLE_FINANCING]},{id:s.In.OTHER,icon:"IconOthers",subItems:[s.ID.RECEIVABLE_FINANCING,s.ID.OFFER_TRADE_CREDIT,s.ID.MATERIAL_AND_SERVICE_FINANCING,s.ID.OFFER_EARLY_PAYMENT,s.ID.ACCEPT_ACH_CARD]}],g=[{id:s.ID.RECEIVABLE_FINANCING,subTitle:"GetARAdvance",icon:"IconReceivableFinancing",action:"setupAccount"},{id:s.ID.ACCEPT_ACH_CARD,subTitle:"AcceptACHCard",icon:"IconAcceptAchAndCardPayments",action:"setupAccount"},{id:s.ID.MATERIAL_AND_SERVICE_FINANCING,subTitle:"PurchaseMaterialsNow",icon:"IconMakePayment",action:"setupAccount"},{id:s.ID.OFFER_EARLY_PAYMENT,subTitle:"PaySubsAndVendorsFaster",icon:"IconOfferEarlyPayment",action:"setupAccount"},{id:s.ID.OFFER_TRADE_CREDIT,subTitle:"OfferExtendedNetTerms",icon:"IconOfferTradeCredit",action:"setupAccount"}],h=[{id:s.yt.GET_PAID_FAST_ACH,subTitle:"SendOutInvoices",icon:"IconMakePayment",action:"setupAccount"},{id:s.yt.UPLOAD_INVOICE_SUP,subTitle:"UploadToPayWithBC",icon:"IconMakePayment",action:"uploadInvoice"},{id:s.yt.UPLOAD_INVOICE_VENDORS,subTitle:"UploadInvoice",icon:"IconGetPaidFastAnd",action:"uploadInvoice"}],v=o.types.model({id:o.types.union(o.types.number,o.types.string),icon:o.types.string,subItems:o.types.array(o.types.string)}),y={areYouABusiness:o.types.optional(o.types.string,"yes"),item:o.types.maybeNull(v),items:o.types.array(v),step:o.types.optional(o.types.number,1),businessType:o.types.optional(o.types.string,""),email:o.types.optional(o.types.string,"")};function b(e){const t=[];return e.forEach((e=>{const n=g.find((t=>t.id===e));n&&t.push(n)})),t}const f=o.types.compose(o.types.model(y).views((function(e){return{get sub(){if(null===e.item)return[];if(e.item.id===s.In.OTHER&&"no"===e.areYouABusiness){return b([s.ID.OFFER_EARLY_PAYMENT])}return b(e.item.subItems)}}})).actions((function(e){return{setItem(t){e.item=t},setStep(t){e.step=t},setEmail(t){e.email=t},onboard(t,n){const o={onboardingType:[s.In.OTHER===e.item.id?e.item.id+e.areYouABusiness:e.item.id,t]};e.item.id===s.In.OTHER&&"yes"===e.areYouABusiness&&(o.businessType=e.businessType),[s.ID.RECEIVABLE_FINANCING,s.ID.ACCEPT_ACH_CARD,s.ID.OFFER_TRADE_CREDIT].includes(t)&&(o.approveRead=!0),r.JZ.QN.settings(o).then((()=>{console.log("self.email",e.email),e.email?r.Vv.kQ.updateInfo({email:e.email}).then((()=>{a.A.userStore.fetchUser(),o.approveRead&&this.startGetPaidApplication(n)})):(a.A.userStore.fetchUser(),o.approveRead&&this.startGetPaidApplication(n)),[s.ID.MATERIAL_AND_SERVICE_FINANCING,s.ID.OFFER_EARLY_PAYMENT].includes(t)&&this.startLoanApplication(n)}))},startLoanApplication(e){a.A.userStore.fetchUser().then((()=>{d.A.createLoanApp((()=>
1{this.resetOnboardingAction(),a.A.initRouteParams({}),e.navigate(c.f0.CreditApplication)}))}))},startGetPaidApplication(e){a.A.userStore.fetchUser().then((()=>{a.A.userStore.fetchDocument(u.X.Supplier),e.navigate(c.f0.GetPaidApplication)}))},setIsBusiness(t){e.areYouABusiness=t},getCustomerType(e){const t=a.A.userStore.company;if(null!==t&&void 0!==t&&t.roles&&t.roles.includes(m.Sy.Lender))return[s.DX.LENDER,void 0];if(null===e||void 0===e||!e.length)return[void 0,void 0];const[n,o]=e,r=[s.In.MANUFACTURER_DISTRIBUTOR,s.In.ENGINEER_CONSULTANT,s.In.ARCHITECT_INTERIOR_DESIGNER,s.In.DEALER_RETAILER_SUPPLIER],l=[s.In.SUB_CONTRACTOR,s.In.GENERAL_CONTRACTOR,s.In.DEVELOPER_PROPERTY_OWNER_YES,s.In.DEVELOPER_PROPERTY_OWNER],i=[s.In.DEVELOPER_PROPERTY_OWNER_NO,s.In.OTHER_NO];return r.includes(n)?[s.DX.GET_PAID,o]:l.includes(n)?[s.DX.PAY,o]:s.In.OTHER_YES===n?o===s.ID.GET_PAID_FAST_ACH?[s.DX.GET_PAID,o]:[s.DX.PAY,o]:i.includes(n)?[s.DX.PAY_ONLY,o]:[void 0,void 0]},async skip(){const t=e.item.id===s.In.OTHER||e.item.id===s.In.DEVELOPER_PROPERTY_OWNER?e.item.id+e.areYouABusiness:e.item.id;return r.JZ.QN.settings({onboardingType:[t]}).then((()=>e.email?r.Vv.kQ.updateInfo({email:e.email}).then((()=>a.A.userStore.fetchUser())):a.A.userStore.fetchUser()))},getItems:e=>e?p.filter((t=>t.id===e)):p,getSubItems:e=>e?g.filter((t=>t.id===e)):p,getHomeItems:e=>e?h.filter((t=>t.id===e)):p,resetOnboardingAction(){const t=a.A.userStore.settings.get("onboardingType"),[,n]=e.getCustomerType(t);n&&r.JZ.QN.settings({onboardingType:[t[0]]}).then((()=>{a.A.userStore.fetchUser()}))}}})),(0,r.E2)()).named("OnboardingStore").create({items:p});i()(f);const E=f},6951:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var o=n(50016),r=n(4670),a=n(7371),l=n(78267),i=n(49727),s=n(17171),c=n(38767),d=n(20282),u=n(69102),m=n(50112),p=n(29731),g=n(68215);const h=e=>{let{onPress:t,selectedId:n}=e;const{md:r}=(0,s.Qs)(),{items:l}=u.A,{t:m}=(0,p.Bd)("onboarding");return o.createElement(a.A,null,o.createElement(i.A,{style:[y.title,r&&{marginLeft:15}],testID:"tell_who_you_are_label"},m("tellUsWhoYouAre")),o.createElement(d.hK,{height:16}),o.createElement(i.A,{style:[y.subTitle,r&&{marginLeft:15}],testID:"select_business_category_label"},m("selectBusinessCategory")),!r&&o.createElement(d.hK,{height:40}),o.createElement(a.A,{style:(0,c.composeStyle)(r?{flexDirection:"row",flexWrap:"wrap",justifyContent:"space-evenly"}:{width:"100%"})},l.map((e=>o.createElement(v,{key:e.id,item:e,md:r,onPress:()=>t(e),selectedId:n})))))},v=e=>{let{item:t,md:n,onPress:l,selectedId:s}=e;const{icon:d,id:u}=t,{t:h}=(0,p.Bd)("onboarding"),v=n?64:52,y=t.id===s;return o.createElement(r.A,{onPress:()=>l(t),style:(0,c.composeStyle)({borderColor:y?g.commonColors.accentText:"#E6EBEE",borderWidth:y?2:1,borderRadius:8,marginTop:10,padding:10,shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.05,shadowRadius:5,elevation:1},n?{width:150,height:150,marginTop:60}:{width:"100%",height:80,flexDirection:"row",alignItems:"center"}),testID:"".concat(t.id,"Button")},o.createElement(a.A,{style:(0,c.composeStyle)({width:v,height:v,alignItems:"center",justifyContent:"center"},n?{position:"absolute",top:-30,left:40,borderRadius:v/2,borderColor:y?g.commonColors.accentText:"#E6EBEE",borderWidth:y?2:0}:{})},o.createElement(m.Icon,{name:d})),o.createElement(i.A,{style:(0,c.composeStyle)({fontWeight:"600",width:"100%",textAlign:"center"},n?{marginTop:60}:{marginLeft:15})},h(u)))},y=l.A.create({title:{fontFamily:"Inter",fontSize:28,fontWeight:"600",lineHeight:36,letterSpacing:-.5,color:"#003353"},subTitle:{fontFamily:"Inter",fontSize:18,fontWeight:"500",lineHeight:30,color:"#668598"}})},46756:(e,t,n)=>{"use strict";n.d(t,{A:()=>f,Y:()=>E});var o=n(50016),r=n(7371),a=n(78267),l=n(62525),i=n(49727),s=n(17171),c=n(38767),d=n(20282),u=n(68215),m=n(50112),p=n(69102),g=n(92279),h=n(5438),v=n(29731),y=n(56543),b=n(19226);const f=(0,h.PA)((e=>{let{item:t,onPress:n,onSkip:a}=e;const{sm:c}=(0,s.Qs)(),{setIsBusiness:m,areYouABusiness:h,sub:b,businessType:f,setValue:A}=p.A,{t:S}=(0,v.Bd)("onboarding"),[w,P]=(0,o.useState)(""),I=e=>{t.id!==g.In.OTHER||f||"yes"!==h?n(e):P(S("EnterBusinessType"))};return(0,o.useEffect)((()=>
1{(t.id!==g.In.OTHER||"yes"!==h||f)&&P("")}),[f,t.id,h]),o.createElement(r.A,null,g.In.OTHER===t.id?o.createElement(r.A,null,o.createElement(i.A,{style:{fontSize:c?28:24,fontWeight:"600",marginBottom:c?10:5}},S("areYouBusiness")),o.createElement(l.Ay,{checked:"yes"===h,label:S("yes"),onPress:()=>m("yes"),radioProps:{checkedColor:u.commonColors.accentText},testID:"onboarding_yes_radio_btn"}),o.createElement(l.Ay,{checked:"no"===h,label:S("no"),onPress:()=>m("no"),radioProps:{checkedColor:u.commonColors.accentText},testID:"onboarding_no_radio_btn"}),"yes"===h?o.createElement(o.Fragment,null,o.createElement(i.A,{style:{fontWeight:"500",fontSize:c?20:18,marginTop:c?10:5},testID:"onboarding_type_of_business_label"},S("WhatTypeOfBusiness")),o.createElement(y.p,{error:w,testID:"firstName",value:f,onChangeText:e=>A("businessType",e),label:S("TypeOfBusiness"),mandatory:!0})):o.createElement(o.Fragment,null)):o.createElement(o.Fragment,null,o.createElement(i.A,{style:[C.title,{fontSize:c?28:25}]},S("whatWouldYouLikeToDo")),o.createElement(d.hK,{height:8}),o.createElement(i.A,{style:[C.subTitle,{fontSize:c?18:16}]},S("chooseAnAction")),o.createElement(d.hK,{height:c?15:10})),b.map((e=>o.createElement(E,{key:e.id,item:e,sm:c,onPress:I,disabled:t.id===g.In.OTHER&&f.length<2&&"yes"===h}))),t.id!==g.In.OTHER&&o.createElement(i.A,{style:{width:"100%",fontWeight:"600",color:u.commonColors.accentText,textAlign:"center",marginTop:30},onPress:()=>{t.id!==g.In.OTHER||f||"yes"!==h?a():P(S("EnterBusinessType"))},testID:"onboarding_skip_button"},S("skip")))})),E=e=>{let{item:t,sm:n,onPress:a,style:l={},noIcon:s=!1,disabled:u=!1,noPointer:p=!1}=e;const{subTitle:g,icon:h,id:y}=t,f=n?118:64,{t:E}=(0,v.Bd)("onboarding");return o.createElement(r.A,{style:(0,c.composeStyle)({backgroundColor:"white",borderColor:"#E6EBEE",borderWidth:1,borderRadius:8,marginTop:20,width:"100%",shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.08,shadowRadius:5,elevation:1},l)},u&&o.createElement(r.A,{style:{zIndex:100,backgroundColor:"white",opacity:.8,position:"absolute",height:"100%",width:"100%",borderRadius:8}}),o.createElement(r.A,{style:{flexDirection:"row",alignItems:"center",paddingHorizontal:16,paddingVertical:16}},o.createElement(r.A,{style:{flex:1,marginRight:20},pointerEvents:p?"none":"auto"},o.createElement(i.A,{style:(0,c.composeStyle)(C.cardTitle,n?{fontSize:18}:{fontSize:16})},E(y)),o.createElement(d.hK,{height:5}),o.createElement(i.A,{style:(0,c.composeStyle)(C.cardSubTitle,n?{fontSize:15}:{fontSize:13})},E(g)),o.createElement(b.$,{item:t,onPress:a})),!s&&o.createElement(r.A,{style:(0,c.composeStyle)({width:f,height:f,alignItems:"center",justifyContent:"center"})},o.createElement(m.Icon,{name:h}))))},C=a.A.create({title:{fontFamily:"Inter",fontSize:28,fontWeight:"600",lineHeight:36,letterSpacing:-.5,color:"#001929"},subTitle:{fontFamily:"Inter",fontSize:18,fontWeight:"500",lineHeight:30,color:"#394D5A"},cardTitle:{fontFamily:"Inter",fontSize:18,fontWeight:"600",lineHeight:30,color:"#001929"},cardSubTitle:{fontFamily:"Inter",fontSize:15,fontWeight:"500",lineHeight:26,color:"#394D5A"}})},50112:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Icon:()=>R,OnboardingHeader:()=>_,default:()=>B});var o=n(50016),r=n(71003),a=n(32572),l=n(7371),i=n(49727),s=n(17171),c=n(97076),d=n(38767),u=n(20282),m=n(68215),p=n(6951),g=n(46756),h=n(5438),v=n(12709),y=n(63957),b=n(69102),f=n(56543),E=n(29731);const C=(0,h.PA)((()=>{const{t:e}=(0,E.Bd)("onboarding"),{setStep:t,email:n,setEmail:r}=b.A;return o.createElement(l.A,{style:{width:680,height:300}},o.createElement(i.A,{style:{fontSize:28,fontWeight:"600"}},e("enter-email")),o.createElement(u.hK,{height:16}),o.createElement(f.p,{testID:"login",value:n,onChangeText:r,label:e("email-label"),autoFocus:!0,mandatory:!0}),o.createElement(l.A,{style:{width:"100%",alignItems:"flex-end",paddingHorizontal:15,marginTop:60}},o.createElement(y.A,{style:{alignSelf:"flex-end",marginTop:20},onPress:()=>t(3),disabled:!(n&&(0,v.validateEmail)(n))},e("Continue"))))}));var A=n(2745),S=n(97976),w=n(82345),P=n(67869),I=n(19190),x=n(93894),D=n(68096),T=n(21319),k=n(58876);const B=(0,h.PA)((()=>{var e,t,n,c,h,v,y;const{md:f,screenHeight:B}=(0,s.Qs)(),{setItem:N,onboard:R,item:L,skip:M,step:O,setStep:z,setIsBusiness:j}=b.A,{userStore:W}=(0,S.P)(),V=!(null===(e=W.company)||void 0===e||!e.isBusiness),H=(0,w.useNavigation)(),U=(0,d.composeStyle)({flexGrow:1,backgroundColor:"#F8FBFE",minHeight:"100%"},f&&B>850?{justifyContent:"center",alignItems:"center",paddingVertical:60}:f&&B<=850?{alignItems:"center"}:{}),G=(0,d.composeStyle)({backgroundColor:"white"},f?{maxWidth:740,padding:30,borderRadius:8,...F}:{flex:1,padding:20}),Y=(0,o.useMemo)((()=>{var e;return 2!==O||null!==(e=W.user)&&void 0!==e&&e.email?!L||3!==O&&2!==O?o.createElement(p.A,{onPress:e=>{N((0,A.toJS)(e)),console.log({val:e})},selectedId:L&&L.id}):o.createElement(g.A,{item:L,onPress:e=>R(e,H),onSkip:M}):o.createElement(C,null)}),[L,L&&L.id,O,M,R,N]),{t:Q}
1=(0,E.Bd)("onboarding"),q=(null===(t=S.A.routeParams)||void 0===t?void 0:t.invitationType)===k.zI.SUPPLIER_INVITE_CUSTOMER||(null===(n=S.A.routeParams)||void 0===n?void 0:n.invitationType)===k.zI.SUPPLIER_INVITE_USER,K=!!(T.A.signupInvoiceId&&T.A.signupInvoiceId.length>0),J=q||K||(null===(c=W.user)||void 0===c||null===(h=c.settings)||void 0===h||null===(v=h.conversion)||void 0===v?void 0:v.source_url)&&S.A.branding,Z=(0,o.useMemo)((()=>{var e;return null!==(e=W.user)&&void 0!==e&&e.email?J?1:2:3}),[null===(y=W.user)||void 0===y?void 0:y.email,J]);return o.createElement(r.A,{style:{backgroundColor:"white",flex:1},testID:"onboardingContainer"},S.A.branding?o.createElement(x.X,null):o.createElement(_,{md:f}),o.createElement(a.A,{contentContainerStyle:U},o.createElement(l.A,{style:G},o.createElement(l.A,{style:{width:"100%",justifyContent:"space-between",flexDirection:"row"}},1===O?o.createElement(l.A,null):o.createElement(D.N,{onPress:()=>{z(O-1)},testID:"onboarding_back_button"}),o.createElement(i.A,{style:{backgroundColor:"#F4F9FD",borderRadius:8,paddingHorizontal:10,paddingVertical:5,color:m.commonColors.accentText}},Q("step")," ",O,o.createElement(i.A,null,"/",Z))),o.createElement(u.hK,{height:20}),Y,1===O&&o.createElement(l.A,{style:{width:"100%",alignItems:"flex-end",paddingHorizontal:f?15:0}},o.createElement(u.eF,{buttonStyle:{alignSelf:"right",marginTop:20,opacity:L?1:.1},onPress:()=>{(async()=>{var e;"request-credit"===(null===(e=S.A.routeParams)||void 0===e?void 0:e.action)?M().then((()=>{I.A.createLoanApp((()=>{S.A.initRouteParams({}),H.navigate(P.f0.CreditApplication)}))})):J?(j(V?"yes":"no"),M().then((()=>{var e,t;(null===(e=S.A.routeParams)||void 0===e?void 0:e.invitationType)===k.zI.SUPPLIER_INVITE_CUSTOMER&&null!==(t=S.A.routeParams)&&void 0!==t&&t.factoringSupplierId?(H.navigate(P.f0.InHouseCreditApplication,{supplierId:S.A.routeParams.factoringSupplierId}),S.A.initRouteParams({})):H.navigate(P.f0.Home._self)}))):L&&z(2)})()},testID:"onboarding_continue_button",nativeID:"chosen-category=".concat(null===L||void 0===L?void 0:L.id)},Q("Continue")),!f&&o.createElement(u.hK,{height:20})))))})),F={shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:1.41,elevation:2},_=e=>{let{md:t}=e;return o.createElement(l.A,{style:(0,d.composeStyle)({width:"100%",height:t?80:54,backgroundColor:"white",justifyContent:"center",marginBottom:2},F,t?{paddingLeft:30}:{alignItems:"center"})},o.createElement(c.gkA,{width:t?130:95,height:t?30:22}))},N={IconArchitects:c.OQR,IconContractors:c._m8,IconDealers:c.cWL,IconDistributors:c.qNi,IconEngineers:c.azw,IconHomeOwner:c.wGO,IconOthers:c.jG4,IconProperty:c.PJK,IconGetPaidFastAnd:c.$1Y,IconReceivableFinancing:c.jKK,IconMakePayment:c.kjs,IconAcceptAchAndCardPayments:c.AZs,IconOfferEarlyPayment:c.Bib,IconOfferTradeCredit:c.bJK},R=e=>{let{name:t}=e;const n=N[t];return n?o.createElement(n,null):null}},71995:(e,t,n)=>{"use strict";n.d(t,{w:()=>S});var o=n(63680),r=n(50016),a=n(7371),l=n(78267),i=n(38117),s=n(25891),c=n(58876),d=n(14329),u=n(29731),m=n(50965),p=n(87722),g=n(48321),h=n(97976),v=n(85536),y=n(219),b=n(22759),f=n(97076),E=n(67869),C=n(82047);const A=e=>{let{navigation:t}=e;return r.createElement(b.I,{icon:r.createElement(C.A,{icon:r.createElement(f.tz0,{height:"12",width:"12"}),onPress:()=>{t.canGoBack()?t.goBack():t.navigate(E.f0.Console._self)}})})},S=(0,o.PA)((e=>{var t,n;let{route:o,navigation:l}=e;const{t:f}=(0,u.Bd)("global"),{isBusy:E}=h.A,{submit:C,allSectionsFilled:S,isCurrentSectionFilled:P,mobileAddress:I,initializeAllSections:x}=m.A,{resetRefresher:D}=g.Ay;(0,r.useEffect)((()=>{x()}),[]);const T=(0,r.useCallback)((()=>{var e,t;S&&C(l,D,null===(e=o.params)||void 0===e?void 0:e.ids,null===(t=o.params)||void 0===t?void 0:t.projectId)}),[S,l,D,null===(t=o.params)||void 0===t?void 0:t.ids,null===(n=o.params)||void 0===n?void 0:n.projectId,C]);return I?r.createElement(y.A,{toolbar:r.createElement(b.M,{headerStyle:{marginBottom:0,borderBottomWidth:1,borderBottomColor:"#E6EBEE",width:"100%",paddingHorizontal:0,height:64},title:f("ProjectForm.create"),titleTextStyle:w.titleHeader,leftComponent:r.createElement(a.A,{style:{width:"33%"}}),rightComponent:r.createElement(A,{navigation:l})}),toolbarStyle:{paddingHorizontal:0},footer:r.createElement(a.A,{style:w.buttonContainer},r.createElement(d.BtButton,{onPress:T,disabled:!P||E,style:w.createProjectButton},f("ProjectForm.create")))},r.createElement(s.BM,{contentContainerStyle:{flexGrow:1},keyboardShouldPersistTaps:"handled"},r.createElement(a.A,{style:{padding:16}},r.createElement(i.A,{style:w.title},f("ProjectForm.mobile.header")),r.createElement(d.Spacer,{height:5}),r.createElement(i.A,{style:w.subtitle},f("ProjectForm.mobile.subHeader")),r.createElement(d.Spacer,{height:5}),r.createElement(i.A,{style:[w.title,{fontSize:16}]},f(v.V[c.VT.ADDRESS].title)),r.createElement(d.Spacer,{height:5}),r.createElement(i.A,{style:w.subtitle},f("ProjectForm.mobile.subTitle")),r.createElement(d.Spacer,{height:10}),r.createElement(p.v,{section:c.VT.ADDRESS,question:I,key:null===I||void 0===I?void 0:I.identifier})))):null})),w=l.A.create({titleHeader:{fontWeight:"700",fontSize:16,lineHeight:24,fontFamily:"Inter",color:"#003353"},title:{fontWeight:"700",fontSize:18,lineHeight:24,fontFamily:"Inter",color:"#003353"},subtitle:{fontWeight:"400",fontSize:14,lineHeight:20,marginBottom:15,color:"#001929"},buttonContainer:{paddingHorizontal:20,width:"100%",shadowOffset:{width:0,height:-4},shadowOpacity:.06,shadowRadius:12,elevation:4},createProjectButton:{marginVertical:16,width:"100%"}})},87722:(e,t,n)=>{"use strict";n.d(t,{v:()=>s});var o=n(50016),r=n(79024),a=n(50965),l=n(5438),i=n(2745);const s=(0,l.PA)((e=>{let{section:t,question:n}=e;const{model:l,formData:s}=a.A,c=(0,o.useMemo)((()=>{var e,o,r,a;return null===s||void 0===s||null===(e=s.data)||void 0===e||null===(o=e.get(t||""))||void 0===o||null===(r=o.items)||void 0===r||null===(a=r.find((e=>e.identifier===n.identifier)))||void 0===a?void 0:a.content}),[(0,i.toJS)(null===s||void 0===s?void 0:s.data),n.identifier,t]),d=l(t,n);return o.createElement(o.Fragment,null,!!n.title&&o.createElement(r.VY,{title:n.title,subtitle:n.subtitle}),o.createElement(n.component,{model:d,value:c}))}))}
1,88333:(e,t,n)=>{"use strict";n.d(t,{m:()=>h});var o=n(63680),r=n(19462),a=n(50016),l=n(29731),i=n(7371),s=n(25891),c=n(82997),d=n(58876),u=n(20282),m=n(79024),p=n(87722),g=n(50965);const h=(0,o.PA)((e=>{let{route:t,navigation:n}=e;const{t:o}=(0,l.Bd)("global"),{currentSection:h,questionsUnderCurrentSection:v,formData:y,setUpSection:b,setFormData:f}=g.A;return console.log("===== FORM DATA =====",y&&(0,r.getSnapshot)(y)),(0,a.useEffect)((()=>{var e;null!==(e=t.params)&&void 0!==e&&e.projectId||f(c.lV.create({currentSection:d.VT.ADDRESS})),b(d.VT.ADDRESS)}),[]),a.createElement(i.A,{style:{flex:1}},a.createElement(m.vG,null),a.createElement(s.BM,{contentContainerStyle:{flexGrow:1}},a.createElement(i.A,{style:{alignSelf:"center",width:600}},a.createElement(m.bm,{section:null===y||void 0===y?void 0:y.currentSection,route:t}),a.createElement(m._x,null,o(null===h||void 0===h?void 0:h.title)),(null===h||void 0===h?void 0:h.subtitle)&&a.createElement(m.eE,null,o(null===h||void 0===h?void 0:h.subtitle)),null===v||void 0===v?void 0:v.map((e=>a.createElement(p.v,{section:null===y||void 0===y?void 0:y.currentSection,question:e,key:e.identifier}))),a.createElement(i.A,{style:{alignItems:"flex-end"}},a.createElement(i.A,{style:{flexDirection:"row",marginVertical:30}},a.createElement(m.oq,{navigation:n}),a.createElement(u.hK,{width:20}),a.createElement(m.WE,null))))))}))},50965:(e,t,n)=>{"use strict";n.d(t,{A:()=>y});var o=n(19462),r=n(82997),a=n(24574),l=n(58319),i=n(85536),s=n(58876),c=n(16148),d=n(97976),u=n(52628),m=n.n(u),p=n(13673),g=n(97900),h=n(67869);const v={formData:o.types.maybeNull(r.lV),s3Folder:o.types.optional(o.types.string,"")},y=o.types.compose("ProjectStore",o.types.model(v).actions((e=>({initializeAllSections(){const t=r.lV.create({data:{},currentSection:s.VT.ADDRESS});e.setFormData(t),e.setUpSection(s.VT.ADDRESS),Object.values(s.VT).forEach((t=>{if(t!==s.VT.ADDRESS){var n;const o=e.getQuestionsList(t);null===(n=e.formData)||void 0===n||n.addSection(t,o)}}))},setS3Folder(t){e.s3Folder=t},setFormData(t){e.formData=t},isIndividualOwner:e=>(null===e||void 0===e?void 0:e.type)===s.Je.INDIVIDUAL,isOptional:(e,t)=>i.V[e].allQuestions[t].optional,isBusiness:e=>(null===e||void 0===e?void 0:e.type)===s.Je.BUSINESS,isContractValueMoreThan(){var t,n,o,r,a;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e5;const i=null===(t=e.formData)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.get(s.VT.INFORMATION))||void 0===o||null===(r=o.items)||void 0===r||null===(a=r.find((e=>"contractValue"===e.identifier)))||void 0===a?void 0:a.content;return Number(i)>l},getContent(t,n){var o,r,a,l,i;return null===(o=e.formData)||void 0===o||null===(r=o.data)||void 0===r||null===(a=r.get(t))||void 0===a||null===(l=a.items)||void 0===l||null===(i=l.find((e=>e.identifier===n)))||void 0===i?void 0:i.content},model(t,n){const{identifier:r,shouldProcessAnswer:a,Model:l,title:i}=n,s=m().capitalize(null===r||void 0===r?void 0:r.split(/(?=[A-Z])/).join(" ")),c=i||s;return{setValue:n=>{var o;const l=e.getContent(t,r);null===(o=e.formData)||void 0===o||o.setData(t,r,n,!!n,!0,c),a&&l!==n&&e.onAnswer(t,r)},setModelValue:(n,o)=>{var i,s,d,u,m;const p={...null===(i=e.formData)||void 0===i||null===(s=i.data)||void 0===s||null===(d=s.get(t))||void 0===d||null===(u=d.items)||void 0===u?void 0:u.find((e=>e.identifier===r)).content,[n]:o},g=l.create(p),h=g.filled,v=g.validated;null===(m=e.formData)||void 0===m||m.setData(t,r,p,h,v,c),a&&e.onAnswer(t,r)},setMultipleValue:(n,a,i)=>{var s,d,u,m,p;const g=null===(s=e.formData)||void 0===s||null===(d=s.data)||void 0===d||null===(u=d.get(t))||void 0===u||null===(m=u.items)||void 0===m?void 0:m.find((e=>e.identifier===r)).content;let h;h=g?g.map((e=>e.id===i?{...e,[n]:a}:{...e})):[(0,o.getSnapshot)(l.create({[n]:a}))];const v=h.reduce(((e,t)=>{const n=l.create(t);return e.filled=e.filled&&n.filled,e.validated=e.validated&&n.validated,e}),{filled:!0,validated:!0});null===(p=e.formData)||void 0===p||p.setData(t,r,h,v.filled,v.validated,c)}}},getQuestionsList(e){var t;return null===(t=i.V[e].initialQuestions)||void 0===t?void 0:t.map((e=>{const{identifier:t,title:n,Model:r,multipleAnswers:a}=e;return{identifier:t,title:n,content:r?a?[(0,o.getSnapshot)(r.create({id:(0,c.kk)()}))]:(0,o.getSnapshot)(r.create({})):"",filled:!1,validated:!0}}))}
1,getList:(t,n)=>t.map((t=>{var o,a,l,i;const{identifier:s,title:c}=t;return(null===(o=e.formData)||void 0===o||null===(a=o.data)||void 0===a||null===(l=a.get(n))||void 0===l||null===(i=l.items)||void 0===i?void 0:i.find((e=>e.identifier===s)))||r.vN.create({identifier:s,title:c,content:"",filled:!1,validated:!0})})),setUpSection(t){var n;const o=e.getQuestionsList(t);null===(n=e.formData)||void 0===n||n.setCurrent(t,o)},setUpNextSection(){var t;const n=Object.keys(i.V),o=n[n.indexOf(null===(t=e.formData)||void 0===t?void 0:t.currentSection)+1];e.setUpSection(o)},setUpPreviousSection(){var t;const n=Object.keys(i.V),o=n[n.indexOf(null===(t=e.formData)||void 0===t?void 0:t.currentSection)-1];e.setUpSection(o)},resetProjectType(){var t;const n=e.getQuestionsList(s.VT.TYPE);null===(t=e.formData)||void 0===t||t.resetSectionQuestions(n,s.VT.TYPE)},addQuestionsToInitialList(t,n){var o,r,a,l;const s=i.V[n].initialQuestions.map((e=>e.identifier)),c=null===(o=e.formData)||void 0===o||null===(r=o.data)||void 0===r||null===(a=r.get(n))||void 0===a?void 0:a.items.filter((e=>s.includes(e.identifier)));null===(l=e.formData)||void 0===l||l.resetSectionQuestions([...c,...t],n)},addQuestionsToCurrentList(t,n){var o,r,a,l;const i=null===(o=e.formData)||void 0===o||null===(r=o.data)||void 0===r||null===(a=r.get(n))||void 0===a?void 0:a.items;null===(l=e.formData)||void 0===l||l.resetSectionQuestions([...i,...t],n)},removeQuestion(t,n){var o,r,a,l;const i=(null===(o=e.formData)||void 0===o||null===(r=o.data)||void 0===r||null===(a=r.get(n))||void 0===a?void 0:a.items).filter((e=>e.identifier!==t));null===(l=e.formData)||void 0===l||l.resetSectionQuestions(i,n)},onAnswer(t,n){const o=e.getContent(t,n);switch(t){case s.VT.ADDRESS:{var r,a,l,c;let n=[];const d=i.V.propertyAddress.isNoticeRequired(o),u=null===(r=e.formData)||void 0===r||null===(a=r.data)||void 0===a||null===(l=a.get(s.VT.ADDRESS))||void 0===l||null===(c=l.items.find((e=>"noticeOfCommencement"===e.identifier)))||void 0===c?void 0:c.filled;if(d){if(u)return;n=e.getList(d,t)}return void e.addQuestionsToInitialList(n,t)}case s.VT.INFORMATION:{let r=[];if("role"===n){const n=i.V.projectInformation.isPrimeContractorDetailsRequired(o);n&&(r=e.getList(n,t)),e.addQuestionsToInitialList(r,t);e.getContent(s.VT.TYPE,"type")===s.FJ.PUBLIC&&e.resetProjectType()}else if("contractValue"===n){e.getContent(s.VT.TYPE,"type")===s.FJ.FEDERAL&&e.resetProjectType()}return}case s.VT.TYPE:if("type"===n){const n=i.V.projectType.isPrivate(o)||i.V.projectType.isPublic(o)||i.V.projectType.isFederal(o,e.isContractValueMoreThan());if(n){const o=e.getList(n,t);e.addQuestionsToInitialList(o,t)}}else if("bondExists"===n){const n=i.V.projectType.isBondExists(o);if(n){const o=e.getList(n,t);e.addQuestionsToCurrentList(o,t)}else e.removeQuestion("uploadBond",t)}return;default:return}},sectionCategory(t){var n,o,r;const a=null===(n=e.formData)||void 0===n||null===(o=n.data.get(t))||void 0===o?void 0:o.items.every((n=>e.isOptional(t,n.identifier)&&n.validated||n.filled));return(null===(r=e.formData)||void 0===r?void 0:r.currentSection)===t?s.R6.CURRENT:a?s.R6.FILLED:s.R6.PENDING},addAnotherOwner(t){var n;const a=t.reduce(((e,t)=>{const n=r._O.create(t);return e.filled=e.filled&&n.filled,e.validated=e.validated&&n.validated,e}),{filled:!0,validated:!0}),l=[...t];l.push((0,o.getSnapshot)(r._O.create({id:(0,c.kk)()}))),null===(n=e.formData)||void 0===n||n.setData(s.VT.PROPERTY_OWNER,"details",l,a.filled,a.validated)},removeOwner(t,n){var o;const a=t.filter((e=>e.id!==n)),l=a.every((e=>r._O.create(e).filled)),i=a.every((e=>r._O.create(e).validated));null===(o=e.formData)||void 0===o||o.setData(s.VT.PROPERTY_OWNER,"details",a,l,i)},submit(t,n,i,c){const m=(0,o.getSnapshot)(e.formData),v=(0,u.cloneDeep)(m);if(Object.keys(v.data).forEach((e=>{v.data[e].items.forEach((e=>{delete e.validated}))})),c)r.Vv.Cv.update(c,v).then((()=>{console.log(c,"Project updated"),l.q.invalidateQueries({queryKey:a.c.all}),t.goBack(),n()})).catch((e=>console.log(e)));else{const{streetAddress:o,unitNum:c,state:u,city:m,zip:y,houseNum:b,subdivision:f,lotNum:E,blockNum:C}
1=e.getContent(s.VT.ADDRESS,"address"),A=[o,c,u,m,y,b,f,E,C].filter(Boolean).join(", ");r.Vv.Cv.create({data:v,address:A}).then((e=>{if(l.q.invalidateQueries({queryKey:a.c.all}),d.A.userStore.projectAdded||d.A.userStore.fetchUser(),console.log("here ids",i),i){const n=i.split(",");if(console.log("here res",e),e.data._id){const o=e.data._id;r.Vv.Cv.addInvoices(o,{invoices:n}).then((()=>{var e;(0,g.N)(n,o);const r=null===(e=t.getState().routes[t.getState().routes.length-2])||void 0===e?void 0:e.name;[h.f0.Console.Payables.SelectProject,h.f0.Console.InvoicesToPay.SelectProject].includes(r)?t.pop(2):t.goBack(),p.A.resumeApplyingForLoan()}))}}else console.log("Result 1",e,t.canGoBack()),t.goBack(),n()})).catch((e=>console.log(e)))}}}))).views((e=>({get currentSection(){var t;return i.V[null===(t=e.formData)||void 0===t?void 0:t.currentSection]},get questionsUnderCurrentSection(){var t,n,o,r;const a=null===(t=e.formData)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.get(null===(r=e.formData)||void 0===r?void 0:r.currentSection))||void 0===o?void 0:o.items.map((e=>e.identifier));return null===a||void 0===a?void 0:a.map((t=>{var n;return i.V[null===(n=e.formData)||void 0===n?void 0:n.currentSection].allQuestions[t]}))},get progress(){var t;return(Object.keys(i.V).indexOf(null===(t=e.formData)||void 0===t?void 0:t.currentSection)+1)/Object.keys(i.V).length},get isCurrentSectionFilled(){var t,n,o;const r=null===(t=e.formData)||void 0===t?void 0:t.currentSection;return null===(n=e.formData)||void 0===n||null===(o=n.data.get(r))||void 0===o?void 0:o.items.every((t=>e.isOptional(r,t.identifier)&&t.validated||t.filled))},get isLastSection(){var t;const n=Object.keys(i.V);return n[n.length-1]===(null===(t=e.formData)||void 0===t?void 0:t.currentSection)},get isFirstSection(){var t;return Object.keys(i.V)[0]===(null===(t=e.formData)||void 0===t?void 0:t.currentSection)},get allSectionsFilled(){return Object.keys(i.V).every((t=>{var n,o;return null===(n=e.formData)||void 0===n||null===(o=n.data.get(t))||void 0===o?void 0:o.validated}))},get isSubcontractor(){return e.getContent(s.VT.INFORMATION,"role")===s.gg.SUBCONTRACTOR},get mobileAddress(){var t,n,o,r;const a=null===(t=e.formData)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.get(s.VT.ADDRESS))||void 0===o||null===(r=o.items.find((e=>"address"===e.identifier)))||void 0===r?void 0:r.identifier;return i.V[s.VT.ADDRESS].allQuestions[a]}}))),(0,r.E2)()).create({})},79024:(e,t,n)=>{"use strict";n.d(t,{Jb:()=>s,oq:()=>u,Wj:()=>J,bm:()=>F,ET:()=>N,WE:()=>k,vG:()=>S,VY:()=>m,cR:()=>H,eE:()=>g,_x:()=>p,Uw:()=>K,_O:()=>G,qQ:()=>Z});var o=n(50016),r=n(29731),a=n(4670),l=n(38117),i=n(97076);const s=e=>{let{onPress:t}=e;const{t:n}=(0,r.Bd)("global");return o.createElement(a.A,{style:{width:"100%",height:51,borderRadius:16,borderWidth:2,borderColor:"#00A0F3",alignItems:"center",justifyContent:"center",backgroundColor:"#F4F9FD",flexDirection:"row",marginTop:20},onPress:t},o.createElement(i.Kng,{width:16,height:16,style:{marginRight:10}}),o.createElement(l.A,{style:{fontWeight:"700",fontSize:14,color:"#222B45"}},n("ProjectForm.add-another-owner")))};var c=n(67869),d=n(50965);const u=e=>{let{navigation:t}=e;const{t:n}=(0,r.Bd)("global"),{setUpPreviousSection:i,isFirstSection:s}=d.A;return o.createElement(a.A,{style:{alignItems:"center",justifyContent:"center",backgroundColor:"#F8F9F9",width:132,borderRadius:4},onPress:()=>{console.log("first section",s),s?t.canGoBack()?t.goBack():t.navigate(c.f0.Console._self):i()},testID:"ProjectBackButton"},o.createElement(l.A,{style:{color:"#19262F",fontWeight:"700",fontSize:15}},n("ProjectForm.back-button-label")))},m=e=>{let{title:t,subtitle:n}=e;return o.createElement(o.Fragment,null,o.createElement(l.A,{style:{fontWeight:"700",fontSize:20,lineHeight:28,color:"#394D5A",marginTop:20,marginBottom:n?4:20}},t),n&&o.createElement(l.A,{style:{fontWeight:"400",fontSize:14,lineHeight:20,color:"#394D5A",marginBottom:20,letterSpacing:-.5}},n))},p=e=>{let{children:t}=e;return o.createElement(l.A,{style:{fontWeight:"700",fontSize:28,lineHeight:48,color:"#394D5A",marginTop:40,marginBottom:20}},t)},g=e=>{let{children:t}=e;return o.createElement(l.A,{style:{fontWeight:"500",fontSize:16,lineHeight:20,color:"#394D5A",marginTop:-15,marginBottom:30,letterSpacing:-.5}},t)};var h=n(7371),v=n(78267),y=n(85536),b=n(38767),f=n(17171),E=n(82345);const C={current:{checkIcon:o.createElement(i.onk,null),backgroundColor:"rgba(219, 242, 255, 1)"},pending:{checkIcon:o.createElement(i.TU4,null),backgroundColor:"rgba(248, 249, 249, 1)"},filled:{checkIcon:o.createElement(i.bak,null),backgroundColor:"rgba(14, 192, 107, 0.1)"}},A=e=>{let{name:t,category:n}=e;return o.createElement(h.A,{style:{flexDirection:"row",alignItems:"center"}},o.createElement(h.A,{style:(0,b.composeStyle)(w.checkContainer,{backgroundColor:C[n].backgroundColor})},C[n].checkIcon),o.createElement(l.A,{style:w.name},t))},S=()=>{const{screenWidth:e,sm:t}=(0,f.Qs)(),{t:n}=(0,r.Bd)("global"),s=(0,E.useNavigation)(),{progress:u,sectionCategory:m}=d.A,p=Object.keys(y.V),g=(0,o.useMemo)((()=>e*u),[e,u]);return o.createElement(h.A,{style:P.root},o.createElement(h.A,{style:P.subView},o.createElement(h.A,{style:{width:"8%"}}),t?o.createElement(h.A,{style:{flexDirection:"row"}},p.map(((e,t)=>{const n=e.replace(/([a-z])([A-Z])/g,"$1 $2"),r=m(e);return o.createElement(o.Fragment,{key:e},o.createElement(A,{name:n.replace(/^./,n[0].toUpperCase()),category:r}),t!==p.length-1&&o.createElement(i.mTb,{style:{alignSelf:"center",marginLeft:30,marginRight:30}}))}))):o.createElement(l.A,{style:P.mobileTitle},n("ProjectForm.mobile-title")),o.createElement(a.A,{onPress:()=>{s.canGoBack()?s.goBack():s.navigate(c.f0.Console._self)},style:P.close},o.createElement(i.tz0,{width:12,height:12}))),o.createElement(h.A,{style:(0,b.composeStyle)(P.progressBar,{width:g})}))},w=v.A.create({name:{fontWeight:"600",fontSize:14,lineHeight:22,color:"#19262F"},checkContainer:{width:32,height:32,borderRadius:16,alignItems:"center",justifyContent:"center",marginRight:10}}),P=v.A.create({root:{height:64,width:"100%",justifyContent:"center",borderBottomColor:"#EEF2F5",borderBottomWidth:1},subView:{flexDirection:"row",justifyContent:"space-between",padding:12,alignItems:"center"},progressBar:{height:3,borderRadius:3,backgroundColor:"#00A0F3"},mobileTitle:{fontWeight:"700",fontSize:16,lineHeight:24},close:{borderColor:"#E6EBEE",borderRadius:6,borderWidth:1,alignItems:"center",justifyContent:"center",width:40,height:40,backgroundColor:"#F5F7F8"}});var I=n(14329),x=n(63680),D=n(97976),T=n(48321);const k=(0,x.PA)((()=>{const{t:e}=(0,r.Bd)("global"),{isBusy:t}
1=D.A,n=(0,E.useRoute)(),a=(0,E.useNavigation)(),{setUpNextSection:l,isCurrentSectionFilled:i,isLastSection:s,allSectionsFilled:c,submit:u}=d.A,{resetRefresher:m}=T.Ay,p=()=>{m()},g=(0,o.useMemo)((()=>{var e;return s&&(null===(e=n.params)||void 0===e?void 0:e.projectId)}),[n.params,s]);return o.createElement(I.BtButton,{onPress:()=>{var e,t;s?c&&u(a,p,null===(e=n.params)||void 0===e?void 0:e.ids,null===(t=n.params)||void 0===t?void 0:t.projectId):l()},style:{minWidth:132,borderRadius:4},testID:"ProjectNextButton",disabled:!i||t},e(g?"ProjectForm.update":"ProjectForm.next-button-label"))}));var B=n(58876);const F=e=>{var t,n;let{section:a,route:i}=e;const{t:s}=(0,r.Bd)("global"),c=(0,D.P)(),d=null===c||void 0===c?void 0:c.userStore.projectAdded;return a!==B.VT.ADDRESS?null:null!==(t=i.params)&&void 0!==t&&t.ids&&!d?o.createElement(o.Fragment,null,o.createElement(l.A,{style:_.headingDesktop},s("ProjectForm.main-heading-when-no-projects-exist")),o.createElement(l.A,{style:_.subheadingDesktop},s("ProjectForm.main-subheading"))):null!==(n=i.params)&&void 0!==n&&n.withInvoice?o.createElement(o.Fragment,null,o.createElement(l.A,{style:_.headingDesktop},s("ProjectForm.main-heading-when-projects-exist")),o.createElement(l.A,{style:_.subheadingDesktop},s("ProjectForm.main-subheading"))):null},_=v.A.create({headingDesktop:{marginTop:30,fontWeight:"700",fontSize:32,lineHeight:48,color:"#394D5A"},subheadingDesktop:{marginTop:7,fontWeight:"500",fontSize:16,lineHeight:20,color:"#394D5A",letterSpacing:-.5}}),N=()=>{const{t:e}=(0,r.Bd)("global");return o.createElement(l.A,{style:R.enterManuallyText},e("ProjectForm.please-enter-manually"))},R=v.A.create({enterManuallyText:{fontWeight:"400",fontSize:12,color:"rgba(17, 17, 19, 0.6)",marginTop:7}});var L=n(95090),M=n(68215),O=n(82997),z=n(97872),j=n(60705),W=n(21786),V=n.n(W);const H={NOTICE:"Notice_of_commencement",CONTRACT:"Contract",BOND:"Bond"},U={SUCCESS:"success",PROCESSING:"processing",UPLOADERROR:"uploadError",SIZEERROR:"sizeError"},G=e=>{let{docName:t,onSuccess:n,onDelete:a,uploaded:s=!1}=e;const{t:c}=(0,r.Bd)("global"),{setS3Folder:u,s3Folder:m}=d.A,[p,g]=(0,o.useState)(),[v,y]=(0,o.useState)(s?U.SUCCESS:""),{getRootProps:b,getInputProps:f,open:E}=(0,L.VB)({accept:"image/*, .pdf, .png",onDrop:e=>{const o=e[0];if(o.size>z.OL)return void y(U.SIZEERROR);const r="".concat(t,".").concat(o.name.split(".").pop());y(U.PROCESSING),g(o),O.JZ.NJ.uploadProjectDocument(r,m).then((e=>{const{key:t}=e;(0,j.E)(e,o).then((e=>{u(t.split("/")[2]),[200,201,204].includes(e.status)&&y(U.SUCCESS),n(t)})).catch((()=>y(U.UPLOADERROR)))})).catch((()=>y(U.UPLOADERROR)))},multiple:!1}),C=(0,o.useMemo)((()=>!s||null!==p&&void 0!==p&&p.name?"".concat(null===p||void 0===p?void 0:p.name," ").concat((null===p||void 0===p?void 0:p.size)&&"- (".concat(V()((null===p||void 0===p?void 0:p.size)/1e3/1e3).format({mantissa:2}),"m)")):t),[p,t,s]);return o.createElement(o.Fragment,null,o.createElement(h.A,{style:{height:75,width:600,borderStyle:"dashed",borderWidth:1,borderRadius:10,borderColor:[U.UPLOADERROR,U.SIZEERROR].includes(v)?"#EC002A":"rgba(153, 173, 186, 1)",paddingHorizontal:30,paddingVertical:15}},v===U.PROCESSING?o.createElement(Q,{name:C}):v===U.SUCCESS?o.createElement(Y,{name:C,t:c,onDelete:()=>{a(),y("")}}):o.createElement(h.A,Object.assign({},b({className:"dropzone"}),{style:{flexDirection:"row",alignItems:"center"}}),o.createElement("input",f()),o.createElement(i.$aC,null),o.createElement(h.A,{style:{marginLeft:15,flex:1}},o.createElement(l.A,{style:q.text1},c("UploadFile.select-file")),o.createElement(l.A,{style:q.text2},c("UploadFile.accepted-files"))),o.createElement(I.BtButton,{onPress:E,style:q.uploadButton,testID:"UploadButton"},(()=>o.createElement(l.A,{style:q.uploadButtonLabel},c("UploadFile.upload-file")))))),[U.UPLOADERROR,U.SIZEERROR].includes(v)&&o.createElement(l.A,{style:q.error},U.UPLOADERROR===v?c("UploadFile.on-upload-error"):c("UploadFile.on-size-error")))},Y=e=>{let{name:t,t:n,onDelete:r}=e;return o.createElement(h.A,{style:q.successContainer},o.createElement(i.CeH,{style:{marginRight:7}}),o.createElement(h.A,{style:{flex:1,flexDirection:"row",alignItems:"center"}},o.createElement(l.A,{style:q.fileName},t),o.createElement(i.v3G,null)),o.createElement(a.A,{onPress:r},o.createElement(l.A,{style:q.delete}
1,n("UploadFile.delete"))))},Q=e=>{let{name:t}=e;return o.createElement(o.Fragment,null,o.createElement(h.A,{style:{flexDirection:"row",alignItems:"center"}},o.createElement(l.A,{style:q.fileName},t),o.createElement(i.Zf3,null)),o.createElement(h.A,{style:q.progressBar},o.createElement(h.A,{style:q.progressBarCompleted})))},q=v.A.create({fileName:{fontWeight:"600",fontSize:14,lineHeight:24,color:"#3E4756",marginRight:7},delete:{fontWeight:"700",fontSize:14,color:"#00A0F3"},error:{fontWeight:"600",fontSize:13,color:"#EC002A",marginTop:7},progressBar:{width:"100%",height:4,borderRadius:4,backgroundColor:"#F4F9FD",marginTop:5},progressBarCompleted:{width:"40%",height:4,borderRadius:4,backgroundColor:M.commonColors.accentText},text1:{fontWeight:"600",fontSize:13,lineHeight:15.73,color:"#19262F",marginBottom:10},text2:{fontWeight:"400",fontSize:12,lineHeight:14.52,color:"#758590"},uploadButtonLabel:{color:M.commonColors.accentText,fontWeight:"700",fontSize:14},uploadButton:{width:116,minHeight:30,borderRadius:8,backgroundColor:"rgba(0, 160, 243, 0.1)",border:"none"},successContainer:{flexDirection:"row",alignItems:"center",height:"100%"}}),K=e=>{let{value:t,onChangeText:n,label:a}=e;const{t:l}=(0,r.Bd)("global");return o.createElement(I.CZ,{options:Object.keys(B.ve),mandatory:!0,onSelect:n,value:t,label:a||l("ProjectForm.state"),containerStyle:{marginTop:20}})},J=e=>{let{value:t,onChangeText:n,label:a,style:l}=e;const{t:i}=(0,r.Bd)("global");return o.createElement(I.BtInput,{value:t,onChangeText:n,style:l,label:a||i("ProjectForm.city"),testID:"city",mandatory:!0})},Z=e=>{let{value:t,onChangeText:n,label:a,style:l}=e;const{t:i}=(0,r.Bd)("global");return o.createElement(I.sy,{size:"large",value:t,onChangeText:n,style:l,label:a||i("ProjectForm.zip"),testID:"zip",validate:()=>5===(null===t||void 0===t?void 0:t.length)?"":i("ProjectForm.invalid-zip"),format:"#####",required:!0})}},85536:(e,t,n)=>{"use strict";n.d(t,{V:()=>L});var o=n(58876),r=n(50016),a=n(78267),l=n(7371),i=n(14329),s=n(29731),c=n(82997),d=n(5438),u=n(12709),m=n(38767);const p=(0,d.PA)((e=>{let{model:t,value:n}=e;const{t:a}=(0,s.Bd)("global"),[c,d]=(0,r.useState)(!1),[p,g]=(0,r.useState)(!1),v=(e,n)=>{t.setModelValue(e,n)};return r.createElement(r.Fragment,null,r.createElement(i.WG,{value:c?n.streetAddress:(()=>{const{streetAddress:e,city:t,state:o,zip:r}=n;return e&&t&&o&&r?"".concat(e,", ").concat(t,", ").concat(o,", ").concat(r):""})(),onSelect:e=>{const{address:n,city:o,state:r,zip:a}=e;g(!0),t.setModelValue("streetAddress",n),t.setModelValue("city",o),t.setModelValue("state",r),t.setModelValue("zip",null!==a&&void 0!==a?a:""),(0,u.validateZip)(a)&&o&&d(!1)},onChange:e=>t.setModelValue("streetAddress",e),label:a("ProjectForm.street-address"),testID:"streetAddress",onFocus:()=>d(!0),mandatory:!0}),c&&r.createElement(r.Fragment,null,r.createElement(i.CZ,{options:Object.keys(o.ve),mandatory:!0,onSelect:e=>v("state",e),value:null===n||void 0===n?void 0:n.state,label:a("ProjectForm.state"),containerStyle:{marginTop:20}}),r.createElement(l.A,{style:h.row},r.createElement(i.sy,{size:"large",value:null===n||void 0===n?void 0:n.zip,onChangeText:e=>v("zip",e),style:(0,m.composeStyle)({width:"48%"},p&&!(0,u.validateZip)(null===n||void 0===n?void 0:n.zip)&&{borderColor:"red"}),label:a("ProjectForm.zip"),testID:"zip",validate:()=>5===(null===n||void 0===n?void 0:n.zip.length)?"":a("ProjectForm.invalid-zip"),format:"#####",required:!0}),r.createElement(i.BtInput,{size:"large",value:n.city,onChangeText:e=>v("city",e),style:(0,m.composeStyle)({width:"48%"},p&&!n.city&&{borderColor:"red"}),label:a("ProjectForm.city"),testID:"city",mandatory:!0}))),r.createElement(i.sy,{size:"large",value:null===n||void 0===n?void 0:n.unitNum,onChangeText:e=>v("unitNum",e),style:{marginTop:20},label:a("ProjectForm.unit-num"),testID:"unitNumber",format:"#####"}),r.createElement(l.A,{style:h.row},r.createElement(i.sy,{size:"large",value:null===n||void 0===n?void 0:n.houseNum,onChangeText:e=>v("houseNum",e),style:{width:"48%"},label:a("ProjectForm.house-num"),format:"#########",testID:"house
1Number"}),r.createElement(i.BtInput,{value:n.subdivision,onChangeText:e=>v("subdivision",e),style:{width:"48%"},label:a("ProjectForm.subdivision"),testID:"subdivision",size:"large"})),r.createElement(l.A,{style:h.row},r.createElement(i.sy,{size:"large",value:null===n||void 0===n?void 0:n.lotNum,onChangeText:e=>v("lotNum",e),style:{width:"48%"},label:a("ProjectForm.lot-num"),format:"#########",testID:"lotNumber"}),r.createElement(i.sy,{size:"large",value:n.blockNum,onChangeText:e=>v("blockNum",e),style:{width:"48%"},label:a("ProjectForm.block-num"),format:"#########",testID:"blockNum"})))})),g={identifier:"address",title:"",component:p,Model:c.pk,shouldProcessAnswer:!0},h=a.A.create({row:{flexDirection:"row",justifyContent:"space-between",width:"100%",marginTop:20}}),v={identifier:"contractValue",title:"",component:e=>{let{model:t,value:n}=e;const{t:o}=(0,s.Bd)("global");return r.createElement(i.m,{size:"large",label:o("ProjectForm.contract-value-label"),value:n,maxLength:15,onChangeText:e=>{t.setValue(e)},testID:"projectInfo_contractValue",placeholder:"$"})},shouldProcessAnswer:!0,optional:!0};var y=n(79024);const b={identifier:"primeContractorDetails",title:"Tell us more about the prime contractor",component:e=>{var t,n,o;let{model:a,value:d}=e;const{t:m}=(0,s.Bd)("global"),p=(0,r.useRef)(null),[g,h]=(0,r.useState)(!1),v=(0,r.useCallback)((()=>c.bA.create(d).phoneFilled?"":m("ProjectForm.phone-invalid")),[m,d]),b=(0,r.useCallback)((()=>c.bA.create(d).emailFilled?"":m("ProjectForm.email-invalid")),[m,d]),f=(0,r.useMemo)((()=>{var e;const{address:t,city:n,state:o,zip:r}=null!==(e=d.businessAddress)&&void 0!==e?e:{};return t&&n&&o&&r?"".concat(t," ").concat(n," ").concat(o," ").concat(r):""}),[d.businessAddress]),E=(0,r.useCallback)(((e,t)=>{a.setModelValue(e,t)}),[a]);return r.createElement(r.Fragment,null,r.createElement("div",{ref:p}),r.createElement(i.BtInput,{value:d.businessName,onChangeText:e=>E("businessName",e),testID:"businessName",label:m("ProjectForm.business-name-label"),onFocus:()=>{var e;return null===(e=p.current)||void 0===e?void 0:e.scrollIntoView({behavior:"smooth"})},mandatory:!0}),r.createElement(l.A,{style:{flexDirection:"row",justifyContent:"space-between",width:"100%",marginTop:20}},r.createElement(i.BtInput,{value:d.firstName,onChangeText:e=>E("firstName",e),testID:"firstName",label:m("ProjectForm.first-name-label"),style:{width:"48%"},mandatory:!0}),r.createElement(i.BtInput,{value:d.lastName,onChangeText:e=>E("lastName",e),testID:"lastName",label:m("ProjectForm.last-name-label"),style:{width:"48%"},mandatory:!0})),r.createElement(l.A,{style:{flexDirection:"row",justifyContent:"space-between",width:"100%",marginTop:20}},r.createElement(i.vW,{value:d.phone,testID:"contractorPhone",label:m("ProjectForm.business-phone"),validate:v,onChangeText:e=>E("phone",e.parsed),style:{width:"48%"},required:!0}),r.createElement(i.BtInput,{value:d.email,onChangeText:e=>E("email",e),label:m("ProjectForm.email-label"),testID:"contractorEmail",validateInput:b,validateInputOnBlur:!0,mandatory:!0,style:{width:"48%"}})),r.createElement(i.WG,{value:f,style:{marginTop:20},onSelect:e=>{E("businessAddress",e),(0,u.validateZip)(e.zip)&&e.city&&h(!1)},onChange:e=>E("businessAddress",{...d.businessAddress,address:e}),label:m("ProjectForm.address-label"),onFocus:()=>h(!0),mandatory:!0}),g&&r.createElement(r.Fragment,null,r.createElement(y.Uw,{value:null===(t=d.businessAddress)||void 0===t?void 0:t.state,onChangeText:e=>E("businessAddress",{...d.businessAddress,state:e})}),r.createElement(y.Wj,{value:null===(n=d.businessAddress)||void 0===n?void 0:n.city,onChangeText:e=>E("businessAddress",{...d.businessAddress,city:null!==e&&void 0!==e?e:""}),style:{marginTop:20}}),r.createElement(y.qQ,{value:null===(o=d.businessAddress)||void 0===o?void 0:o.zip,onChangeText:e=>E("businessAddress",{...d.businessAddress,zip:null!==e&&void 0!==e?e:""}),style:{marginTop:20}})))},Model:c.bA,optional:!0},f=Object.values(o.gg),E={identifier:"role",title:"Role on this project",component:e=>{let{model:t,value:n}=e;const{t:o}=(0,s.Bd)("global");return r.createElement(i.BtSelect,{size:"large",options:f,testID:"RoleInput",label:o("ProjectForm.role-label"),value:n,placeholder:o("ProjectForm.role-placeholder"),onChange:e=>{t.setValue(e)},primitiveArray:!0})},shouldProcessAnswer:!0,optional:!0},C={identifier:"timePeriod",title:"",component:e=>{let{model:t,value:n}=e;const{t:o}=(0,s.Bd)("global"),{firstFilled:a,lastFilled:d}
1=c.Y_.create(n),u=(e,n)=>{t.setModelValue(n,e)},m=e=>t=>{const n=t.target.value;8===t.which&&"/"===n[n.length-1]&&u(n.slice(0,n.length-2),e)},p=e=>t=>{let n=t.target.value;const o=t.target.value.length;2!==o&&5!==o||(n=t.target.value+"/"),11!==o&&u(n,e)};return r.createElement(l.A,{style:{flexDirection:"row",justifyContent:"space-between",width:"100%",marginTop:20}},r.createElement(i.BtInput,{maskType:"datetime",label:o("ProjectForm.first-day-on-job"),value:n.firstDayOnJob,onChange:p("firstDayOnJob"),onKeyPress:m("firstDayOnJob"),maskOptions:{format:"MM/DD/YYYY"},maxLength:10,placeholder:o("ProjectForm.date-placeholder"),containerStyle:{maxHeight:40,width:290,borderRadius:4},validateInput:()=>a?"":o("ProjectForm.invalid-first-day"),validateInputOnBlur:!0}),r.createElement(i.BtInput,{maskType:"datetime",label:o("ProjectForm.last-day-on-job"),value:n.expectedLastDayOnJob,onChange:p("expectedLastDayOnJob"),onKeyPress:m("expectedLastDayOnJob"),maskOptions:{format:"MM/DD/YYYY"},maxLength:10,placeholder:o("ProjectForm.date-placeholder"),containerStyle:{maxHeight:40,width:290,borderRadius:4},validateInput:()=>d?"":o("ProjectForm.invalid-last-day"),validateInputOnBlur:!0}))},Model:c.Y_,optional:!0},A={identifier:"bondExists",title:"Is there a bond for this project?",component:e=>{let{model:t,value:n}=e;return(0,r.useMemo)((()=>r.createElement(i.HN,{value:n,onChange:e=>t.setValue(e),options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}],radioStyle:{marginRight:32},groupStyle:{flexDirection:"row"},labelStyle:{color:"#19262F",fontWeight:"500",fontSize:16},testID:"projectType_bondExists"})),[t,n])},shouldProcessAnswer:!0,optional:!0},S={identifier:"descriptionOfPublicProject",title:"Description of public project",component:e=>{let{model:t,value:n}=e;const{t:o}=(0,s.Bd)("global");return r.createElement(r.Fragment,null,r.createElement(i.BtInput,{value:n,onChangeText:e=>t.setValue(e),testID:"descriptionOfPublicProject",label:o("ProjectForm.description-label")}),r.createElement(y.ET,null))},optional:!0},w={identifier:"privateType",title:"Select type of private project",component:e=>{let{model:t,value:n}=e;const{t:o}=(0,s.Bd)("global"),a=(0,r.useMemo)((()=>{const e=[{label:o("ProjectForm.commercial"),value:"commercial"},{label:o("ProjectForm.residential"),value:"residential"}];return r.createElement(i.HN,{value:n,onChange:e=>t.setValue(e),options:e,radioStyle:{marginRight:32},groupStyle:{flexDirection:"row"},labelStyle:{color:"#19262F",fontWeight:"500",fontSize:16},testID:"projectType_privateType"})}),[t,o,n]);return a},optional:!0};var P=n(20282);const I={identifier:"projectBuiltFor",title:"Project is being built for:",component:e=>{let{model:t,value:n}=e;const{t:o}=(0,s.Bd)("global"),a=(0,r.useMemo)((()=>{const e=[{label:o("ProjectForm.spec"),value:"spec"},{label:o("ProjectForm.new-building"),value:"newBuilding"},{label:o("ProjectForm.renovation"),value:"renovation"}],a=e=>t.setValue(e);return r.createElement(r.Fragment,null,r.createElement(i.HN,{value:n,onChange:a,options:e,radioStyle:{marginRight:32},groupStyle:{flexDirection:"row",flexWrap:"wrap"},labelStyle:{color:"#19262F",fontWeight:"500",fontSize:16},testID:"projectType_builtFor"}),r.createElement(P.hK,{height:10}),r.createElement(i.BtInput,{value:e.find((e=>e.value===n))?"":n,onChangeText:a,testID:"built-for-other",label:o("ProjectForm.other-label")}),r.createElement(y.ET,null))}),[t,o,n]);return a},optional:!0},x={identifier:"type",title:"",component:e=>{let{model:t,value:n}=e;return(0,r.useMemo)((()=>r.createElement(i.HN,{value:n,options:[{label:"Private",value:"private"},{label:"Public",value:"public"},{label:"Federal",value:"federal"}],onChange:e=>t.setValue(e),radioStyle:{marginRight:32},groupStyle:{flexDirection:"row"},labelStyle:{color:"#19262F",fontWeight:"500",fontSize:16},testID:"businessOwner_isAuthorized"})),[t,n])},shouldProcessAnswer:!0,optional:!0};var D=n(38117),T=n(50965);const k={identifier:"details",title:"",component:e=>{let{model:t,value:n}=e;const{t:a}=(0,s.Bd)("global"),{isBusiness:c,addAnotherOwner:d,removeOwner:m}=T.A,[p,g]=(0,r.useState)(""),h=(0,r.useCallback)((e=>(0,u.validateUSPhoneNumber)(e)?"":a("ProjectForm.phone-invalid")),[a]),v=e=>{const{address:t,city:n,state:o,zip:r}=null!==e&&void 0!==e?e:{};return t&&n&&o&&r?"".concat(t," ").concat(n," ").concat(o," ").concat(r):""},b=()=>d(n),f=[{label:a("ProjectForm.individual-owner"),value:o.Je.INDIVIDUAL},{label:a("ProjectForm.business"),value:o.Je.BUSINESS}];return r.createElement(r.Fragment,null,n.map(((e,o)=>{const{id:s,type:d,businessName:E,firstName:C,lastName:A,phone:S,address:w}=e;return r.createElement(r.Fragment,{key:s},0!==o&&r.createElement(l.A,{style:{flexDirection:"row",justifyContent:"space-between"}},r.createElement(D.A,{style:{fontWeight:"700",fontSize:20,marginTop:30,marginBottom:10}},a("ProjectForm.another-owner")),r.createElement(i.BtButton,{size:"small",appearance:"ghost",status:"basic",onPress:()=>m(n,s),style:{marginTop:20},iconLeft:"trash-2-outline"},a("ProjectForm.delete"))),r.createElement(i.HN,{value:d,onChange:e=>t.setMultipleValue("type",e,s),options:f,radioStyle:{marginRight:32},groupStyle:{flexDirection:"row"},labelStyle:{color:"#19262F",fontWeight:"500",fontSize:16},testID:"propertyOwnerType"}),c(e)&&r.createElement(i.BtInput,{value:E,onChangeText:e=>t.setMultipleValue("businessName",e,s),testID:"propertyOwnerBusinessName",label:a("ProjectForm.business-name-label"),style:{marginTop:20}}),r.createElement(l.A,{style:{flexDirection:"row",justifyContent:"space-between",width:"100%",marginTop:20}},r.createElement(i.BtInput,{value:C,onChangeText:e=>t.setMultipleValue("firstName",e,s),testID:"propertyOwnerFirstname",label:a("ProjectForm.first-name-label"),style:{width:"48%"}}),r.createElement(i.BtInput,{value:A,onChangeText:e=>t.setMultipleValue("lastName",e,s),testID:"propertyOwnerLastname",label:a("ProjectForm.last-name-label"),style:{width:"48%"}})),r.createElement(i.vW,{value:S,testID:"contractorPhone",label:c(e)?a("ProjectForm.business-phone"):a("ProjectForm.phone-number"),validate:h,onChangeText:e=>t.setMultipleValue("phone",e.parsed,s),style:{marginTop:20}}),r.createElement(i.WG,{value:v(w),style:{marginTop:20},onSelect:e=>{t.setMultipleValue("address",e,s),(0,u.validateZip)(e.zip)&&e.city&&g("")},onChange:e=>t.setMultipleValue("address",{...w,address:e},s),label:c(e)?a("ProjectForm.address-label"):a("ProjectForm.home-address"),onFocus:()=>{g(s)}}),p===s&&r.createElement(r.Fragment,null,r.createElement(y.Uw,{value:null===w||void 0===w?void 0:w.state,onChangeText:e=>t.setMultipleValue("address",{...w,state:e},s)}),r.createElement(y.Wj,{value:null===w||void 0===w?void 0:w.city,onChangeText:e=>t.setMultipleValue("address",{...w,city:null!==e&&void 0!==e?e:""},s),style:{marginTop:20}}),r.createElement(y.qQ,{value:null===w||void 0===w?void 0:w.zip,onChangeText:e=>t.setMultipleValue("address",{...w,zip:null!==e&&void 0!==e?e:""},s),style:{marginTop:20}})),0===o&&r.createElement(y.Jb,{onPress:b}))})))},Model:c._O,multipleAnswers:!0,optional:!0},B={identifier:"noticeOfCommencement",title:"Please upload a notice of commencement",optional:!0,component:e=>{var t,n,o,a;let{model:l}=e;const i=null===(t=T.A.formData)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.get("propertyAddress"))||void 0===o||null===(a=o.items.find((e=>"noticeOfCommencement"===e.identifier)))||void 0===a?void 0:a.filled;return r.createElement(y._O,{docName:y.cR.NOTICE,onSuccess:e=>{l.setValue(e)},onDelete:()=>{l.setValue("")},uploaded:i})}},F={identifier:"subcontractorShouldCarryBond",title:"Were you required to carry a bond?",subtitle:"As the sub-contractor*",component:e=>{let{model:t,value:n}=e;return(0,r.useMemo)((()=>r.createElement(i.HN,{value:n,onChange:e=>t.setValue(e),options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}],radioStyle:{marginRight:32},groupStyle:{flexDirection:"row"},testID:"subcontractor_should_carry_bond"})),[t,n])},optional:!0},_={identifier:"uploadBond",title:"Please upload a copy of the bond",component:e=>{var t,n,o,a;let{model:l}=e;const i=null===(t=T.A.formData)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.get("projectType"))||void 0===o||null===(a=o.items.find((e=>"uploadBond"===e.identifier)))||void 0===a?void 0:a.filled;return r.createElement(y._O,{docName:y.cR.BOND,onSuccess:e=>{l.setValue(e)},onDelete:()=>{l.setValue("")},uploaded:i})}},N={identifier:"jobId",title:"What is the Job ID?",component:e=>{let{model:t,value:n}=e;const{t:o}=(0,s.Bd)("global");return r.createElement(i.BtInput,{value:n,onChangeText:e=>t.setValue(e),label:o("ProjectForm.jobid-label"),testID:"jobId"})},optional:!0},R={identifier:"uploadContract",title:"Please upload the contract",component:e=>{var t,n,o,a;let{model:i}=e;const s=null===(t=T.A.formData)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.get("projectInformation"))||void 0===o||null===(a=o.items.find((e=>"uploadContract"===e.identifier)))||void 0===a?void 0:a.filled;return r.createElement(l.A,{style:{marginBottom:15}},r.createElement(y._O,{docName:y.cR.CONTRACT,onSuccess:e=>i.setValue(e),onDelete:()=>i.setValue(""),uploaded:s}))},optional:!0}
1,L={propertyAddress:{title:"ProjectForm.address-title",subtitle:"ProjectForm.address-subtitle",initialQuestions:[g,N],isNoticeRequired:e=>!!o.N6.includes(e.state.toLowerCase())&&[B],allQuestions:{address:g,jobId:N,noticeOfCommencement:B}},projectInformation:{title:"ProjectForm.project-info-title",initialQuestions:[v,R,C,E],isPrimeContractorDetailsRequired:e=>![o.gg.PRIME_OR_GENERAL].includes(e)&&[b],allQuestions:{contractValue:v,uploadContract:R,timePeriod:C,role:E,primeContractorDetails:b}},projectType:{title:"ProjectForm.project-type-title",initialQuestions:[x],isPrivate:e=>e===o.FJ.PRIVATE&&[w,I],isPublic:e=>{const t=[];return e===o.FJ.PUBLIC&&(t.push(S,A),T.A.isSubcontractor&&t.push(F),t)},isFederal:e=>e===o.FJ.FEDERAL&&(T.A.isContractValueMoreThan()?[_]:[A]),isBondExists:e=>"yes"===e&&[_],allQuestions:{type:x,privateType:w,projectBuiltFor:I,descriptionOfPublicProject:S,bondExists:A,subcontractorShouldCarryBond:F,uploadBond:_}},propertyOwner:{title:"ProjectForm.property-owner-title",initialQuestions:[k],allQuestions:{details:k}}}},10349:(e,t,n)=>{"use strict";n.d(t,{P:()=>u});var o=n(50016),r=n(7371),a=n(29731),l=n(14329),i=n(97076);const s=n(78267).A.create({mainWrapper:{flex:1,alignItems:"center"},bottomTitle:{fontSize:24,color:"#003353",fontWeight:"600",lineHeight:30,marginTop:40,marginBottom:20},bottomSubtitle:{fontSize:18,fontWeight:"400",color:"#335C75",lineHeight:26,textAlign:"center"},button:{marginTop:20,borderRadius:4}});var c=n(82345),d=n(67869);const u=e=>{let{title:t,subtitle:n,btnText:u,params:m,buttonOnPress:p}=e;const{t:g}=(0,a.Bd)("global"),h=(0,c.useNavigation)();return o.createElement(r.A,{style:s.mainWrapper,testID:"projects_empty_content_wrapper"},o.createElement(i.m3J,{width:409,height:309}),o.createElement(l.BtText,{style:s.bottomTitle},t||g("Projects.create_first_project")),o.createElement(l.BtText,{style:s.bottomSubtitle},n||g("Projects.create_first_project_subtitle")),"receivable"!==(null===m||void 0===m?void 0:m.category)&&"PAID"!==(null===m||void 0===m?void 0:m.status)||"payable"!==(null===m||void 0===m?void 0:m.category)&&"PAID"!==(null===m||void 0===m?void 0:m.status)?o.createElement(l.BtButton,{testID:"projects-create-button",style:s.button,onPress:()=>p?p():h.navigate(d.f0.NewProject)},u||g("Projects.create_first_project")):null)}},30584:(e,t,n)=>{"use strict";n.d(t,{L:()=>c});var o=n(50016),r=n(7371),a=n(29731),l=n(14329),i=n(97076),s=n(40488);const c=(0,o.memo)((e=>{let{value:t,onChange:n,setResetPaginationToggle:c,resetPaginationToggle:d}=e;const{t:u}=(0,a.Bd)("global");return o.createElement(r.A,{style:{width:"100%",alignItems:"center"}},o.createElement(l.BtInput,{placeholder:u("Projects.searchProjectName"),style:s.R.input,containerStyle:{borderWidth:1,borderColor:"#E4E9F2",height:40},onChangeText:n,value:t,onClear:()=>{t&&(c(!d),n(""))},testID:"projects-search-input",rightComponent:o.createElement(i.DKe,null)}))}))},69873:(e,t,n)=>{"use strict";n.d(t,{r:()=>E});var o=n(4670),r=n(7371),a=n(50016),l=n(63680),i=n(29731),s=n(14329),c=n(82997),d=n(82345),u=n(17171),m=n(30584),p=n(10349),g=n(67869),h=n(48321),v=n(24038);const y={table:{style:{backgroundColor:v.Tj.surface,alignSelf:"center"}},tableWrapper:{style:{backgroundColor:v.Tj.surface,width:"100%",justifyContent:"center",display:"flex"}},subHeader:{style:{paddingBottom:0,flex:1}},head:{style:{}},headRow:{style:{borderBottomWidth:0,minHeight:35},denseStyle:{}},contextMenu:{style:{},activeStyle:{}},cells:{style:{paddingLeft:0,paddingRight:0,color:v.Tj.primary,fontSize:16,lineHeight:1.5,fontWeight:"400"}},rows:{selectedHighlightStyle:{},denseStyle:{},stripedStyle:{}},expanderRow:{style:{}},expanderCell:{style:{}},expanderButton:{style:{}},pagination:{style:{width:"90%",alignSelf:"center",borderTopWidth:0},pageButtonsStyle:{}},noData:{style:{}},progress:{style:{width:"100%"}}};var b=n(40488),f=n(19925);const E=(0,l.PA)((e=>{let{cols:t,params:n}=e;const l=(0,d.useNavigation)(),{sm:v}=(0,f.Qs)(),{t:E}=(0,i.Bd)("global"),{searchText:C,setSearchText:A}=(0,u.ui)(),[S,w]=(0,a.useState)(!1),{count:P,pageSize:I,refresher:x,updateProjectDetail:D}=h.Ay,T=[{cell:e=>{var t;return a.createElement(r.A,{style:{flexDirection:"row",marginBottom:20,marginTop:20,width:"100%"}},a.createElement(r.A,{style:{flex:1}},a.createElement(s.BtText,{style:b.R.rowsLabel},e.data?(e=>{let{streetAddress:t,city:n,state:o,zip:r}=e;return"".concat(t,", ").concat(n,", ").concat(o,", ").concat(r)})(null===(t=e.data)||void 0===t?void 0:t.propertyAddress.items[0].content):e.address)),a.createElement(o.A,{style:{width:126,height:34,borderRadius:8,backgroundColor:"#F5F7F8",alignItems:"center",justifyContent:"center"},onPress:()=>{D(e),l.navigate(g.f0.Console.Projects.Details,{projectId:null===e||void 0===e?void 0:e._id})}},a.createElement(s.BtText,{style:{fontWeight:"700",fontSize:14}},E("Projects.more-details"))))}}];return a.createElement(r.A,{style:b.R.mainWrapper},a.createElement(s.tv,{style:y,columns:t||T,apiCaller:e=>c.Vv.Cv.findAll(e),filterPlaceholder:E("Projects.searchPropertyAddress"),defaultSortColumn:E("Projects.createdAt"),refresher:x,noDataComponent:a.createElement(p.P,{title:E("noItems"),subtitle:E("Projects.TryAgainProject"),btnText:E("Projects.create-project")}),pagination:!0,paginationServer:!0,rowsPerPage:I,paginationTotalRows:P,paginationPerPage:5,onItemPress:e=>{D(e),l.navigate(g.f0.Console.Projects.Details,{projectId:null===e||void 0===e?void 0:e._id})},filterWidth:v?680:"100%",subHeader:!0,subHeaderAlign:E("Projects.left"),highlightOnHover:!1,subHeaderComponent:a.createElement(m.L,{value:C,onChange:A,setResetPaginationToggle:w,resetPaginationToggle:S}),extraApiParams:{invoices:n}}))}))}
1,40488:(e,t,n)=>{"use strict";n.d(t,{R:()=>o});const o=n(78267).A.create({mainWrapper:{flex:1},inputContainer:{width:542,paddingLeft:16,paddingRight:19,backgroundColor:"#F7F9FC",borderRadius:4,borderWidth:1,borderColor:"#E4E9F2",textAlignVertical:"top",flexDirection:"row",alignItems:"center",marginTop:31,marginLeft:-24},input:{width:680,marginTop:0,backgroundColor:"#F7F9FC",borderWidth:1,borderColor:"#E4E9F2"},rowsLabel:{fontWeight:"500",fontSize:14,color:"#003353",lineHeight:20},businessNameLabel:{fontSize:16,color:"#335C75",lineHeight:24}})},48321:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>b});var o=n(19462),r=n(74841),a=n.n(r),l=n(23886),i=n.n(l),s=n(93617),c=n(82997),d=n(24574),u=n(58319),m=n(20648);var p=function(e){return e.Page="page",e.PageSize="pageSize",e}(p||{});const g=o.types.array(c.qO.props({_id:o.types.string,isChecked:o.types.optional(o.types.boolean,!1),customer:o.types.maybeNull(c.q0.props({_id:o.types.string}))})),h={isVisibleSidebar:o.types.optional(o.types.boolean,!1),listing:o.types.optional(o.types.array(s.M),[]),[p.Page]:o.types.optional(o.types.number,1),[p.PageSize]:o.types.optional(o.types.number,10),loading:o.types.optional(o.types.boolean,!0),loadingDelete:!1,count:0,chosenName:"",chosenAddress:"",chosenAmount:0,chosenNotes:"",receivables:g,payables:g,income:g,expenses:g,stats:o.types.model({receivables:o.types.optional(o.types.union(o.types.string,o.types.number),"0"),income:o.types.optional(o.types.union(o.types.string,o.types.number),"0"),expense:o.types.optional(o.types.union(o.types.string,o.types.number),"0")}),invoiceListing:g,viewInvoice:o.types.optional(o.types.boolean,!1),invoiceId:o.types.maybeNull(o.types.union(o.types.string,o.types.number)),selectedInvoices:o.types.array(o.types.string),noteIsTypingNow:o.types.optional(o.types.boolean,!1),projectDetail:s.M,type:o.types.string,activeInvoice:o.types.frozen(),invoiceSource:o.types.optional(o.types.string,""),refresher:o.types.optional(o.types.number,0)};function v(e){if(!e)return"";let t="";return e.first_name&&(t=e.first_name),e.last_name&&(t=t?t+" "+e.last_name:e.last_name),t?t.trim():""}const y=o.types.compose(o.types.model(h).actions((e=>({resetRefresher:()=>e.refresher+=1,updateType:t=>e.type=t,updateProjectDetail:t=>{e.projectDetail={_id:null===t||void 0===t?void 0:t._id,name:null===t||void 0===t?void 0:t.name,company_id:null===t||void 0===t?void 0:t.company_id,projectId:null===t||void 0===t?void 0:t._id,totalInvoices:null===t||void 0===t?void 0:t.totalInvoices,lastActivityDate:null===t||void 0===t?void 0:t.lastActivityDate,address:null===t||void 0===t?void 0:t.address,notes:null===t||void 0===t?void 0:t.notes,contractValue:null===t||void 0===t?void 0:t.contractValue,updatedAt:null===t||void 0===t?void 0:t.updatedAt,customer_account_id:null===t||void 0===t?void 0:t.customer_account_id,customerName:null===t||void 0===t?void 0:t.customerName,data:null===t||void 0===t?void 0:t.data},e.projectDetail.invoices=i()(null===t||void 0===t?void 0:t.invoices),e.projectDetail.customer=i()({...null===t||void 0===t?void 0:t.customer,name:v(null===t||void 0===t?void 0:t.customer)})},updateReceivables:t=>{var n,o;e.receivables.replace(t),null===(n=e.receivables)||void 0===n||null===(o=n.customer)||void 0===o||o.replace(null===t||void 0===t?void 0:t.customer)},updateIncome:t=>{e.income.replace(t),e.income.customer.replace(null===t||void 0===t?void 0:t.customer)},updatePayables:t=>{e.payables.replace(t),e.payables.customer.replace(null===t||void 0===t?void 0:t.customer)},updateExpenses:t=>{e.expenses.replace(t),e.expenses.customer.replace(null===t||void 0===t?void 0:t.customer)},toggleSideBar:()=>e.isVisibleSidebar=!e.isVisibleSidebar,setNoteIsTypingNow:t=>e.noteIsTypingNow=t,setViewInvoice(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";e.viewInvoice=t,e.invoiceSource=t?n:""},resetEverything:()=>{e.stats={expense:"0",income:"0",receivables:"0"},e.invoiceListing=[],e.receivables=[],e.income=[],e.expenses=[],e.payables=[],e.selectedInvoices=[],e.projectDetail={},e.type="receivable"},setActiveInvoice:t=>e.activeInvoice=t,updateSelectedInvoices:t=>{let{selectedRows:n}=t;return e.selectedInvoices=null===n||void 0===n?void 0:n.map((e=>(null===e||void 0===e?void 0:e._id)||(null===e||void 0===e?void 0:e.id)))},updateProjectStats:t=>e.stats=t,updateInvoiceListing:t=>e.invoiceListing=t,updateListing:t=>{e.listing=t.items,e.count=t.count},setLoading:t=>{e.loading=t},setLoadingDelete:t=>{e.loadingDelete=t},setPageNum:t=>{e[p.Page]=t,e.fetchListing()},setPageSize:t=>{e[p.PageSize]=t,e.fetchListing()},onSearchListing:(0,o.flow)((function*(t){const n=yield c.Vv.Cv.findAll({page:e.page,pageSize:e.pageSize,search:t});var o;(n.result="ok")&&((null===n||void 0===n||null===(o=n.items)||void 0===o?void 0:o.length)>0&&e.updateListing(n),e.setLoading(!1))})),fetchListing:(0,o.flow)((function*(){const t=yield c.Vv.Cv.findAll({page:e.page,pageSize:e.pageSize});var n;(t.result="ok")&&((null===t||void 0===t||null===(n=t.items)||void 0===n?void 0:n.length)>0&&e.updateListing(t),e.setLoading(!1))})),deleteProject:(0,o.flow)((function*(e,t){((yield c.Vv.Cv.del(e)).result="ok")&&(u.q.invali
1dateQueries({queryKey:d.c.all}),t())})),updateProject:(0,o.flow)((function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){if(n.hasOwnProperty("name")){const e=yield c.Vv.Cv.update(t,n);return u.q.invalidateQueries({queryKey:d.c.all}),e}const o=c.Vv.Cv.update(t,{notes:e.chosenNotes,data:{}});return o.then((()=>u.q.invalidateQueries({queryKey:d.c.all}))),o}()})),getProjectTabInvoices:(0,o.flow)((function*(t){const n=yield c.Vv.Cv.getInvoices({...t});if(n.result="ok"){const o=n.items.map((e=>{var t,n,o;const r=null===(t=e.material_subtotal)||void 0===t?void 0:t.toString(),a=null===(n=e.refunded_amount)||void 0===n?void 0:n.toString(),l=null===(o=e.tax_amount)||void 0===o?void 0:o.toString(),i=null===e||void 0===e?void 0:e._id;return{...e,id:i,tax_amount:l,refunded_amount:a,material_subtotal:r}}));"receivable"===(null===t||void 0===t?void 0:t.category)&&""===(null===t||void 0===t?void 0:t.status)&&e.updateReceivables(o),"receivable"===(null===t||void 0===t?void 0:t.category)&&"PAID"===(null===t||void 0===t?void 0:t.status)&&e.updateIncome(o),"payable"===(null===t||void 0===t?void 0:t.category)&&""===(null===t||void 0===t?void 0:t.status)&&e.updatePayables(o),"payable"===(null===t||void 0===t?void 0:t.category)&&"PAID"===(null===t||void 0===t?void 0:t.status)&&e.updateExpenses(o)}})),getProjectStats:(0,o.flow)((function*(t){const n=yield c.Vv.Cv.getStatistics(t);(n.result="ok")&&e.updateProjectStats(n.data)})),addInvoicesToProject:(0,o.flow)((function*(t,n){((yield c.Vv.Cv.addInvoices(t,{invoices:e.selectedInvoices})).result="ok")&&(e.updateSelectedInvoices([]),n())})),removeInvoicesFromProject:(0,o.flow)((function*(t,n){((yield c.Vv.Cv.removeInvoices(t,{invoices:e.selectedInvoices})).result="ok")&&(e.updateSelectedInvoices([]),n())})),getProjectDetail:(0,o.flow)((function*(t){const n=yield c.Vv.Cv.findById(t);(n.result="ok")&&e.updateProjectDetail(n.data)})),isProjectMissingOnAllInvoices:e=>e.every((e=>!e.project_id)),areInvoicesFromSameProject(e){var t;const n=null===(t=e[0])||void 0===t?void 0:t.project_id;return e.every((e=>e.project_id&&e.project_id===n))},isSearchScoreMoreThanThreshold:e=>e>=.1}))),(0,c.E2)(),(0,m.O)(s.M)).named("ProjectsStore").create({listing:[],chosenDetails:{isOpenedSidebar:!1},receivables:[],payables:[],income:[],expenses:[],stats:{receivables:"0",income:"0",expense:"0"},invoiceListing:[],projectDetail:{},type:"receivable",refresher:0});a()(y);const b=y},92147:(e,t,n)=>{"use strict";n.d(t,{G:()=>d});var o=n(50016),r=n(70764),a=n(73984),l=n(56480),i=n(63092),s=n(29731);const c="ExpiredLinkNotice_root__X5uCj",d=()=>{const{t:e}=(0,s.Bd)("global");return o.createElement(r.B,{className:c,gap:8},o.createElement(a.h,{order:4},e("payables.public.expiredTitle")),o.createElement(l.E,null,o.createElement(s.x6,{t:e,i18nKey:"payables.public.expiredMessage",components:{email:o.createElement(i.M,{href:"mailto:".concat(e("contact-email"))})}})))}},92985:(e,t,n)=>{"use strict";n.d(t,{Y:()=>a});var o=n(82997),r=n(67869);const a={canOfferSignIn:l,toWizardInvoice:function(e,t,n){return{_id:e,existingCustomer:l(t,n)?{login:t.email}:void 0,customer:{first_name:t.firstName,last_name:t.lastName,email:t.email,phone:t.phone,name:t.businessName}}},toSignupCustomer:function(e,t){var n,o,r,a,l;return{first_name:null!==(n=t.firstName)&&void 0!==n?n:"",last_name:null!==(o=t.lastName)&&void 0!==o?o:"",email:null!==(r=t.email)&&void 0!==r?r:"",phone:null!==(a=t.phone)&&void 0!==a?a:"",name:null!==(l=t.businessName)&&void 0!==l?l:"",invoiceId:e,customerAccountId:t.customerAccountId,isBillingContact:t.isBillingContact}},handoffTarget:i,performHandoff:async function(e,t){let{paymentType:n,invoiceId:o}=e,{navigate:a,prefetchInvoice:l}=t;const s=i(n,o);l&&s.name===r.f0.InvoiceLink.Invoice&&await l(o);a(s.name,s.params)}};function l(e,t){return t&&!!e.email}function i(e,t){return{name:e===o.mn.FACTORING?r.f0.InvoiceLink.PaymentHistory:r.f0.InvoiceLink.Invoice,params:{id:t}}}},76333:(e,t,n)=>{"use strict";n.d(t,{w:()=>y});var o=n(50016),r=n(70764),a=n(50767),l=n(60563),i=n(63680),s=n(97076),c=n(83613),d=n(10972);const u="PublicScreenLayout_root__xwfLG",m="PublicScreenLayout_header__q23DR",p="PublicScreenLayout_logo__QCW+p",g="PublicScreenLayout_close__sv9LW",h="PublicScreenLayout_scroll__7V9xD",v="PublicScreenLayout_footer__Fq--l",y=(0,i.PA)((e=>
1{let{children:t,footer:n,onClose:i}=e;const y=!!c.A.branding;return o.createElement(r.B,{className:u},!y&&o.createElement(a.a,{component:"header",className:m,"data-testid":"publicScreenHeader"},o.createElement(a.a,{className:p},o.createElement(s.SeL,null)),i&&o.createElement(d.$,{type:"close",className:g,onClick:i,"data-testid":"publicScreenClose"})),o.createElement(l.F,{className:h,"data-testid":"publicScreenScroll"},t),!!n&&o.createElement(a.a,{component:"footer",className:v,"data-testid":"publicScreenFooter"},n))}))},54763:(e,t,n)=>{"use strict";n.d(t,{Y:()=>a,x:()=>l});let o=!1;const r=new Set,a=()=>{o=!0,r.size>0&&(o=!1,r.forEach((e=>e())))},l=e=>(r.add(e),o&&(o=!1,e()),()=>{r.delete(e)})},4287:(e,t,n)=>{"use strict";n.d(t,{d:()=>a,q:()=>l});let o=!1;const r=new Set,a=()=>{o=!0,r.size>0&&(o=!1,r.forEach((e=>e())))},l=e=>(r.add(e),o&&(o=!1,e()),()=>{r.delete(e)})},61289:(e,t,n)=>{"use strict";n.r(t),n.d(t,{navigate:()=>r,navigationRef:()=>o});const o=n(50016).createRef();function r(e,t){var n;null===(n=o.current)||void 0===n||n.navigate(e,t)}},79074:(e,t,n)=>{"use strict";n.d(t,{R:()=>s});var o=n(50016),r=n(29731),a=n(63680),l=n(64504),i=n(17171);const s=(0,a.PA)((e=>{const{t:t}=(0,r.Bd)(),{sm:n}=(0,i.Qs)(),{visible:a,onClose:s,onConfirm:c}=e,d={testID:"logout-logout",label:t("logOut"),status:"basic",onPress:c},u={testID:"logout-continue-session",label:t("continue-session"),status:"primary",onPress:s};return o.createElement(l.Fc,{visible:a,verticalButtons:!n,onClose:s,buttons:n?[d,u]:[u,d],buttonsContainerStyle:{alignSelf:"center",width:n?"90%":280},title:t("are-you-sure-to-logout"),titleStyle:{width:280,fontWeight:"600",marginTop:16}})}))},37458:(e,t,n)=>{"use strict";n.d(t,{h:()=>s});var o=n(80608),r=n(2745),a=n(24349),l=n(76525),i=n(58319);class s{constructor(){this.loading=!1,this.exportLoading=!1,this.dataLoaded=!1,this.page=1,this.sort=this.getDefaultSort(),this.filter=null,this.tableData={items:[],totalCount:0},this.request=void 0,this.exportFileName="",this.observer=void 0,this.observerUnsubscribe=void 0}setPage(e){this.page=e,this.fetchData()}resetPage(){this.page=1}setSort(e,t){this.sort=e&&t?{column:e,direction:t}:{column:"",direction:""},this.fetchData()}resetSort(){this.sort=this.getDefaultSort()}getDefaultSort(){return{column:"createdAt",direction:"desc"}}setFilter(e){this.hasSearchQueryChanged(e)&&(this.page=1),this.filter=e,this.fetchData()}hasSearchQueryChanged(e){return!1}initObservable(){(0,r.makeObservable)(this,{loading:r.observable,exportLoading:r.observable,page:r.observable,sort:r.observable,tableData:r.observable,filter:r.observable,setPage:r.action,setSort:r.action,setFilter:r.action,fetchData:r.action})}callApi(e){throw new Error("BaseTableStore: subclass must implement callApi() or getQueryOptions()")}fetchData(){const e=this.buildParams();this.getQueryOptions?this.fetchViaObserver(e):this.fetchViaCallApi(e)}prefetch(){this.getQueryOptions&&i.q.fetchQuery({...this.getQueryOptions(this.buildParams()),staleTime:0}).catch((()=>{}))}fetchViaObserver(e){const t=this.getQueryOptions(e);this.loading=!0,this.observer?(this.observer.setOptions(t),this.observer.refetch().catch((()=>{}))):(this.observer=new l.$(i.q,t),this.observerUnsubscribe=this.observer.subscribe((e=>this.handleObserverResult(e))),this.handleObserverResult(this.observer.getCurrentResult()))}fetchViaCallApi(e){var t,n;(this.loading=!0,null!==(t=this.request)&&void 0!==t&&t.cancel)&&(null===(n=this.request)||void 0===n||n.cancel());this.request=this.callApi(e),this.request.then((e=>{(0,r.runInAction)((()=>{this.applyResponse(e)}))})).catch((e=>{if("request-cancelled"!==e.code)throw(0,r.runInAction)((()=>{this.loading=!1,this.dataLoaded=!0})),e}))}buildParams(){const e=this.sort.column?this.sort:this.getDefaultSort();return{...this.filter,sortColumn:e.column,sortDirection:e.direction,page:this.page,pageSize:o.md}}handleObserverResult(e){(0,r.runInAction)((()=>{this.loading=e.isFetching,e.isFetching||"success"!==e.status?e.isFetching||"error"!==e.status||(this.dataLoaded=!0):this.applyResponse(e.data)}))}applyResponse(e){var t,n,o,r;(this.dataLoaded=!0,null!==e&&void 0!==e&&null!==(t=e.items)&&void 0!==t&&t.length||1===this.page)?this.tableData={items:null!==(n=null===e||void 0===e||null===(o=e.items)||void 0===o?void 0:o.map((e=>
1this.formatTableItem(e))))&&void 0!==n?n:[],totalCount:null!==(r=null===e||void 0===e?void 0:e.totalCount)&&void 0!==r?r:0}:(this.tableData={items:[],totalCount:0},this.setPage(1));this.handleDataFetched(e),this.loading=!1}handleDataFetched(e){}invalidate(){this.dataLoaded=!1}async exportData(){(0,r.runInAction)((()=>{this.exportLoading=!0}));const e={...this.filter,page:-1,pageSize:-1};try{var t;const n=null===(t=(this.getQueryOptions?await i.q.fetchQuery({...this.getQueryOptions(e),staleTime:0}):await this.callApi(e)).items)||void 0===t?void 0:t.map((e=>{const t=this.formatTableItem(e);return this.formatExportItem(t)})).filter(Boolean);(0,a.bJ)(n||[],this.exportFileName,"xlsx")}finally{(0,r.runInAction)((()=>{this.exportLoading=!1}))}}dispose(){var e,t,n;null===(e=this.observerUnsubscribe)||void 0===e||e.call(this),this.observerUnsubscribe=void 0,null===(t=this.observer)||void 0===t||t.destroy(),this.observer=void 0,null!==(n=this.request)&&void 0!==n&&n.cancel&&this.request.cancel(),this.request=void 0}}},36913:(e,t,n)=>{"use strict";n.d(t,{fv:()=>m});var o=n(19462),r=n(82997),a=n(50016),l=n(52628),i=n.n(l),s=n(74161),c=n.n(s);const d=o.types.model("InvoicesToPayStore",{fetchParams:o.types.maybeNull(o.types.frozen()),items:o.types.optional(o.types.array(o.types.frozen()),[]),current:o.types.maybeNull(o.types.frozen()),count:o.types.optional(o.types.number,0),selectedToPay:o.types.optional(o.types.array(o.types.frozen()),[]),selectedInvoices:o.types.optional(o.types.array(o.types.frozen()),[]),totalInvoiceAmount:o.types.optional(o.types.number,0),totalACHDiscount:o.types.optional(o.types.number,0)}).views((e=>({get invoices(){return e.items.map((e=>e)).flat(1)},get achDiscountEligibility(){return{all:e.selectedToPay.every((e=>!!e.achDiscount)),some:e.selectedToPay.some((e=>!!e.achDiscount))}}}))).actions((e=>({setTotalInvoiceAmount(t){e.totalInvoiceAmount=t},setTotalACHDiscount(t){e.totalACHDiscount=t},setSelectedToPay(t){e.selectedToPay=t},setSelectedInvoices(t){e.selectedInvoices=t},fetchInvoiceToPay:t=>(e.fetchParams=t,r.JZ.rN.payablesInvoices({page:-1,pageSize:-1,dateFrom:c()().subtract(2,"years").format("MM/DD/YYYY"),...t})),calculateTotals(t){const n=(t||e.selectedToPay).filter((e=>e.selected));this.setSelectedInvoices(n),this.setTotalInvoiceAmount(i().sumBy(n,"total_amount")),this.setTotalACHDiscount(i().sumBy(n,"achDiscount"))},onSelect(t){const n=e.selectedToPay.map((e=>e._id===t?{...e,selected:!e.selected}:e));this.calculateTotals(n),this.setSelectedToPay(n)},clear(){e.fetchParams=null,e.current=null,e.count=0,e.items.clear()}}))),u=(0,a.createContext)(d.create()),m=(u.Provider,()=>(0,a.useContext)(u))},54977:(e,t,n)=>{"use strict";n.d(t,{NE:()=>p,O3:()=>v,pK:()=>h});var o=n(19462),r=n(82997),a=n(20648),l=n(98664),i=n(3404),s=n(89077),c=n(50016),d=n(12709),u=n(90140),m=n(2745);const p=o.types.compose(o.types.model("SupplierAccountsTabStore",{fetchParams:o.types.maybeNull(o.types.frozen()),items:o.types.array(o.types.frozen()),updatingCustomers:o.types.array(o.types.string)}).volatile((e=>({mobileInputError:"",emailInputError:"",isExistingContractor:!1,isCheckingExistingCustomer:!1,isLoadingCreditInfo:!1,isLoadingCustomerDetails:!1,discardChangesConfirmationModal:!1,viewAfterInvoice:!1,onRefresh:void 0}))).actions((e=>({turnOnViewAfterInvoice(){e.viewAfterInvoice=!0},turnOffViewAfterInvoice(){e.viewAfterInvoice=!1},showDiscardChangesConfirmationModal(){e.discardChangesConfirmationModal=!0},hideDiscardChangesConfirmationModal(){e.discardChangesConfirmationModal=!1},resetMobileInputError(){e.mobileInputError=""},resetEmailInputError(){e.emailInputError=""},startLoadingCreditInfo:()=>{e.isLoadingCreditInfo=!0},stopLoadingCreditInfo:()=>{e.isLoadingCreditInfo=!1},startLoadingCustomerDetails:()=>{e.isLoadingCustomerDetails=!0},stopLoadingCustomerDetails:()=>{e.isLoadingCustomerDetails=!1},createCustomer:t=>{e.showCreateSideBar(),e.isExistingContractor=!1,e.draftModel.setValue("type",t)},fetchBillingContacts:(0,o.flow)((function*(t){try{e.startSending();const{billingContacts:n}=yield r.JZ.Zm.billingContact(t.id);t.setValue("contacts",n)}catch(n){e.setErrorMessage(n.message)}
1finally{e.stopSending()}})),fetchCustomerDetails:(0,o.flow)((function*(t){try{e.startLoadingCustomerDetails();const n=yield r.JZ.Zm.customerDetails(t.id);e.draftModel.setValue("salesRepId",n.salesRepId||null),e.draftModel.setValue("salesRepUserInfo",n.salesRepUserInfo||null),e.draftModel.setValue("bankAccounts",n.bankAccounts),e.draftModel.setValue("customer",n.customer),e.draftModel.setValue("customer_id",t.id),e.draftModel.setValue("notes",n.notes)}catch(n){e.setErrorMessage(n.message)}finally{e.stopLoadingCustomerDetails()}})),hasPastDue:e=>(null===e||void 0===e?void 0:e.pastDue30)||(null===e||void 0===e?void 0:e.pastDue60)||(null===e||void 0===e?void 0:e.pastDue90)||(null===e||void 0===e?void 0:e.pastDue120)||(null===e||void 0===e?void 0:e.pastDue120Plus),setContactsError(e,t){e.contacts.forEach((e=>{t.includes(e.email)||t.includes(e.phone)?e.setValue("error","This Billing contact already exists. Please check details and try again"):t||e.setValue("error",t)}))},setOnRefresh(t){e.onRefresh=t},saveSalesRepId:(0,o.flow)((function*(t){e.startSending();try{var n;const o=(0,m.toJS)(e.draftModel);o.salesRepId=t._id,delete o.salesRepUserInfo,yield r.JZ.Zm.saveAccount(o),e.draftModel.onSalesRepChange(t),e.closeAddSalesRep(),e.refreshTable+=1,null===(n=e.onRefresh)||void 0===n||n.call(e)}catch(o){console.log(o),e.setErrorMessage("Changes could not be saved")}finally{e.stopSending()}})),submit:(0,o.flow)((function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1?arguments[1]:void 0;return function*(){e.startSending();try{yield r.JZ.Zm.saveAccount((0,o.getSnapshot)(e.draftModel),t),e.setSuccessMessage(n||(e.isEdit?"Account Edited.":"Account Added.")),e.createDefaultDraftModel(),e.cancelAnySideBar(),e.refreshTable+=1}catch(a){e.setErrorMessage(a.message),e.draftModel.invited&&e.draftModel.setValue("invited",!1)}finally{e.stopSending()}}()})),submitContacts:(0,o.flow)((function*(t){e.startSending();try{var n;yield r.JZ.Zm.saveBillingContact(t.id,t.contacts),e.setSuccessMessage("Billing contacts have been added"),e.fetchBillingContacts(t),e.refreshTable+=1,e.closeAddContactSidebar(t),e.setContactsError(t,""),null===(n=e.onRefresh)||void 0===n||n.call(e)}catch(o){e.setContactsError(t,o.message)}finally{e.stopSending()}})),deleteAccount:(0,o.flow)((function*(t){if(t)try{yield r.JZ.Zm.deleteAccount(t),e.refreshTable+=1}catch(n){e.setErrorMessage(n.message)}})),deleteContact:(0,o.flow)((function*(t,n,o){if(t){e.startSending();try{yield r.JZ.Zm.deleteContact(t),e.fetchBillingContacts(n),e.refreshTable+=1,e.closeAddContactSidebar(n)}catch(a){e.setErrorMessage(a.message)}finally{e.stopSending()}}else n.removeContact(o)})),submitWithInvitation:(0,o.flow)((function(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function*(){let o=e.draftModel.email;t&&(e.setDraftModel(t),o=t.email),e.draftModel.setValue("invited",!0),yield e.submit(!0,(t||n)&&"Invitation has been ".concat(n?"resent":"sent"," to ").concat(o))}()})),submitWithInvitationFromView:(0,o.flow)((function(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2?arguments[2]:void 0;return function*(){const l=t.email,i=(0,m.toJS)(t);e.setDraftModel(i),e.draftModel.setValue("invited",!0),e.startSending();try{yield r.JZ.Zm.saveAccount((0,o.getSnapshot)(e.draftModel),!0),e.setSuccessMessage("Invitation has been ".concat(n?"resent":"sent"," to ").concat(l)),a&&a(),e.refreshTable+=1}catch(s){e.setErrorMessage(s.message),e.draftModel.invited&&e.draftModel.setValue("invited",!1)}finally{e.stopSending()}}()})),showCreateWithInitialValue(t){e.draftModel=r.q0.create(t),e.setSideBar(i.PC.create)},checkIfCustomerExists:(0,o.flow)((function*(){try{if(e.draftModel.phone&&e.draftModel.isValidPhone){var t,n;e.isCheckingExistingCustomer=!0;const o=(0,s.L)(e.draftModel.phone,"US").nationalNumber,a=null!==(t=e.draftModel.email)&&void 0!==t?t:void 0,l=null!==(n=e.draftModel.id)&&void 0!==n?n:void 0,i=yield r.JZ.Zm.checkExistingCustomer(o,a,l);i.error?(e.mobileInputError=i.error,e.draftModel.email&&(e.emailInputError=i.error),e.isExistingContractor=!1,e.isCachedContractor=!1):i.data&&!e.isExistingContractor?(e.isExistingContractor=!0,e.isCachedContractor=!0,e.draftModel.setValue("first_name",i.data.firstName),e.draftModel.setValue("last_name",i.data.lastName),e.draftModel.setValue("name",i.data.businessName),e.draftModel.setValue("email",i.data.email),e.resetMobileInputError(),e.resetEmailInputError()):(e.resetMobileInputError(),e.resetEmailInputError())}else e.isExistingContractor=!1,e.resetMobileInputError(),e.resetEmailInputError(),e.isCachedContractor&&(e.draftModel.setValue("first_name",""),e.draftModel.setValue("last_name",""),e.draftModel.setValue("name",""),e.draftModel.setValue("email",""))}catch(o){e.setErrorMessage(o.message)}finally{e.isCheckingExistingCustomer=!1}}
1)),setSuggestedCustomerInfo:(0,o.flow)((function*(t){e.draftModel.setValue("first_name",t.firstName),e.draftModel.setValue("last_name",t.lastName),e.draftModel.setValue("address",t.address),e.draftModel.setValue("name",t.name),e.draftModel.setValue("email",t.email),e.draftModel.setValue("contacts",t.contacts),e.draftModel.setValue("phone",t.phone&&t.phone.replace(d.toDeleteRegexPhoneNumberMask,""))})),setCustomerData:(0,o.flow)((function*(t){try{Object.keys(t).forEach((n=>{const o="phone"===n?t[n]?t[n].replace(d.toDeleteRegexPhoneNumberMask,""):"":t[n];"isBillingContactAdded"!==n&&((t,n)=>{"function"===typeof e.draftModel.setValue?e.draftModel.setValue(t,n):e.draftModel[t]=n})(n,o)}))}catch(n){e.setErrorMessage(n.message)}})),setPhoneAndContactFromBusiness(t){t&&(e.resetMobileInputError(),e.resetEmailInputError(),e.isCheckingExistingCustomer=!1,e.isExistingContractor=!0,e.setSuggestedCustomerInfo(t),e.customerInputForceUpdate+=1)},setData(t){let{items:n}=t;e.items.replace(n)}}))).views((e=>({get getUpdatingCustomers(){return console.log("HCHCHC",e.updatingCustomers),e.updatingCustomers},get isBussinesFieldEditable(){const{status:t,name:n}=e.draftModel;return t!==u.h.tradeCredit&&(t!==u.h.active||!n)},get canSaveInEditMode(){const t=!!e.draftModel.phone&&e.draftModel.isValidPhone;return e.isEdit&&t&&e.draftModel.isValidEmail&&e.draftModel.contact&&e.draftModel.first_name&&e.draftModel.last_name}}))),l.bG,(0,a.O)(r.q0)),g=(0,c.createContext)(p.create()),h=g.Provider,v=()=>(0,c.useContext)(g)},20648:(e,t,n)=>{"use strict";n.d(t,{O:()=>a});var o=n(19462),r=n(3404);const a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.types.model({}).volatile((n=>{const r=e.create(t);return(0,o.unprotect)(r),{draftModel:r,sideBarScreen:null,isSending:!1,refreshTable:0,isShowConfirmation:!1,showDelete:!1,showDeleteModal:!1,previousSidebar:"",isViewAfterReload:!1}})).actions((n=>({resetRefreshTable:()=>n.refreshTable+=1,refreshAndViewSidebar:()=>{n.resetRefreshTable(),n.setIsViewAfterReload(!0)},createDefaultDraftModel:()=>{n.draftModel=e.create(t),(0,o.unprotect)(n.draftModel)},setSideBar:e=>n.sideBarScreen=e,setPreviousSidebar:e=>n.previousSidebar=e,unsetSideBar:e=>{n.sideBarScreen===e&&(n.sideBarScreen=null)},showDeleteSideBar:()=>n.showDelete=!0,cancelDeleteSideBar:()=>n.showDelete=!1,cancelAnySideBar:()=>n.sideBarScreen=null,showCreateSideBar(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};n.cancelDeleteSideBar(),n.createDefaultDraftModel(),e(),n.setSideBar(r.PC.create)},cancelCreateSideBar:()=>{n.unsetSideBar(r.PC.create)},setDraftModel:t=>n.draftModel=e.create(t),showAccountDeleteModal:e=>{n.showDeleteModal=!0,n.setDraftModel(e)},closeAccountDeleteModal:()=>{n.showDeleteModal=!1},showEditSideBar(e){n.cancelDeleteSideBar(),n.setSideBar(r.PC.edit),n.setDraftModel(e)},cancelEditSideBar:()=>{n.unsetSideBar(r.PC.edit)},showViewSideBar(e){n.cancelDeleteSideBar(),n.setSideBar(r.PC.view),n.setDraftModel(e)},showAddBillingContacts(){n.setPreviousSidebar(n.sideBarScreen),n.setSideBar(r.PC.addContact)},showAddSalesRepSideBar(){n.setPreviousSidebar(n.sideBarScreen),n.setSideBar(r.PC.addSalesRep)},cancelViewSideBar:()=>{n.unsetSideBar(r.PC.view),n.setIsViewAfterReload(!1)},closeAddContactSidebar:e=>{var t;n.setSideBar(n.previousSidebar);const o=null===e||void 0===e||null===(t=e.contacts)||void 0===t?void 0:t.filter((e=>!e.error&&e.id));!n.isCreate&&(null===e||void 0===e?void 0:e.setValue)&&(null===e||void 0===e||e.setValue("contacts",o))},closeAddSalesRep:()=>{n.setSideBar(n.previousSidebar)},startSending:()=>n.isSending=!0,stopSending:()=>n.isSending=!1,showConfirmation:()=>n.isShowConfirmation=!0,cancelConfirmation:()=>n.isShowConfirmation=!1,setIsViewAfterReload:e=>n.isViewAfterReload=e}))).views((e=>({get isCreate(){return e.sideBarScreen===r.PC.create},get isView(){return e.sideBarScreen===r.PC.view},get isEdit(){return e.sideBarScreen===r.PC.edit},get isDelete(){return e.showDelete},get isAddContact(){return e.sideBarScreen===r.PC.addContact},get isAddSalesRep(){return e.sideBarScreen===r.PC.addSalesRep},get isAccountDelete(){return e.showDeleteModal}})))}},27232:(e,t,n)=>{"use strict";n.d(t,{nR:()=>T,j3:()=>_,II:()=>N});var o=n(19462),r=n(82997),a=n(20648),l=n(98664),i=n(74161),s=n.n(i),c=n(12709),d=n(2745);const u=o.types.model({}).volatile((e=>({customerInputForceUpdate:0}))).actions((e=>({setCustomerData:(0,o.flow)((function*(t){e.customer.setValue("contact",t.contact),e.customer.setValue("address",t.address),e.customer.setValue("name",t.name),e.customer.setValue("type",t.type),e.customer.setValue("phone",t.ph
1one.replace(c.toDeleteRegexPhoneNumberMask,""));const n=t.settings?(0,d.toJS)(t.settings):{};e.customer.setValue("settings",n)})),resetInvoiceFields:function(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((n=>e.draftModel.setValue(n,t)))},setPhoneAndContactFromBusiness(t){const{draftModel:n}=e;t?(n.setValue("customer_account_id",t.id),e.setCustomerData(t)):(n.setValue("customer_account_id",""),e.customer.setValue("contact",""),e.customer.setValue("name",""),e.customer.setValue("address",""),e.customer.setValue("phone",""),e.customer.setValue("settings",{}),e.businessAccountsUsers=[]),e.customerInputForceUpdate+=1},setBusinessAndCusterNameFromPhone(t){const{draftModel:n,businessAccounts:o}=e,r=(0,d.toJS)(e.customer);if(e.customer.isValidPhone){const l=t||o.find((e=>e.phone.replace(c.toDeleteRegexPhoneNumberMask,"")===r.phone.replace("-","")));var a;if(l)null===n||void 0===n||null===(a=n.setValue)||void 0===a||a.call(n,"customer_account_id",l.id),e.setCustomerData(l)}else{var l;(null===(l=e.customer.phone)||void 0===l?void 0:l.length)>=0&&(n.customer_account_id&&(e.resetInvoiceFields(["customer_account_id"]),e.customer.resetWithPhoneNumber()),e.businessAccountsUsers.length&&(e.businessAccountsUsers=[]))}}})));var m=n(97081),p=n(3404),g=n(16148),h=n(40046),v=n(50016),y=n(23088),b=n(74841),f=n.n(b),E=n(67976),C=n(21786),A=n.n(C),S=n(24349),w=n(9855),P=n.n(w);const I=o.types.compose(r.qO,o.types.model({totalPaidAmount:o.types.optional(o.types.number,0),totalProcessingAmount:o.types.optional(o.types.number,0),totalRemainingAmount:o.types.optional(o.types.number,0),lateFee:o.types.optional(o.types.number,0),customerFee:o.types.optional(o.types.number,0),operation:o.types.optional(o.types.frozen(),{})}));var x=n(77079);const D={[r.tD.INVOICE]:"invoice",[r.tD.QUOTE]:"quote",[r.tD.SALE_ORDER]:"SO",[r.tD.STATEMENT]:"statement"},T=o.types.compose(o.types.model("SupplierInvoicesTabStore",{}).volatile((e=>({businessAccounts:[],businessAccountsUsers:[],isLoadingBusinessAccounts:!1,isLoadingTransactions:!1,isDownloadingAttachment:!1,customer:r.q0.create({}),showCancel:!1,transactions:[],discardChangesConfirmationModal:!1,invoicesToCreate:[],isLoading:!1,isCanceling:!1,isDownloaded:!1,hasInvoiceSent:!1,type:"invoice",showRequiredAlert:!1,isFieldsPrefiled:!1,isCustomerFactoringEnabled:null,fetchParams:{}}))).actions((e=>({createCustomer(t){e.customer=r.q0.create(t)},setIsDownloaded(t){e.isDownloaded=t},setIsCustomerFactoringEnabled(t){e.isCustomerFactoringEnabled=t},setHasInvoiceSent(t){e.hasInvoiceSent=t},setType(t){e.type=t},setReceivableType(t){t!==e.type&&e.setType(t)},addInvoicesToCreate(t,n,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=t;if(r){const t=e.invoicesToCreate.findIndex((e=>{var t;return null===e||void 0===e||null===(t=e.document_name)||void 0===t?void 0:t.includes(r)}));-1!==t&&(a=t)}const l={...(0,d.toJS)(n),customer:(0,d.toJS)(n.customer)};"undefined"===typeof o||a===o?(e.setDraftModel(e.invoiceConvertFromData(l)),e.setBusinessNameFromAccountId(),e.setCustomerFromAccountId(),e.invoicesToCreate[a]=e.draftModel):e.invoicesToCreate[a]=y.qO.create(l)},setEmptyInvoicesToCreate(){e.invoicesToCreate=[]}
1,setLoading(t){e.isLoading=t},async sendInvoicesToCreate(t,n){var o,a;e.setLoading(!0);const l=await r.JZ.rN.saveInvoice({...e.invoicesToCreate[t],status:m.uR.placed,currentDate:s()().format("YYYY-MM-DD"),total_amount:(0,x.Rq)(e.invoicesToCreate[t]),material_subtotal:A().unformat(null===(o=e.invoicesToCreate[t])||void 0===o?void 0:o.material_subtotal),tax_amount:A().unformat(null===(a=e.invoicesToCreate[t])||void 0===a?void 0:a.tax_amount)});"ok"===(null===l||void 0===l?void 0:l.result)?(e.setHasInvoiceSent(!0),e.setSuccessMessage(e.type===r.tD.INVOICE?"Invoice placed successfully":e.type===r.tD.QUOTE?"Quote placed successfully":"SO placed successfully"),e.setIsDownloaded("ok"),n?n(m.uR.placed):e.resetRefreshTable()):(e.setHasInvoiceSent(!1),e.setIsDownloaded("error")),e.setLoading(!1)},async sendInvoicesToDraft(t,n){e.setLoading(!0);const o=await r.JZ.rN.saveInvoice({...e.invoicesToCreate[t],currentDate:s()().format("YYYY-MM-DD"),total_amount:(0,x.Rq)(e.invoicesToCreate[t])});"ok"===(null===o||void 0===o?void 0:o.result)?(e.setHasInvoiceSent(!0),e.setSuccessMessage(e.type===r.tD.INVOICE?"Invoice placed as draft successfully":e.type===r.tD.QUOTE?"Quote placed as draft successfully":"SO placed as draft successfully"),e.setIsDownloaded("ok"),n?n(m.uR.draft):e.resetRefreshTable()):(e.setHasInvoiceSent(!1),e.setIsDownloaded("error")),e.setLoading(!1)},removeFromInvoicesToCreate(t){const n=e.invoicesToCreate.filter(((e,n)=>n!==t));e.invoicesToCreate=n},showDiscardChangesConfirmationModal(){e.discardChangesConfirmationModal=!0},hideDiscardChangesConfirmationModal(){e.discardChangesConfirmationModal=!1},createDefaultCustomer(){e.customer=r.q0.create({})},setShowRequiredAlert(t){e.showRequiredAlert=t},setFieldsPrefiled(t){e.isFieldsPrefiled=t}}))).views((e=>({get isCancel(){return e.sideBarScreen===p.vV.cancel},get hasCustomer(){return e.customer},get typeOfInvoice(){var t;return P()(null===e||void 0===e||null===(t=e.draftModel)||void 0===t?void 0:t.type).replace("_"," ")},get isQuote(){var t;return"quote"===(null===e||void 0===e||null===(t=e.draftModel)||void 0===t?void 0:t.type)},get receivableType(){const t=e.type;return"sales_order"===t?"SO":"invoice"===t?"Invoice":"Quote"}}))).actions((e=>({startLoadingBusinessAccounts:()=>e.loadingBusinessAccounts=!0,stopLoadingBusinessAccounts:()=>e.loadingBusinessAccounts=!1,startLoadingTransactions:()=>e.isLoadingTransactions=!0,stopLoadingTransactions:()=>e.isLoadingTransactions=!1,startDownloadingAttachment:()=>e.isDownloadingAttachment=!0,stopDownloadingAttachment:()=>e.isDownloadingAttachment=!1,clearBusinessAccounts:()=>e.businessAccounts=null,loadBusinessAccounts:(0,o.flow)((function*(){e.startLoadingBusinessAccounts();try{const{items:t}=yield r.JZ.Zm.allAccounts({search:"",sortColumn:"",sortDirection:"",page:1,pageSize:1e3});e.businessAccounts=t.map((e=>r.q0.create(e)))}catch(t){e.setErrorMessage(t.message)}finally{e.stopLoadingBusinessAccounts()}})),checkAndLoadBusinessAccounts(){e.isLoadingBusinessAccounts||e.loadBusinessAccounts()},loadAccountCustomers:()=>{e.draftModel.customer_account_id?e.businessAccountsUsers=e.businessAccounts.filter((t=>t.id===e.draftModel.customer_account_id)):(e.businessAccountsUsers=[],e.draftModel.setValue("customer_contact",""))},setBusinessNameFromAccountId(){var t;const n=e.draftModel.customer_account_id?null===(t=e.businessAccounts.find((t=>{var n;return t.id===(null===(n=e.draftModel)||void 0===n?void 0:n.customer_account_id)})))||void 0===t?void 0:t.name:"";e.draftModel.setValue("business_name",n)},setCustomerFromAccountId(){const t=e.draftModel.customer_account_id&&e.businessAccounts.find((t=>{var n;return t.id===(null===(n=e.draftModel)||void 0===n?void 0:n.customer_account_id)}));e.customer=r.q0.create(t||{})},loadTransactions:(0,o.flow)((function*(){try{var t;e.startLoadingTransactions();const{items:n}=yield r.JZ.gN.allTransactions({invoiceId:e.draftModel.id,search:"",includeNoPulls:!0,dateTo:null!==(t=e.draftModel.refinance)&&void 0!==t&&t.isRefinanced?e.draftModel.refinance.date:void 0});e.transactions=n}catch(n){e.setErrorMessage(n.message)}
1finally{e.stopLoadingTransactions()}})),downloadAttachment:(0,o.flow)((function*(){try{e.startDownloadingAttachment();const{url:t}=yield r.Vv.NJ.invoiceDocument({invoiceId:e.draftModel.id});setTimeout((()=>{g.HZ?window.open(t,"_blank"):h.A.openURL(t)}),100)}catch(t){e.setErrorMessage(t.message)}finally{e.stopDownloadingAttachment()}}))}))).actions((e=>({submit:(0,o.flow)((function*(){if(!e.isSending){e.startSending();try{var t;["invoice_date","invoice_due_date","expiration_date"].forEach((t=>{e[t]&&(e[t]=s()(e[t]).toISOString())})),yield r.JZ.rN.saveInvoice({...(0,o.getSnapshot)(e.draftModel),currentDate:s()().format("YYYY-MM-DD"),material_subtotal:null!==(t=A().unformat(e.draftModel.material_subtotal))&&void 0!==t?t:0,tax_amount:A().unformat(e.draftModel.tax_amount),total_amount:(0,x.Rq)(e.draftModel),type:null===e||void 0===e?void 0:e.type});const n=D[e.type];if(e.draftModel.isDeleted)e.setErrorMessage("This ".concat(n," has been deleted"));else if(e.isCancel)e.setErrorMessage("This ".concat(n," has been cancelled"));else{const t=e.draftModel.status===m.uR.draft?"".concat(n," number ").concat(e.draftModel.invoice_number," is saved as draft"):"".concat(n," number ").concat(e.draftModel.invoice_number," is placed");e.setSuccessMessage(t)}e.createDefaultCustomer(),e.createDefaultDraftModel(),e.cancelAnySideBar(),e.resetRefreshTable()}catch(n){e.setErrorMessage(n.message)}finally{e.stopSending(),e.isShowConfirmation=!1}}})),makeInvoiceDraft(){e.draftModel.setValue("status",m.uR.draft)},makeInvoicePlaced(){e.draftModel.setValue("status",m.uR.placed),""===e.draftModel.company_id&&e.draftModel.setValue("approved",!0)},submitWithSend(){e.makeInvoicePlaced(),e.submit()},submitWithDraft(){e.makeInvoiceDraft(),e.submit()},deleteInvoice(){e.draftModel.setValue("isDeleted",!0),e.submit()},cancelInvoice:(0,o.flow)((function*(){e.startSending(),e.isCanceling=!0;try{yield r.JZ.rN.cancel(e.draftModel.id);const t=D[e.type];e.setErrorMessage("This ".concat(t," has been cancelled")),e.createDefaultDraftModel(),e.cancelAnySideBar()}catch(t){e.setErrorMessage(t.message)}finally{e.stopSending(),e.isCanceling=!1,e.isShowConfirmation=!1}})),cancelCancelSideBar:()=>e.unsetSideBar(p.vV.cancel),showCancelSideBar:t=>{e.cancelDeleteSideBar(),e.setSideBar(p.vV.cancel),t&&e.setDraftModel(t)}}))).actions((e=>({invoiceConvertFromData(t){var n,o,a,l,i,d,u,m;return t?(e.customer=r.q0.create({...t.customer,phone:null===(n=t.customer)||void 0===n||null===(o=n.phone)||void 0===o?void 0:o.replace(c.toDeleteRegexPhoneNumberMask,"")}||{}),{...t,phone:null===(a=t.phone)||void 0===a?void 0:a.replace(c.toDeleteRegexPhoneNumberMask,""),total_amount:(0,x.$J)(t.total_amount),material_subtotal:(0,x.$J)(t.material_subtotal).toFixed(2),tax_amount:(0,x.$J)(t.tax_amount).toFixed(2),tax_exempted:!t.tax_amount,refunded_amount:null!==(l=t.refunded_amount)&&void 0!==l?l:"",quoteDetails:{...t.quoteDetails,authorization_deadline:null!==(i=t.quoteDetails)&&void 0!==i&&i.authorization_deadline?s()(t.quoteDetails.authorization_deadline).toDate():null,authorization_date:null!==(d=t.quoteDetails)&&void 0!==d&&d.authorization_date?s()(t.quoteDetails.authorization_date).toDate():null},paymentDetails:{...t.paymentDetails,originalDueDate:null!==(u=t.paymentDetails)&&void 0!==u&&u.originalDueDate?s()(t.paymentDetails.originalDueDate).toDate():null,loanPlanManuallySelectedAt:null!==(m=t.paymentDetails)&&void 0!==m&&m.loanPlanManuallySelectedAt?s()(t.paymentDetails.loanPlanManuallySelectedAt).toDate():null},inHouseCreditTerm:t.inHouseCreditTerm}):(e.customer=r.q0.create({}),{})},showViewSideBarWithConversion(t){e.showViewSideBar(e.invoiceConvertFromData(t))},showEditSideBarWithConversion(t){e.showEditSideBar(e.invoiceConvertFromData(t))},showNotifications(){e.tabNotifications.forEach((t=>{Object.values(E.$z).includes(t.metadata.alertType)&&e.showNotification(t.content,t.metadata.alertType)})),e.markAllAsRead()},async exportInvoicesTable(t,n){const o=null!==n&&void 0!==n?n:e.fetchParams,a=await r.JZ.rN.allInvoices({...o,pageSize:-1,page:-1});if(0===a.length)return;const l=t.filter((e=>e.name&&" "!==e.name)),i=(e,t)=>{var n;const o=null===(n=m.Od[e[t]])||void 0===n?void 0:n.label;return e.status===m.uR.pastDue&&e.seen?"".concat(o," (Seen)"):o};(0,S.bJ)(a.items.map((e=>l.reduce(((t,n)=>({...t,[n.name]:"status"===n.selector?i(e,n.selector)||B(e,n.selector):"string"===typeof n.selector?B(e,n.selector):n.selector(e)})),{}))),"invoices","xlsx")}}))),l.bG,(0,a.O)(I),u,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"INVOICES";return o.types.model({}).volatile((()=>({tabNotifications:[]}))).views((e=>({get rootNotification(){return(0,o.getEnv)(e).notificationStore}}))).actions((t=>({getNotifications(){t.tabNotifications=t.rootNotification.notifications.filter((t=>t.type===e))},markAllAsRead:(0,o.flow)((function*(){t.rootNotification.markAllAsRead({type:e})}))})))}("INVOICES")).named("SupplierTabInvoiceStore"),k=T.create();function B(e,t){const n=t.split(".");for(;n.length>0;){if(!e)return"";e=e[n.shift()]}return e||""}f()(k);const F=(0,v.createContext)(k),_=F.Provider,N=()=>(0,v.useContext)(F)}
1,98664:(e,t,n)=>{"use strict";n.d(t,{bG:()=>o.b});var o=n(92404),r=n(19462),a=n(74161),l=n.n(a);r.types.custom({name:"Moment",fromSnapshot:e=>l()(e),toSnapshot:e=>e.format("YYYY-MM-DD HH:mm:ss.SSSZZ"),isTargetType:e=>l().isMoment(e),getValidationMessage:e=>l()(e).isValid()?"":"Value ".concat(e," provided seems not valid Moment instance")}),r.types.custom({name:"MomentDate",fromSnapshot:e=>l()(e,"YYYY-MM-DD"),toSnapshot:e=>e.format("YYYY-MM-DD"),isTargetType:e=>l().isMoment(e),getValidationMessage:e=>l()(e,"YYYY-MM-DD").isValid()?"":"Value ".concat(e," provided seems not valid MomentDate instance")})},78573:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o=n(50016),r=n(82997),a=n(17439),l=n(97976);const i=(0,o.forwardRef)(((e,t)=>{let{onConnectSuccess:n,setLoading:i=(()=>{})}=e;const{userStore:s,screensStore:{paymentMethodsStore:c}}=(0,l.P)(),[d,u]=(0,o.useState)(""),[m,p]=(0,o.useState)(""),g=(0,o.useCallback)(((e,t)=>{p(e||""),i(!0),r.JZ.py.createLinkToken(t,e).then((e=>{u(e.link_token)})).finally((()=>{i(!1)}))}),[i]);(0,o.useImperativeHandle)(t,(()=>({createToken:g})),[g]);const h=(0,o.useCallback)((async(e,t)=>{i(!0),console.log("ONSUCCESS: Metadata ".concat(JSON.stringify(t)," ").concat(e)),m?r.JZ.py.healthCheck(m).then((async()=>{s.fetchUser(),await c.fetchPaymentMethods(),n&&n()})).finally((()=>i(!1))):r.JZ.py.exchangePublicToken(e).then((async()=>{s.fetchUser(),await c.fetchPaymentMethods(),n&&n()})).catch((e=>console.log(e))).finally((()=>i(!1)))}),[m]),v=(0,o.useMemo)((()=>({token:d,onSuccess:h,onExit:(e,t)=>{console.log("Exited early. Error: ".concat(JSON.stringify(e)," Metadata: ").concat(JSON.stringify(t)))},onEvent:(e,t)=>{console.log("Event ".concat(e,", Metadata: ").concat(JSON.stringify(t)))}})),[d,h]),{open:y,ready:b}=(0,a.usePlaidLink)(v);return(0,o.useEffect)((()=>{b&&y&&y()}),[y,b]),null}))},92734:(e,t,n)=>{"use strict";n.d(t,{X:()=>u});var o=n(50016),r=n(78267),a=n(4670),l=n(7371),i=n(14329),s=n(97076),c=n(17171),d=n(53941);const u=e=>{let{title:t,titleStyle:n,containerStyle:r,useModalStyles:u=!1,centeredTitle:p,disabled:g,onBack:h,onClose:v}=e;const{sm:y}=(0,c.Qs)(),b=(0,d.A)();return o.createElement(l.A,{style:[m.container,b&&u&&m.containerMobile,r]},h?o.createElement(a.A,{onPress:h,disabled:g},o.createElement(s.Z3O,{width:40,height:40})):p?o.createElement(l.A,{style:{width:40}}):null,"string"===typeof t?o.createElement(i.QG,{style:[m.title,!y&&m.mobileTitle,n]},t):t,o.createElement(a.A,{onPress:v,disabled:g,style:t?{}:{marginLeft:"auto"}},o.createElement(s.vaf,{width:40,height:40})))},m=r.A.create({container:{flexDirection:"row",display:"flex",justifyContent:"space-between",alignItems:"center",margin:32,marginBottom:0,gap:10},containerMobile:{marginHorizontal:15},title:{fontFamily:"Inter, sans-serif",fontWeight:"700",fontSize:24,lineHeight:34,letterSpacing:-.5,color:"#001929",textAlign:"left"},mobileTitle:{fontSize:18}})},40701:(e,t,n)=>{"use strict";n.d(t,{G:()=>s});var o=n(50016),r=n(78267),a=n(7371),l=n(14425),i=n(10272);const s=e=>{let t,n,r,s,{name:d,theme:u="blue",size:m="large"}=e;switch(t=34,r=72,u){case"blue":default:n=i.B.blue.blue400,s=i.B.blue.blue100;break;case"green":n=i.B.service.green,s="".concat(i.B.service.green,"1A");break;case"orange":n=i.B.service.orange,s="".concat(i.B.service.orange,"26");break;case"red":n=i.B.service.red100c,s=i.B.service.red000}return o.createElement(a.A,{style:[c.icon,{width:r,height:r,backgroundColor:s,borderRadius:r/2}]},o.createElement(l.Icon,{name:d,width:t,fill:n}))},c=r.A.create({icon:{justifyContent:"center",alignItems:"center",alignSelf:"center"}})},93186:(e,t,n)=>{"use strict";n.d(t,{f:()=>c,t:()=>d});var o=n(50016),r=n(56480),a=n(80443),l=n(97076),i=n(73819),s=n(97537);const c=e=>{let{status:t}=e;const n=g[t];return o.createElement(i.sS,{icon:null===n||void 0===n?void 0:n.icon,styles:{icon:{color:null===n||void 0===n?void 0:n.color}}},o.createElement(r.E,{c:null===n||void 0===n?void 0:n.color,fw:600,mt:1},d(t)))},d=e=>{const t=s.Ay.getFixedT(null,"tradeCredit");switch(e){case a.Lo.DUE_NEXT:return t("tradeCredit.tabDraws.table.activeDraws.statuses.dueNext");case a.Lo.PAST_DUE:return t("tradeCredit.tabDraws.table.activeDraws.statuses.pastDue");case a.Lo.CLOSED:return t("tradeCredit.tabDraws.table.closedDraws.statuses.paidOff");case a.Lo.CANCELLED:return t("tradeCredit.tabDraws.table.closedDraws.statuses.cancelled");case a.Lo.REFINANCED:return t("tradeCredit.tabDraws.table.closedDraws.statuses.refinanced");default:return e}},u={color:"#0385c8",icon:o.createElement(l.HZZ,null)},m={color:"#0ec06b",icon:o.createElement(l.nJm,null)},p={color:"#ec002a",icon:o.createElement(l.n7P,null)},g={[a.Lo.DUE_NEXT]:u,[a.Lo.CLOSED]:m,[a.Lo.REFINANCED]:m,[a.Lo.PAST_DUE]:p,[a.Lo.CANCELLED]:p}},82047:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var o=n(50016),r=n(4670),a=n(68215);const l=e=>{let{icon:t,onPress:n,style:l={},testID:i=""}=e;return o.createElement(r.A,{style:{height:40,width:40,alignItems:"center",justifyContent:"center",backgroundColor:a.commonColors.backgroundLight,borderRadius:8,...l},onPress:n,testID:i},t)}}
1,55502:(e,t,n)=>{"use strict";n.d(t,{fI:()=>m,fv:()=>g});var o=n(50016),r=n(59243),a=n(7371),l=n(38767);const i=[{key:"xl",value:1920},{key:"lg",value:1440},{key:"md",value:1024},{key:"sm",value:576},{key:"xs",value:0}];function s(){const{width:e}=r.A.get("window"),t=i.find((t=>t.value<=e));return t&&t.key||i[i.length-1].key}function c(){const[e,t]=(0,o.useState)(s());return(0,o.useEffect)((()=>{const e=r.A.addEventListener("change",(()=>t(s())));return e&&e.remove}),[]),e}const d=e=>isFinite(e)&&e>=0;function u(e,t){const{xs:n,sm:r,md:a,lg:l,xl:i}=t;return(0,o.useMemo)((()=>{var t;return(null===(t={xl:[i,l,a,r,n],lg:[l,a,r,n],md:[a,r,n],sm:[r,n],xs:[n]}[e])||void 0===t?void 0:t.find(d))||0}),[e,n,r,a,l,i])}const m=e=>{let{children:t,style:n,onLayout:r}=e;const i=-u(c(),{xs:5,sm:10});return o.createElement(a.A,{style:(0,l.composeStyle)({flexDirection:"row",flexWrap:"wrap",marginHorizontal:i},n),onLayout:r},t)},p={1:(100/12).toFixed(6)+"%",2:(100/12*2).toFixed(6)+"%",3:25..toFixed(6)+"%",4:(100/12*4).toFixed(6)+"%",5:(100/12*5).toFixed(6)+"%",6:50..toFixed(6)+"%",7:(100/12*7).toFixed(6)+"%",8:(100/12*8).toFixed(6)+"%",9:75..toFixed(6)+"%",10:(100/12*10).toFixed(6)+"%",11:(100/12*11).toFixed(6)+"%",12:100..toFixed(6)+"%"},g=e=>{let{children:t,style:n,...r}=e;const i=c(),s=u(i,{xs:5,sm:10}),d=u(i,r),m=p[d];return o.createElement(a.A,{style:(0,l.composeStyle)({paddingHorizontal:s,width:m},n)},t)}},17720:(e,t,n)=>{"use strict";n.d(t,{H:()=>m});var o=n(50016),r=n(49727),a=n(78267),l=n(4670),i=n(7371),s=n(91099),c=n(71744),d=n(97081),u=n(29731);const m=e=>{var t,n;let{onPress:a,title:u,subtitle:m,status:p,amount:v,style:y,embeddedButton:b,disabled:f=!1,isFactoring:E=!1,type:C=""}=e;const A=b?"auto":80;return o.createElement(l.A,{style:{padding:16,height:A,borderWidth:1,borderColor:"#E6EBEE",borderRadius:12,...y},disabled:f,onPress:a},o.createElement(i.A,{style:{flexDirection:"row"}},o.createElement(i.A,{style:{flex:1,justifyContent:"center"}},o.createElement(r.A,{numberOfLines:1,ellipsizeMode:"tail",style:{fontWeight:"500",fontSize:16,color:s.q.textDark}},u),o.createElement(r.A,{style:{fontWeight:"500",fontSize:12,color:s.q.textLight,marginVertical:6}},m)),o.createElement(i.A,{style:{flexDirection:"column",alignItems:"flex-end"}},o.createElement(r.A,{style:{fontWeight:"500",fontSize:16,color:"#003353"}},"$ ",v),o.createElement(i.A,{style:h.rowContainer},C&&!E?o.createElement(g,{type:C}):null,o.createElement(c.n,{label:null===(t=d.Od[p])||void 0===t?void 0:t.label,textColor:null===(n=d.Od[p])||void 0===n?void 0:n.textColor})))),o.createElement(i.A,{style:{paddingTop:16}},b))},p={quote:{borderColor:"#003353",color:"#003353"},invoice:{borderColor:"#00A0F3",color:"#00A0F3"},other:{borderColor:"#0070AA",color:"#0070AA"}};function g(e){var t,n;let{type:a}=e;const{t:l}=(0,u.Bd)("global"),s=(null===(t=p[a])||void 0===t?void 0:t.borderColor)||p.other.borderColor,c=(null===(n=p[a])||void 0===n?void 0:n.color)||p.other.color;return o.createElement(i.A,{style:[h.typeWrapper,{borderColor:s}]},o.createElement(r.A,{style:[h.typeLabel,{color:c}]},l(a)))}const h=a.A.create({rowContainer:{flexDirection:"row",alignItems:"center"},typeWrapper:{borderRadius:5,borderWidth:1,justifyContent:"center",alignItems:"center",height:22,marginRight:6,paddingHorizontal:12},typeLabel:{fontSize:11,fontWeight:"500",lineHeight:20}})},95390:(e,t,n)=>{"use strict";n.d(t,{N:()=>i});var o=n(50016),r=n(4670),a=n(38117),l=n(38767);const i=e=>{let{onPress:t,title:n,color:i,icon:s,textStyle:c={},testID:d="link",style:u={},disabled:m=!1}=e;return o.createElement(r.A,{style:(0,l.composeStyle)({flexDirection:"row",justifyContent:"center",alignItems:"center"},u),onPress:t,testID:d,disabled:m},o.createElement(a.A,{style:(0,l.composeStyle)({color:i,fontSize:14,fontWeight:"500"},c)},n),s)}},6116:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var o=n(82345),r=n(50016),a=n(40046),l=n(49727),i=n(52993),s=n(38542);const{composeStyle:c}=s.helpers,d=e=>({linkLabel:{color:e.colors.accentText,fontSize:16,fontWeight:"500",lineHeight:24}});function u(e){const{children:t,url:n,screen:s,params:u,onPress:m,style:p}=e,g=(0,o.useNavigation)(),h=(0,r.useCallback)((()=>{s&&g.navigate(s,u),n&&a.A.canOpenURL(n).then((()=>a.A.openURL(n)))}),[s,n,g]),v=(0,i.Qc)(d);return r.createElement(l.A,{onPress:m||h,style:c(v.linkLabel,p)},t)}},6903:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var o=n(50016),r=n(7371),a=n(38117),l=n(78267),i=n(38767),s=n(68215);const c=e=>{let{image:t,heading:n,subHeading:l,style:s}=e;return o.createElement(r.A,{style:(0,i.composeStyle)(d.view,s)}
1,t,o.createElement(r.A,{style:d.childView},o.createElement(a.A,{style:d.heading},n),o.createElement(a.A,{style:d.subheading},l)))},d=l.A.create({view:{flex:1,alignItems:"center",justifyContent:"center"},childView:{justifyContent:"center",alignItems:"center",paddingTop:20},heading:{fontWeight:"600",fontSize:18,lineHeight:28},subheading:{textAlign:"center",fontSize:14,fontWeight:"400",lineHeight:21,maxWidth:268,paddingTop:14,color:s.commonColors.textLight}})},85825:(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o=n(50016),r=n(14425);const a=e=>{let{maxWidth:t}=e;return o.createElement("div",{style:{width:"100%",maxWidth:t,display:"flex",justifyContent:"center"}},o.createElement(r.Spinner,null))}},91855:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var o=n(50016),r=n(48369),a=n.n(r);const l=e=>{let{visible:t,onClose:n,backDropAction:r,children:l,...i}=e;return o.createElement(a(),Object.assign({backdropOpacity:.5,backdropColor:"rgba(0, 0, 0, 0.6)",isVisible:t,onBackdropPress:()=>r&&n(),onBackButtonPress:n},i),l)}},8219:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var o=n(50016),r=n(38325),a=n(35143),l=n(7371),i=n(38542),s=n(58876);const{composeStyle:c}=i.helpers,{commonColors:d}=i.theme,u=6;const m=e=>{let{otp:t="",onChange:n,otpSize:i=u,invalid:m=!1,disabled:p=!1,testID:g="six-digit-code-component"}=e;const[h,v]=(0,o.useState)(""),[y,b]=(0,o.useState)([]),[f,E]=(0,o.useState)(0);return(0,o.useEffect)((()=>{v(t)}),[t]),(0,o.useEffect)((()=>{n&&n(h),y[h.length]?y[h.length].focus():y[h.length-1]&&h.length<6&&y[h.length-1].blur()}),[h]),o.createElement(l.A,{style:{flexDirection:"row",alignItems:"center",width:"100%",justifyContent:"space-between"},testID:g},Array(i||u).fill().map(((e,t)=>o.createElement(a.A,Object.assign({testID:"otp_".concat(t),key:t,ref:e=>b((n=>(n[t]=e,n))),value:h[t]||"",editable:t===h.length,blurOnSubmit:!1,returnKeyType:5===t?"done":"next",autoComplete:0===t?"password":"off",keyboardType:s.ui.NumberPad,disabled:p,secureTextEntry:!0,onFocus:()=>E(t),onKeyPress:e=>{8!==e.keyCode&&46!==e.keyCode||v(h.substr(0,h.length-1))}},r.A.select({web:{onClick:()=>{y[h.length]?y[h.length].focus():(h.length>=i||u)&&v(h.substr(0,5))}}}),{style:c({borderRadius:6,padding:8,textAlign:"center",width:40,border:m?"1px solid ".concat(d.accent):f===t?"1px solid ".concat(d.accentText):"1px solid #E6EBEE",fontSize:20,fontWeight:"500",color:d.primary},r.A.select({web:{outline:"none"}})),onChangeText:e=>{v(h.substring(0,t)+e)}})))))}},18502:(e,t,n)=>{"use strict";n.d(t,{A:()=>y});var o=n(48369),r=n.n(o),a=n(50016),l=n(38325),i=n(32572),s=n(7371),c=n(49727),d=n(1923),u=n(97076),m=n(4670),p=n(38542),g=n(90399);const{commonColors:h}=p.theme,{composeStyle:v}=p.helpers,y=e=>{var t;let{children:n,onClose:o,visible:p,style:y,title:b,subTitle:f,width:E=622,footer:C,footerStyle:A,header:S,customSidebarStyles:w={},customPadding:P=!1,divider:I=!0,...x}=e;const D=null!==(t=null===A||void 0===A?void 0:A.height)&&void 0!==t?t:100,T=e=>{27===e.keyCode&&p&&o()};let k;a.useEffect((()=>("web"===l.A.OS&&document.addEventListener("keydown",T,!1),()=>{"web"===l.A.OS&&document.removeEventListener("keydown",T,!1)})),[]),a.useEffect((()=>{k&&p&&k.scrollTo({x:0,y:0,animated:!1})}),[p]);const B=window.innerHeight,F=(0,a.useMemo)((()=>b?"object"===typeof b?b:a.createElement(c.A,{style:{fontSize:20,fontWeight:"500"}},b):null),[b]),_=(0,a.useMemo)((()=>f?"object"===typeof f?f:a.createElement(c.A,{style:{color:h.tertiaryDark}},f):null),[f]);return p?a.createElement(r(),Object.assign({isVisible:p,onBackdropPress:o,onBackButtonPress:o,backdropColor:"rgba(0, 0, 0, 0.6)",backdropOpacity:.7},x,{animationIn:"slideInRight",animationOut:"slideOutRight",animationInTiming:400,animationOutTiming:300,transparent:!0,style:{marginLeft:window.innerWidth-E}}),a.createElement(s.A,{style:[{width:E,height:B,backgroundColor:"white"},y]},S||a.createElement(s.A,{style:{paddingTop:24,paddingHorizontal:24,flexDirection:"row",height:100}},a.createElement(s.A,{style:{flex:1}},_,F),a.createElement(m.A,{onPress:o,testID:"close_sidebar_button"},a.createElement(u.P3E,null))),a.createElement(s.A,{style:{height:B-100-D}},a.createElement(i.A,{style:{paddingHorizontal:P||20},ref:e=>k=e},n)),!!C&&a.createElement(a.Fragment,null,I&&a.createElement(d.A,null),a.createElement(s.A,{style:v({height:D,padding:24,flexDirection:"row",justifyContent:"flex-end"},A)},C))),a.createElement(g.r,{wrapperStyle:{marginLeft:100}})):null}},4726:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var o=n(50016),r=n(7371);const a=e=>{let{height:t=12,width:n=0}=e;return o.createElement(r.A,{style:{height:t,width:n}})}},76466:(e,t,n)=>{"use strict";n.d(t,{y:()=>c});var o=n(50016),r=n(7371),a=n(78267),l=n(23405),i=n(24924),s=n(74227);const c=e=>{let{size:t="medium",status:n="primary",style:a}=e;const c=(0,o.useMemo)((()=>new l.A.Value(0)),[]);o.useEffect((()=>(function e(){c.setValue(0),l.A.timing(c,{toValue:1,duration:1e3,easing:i.A.linear,useNativeDriver:!0}).start((()=>e()))}(),()=>{c.stopAnimation()})),[c]);const u=c.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]}),m={small:16,medium:30,large:48}[t],p={primary:"#00A0F3",basic:"#001929"}[n];return o.createElement(r.A,{style:[d.container,a]}
1,o.createElement(l.A.View,{style:{transform:[{rotate:u}]}},o.createElement(s.default,{width:m,height:m,viewBox:"0 0 50 50"},o.createElement(s.Circle,{cx:"25",cy:"25",r:"20",fill:"none",stroke:p,strokeWidth:"5",strokeLinecap:"round",strokeDasharray:"128",strokeDashoffset:"82"}))))},d=a.A.create({container:{alignItems:"center",justifyContent:"center",zIndex:999999}})},71744:(e,t,n)=>{"use strict";n.d(t,{n:()=>d});var o=n(50016),r=n(7371),a=n(78267),l=n(49727),i=n(91396),s=n.n(i),c=n(38767);const d=e=>{let{label:t,textColor:n,style:a,info:i}=e;return o.createElement(r.A,{style:{flexDirection:"column"}},o.createElement(r.A,{style:{marginVertical:6,height:22,borderRadius:5,backgroundColor:s()(n).alpha(.1).rgb().string(),justifyContent:"center",alignSelf:"flex-end",...a}},o.createElement(l.A,{style:(0,c.composeStyle)(u.label,{color:n})},t)),i&&o.createElement(l.A,{style:u.info},i))},u=a.A.create({info:{fontWeight:"500",fontSize:10,marginTop:2,color:"#DA515E"},label:{fontWeight:"500",fontSize:11,paddingHorizontal:10,justifyContent:"center"}})},43094:(e,t,n)=>{"use strict";n.d(t,{V:()=>s});var o=n(50016),r=n(14425),a=n(97076),l=n(14329),i=n(16148);const s=e=>{let{tooltip:t,title:n,tooltipPosition:s,size:d=12,iconColor:u}=e;const[m,p]=(0,o.useState)(!1),g=(0,o.useRef)(null),h=e=>{if(g.current){const t=e.clientX,n=e.clientY,o=g.current.getBoundingClientRect(),r=t>=o.left&&t<=o.right&&n>=o.top&&n<=o.bottom;p(r)}};return(0,o.useEffect)((()=>i.HZ?(window.addEventListener("mousemove",h),()=>{window.removeEventListener("mousemove",h)}):void 0),[]),o.createElement("div",{ref:g},o.createElement(r.Tooltip,{anchor:()=>o.createElement("div",{style:{cursor:"pointer"}},o.createElement(a.mo0,{height:d,width:d,onClick:()=>p(!0),fill:null!==u&&void 0!==u?u:m?"#00A0F3":"#668598"})),visible:m,placement:null!==s&&void 0!==s?s:r.PopoverPlacements.BOTTOM,onBackdropPress:()=>p(!1),style:{width:275,backgroundColor:"#003353"}},o.createElement("div",{style:{padding:5}},n?o.createElement("div",{style:{marginBottom:5}},o.createElement(l.BtText,{weight:"700",style:c.text},n)):null,o.createElement(l.BtText,{weight:"400",style:c.text},t))))},c={text:{fontFamily:"Inter, sans-serif",color:"#FFFFFF",fontSize:14}}},65319:(e,t,n)=>{"use strict";n.d(t,{E:()=>u});var o=n(50016),r=n(7371),a=n(38117),l=n(78267),i=n(23049),s=n(91562),c=n(39013),d=n(14329);const u=e=>{let{tooltip:t,title:n,position:l="bottom",size:u=12,iconName:p="information-outline",iconColor:g,hoverColor:h="#00A0F3",defaultColor:v="#00A0F3",useHoverEffect:y=!1,containerStyle:b,tooltipWidth:f=246}=e;const[E,C]=(0,o.useState)(!1),[A,S]=(0,o.useState)(null),w=(0,o.useRef)(),P=(0,o.useCallback)((e=>{null!==e&&S(e)}),[]),I=()=>{w.current&&clearTimeout(w.current),C(!0)},x=()=>{w.current=setTimeout((()=>{C(!1)}),100)},D=e=>g||(y&&e?h:v);return o.createElement(r.A,{style:[m.container,b]},o.createElement(s.A,{onHoverIn:I,onHoverOut:x},(e=>o.createElement("div",{ref:P},o.createElement(i.Ay,{name:p,size:u,color:D(e)})))),(()=>{if(!E||!A)return null;const e=A.getBoundingClientRect(),i=e.left+e.width/2,s=e.top+e.height/2,{tooltip:u,arrow:p}=(()=>{const t="".concat(8,"px solid transparent"),n="".concat(8,"px solid #003353"),o=f/2;switch(l){case"top":return{tooltip:{left:i-o,bottom:window.innerHeight-e.top+8},arrow:{borderLeft:t,borderRight:t,borderTop:n,bottom:-8,left:o-8}};case"left":return{tooltip:{right:window.innerWidth-e.left+8,top:s-50},arrow:{borderTop:t,borderBottom:t,borderLeft:n,right:-8,top:42}};case"right":return{tooltip:{left:e.right+8,top:s-50},arrow:{borderTop:t,borderBottom:t,borderRight:n,left:-8,top:42}};default:return{tooltip:{left:i-o,top:e.bottom+8},arrow:{borderLeft:t,borderRight:t,borderBottom:n,top:-8,left:o-8}}}})(),g=o.createElement("div",{onMouseEnter:I,onMouseLeave:x,style:{position:"fixed",width:f,backgroundColor:"#003353",borderRadius:4,padding:16,zIndex:2147483647,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.25)",...u}},o.createElement("div",{style:{position:"absolute",width:0,height:0,...p}}),n&&o.createElement(r.A,{style:m.titleContainer},o.createElement(a.A,{style:m.text},n)),o.createElement(d.BtText,{weight:"400",style:m.text},t));return(0,c.createPortal)(g,document.body)})())},m=l.A.create({container:{position:"relative",display:"flex"},titleContainer:{marginBottom:8},text:{fontFamily:"Inter, sans-serif",color:"#FFFFFF",fontSize:14,fontWeight:"400"}})},51567:(e,t,n)=>{"use strict";n.d(t,{P:()=>d});var o=n(38542),r=n(50016),a=n(7371),l=n(56475),i=n(68215);const{composeStyle:s,webSpecificStyle:c}=o.helpers,d=e=>{let{block:t=!1,style:n={},buttonStyle:o,contentStyle:d={},disabled:u=!1,mode:m,labelStyle:p,compact:g,...h}=e;const{backgroundColor:v,opacity:y}=(0,r.useMemo)((()=>({backgroundColor:u?"#0070AA":i.commonColors.accentText,opacity:u&&.2})),[u]);return r.createElement(a.A,{style:s({alignItems:t?"stretch":"flex-start",alignSelf:t&&"stretch"},n)},r.createElement(l.A,Object.assign({disabled:u,contentStyle:s(!g&&{height:48},d),uppercase:!1,mode:m||"contained",theme:{roundness:8},labelStyle:s({fontSize:16,padding:2,fontWeight:"500",color:"white"},c({userSelect:"none"}),p),style:[{backgroundColor:v},{opacity:y},o]},h)))}}
1,43872:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});var o=n(50016),r=n(38325),a=n(38117),l=n(63559),i=n(82345),s=n(38542),c=n(38767),d=n(52993),u=n(44468),m=n(27520),p=n(37854),g=n(58876);const{composeStyle:h}=s.helpers,v={autoCompleteType:{off:"off",username:"username",password:"password","new-password":"password","current-password":"password",email:"email",name:"name",nickname:"name",tel:"tel","tel-national":"tel","tel-local":"tel","street-address":"street-address","postal-code":"postal-code","cc-number":"cc-number","cc-csc":"cc-csc","cc-exp":"cc-exp","cc-exp-month":"cc-exp-month","cc-exp-year":"cc-exp-year"},textContentType:{off:"none",username:"username",password:"password",tel:"telephoneNumber",url:"URL","address-level2":"addressCity","address-level1":"addressCityAndState",addressState:"addressState","country-name":"countryName","cc-number":"creditCardNumber",email:"emailAddress","family-name":"familyName","street-address":"fullStreetAddress","given-name":"givenName","additional-name":"middleName",name:"name","honorific-prefix":"namePrefix","honorific-suffix":"nameSuffix",nickname:"nickname","organization-title":"organizationName","postal-code":"postalCode","address-line1":"streetAddressLine1","address-line2":"streetAddressLine2","address-level4":"sublocality"}};const y=e=>{const{onBlur:t,onFocus:n,focused:s}=(0,d.Lx)(),{onBlur:g,onFocus:y,disabled:b}=e,f=(0,l.DP)(),{colors:{accentText:E}}=f,{inputBackgroundColor:C}=(0,p._)(),{inputRef:A,style:S,autoFocus:w,inputOuterStyle:P,innerBorderStyle:I,...x}=function(e){const{autoComplete:t,...n}=e;return{...(0,o.useMemo)((()=>{if("string"!==typeof t)return{autoComplete:t};switch(r.A.OS){case"android":case"ios":const e="android"===r.A.OS?"autoCompleteType":"textContentType",n=v[e][t];if("string"===typeof n)return{[e]:n};default:return{autoComplete:t}}}),[t]),...n}}(e),D=(0,d.Qc)((e=>({countryCodeInput:{maxWidth:36,marginRight:8},inputOuterStyle:{borderRadius:8,height:30},input:{backgroundColor:"transparent",color:"#003353",flex:1,fontSize:18,fontWeight:"400",minWidth:200,marginTop:0,width:"100%"}}))),{highlight:T,error:k,label:B,mandatory:F}=x,[_,N]=o.useState(k);A&&(x.ref=A);const{primary:R}=(0,l.DP)().colors;x.placeholderTextColor||(x.placeholderTextColor="#99ADBA");const L=(0,o.useMemo)((()=>h(D.input,(0,c.webSpecificStyle)({caretColor:R,outline:"none"}),S)),[S]),M=(0,i.useIsFocused)(),O=(0,o.useRef)();(0,o.useEffect)((()=>{O.current&&w&&M&&O.current.focus()}),[M]);const z=o.createElement(a.A,{style:h({fontSize:16},b&&{color:"#99ADBA"})},B,F?o.createElement(a.A,{style:{paddingLeft:2}},"*"):null);return o.createElement(m.r,{focused:s,style:[S,b&&{borderColor:"#F5F7F8"},T?{borderColor:"#DD4A2C"}:{}],error:_},o.createElement(u.Sm,Object.assign({},x,{ref:O,style:L,label:z,labelActiveColor:E,dense:!0,theme:{roundness:8},inputOuterStyle:h(C,{flex:1,borderRadius:8},b&&{backgroundColor:"#F5F7F8"}),onFocus:y,onBlur:g,InputContainer:m.y,underlineColor:"transparent"})))},b=e=>{let{value:t="",onChangeText:n,autoFocus:r=!1,autoComplete:a="off",editable:l=!0,keyboardType:i=g.ui.Default,returnKeyType:s="go",onSubmitEditing:c,placeholder:d="",placeholderTextColor:u="",secureTextEntry:m=!1,style:p={},...h}=e;return o.createElement(y,Object.assign({value:t,onChangeText:n,autoFocus:r,autoComplete:a,editable:l,keyboardType:i,returnKeyType:s,onSubmitEditing:c,placeholder:d,placeholderTextColor:u,secureTextEntry:m,style:p},h))}},56543:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var o=n(50016),r=n(43872);const a=e=>{let{value:t="",onChangeText:n,editable:a=!0,...l}=e;return o.createElement(r.A,Object.assign({value:t,onChangeText:n,editable:a},l))}},3241:(e,t,n)=>{"use strict";n.d(t,{F:()=>h});var o=n(50016),r=n(4670),a=n(37854),l=n(44468),i=n(52993),s=n(27520),c=n(38767),d=n(97076),u=n(68215);const m=(0,o.forwardRef)(((e,t)=>{let{style:n,error:m,onFocus:p,onBlur:g,siblingProps:h,onChangeText:v,toRemoveRegex:y,highlight:b,mandatory:f,inputOuterStyle:E,...C}=e;const{inputBackgroundColor:A}=(0,a._)(),[S,w]=o.useState(m),{onBlur:P,onFocus:I,focused:x,error:D}=(0,i.Lx)(S),{value:T,label:k,validateInput:B,validateInputOnBlur:F,editable:_=!0}=C,[N,R]=(0,o.useState)(!1),L=(0,i.A8)({validateInput:B,validateInputOnBlur:F,onInputBlur:g,setError:w,toRemoveRegex:y}),M=(0,i.Gz)({validateInput:B,validateInputOnBlur:F,onChangeText:v,setError:w,toRemoveRegex:y}),O=!!T&&(!B||!B(T));return(0,o.useEffect)((()=>{N&&M&&M(T||"")}),[N,O,M,T]),(0,o.useEffect)((()=>{S&&R(!0)}),[S]),o.createElement(s.r,{focused:x,style:[n,!_&&{borderColor:"#F5F7F8"},b?{borderColor:"#DD4A2C"}:{}],error:F?D:S},o.createElement(l.Sm,Object.assign({underlineColor:"transparent",labelActiveColor:u.commonColors.accentText,onFocus:()=>{p&&p(),I()},onBlur:e=>{L(e.nativeEvent.text),P(),R(!0)},disabledStyle:{color:"#335C75"},inputOuterStyle:(0,c.composeStyle)(A,{flex:1,borderRadius:8},E,!_&&{backgroundColor:"#F5F7F8"}),theme:{roundness:8},dense:!0,sibling:C.showDropdown?o.createElement(r.A,{onPress:C.onPress,disabled:!_},o.createElement(d.Txw,{width:15,style:{marginRight:15,marginLeft:15,marginTop:2}})):void 0===_||_||C.showClearIcon?o.createElement(l.zC,{value:T,disabled:C.disabled,onChangeText:v,testID:"".concat(null===C||void 0===C?void 0:C.testID,"_clear_btn")}):null,InputContainer:s.y,error:F?D:S},C,{label:"".concat(k," ").concat(f?" *":""),ref:t,onChangeText:M})))})),p=(0,i.L4)(m),g=(0,o.forwardRef)(((e,t)=>o.createElement(p,Object.assign({},e,{ref:t})))),h=(0,o.memo)(g)},27520:(e,t,n)=>{"use strict";n.d(t,{r:()=>c,y:()=>s});var o=n(7371),r=n(50016),a=n(38767),l=n(37854),i=n(63559);const s=e=>r.createElement(o.A,Object.assign({style:{flexDirection:"row",alignItems:"center",height:"100%"}},e)),c=e=>{let{focused:t,style:n,error:s,...c}=e;
1const{inputBackgroundColor:d}=(0,l._)(),{colors:{accentText:u,accent:m,tertiaryLight:p}}=(0,i.DP)();return r.createElement(o.A,Object.assign({style:(0,a.composeStyle)(d,{borderColor:t?u:"#E5E5E5",borderWidth:1,borderRadius:8,marginTop:24,paddingBottom:1,overflow:"hidden"},n,s?{borderColor:m}:{})},c))}},18394:(e,t,n)=>{"use strict";n.d(t,{c:()=>d});var o=n(50016),r=n(97076),a=n(49727),l=n(4670),i=n(7371),s=n(91099),c=n(38767);const d=e=>{let{id:t=0,onPress:n,icon:d,title:u,subtitle:m,endIcon:p,style:g,disabled:h,smallTitle:v,otherStyles:y,testID:b,badge:f}=e;return o.createElement(i.A,{style:(0,c.composeStyle)({position:"relative",paddingHorizontal:9,width:"100%"},null===y||void 0===y?void 0:y.container),pointerEvents:n?"auto":"none"},f,o.createElement(l.A,{disabled:h,key:t,style:(0,c.composeStyle)({opacity:h?.3:1,minHeight:72,paddingHorizontal:20,width:"100%",maxWidth:700,borderWidth:1,borderColor:"#E6EBEE",borderRadius:12,marginBottom:f?14:19,alignSelf:"center",overflow:"hidden",marginTop:f?10:0},g),onPress:()=>{h||n&&n()},testID:b},o.createElement(i.A,{style:(0,c.composeStyle)({flexDirection:"row",height:"100%"},null===y||void 0===y?void 0:y.iconsAndText)},d&&o.createElement(i.A,{style:(0,c.composeStyle)({marginRight:15,alignItems:"center",justifyContent:"center",marginVertical:16},null===y||void 0===y?void 0:y.frontIcon)},d),o.createElement(i.A,{style:{flex:1,justifyContent:"center"}},v&&o.createElement(a.A,{style:(0,c.composeStyle)({fontWeight:"500",fontSize:12,color:s.q.textLight,marginBottom:3},null===y||void 0===y?void 0:y.smallTitle)},v),o.createElement(a.A,{style:(0,c.composeStyle)({fontWeight:"500",fontSize:16,lineHeight:25,color:s.q.textDark},null===y||void 0===y?void 0:y.title)},u),o.createElement(a.A,{style:(0,c.composeStyle)({fontWeight:"500",fontSize:12,lineHeight:20,color:s.q.textLight},null===y||void 0===y?void 0:y.subTitle)},m)),n&&o.createElement(i.A,{style:(0,c.composeStyle)({justifyContent:"center"},null===y||void 0===y?void 0:y.endIcon)},p||o.createElement(r.H6J,null)))))}},20282:(e,t,n)=>{"use strict";n.d(t,{$n:()=>c,mc:()=>g,eN:()=>L,eF:()=>b,th:()=>S,Bx:()=>O.A,hK:()=>M.A,m0:()=>W,_Y:()=>H});var o=n(50016),r=n(56475),a=n(23851),l=n(38542);const{composeStyle:i,webSpecificStyle:s}=l.helpers,c=e=>{let{labelStyle:t,dense:n,...l}=e;const{button:c,buttonDense:d}=(0,a.O6)();return o.createElement(r.A,Object.assign({},l,{labelStyle:i(t,n?d:c,s({userSelect:"none"}))}))},{composeStyle:d,webSpecificStyle:u}=l.helpers;var m=n(7371);const{composeStyle:p}=l.helpers,g=o.memo((e=>{const{style:t,minified:n,center:r,row:l=!1,...i}=e,{container:s,containerCentered:c,minimized:d}=(0,a.O6)(),u=(0,o.useMemo)((()=>p(s,t,r?c:{},n?d:{},l&&{flexDirection:"row"})),[s,t,r,c,n,d,l]);return o.createElement(m.A,Object.assign({},i,{style:u}))}));n(6116);var h=n(63559);const{composeStyle:v,webSpecificStyle:y}=l.helpers,b=e=>{let{block:t=!1,color:n="",style:a={},buttonStyle:l={},contentStyle:i={},mode:s="contained",labelStyle:c={},children:d,testID:u="",compact:p,nativeID:g,...b}=e;const{colors:f}=(0,h.DP)();return o.createElement(m.A,{style:v({alignItems:t?"stretch":"flex-start",alignSelf:t&&"stretch"},a),nativeID:g},o.createElement(r.A,Object.assign({contentStyle:v(!p&&{height:48},i),buttonColor:n||f.accentText,uppercase:!1,mode:s,theme:{roundness:t?0:4},labelStyle:v({fontSize:16,padding:2},y({userSelect:"none"}),c),style:l,testID:u},b),d))};var f=n(35143),E=n(97076);const{composeStyle:C,webSpecificStyle:A}=l.helpers,S=e=>{let{value:t,onChangeText:n,style:r,...a}=e;const{colors:{borderLight:l,accentText:i,primary:s},fonts:{medium:c}}=(0,h.DP)();return o.createElement(g,Object.assign({minified:!0,style:{flex:1,height:40,borderRadius:60,borderWidth:1,borderColor:l,flexDirection:"row",alignItems:"center",...r}},a),o.createElement(f.A,{name:"search",style:C({flex:1,color:s,...c},A({outline:"none",caretColor:i})),onChangeText:n,value:t}),o.createElement(g,{center:!0,style:{position:"absolute",right:7,height:37,justifyContent:"center"}},o.createElement(E.C0l,{height:28,width:28})))};var w=n(56480),P=n(94408),I=n(28535),x=n(99324),D=n(8664),T=n(90140),k=n(81309),B=n.n(k),F=n(73819),_=n(64413);const N={[T.h.saved]:{color:_.F.gray,icon:o.createElement(P.A,null)},[T.h.invited]:{color:_.F.violet,icon:o.createElement(I.A,null)},[T.h.active]:{color:_.F.green,icon:o.createElement(x.A,null)},[T.h.tradeCredit]:{color:_.F.blue7,icon:o.createElement(x.A,null)},[T.h.inHouseCredit]:{color:_.F.blue7,icon:o.createElement(x.A,null)}},R={color:_.F.gray6,icon:o.createElement(D.A,null)},L=e=>{var t;let{status:n=T.h.saved}=e;const{color:r,icon:a}=null!==(t=N[n])&&void 0!==t?t:R;return o.createElement(F.sS,{icon:a,c:r},o.createElement(w.E,{fw:600,mt:1},B()(n.toLowerCase())))};var M=n(4726),O=n(18502),z=n(49727);const{composeStyle:j}=l.helpers,W=e=>{let{style:t,noTopMargin:n,...r}=e;const{bodySecondary:l}=(0,a.Nn)();return o.createElement(z.A,Object.assign({},r,{style:j(l,t,n&&{marginTop:0})}))},{composeStyle:V}
1=l.helpers,H=e=>{let{style:t,center:n,stretch:r,children:l,testID:i="",...s}=e;const{heading:c}=(0,a.Nn)();return o.createElement(z.A,Object.assign({},s,{style:V(c,t,n&&{textAlign:"center"},r&&{width:"100%"}),testID:i}),l)};n(38767),n(91396);n(68215);n(92734)},31925:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var o=n(50016),r=n(53941),a=n(88044),l=n(64626);const i=e=>(0,r.A)()?o.createElement(l.A,e):o.createElement(a.A,e)},80608:(e,t,n)=>{"use strict";n.d(t,{md:()=>S,Ay:()=>w,Ju:()=>x});var o=n(82345),r=n(91396),a=n.n(r),l=n(50016),i=n(5910),s=n(7371),c=n(49727),d=n(35790),u=n(97076),m=n(38542),p=n(38767),g=n(63680),h=n(29731),v=n(38325),y=n(78267),b=n(35143);const f=e=>{let{placeholder:t,value:n,testID:o="search_input_table",onChange:r,magnifierPosition:i="left"}=e;const[c,d]=(0,l.useState)(n),p=(0,l.useRef)(!1);return(0,l.useEffect)((()=>{if(p.current){const e=setTimeout((()=>r(c)),900);return()=>clearTimeout(e)}p.current=!0}),[c]),l.createElement(s.A,{style:E.wrapper,testID:"".concat(o,"_wrapper")},"left"===i&&l.createElement(s.A,{style:E.iconLeft},l.createElement(u.C0l,{width:21,height:21})),l.createElement(b.A,{value:c,onChangeText:d,placeholder:t,placeholderTextColor:a()(m.theme.light.colors.primary).alpha(.4).rgb().string(),style:E.input,testID:o}),"right"===i&&l.createElement(s.A,{style:E.iconRight},l.createElement(u.C0l,{width:21,height:21})))},E=y.A.create({wrapper:{borderWidth:1,borderColor:m.theme.light.colors.borderLight,borderRadius:4,padding:11,flexDirection:"row",flex:1,marginRight:24,backgroundColor:"#F7F9FC"},iconLeft:{marginRight:8},iconRight:{marginRight:8},input:{color:m.theme.light.colors.primary,fontSize:16,lineHeight:1.5,fontWeight:"400",flex:1,overflow:"hidden",...v.A.select({web:{outline:"none"}})}});var C=n(52628);const{light:A}=m.theme,S=25;const w=(0,g.PA)((function(e){var t,n,r;const{t:a}=(0,h.Bd)("global"),[{items:g=[],count:v=0,loading:y=!1,errorMessage:b=""},f]=(0,l.useState)({}),[E,w]=(0,l.useState)(""),[x,D]=(0,l.useState)({}),[[T,k],B]=(0,l.useState)([e.defaultSortColumn||"","desc"]),[F,_]=(0,l.useState)(null!==(t=e.page)&&void 0!==t?t:1),[N,R]=(0,l.useState)(S),L=(0,l.useRef)(null),M=(0,o.useIsFocused)(),O=(0,l.useMemo)((()=>e.sortCol||T),[T,e.sortCol]),z=(0,l.useMemo)((()=>e.sortDir||k),[k,e.sortDir]),{style:j={},title:W="",noTableHead:V=!1,disabled:H,CustomFilterComponent:U,filterPlaceholder:G="",apiCaller:Y,showOverflow:Q,expandableRows:q=!1,expandableRowsComponent:K,expandableRowDisabled:J,expandableRowExpanded:Z,extraApiParams:X=null,conditionalRowStyles:$=[],showFilters:ee=!0,showPagination:te=!0,searchable:ne=!0,store:oe=null,testID:re="api_table_".concat((new Date).getTime()),dataParam:ae="items",onReload:le,setSortColDir:ie,disableTable:se,className:ce,sortIcon:de,onSort:ue}=e,me=(0,l.useCallback)((()=>{var e,t;null===(e=L.current)||void 0===e||e.cancel(),Y&&(f({loading:!0}),L.current=Y({...X,...x,search:E,sortColumn:O,sortDirection:z,page:F,pageSize:N}),null===(t=L.current)||void 0===t||t.then((e=>{var t;const n={...e,items:(null===e||void 0===e?void 0:e.items)||[],count:(null===e||void 0===e?void 0:e.count)||(null===e||void 0===e?void 0:e.totalCount)||(null===e||void 0===e||null===(t=e.items)||void 0===t?void 0:t.length)||0};oe&&oe.setData(n),f(n),le&&le(e.items||[])})).catch((e=>{if("request-cancelled"!==e.code){var t;const n=(null===(t=e.data)||void 0===t?void 0:t.message)||e.message||e.toString();f({errorMessage:n})}})))}),[L,Y,X,x,E,O,z,F,N,oe]),pe=H||!M||e.data?null:me;(0,l.useEffect)((()=>(pe&&pe(),()=>{var e;null===(e=L.current)||void 0===e||e.cancel()})),[pe]);const ge=(0,l.useMemo)((()=>U?l.createElement(U,{value:x,onChange:D,store:oe}):null),[U,x,oe]),he=(0,l.useMemo)((()=>l.createElement(P,{search:E,onSearch:w,placeholder:G,filters:ge,testID:"".concat(re,"_filter_component")})),[E,G,ge,re]),ve=(0,l.useMemo)((()=>b?l.createElement(c.A,{style:{color:A.colors.error},testID:b},b):l.createElement(c.A,{testID:"no_items"},a("noItems"))),[b,a]),ye=e.emptyResult||ve;return l.createElement(i.Ay,{className:ce,style:(0,p.composeStyle)(j,Q&&{overflow:"visible"}),onRowClicked:e.onItemPress,noHeader:!W,disabled:se,title:W,noTableHead:V,noContextMenu:!0,subHeader:ne,subHeaderComponent:ee?he:null,subHeaderAlign:"left",columns:e.columns,data:e.data?e.data.slice():oe?oe[ae].slice():g,sortServer:!0,defaultSortField:O,defaultSortAsc:"desc"!==z,onSort:(0,l.useCallback)(((e,t)=>{const{id:n,name:o,selector:r}
1=e,a="string"===typeof r?r:"string"===typeof o?o:"string"===typeof n?n:"_id";ue&&ue(a,t),ie?(ie([a,t]),B([a,t])):B([a,t])}),[ie,ue]),pagination:te,paginationServer:!0,paginationDefaultPage:F,paginationPerPage:N,paginationTotalRows:null!==(n=e.count)&&void 0!==n?n:v,paginationRowsPerPageOptions:(0,l.useMemo)((()=>[S]),[]),onChangePage:(0,l.useCallback)((t=>{var n;null===(n=e.onChangePage)||void 0===n||n.call(e,t),_(t)}),[e]),onChangeRowsPerPage:(0,l.useCallback)((e=>R(e)),[]),progressPending:null!==(r=e.loading)&&void 0!==r?r:y,progressComponent:(0,l.useMemo)((()=>{var t,n;return null!==(t=e.progressComponent)&&void 0!==t?t:l.createElement(d.A,{indeterminate:!0,visible:null!==(n=e.loading)&&void 0!==n?n:y,testID:"progress_bar",color:m.theme.commonColors.accentText})}),[y,e.loading,e.progressComponent]),noDataComponent:ye,highlightOnHover:!0,customStyles:(0,C.merge)({},I,e.style),conditionalRowStyles:$,sortIcon:(0,l.useMemo)((()=>l.createElement(s.A,{testID:"sort_icon"},de?de(T?z:null):l.createElement(u.JCV,null))),[de,z,T]),keyField:e.keyField,expandableRowsHideExpander:!0,expandOnRowClicked:!0,expandableRows:q,expandableRowsComponent:!!q&&K,expandableRowDisabled:J,expandableRowExpanded:Z})})),P=l.memo((function(e){const t=e.placeholder||"Business name, account number...";return l.createElement(s.A,{style:{width:"100%",flexDirection:"row",flexWrap:"wrap"}},l.createElement(f,{value:e.search,onChange:e.onSearch,placeholder:t}),e.filters)})),I={table:{style:{backgroundColor:A.colors.surface}},tableWrapper:{style:{backgroundColor:A.colors.surface}},header:{style:{paddingLeft:0,paddingRight:0,minHeight:void 0}},subHeader:{style:{paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:32}},head:{style:{}},headRow:{style:{borderBottomColor:a()(A.colors.borderLight).alpha(.6).rgb().string(),minHeight:48},denseStyle:{}},headCells:{style:{color:A.colors.primary,fontSize:16,lineHeight:1.5,fontWeight:"bold"},activeSortStyle:{color:A.colors.primary,fontSize:16,lineHeight:1.5,fontWeight:"bold",width:"100%",div:{width:"100%"}},inactiveSortStyle:{color:A.colors.primary,fontSize:16,lineHeight:1.5,fontWeight:"bold",width:"100%",div:{width:"100%"},span:{textDecoration:"none",div:{svg:{opacity:"0.2 !important"}}}}},contextMenu:{style:{},activeStyle:{}},cells:{style:{color:A.colors.primary,fontSize:16,lineHeight:1.5,fontWeight:"400"}},rows:{style:{borderBottomColor:a()(A.colors.borderLight).alpha(.6).rgb().string()},selectedHighlightStyle:{},denseStyle:{},highlightOnHoverStyle:{backgroundColor:a()(A.colors.accentText).alpha(.08).rgb().string(),borderBottomColor:a()(A.colors.borderLight).alpha(.6).rgb().string(),outlineColor:a()(A.colors.borderLight).alpha(.6).rgb().string()},stripedStyle:{}},expanderRow:{style:{}},expanderCell:{style:{}},expanderButton:{style:{}},pagination:{style:{},pageButtonsStyle:{}},noData:{style:{}},progress:{style:{width:"100%"}}},x={header:{height:54},headRow:{borderBottomColor:"#E6E8EA",border:"1px"},headCells:{style:{paddingLeft:2,paddingRight:2,paddingBottom:8,fontSize:14,lineHeight:22,fontFamily:"Inter, sans-serif",fontWeight:"700",backgroundColor:"#F8F9F9",color:"#19262F",display:"flex",alignItems:"start",justifyContent:"flex-start",flexDirection:"row"},activeSortStyle:{fontSize:14,transform:"none",width:"auto",gap:"7px",div:{svg:{transform:"none !important"}}},inactiveSortStyle:{fontSize:14,width:"auto",gap:"7px",span:{textDecoration:"none",div:{svg:{transform:"none !important",opacity:"0.5 !important",fill:"#99ADBA"}}}}},cells:{style:{fontSize:14,alignItems:"center",justifyContent:"flex-start",paddingLeft:2,paddingRight:2,height:68,color:"#19262F",gap:4}}}},10150:(e,t,n)=>{"use strict";n.d(t,{A:()=>v});var o=n(50016),r=n(38325),a=n(32572),l=n(7371),i=n(49727),s=n(91855),c=n(17171),d=n(16148),u=n(38542),m=n(97076),p=n(82047),g=n(14329);const{composeStyle:h}=u.helpers,v=e=>{let{title:t="",onClose:n,onBack:u,visible:v=!1,children:y,height:b,backgroundColor:f="white",subtitle:E="",fixedContent:C,paddingHorizontal:A=20,footer:S=null,backdropOpacity:w=.3,testID:P,width:I,minWidth:x=600,minHeight:D}=e;const{screenWidth:T,screenHeight:k,md:B,sm:F}=(0,c.Qs)();(0,o.useEffect)((()=>{const e=e=>
1{27===e.keyCode&&n&&n()};return"web"===r.A.OS&&document.addEventListener("keydown",e,!1),()=>{"web"===r.A.OS&&document.removeEventListener("keydown",e,!1)}}),[n]);const _=B?(T-d.Uz)/2:T>300?null!==I&&void 0!==I?I:T:300,N=B?(T-_)/2:16,R=k-20,L=(0,o.useMemo)((()=>t?"object"===typeof t?t:o.createElement(l.A,{style:{alignItems:"center",justifyContent:"center",height:30,flex:1}},o.createElement(g.QG,{style:{fontWeight:"700",fontSize:20,lineHeight:26,textAlign:"center"},testID:t||""},t),!!E&&o.createElement(i.A,{style:{fontWeight:"500",fontSize:12,color:"#668598",lineHeight:20}},E)):o.createElement(l.A,{style:{flex:1}})),[t,E]);return o.createElement(s.A,{testID:P,visible:v,onClose:n,backdropOpacity:w,animationIn:"fadeIn",animationOut:"fadeOut",animationInTiming:1,animationOutTiming:1,style:h({marginHorizontal:F?N:-0,marginBottom:0,width:F&&(I||_-2*N),overflowY:"visible"},B?{justifyContent:"center",alignContent:"center",marginTop:0,marginRight:"auto",marginLeft:"auto",minWidth:null!==x&&void 0!==x?x:600}:{})},o.createElement(l.A,{style:h({backgroundColor:f,height:b,paddingHorizontal:A,borderRadius:20,maxHeight:R,minHeight:D,overflowY:"auto"})},!B&&o.createElement(l.A,{style:{height:4,borderRadius:3,width:32,alignSelf:"center",marginTop:8,marginBottom:8}}),o.createElement(l.A,{style:h({flexDirection:"row",alignItems:"center",marginBottom:10},B?{marginTop:24}:{})},u?o.createElement(p.A,{icon:o.createElement(m.Z3O,{width:40,height:40}),onPress:u,style:{marginLeft:20}}):o.createElement(l.A,{style:{width:30}}),L,!!n&&o.createElement(l.A,{style:{marginRight:10}},o.createElement(p.A,{style:{marginRight:"10"},testID:"".concat(t,"_close_btn"),icon:o.createElement(m.vaf,{width:40,height:40}),onPress:n}))),C,o.createElement(a.A,{contentContainerStyle:{height:"100%"},showsVerticalScrollIndicator:!1},y),S))}},62502:(e,t,n)=>{"use strict";n.d(t,{u:()=>p});var o=n(50016),r=n(20282),a=n(56475),l=n(68215),i=n(38542),s=n(97076),c=n(97976),d=n(63680),u=n(7371);const{composeStyle:m}=i.helpers,p=(0,d.PA)((e=>{var t;let{onPress:n,disabled:i,containerStyle:d,buttonStyle:p,style:g,save:h,children:v="Next",buttonProps:y,dontShowBack:b,onBack:f,...E}=e;const{userStore:C}=(0,c.P)(),A="project_form"===(null===(t=E.document)||void 0===t?void 0:t.type)?E.document:C.document;return o.createElement(u.A,Object.assign({style:m({marginVertical:20,width:"100%",flexDirection:"row",justifyContent:"space-between",paddingHorizontal:18},d)},E),!b&&o.createElement(a.A,{onPress:()=>{f?f():A.filled.length>0?A.moveBack():A.setCurrent("review")}},o.createElement(s.CP6,null)),o.createElement(r.hK,null),n&&o.createElement(a.A,Object.assign({disabled:i,buttonColor:l.commonColors.accentText,mode:"contained",style:m({borderRadius:8,width:150},p),contentStyle:{height:48,padding:16,borderRadius:0,alignItems:"center",justifyContent:"center"},onPress:n,labelStyle:{fontSize:16}},y),h?"Save":v))}))},22759:(e,t,n)=>{"use strict";n.d(t,{I:()=>g,M:()=>h});var o=n(50016),r=n(71003),a=n(7371),l=n(38117),i=n(20064),s=n(32641),c=n(82345),d=n(38767),u=n(82047),m=n(97076),p=n(22481);const g=e=>{let{onPress:t,icon:n,back:r=!1,menu:a}=e;const l=(0,c.useNavigation)();let s=n;return r?s=o.createElement(u.A,{icon:o.createElement(m.tTe,{height:"20",width:"20"}),onPress:()=>l.goBack()}):a&&(s="menu"),o.createElement(i.A,{icon:()=>s,size:30,onPress:()=>{t?t():r?l.goBack():a&&l.dispatch(p.DrawerActions.toggleDrawer())}})},h=e=>{let{leftComponent:t,title:n="",titleStyle:i={},titleTextStyle:c={},subTitle:u="",centerComponent:m,rightComponent:p,back:h=!1,subComponent:v,headerStyle:y,containerStyle:b,...f}=e;const E=h?o.createElement(a.A,{style:{flexDirection:"row",alignItems:"center"}},o.createElement(g,Object.assign({back:h},f)),t):t,C=n?o.createElement(a.A,{style:(0,d.composeStyle)({flex:1,justifyContent:"space-around",marginLeft:10},i)},o.createElement(l.A,{style:[{fontSize:18,fontWeight:"600"},c],ellipsizeMode:"tail",numberOfLines:1},n),u&&o.createElement(s.A,{ellipsizeMode:"tail",numberOfLines:1},u)):m;return o.createElement(r.A,{style:[{top:0,left:0,right:0},b]},o.createElement(a.A,{style:{height:60,flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:10,marginBottom:16,...y}},E,C,p),v)}}
1,45983:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var o=n(50016),r=n(38325),a=n(7371),l=n(4670),i=n(97405),s=n(91855),c=n(97076),d=n(38542);const{composeStyle:u}=d.helpers,m=e=>{let{title:t="",onClose:n,visible:d,children:m,containerStyle:p={},titleIcon:g="",contentStyle:h={},backDropAction:v=!0,iconClosePos:y="title",modalStyle:b={},titleStyle:f={},testID:E="modal",animationIn:C="fadeIn",animationOut:A="fadeOut"}=e;const S=(0,o.useCallback)((e=>{27===e.keyCode&&v&&d&&n()}),[v,d,n]);return o.useEffect((()=>("web"===r.A.OS&&document.addEventListener("keydown",S,!1),()=>{"web"===r.A.OS&&document.removeEventListener("keydown",S,!1)})),[S]),o.createElement(s.A,{backDropAction:v,visible:d,onClose:n,animationIn:C,animationOut:A,animationInTiming:400,style:u({borderRadius:8},b)},o.createElement(a.A,{style:u({backgroundColor:"white",borderRadius:10,alignSelf:"center",minWidth:300},p),testID:E},"absolute"===y&&o.createElement(l.A,{onPress:n},o.createElement(c.USm,{style:{right:5,top:5,position:"absolute"}})),!!t&&o.createElement(a.A,{style:{flexDirection:"row",alignItems:"center",padding:20,borderRadius:10,zIndex:-1}},g,o.createElement(i.A,{style:u({flex:1,marginLeft:g?10:0},f)},t),"title"===y&&o.createElement(l.A,{onPress:n},o.createElement(c.P3E,null))),o.createElement(a.A,{style:[{padding:10},h]},m)))}},2252:(e,t,n)=>{"use strict";n.d(t,{p:()=>p});var o=n(50016),r=n(56480),a=n(94408),l=n(28535),i=n(9490),s=n(14344),c=n(99324),d=n(16872),u=n(97081),m=n(73819);const p=e=>{var t;let{status:n}=e;const a=E[n],l=(null===(t=u.Od[n])||void 0===t?void 0:t.label)||n;return o.createElement(m.sS,{icon:null===a||void 0===a?void 0:a.icon,styles:{icon:{color:null===a||void 0===a?void 0:a.color}},"data-testid":"invoice_status_badge"},o.createElement(r.E,{c:null===a||void 0===a?void 0:a.color,fw:600,mt:1},l))},g={color:"#9baebc",icon:o.createElement(a.A,null)},h={color:"#0385c8",icon:o.createElement(l.A,null)},v={color:"#ff7926",icon:o.createElement(i.A,null)},y={color:"#7549e0",icon:o.createElement(s.A,null)},b={color:"#0ec06b",icon:o.createElement(c.A,null)},f={color:"#ec002a",icon:o.createElement(d.A,null)},E={[u.uR.draft]:g,[u.uR.seen]:h,[u.uR.due]:h,[u.uR.placed]:h,[u.uR.reviewRequired]:h,[u.uR.termsRequested]:h,[u.uR.paymentProcessing]:v,[u.uR.disbursementProcessing]:v,[u.uR.authorizationInReview]:v,[u.uR.applicationProcessing]:v,[u.uR.pendingDisbursement]:v,[u.uR.authorized]:y,[u.uR.collected]:b,[u.uR.invoiced]:b,[u.uR.creditApplied]:b,[u.uR.paid]:b,[u.uR.refinanced]:b,[u.uR.pastDue]:f,[u.uR.applicationCancelled]:f,[u.uR.applicationRejected]:f,[u.uR.cancelled]:f,[u.uR.expired]:f,[u.uR.rejected]:f,[u.uR.dismissed]:f,[u.uR.paymentFailed]:f,[u.uR.paymentError]:f}},80232:(e,t,n)=>{"use strict";n.d(t,{V:()=>d});var o,r,a,l=n(60034),i=n(50016),s=n(43723),c=n(68271);const d=e=>{let{status:t,displayStatus:n,tooltip:o,onPress:r,statusOptionsProvider:a}=e;const l=a(t);return i.createElement(c.A,{helper:o},i.createElement(u,{uiParams:l,testID:"invoice_status_badge",onClick:r},i.createElement(m,{id:"status-label-container",uiParams:l},i.createElement(p,{id:"status-icon"},l.icon),n||l.label)))},u=s.default.div(o||(o=(0,l.A)(["\n  padding: 1px 0 1px 0;\n  border-radius: 5px;\n  font-size: 14px;\n  line-height: 20px;\n  font-weight: 600;\n  font-family: 'Inter', sans-serif;\n  ","\n"])),(e=>{var t;return null===(t=e.uiParams)||void 0===t?void 0:t.style})),m=s.default.div(r||(r=(0,l.A)(["\n  display: flex;\n  gap: 8px;\n  height: 100%;\n  flex-direction: row;\n  justify-content: space-between;\n  ","\n"])),(e=>{var t,n;return(null===(t=e.uiParams)||void 0===t?void 0:t.gap)&&{gap:null===(n=e.uiParams)||void 0===n?void 0:n.gap}})),p=s.default.div(a||(a=(0,l.A)(["\n  flex-shrink: 0;\n"])))},61144:(e,t,n)=>{"use strict";n.d(t,{O:()=>h});var o,r,a,l,i,s,c,d=n(60034),u=n(97081),m=n(97076),p=n(50016),g=n(43723);function h(e){var t;const n=(null===(t=u.Od[e])||void 0===t?void 0:t.label)||e;switch(e){case u.uR.draft:return{label:n,icon:p.createElement(m.xt4,null),color:"#9baebc",style:(0,g.css)(o||(o=(0,d.A)(["\n          color: #9baebc;\n        "])))};case u.uR.seen:case u.uR.due:case u.uR.placed:case u.uR.reviewRequired:case u.uR.termsRequested:return{label:n,icon:p.createElement(m.HZZ,null),color:"#0385c8",style:(0,g.css)(r||(r=(0,d.A)(["\n          color: #0385c8;\n        "])))};case u.uR.paymentProcessing:case u.uR.disbursementProcessing:case u.uR.authorizationInReview:case u.uR.applicationProcessing:case u.uR.pendingDisbursement:return{label:n,icon:p.createElement(m.WSm,null),color:"#ff7926",style:(0,g.css)(a||(a=(0,d.A)(["\n          color: #ff7926;\n        "])))};case u.uR.authorized:return{label:n,icon:p.createElement(m.LBs,null),
1color:"#7549e0",style:(0,g.css)(l||(l=(0,d.A)(["\n          color: #7549e0;\n        "])))};case u.uR.collected:return{label:n,icon:p.createElement(m.Bfx,null),color:"#0ec06b",style:(0,g.css)(i||(i=(0,d.A)(["\n          color: #0ec06b;\n        "])))};case u.uR.invoiced:case u.uR.creditApplied:case u.uR.paid:case u.uR.refinanced:return{label:n,icon:p.createElement(m.nJm,null),color:"#0ec06b",style:(0,g.css)(s||(s=(0,d.A)(["\n          color: #0ec06b;\n        "])))};case u.uR.pastDue:case u.uR.applicationCancelled:case u.uR.applicationRejected:case u.uR.cancelled:case u.uR.expired:case u.uR.rejected:case u.uR.dismissed:case u.uR.paymentFailed:case u.uR.paymentError:return{label:n,icon:p.createElement(m.n7P,null),color:"#ec002a",style:(0,g.css)(c||(c=(0,d.A)(["\n          color: #ec002a;\n        "])))};default:return{label:e}}}},88044:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var o=n(50016),r=n(78267),a=n(38117),l=n(4670),i=n(7371),s=n(57081),c=n(25207),d=n(76466),u=n(10272);const m=r.A.create({container:{flexDirection:"row",alignItems:"center",borderRadius:8,padding:16,borderWidth:1},errorContainer:{backgroundColor:u.B.background.red100,borderColor:u.B.border.red100},infoContainer:{backgroundColor:"var(--mantine-color-blue-0)",borderColor:"var(--mantine-color-blue-0)"},iconContainer:{marginRight:12,marginTop:2,alignSelf:"flex-start"},textContainer:{flex:1,marginRight:16},title:{fontFamily:"Inter",fontSize:16,lineHeight:24,fontWeight:"700",color:"#001929",marginBottom:4},message:{maxWidth:840,fontFamily:"Inter",fontSize:14,fontWeight:"500",lineHeight:20,color:"#001929"},buttonContainer:{minWidth:110,flexDirection:"row",justifyContent:"flex-end",alignSelf:"flex-start"},buttonText:{textAlign:"center",fontWeight:"700",fontSize:14,lineHeight:24,fontFamily:"Inter"},button:{alignSelf:"flex-start",paddingVertical:8,paddingHorizontal:20,borderRadius:8,height:40},closeButtonContainer:{marginLeft:12,alignItems:"center",justifyContent:"center"},closeButton:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},loadingContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center",flex:1,paddingVertical:8},loadingText:{fontFamily:"Inter",fontSize:14,fontWeight:"500",color:"#668598",marginLeft:12}}),p=e=>{let{icon:t,title:n,message:r,buttonText:u,onActionPress:p,onClose:g,status:h,testID:v,buttonStyle:y,buttonTextStyle:b,containerStyle:f,loading:E=!1}=e;const C=[m.container,"error"===h?m.errorContainer:m.infoContainer,f];return E?o.createElement(i.A,{style:C,testID:v||"styled_alert_".concat(h,"_loading")},o.createElement(i.A,{style:m.loadingContainer},o.createElement(d.y,{size:"small",status:"primary"}))):o.createElement(i.A,{style:C,testID:v||"styled_alert_".concat(h)},!!t&&o.createElement(i.A,{style:m.iconContainer},t),o.createElement(i.A,{style:m.textContainer},"string"===typeof n?o.createElement(a.A,{style:m.title},n):n," ","string"===typeof r?o.createElement(a.A,{style:m.message},r):r),!(!p&&!g)&&o.createElement(i.A,{style:m.buttonContainer},!!p&&o.createElement(c.A,{onPress:p,testID:"".concat(v,"_action_button")||0,textStyle:[m.buttonText,b],buttonStyle:[m.button,y],label:u}),!!g&&o.createElement(l.A,{style:m.closeButtonContainer,onPress:g,testID:"".concat(v,"_close_button")||0},o.createElement(s.A,{color:"#00A0F3",width:18,height:18}))))}},64626:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var o=n(50016),r=n(78267),a=n(38117),l=n(4670),i=n(7371),s=n(57081),c=n(25207),d=n(76466);const u=r.A.create({container:{flexDirection:"row",alignItems:"center",borderRadius:8,padding:16,borderWidth:1},errorContainer:{backgroundColor:"#FFF2F4"},infoContainer:{backgroundColor:"#EFF8FE",borderColor:"#CCE8FC"},iconContainer:{marginRight:12,marginTop:2,alignSelf:"flex-start"},textContainer:{flex:1,marginRight:16},title:{fontFamily:"Inter",fontSize:14,lineHeight:20,fontWeight:"700",color:"#001929",marginBottom:4,letterSpacing:-.3},message:{maxWidth:840,fontFamily:"Inter",fontSize:14,fontWeight:"500",lineHeight:20,letterSpacing:-.3,color:"#001929"},buttonText:{textAlign:"center",fontWeight:"700",fontSize:14,lineHeight:24,fontFamily:"Inter"},button:{alignSelf:"flex-start",paddingVertical:6,paddingHorizontal:20,borderRadius:8,height:36,marginTop:12},closeButtonContainer:{marginLeft:12,alignItems:"center",justifyContent:"center",alignSelf:"flex-start"},closeButton:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},loadingContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center",flex:1,paddingVertical:8},loadingText:{fontFamily:"Inter",fontSize:14,fontWeight:"500",color:"#668598",marginLeft:12}}),m=e=>{let{icon:t,title:n,message:r,buttonText:m,onActionPress:p,onClose:g,status:h,testID:v,buttonStyle:y,buttonTextStyle:b,containerStyle:f,loading:E=!1}=e;const C=[u.container,"error"===h?u.errorContainer:u.infoContainer,f];return E?o.createElement(i.A,{style:C,testID:v||"styled_mobile_alert_".concat(h,"_loading")},o.createElement(i.A,{style:u.loadingContainer},o.createElement(d.y,{size:"small",status:"primary"}))):o.createElement(i.A,{style:C,testID:v||"styled_alert_".concat(h)},o.createElement(i.A,{style:u.iconContainer},t),o.createElement(i.A,{style:u.textContainer}
1,"string"===typeof n?o.createElement(a.A,{style:u.title},n):n," ","string"===typeof r?o.createElement(a.A,{style:u.message},r):r,!!p&&o.createElement(c.A,{onPress:p,testID:"".concat(v,"_action_button")||0,textStyle:[u.buttonText,b],buttonStyle:[u.button,y],label:m})),g&&o.createElement(l.A,{style:u.closeButtonContainer,onPress:g,testID:"".concat(v,"_close_button")||0},o.createElement(s.A,{color:"#00A0F3",width:18,height:18})))}},38146:(e,t,n)=>{"use strict";n.d(t,{s:()=>p});var o=n(50016),r=n(56475),a=n(38117),l=n(7371),i=n(38542),s=n(38767),c=n(14329),d=n(92734);const{commonColors:u}=i.theme,m=e=>{let{title:t,bgColor:n=u.accentText,mode:a,onPress:l,labelStyle:i={},contentStyle:c,style:d,...m}=e;return o.createElement(r.A,{testID:"option-btn",mode:a,uppercase:!1,style:{backgroundColor:n,width:"100%",...d},onPress:l,contentStyle:(0,s.composeStyle)(!m.compact&&{height:48,width:150},c),theme:{roundness:8},labelStyle:(0,s.composeStyle)({fontSize:16,padding:2,fontWeight:"500",color:"white"},(0,s.webSpecificStyle)({userSelect:"none"}),i)},t)},p=e=>{let{visible:t=!1,icon:n,onDismiss:r,height:i,linkData:s,textContentBottomMargin:u=45,title:p,message:g,buttonData:h,contentContainerStyle:v={},contentStyle:y={},exitable:b=!0,footer:f=null}=e;return t?o.createElement(c.BtModal,{visible:t,onClose:r,containerStyle:{backgroundColor:"white",height:i,minWidth:300,borderRadius:20,marginHorizontal:20,padding:0,display:"flex",justifyContent:"flex-start",...v},customHeader:b?o.createElement(d.X,{onClose:r}):null,testID:"alert-success-modal"},o.createElement(l.A,{style:{backgroundColor:"white",width:340,borderRadius:20,paddingBottom:20,...y},testID:"alert-success-content"},o.createElement(l.A,{style:{alignSelf:"center"}},n),o.createElement(l.A,{style:{padding:0,alignItems:"center",marginBottom:u},testID:"alert-success-info-content"},o.createElement(c.QG,{style:{fontSize:24,fontWeight:"700",textAlign:"center",marginVertical:22},testID:"alert-success-title"},p),o.createElement(c.QG,{style:{fontSize:16,fontWeight:"500",textAlign:"center",width:"90%",marginTop:18,lineHeight:24},testID:"alert-success-message"},g)),f,o.createElement(l.A,{style:{flexDirection:"row",justifyContent:"space-evenly"},testID:"alert-success-option-btn-container"},h&&o.createElement(m,{title:h.title,onPress:h.onPress,style:null===h||void 0===h?void 0:h.style,contentStyle:null===h||void 0===h?void 0:h.contentStyle})),s&&o.createElement(l.A,{style:{marginTop:21,width:"100%",alignItems:"center"},testID:"alert-success-link-data-container"},o.createElement(a.A,{style:{fontWeight:"500",fontSize:16},testID:"alert-success-link-data-title"},s.text)))):null}},68271:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var o=n(50016),r=n(16148);const a=e=>{let{children:t,helper:n,position:a="top",style:l={}}=e;return r.HZ?o.createElement("div",{"data-tooltip":n,"data-flow":a,style:l,id:"tooltip-view"},t):t}},94435:(e,t,n)=>{"use strict";n.d(t,{ZT:()=>k.Z,FN:()=>h,nv:()=>y,Hr:()=>D,x1:()=>C,ck:()=>w,gn:()=>T});var o=n(50016),r=n(17171),a=n(52993),l=n(44468);const i=(0,o.forwardRef)(((e,t)=>o.createElement(l.pq,Object.assign({ref:t,innerBorderStyle:{paddingLeft:(0,r.X6)(10),paddingRight:(0,r.X6)(5),paddingTop:(0,r.X6)(32),lineHeight:(0,r.X6)(24)},siblingProps:{marginRight:(0,r.X6)(10)}},e))));(0,a.L4)(i);n(82345);var s=n(20282),c=n(97076);var d=n(38767);var u=n(32572),m=n(7371),p=n(25891);let g;const h=(0,n(63680).PA)((e=>{let{children:t,style:n}=e;const{mobileWidth:a}=(0,r.Qs)(),[l,i]=o.useState(0),c=o.Children.toArray(t),d=(0,o.useRef)(!1),h=e=>{var t;d.current=!0,null===(t=g)||void 0===t||t.scrollTo({x:.8*a*e,animated:!1}),setTimeout((()=>{d.current=!1}),200)},v=[];for(let r=0;r<c.length;r++)v.push(o.createElement(p.dY,{key:r,style:{margin:5,height:6,width:6,borderRadius:3,backgroundColor:l===r?"#99ADBA":"#E6EBEE"},onPress:()=>{i(r),h(r)}}));return o.createElement(o.Fragment,null,o.createElement(m.A,{style:n},o.createElement(u.A,{ref:e=>g=e,horizontal:!0,contentContainerStyle:{width:"".concat(a*c.length,"%")},showsHorizontalScrollIndicator:!1,scrollEventThrottle:200,decelerationRate:"fast",pagingEnabled:!0,onScroll:e=>{if(d.current)return;const t=Math.round(e.nativeEvent.contentOffset.x/(.8*a));t!==l&&i(t)}},c.map(((e,t)=>o.createElement(s.mc,{key:t,style:{flex:1,width:t===c.length-1?.9*a:.8*a}},e))))),o.createElement(m.A,{style:{justifyContent:"center",display:"flex",flexDirection:"row",alignItems:"flex-start",paddingTop:8}},v.length>1&&v))}));var v=n(23851);(0,r.Fb)(s.mc);n(91396),n(67976);const y=e=>
1{let{numberOfDots:t=3,style:n,dotSize:r=3,color:a="black",space:l=2,containerProps:i,dotStyle:c,testID:u="dots"}=e;return o.createElement(s.mc,Object.assign({center:!0,row:!0,style:(0,d.composeStyle)({margin:"auto"},n)},i),Array.from(Array(t)).map(((e,t)=>o.createElement(m.A,{key:t,style:(0,d.composeStyle)({height:r,width:r,borderRadius:r,backgroundColor:a,margin:l},c),testID:"".concat(u,"_").concat(t)}))))};var b=n(2618),f=n(38542);const{composeStyle:E}=f.helpers,C=e=>{let{colors:t,minimized:n,horizontal:r=!1,style:a,...l}=e;const{container:i,minimized:s}=(0,v.O6)();return o.createElement(b.A,Object.assign({style:E(i,n&&s,a),start:r&&{x:0,y:0},end:r&&{x:1,y:0},colors:t},l))};var A=n(429);const{composeStyle:S}=f.helpers,w=e=>{let{style:t,onPress:n,icon:a=(()=>o.createElement(c._Kz,null)),title:l,titleStyle:i,isLast:s,index:d,total:u,...m}=e;const{mobileWidth:p}=(0,r.Qs)();return o.createElement(A.A,Object.assign({titleStyle:S({fontWeight:"600",color:"black",opacity:.5},i),style:S({borderColor:"#E5E5E5",borderTopWidth:1,width:p,paddingVertical:10,paddingHorizontal:15},s||d===u-1?{borderBottomWidth:1}:{},t),title:l,titleNumberOfLines:2,onPress:n,right:a},m))};n(68215),n(68271),n(4726);const{composeStyle:P}=f.helpers,I=(0,o.forwardRef)(((e,t)=>{let{style:n={},nativeProps:r,big:a=!1,half:i=!1,...s}=e;return o.createElement(l.pq,Object.assign({style:P(a&&{height:72},i&&{width:144},n),innerBorderStyle:P(a&&{marginTop:8},i&&{width:100,paddingLeft:16}),ref:t},s))}));(0,a.L4)(I);var x=n(49727);const D=e=>{let{style:t}=e;return o.createElement(m.A,{style:(0,d.composeStyle)({borderBottomColor:"#F0F0F0",borderBottomWidth:1,flex:1},t)}
1)},T=e=>{let{children:t,containerStyle:n}=e;return o.createElement(m.A,{style:[{flexDirection:"row",alignItems:"center"},n]},o.createElement(D,null),o.createElement(x.A,{style:{textAlign:"center",marginHorizontal:20}},t),o.createElement(D,null))};n(88044),n(64626);var k=n(31925)},91663:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>A,Fr:()=>f});var o=n(50016),r=n(78267),a=n(38117),l=n(7371),i=n(5438),s=n(97076),c=n(29731),d=n(82345),u=n(19925),m=n(53941),p=n(67869),g=n(38767),h=n(3180),v=n(97976),y=n(31925),b=n(91162);let f=function(e){return e.Payables="payables",e.Account="account",e}({});const E=(0,i.PA)((e=>{var t;let{onActionPress:n,primaryPaymentMethod:r,origin:i=f.Payables,loading:E}=e;const{loanRepaymentSettings:A}=null===(t=v.A.screensStore)||void 0===t?void 0:t.paymentMethodsStore,{t:S}=(0,c.Bd)("global"),w=(0,d.useNavigation)(),{sm:P}=(0,u.Qs)(),I=(0,m.A)(),x=o.createElement(l.A,{style:C.titleContainer},o.createElement(a.A,{style:[C.texts,C.title,I&&{fontSize:14,lineHeight:20}]},S("autoPayWarning.enabled.title")+" "),o.createElement(a.A,{style:[C.texts,C.title,C.onText]},S("autoPayWarning.enabled.on"))),D=(0,h.w)(r,A),T=o.createElement(l.A,null,o.createElement(a.A,{style:[C.texts,C.message]},S("autoPayWarning.enabled.message")+" ",o.createElement(a.A,{style:[C.texts,C.message,C.accountText]},b.A.getLongName(r))));return o.createElement(l.A,null,o.createElement(y.Z,{icon:o.createElement(s.ccF,{width:20,height:20}),title:x,message:T,buttonText:i===f.Payables?S("autoPayWarning.enabled.buttonTextPayables"):S("autoPayWarning.enabled.buttonTextAccount"),onActionPress:()=>{i===f.Account?n():P?w.navigate(p.f0.Console.Accounts._self):w.navigate(p.f0.Console.More._self,{screen:p.f0.Console.More.Wallet})},status:"info",testID:"ihc_autopay_enabled_banner",loading:E,buttonStyle:i===f.Payables?(0,g.composeStyle)({backgroundColor:"transparent"},I?{marginLeft:-20,height:25}:{paddingHorizontal:0}):void 0,buttonTextStyle:i===f.Payables?{color:"#00A0F3"}:void 0}),i===f.Account&&!!D&&!E&&o.createElement(a.A,{style:[C.texts,C.processingFeeText]},"*"+S("autoPayIHCFlow.processingFeeNote",{processingFee:D})))})),C=r.A.create({titleContainer:{flexDirection:"row",alignItems:"center",marginBottom:4},title:{fontSize:16,lineHeight:24,fontWeight:"700"},onText:{color:"#0EC06B"},message:{maxWidth:840,fontSize:14,lineHeight:20,fontWeight:"500"},accountText:{fontWeight:"700"},processingFeeText:{marginTop:16,fontSize:14,lineHeight:20,fontWeight:"500",color:"#00A0F3",letterSpacing:0},texts:{fontFamily:"Inter",color:"#001929",letterSpacing:-.3}}),A=E},38804:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var o=n(50016),r=n(40046),a=n(38117),l=n(7371),i=n(5438),s=n(29731),c=n(91663),d=n(97076),u=n(97976),m=n(14329),p=n(94435);const g=(0,i.PA)((e=>{var t,n,i,g;let{onActionPress:h,onClose:v,origin:y=c.Fr.Payables,marginBottom:b=0,marginTop:f=0,isAutoPayIhcFlowOpened:E}=e;const{t:C}=(0,s.Bd)("global"),{userStore:A,screensStore:{paymentMethodsStore:{paymentMethods:S,loading:w}}}=(0,u.P)(),P=!A.userInfoReady,I=!E&&(P||w),x=(null===(t=A.suppliers)||void 0===t?void 0:t.some((e=>e.isFactoringEnabled)))||!1,D=S.find((e=>e.isPrimaryForIHCAutoPay));if(!x)return null;const T=null===(n=A.company)||void 0===n||null===(i=n.settings)||void 0===i?void 0:i.inHouseCredit,k=null===T||void 0===T?void 0:T.isAutoPayEnabledByCompanyUser,B=(null===T||void 0===T?void 0:T.isAutoPayRequired)||!1,F="[email protected]",_=!0===(null===D||void 0===D?void 0:D.isPrimaryForIHCAutoPay)&&!0===(null===D||void 0===D||null===(g=D.autoPay)||void 0===g?void 0:g.isAutoPayPaused),N=o.createElement(l.A,null,o.createElement(a.A,{style:{fontSize:14,fontWeight:"500",color:"#001929",lineHeight:20}},C("autoPayWarning.bankAccountOnHold.message")),o.createElement(l.A,{style:{flexDirection:"row",marginTop:8}},o.createElement(d.Oh,{width:16,height:16}),o.createElement(a.A,{style:{fontSize:14,fontWeight:"500",color:"#00A0F3",marginLeft:4},onPress:()=>r.A.openURL("tel:8554281185")},"855-428-1185"),o.createElement(d.eUD,{width:18,height:18,style:{marginLeft:16}}),o.createElement(a.A,{style:{fontSize:14,fontWeight:"500",color:"#00A0F3",marginLeft:4},onPress:()=>r.A.openURL("mailto:".concat(F))},F)));return k&&D?o.createElement(o.Fragment,null,!!f&&o.createElement(m.Spacer,{height:f}),_?o.createElement(p.ZT,{icon:o.createElement(d.RYv,{width:20,height:22}),title:C("autoPayWarning.bankAccountOnHold.title"),message:N,buttonText:C("autoPayWarning.bankAccountOnHold.buttonText"),onActionPress:h,status:"error",containerStyle:{backgroundColor:"white",borderWidth:3,borderColor:"#D10026"}
1,testID:"ihc_autopay_bank_account_on_hold_banner",loading:I}):o.createElement(c.Ay,{onActionPress:h,primaryPaymentMethod:D,loading:I,origin:y}),!!b&&o.createElement(m.Spacer,{height:b})):o.createElement(o.Fragment,null,!!f&&o.createElement(m.Spacer,{height:f}),B?o.createElement(p.ZT,{icon:o.createElement(d.RYv,{width:20,height:22}),title:C("autoPayWarning.required.title"),message:C("autoPayWarning.required.message"),buttonText:C("autoPayWarning.required.buttonText"),onActionPress:h,status:"error",testID:"ihc_autopay_required_banner",loading:I}):o.createElement(p.ZT,{icon:o.createElement(d.Tvg,{width:20,height:22}),title:C("autoPayWarning.recommended.title"),message:C("autoPayWarning.recommended.message"),buttonText:C("autoPayWarning.recommended.buttonText"),onActionPress:h,onClose:v,status:"info",testID:"ihc_autopay_recommended_banner",loading:I}),_&&o.createElement(p.ZT,{icon:o.createElement(d.RYv,{width:20,height:22}),title:C("autoPayWarning.bankAccountOnHold.title"),message:N,buttonText:C("autoPayWarning.bankAccountOnHold.buttonText"),onActionPress:h,status:"error",containerStyle:{backgroundColor:"white",borderWidth:3,borderColor:"#D10026"},testID:"ihc_autopay_bank_account_on_hold_banner",loading:I}),!!b&&o.createElement(m.Spacer,{height:b}))}))},96157:(e,t,n)=>{"use strict";n.d(t,{b:()=>i});var o=n(50016),r=n(20282),a=n(38542);const{composeStyle:l}=a.helpers,i=e=>{let{style:t,...n}=e;return o.createElement(r.mc,Object.assign({minified:!0,style:l({paddingHorizontal:32},t)},n))}},14899:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var o=n(50016),r=n(7371),a=n(63680),l=n(20282);class i extends o.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!!e}}componentDidCatch(e,t){console.log(e,t)}render(){return this.state.hasError?o.createElement("h1",null,"Something went wrong."):this.props.children}}function s(e,t,n,o){let r=[],a=[];if("review"===t)return a;for(r.push("".concat(t,".").concat(n)),a.push("".concat(t,".").concat(n));r.length>0;){var l;let[t,n]=r.pop().split("."),i=null===(l=e[t])||void 0===l?void 0:l[n];if(i)if(i.next){const e="function"===typeof i.next?i.next(o):i.next;"review"!==e&&a.push(e),r.push(e)}else i.list&&i.list.forEach((e=>{var l;const i=null===(l=o.data.get(t))||void 0===l?void 0:l.get(n),s="function"===typeof e.next?e.next(o):e.next;i&&i!==e.value||a.push(s),i&&i!==e.value||r.push(s)}))}return a}var c=n(4726),d=n(90964),u=n(19462);const m=e=>{let{data:t,coOwnerData:n,route:r,item:a,group:l,flow:i,document:c}=e;const m=i[l][a];return o.createElement(m.component,{document:c,currentData:t,route:r,coOwnerData:null===n||void 0===n?void 0:n.content,onValue:(e,t,n)=>{c.setData(a,e,m.title,l,i[l].title,n);const o="loan_application"===c.type?s(i,"businessInfo","describeYourSelf",c):s(i,l,a,c),r=Array.from(c.data.keys()).indexOf(l),d=c.data.get(l).get(a,!0),u=c.data.get(l).items.indexOf(d);if(c.clearData(((e,t,n,a)=>{var l;let i=o.includes("".concat(n,".").concat(e.identifier));return(a<r||a===r&&t<=u||null!==(l=e.content)&&void 0!==l&&l.allMandatoryFilled)&&(i=!0),i})),t)"function"===typeof t?c.setCurrent(t(c)):c.setCurrent(t);else if("function"===typeof m.next){const e=m.next(c);c.setCurrent(e)}else c.setCurrent(m.next)},onSkip:()=>{if(c.removeData(l,a),"function"===typeof m.next){const e=m.next(c);c.setCurrent(e)}else c.setCurrent(m.next)},onValueForCoOwner:(e,t)=>{var o;c.removeData("coOwnerInfo",t);const r=null===(o=c.data.get("coOwnerInfo"))||void 0===o?void 0:o.get(n.identifier),a=d.ab.create(null!==r&&void 0!==r?r:{});"object"===typeof e?Object.keys(e).forEach((t=>{a.setValue(t,e[t])})):a.setValue(t,e),null===c||void 0===c||c.setData(n.identifier,{...(0,u.getSnapshot)(a),allMandatoryFilled:a.allMandatoryFilled},"Co-owner details","coOwnerInfo","Business Co-owner information",a.allMandatoryFilled),c.setCurrent("function"===typeof m.next?m.next(c):m.next)}})};const p=function(e){let{flow:t,initial:n,document:s,closeMe:d,style:u,type:p,...g}=e;if(!s||s.type!==p)return null;const[h,v]=(s.current||n).split(".");let y=t[h][v];return o.createElement(r.A,{style:[{flex:1},u]},o.createElement(r.A,{style:{flexDirection:"row",marginBottom:10}},o.createElement(l._Y,{style:{marginHorizontal:23,marginTop:15,lineHeight:28,fontSize:22}},null===y||void 0===y?void 0:y.title)),o.createElement(l.m0,{style:{fontWeight:"300",fontSize:15,lineHeight:22,marginTop:0,paddingHorizontal:23,alignSelf:"center"}},null===y||void 0===y?void 0:y.description),o.createElement(c.A,null),o.createElement(r.A,{style:{flex:1}},y&&y.component&&o.createElement(i,{Fallback:o.createElement(m,{data:null})},o.createElement(a.nu,null,(()=>o.createElement(m,Object.assign({data:s.currentData,document:s,flow:t,group:h,item:v},g)))))))}},60236:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n(50016),r=n(86348),a=n(56299),l=n(53941);const i=e=>{let{pdfUrl:t,onReachedAgreementEnd:n}=e;const[i,s]=(0,o.useState)(!0),[c,d]=(0,o.useState)(!1),[u,m]=(0,o.useState)(null),p=(0,o.useRef)(null),g=(0,o.useRef)(null),h=(0,o.useRef)(new Set),[v,y]=(0,o.useState)(!1),[b,f]=(0,o.useState)(0),[E,C]=(0,o.useState)(window.innerWidth),A=(0,l.A)();(0,o.useEffect)((()=>{const e=()=>{C(window.innerWidth)};return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}}),[]),(0,o.useEffect)((()=>{(async()=>{try{const e=r.pdfjs.getDocument(t),n=await e.promise;m(n)}catch(e){console.error("Error loading PDF: ",e)}})()}),[t]);const S=(0,o.useCallback)((async e=>{if(u&&!h.current.has(e)){h.current.add(e);try{var t;const n=await u.getPage(e),o=n.getViewport({scale:1}),r=((null===(t=p.current)||void 0===t?void 0:t.clientWidth)||o.width)/o.width,a=n.getViewport({scale:r}),l=document.getElementById("page-".concat(e));if(l){l.width=a.width,l.height=a.height;const e=l.getContext("2d");
1if(e){const t={canvasContext:e,viewport:a};await n.render(t).promise,f((e=>e+1))}}}catch(n){console.error("Error rendering page ".concat(e,": "),n)}finally{h.current.delete(e)}}}),[u]),w=(0,o.useCallback)((()=>{if(!u||!p.current)return;const e=p.current,t=e.scrollTop,n=e.clientHeight;for(let o=1;o<=u.numPages;o++){const e=document.getElementById("page-".concat(o)),r=(o-1)*(e?e.height:0);r>=t&&r<t+n&&S(o)}}),[u,S]),P=(0,o.useCallback)((e=>{let{scrollTop:t,scrollHeight:o,clientHeight:r}=e;t+r>=o-1&&!v&&b===(null===u||void 0===u?void 0:u.numPages)&&(y(!0),n&&n()),d(t+r>=o-30),s(b===(null===u||void 0===u?void 0:u.numPages)&&t<=30)}),[v,n,b,null===u||void 0===u?void 0:u.numPages]);(0,o.useEffect)((()=>{const e=p.current;return e&&e.addEventListener("scroll",w),()=>{e&&e.removeEventListener("scroll",w)}}),[w]),(0,o.useEffect)((()=>{u&&u.numPages>0&&(S(1),w())}),[u,S,w]);const I=i?{borderTopLeftRadius:40,borderTopRightRadius:40,borderBottomLeftRadius:0,borderBottomRightRadius:0}:c?{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:40,borderBottomRightRadius:40}:{borderRadius:0};return o.createElement(a.ur,{ref:g,style:{maxWidth:A?E<=415?475:500:880,width:A?E<=415?360:440:880,height:600,border:b!==(null===u||void 0===u?void 0:u.numPages)?"none":"2px solid #F8F9F9",...I},autoHide:!0,autoHideTimeout:1e3,autoHideDuration:200,onUpdate:P,renderThumbVertical:e=>{let{style:t,...n}=e;return o.createElement("div",Object.assign({},n,{style:{...t,backgroundColor:"#626D75",borderRadius:10,width:8}}))},renderTrackVertical:e=>{let{style:t,...n}=e;return o.createElement("div",Object.assign({},n,{style:{...t,right:2,top:30,bottom:54,borderRadius:10,width:8}}))}},o.createElement("div",{ref:p,style:{maxWidth:A?E<=415?475:500:840,width:A?E<=415?420:400:840,borderRadius:40,padding:20,paddingBottom:40,backgroundColor:"#F8F9F9"}},Array.from({length:(null===u||void 0===u?void 0:u.numPages)||0},((e,t)=>o.createElement("div",{key:t+1,style:{position:"relative",margin:"10px 0"}},o.createElement("canvas",{id:"page-".concat(t+1),style:{width:"100%",border:"1px solid #e0e0e0",borderRadius:"6px",backgroundColor:"white",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.05)"}}))))))}},8922:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var o=n(50016),r=n(78267),a=n(7371),l=n(17171),i=n(38767),s=n(52993),c=n(43872),d=n(29731),u=n(58876);const m=r.A.create({inputsWrapper:{flex:1}}),p=e=>{let{editable:t=!0,containerStyle:n={},style:r={},value:p,onChangeText:g,customStyle:h={},inputStyle:v={},...y}=e;const{t:b}=(0,d.Bd)("errors"),[f,E,C]=(0,l.S3)(p,g),[A,S]=(0,o.useState)(14),w=(0,s.Lx)(f.length&&!C?b("not-valid-number"):"");return(0,o.useEffect)((()=>{switch(f[0]){case"+":S(15);break;case"1":S(16);break;default:S(14)}}),[f]),o.createElement(a.A,{style:(0,i.composeStyle)({...m.inputsWrapper,customStyle:h},n)},o.createElement(c.A,Object.assign({},w,{value:f,onChangeText:E,editable:t,maxLength:A,autoComplete:"tel",keyboardType:u.ui.NumberPad,highlight:w.error,style:v},y)))}},77095:(e,t,n)=>{"use strict";n.d(t,{aC:()=>m,lI:()=>_,Dx:()=>N,rp:()=>I,Z8:()=>G,yZ:()=>S,BA:()=>ee,lO:()=>he});var o=n(50016),r=n(63559),a=n(66463),l=n(49727),i=n(20282),s=n(94435);var c=n(38542),d=n(29731);const{webSpecificStyle:u}=c.helpers,m=e=>{let{last:t=!1,title:n,onPress:c,details:m={}}=e;const{t:p}=(0,d.Bd)("global"),{colors:g}=(0,r.DP)(),h=!function(e){if(null===e)return!1;for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return n.every((t=>!!e[t]))}(m,"accountNumber","accountholderName","routingNumber");return o.createElement(a.A,{onPress:c},o.createElement(s.x1,{direction:p("90deg"),colors:h?["#9BAEBC","#9BAEBC"]:["#68B4DC","#7D78C6"],minimized:!0,horizontal:!0,style:[!t&&{marginRight:25},{paddingHorizontal:16,paddingVertical:24,borderRadius:8,maxWidth:420,minWidth:320,minHeight:180,boxShadow:"0px 0px 20px 4px rgba(0, 0, 0, 0.12)",...u({userSelect:"none"})}],md:{minWidth:420}},!!n&&o.createElement(i.mc,null,o.createElement(l.A,{style:{color:g.surface,fontWeight:"600"}},n," ",h&&"+")),o.createElement(i.mc,null,o.createElement(i._Y,{style:{fontWeight:"300",color:g.surface}},(null===m||void 0===m?void 0:m.name)||(null===m||void 0===m?void 0:m.accountholderName))),o.createElement(i.mc,{minified:!0,style:{alignSelf:"flex-end"}},!(null===m||void 0===m||!m.accountNumber)&&o.createElement(i._Y,{style:{color:g.surface,fontWeight:"500",fontSize:14}},p("BankManagment.checkingAccount")," ",m.accountNumber)),!(null===m||void 0===m||!m.routingNumber)&&o.createElement(l.A,{style:{alignSelf:"flex-end",color:g.surface,fontWeight:"500",fontSize:14}},p("BankManagment.routing")," ",m.routingNumber)))};var p=n(14329),g=n(78267),h=n(7371),v=n(14425),y=n(32572),b=n(92734),f=n(53941),E=n(10272),C=n(76466);const A=()=>
1o.createElement(h.A,{style:w.loaderContainer},o.createElement(C.y,{size:"large",status:"primary"})),S=Object.assign((e=>{let{title:t,disabled:n,loading:r,children:a,testID:l,style:i,headerStyle:s,centeredTitle:c,onClose:d,onBack:u}=e;const m=(0,f.A)(),[p,g]=(0,o.useState)(!1);(0,o.useEffect)((()=>{const e=requestAnimationFrame((()=>g(!0)));return()=>cancelAnimationFrame(e)}),[]);const h=[w.modal,m&&P.modal,i],y=[w.header,m&&P.header,s];return o.createElement(v.Modal,{visible:p,onBackdropPress:d,backdropStyle:w.backdrop,testID:l,style:h},o.createElement(b.X,{title:t,disabled:n,useModalStyles:!0,centeredTitle:c,onClose:d,onBack:u,containerStyle:y}),r?o.createElement(A,null):a)}),{Content:e=>{let{children:t}=e;return o.createElement(y.A,{showsVerticalScrollIndicator:!1},o.createElement(h.A,{style:w.content},t))},Buttons:e=>{let{alignment:t="right",children:n}=e;const r=(0,f.A)(),a="right"===t?w.footerRight:"left"===t?w.footerLeft:w.footerCenter,l=[w.footer,a,r&&P.footer],s=o.Children.toArray(n),c=r?s.reverse():s;return o.createElement(o.Fragment,null,r&&o.createElement(i.hK,{height:20}),o.createElement(h.A,{style:l},c))}}),w=g.A.create({modal:{backgroundColor:"#fff",borderRadius:12,maxHeight:"100%",padding:25,width:620},grip:{backgroundColor:E.B.elements.grey200,height:4,borderRadius:3,width:32,alignSelf:"center",marginTop:8},content:{flex:1},loaderContainer:{flex:1,justifyContent:"center",alignItems:"center",minHeight:300},header:{margin:0,marginBottom:24},backdrop:{backgroundColor:"rgba(0, 0, 0, 0.3)"},footer:{marginTop:30,flexDirection:"row",gap:12,width:"100%"},footerRight:{justifyContent:"flex-end"},footerLeft:{justifyContent:"flex-start"},footerCenter:{justifyContent:"center"}}),P=g.A.create({modal:{padding:15,width:"100%"},header:{margin:0,marginHorizontal:0,marginBottom:15},footer:{flexDirection:"column",justifyContent:"center",marginBottom:5,marginHorizontal:0}}),I=e=>{let{icon:t,title:n,children:r,buttons:a,testID:l="AlertModal",textStyle:i,onClose:s}=e;const c=(0,f.A)()?[T.title,T.mobileTitle]:T.title;return o.createElement(S,{headerStyle:T.header,testID:l,onClose:s},o.createElement(S.Content,null,o.createElement(h.A,{style:T.iconContainer},t),o.createElement(p.Spacer,{height:20}),n&&o.createElement(o.Fragment,null,o.createElement(p.QG,{style:c},n),o.createElement(p.Spacer,{height:20})),o.createElement(x,{textStyle:i},r)),o.createElement(D,{buttons:a,onClose:s,testID:l}))},x=e=>{let{textStyle:t,children:n}=e;const r=(0,f.A)();if(!n)return null;const a=o.Children.toArray(n),l=r?[T.text,T.mobileText]:T.text;return o.createElement(o.Fragment,null,a.map(((e,n)=>o.createElement(o.Fragment,{key:n},"string"===typeof e?o.createElement(p.QG,{style:[l,t]},e):e))))},D=e=>{let{buttons:t,testID:n,onClose:r}=e;const a=(0,f.A)(),l=(a?[...t].reverse():t).map((e=>"string"===typeof e?{label:e}:e)),i=a?T.mobileButton:T.desktopButton;return o.createElement(S.Buttons,{alignment:"center"},l.map(((e,l)=>{var s;const c=a?t.length-1-l:l,d=c===t.length-1,u=null!==(s=e.status)&&void 0!==s?s:d?"primary":"basic",m=e.onClick||r;return o.createElement(p.BtButton,{key:c,style:[i,e.style],status:u,onPress:m,testID:"".concat(n,".Button").concat(c)},e.label)})))},T=g.A.create({desktopButton:{minWidth:220},mobileButton:{width:"100%",borderRadius:8},iconContainer:{alignItems:"center"},title:{fontSize:24,fontWeight:"700",lineHeight:32,textAlign:"center"},header:{marginBottom:0},mobileTitle:{fontSize:18,lineHeight:24,letterSpacing:-.3},text:{fontSize:16,lineHeight:28,textAlign:"center",paddingHorizontal:20},mobileText:{lineHeight:22}});n(14899);var k=n(62502);var B=n(44468);const{commonColors:F}=c.theme,_=e=>{let{onValue:t,currentData:n,data:r,options:a=["Yes","No"],document:l,onValueForCoOwner:i,identifier:c,otherTextLabel:d}=e;const[u,m]=(0,o.useState)(!1),[p,g]=(0,o.useState)((null===n||void 0===n?void 0:n.content)||r||"");(0,o.useEffect)((()=>{p&&!a.includes(p)&&m(!0)}),[]);return o.createElement(h.A,null,a.map(((e,n)=>o.createElement(s.ck,{key:n,index:n,total:a.length,titleStyle:{opacity:p===e?1:.5},style:{backgroundColor:p===e&&F.highlighted},title:e,onPress:()=>(e=>{c?i(e,c):"Other"===e?(m(!0),g("")):t(e)})(e)}))),u&&o.createElement(B.Sm,{placeholder:d,style:{margin:20,paddingTop:0,textAlign:"center",borderBottomWidth:.5},value:p,onChangeText:g}),o.createElement(k.u,{containerStyle:{marginTop:40},disabled:"loan_application"!==(null===l||void 0===l?void 0:l.type)&&!p||u&&!p,onPress:()=>t(p),document:l}))},N=e=>{let t,{onValue:n,currentData:r,noButtons:a,list:l,document:i}=e;return o.createElement(o.Fragment,null,o.createElement(h.A,{style:{alignItems:"center"}},l.map(((e,a)=>{let{value:i,next:c}=e;return(null===r||void 0===r?void 0:r.content)===i&&(t=c),o.createElement(s.ck,{key:a,index:a,total:l.length,title:i,titleStyle:{opacity:(null===r||void 0===r?void 0:r.content)===i?1:.5},style:{backgroundColor:(null===r||void 0===r?void 0:r.content)===i&&F.highlighted,width:"100%"},onPress:()=>n(i,c)})}))),!a&&o.createElement(k.u,{containerStyle:{marginTop:40},disabled:!(null!==r&&void 0!==r&&r.content),onPress:()=>n(null===r||void 0===r?void 0:r.content,t),document:i}))};var R=n(78554),L=n(5438),M=n(96157),O=n(23049),z=n(52993),j=n(37854),W=n(38767);const V=(0,o.forwardRef)(((e,t)=>{let{style:n,onFocus:r,onBlur:a,error:l,siblingProps:i,onChangeText:s,toRemoveRegex:c,highlight:d,mandatory:u,...m}=e;
1const{inputBackgroundColor:p}=(0,j._)(),[g,h]=o.useState(l),{onBlur:v,onFocus:y,focused:b,error:f}=(0,z.Lx)(g),{value:E,validateInput:C}=m,[A,S]=(0,o.useState)(!1),w=(0,z.A8)({validateInput:C,onInputBlur:a,setError:h,toRemoveRegex:c}),P=(0,z.Gz)({validateInput:C,onChangeText:s,setError:h,toRemoveRegex:c}),I=(0,o.useMemo)((()=>!!E&&(!C||!C(E))),[E,C]);return(0,o.useEffect)((()=>{A&&P&&P(E||"")}),[A,I,P,E]),(0,o.useEffect)((()=>{g&&S(!0)}),[g]),o.createElement(B.Vu,{style:[{borderTopWidth:0,borderLeftWidth:0,borderRightWidth:0,borderBottomWidth:1,borderBottomColor:"rgba(200, 200, 200, 1)",outline:0,borderRadius:0},n,d?{borderColor:"#DD4A2C"}:{}],error:f},o.createElement(B.Sm,Object.assign({underlineColor:"transparent",onFocus:()=>{r&&r(),y()},onBlur:e=>{w(e.nativeEvent.text),v(),S(!0)},focused:b,inputOuterStyle:(0,W.composeStyle)(p,{flex:1}),theme:{roundness:4},dense:!0,sibling:(void 0===m.editable||m.editable||m.showClearIcon)&&o.createElement(B.zC,{value:E,disabled:m.disabled,onChangeText:s}),InputContainer:B.A0,error:f,paddingBottom:13},m,{ref:t,onChangeText:P,style:{textAlign:"center",...m.textStyle}})))})),H=((0,z.L4)(V),e=>{let{secureTextEntry:t,setSecureTextEntry:n,onChangeText:a,value:l,disabled:i,editable:s=!0}=e;const{colors:{primary:c}}=(0,r.DP)();return s?o.createElement(o.Fragment,null,o.createElement(O.Ay,{name:t?"eye-off":"eye",size:20,style:{marginRight:10},onPress:()=>n(!t),color:c}),o.createElement(B.zC,{onChangeText:a,disabled:i,value:l})):null}),U=(0,o.forwardRef)(((e,t)=>{let{style:n,inputMask:r="",maskOptions:a,inputLength:l=11,nativeProps:i,onChangeText:s,error:c,toRemoveRegex:d,...u}=e;const[m,p]=o.useState(c),{value:g,validateInput:h,setInvalid:v}=u,[y,b]=(0,o.useState)(!0),[f,E]=(0,o.useState)(!(g||!r)&&r),C=(0,o.useMemo)((()=>e=>{e.includes("*")&&(s(e.replace("*","")),E(null!==r&&void 0!==r&&r)),e&&!f&&E(r)}),[s,E,r,f]);(0,o.useEffect)((()=>{v&&v(!!m)}),[m,v]);const A=(0,z.Gz)({validateInput:h,onChangeText:s,setError:p,handleMaskedStringChange:C,toRemoveRegex:d}),S=o.createElement(H,{onChangeText:A,secureTextEntry:y,disabled:u.disabled,editable:u.editable||!0,value:g,setSecureTextEntry:b});return o.createElement(V,Object.assign({style:n,maskOptions:a,secureTextEntry:y,sibling:S,error:m,inputMask:f||new Array(l).join("*"),ref:t},u,{onChangeText:A}))})),G=(0,L.PA)((e=>{let{onValue:t,currentData:n,placeHolder:r,inputMask:a,maskType:l,maskedInputProps:i,save:s,children:c,nativeProps:d,errorText:u,personalValue:m,validate:p,identifier:g,textBeforeButton:h,data:v,document:y,required:b,keyboardType:f}=e;const[E,C]=(0,o.useState)((null===n||void 0===n?void 0:n.content)||m||v||""),[A,S]=(0,o.useState)(!1),w=c||(a||l?o.createElement(U,Object.assign({placeholder:r,style:{marginTop:0,paddingTop:0,textAlign:"center"},value:E,maskType:l,error:u,inputMask:a,onChangeText:C,setInvalid:S,validateInput:p?e=>!e||e&&9===e.length?"":"Invalid":null,keyboardType:f},i)):o.createElement(B.Sm,{placeholder:r,nativeProps:d,style:{marginTop:0,paddingTop:0,textAlign:"center",backgroundColor:"#FFF"},value:E,error:u,onChangeText:C,innerBorderStyle:{border:"none",borderBottom:"1px solid rgb(155, 174, 188)",outline:0,paddingBottom:20},keyboardType:f}));return o.createElement(o.Fragment,null,o.createElement(M.b,{style:{}},w,o.createElement(R.A,{type:"error",visible:!!u},u||" ")),h,o.createElement(k.u,{containerStyle:{marginTop:40},disabled:b&&!E||A,onPress:()=>t(E,g),save:s,document:y}))}));n(8922);var Y=n(68215),Q=n(70918);const q=(0,o.memo)((e=>{let t,n,{isCompleted:r,shouldHideLine:a,status:l}=e;return r?(t=K.completedCircle,n=K.completedVertical):[Q.mu.PASTDUE,Q.mu.LATE].includes(l)?t=K.pastDue:l===Q.mu.PROCESSING&&(t=K.processing),o.createElement(h.A,{style:{alignItems:"center"}},o.createElement(h.A,{style:(0,W.composeStyle)(K.circleStyles,t)}),!a&&o.createElement(h.A,{style:(0,W.composeStyle)(K.verticalLineStyles,n)}))})),K=g.A.create({circleStyles:{width:10,height:10,borderRadius:5,borderWidth:2,backgroundColor:Y.commonColors.backgroundLight,borderColor:Y.commonColors.borderLight},verticalLineStyles:{flex:1,borderLeftWidth:2,borderLeftColor:Y.commonColors.borderLight,borderLeftStyle:"dashed"},completedCircle:{backgroundColor:Y.commonColors.accentText,borderColor:Y.commonColors.accentText},completedVertical:{borderLeftColor:Y.commonColors.accentText,borderLeftStyle:"solid"},pastDue:{borderColor:"#DB081C"},processing:{borderColor:Y.commonColors.accentText}});var J=n(67956),Z=n(47822),X=n(35118),$=n(43094);let ee=function(e){return e.TRADE_CREDIT="tradeCredit",e.IHC_INVOICE="ihcInvoice",e}({});const{CURRENT:te}=Q.Mu,{LATE_FEE:ne,EXTENSION_FEE:oe,MANUAL_LATE_FEE:re,PENALTY_INTEREST_FEE:ae,LOAN_FEE:le}=Q.y9,ie="#DB2424",se="#19262F",ce="rgba(25, 38, 47, 0.3)",de=e=>{let{status:t,context:n}=e;const{t:r}=(0,d.Bd)(n===ee.TRADE_CREDIT?"tradeCredit":"global"),a=((e,t)=>e===ee.TRADE_CREDIT?{[Q.mu.PAID]:t("tradeCredit.drawDetails.details.paymentSchedule.paid-caption"),[Q.mu.PROCESSING]:t("tradeCredit.drawDetails.details.paymentSchedule.processing-caption"),[Q.mu.PENDING]:t("tradeCredit.drawDetails.details.paymentSchedule.due-caption"),[Q.mu.RESCHEDULED]:t("tradeCredit.drawDetails.details.paymentSchedule.rescheduled-caption"),[Q.mu.DUENEXT]:t("tradeCredit.drawDetails.details.paymentSchedule.due-caption"),[Q.mu.PASTDUE]:t("tradeCredit.drawDetails.details.paymentSchedule.past-due-caption"),[Q.mu.LATE]:t("tradeCredit.drawDetails.details.paymentSchedule.past-due-caption"),[Q.mu.FAILED]:t("tradeCredit.drawDetails.details.paymentSchedule.past-due-caption")}:{[Q.mu.PAID]:t("PaymentHistoryInvoice.paymentSchedule.paid"),[Q.mu.PROCESSING]:t("PaymentHistoryInvoice.paymentSchedule.processing"),[Q.mu.PENDING]:t("PaymentHistoryInvoice.paymentSchedule.due"),[Q.mu.RESCHEDULED]:t("PaymentHistoryInvoice.paymentSchedule.rescheduled"),[Q.mu.DUENEXT]:t("PaymentHistoryInvoice.paymentSchedule.due"),[Q.mu.PASTDUE]:t("PaymentHistoryInvoice.paymentSchedule.due"),[Q.mu.LATE]:t("PaymentHistoryInvoice.paymentSchedule.due"),[Q.mu.FAILED]:t("PaymentHistoryInvoice.paymentSchedule.due")}
1)(n,r),i=[Q.mu.PASTDUE,Q.mu.FAILED,Q.mu.LATE].includes(t)?ie:se,s=a[t];return o.createElement(l.A,{style:{fontWeight:s===a[Q.mu.PAID]?"500":"400",color:i,lineHeight:24,fontFamily:"Inter"}},s)},ue=e=>{let{date:t,scheduleStatus:n}=e;const r=n!==te?ce:se;return o.createElement(l.A,{style:(0,W.composeStyle)(ve.date,{color:r})},(0,J.jr)(t))},me=e=>{let{status:t,expectedAmount:n,context:r}=e;const a=(0,o.useMemo)((()=>{let e=se;return[Q.mu.LATE,Q.mu.PASTDUE].includes(t)?e=ie:t===Q.mu.RESCHEDULED&&(e=ce),e}),[t]),i=r===ee.TRADE_CREDIT?"$".concat((0,X.f)((0,Z.a)(n))):(0,J.Wl)(n);return o.createElement(l.A,{style:(0,W.composeStyle)(ve.amount,{color:a})},i)},pe=e=>{let{status:t}=e;const{t:n}=(0,d.Bd)("global");return t===Q.mu.PROCESSING?o.createElement(h.A,{style:{marginLeft:5,marginTop:3}},o.createElement($.V,{tooltip:n("ViewLoan.processing-info"),tooltipPosition:v.PopoverPlacements.RIGHT})):null},ge=e=>{let{status:t,type:n,context:r,isFee:a}=e;const{t:i}=(0,d.Bd)(r===ee.TRADE_CREDIT?"tradeCredit":"global"),s=(0,o.useMemo)((()=>{if(t===Q.mu.RESCHEDULED)return ce;return[Q.mu.LATE,Q.mu.PASTDUE,Q.mu.FAILED].includes(t)||a&&n!==le?ie:se}),[t,a,n]),c=(0,o.useMemo)((()=>a?r===ee.IHC_INVOICE&&n===le?i("PaymentHistoryInvoice.paymentSchedule.customerFee"):Q.rN[n]:r===ee.TRADE_CREDIT?i("tradeCredit.drawDetails.details.paymentSchedule.principalPayment"):i("PaymentHistoryInvoice.paymentSchedule.principalPayment")),[a,r,n,i]);return o.createElement(l.A,{style:(0,W.composeStyle)(ve.paymentType,{color:s})},c)},he=e=>{let{installment:t,isLastPayment:n,context:r}=e;const{t:a}=(0,d.Bd)("global"),{type:i,scheduleStatus:s,status:c,expectedDate:u,expectedAmount:m,processingAmount:p,processingDate:g,paidAmount:v,paidDate:y}=t,b=c===Q.mu.PAID,f=[ne,oe,re,ae,le].includes(i),E=(0,o.useMemo)((()=>s!==te?Q.mu.RESCHEDULED:![Q.mu.PASTDUE,Q.mu.FAILED,Q.mu.LATE].includes(c)&&s===te&&!v&&!p&&new Date(u).getTime()+432e6>=(new Date).getTime()?Q.mu.DUENEXT:![Q.mu.PROCESSING,Q.mu.PENDING,Q.mu.LATE].includes(c)||(0,Z.a)(m-p)&&(0,Z.a)(m-(p+v))?c:Q.mu.PROCESSING),[s,c,p,v,m,u]),C=(0,o.useMemo)((()=>[Q.mu.LATE,Q.mu.PASTDUE,Q.mu.PROCESSING,Q.mu.PENDING].includes(E)&&m-p&&p),[p,m,E]),A=(0,o.useMemo)((()=>[Q.mu.LATE,Q.mu.PASTDUE,Q.mu.PROCESSING,Q.mu.PENDING].includes(E)&&m-v&&v),[v,m,E]);return o.createElement(h.A,{style:{flexDirection:"row"}},o.createElement(q,{isCompleted:b,shouldHideLine:n,status:E}),o.createElement(h.A,{style:{flex:1,paddingLeft:15,paddingBottom:35,flexDirection:"row",marginTop:-6,justifyContent:"space-between"}},o.createElement(h.A,{style:{flex:1,marginRight:10}},o.createElement(ue,{date:u,scheduleStatus:s})," ",o.createElement(h.A,{style:{flexDirection:"row",alignItems:"center"}},o.createElement(de,{status:E,context:r}),o.createElement(pe,{status:E})),!!C&&o.createElement(l.A,{style:(0,W.composeStyle)(ve.processing,{marginTop:5})},a("LoanSchedule.processing-caption",{amount:(0,J.Wl)(null!==p&&void 0!==p?p:0),partialAmountCoveredOn:(0,J.jr)(null!==g&&void 0!==g?g:new Date)})),!!A&&o.createElement(l.A,{style:ve.processing},a("LoanSchedule.paid-off-caption",{amount:(0,J.Wl)(v),partialAmountCoveredOn:(0,J.jr)(y)}))),o.createElement(h.A,{style:{marginTop:-3,minWidth:100}},o.createElement(me,{status:E,expectedAmount:m,context:r}),o.createElement(ge,{type:i,status:E,context:r,isFee:f}))))},ve=g.A.create({paymentType:{fontWeight:"400",lineHeight:24,fontFamily:"Inter",color:ie,textAlign:"right",marginTop:-1},date:{fontWeight:"700",lineHeight:24,marginBottom:5,fontFamily:"Inter"},amount:{fontWeight:"700",textAlign:"right",lineHeight:24,marginBottom:8,fontFamily:"Inter"},processing:{fontWeight:"500",fontFamily:"Inter",fontSize:12,lineHeight:16,color:"rgba(25, 38, 47, 0.7)"}})},93894:(e,t,n)=>{"use strict";n.d(t,{X:()=>y});var o=n(50016),r=n(7371),a=n(4419),l=n(38405),i=n(38767),s=n(98690),c=n(17171),d=n(97976),u=n(58876),m=n(20282),p=n(10972),g=n(61289),h=n(67869);const v=e=>e?80:54,y=e=>{var t,n;let{onClose:l,disableHomeLink:y}=e;const{sm:f}=(0,c.Qs)(),{branding:E,userStore:C}=d.A,A=!(null===(t=C.company)||void 0===t||null===(n=t.roles)||void 0===n?void 0:n.includes(u.Sy.Lender))&&E,S=!y&&C.isAuthenticated&&!!g.navigationRef.current,w=()=>(0,g.navigate)(h.f0.Home._self);return A?o.createElement(r.A,{style:(0,i.composeStyle)({flexDirection:"row",width:"100%",height:v(f),backgroundColor:"white",justifyContent:"space-between",alignItems:"center",paddingVertical:16,paddingHorizontal:40,marginBottom:2,borderColor:"#E6EBEE",borderWidth:1},!f&&{paddingVertical:13,paddingHorizontal:16}),testID:"whitelabelHeader"},o.createElement(b,{enabled:S,onPress:w,testID:"coBrandingLogoHome"},o.createElement(a.A,{source:{uri:null===E||void 0===E?void 0:E.logoUrl},style:{width:f?151:83,height:f?47:26},resizeMode:"contain"})),o.createElement(r.A,{style:{flexDirection:"row",alignItems:"center"}},o.createElement(b,{enabled:S,onPress:w,testID:"poweredByHome"},o.createElement(s._,null)),l&&o.createElement(o.Fragment,null,o.createElement(m.hK,{width:16}),o.createElement(p.$,{type:"close",onClick:l,"data-testid":"coBrandingClose"})))):null},b=e=>{let{enabled:t,onPress:n,testID:r,children:a}=e;return t?o.createElement(l.A,{onPress:n,accessibilityRole:"link",testID:r},a):o.createElement(o.Fragment,null,a)}},98690:(e,t,n)=>{"use strict";n.d(t,{_:()=>m});var o=n(50016),r=n(38117),a=n(7371),l=n(78267),i=n(29731),s=n(38767),c=n(20282),d=n(17171),u=n(97076);const m=()=>{const{sm:e}=(0,d.Qs)(),{t:t}=(0,i.Bd)("auth");return o.createElement(a.A,{style:p.viewLeft,testID:"poweredByBluetape"}
1,o.createElement(r.A,{style:(0,s.composeStyle)(p.poweredBy,!e&&p.poweredByMobile)},t("poweredBy")),o.createElement(c.hK,{height:e?5:2}),o.createElement(u.gkA,{width:e?165:95,height:e?21:12}))},p=l.A.create({viewLeft:{alignItems:"flex-end"},poweredBy:{fontWeight:"400",fontSize:16,lineHeight:19,color:"#003353"},poweredByMobile:{fontSize:9,lineHeight:10}})},10272:(e,t,n)=>{"use strict";n.d(t,{B:()=>o});const o={text:{black:"#001929",grey300:"#CCD6DD",grey400:"#99ADBA",grey500:"#758590",grey600:"#394D5A",grey700:"#19262F",mainSecondary:"#003353"},primary:{charcoal:"#3E4756"},gray:{dark1:"#668598"},elements:{black:"#001929FF",grey200:"#DEE5EB",grey300:"#CCD6DD"},background:{grey100:"#F8F9F9",grey200:"#F5F7F8",red100:"#FFF2F4",blue100:"#EFF8FE"},border:{blue100:"#CCE8FC",red100:"#FED7D7"},service:{green:"#0EC06B",red100c:"#EC002A",red000:"#FFF2F4",orange:"#FF7926"},blue:{blue100:"#F4F9FD",blue400:"#00A0F3"},caption:{grey500:"#335C75"}}},98593:(e,t,n)=>{"use strict";n.d(t,{Ms:()=>u,RM:()=>m,on:()=>d});var o=n(82997),r=n(89240),a=n(67976),l=n(71877),i=n.n(l),s=n(97976),c=n(67869);const d={accept:["application/pdf","application/msword","image/*","application/zip"],maxFiles:1,maxSize:52428800,multiple:!1},u=(e,t,n)=>{o.JZ.NJ.upload(t.map((e=>e.name))).then((e=>{let{results:n}=e;s.A.setBusy(!0);let o=[];for(let r of t){let e=n.find((e=>(console.log(e.file,r.name),e.file===r.name)));if(e.url){let t=i().create({url:e.url,method:"PUT",data:r});o.push(t.put(e.url,r).then((t=>200===t.status?e:{result:"failed"})))}}return Promise.all(o)})).then((t=>{"ok"===t[0].result&&r.A.set("invoice_document",t[0]).then((()=>{n?n():e.navigate(c.f0.Console.Payables._self,{screen:c.f0.Console.Payables.InvoiceForm})}))})).finally((()=>s.A.setBusy(!1)))},m=(e,t)=>{e.forEach((e=>{let{file:n,errors:o}=e;o.forEach((e=>{"file-too-large"===e.code?t(a.$z.ERROR,"The file size should be less than 10 megabite"):t(a.$z.ERROR,e.message)}))}))}},35118:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});var o=n(21786),r=n.n(o);const a=e=>r()(e).format({thousandSeparated:!0,mantissa:2})},25128:(e,t,n)=>{"use strict";n.d(t,{dk:()=>p,Yx:()=>c,HE:()=>v,pq:()=>g,Zl:()=>u,XW:()=>d,Sw:()=>h});var o=n(92431),r=n(35584);const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,o.X)(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;return e.map((e=>({value:e,label:t[e]||e}))).sort(((e,t)=>{let{label:n}=e,{label:o}=t;return n<o?-1:n>o?1:0}))};a();var l=n(78542);a().map((e=>({...e,countryCode:e.value,value:"+".concat((0,l.K)(e.value))})));n(3404);var i=n(16148),s=n(40046);const c=e=>{i.HZ?window.open(e):s.A.openURL(e)},d=e=>void 0!==e&&Object.keys(e).some((e=>e.startsWith("utm"))),u=e=>Object.keys(e).filter((e=>e.startsWith("utm"))).reduce(((t,n)=>({...t,[n]:e[n]})),{});var m=n(82997);const p=async e=>await m.JZ.Zm.user({search:e,limit:10});n(74161);function g(e,t){const n=Object.entries(e).filter((e=>{let[n,o]=e;return o===t}));return n.length?n[0][0]:""}function h(e){try{document.title=e?"BlueTape - ".concat(e):"BlueTape"}catch(t){}}function v(e){return e?"BlueTape - ".concat(e):"BlueTape"}},48328:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var o=n(82997),r=n(58876);class a{static downloadCustomerAgreement(){o.Vv.NJ.staticDocument({document:r.y7.CustomerAgreement}).then((e=>{let{url:t}=e;return window.open(t,"_blank")}))}static downloadWiringInstructions(){o.Vv.NJ.staticDocument({document:r.y7.WiringInstructions}).then((e=>{let{url:t}=e;return window.open(t,"_blank")}))}static downloadMasterAgreementWithJwt(e){o.JZ.bc.publicMasterAgreement(e).then((e=>{let{url:t}=e;return window.open(t,"_blank")}))}static downloadPersonalGuarantorAgreementWithJwt(e){o.JZ.bc.publicPersonalGuarantorAgreement(e).then((e=>{let{url:t}=e;return window.open(t,"_blank")}))}static downloadSellerAgreementWithJwt(e){o.JZ.bc.publicSellerAgreement(e).then((e=>{let{url:t}=e;return window.open(t,"_blank")}))}static downloadInvoicePurchaseAgreementWithJwt(e){o.JZ.bc.publicInvoicePurchaseAgreement(e).then((e=>{let{url:t}=e;return window.open(t,"_blank")}))}static downloadSellerAgreement(){o.JZ.Zm.downloadSellerAgreement().then((e=>{let{url:t}=e;return window.open(t,"_blank")}))}static downloadInvoicePurchaseAgreement(){o.JZ.Zm.downloadInvoicePurchaseAgreement().then((e=>{let{url:t}=e;return window.open(t,"_blank")}))}static downloadGuarantySecuredAgreement(){o.JZ.Zm.downloadGuarantySecuredAgreement().then((e=>{let{url:t}=e;return window.open(t,"_blank")}))}static previewSellerAgreement(){o.JZ.Zm.previewSellerAgreement().then((e=>{let{url:t}=e;return window.open(t,"_blank")}))}}},67956:(e,t,n)=>{"use strict";n.d(t,{Rr:()=>c,Uq:()=>d,Wl:()=>m,jr:()=>p,q6:()=>u});var o=n(97585),r=n(37525),a=n(74161),l=n.n(a),i=n(21786),s=n.n(i);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",{silent:t,defaultCountry:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{silent:!0,defaultCountry:"US"},o=e;if("number"===typeof e&&(o=e.toString()),o.length<10){if(!t)throw new Error("Invalid Phone Number.");return o}return(0,r.l)(o,n).formatNational()},d=e=>o.sz.toMask("custom",e||"",{mask:"+1 (999) 999-9999"}),u=e=>o.sz.toMask("custom",(null===e||void 0===e?void 0:e.substring(2))||"",{mask:"(999) 999-9999"}),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n="string"===typeof e?e.replace(/[^-\d.]/g,""):e;return n||(n=t),s()(n).formatCurrency({thousandSeparated:!0,mantissa:2})}
1,p=e=>l()(e).format("MM/DD/YYYY")},25606:(e,t,n)=>{"use strict";n.d(t,{L:()=>a});var o=n(21786),r=n.n(o);const a=e=>Number(r()(e).format({mantissa:2}))},60705:(e,t,n)=>{"use strict";n.d(t,{E:()=>a});var o=n(71877),r=n.n(o);const a=(e,t)=>{let{url:n,fields:o}=e;const a=new FormData;return Object.entries(o).forEach((e=>{let[t,n]=e;return a.append(t,n)})),a.append("file",t),r().create().post(n,a)}},17171:(e,t,n)=>{"use strict";n.d(t,{X6:()=>m.X6,A3:()=>P,S3:()=>u,Qs:()=>m.Qs,ui:()=>S,R_:()=>C,Fb:()=>g});n(52993);var o=n(50016);n(95090);var r=n(78267),a=(n(29731),n(38542));n(82997),n(97076),n(20282),n(23049),n(18394),n(71877);const{commonColors:l}=a.theme,{composeStyle:i}=a.helpers;r.A.create({dropzone:{marginBottom:16,height:70,flexDirection:"row",justifyContent:"center",alignItems:"center",borderColor:"#9BAEBC",borderWidth:1,borderRadius:4,borderStyle:"dashed"},wrapper:{paddingVertical:16,paddingHorizontal:24,borderColor:"#9BAEBC",borderWidth:1,borderRadius:4,flexDirection:"column"},label:{color:l.primary,fontSize:16,fontWeight:"500",lineHeight:24}});var s=n(10237),c=n(75707),d=n(69991);function u(e,t){const n=(0,o.useMemo)((()=>(0,s.r)(e,"US")),[e]),r=(0,o.useRef)(n);(0,o.useLayoutEffect)((()=>{r.current=n}),[n]);const a=(0,o.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=e?(0,c.A)(e):"";if(n){const t=(0,s.r)(n,"US"),o=r.current;t===o&&o.startsWith(e)&&e.length<o.length&&(n=n.substr(0,n.length-1))}t(n)}),[r,t]);return[n,a,(0,d.F)(n,"US")]}var m=n(44814);const{composeResponsiveStyles:p}=a.helpers;function g(e){return function(t){let{style:n,xs:r,sm:a,md:l,lg:i,xl:s,landscape:c,...d}=t;const u=(0,m.Qs)(),g=(0,o.useMemo)((()=>p(n,{xs:r,sm:a,md:l,lg:i,xl:s},null!==c&&void 0!==c?c:{},u)),[u,c,i,l,a,n,s,r]);return o.createElement(e,Object.assign({style:g},d))}}const{breakpoints:h}=a.theme;var v=n(82345),y=n(27232),b=n(67869),f=n(4287),E=n(54763);const C=()=>{const e=(0,v.useNavigation)(),t=(0,v.useRoute)(),n=(0,y.II)();return{addAccount:()=>{t.name!==b.f0.Console.customers._self&&e.navigate(b.f0.Console.customers._self,{screen:b.f0.Console.customers.home._self}),(0,E.Y)()},addInvoice:()=>{const{Receivables:o}=b.f0.Console;t.name===o._self&&"invoice"===n.type||(t.name===o._self?e.navigate(o.ReceivableList.Invoices):t.name!==b.f0.Console.ArAdvanceInvoices._self&&e.navigate(o._self,{screen:o.ReceivableList._self,params:{screen:o.ReceivableList.Invoices}})),(0,f.d)()}}};var A=n(48321);const S=()=>{const[e,t]=(0,o.useState)(""),{onSearchListing:n}=A.Ay;return(0,o.useEffect)((()=>{const t=setTimeout((()=>{n(e)}),900);return()=>clearTimeout(t)}),[e]),{searchText:e,setSearchText:t}};var w=n(38325);function P(){const[e,t]=(0,o.useState)(!1),[n,r]=(0,o.useState)(null);return{isUploading:e,error:n,pickAndUploadFile:(0,o.useCallback)((async(e,n,o)=>{t(!0),r(null);try{"web"===w.A.OS?await async function(e,t,n){return new Promise(((e,o)=>{const r=document.createElement("input");r.type="file",r.accept=".pdf,.doc,.docx,.jpg,.jpeg,.png",r.multiple=!1;let a=!1,l=!1,i=!1,s=null;const c=()=>{s&&(clearTimeout(s),s=null),window.removeEventListener("focus",u),document.removeEventListener("visibilitychange",m)},d=()=>{a||l||!i||(a=!0,c(),o(new Error("File selection cancelled")))},u=()=>{i&&(s=setTimeout(d,500))},m=()=>{!document.hidden&&i&&(s=setTimeout(d,500))};r.onchange=async r=>{var i;if(a)return;l=!0;const s=null===(i=r.target.files)||void 0===i?void 0:i[0];if(!s)return a=!0,c(),void o(new Error("No file selected"));const d=26214400;if(s.size>d)return a=!0,c(),void o(new Error("File size must be less than 25MB"));if(!function(e,t){return["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","image/jpeg","image/jpg","image/png"].includes(e.type)}(s))return a=!0,c(),void o(new Error("Invalid file type"));if(n&&n.includes(s.name))return a=!0,c(),void o(new Error('File with name "'.concat(s.name,'" already exists. Please choose another file and try again.')));try{await t(s),a=!0,c(),e()}catch(u){a=!0,c(),o(u)}},window.addEventListener("focus",u),document.addEventListener("visibilitychange",m),setTimeout((()=>{i=!0}),100),r.click()}))}(0,n,o):await async function(e,t,n){throw new Error("Mobile file picker not implemented yet")}()}catch(a){const e=a instanceof Error?a.message:"Upload failed";r(e),console.error("Document upload error:",a)}finally{t(!1)}}),[])}}}
1,44814:(e,t,n)=>{"use strict";n.d(t,{Qs:()=>c,X6:()=>u});var o=n(50016),r=n(59243),a=n(38542);const{breakpoints:l}=a.theme,i=e=>{let{width:t,height:n}=e;return{portrait:t<=n,landscape:t>n,xs:!0,sm:t>=l.sm,md:t>=l.md,lg:t>=l.lg,xl:t>=l.xl,screenWidth:t,screenHeight:n,mobileWidth:t<300?t:t>450?450:t}},s=(e,t)=>{const n=i(t);return Object.keys(n).some((t=>e[t]!==n[t]))?n:e};function c(){const[e,t]=(0,o.useReducer)(s,i(r.A.get("window"))),n=(0,o.useCallback)((()=>t(r.A.get("window"))),[]);return(0,o.useEffect)((()=>{const e=r.A.addEventListener("change",n);return()=>null===e||void 0===e?void 0:e.remove()}),[n]),e}const d=r.A.get("window").width/375;function u(e){return d<1?d*e:e}},12162:(e,t,n)=>{"use strict";n.d(t,{G:()=>a});let o=function(e){return e.Off="off",e.Everyone="everyOne",e.SelectedCustomers="selectedCustomers",e}({});function r(e){return!!e&&e!==o.Off}class a{static canExtendIhcInvoice(e,t){return function(e,t){var n,o,a,l;return r(null===t||void 0===t||null===(n=t.arAdvance)||void 0===n||null===(o=n.extension)||void 0===o?void 0:o.enabledFor)&&!0===(null===e||void 0===e||null===(a=e.inHouseCredit)||void 0===a||null===(l=a.extension)||void 0===l?void 0:l.isEnabled)}(e,t)}static canExtendRegularInvoice(e,t){return function(e,t){var n,o;return r(null===t||void 0===t||null===(n=t.extension)||void 0===n?void 0:n.enabledFor)&&!0===(null===e||void 0===e||null===(o=e.extension)||void 0===o?void 0:o.isEnabled)}(e,t)}}},3404:(e,t,n)=>{"use strict";n.d(t,{vV:()=>r,PC:()=>o});Object.freeze({xs:Symbol("xs"),sm:Symbol("sm"),md:Symbol("md"),lg:Symbol("lg"),xl:Symbol("xl")});const o={create:"create",view:"view",edit:"edit",delete:"delete",addContact:"addContact",addSalesRep:"addSalesRep"},r={cancel:"cancel"};Object.freeze({none:Symbol("none"),forward:Symbol("forward"),backward:Symbol("backward")})},8289:(e,t,n)=>{"use strict";n.d(t,{i_:()=>i,JK:()=>a,o$:()=>s});var o=n(50016),r=n(63680);function a(e){let{Component:t,valuePropertyName:n="value",changePropertyName:a="onChange",changeOverride:l=null}=e;const i=(0,r.PA)((function(e){let{model:r,name:i,converter:s,forwardRef:c,store:d,[n]:u,[a]:m,...p}=e;const g=e=>{e&&s&&s.to&&(e=s.to(e)),r&&r.setValue&&r.setValue(i,e),m&&m(e)};return r&&(u=r[i],s&&s.from&&(u=s.from(u))),p[n]=u,p[a]=l?l(e,g):g,o.createElement(t,Object.assign({},p,{ref:c}))}));i.displayName="Editable(".concat(t.displayName||t.name,")");const s=(e,t)=>o.createElement(i,Object.assign({},e,{forwardRef:t}));return o.forwardRef(s)}var l=n(78267);const i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.A.flatten([t])},s=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g},19925:(e,t,n)=>{"use strict";n.d(t,{d7:()=>E,Lx:()=>C,Gz:()=>r,A8:()=>a,Qs:()=>f,DP:()=>h,L4:()=>m});var o=n(50016);const r=e=>{let{validateInput:t,validateInputOnBlur:n=!1,onChangeText:r,setError:a,handleMaskedStringChange:l,toRemoveRegex:i=""}=e;return(0,o.useMemo)((()=>{const e=e=>(e||"").replace(new RegExp(i,"g"),"");return t?o=>{const i=e(o);r&&r(i);const s=t(i);s?!n&&a(s):a(void 0),l&&l(i)}:l?t=>{const n=e(t);r&&r(n),l(n)}:r}),[t,r,a,l,i,n])},a=e=>{let{validateInput:t,validateInputOnBlur:n=!1,onInputBlur:r,setError:a,toRemoveRegex:l=""}=e;return(0,o.useMemo)((()=>t&&n?e=>{const n=e&&(e=>(e||"").replace(l,""))(e);r&&r(!0);const o=t(n);a(o||void 0)}:()=>r&&r(!0)),[t,r,a,n,l])};var l=n(8289),i=n(54075),s=n.n(i),c=n(94384),d=n.n(c);const u={to:e=>e,from:e=>s()(e)||d()(e)?"":e},m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"onChangeText";const n=(0,l.JK)({Component:e,changePropertyName:t});return o.forwardRef(((e,t)=>o.createElement(n,Object.assign({converter:u},e,{ref:t}))))};var p=n(14425),g=n(24038);function h(){const e=(0,p.useTheme)(),{theme:t,toggleTheme:n}=o.useContext(g.Dx);return{theme:t,toggleTheme:n,...e}}var v=n(59243);const y=e=>{let{width:t,height:n}=e;return{portrait:t<=n,landscape:t>n,xs:!0,sm:t>=g.fi.sm,md:t>=g.fi.md,lg:t>=g.fi.lg,xl:t>=g.fi.xl,screenWidth:t,screenHeight:n,mobileWidth:t<300?t:t>450?450:t}},b=(e,t)=>{const n=y(t);return Object.keys(n).some((t=>e[t]!==n[t]))?n:e};function f(){const[e,t]=(0,o.useReducer)(b,y(v.A.get("window"))),n=(0,o.useCallback)((()=>t(v.A.get("window"))),[]);return(0,o.useEffect)((()=>{const e=v.A.addEventListener("change",n);return()=>null===e||void 0===e?void 0:e.remove()}),[n]),e}v.A.get("window").width;function E(e,t){const[n,r]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const n=setTimeout((()=>{r(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),n}const C=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t,n,r,a]=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const[r,a]=(0,o.useState)(n);return[r,()=>a(e),()=>a(t),a]}();return{focused:t,onFocus:n,onBlur:r,error:!t&&e,setFocus:a}}}
1,24038:(e,t,n)=>{"use strict";n.d(t,{Dx:()=>a,fi:()=>o,Tj:()=>r,customTheme:()=>s,evaMapping:()=>c,r7:()=>l});const o={xs:0,sm:576,md:768,lg:992,xl:1200},r={primary:"#2F4858",accent:"#DD4A2C",error:"#DD4A2C",logo:"#2F4858",logoAccent:"#DD4A2C",surface:"#FFFFFF",text:"#2F4858",warning:"#EB9928",success:"#00B396",background:"#F2F2F2",disabled:"#E9EDEE",backdrop:"#303030",highlighted:"#d0dcec",borderBottomColor:"#F7F7F7",placeholder:"#94A3AB",textInactive:"rgba(47,77,88, 0.7)",accentText:"#00A0F3",borderLight:"#9BAEBC",backgroundColor:"rgba(238,242,245,1)",textLight:"#668598",backgroundLight:"#F5F7F8",textDark:"#335C75",borderColor:"#E5E5E5",white:"white",secondaryDark:"#407899",secondaryLight:"#68B4DC",tertiaryLight:"#9BAEBC",darkWarning:"#FE8134"};const a=n(50016).createContext({theme:"light",toggleTheme:()=>{}}),l={shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.18,shadowRadius:1,elevation:1},i=JSON.parse('{"$schema":"./node_modules/@eva-design/dss/schema/schema.json","version":1,"strict":{"text-font-family":"System","text-heading-1-font-size":36,"text-heading-1-font-weight":"800","text-heading-1-font-family":"$text-font-family","text-heading-2-font-size":32,"text-heading-2-font-weight":"800","text-heading-2-font-family":"$text-font-family","text-heading-3-font-size":30,"text-heading-3-font-weight":"800","text-heading-3-font-family":"$text-font-family","text-heading-4-font-size":26,"text-heading-4-font-weight":"800","text-heading-4-font-family":"$text-font-family","text-heading-5-font-size":22,"text-heading-5-font-weight":"800","text-heading-5-font-family":"$text-font-family","text-heading-6-font-size":18,"text-heading-6-font-weight":"800","text-heading-6-font-family":"$text-font-family","text-subtitle-1-font-size":15,"text-subtitle-1-font-weight":"600","text-subtitle-1-font-family":"$text-font-family","text-subtitle-2-font-size":13,"text-subtitle-2-font-weight":"600","text-subtitle-2-font-family":"$text-font-family","text-paragraph-1-font-size":15,"text-paragraph-1-font-weight":"400","text-paragraph-1-font-family":"$text-font-family","text-paragraph-2-font-size":13,"text-paragraph-2-font-weight":"400","text-paragraph-2-font-family":"$text-font-family","text-caption-1-font-size":12,"text-caption-1-font-weight":"400","text-caption-1-font-family":"$text-font-family","text-caption-2-font-size":12,"text-caption-2-font-weight":"600","text-caption-2-font-family":"$text-font-family","text-label-font-size":12,"text-label-font-weight":"800","text-label-font-family":"$text-font-family","button-border-radius":8,"size-tiny":24,"size-small":36,"size-medium":40,"size-large":48,"size-giant":56,"border-radius":4,"border-width":1},"components":{"Avatar":{"meta":{"scope":"all","parameters":{"roundCoefficient":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"}},"appearances":{"default":{"default":true}},"variantGroups":{"shape":{"round":{"default":true},"rounded":{"default":false},"square":{"default":false}},"size":{"tiny":{"default":false},"small":{"default":false},"medium":{"default":true},"large":{"default":false},"giant":{"default":false}}},"states":{}},"appearances":{"default":{"mapping":{},"variantGroups":{"shape":{"round":{"roundCoefficient":0.5},"rounded":{"roundCoefficient":0.3},"square":{"roundCoefficient":0}},"size":{"tiny":{"width":"size-tiny","height":"size-tiny"},"small":{"width":"size-small","height":"size-small"},"medium":{"width":"size-medium","height":"size-medium"},"large":{"width":"size-large","height":"size-large"},"giant":{"width":"size-giant","height":"size-giant"}}}}}},"BottomNavigationTab":{"meta":{"scope":"mobile","parameters":{"paddingHorizontal":{"type":"number"},"paddingVertical":{"type":"number"},"iconMarginVertical":{"type":"number"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconTintColor":{"type":"string"},"textMarginVertical":{"type":"number"},"textColor":{"type":"string"},"textFontFamily":{"type":"string"},"textFontSize":{"type":"number"},"textFontWeight":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{},"states":{"selected":{"default":false,"priority":0,"scope":"mobile"},"hover":{"default":false,"priority":1,"scope":"mobile"}
1,"focused":{"default":false,"priority":2,"scope":"mobile"}}},"appearances":{"default":{"mapping":{"textMarginVertical":2,"textFontSize":"text-caption-2-font-size","textFontWeight":"text-caption-2-font-weight","textFontFamily":"text-caption-2-font-family","textColor":"text-hint-color","iconWidth":24,"iconHeight":24,"iconMarginVertical":2,"iconTintColor":"text-hint-color","state":{"hover":{"textColor":"text-primary-hover-color","iconTintColor":"text-primary-hover-color"},"selected":{"textColor":"text-primary-color","iconTintColor":"text-primary-color"}}}}}},"BottomNavigation":{"meta":{"scope":"mobile","parameters":{"minHeight":{"type":"number"},"paddingVertical":{"type":"number"},"backgroundColor":{"type":"string"},"borderTopColor":{"type":"string"},"borderTopWidth":{"type":"number"},"indicatorHeight":{"type":"number"},"indicatorBackgroundColor":{"type":"string"}},"appearances":{"default":{"default":true},"noIndicator":{"default":false}},"variantGroups":{},"states":{}},"appearances":{"default":{"mapping":{"minHeight":56,"paddingVertical":4,"backgroundColor":"background-basic-color-1","indicatorHeight":4,"indicatorBackgroundColor":"color-primary-default"}},"noIndicator":{"mapping":{"indicatorHeight":0,"indicatorBackgroundColor":"transparent"}}}},"Button":{"meta":{"scope":"all","parameters":{"minWidth":{"type":"number"},"minHeight":{"type":"number"},"paddingHorizontal":{"type":"number"},"paddingVertical":{"type":"number"},"borderRadius":{"type":"number"},"borderColor":{"type":"string"},"borderWidth":{"type":"number"},"backgroundColor":{"type":"string"},"textMarginHorizontal":{"type":"number"},"textFontFamily":{"type":"string"},"textFontSize":{"type":"number"},"textFontWeight":{"type":"string"},"textColor":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconTintColor":{"type":"string"},"iconMarginHorizontal":{"type":"number"}},"appearances":{"filled":{"default":true},"outline":{"default":false},"ghost":{"default":false}},"variantGroups":{"status":{"basic":{"default":false},"primary":{"default":true},"success":{"default":false},"info":{"default":false},"warning":{"default":false},"danger":{"default":false},"control":{"default":false}},"size":{"tiny":{"default":false},"small":{"default":false},"medium":{"default":true},"large":{"default":false},"giant":{"default":false}}},"states":{"hover":{"default":false,"priority":0,"scope":"all"},"disabled":{"default":false,"priority":1,"scope":"all"},"active":{"default":false,"priority":2,"scope":"all"},"focused":{"default":false,"priority":3,"scope":"mobile"}}},"appearances":{"filled":{"mapping":{"textFontFamily":"text-font-family","iconMarginHorizontal":4},"variantGroups":{"status":{"basic":{"borderColor":"color-basic-default-border","backgroundColor":"color-basic-default","textColor":"color-basic-800","iconTintColor":"color-basic-800","state":{"focused":{"borderColor":"color-basic-focus-border","backgroundColor":"color-basic-focus"},"hover":{"borderColor":"color-basic-hover-border","backgroundColor":"color-basic-hover"},"active":{"borderColor":"color-basic-active-border","backgroundColor":"color-basic-active"},"disabled":{"borderColor":"color-basic-disabled-border","backgroundColor":"color-basic-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"primary":{"borderColor":"color-primary-default-border","backgroundColor":"color-primary-default","textColor":"text-control-color","iconTintColor":"text-control-color","state":{"focused":{"borderColor":"color-primary-focus-border","backgroundColor":"color-primary-focus"},"hover":{"borderColor":"color-primary-hover-border","backgroundColor":"color-primary-hover"},"active":{"borderColor":"color-primary-active-border","backgroundColor":"color-primary-active"},"disabled":{"borderColor":"color-primary-disabled-border","backgroundColor":"color-primary-disabled","textColor":"text-primary-disabled-color","iconTintColor":"text-disabled-color"}}},"success":{"borderColor":"color-success-default-border","backgroundColor":"color-success-default","textColor":"text-control-color","iconTintColor":"text-control-color","state":{"focused":{"borderColor":"color-success-focus-border","backgroundColor":"color-success-focus"},"hover":{"borderColor":"color-success-hover-border","backgroundColor":"color-success-hover"},"active":{"borderColor":"color-success-active-border","backgroundColor":"color-success-active"},"disabled":{"borderColor":"color-success-disabled-border","backgroundColor":"color-success-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"info":{"borderColor":"color-info-default-border","backgroundColor":"color-info-default","textColor":"text-control-color","iconTintColor":"text-control-color","state":{"focused":{"borderColor":"color-info-focus-border","backgroundColor":"color-info-focus"},"hover":{"borderColor":"color-info-hover-border","backgroundColor":"color-info-hover"},"active":{"borderColor":"color-info-active-border","backgroundColor":"color-info-active"},"disabled":{"borderColor":"color-info-disabled-border","backgroundColor":"color-info-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"warning":{"borderColor":"color-warning-default-border","backgroundColor":"color-warning-default","textColor":"text-control-color","iconTintColor":"text-control-color","state":{"focused":{"borderColor":"color-warning-focus-border","backgroundColor":"color-warning-focus"},"hover":{"borderColor":"color-warning-hover-border","backgroundColor":"color-warning-hover"},"active":{"borderColor":"color-warning-active-border","backgroundColor":"color-warning-active"},"disabled":{"borderColor":"color-warning-disabled-border","backgroundColor":"color-warning-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"danger":{"borderColor":"color-danger-default-border","backgroundColor":"color-danger-default","textColor":"text-control-color","iconTintColor":"text-control-color","state":{"focused":{"borderColor":"color-danger-focus-border","backgroundColor":"color-danger-focus"},"hover":{"borderColor":"color-danger-hover-border","backgroundColor":"color-danger-hover"},"active":{"borderColor":"color-danger-active-border","backgroundColor":"color-danger-active"},"disabled":{"borderColor":"color-danger-disabled-border","backgroundColor":"color-danger-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"control":{"borderColor":"color-control-default-border","backgroundColor":"color-control-default","textColor":"color-basic-800","iconTintColor":"color-basic-800","state":{"focused":{"borderColor":"color-control-focus-border","backgroundColor":"color-control-focus"},"hover":{"borderColor":"color-control-hover-border","backgroundColor":"color-control-hover"},"active":{"borderColor":"color-control-active-border","backgroundColor":"color-control-active"},"disabled":{"borderColor":"color-control-disabled-border","backgroundColor":"color-control-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}}},"size":{"tiny":{"minWidth":"size-tiny","minHeight":"size-tiny","borderRadius":"button-border-radius","borderWidth":"border-width","paddingHorizontal":6,"paddingVertical":6,"textMarginHorizontal":6,"textFontSize":10,"textFontWeight":"bold","iconWidth":12,"iconHeight":12,"iconMarginHorizontal":6},"small":{"minWidth":"size-small","minHeight":"size-small","borderRadius":"button-border-radius","borderWidth":"border-width","paddingHorizontal":8,"paddingVertical":8,"textMarginHorizontal":8,"textFontSize":14,"textFontWeight":"bold","iconWidth":16,"iconHeight":16,"iconMarginHorizontal":8},"medium":{"minWidth":"size-medium","minHeight":"size-medium","borderRadius":"button-border-radius","borderWidth":"border-width","paddingHorizontal":10,"paddingVertical":12,"textMarginHorizontal":10,"textFontSize":14,"textFontWeight":"bold","iconWidth":20,"iconHeight":20,"iconMarginHorizontal":10},"large":{"minWidth":"size-large","minHeight":"size-large","borderRadius":"button-border-radius","borderWidth":"border-width","paddingHorizontal":10,"paddingVertical":14,"textMarginHorizontal":10,"textFontSize":16,"textFontWeight":"bold","iconWidth":24,"iconHeight":24,"iconMarginHorizontal":10},"giant":{"minWidth":"size-giant","minHeight":"size-giant","borderRadius":"button-border-radius","borderWidth":"border-width","paddingHorizontal":12,"paddingVertical":16,"textMarginHorizontal":12,"textFontSize":18,"textFontWeight":"bold","iconWidth":24,"iconHeight":24,"iconMarginHorizontal":12}}}},"outline":{"mapping":{},"variantGroups":{"status":{"basic":{"borderColor":"color-basic-transparent-default-border","backgroundColor":"color-basic-transparent-default","textColor":"text-hint-color","iconTintColor":"text-hint-color","state":{"focused":{"borderColor":"color-basic-transparent-focus-border","backgroundColor":"color-basic-transparent-focus","textColor":"text-hint-color","iconTintColor":"text-hint-color"},"hover":{"borderColor":"color-basic-transparent-hover-border","backgroundColor":"color-basic-transparent-hover","textColor":"text-hint-color","iconTintColor":"text-hint-color"},"active":{"borderColor":"color-basic-transparent-active-border","backgroundColor":"color-basic-transparent-active","textColor":"text-hint-color","iconTintColor":"text-hint-color"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"primary":{"borderColor":"color-primary-transparent-default-border","backgroundColor":"color-primary-transparent-default","textColor":"text-primary-color","iconTintColor":"text-primary-color","state":{"focused":{"borderColor":"color-primary-transparent-focus-border","backgroundColor":"color-primary-transparent-focus","textColor":"text-primary-color","iconTintColor":"text-primary-color"},"hover":{"borderColor":"color-primary-transparent-hover-border","backgroundColor":"color-primary-transparent-hover","textColor":"text-primary-color","iconTintColor":"text-primary-color"},"active":{"borderColor":"color-primary-transparent-active-border","backgroundColor":"color-primary-transparent-active","textColor":"text-primary-color","iconTintColor":"text-primary-color"},"disabled":{"borderColor":"color-primary-transparent-disabled-border","backgroundColor":"color-primary-transparent-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"success":{"borderColor":"color-success-transparent-default-border","backgroundColor":"color-success-transparent-default","textColor":"text-success-color","iconTintColor":"text-success-color","state":{"focused":{"borderColor":"color-success-transparent-focus-border","backgroundColor":"color-success-transparent-focus","textColor":"text-success-color","iconTintColor":"text-success-color"},"hover":{"borderColor":"color-success-transparent-hover-border","backgroundColor":"color-success-transparent-hover","textColor":"text-success-color","iconTintColor":"text-success-color"},"active":{"borderColor":"color-success-transparent-active-border","backgroundColor":"color-success-transparent-active","textColor":"text-success-color","iconTintColor":"text-success-color"},"disabled":{"borderColor":"color-success-transparent-disabled-border","backgroundColor":"color-success-transparent-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"info":{"borderColor":"color-info-transparent-default-border","backgroundColor":"color-info-transparent-default","textColor":"text-info-color","iconTintColor":"text-info-color","state":{"focused":{"borderColor":"color-info-transparent-focus-border","backgroundColor":"color-info-transparent-focus","textColor":"text-info-color","iconTintColor":"text-info-color"},"hover":{"borderColor":"color-info-transparent-hover-border","backgroundColor":"color-info-transparent-hover","textColor":"text-info-color","iconTintColor":"text-info-color"},"active":{"borderColor":"color-info-transparent-active-border","backgroundColor":"color-info-transparent-active","textColor":"text-info-color","iconTintColor":"text-info-color"},"disabled":{"borderColor":"color-info-transparent-disabled-border","backgroundColor":"color-info-transparent-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"warning":{"borderColor":"color-warning-transparent-default-border","backgroundColor":"color-warning-transparent-default","textColor":"text-warning-color","iconTintColor":"text-warning-color","state":{"focused":{"borderColor":"color-warning-transparent-focus-border","backgroundColor":"color-warning-transparent-focus","textColor":"text-warning-color","iconTintColor":"text-warning-color"},"hover":{"borderColor":"color-warning-transparent-hover-border","backgroundColor":"color-warning-transparent-hover","textColor":"text-warning-color","iconTintColor":"text-warning-color"},"active":{"borderColor":"color-warning-transparent-active-border","backgroundColor":"color-warning-transparent-active","textColor":"text-warning-color","iconTintColor":"text-warning-color"},"disabled":{"borderColor":"color-warning-transparent-disabled-border","backgroundColor":"color-warning-transparent-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"danger":{"borderColor":"color-danger-transparent-default-border","backgroundColor":"color-danger-transparent-default","textColor":"text-danger-color","iconTintColor":"text-danger-color","state":{"focused":{"borderColor":"color-danger-transparent-focus-border","backgroundColor":"color-danger-transparent-focus","textColor":"text-danger-color","iconTintColor":"text-danger-color"},"hover":{"borderColor":"color-danger-transparent-hover-border","backgroundColor":"color-danger-transparent-hover","textColor":"text-danger-color","iconTintColor":"text-danger-color"},"active":{"borderColor":"color-danger-transparent-active-border","backgroundColor":"color-danger-transparent-active","textColor":"text-danger-color","iconTintColor":"text-danger-color"},"disabled":{"borderColor":"color-danger-transparent-disabled-border","backgroundColor":"color-danger-transparent-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"control":{"borderColor":"color-control-transparent-default-border","backgroundColor":"color-control-transparent-default","textColor":"text-control-color","iconTintColor":"text-control-color","state":{"focused":{"borderColor":"color-control-transparent-focus-border","backgroundColor":"color-control-transparent-focus","textColor":"text-control-color","iconTintColor":"text-control-color"},"hover":{"borderColor":"color-control-transparent-hover-border","backgroundColor":"color-control-transparent-hover","textColor":"text-control-color","iconTintColor":"text-control-color"},"active":{"borderColor":"color-control-transparent-active-border","backgroundColor":"color-control-transparent-active","textColor":"text-control-color","iconTintColor":"text-control-color"},"disabled":{"borderColor":"color-control-transparent-disabled-border","backgroundColor":"color-control-transparent-disabled","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}}}}},"ghost":{"mapping":{},"variantGroups":{"status":{"basic":{"borderColor":"transparent","backgroundColor":"transparent","textColor":"text-hint-color","iconTintColor":"text-hint-color","state":{"focused":{"borderColor":"color-basic-transparent-500","backgroundColor":"color-basic-transparent-200","textColor":"text-hint-color","iconTintColor":"text-hint-color"},"hover":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-100","textColor":"text-hint-color","iconTintColor":"text-hint-color"},"active":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-hint-color","iconTintColor":"text-hint-color"},"disabled":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"primary":{"borderColor":"transparent","backgroundColor":"transparent","textColor":"text-primary-color","iconTintColor":"text-primary-color","state":{"focused":{"borderColor":"color-basic-transparent-500","backgroundColor":"color-basic-transparent-200","textColor":"text-primary-color","iconTintC
1olor":"text-primary-color"},"hover":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-100","textColor":"text-primary-color","iconTintColor":"text-primary-color"},"active":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-primary-color","iconTintColor":"text-primary-color"},"disabled":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"success":{"borderColor":"transparent","backgroundColor":"transparent","textColor":"text-success-color","iconTintColor":"text-success-color","state":{"focused":{"borderColor":"color-basic-transparent-500","backgroundColor":"color-basic-transparent-200","textColor":"text-success-color","iconTintColor":"text-success-color"},"hover":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-100","textColor":"text-success-color","iconTintColor":"text-success-color"},"active":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-success-color","iconTintColor":"text-success-color"},"disabled":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"info":{"borderColor":"transparent","backgroundColor":"transparent","textColor":"text-info-color","iconTintColor":"text-info-color","state":{"focused":{"borderColor":"color-basic-transparent-500","backgroundColor":"color-basic-transparent-200","textColor":"text-info-color","iconTintColor":"text-info-color"},"hover":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-100","textColor":"text-info-color","iconTintColor":"text-info-color"},"active":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-info-color","iconTintColor":"text-info-color"},"disabled":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"warning":{"borderColor":"transparent","backgroundColor":"transparent","textColor":"text-warning-color","iconTintColor":"text-warning-color","state":{"focused":{"borderColor":"color-basic-transparent-500","backgroundColor":"color-basic-transparent-200","textColor":"text-info-color","iconTintColor":"text-info-color"},"hover":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-100","textColor":"text-warning-color","iconTintColor":"text-warning-color"},"active":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-warning-color","iconTintColor":"text-warning-color"},"disabled":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"danger":{"borderColor":"transparent","backgroundColor":"transparent","textColor":"text-danger-color","iconTintColor":"text-danger-color","state":{"focused":{"borderColor":"color-basic-transparent-500","backgroundColor":"color-basic-transparent-200","textColor":"text-danger-color","iconTintColor":"text-danger-color"},"hover":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-100","textColor":"text-danger-color","iconTintColor":"text-danger-color"},"active":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-danger-color","iconTintColor":"text-danger-color"},"disabled":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"control":{"borderColor":"transparent","backgroundColor":"transparent","textColor":"text-control-color","iconTintColor":"text-control-color","state":{"focused":{"borderColor":"color-basic-transparent-500","backgroundColor":"color-basic-transparent-200","textColor":"text-control-color","iconTintColor":"text-control-color"},"hover":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-100","textColor":"text-control-color","iconTintColor":"text-control-color"},"active":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-control-color","iconTintColor":"text-control-color"},"disabled":{"borderColor":"transparent","backgroundColor":"color-basic-transparent-200","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}}}}}}},"ButtonGroup":{"meta":{"scope":"all","parameters":{"borderRadius":{"type":"number"},"borderWidth":{"type":"number"},"borderColor":{"type":"string"}
1,"dividerBackgroundColor":{"type":"string"},"dividerWidth":{"type":"string"}},"appearances":{"filled":{"default":true},"outline":{"default":false},"ghost":{"default":false}},"variantGroups":{"status":{"basic":{"default":false},"primary":{"default":true},"success":{"default":false},"info":{"default":false},"warning":{"default":false},"danger":{"default":false},"control":{"default":false}},"size":{"tiny":{"default":false},"small":{"default":false},"medium":{"default":true},"large":{"default":false},"giant":{"default":false}}},"states":{}},"appearances":{"filled":{"mapping":{"borderColor":"transparent","dividerWidth":1},"variantGroups":{"size":{"tiny":{"borderRadius":"border-radius","borderWidth":"border-width"},"small":{"borderRadius":"border-radius","borderWidth":"border-width"},"medium":{"borderRadius":"border-radius","borderWidth":"border-width"},"large":{"borderRadius":"border-radius","borderWidth":"border-width"},"giant":{"borderRadius":"border-radius","borderWidth":"border-width"}},"status":{"basic":{"dividerBackgroundColor":"border-basic-color-2"},"primary":{"dividerBackgroundColor":"border-primary-color-2"},"success":{"dividerBackgroundColor":"border-success-color-2"},"info":{"dividerBackgroundColor":"border-info-color-2"},"warning":{"dividerBackgroundColor":"border-warning-color-2"},"danger":{"dividerBackgroundColor":"border-danger-color-2"},"control":{"dividerBackgroundColor":"color-basic-200"}}}},"outline":{"mapping":{},"variantGroups":{"status":{"basic":{"borderColor":"color-basic-default-border","dividerBackgroundColor":"color-basic-default"},"primary":{"borderColor":"color-primary-default-border","dividerBackgroundColor":"color-primary-default"},"success":{"borderColor":"color-success-default-border","dividerBackgroundColor":"color-success-default"},"info":{"borderColor":"color-info-default-border","dividerBackgroundColor":"color-info-default"},"warning":{"borderColor":"color-warning-default-border","dividerBackgroundColor":"color-warning-default"},"danger":{"borderColor":"color-danger-default-border","dividerBackgroundColor":"color-danger-default"},"control":{"borderColor":"color-control-default-border","dividerBackgroundColor":"color-control-default"}}}},"ghost":{"mapping":{},"variantGroups":{"status":{"basic":{"borderColor":"transparent","dividerBackgroundColor":"transparent"},"primary":{"borderColor":"transparent","dividerBackgroundColor":"transparent"},"success":{"borderColor":"transparent","dividerBackgroundColor":"transparent"},"info":{"borderColor":"transparent","dividerBackgroundColor":"transparent"},"warning":{"borderColor":"transparent","dividerBackgroundColor":"transparent"},"danger":{"borderColor":"transparent","dividerBackgroundColor":"transparent"},"control":{"borderColor":"transparent","dividerBackgroundColor":"transparent"}}}}}},"Card":{"meta":{"scope":"all","parameters":{"backgroundColor":{"type":"string"},"borderRadius":{"type":"number"},"borderColor":{"type":"string"},"borderWidth":{"type":"number"},"bodyPaddingHorizontal":{"type":"number"},"bodyPaddingVertical":{"type":"number"},"headerPaddingHorizontal":{"type":"number"},"headerPaddingVertical":{"type":"number"},"footerPaddingHorizontal":{"type":"number"},"footerPaddingVertical":{"type":"number"},"accentBackgroundColor":{"type":"string"},"accentHeight":{"type":"number"}},"appearances":{"filled":{"default":false},"outline":{"default":true}},"variantGroups":{"status":{"basic":{"default":false},"primary":{"default":false},"success":{"default":false},"info":{"default":false},"warning":{"default":false},"danger":{"default":false},"control":{"default":false}}},"states":{"active":{"default":false,"priority":0,"scope":"all"}}},"appearances":{"outline":{"mapping":{"backgroundColor":"background-basic-color-1","borderRadius":"border-radius","borderColor":"border-basic-color-4","borderWidth":1,"accentHeight":0,"bodyPaddingHorizontal":24,"bodyPaddingVertical":16,"headerPaddingHorizontal":24,"headerPaddingVertical":16,"footerPaddingHorizontal":24,"footerPaddingVertical":16,"state":{"active":{"backgroundColor":"background-basic-color-2"}}},"variantGroups":{"status":{"basic":{"accentHeight":4,"accentBackgroun
1dColor":"color-basic-default"},"primary":{"accentHeight":4,"accentBackgroundColor":"color-primary-default"},"success":{"accentHeight":4,"accentBackgroundColor":"color-success-default"},"info":{"accentHeight":4,"accentBackgroundColor":"color-info-default"},"warning":{"accentHeight":4,"accentBackgroundColor":"color-warning-default"},"danger":{"accentHeight":4,"accentBackgroundColor":"color-danger-default"},"control":{"accentHeight":4,"accentBackgroundColor":"color-control-default"}}}},"filled":{"mapping":{"borderWidth":0,"borderColor":"transparent"}}}},"Calendar":{"meta":{"scope":"all","parameters":{"width":{"type":"number"},"paddingVertical":{"type":"number"},"borderColor":{"type":"string"},"borderWidth":{"type":"number"},"borderRadius":{"type":"number"},"headerPaddingHorizontal":{"type":"number"},"headerPaddingVertical":{"type":"number"},"dividerMarginVertical":{"type":"number"},"titleFontSize":{"type":"number"},"titleFontWeight":{"type":"string"},"titleColor":{"type":"string"},"titleFontFamily":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconTintColor":{"type":"string"},"weekdayTextFontSize":{"type":"number"},"weekdayTextFontWeight":{"type":"string"},"weekdayTextColor":{"type":"string"},"weekdayTextFontFamily":{"type":"string"},"rowMinHeight":{"type":"number"},"rowMarginHorizontal":{"type":"number"}},"appearances":{"default":{"default":true}},"variantGroups":{},"states":{}},"appearances":{"default":{"mapping":{"width":344,"borderRadius":"border-radius","borderWidth":"border-width","borderColor":"border-basic-color-4","paddingVertical":8,"headerPaddingHorizontal":10,"headerPaddingVertical":4,"titleFontSize":"text-heading-6-font-size","titleFontWeight":"text-heading-6-font-weight","titleFontFamily":"text-heading-6-font-family","titleColor":"text-basic-color","iconWidth":24,"iconHeight":24,"iconTintColor":"text-basic-color","weekdayTextFontSize":"text-subtitle-1-font-size","weekdayTextFontWeight":"text-subtitle-1-font-weight","weekdayTextFontFamily":"text-subtitle-1-font-family","weekdayTextColor":"text-hint-color","dividerMarginVertical":4,"rowMinHeight":45,"rowMarginHorizontal":10}}}},"CalendarCell":{"meta":{"scope":"all","parameters":{"paddingHorizontal":{"type":"number"},"paddingVertical":{"type":"number"},"backgroundColor":{"type":"string"},"borderRadius":{"type":"string"},"contentBorderWidth":{"type":"number"},"contentBorderRadius":{"type":"string"},"contentBorderColor":{"type":"string"},"contentBackgroundColor":{"type":"string"},"contentTextColor":{"type":"string"},"contentTextFontSize":{"type":"number"},"contentTextFontWeight":{"type":"number"},"contentTextFontFamily":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{},"states":{"bounding":{"scope":"all","priority":0,"default":false},"today":{"scope":"all","priority":1,"default":false},"disabled":{"scope":"all","priority":2,"default":false},"selected":{"scope":"all","priority":3,"default":false},"range":{"scope":"all","priority":5,"default":false}}},"appearances":{"default":{"mapping":{"paddingHorizontal":0,"paddingVertical":0,"borderRadius":0,"backgroundColor":"transparent","contentBorderRadius":"border-radius","contentBorderWidth":"border-width","contentBorderColor":"transparent","contentTextFontSize":"text-subtitle-1-font-size","contentTextFontWeight":"text-subtitle-1-font-weight","contentTextFontFamily":"text-subtitle-1-font-family","contentTextColor":"text-basic-color","state":{"bounding":{"contentTextColor":"text-hint-color"},"selected":{"contentBorderColor":"color-primary-default-border","contentBackgroundColor":"color-primary-default","contentTextColor":"text-control-color"},"disabled":{"contentTextColor":"text-disabled-color"},"today":{"contentBorderColor":"color-primary-transparent-default-border","contentBackgroundColor":"color-primary-transparent-default"},"range":{"borderRadius":"border-radius","backgroundColor":"color-primary-default","contentTextColor":"text-control-color"},"today.range":{"contentBorderColor":"color-control-transparent-default-border","contentBackgroundColor":"color-control-transparent-default"}}}}}},"CheckBox":{"meta":{"scope":"all","parameters":{"width":{"type":"number"},"height":{"type":"number"},"borderWidth":{"type":"number"},"borderRadius":{"type":"number"},"borderColor":{"type":"string"},"backgroundColor":{"type":"string"},"textMarginHorizontal":{"type":"number"},"textColor":{"type":"string"},"textFontFamily":{"type":"string"},"textFontSize":{"type":"number"},"textFontWeight":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconTintColor":{"type":"string"},"outlineWidth":{"type":"number"},"outlineHeight":{"type":"number"},"outlineBorderRadius":{"type":"number"}
1,"outlineBackgroundColor":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{"status":{"primary":{"default":false},"success":{"default":false},"warning":{"default":false},"danger":{"default":false},"info":{"default":false},"basic":{"default":true},"control":{"default":false}}},"states":{"checked":{"default":false,"priority":0,"scope":"all"},"hover":{"default":false,"priority":1,"scope":"all"},"disabled":{"default":false,"priority":2,"scope":"all"},"active":{"default":false,"priority":3,"scope":"all"},"indeterminate":{"default":false,"priority":4,"scope":"all"},"focused":{"default":false,"priority":5,"scope":"all"}}},"appearances":{"default":{"mapping":{"width":20,"height":20,"borderRadius":3,"borderWidth":"border-width","outlineWidth":32,"outlineHeight":32,"outlineBorderRadius":6,"outlineBackgroundColor":"transparent","textFontSize":"text-subtitle-2-font-size","textFontWeight":"text-subtitle-2-font-weight","textFontFamily":"text-subtitle-2-font-family","textMarginHorizontal":12,"iconWidth":12,"iconHeight":12,"iconTintColor":"transparent"},"variantGroups":{"status":{"basic":{"borderColor":"color-basic-transparent-default-border","backgroundColor":"color-basic-transparent-default","textColor":"text-basic-color","state":{"checked":{"borderColor":"color-primary-default-border","backgroundColor":"color-primary-default","iconTintColor":"text-control-color"},"indeterminate":{"borderColor":"color-primary-default-border","backgroundColor":"color-primary-default","iconTintColor":"text-control-color"},"focused":{"borderColor":"color-primary-transparent-focus-border","backgroundColor":"color-primary-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-primary-focus-border","backgroundColor":"color-primary-focus"},"hover":{"borderColor":"color-primary-transparent-hover-border","backgroundColor":"color-primary-transparent-hover"},"checked.hover":{"borderColor":"color-primary-hover-border","backgroundColor":"color-primary-hover"},"active":{"borderColor":"color-primary-transparent-active-border","backgroundColor":"color-primary-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-primary-active-border","backgroundColor":"color-primary-active","outlineBackgroundColor":"outline-color"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"color-basic-transparent-600"}}},"primary":{"borderColor":"color-primary-transparent-default-border","backgroundColor":"color-primary-transparent-default","textColor":"text-basic-color","state":{"checked":{"borderColor":"color-primary-default-border","backgroundColor":"color-primary-default","iconTintColor":"text-control-color"},"indeterminate":{"borderColor":"color-primary-default-border","backgroundColor":"color-primary-default","iconTintColor":"text-control-color"},"focused":{"borderColor":"color-primary-transparent-focus-border","backgroundColor":"color-primary-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-primary-focus-border","backgroundColor":"color-primary-focus"},"hover":{"borderColor":"color-primary-transparent-hover-border","backgroundColor":"color-primary-transparent-hover"},"checked.hover":{"borderColor":"color-primary-hover-border","backgroundColor":"color-primary-hover"},"active":{"borderColor":"color-primary-transparent-active-border","backgroundColor":"color-primary-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-primary-active-border","backgroundColor":"color-primary-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"color-basic-transparent-600"}}},"success":{"borderColor":"color-success-transparent-default-border","backgroundColor":"color-success-transparent-default","textColor":"text-basic-color","state":{"checked":{"borderColor":"color-success-default-border","backgroundColor":"color-success-default","iconTintColor":"text-control-color"},"indeterminate":{"borderColor":"color-success-default-border","backgroundColor":"color-success-default","iconTintColor":"text-control-color"}
1,"focused":{"borderColor":"color-success-transparent-focus-border","backgroundColor":"color-success-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-success-focus-border","backgroundColor":"color-success-focus"},"hover":{"borderColor":"color-success-transparent-hover-border","backgroundColor":"color-success-transparent-hover"},"checked.hover":{"borderColor":"color-success-hover-border","backgroundColor":"color-success-hover"},"active":{"borderColor":"color-success-transparent-active-border","backgroundColor":"color-success-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-success-active-border","backgroundColor":"color-success-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"color-basic-transparent-600"}}},"info":{"borderColor":"color-info-transparent-default-border","backgroundColor":"color-info-transparent-default","textColor":"text-basic-color","state":{"checked":{"borderColor":"color-info-default-border","backgroundColor":"color-info-default","iconTintColor":"text-control-color"},"indeterminate":{"borderColor":"color-info-default-border","backgroundColor":"color-info-default","iconTintColor":"text-control-color"},"focused":{"borderColor":"color-info-transparent-focus-border","backgroundColor":"color-info-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-info-focus-border","backgroundColor":"color-info-focus"},"hover":{"borderColor":"color-info-transparent-hover-border","backgroundColor":"color-info-transparent-hover"},"checked.hover":{"borderColor":"color-info-hover-border","backgroundColor":"color-info-hover"},"active":{"borderColor":"color-info-transparent-active-border","backgroundColor":"color-info-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-info-active-border","backgroundColor":"color-info-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"color-basic-transparent-600"}}},"warning":{"borderColor":"color-warning-transparent-default-border","backgroundColor":"color-warning-transparent-default","textColor":"text-basic-color","state":{"checked":{"borderColor":"color-warning-default-border","backgroundColor":"color-warning-default","iconTintColor":"text-control-color"},"indeterminate":{"borderColor":"color-warning-default-border","backgroundColor":"color-warning-default","iconTintColor":"text-control-color"},"focused":{"borderColor":"color-warning-transparent-focus-border","backgroundColor":"color-warning-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-warning-focus-border","backgroundColor":"color-warning-focus"},"hover":{"borderColor":"color-warning-transparent-hover-border","backgroundColor":"color-warning-transparent-hover"},"checked.hover":{"borderColor":"color-warning-hover-border","backgroundColor":"color-warning-hover"},"active":{"borderColor":"color-warning-transparent-active-border","backgroundColor":"color-warning-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-warning-active-border","backgroundColor":"color-warning-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"color-basic-transparent-600"}}},"danger":{"borderColor":"color-danger-transparent-default-border","backgroundColor":"color-danger-transparent-default","textColor":"text-basic-color","state":{"checked":{"borderColor":"color-danger-default-border","backgroundColor":"color-danger-default","iconTintColor":"text-control-color"},"indeterminate":{"borderColor":"color-danger-default-border","backgroundColor":"color-danger-default","iconTintColor":"text-control-color"}
1,"focused":{"borderColor":"color-danger-transparent-focus-border","backgroundColor":"color-danger-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-danger-focus-border","backgroundColor":"color-danger-focus"},"hover":{"borderColor":"color-danger-transparent-hover-border","backgroundColor":"color-danger-transparent-hover"},"checked.hover":{"borderColor":"color-danger-hover-border","backgroundColor":"color-danger-hover"},"active":{"borderColor":"color-danger-transparent-active-border","backgroundColor":"color-danger-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-danger-active-border","backgroundColor":"color-danger-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"color-basic-transparent-600"}}},"control":{"borderColor":"color-control-transparent-default-border","backgroundColor":"color-control-transparent-default","textColor":"text-control-color","state":{"checked":{"borderColor":"color-control-default-border","backgroundColor":"color-control-default","iconTintColor":"color-basic-800"},"indeterminate":{"borderColor":"color-control-default-border","backgroundColor":"color-control-default","iconTintColor":"color-basic-800"},"focused":{"borderColor":"color-control-transparent-focus-border","backgroundColor":"color-control-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-control-focus-border","backgroundColor":"color-control-focus"},"hover":{"borderColor":"color-control-transparent-hover-border","backgroundColor":"color-control-transparent-hover"},"checked.hover":{"borderColor":"color-control-hover-border","backgroundColor":"color-control-hover"},"active":{"borderColor":"color-control-transparent-active-border","backgroundColor":"color-control-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-control-active-border","backgroundColor":"color-control-active"},"disabled":{"borderColor":"color-control-transparent-disabled-border","backgroundColor":"color-control-transparent-disabled","textColor":"text-control-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"color-basic-transparent-600","iconTintColor":"text-control-color"}}}}}}}},"Datepicker":{"meta":{"scope":"all","parameters":{"minHeight":{"type":"number"},"paddingHorizontal":{"type":"number"},"paddingVertical":{"type":"number"},"borderRadius":{"type":"number"},"borderColor":{"type":"string"},"borderWidth":{"type":"number"},"backgroundColor":{"type":"string"},"textMarginHorizontal":{"type":"number"},"textFontSize":{"type":"number"},"textFontWeight":{"type":"string"},"textFontFamily":{"type":"string"},"textColor":{"type":"string"},"placeholderColor":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconMarginHorizontal":{"type":"number"},"iconTintColor":{"type":"string"},"labelColor":{"type":"string"},"labelFontFamily":{"type":"string"},"labelFontSize":{"type":"number"},"labelFontWeight":{"type":"string"},"labelMarginBottom":{"type":"number"},"captionColor":{"type":"string"},"captionFontFamily":{"type":"string"},"captionFontSize":{"type":"number"},"captionFontWeight":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{"status":{"basic":{"default":true},"primary":{"default":false},"success":{"default":false},"info":{"default":false},"warning":{"default":false},"danger":{"default":false},"control":{"default":false}},"size":{"small":{"default":false},"medium":{"default":true},"large":{"default":false}}},"states":{"disabled":{"default":false,"priority":0,"scope":"all"},"active":{"default":false,"priority":1,"scope":"all"}}},"appearances":{"default":{"mapping":{"paddingHorizontal":8,"textMarginHorizontal":8,"textFontFamily":"text-font-family","iconWidth":24,"iconHeight":24,"iconMarginHorizontal":8,"labelMarginBottom":4,"labelFontSize":"text-label-font-size","labelFontWeight":"text-label-font-we
1ight","labelFontFamily":"text-label-font-family","captionFontSize":"text-caption-1-font-size","captionFontWeight":"text-caption-1-font-weight","captionFontFamily":"text-caption-1-font-family"},"variantGroups":{"status":{"basic":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-hint-color","placeholderColor":"text-hint-color","iconTintColor":"text-hint-color","state":{"active":{"borderColor":"color-primary-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","textColor":"text-basic-color","iconTintColor":"text-disabled-color"}}},"primary":{"borderColor":"color-primary-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-primary-color","placeholderColor":"text-hint-color","iconTintColor":"text-primary-color","state":{"active":{"borderColor":"color-primary-active","backgroundColor":"background-basic-color-1","textColor":"text-basic-color"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"success":{"borderColor":"color-success-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-success-color","placeholderColor":"text-hint-color","iconTintColor":"text-success-color","state":{"active":{"borderColor":"color-success-active","backgroundColor":"background-basic-color-1","textColor":"text-basic-color"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"info":{"borderColor":"color-info-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-info-color","placeholderColor":"text-hint-color","iconTintColor":"text-info-color","state":{"active":{"borderColor":"color-info-active","backgroundColor":"background-basic-color-1","textColor":"text-basic-color"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","textColor":"text-basic-color","iconTintColor":"text-disabled-color"}}},"warning":{"borderColor":"color-warning-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-warning-color","placeholderColor":"text-hint-color","iconTintColor":"text-warning-color","state":{"active":{"borderColor":"color-warning-active","backgroundColor":"background-basic-color-1","textColor":"text-basic-color"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","textColor":"text-basic-color","iconTintColor":"text-disabled-color"}}},"danger":{"borderColor":"color-danger-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-danger-color","placeholderColor":"text-hint-color","iconTintColor":"text-danger-color","state":{"active":{"borderColor":"color-danger-active","backgroundColor":"background-basic-color-1","textColor":"text-basic-color"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","textColor":"text-basic-color","iconTintColor":"text-disabled-color"}}},"control":{"borderColor":"color-basic-control-transparent-500","backgroundColor":"color-basic-control-transparent-300","textColor":"text-control-color","labelColor":"text-control-color","captionColor":"text-control-color","placeholderColor":"text-control-color","iconTintColor":"text-control-color","state":{"active":{"borderColor":"color-control-transparent-active-border","backgroundColor":"background-basic-color-1","textColor":"text-basic-color"},"disabled":{"borderColor":"color-control-transparent-disabled-border","backgroundColor":"color-control-transparent-disabled","textColor":"text-control-color","iconTintColor":"text-control-color"}}}},"size":{"small":{"minHeight":"size-small","borderRadius":"border-radius","borderWidth":"border-width","paddingVertical":3,"textFontSize":"text-subtitle-2-font-size","textFontWeight":"normal"},"medium":{"minHeight":"size-medium","borderRadius":"border-radius","borderWidth":"border-width","paddingVertical":7,"textFontSize":"text-subtitle-1-font-size","textFontWeight":"normal"},"large":{"minHeight":"size-large","borderRadius":"border-radius","borderWidth":"border-width","paddingVertical":11,"textFontSize":"text-subtitle-1-font-size","textFontWeight":"normal"}}}}}},"Divider":{"meta":{"scope":"all","parameters":{"backgroundColor":{"type":"string"},"height":{"type":"number"}},"appearances":{"default":{"default":true}},"variantGroups":{},"states":{}},"appearances":{"default":{"mapping":{"height":1,"backgroundColor":"background-basic-color-3"}}}},"Drawer":{"meta":{"scope":"mobile","parameters":{"backgroundColor":{"type":"string"},"headerPaddingHorizontal":{"type":"number"},"headerPaddingVertical":{"type":"number"},"footerPaddingHorizontal":{"type":"number"},"footerPaddingVertical":{"type":"number"}},"appearances":{"default":{"default":true},"noDivider":{"default":false}},"variantGroups":{},"states":{}},"appearances":{"default":{"mapping":{"backgroundColor":"background-basic-color-1","headerPaddingHorizontal":24,"headerPaddingVertical":16,"footerPaddingHorizontal":24,"footerPaddingVertical":8}},"noDivider":{"mapping":{}}}},"Input":{"meta":{"scope":"all","parameters":{"paddingVertical":{"type":"number"},"paddingHorizontal":{"type":"number"},"minHeight":{"type":"number"},"borderRadius":{"type":"number"},"borderWidth":{"type":"number"},"borderColor":{"type":"string"},"backgroundColor":{"type":"string"},"textMarginHorizontal":{"type":"number"},"textFontFamily":{"type":"string"},"textFontSize":{"type":"number"},"textFontWeight":{"type":"string"},"textColor":{"type":"string"},"placeholderColor":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconMarginHorizontal":{"type":"number"},"iconTintColor":{"type":"string"},"labelColor":{"type":"string"},"labelFontFamily":{"type":"string"},"labelFontSize":{"type":"number"},"labelFontWeight":{"type":"string"},"labelMarginBottom":{"type":"number"},"captionColor":{"type":"string"},"captionFontFamily":{"type":"string"},"captionFontSize":{"type":"number"},"captionFontWeight":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{"status":{"basic":{"default":true},"primary":{"default":false},"success":{"default":false},"info":{"default":false},"warning":{"default":false},"danger":{"default":false},"control":{"default":false}},"size":{"small":{"default":false},"medium":{"default":true},"large":{"default":false}}},"states":{"hover":{"default":false,"priority":0,"scope":"all"},"disabled":{"default":false,"priority":1,"scope":"all"}
1,"focused":{"default":false,"priority":2,"scope":"all"}}},"appearances":{"default":{"mapping":{"paddingHorizontal":8,"textMarginHorizontal":8,"textFontFamily":"text-font-family","iconWidth":24,"iconHeight":24,"iconMarginHorizontal":8,"labelMarginBottom":4,"labelFontSize":"text-label-font-size","labelFontWeight":"text-label-font-weight","labelFontFamily":"text-label-font-family","captionFontSize":"text-caption-1-font-size","captionFontWeight":"text-caption-1-font-weight","captionFontFamily":"text-caption-1-font-family"},"variantGroups":{"status":{"basic":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-hint-color","placeholderColor":"text-hint-color","iconTintColor":"text-hint-color","state":{"focused":{"borderColor":"color-primary-default","backgroundColor":"background-basic-color-1","iconTintColor":"text-primary-color"},"hover":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-1"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","textColor":"text-basic-color","labelColor":"text-disabled-color","captionColor":"text-disabled-color","placeholderColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"primary":{"borderColor":"color-primary-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-primary-color","placeholderColor":"text-hint-color","iconTintColor":"text-primary-color","state":{"focused":{"borderColor":"color-primary-focus","backgroundColor":"background-basic-color-1","iconTintColor":"text-primary-focus-color"},"hover":{"borderColor":"color-primary-hover","backgroundColor":"background-basic-color-3"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","textColor":"text-basic-color","labelColor":"text-disabled-color","captionColor":"text-disabled-color","placeholderColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"success":{"borderColor":"color-success-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-success-color","placeholderColor":"text-hint-color","iconTintColor":"text-success-color","state":{"focused":{"borderColor":"color-success-focus","backgroundColor":"background-basic-color-1","iconTintColor":"text-success-focus-color"},"hover":{"borderColor":"color-success-hover","backgroundColor":"background-basic-color-3"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","textColor":"text-basic-color","labelColor":"text-disabled-color","captionColor":"text-disabled-color","placeholderColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"info":{"borderColor":"color-info-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-info-color","placeholderColor":"text-hint-color","iconTintColor":"text-info-color","state":{"focused":{"borderColor":"color-info-focus","backgroundColor":"background-basic-color-1","iconTintColor":"text-info-focus-color"},"hover":{"borderColor":"color-info-hover","backgroundColor":"background-basic-color-3"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","textColor":"text-basic-color","labelColor":"text-disabled-color","captionColor":"text-disabled-color","placeholderColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"warning":{"borderColor":"color-warning-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-warning-color","placeholderColor":"text-hint-color","iconTintColor":"text-warning-color","state":{"focused":{"borderColor":"color-warning-focus","backgroundColor":"background-basic-color-1","iconTintColor":"text-warning-focus-color"},"hover":{"borderColor":"color-warning-hover","backgroundColor":"background-basic-color-3"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","textColor":"text-basic-color","labelColor":"text-disabled-color","captionColor":"text-disabled-color","placeholderColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"danger":{"borderColor":"color-danger-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-danger-color","placeholderColor":"text-hint-color","iconTintColor":"text-danger-color","state":{"focused":{"borderColor":"color-danger-focus","backgroundColor":"background-basic-color-1","iconTintColor":"text-danger-focus-color"},"hover":{"borderColor":"color-danger-hover","backgroundColor":"background-basic-color-3"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","textColor":"text-basic-color","labelColor":"text-disabled-color","captionColor":"text-disabled-color","placeholderColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"control":{"borderColor":"color-basic-control-transparent-500","backgroundColor":"color-basic-control-transparent-300","textColor":"text-control-color","labelColor":"text-control-color","captionColor":"text-control-color","placeholderColor":"text-control-color","iconTintColor":"text-control-color","state":{"focused":{"borderColor":"color-control-transparent-focus-border","backgroundColor":"color-basic-control-transparent-500","iconTintColor":"text-control-color"},"hover":{"borderColor":"color-control-transparent-hover-border","backgroundColor":"color-basic-control-transparent-400"},"disabled":{"borderColor":"color-control-transparent-disabled-border","backgroundColor":"color-control-transparent-disabled","textColor":"text-control-color","labelColor":"text-control-color","captionColor":"text-control-color","placeholderColor":"text-control-color","iconTintColor":"text-control-color"}}}},"size":{"small":{"minHeight":"size-small","borderRadius":"border-radius","borderWidth":"border-width","paddingVertical":3,"textFontSize":"text-subtitle-2-font-size","textFontWeight":"normal"},"medium":{"minHeight":"size-medium","borderRadius":"border-radius","borderWidth":"border-width","paddingVertical":7,"textFontSize":"text-subtitle-1-font-size","textFontWeight":"normal"},"large":{"minHeight":"size-large","borderRadius":"border-radius","borderWidth":"border-width","paddingVertical":11,"textFontSize":"text-subtitle-1-font-size","textFontWeight":"normal"}}}}}},"Layout":{"meta":{"scope":"mobile","parameters":{"backgroundColor":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{"level":{"1":{"default":true},"2":{"default":false},"3":{"default":false},"4":{"default":false}}},"states":{}},"appearances":{"default":{"mapping":{},"variantGroups":{"level":{"1":{"backgroundColor":"background-basic-color-1"},"2":{"backgroundColor":"background-basic-color-2"},"3":{"backgroundColor":"background-basic-color-3"},"4":{"backgroundColor":"background-basic-color-4"}}}}}},"List":{"meta":{"scope":"all","parameters":{"backgroundColor":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{},"states":{}},"appearances":{"default":{"mapping":{"backgroundColor":"background-basic-color-1"}}}},"ListItem":{"meta":{"scope":"all","parameters":{"paddingVertical":{"type":"number"},"paddingHorizontal":{"type":"number"},"backgroundColor":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconMarginHorizontal":{"type":"number"},"iconTintColor":{"type":"string"},"titleMarginHorizontal":{"type":"number"},"titleFontFamily":{"type":"string"},"titleFontSize":{"type":"number"},"titleFontWeight":{"type":"string"},"titleColor":{"type":"string"},"descriptionColor":{"type":"string"},"descriptionFontFamily":{"type":"string"},"descriptionFontSize":{"type":"number"},"descriptionFontWeight":{"type":"string"},"descriptionMarginHorizontal":{"type":"number"},"accessoryMarginHorizontal":{"type":"number"}},"appearances":{"default":{"default":true}},"variantGroups":{},"states":{"active":{"default":false,"priority":0,"scope":"all"}}},"appearances":{"default":{"mapping":{"paddingHorizontal":8,"paddingVertical":12,"backgroundColor":"background-basic-color-1","iconWidth":24,"iconHeight":24,"iconMarginHorizontal":8,"iconTintColor":"text-hint-color","titleMarginHorizontal":8,"t
1itleFontSize":"text-subtitle-2-font-size","titleFontWeight":"text-subtitle-2-font-weight","titleFontFamily":"text-subtitle-2-font-family","titleColor":"text-basic-color","descriptionMarginHorizontal":8,"descriptionFontSize":"text-caption-1-font-size","descriptionFontWeight":"text-caption-1-font-weight","descriptionFontFamily":"text-caption-1-font-family","descriptionColor":"text-hint-color","accessoryMarginHorizontal":8,"state":{"active":{"backgroundColor":"color-basic-transparent-active"}}}}}},"Menu":{"meta":{"scope":"all","parameters":{},"appearances":{"default":{"default":true},"noDivider":{"default":false}},"variantGroups":{},"states":{}},"appearances":{"default":{"mapping":{}},"noDivider":{"mapping":{}}}},"MenuItem":{"meta":{"scope":"all","parameters":{"indicatorWidth":{"type":"number"},"indicatorBackgroundColor":{"type":"string"},"paddingVertical":{"type":"number"},"paddingHorizontal":{"type":"number"},"paddingLeft":{"type":"number"},"backgroundColor":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconMarginHorizontal":{"type":"number"},"iconTintColor":{"type":"string"},"titleMarginHorizontal":{"type":"number"},"titleFontFamily":{"type":"string"},"titleFontSize":{"type":"number"},"titleFontWeight":{"type":"string"},"titleColor":{"type":"string"}},"appearances":{"default":{"default":true},"grouped":{"default":false}},"variantGroups":{},"states":{"hover":{"default":false,"priority":0,"scope":"all"},"disabled":{"default":false,"priority":1,"scope":"all"},"selected":{"default":false,"priority":2,"scope":"all"},"active":{"default":false,"priority":3,"scope":"all"},"focused":{"default":false,"priority":4,"scope":"all"}}},"appearances":{"default":{"mapping":{"paddingHorizontal":8,"paddingVertical":12,"backgroundColor":"background-basic-color-1","indicatorWidth":0,"indicatorBackgroundColor":"transparent","titleMarginHorizontal":8,"titleFontSize":"text-subtitle-2-font-size","titleFontWeight":"text-subtitle-2-font-weight","titleFontFamily":"text-subtitle-2-font-family","titleColor":"text-basic-color","iconWidth":20,"iconHeight":20,"iconMarginHorizontal":8,"iconTintColor":"text-hint-color","state":{"hover":{"titleColor":"text-primary-hover-color","iconTintColor":"text-primary-hover-color"},"active":{"backgroundColor":"color-basic-transparent-active"},"selected":{"backgroundColor":"color-primary-transparent-default","indicatorWidth":4,"indicatorBackgroundColor":"color-primary-default","titleColor":"text-primary-color","iconTintColor":"text-primary-color"},"disabled":{"titleColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}}},"grouped":{"mapping":{"paddingLeft":16}}}},"OverflowMenu":{"meta":{"scope":"all","parameters":{"width":{"type":"number"},"maxHeight":{"type":"number"},"borderRadius":{"type":"number"},"indicatorBackgroundColor":{"type":"string"}},"appearances":{"default":{"default":true},"noDivider":{"default":false}},"states":{},"variantGroups":{}},"appearances":{"default":{"mapping":{"width":160,"maxHeight":256,"borderRadius":"border-radius","indicatorBackgroundColor":"transparent"}},"noDivider":{"mapping":{}}}},"Popover":{"meta":{"scope":"all","parameters":{"borderRadius":{"type":"number"},"borderWidth":{"type":"number"},"borderColor":{"type":"number"},"backgroundColor":{"type":"string"},"indicatorWidth":{"type":"number"},"indicatorHeight":{"type":"number"},"indicatorBackgroundColor":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{},"states":{}},"appearances":{"default":{"mapping":{"borderRadius":"border-radius","borderWidth":"border-width","borderColor":"border-basic-color-3","backgroundColor":"background-basic-color-1","indicatorWidth":6,"indicatorHeight":6,"indicatorBackgroundColor":"background-basic-color-1"}}}},"Select":{"meta":{"scope":"all","parameters":{"minWidth":{"type":"number"},"minHeight":{"type":"number"},"paddingHorizontal":{"type":"number"},"paddingVertical":{"type":"number"},"borderRadius":{"type":"number"},"borderColor":{"type":"string"},"borderWidth":{"type":"number"},"backgroundColor":{"type":"string"},"placeholderFontFamily":{"type":"string"},"placeholderFontSize":{"type":"number"},"placeholderFontWeight":{"type":"string"},"placeholderColor":{"type":"string"},"textMarginHorizontal":{"type":"number"},"textFontFamily":{"type":"string"},"textFontSize":{"type":"number"},"textFontWeight":{"type":"string"},"textColor":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconTintColor":{"type":"string"},"iconMarginHorizontal":{"type":"number"},"popoverMaxHeight":{"type":"number"},"popoverBorderRadius":{"type":"number"},"popoverBorderColor":{"type":"string"},"popoverBorderWidth":{"type":"number"},"labelColor":{"type":"string"},"labelFontFamily":{"type":"string"},"labelFontSize":{"type":"number"},"labelFontWeight":{"type":"string"},"labelMarginBottom":{"type":"number"},"captionColor":{"type":"string"},"captionFontFamily":{"type":"string"},"captionFontSize":{"type":"number"},"captionFontWeight":{"type":"number"}},"appearances":{"default":{"default":true},"thick-border":{"default":false}},"variantGroups":{"status":{"basic":{"default":true},"primary":{"default":false},"success":{"default":false},"info":{"default":false},"warning":{"default":false},"danger":{"default":false},"control":{"default":false}},"size":{"small":{"default":false},"medium":{"default":true},"large":{"default":false}}},"states":{"hover":{"default":false,"priority":0,"scope":"all"},"disabled":{"default":false,"priority":1,"scope":"all"},"active":{"default":false,"priority":2,"scope":"all"}
1,"focused":{"default":false,"priority":3,"scope":"all"}}},"appearances":{"default":{"mapping":{"paddingHorizontal":8,"iconWidth":24,"iconHeight":24,"iconMarginHorizontal":8,"textMarginHorizontal":8,"textFontFamily":"text-font-family","placeholderFontFamily":"text-paragraph-1-font-family","labelMarginBottom":4,"labelFontSize":"text-label-font-size","labelFontWeight":"text-label-font-weight","labelFontFamily":"text-label-font-family","captionFontSize":"text-caption-1-font-size","captionFontWeight":"text-caption-1-font-weight","captionFontFamily":"text-caption-1-font-family","popoverMaxHeight":400,"popoverBorderRadius":"border-radius","popoverBorderWidth":"border-width","popoverBorderColor":"border-basic-color-4"},"variantGroups":{"status":{"basic":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-hint-color","placeholderColor":"text-hint-color","iconTintColor":"text-hint-color","state":{"focused":{"borderColor":"color-primary-default","backgroundColor":"background-basic-color-1"},"hover":{"borderColor":"border-basic-color-1","backgroundColor":"background-basic-color-3"},"active":{"borderColor":"color-primary-default","backgroundColor":"background-basic-color-1"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","placeholderColor":"text-disabled-color","textColor":"text-basic-color","iconTintColor":"text-disabled-color"}}},"primary":{"borderColor":"color-primary-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-primary-color","placeholderColor":"text-hint-color","iconTintColor":"text-hint-color","state":{"focused":{"borderColor":"color-primary-focus","backgroundColor":"background-basic-color-1"},"hover":{"borderColor":"color-primary-hover","backgroundColor":"background-basic-color-3"},"active":{"borderColor":"color-primary-active","backgroundColor":"background-basic-color-1","iconTintColor":"text-basic-color"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-1","placeholderColor":"text-disabled-color","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}},"success":{"borderColor":"color-success-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-success-color","placeholderColor":"text-hint-color","iconTintColor":"text-hint-color","state":{"focused":{"borderColor":"color-success-focus","backgroundColor":"background-basic-color-1"},"hover":{"borderColor":"color-success-hover","backgroundColor":"background-basic-color-3"},"active":{"borderColor":"color-success-active","backgroundColor":"background-basic-color-1","iconTintColor":"text-basic-color"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","placeholderColor":"text-disabled-color","textColor":"text-basic-color","iconTintColor":"text-disabled-color"}}},"info":{"borderColor":"color-info-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-info-color","placeholderColor":"text-hint-color","iconTintColor":"text-hint-color","state":{"focused":{"borderColor":"color-info-focus","backgroundColor":"background-basic-color-1"},"hover":{"borderColor":"color-info-hover","backgroundColor":"background-basic-color-3"},"active":{"borderColor":"color-info-active","backgroundColor":"background-basic-color-1","iconTintColor":"text-basic-color"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","placeholderColor":"text-disabled-color","textColor":"text-basic-color","iconTintColor":"text-disabled-color"}}},"warning":{"borderColor":"color-warning-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-warning-color","placeholderColor":"text-hint-color","iconTintColor":"text-hint-color","state":{"focused":{"borderColor":"color-warning-focus","backgroundColor":"background-basic-color-1"},"hover":{"borderColor":"color-warning-hover","backgroundColor":"background-basic-color-3"},"active":{"borderColor":"color-warning-active","backgroundColor":"background-basic-color-1","iconTintColor":"text-basic-color"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","placeholderColor":"text-disabled-color","textColor":"text-basic-color","iconTintColor":"text-disabled-color"}}},"danger":{"borderColor":"color-danger-default","backgroundColor":"background-basic-color-1","textColor":"text-basic-color","labelColor":"text-hint-color","captionColor":"text-danger-color","placeholderColor":"text-hint-color","iconTintColor":"text-hint-color","state":{"focused":{"borderColor":"color-danger-focus","backgroundColor":"background-basic-color-1"},"hover":{"borderColor":"color-danger-hover","backgroundColor":"background-basic-color-3"},"active":{"borderColor":"color-danger-active","backgroundColor":"background-basic-color-1","iconTintColor":"text-basic-color"},"disabled":{"borderColor":"border-basic-color-4","backgroundColor":"background-basic-color-2","placeholderColor":"text-disabled-color","textColor":"text-basic-color","iconTintColor":"text-disabled-color"}}},"control":{"borderColor":"color-basic-control-transparent-500","backgroundColor":"color-basic-control-transparent-300","textColor":"text-control-color","labelColor":"text-control-color","captionColor":"text-control-color","placeholderColor":"text-control-color","iconTintColor":"text-control-color","state":{"focused":{"borderColor":"color-control-transparent-focus-border","backgroundColor":"color-basic-control-transparent-500"},"hover":{"borderColor":"color-control-transparent-hover-border","backgroundColor":"color-basic-control-transparent-400"},"active":{"borderColor":"color-control-transparent-active-border","backgroundColor":"background-basic-color-1","iconTintColor":"text-basic-color"},"disabled":{"borderColor":"color-control-transparent-disabled-border","backgroundColor":"color-control-transparent-disabled","textColor":"text-control-color","labelColor":"text-control-color","placeholderColor":"text-control-color","iconTintColor":"text-control-color"}}}},"size":{"small":{"borderRadius":"border-radius","borderWidth":"border-width","minHeight":"size-small","paddingVertical":3,"textFontSize":"text-subtitle-2-font-size","textFontWeight":"text-subtitle-2-font-we
1ight","placeholderFontSize":"text-paragraph-1-font-size","placeholderFontWeight":"text-paragraph-1-font-weight"},"medium":{"borderRadius":"border-radius","borderWidth":"border-width","minHeight":"size-medium","paddingVertical":7,"textFontSize":"text-subtitle-1-font-size","textFontWeight":"normal","placeholderFontSize":"text-paragraph-1-font-size","placeholderFontWeight":"text-paragraph-1-font-weight"},"large":{"borderRadius":"border-radius","borderWidth":"border-width","minHeight":"size-large","paddingVertical":11,"textFontSize":"text-subtitle-1-font-size","textFontWeight":"normal","placeholderFontSize":"text-paragraph-1-font-size","placeholderFontWeight":"text-paragraph-1-font-weight"}}}},"thick-border":{"variantGroups":{"status":{"basic":{"borderColor":"#99ADBA"}},"size":{"small":{"borderWidth":2},"medium":{"borderWidth":2},"large":{"borderWidth":2}}}}}},"SelectOption":{"meta":{"scope":"all","parameters":{"paddingHorizontal":{"type":"number"},"paddingVertical":{"type":"number"},"paddingLeft":{"type":"number"},"backgroundColor":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconMarginHorizontal":{"type":"number"},"iconTintColor":{"type":"string"},"textMarginHorizontal":{"type":"number"},"textFontFamily":{"type":"string"},"textFontSize":{"type":"number"},"textFontWeight":{"type":"string"},"textColor":{"type":"string"}},"appearances":{"default":{"default":true},"grouped":{"default":false}},"variantGroups":{},"states":{"hover":{"default":false,"priority":0,"scope":"all"},"disabled":{"default":false,"priority":1,"scope":"all"},"selected":{"default":false,"priority":2,"scope":"all"},"active":{"default":false,"priority":3,"scope":"all"},"focused":{"default":false,"priority":4,"scope":"all"}}},"appearances":{"default":{"mapping":{"paddingHorizontal":8,"paddingVertical":12,"backgroundColor":"background-basic-color-1","textMarginHorizontal":8,"textFontSize":"text-subtitle-1-font-size","textFontWeight":"text-paragraph-1-font-weight","textFontFamily":"text-subtitle-1-font-family","textColor":"text-basic-color","iconWidth":20,"iconHeight":20,"iconMarginHorizontal":8,"iconTintColor":"text-hint-color","state":{"hover":{"iconTintColor":"text-primary-hover-color","backgroundColor":"color-basic-transparent-hover"},"active":{"backgroundColor":"color-basic-transparent-active"},"selected":{"backgroundColor":"color-primary-transparent-default","textColor":"text-basic-color","iconTintColor":"text-primary-color"},"selected.hover":{"background-color":"color-primary-transparent-100","textColor":"text-basic-color"},"disabled":{"backgroundColor":"background-basic-color-1","textColor":"text-disabled-color","iconTintColor":"text-disabled-color"}}}},"grouped":{"mapping":{"paddingLeft":16}}}},"Radio":{"meta":{"scope":"all","parameters":{"width":{"type":"number"},"height":{"type":"number"},"borderRadius":{"type":"number"},"borderWidth":{"type":"number"},"borderColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"textFontFamily":{"type":"string"},"textMarginHorizontal":{"type":"number"},"textFontSize":{"type":"number"},"textFontWeight":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconBorderRadius":{"type":"number"},"iconTintColor":{"type":"string"},"outlineWidth":{"type":"number"},"outlineHeight":{"type":"number"},"outlineBorderRadius":{"type":"number"},"outlineBackgroundColor":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{"status":{"basic":{"default":true},"primary":{"default":false},"success":{"default":false},"info":{"default":false},"warning":{"default":false},"danger":{"default":false},"control":{"default":false}}},"states":{"checked":{"default":false,"priority":0,"scope":"all"},"hover":{"default":false,"priority":1,"scope":"all"},"disabled":{"default":false,"priority":2,"scope":"all"},"active":{"default":false,"priority":3,"scope":"all"},"focused":{"default":false,"priority":4,"scope":"all"}}},"appearances":{"default":{"mapping":{"width":20,"height":20,"borderRadius":10,"borderWidth":"border-width","iconWidth":12,"iconHeight":12,"iconBorderRadius":6,"iconTintColor":"transparent","outlineWidth":32,"outlineHeight":32,"outlineBorderRadius":16,"outlineBackgroun
1dColor":"transparent","textMarginHorizontal":12,"textFontSize":"text-subtitle-2-font-size","textFontWeight":"text-subtitle-2-font-weight","textFontFamily":"text-subtitle-2-font-family"},"variantGroups":{"status":{"basic":{"borderColor":"color-basic-transparent-default-border","backgroundColor":"color-basic-transparent-default","textColor":"text-basic-color","state":{"checked":{"borderColor":"color-primary-default-border","backgroundColor":"transparent","iconTintColor":"color-primary-default"},"focused":{"borderColor":"color-primary-transparent-focus-border","backgroundColor":"color-primary-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-primary-focus-border","backgroundColor":"transparent","iconTintColor":"color-primary-focus"},"hover":{"borderColor":"color-primary-transparent-hover-border","backgroundColor":"color-primary-transparent-hover"},"checked.hover":{"borderColor":"color-primary-hover-border","backgroundColor":"transparent","iconTintColor":"color-primary-hover"},"active":{"borderColor":"color-primary-transparent-active-border","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-primary-active-border","backgroundColor":"transparent","iconTintColor":"color-primary-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"transparent","iconTintColor":"color-basic-transparent-600"}}},"primary":{"borderColor":"color-primary-transparent-default-border","backgroundColor":"color-primary-transparent-default","textColor":"text-basic-color","state":{"checked":{"borderColor":"color-primary-default-border","backgroundColor":"transparent","iconTintColor":"color-primary-default"},"focused":{"borderColor":"color-primary-transparent-focus-border","backgroundColor":"color-primary-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-primary-focus-border","backgroundColor":"transparent","iconTintColor":"color-primary-focus"},"hover":{"borderColor":"color-primary-transparent-hover-border","backgroundColor":"color-primary-transparent-hover"},"checked.hover":{"borderColor":"color-primary-hover-border","backgroundColor":"transparent","iconTintColor":"color-primary-hover"},"active":{"borderColor":"color-primary-transparent-active-border","backgroundColor":"color-primary-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-primary-active-border","backgroundColor":"transparent","iconTintColor":"color-primary-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"transparent","iconTintColor":"color-basic-transparent-600"}}},"success":{"borderColor":"color-success-transparent-default-border","backgroundColor":"color-success-transparent-default","textColor":"text-basic-color","state":{"checked":{"borderColor":"color-success-default-border","backgroundColor":"transparent","iconTintColor":"color-success-default"},"focused":{"borderColor":"color-success-transparent-focus-border","backgroundColor":"color-success-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-success-focus-border","backgroundColor":"transparent","iconTintColor":"color-success-focus"},"hover":{"borderColor":"color-success-transparent-hover-border","backgroundColor":"color-success-transparent-hover"},"checked.hover":{"borderColor":"color-success-default-hover","backgroundColor":"transparent","iconTintColor":"color-success-hover"},"active":{"borderColor":"color-success-transparent-active-border","backgroundColor":"color-success-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-success-active-border","backgroundColor":"transparent","iconTintColor":"color-success-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"transparent","iconTintColor":"color-basic-transparent-600"}}},"info":{"borderColor":"color-info-transparent-default-border","backgroundColor":"color-info-transparent-default","textColor":"text-basic-color","state":{"checked":{"borderColor":"color-info-default-border","backgroundColor":"transparent","iconTintColor":"color-info-default"}
1,"focused":{"borderColor":"color-info-transparent-focus-border","backgroundColor":"color-info-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-info-focus-border","backgroundColor":"transparent","iconTintColor":"color-info-focus"},"hover":{"borderColor":"color-info-transparent-hover-border","backgroundColor":"color-info-transparent-hover"},"checked.hover":{"borderColor":"color-info-default-hover","backgroundColor":"transparent","iconTintColor":"color-info-hover"},"active":{"borderColor":"color-info-transparent-active-border","backgroundColor":"color-info-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-info-active-border","backgroundColor":"transparent","iconTintColor":"color-info-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"transparent","iconTintColor":"color-basic-transparent-600"}}},"warning":{"borderColor":"color-warning-transparent-default-border","backgroundColor":"color-warning-transparent-default","textColor":"text-basic-color","state":{"checked":{"borderColor":"color-warning-default-border","backgroundColor":"transparent","iconTintColor":"color-warning-default"},"focused":{"borderColor":"color-warning-transparent-focus-border","backgroundColor":"color-warning-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-warning-focus-border","backgroundColor":"transparent","iconTintColor":"color-warning-focus"},"hover":{"borderColor":"color-warning-transparent-hover-border","backgroundColor":"color-warning-transparent-hover"},"checked.hover":{"borderColor":"color-warning-default-hover","backgroundColor":"transparent","iconTintColor":"color-warning-hover"},"active":{"borderColor":"color-warning-transparent-active-border","backgroundColor":"color-warning-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-warning-active-border","backgroundColor":"transparent","iconTintColor":"color-warning-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"transparent","iconTintColor":"color-basic-transparent-600"}}},"danger":{"borderColor":"color-danger-transparent-default-border","backgroundColor":"color-danger-transparent-default","textColor":"text-basic-color","state":{"checked":{"borderColor":"color-danger-default-border","backgroundColor":"transparent","iconTintColor":"color-danger-default"},"focused":{"borderColor":"color-danger-transparent-focus-border","backgroundColor":"color-danger-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-danger-focus-border","backgroundColor":"transparent","iconTintColor":"color-danger-focus"},"hover":{"borderColor":"color-danger-transparent-hover-border","backgroundColor":"color-danger-transparent-hover"},"checked.hover":{"borderColor":"color-danger-default-hover","backgroundColor":"transparent","iconTintColor":"color-danger-hover"},"active":{"borderColor":"color-danger-transparent-active-border","backgroundColor":"color-danger-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-danger-active-border","backgroundColor":"transparent","iconTintColor":"color-danger-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","textColor":"text-disabled-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"transparent","iconTintColor":"color-basic-transparent-600"}}},"control":{"borderColor":"color-control-transparent-default-border","backgroundColor":"color-control-transparent-default","textColor":"text-control-color","state":{"checked":{"borderColor":"color-control-default-border","backgroundColor":"transparent","iconTintColor":"color-control-default"}
1,"focused":{"borderColor":"color-control-transparent-focus-border","backgroundColor":"color-control-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-control-focus-border","backgroundColor":"transparent","iconTintColor":"color-control-focus"},"hover":{"borderColor":"color-control-transparent-hover-border","backgroundColor":"color-control-transparent-hover"},"checked.hover":{"borderColor":"color-control-hover-border","backgroundColor":"transparent","iconTintColor":"color-control-hover"},"active":{"borderColor":"color-control-transparent-active-border","backgroundColor":"color-control-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-control-active-border","backgroundColor":"transparent","iconTintColor":"color-control-active"},"disabled":{"borderColor":"color-control-transparent-disabled-border","backgroundColor":"color-control-transparent-disabled","textColor":"text-control-color"},"checked.disabled":{"borderColor":"color-basic-transparent-600","backgroundColor":"transparent","iconTintColor":"color-basic-transparent-600"}}}}}}}},"RadioGroup":{"meta":{"scope":"all","parameters":{"itemMarginVertical":{"type":"number"}},"appearances":{"default":{"default":true}},"variantGroups":{},"states":{}},"appearances":{"default":{"mapping":{"itemMarginVertical":8}}}},"Spinner":{"meta":{"scope":"all","parameters":{"width":{"type":"number"},"height":{"type":"number"},"borderWidth":{"type":"number"},"borderRadius":{"type":"number"},"borderColor":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{"status":{"basic":{"default":false},"primary":{"default":true},"success":{"default":false},"info":{"default":false},"warning":{"default":false},"danger":{"default":false},"control":{"default":false}},"size":{"tiny":{"default":false},"small":{"default":false},"medium":{"default":true},"large":{"default":false},"giant":{"default":false}}},"states":{}},"appearances":{"default":{"mapping":{},"variantGroups":{"status":{"basic":{"borderColor":"color-basic-default"},"primary":{"borderColor":"color-primary-default"},"success":{"borderColor":"color-success-default"},"info":{"borderColor":"color-info-default"},"warning":{"borderColor":"color-warning-default"},"danger":{"borderColor":"color-danger-default"},"control":{"borderColor":"color-control-default"}},"size":{"tiny":{"width":16,"height":16,"borderRadius":8,"borderWidth":2.3},"small":{"width":20,"height":20,"borderRadius":10,"borderWidth":2.8},"medium":{"width":24,"height":24,"borderRadius":12,"borderWidth":3.4},"large":{"width":28,"height":28,"borderRadius":14,"borderWidth":3.9},"giant":{"width":32,"height":32,"borderRadius":16,"borderWidth":4.5}}}}}},"Tab":{"meta":{"scope":"all","parameters":{"textFontFamily":{"type":"string"},"textFontSize":{"type":"number"},"textFontWeight":{"type":"number"},"textMarginVertical":{"type":"number"},"textColor":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconMarginVertical":{"type":"number"},"iconTintColor":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{},"states":{"selected":{"default":false,"priority":0,"scope":"all"},"hover":{"default":false,"priority":1,"scope":"all"},"focused":{"default":false,"priority":2,"scope":"all"}}},"appearances":{"default":{"mapping":{"textMarginVertical":2,"textFontSize":14,"textFontWeight":"bold","textFontFamily":"text-font-family","textColor":"text-hint-color","iconWidth":24,"iconHeight":24,"iconMarginVertical":2,"iconTintColor":"text-hint-color","state":{"hover":{"textColor":"text-primary-hover-color","iconTintColor":"text-primary-hover-color"},"selected":{"textColor":"text-primary-color","iconTintColor":"text-primary-color"}}}}}},"TabBar":{"meta":{"scope":"all","parameters":{"paddingVertical":{"type":"number"},"backgroundColor":{"type":"string"},"indicatorHeight":{"type":"number"},"indicatorBorderRadius":{"type":"number"},"indicatorBackgroundColor":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{},"states":{}},"appearances":{"default":{"mapping":{"paddingVertical":4,"backgroundColor":"background-basic-color-1","indicatorHeight":4,"indicatorBorderRadius":2,"indicatorBackgroun
1dColor":"color-primary-default"}}}},"Text":{"meta":{"scope":"all","parameters":{"fontFamily":{"type":"string"},"fontSize":{"type":"number"},"fontWeight":{"type":"string"},"color":{"type":"string"}},"appearances":{"default":{"default":true},"alternative":{"default":false},"hint":{"default":false}},"variantGroups":{"category":{"h1":{"default":false},"h2":{"default":false},"h3":{"default":false},"h4":{"default":false},"h5":{"default":false},"h6":{"default":false},"s1":{"default":false},"s2":{"default":false},"p1":{"default":true},"p2":{"default":false},"c1":{"default":false},"c2":{"default":false},"label":{"default":false}},"status":{"basic":{"default":false},"primary":{"default":false},"success":{"default":false},"info":{"default":false},"warning":{"default":false},"danger":{"default":false},"control":{"default":false}}},"states":{}},"appearances":{"default":{"mapping":{"color":"text-basic-color"},"variantGroups":{"category":{"h1":{"fontSize":"text-heading-1-font-size","fontWeight":"text-heading-1-font-weight","fontFamily":"text-heading-1-font-family"},"h2":{"fontSize":"text-heading-2-font-size","fontWeight":"text-heading-2-font-weight","fontFamily":"text-heading-2-font-family"},"h3":{"fontSize":"text-heading-3-font-size","fontWeight":"text-heading-3-font-weight","fontFamily":"text-heading-3-font-family"},"h4":{"fontSize":"text-heading-4-font-size","fontWeight":"text-heading-4-font-weight","fontFamily":"text-heading-4-font-family"},"h5":{"fontSize":"text-heading-5-font-size","fontWeight":"text-heading-5-font-weight","fontFamily":"text-heading-5-font-family"},"h6":{"fontSize":"text-heading-6-font-size","fontWeight":"text-heading-6-font-weight","fontFamily":"text-heading-6-font-family"},"s1":{"fontSize":"text-subtitle-1-font-size","fontWeight":"text-subtitle-1-font-weight","fontFamily":"text-subtitle-1-font-family"},"s2":{"fontSize":"text-subtitle-2-font-size","fontWeight":"text-subtitle-2-font-weight","fontFamily":"text-subtitle-2-font-family"},"p1":{"fontSize":"text-paragraph-1-font-size","fontWeight":"text-paragraph-1-font-weight","fontFamily":"text-paragraph-1-font-family"},"p2":{"fontSize":"text-paragraph-2-font-size","fontWeight":"text-paragraph-2-font-weight","fontFamily":"text-paragraph-2-font-family"},"c1":{"fontSize":"text-caption-1-font-size","fontWeight":"text-caption-1-font-weight","fontFamily":"text-caption-1-font-family"},"c2":{"fontSize":"text-caption-2-font-size","fontWeight":"text-caption-2-font-weight","fontFamily":"text-caption-2-font-family"},"label":{"fontSize":"text-label-font-size","fontWeight":"text-label-font-weight","fontFamily":"text-label-font-family"}},"status":{"basic":{"color":"text-basic-color"},"primary":{"color":"text-primary-color"},"success":{"color":"text-success-color"},"info":{"color":"text-info-color"},"warning":{"color":"text-warning-color"},"danger":{"color":"text-danger-color"},"control":{"color":"text-control-color"}}}},"alternative":{"mapping":{"color":"text-alternate-color"}},"hint":{"mapping":{"color":"text-hint-color"}}}},"Toggle":{"meta":{"scope":"all","parameters":{"width":{"type":"number"},"height":{"type":"number"},"borderRadius":{"type":"number"},"borderWidth":{"type":"number"},"borderColor":{"type":"string"},"backgroundColor":{"type":"string"},"thumbWidth":{"type":"number"},"thumbHeight":{"type":"number"},"thumbBorderRadius":{"type":"number"},"thumbBackgroundColor":{"type":"string"},"textMarginHorizontal":{"type":"number"},"textFontFamily":{"type":"string"},"textFontSize":{"type":"number"},"textFontWeight":{"type":"string"},"textColor":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconTintColor":{"type":"string"},"outlineWidth":{"type":"number"},"outlineHeight":{"type":"number"},"outlineBorderRadius":{"type":"number"},"outlineBackgroundColor":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{"status":{"basic":{"default":true},"primary":{"default":false},"success":{"default":false},"info":{"default":false},"warning":{"default":false},"danger":{"default":false},"control":{"default":false}}},"states":{"checked":{"default":false,"priority":0,"scope":"all"},"hover":{"default":false,"priority":1,"scope":"all"},"disabled":{"default":false,"priority":2,"scope":"all"},"active":{"default":false,"priority":3,"scope":"all"}
1,"focused":{"default":false,"priority":4,"scope":"all"}}},"appearances":{"default":{"mapping":{"width":52,"height":32,"borderRadius":16,"borderWidth":"border-width","thumbWidth":28,"thumbHeight":28,"thumbBorderRadius":14,"outlineWidth":64,"outlineHeight":42,"outlineBorderRadius":21,"textMarginHorizontal":12,"textFontSize":"text-subtitle-2-font-size","textFontWeight":"text-subtitle-2-font-weight","textFontFamily":"text-subtitle-2-font-family","iconWidth":12,"iconHeight":12},"variantGroups":{"status":{"basic":{"borderColor":"color-basic-transparent-default-border","backgroundColor":"color-basic-transparent-default","thumbBackgroundColor":"background-basic-color-1","outlineBackgroundColor":"transparent","textColor":"text-basic-color","iconTintColor":"transparent","state":{"checked":{"borderColor":"color-primary-default-border","backgroundColor":"color-primary-default","iconTintColor":"text-primary-color"},"focused":{"borderColor":"color-primary-transparent-focus-border","backgroundColor":"color-primary-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-primary-focus-border","backgroundColor":"color-primary-focus"},"hover":{"borderColor":"color-primary-transparent-hover-border","backgroundColor":"color-primary-transparent-hover"},"checked.hover":{"borderColor":"color-primary-hover-border","backgroundColor":"color-primary-hover"},"active":{"borderColor":"color-primary-transparent-active-border","backgroundColor":"color-primary-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-primary-active-border","backgroundColor":"color-primary-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","thumbBackgroundColor":"color-basic-disabled","textColor":"text-disabled-color"},"checked.disabled":{"iconTintColor":"text-control-color"}}},"primary":{"borderColor":"color-primary-transparent-default-border","backgroundColor":"color-primary-transparent-default","thumbBackgroundColor":"background-basic-color-1","outlineBackgroundColor":"transparent","textColor":"text-basic-color","iconTintColor":"transparent","state":{"checked":{"borderColor":"color-primary-default-border","backgroundColor":"color-primary-default","iconTintColor":"text-primary-color"},"focused":{"borderColor":"color-primary-transparent-focus-border","backgroundColor":"color-primary-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-primary-focus-border","backgroundColor":"color-primary-focus"},"hover":{"borderColor":"color-primary-transparent-hover-border","backgroundColor":"color-primary-transparent-hover"},"checked.hover":{"borderColor":"color-primary-hover-border","backgroundColor":"color-primary-hover"},"active":{"borderColor":"color-primary-transparent-active-border","backgroundColor":"color-primary-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-primary-active-border","backgroundColor":"color-primary-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","thumbBackgroundColor":"color-basic-disabled","textColor":"text-disabled-color"},"checked.disabled":{"iconTintColor":"text-control-color"}}},"success":{"borderColor":"color-success-transparent-default-border","backgroundColor":"color-success-transparent-default","thumbBackgroundColor":"background-basic-color-1","outlineBackgroundColor":"transparent","textColor":"text-basic-color","iconTintColor":"transparent","state":{"checked":{"borderColor":"color-success-default-border","backgroundColor":"color-success-default","iconTintColor":"text-success-color"},"focused":{"borderColor":"color-success-transparent-focus-border","backgroundColor":"color-success-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-success-focus-border","backgroundColor":"color-success-focus"},"hover":{"borderColor":"color-success-transparent-hover-border","backgroundColor":"color-success-transparent-hover"},"checked.hover":{"borderColor":"color-success-hover-border","backgroundColor":"color-success-hover"},"active":{"borderColor":"color-success-transparent-active-border","backgroundColor":"color-success-transparent-active","outlineBackgroun
1dColor":"outline-color"},"checked.active":{"borderColor":"color-success-active-border","backgroundColor":"color-success-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","thumbBackgroundColor":"color-basic-disabled","textColor":"text-disabled-color"},"checked.disabled":{"iconTintColor":"text-control-color"}}},"info":{"borderColor":"color-info-transparent-default-border","backgroundColor":"color-info-transparent-default","thumbBackgroundColor":"background-basic-color-1","outlineBackgroundColor":"transparent","textColor":"text-basic-color","iconTintColor":"transparent","state":{"checked":{"borderColor":"color-info-default-border","backgroundColor":"color-info-default","iconTintColor":"text-info-color"},"focused":{"borderColor":"color-info-transparent-focus-border","backgroundColor":"color-info-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-info-focus-border","backgroundColor":"color-info-focus"},"hover":{"borderColor":"color-info-transparent-hover-border","backgroundColor":"color-info-transparent-hover"},"checked.hover":{"borderColor":"color-info-hover-border","backgroundColor":"color-info-hover"},"active":{"borderColor":"color-info-transparent-active-border","backgroundColor":"color-info-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-info-active-border","backgroundColor":"color-info-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","thumbBackgroundColor":"color-basic-disabled","textColor":"text-disabled-color"},"checked.disabled":{"iconTintColor":"text-control-color"}}},"warning":{"borderColor":"color-warning-transparent-default-border","backgroundColor":"color-warning-transparent-default","thumbBackgroundColor":"background-basic-color-1","outlineBackgroundColor":"transparent","textColor":"text-basic-color","iconTintColor":"transparent","state":{"checked":{"borderColor":"color-warning-default-border","backgroundColor":"color-warning-default","iconTintColor":"text-warning-color"},"focused":{"borderColor":"color-warning-transparent-focus-border","backgroundColor":"color-warning-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-warning-focus-border","backgroundColor":"color-warning-focus"},"hover":{"borderColor":"color-warning-transparent-hover-border","backgroundColor":"color-warning-transparent-hover"},"checked.hover":{"borderColor":"color-warning-hover-border","backgroundColor":"color-warning-hover"},"active":{"borderColor":"color-warning-transparent-active-border","backgroundColor":"color-warning-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-warning-active-border","backgroundColor":"color-warning-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","thumbBackgroundColor":"color-basic-disabled","textColor":"text-disabled-color"},"checked.disabled":{"iconTintColor":"text-control-color"}}},"danger":{"borderColor":"color-danger-transparent-default-border","backgroundColor":"color-danger-transparent-default","thumbBackgroundColor":"background-basic-color-1","outlineBackgroundColor":"transparent","textColor":"text-basic-color","iconTintColor":"transparent","state":{"checked":{"borderColor":"color-danger-default-border","backgroundColor":"color-danger-default","iconTintColor":"text-danger-color"},"focused":{"borderColor":"color-danger-transparent-focus-border","backgroundColor":"color-danger-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-danger-focus-border","backgroundColor":"color-danger-focus"},"hover":{"borderColor":"color-danger-transparent-hover-border","backgroundColor":"color-danger-transparent-hover"},"checked.hover":{"borderColor":"color-danger-hover-border","backgroundColor":"color-danger-hover"},"active":{"borderColor":"color-danger-transparent-active-border","backgroundColor":"color-danger-transparent-active","outlineBackgroun
1dColor":"outline-color"},"checked.active":{"borderColor":"color-danger-active-border","backgroundColor":"color-danger-active"},"disabled":{"borderColor":"color-basic-transparent-disabled-border","backgroundColor":"color-basic-transparent-disabled","thumbBackgroundColor":"color-basic-disabled","textColor":"text-disabled-color"},"checked.disabled":{"iconTintColor":"text-control-color"}}},"control":{"borderColor":"color-control-transparent-default-border","backgroundColor":"color-control-transparent-default","thumbBackgroundColor":"color-control-default","outlineBackgroundColor":"transparent","textColor":"text-control-color","iconTintColor":"transparent","state":{"checked":{"borderColor":"color-control-transparent-default-border","backgroundColor":"color-control-transparent-default","iconTintColor":"color-basic-800"},"focused":{"borderColor":"color-control-transparent-focus-border","backgroundColor":"color-control-transparent-focus","outlineBackgroundColor":"outline-color"},"checked.focused":{"borderColor":"color-control-transparent-focus-border","backgroundColor":"color-control-transparent-focus"},"hover":{"borderColor":"color-control-transparent-hover-border","backgroundColor":"color-control-transparent-hover"},"checked.hover":{"borderColor":"color-control-transparent-hover-border","backgroundColor":"color-control-transparent-hover"},"active":{"borderColor":"color-control-transparent-active-border","backgroundColor":"color-control-transparent-active","outlineBackgroundColor":"outline-color"},"checked.active":{"borderColor":"color-control-transparent-active-border","backgroundColor":"color-control-transparent-active"},"disabled":{"borderColor":"color-control-transparent-disabled-border","backgroundColor":"color-control-transparent-disabled","thumbBackgroundColor":"color-basic-transparent-600","textColor":"text-control-color"},"checked.disabled":{"iconTintColor":"text-control-color"}}}}}}}},"Tooltip":{"meta":{"scope":"all","parameters":{"paddingHorizontal":{"type":"number"},"paddingVertical":{"type":"number"},"borderWidth":{"type":"number"},"borderRadius":{"type":"number"},"borderColor":{"type":"string"},"backgroundColor":{"type":"string"},"indicatorBackgroundColor":{"type":"string"},"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconMarginHorizontal":{"type":"number"},"iconTintColor":{"type":"string"},"textMarginHorizontal":{"type":"number"},"textFontFamily":{"type":"string"},"textFontSize":{"type":"number"},"textFontWeight":{"type":"number"},"textColor":{"type":"string"}},"appearances":{"default":{"default":true}},"variantGroups":{},"states":{}},"appearances":{"default":{"mapping":{"borderRadius":"border-radius","borderColor":"background-alternative-color-3","backgroundColor":"background-alternative-color-3","paddingHorizontal":16,"paddingVertical":8,"indicatorBackgroundColor":"background-alternative-color-3","textMarginHorizontal":4,"textFontSize":"text-caption-1-font-size","textFontWeight":"text-caption-1-font-weight","textFontFamily":"text-caption-1-font-family","textColor":"text-alternate-color","iconWidth":14,"iconHeight":14,"iconMarginHorizontal":4,"iconTintColor":"text-alternate-color"}}}},"TopNavigation":{"meta":{"scope":"mobile","parameters":{"minHeight":{"type":"number"},"paddingVertical":{"type":"number"},"paddingHorizontal":{"type":"number"},"backgroundColor":{"type":"string"},"titleTextAlign":{"type":"string"},"titleFontFamily":{"type":"string"},"titleFontSize":{"type":"number"},"titleFontWeight":{"type":"string"},"titleColor":{"type":"string"},"subtitleTextAlign":{"type":"string"},"subtitleFontFamily":{"type":"string"},"subtitleFontSize":{"type":"number"},"subtitleFontWeight":{"type":"string"},"subtitleColor":{"type":"string"}},"appearances":{"default":{"default":true},"control":{"default":false}},"variantGroups":{"alignment":{"start":{"default":true},"center":{"default":false}}},"states":{}},"appearances":{"default":{"mapping":{"minHeight":56,"paddingVertical":8,"paddingHorizontal":8,"backgroundColor":"background-basic-color-1","titleFontSize":"text-subtitle-1-font-size","titleFontWeight":"text-subtitle-1-font-weight","titleFontFamily":"text-subtitle-1-font-family","titleColor":"text-basic-color","subtitleFontSize":"text-caption-1-font-size","subtitleFontWeight":"text-caption-1-font-weight","subtitleFontFamily":"text-caption-1-font-family","subtitleColor":"text-hint-color"},"variantGroups":{"alignment":{"start":{"titleTextAlign":"left","subtitleTextAlign":"left"}
1,"center":{"titleTextAlign":"center","subtitleTextAlign":"center"}}}},"control":{"mapping":{"backgroundColor":"transparent"}}}},"TopNavigationAction":{"meta":{"scope":"mobile","parameters":{"iconWidth":{"type":"number"},"iconHeight":{"type":"number"},"iconTintColor":{"type":"string"},"iconMarginHorizontal":{"type":"number"}},"appearances":{"default":{"default":true},"control":{"default":false}},"variantGroups":{},"states":{"hover":{"default":false,"priority":0,"scope":"all"},"active":{"default":false,"priority":1,"scope":"all"},"focused":{"default":false,"priority":2,"scope":"all"},"disabled":{"default":false,"priority":3,"scope":"all"}}},"appearances":{"default":{"mapping":{"iconWidth":24,"iconHeight":24,"iconMarginHorizontal":8,"iconTintColor":"text-basic-color","state":{"hover":{"iconTintColor":"text-hint-color"},"focused":{"iconTintColor":"text-hint-color"},"active":{"iconTintColor":"text-hint-color"},"disabled":{"iconTintColor":"text-hint-color"}}}},"control":{"mapping":{"iconTintColor":"color-control-default","state":{"hover":{"iconTintColor":"color-control-hover"},"focused":{"iconTintColor":"color-control-focus"},"active":{"iconTintColor":"color-control-active"},"disabled":{"iconTintColor":"color-control-disabled"}}}}}}}}'),s=JSON.parse('{"color-basic-default":"#F5F7F8","color-basic-800":"#003353","text-primary-disabled-color":"#FFFFFF","color-primary-disabled":"#99D9FA","color-primary-100":"#CBF9FE","color-primary-200":"#98EEFD","color-primary-300":"#64DBFB","color-primary-400":"#3DC4F7","color-primary-500":"#00A0F3","color-primary-600":"#007CD0","color-primary-700":"#005CAE","color-primary-800":"#00418C","color-primary-900":"#002F74","color-success-100":"#EFFCD1","color-success-200":"#DCF9A5","color-success-300":"#BFEF76","color-success-400":"#A0E052","color-success-500":"#76CC20","color-success-600":"#5BAF17","color-success-700":"#449210","color-success-800":"#30760A","color-success-900":"#216106","color-info-100":"#DBF2FF","color-info-200":"#B8E3FF","color-info-300":"#95D0FF","color-info-400":"#7ABEFF","color-info-500":"#4FA1FF","color-info-600":"#397DDB","color-info-700":"#275DB7","color-info-800":"#194193","color-info-900":"#0F2D7A","color-warning-100":"#FEFDCF","color-warning-200":"#FDFBA0","color-warning-300":"#FBF770","color-warning-400":"#F7F14C","color-warning-500":"#EB9928","color-warning-600":"#D0C80D","color-warning-700":"#AEA709","color-warning-800":"#8C8606","color-warning-900":"#746E03","color-danger-100":"#FDE8D4","color-danger-200":"#FBCBAA","color-danger-300":"#F4A57F","color-danger-400":"#FF9356","color-danger-500":"#DD4A2C","color-danger-600":"#BE2E20","color-danger-700":"#9F1816","color-danger-800":"#800E14","color-danger-900":"#6A0815","border-basic-color-4":"#668598"}'),c=i},47639:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var o=n(50016),r=n(4670),a=n(14425),l=n(32553);const i=(0,n(8289).JK)({Component:e=>{let{onPress:t,checked:n,label:i,labelLeft:s=!1,disabled:c=!1,style:d,labelStyle:u,...m}=e;const p=()=>{!c&&t&&t(!n)},g=[u,{opacity:c?.3:1}];return o.createElement(r.A,{style:[{flexDirection:"row",alignItems:"center",alignSelf:"flex-start"},d],onPress:p,disabled:c},s&&o.createElement(l.u8,{style:[g,{marginRight:10}]},i),o.createElement(a.CheckBox,Object.assign({checked:n,onChange:p,disabled:c},m)),!s,!!i&&o.createElement(l.u8,{style:[g,{marginLeft:10}]},i))},valuePropertyName:"checked",changePropertyName:"onPress"})},74881:(e,t,n)=>{"use strict";n.d(t,{w:()=>l});var o=n(50016),r=n(73478),a=n(23328);const l=e=>{let{value:t,label:n,required:l,disabled:i,autoFocus:s,placeholder:c,maxLength:d,onChangeText:u,validate:m,testID:p}=e;const[g,h]=(0,o.useState)(!1);return o.createElement(r.HG,{prefix:"$",size:"large",value:t,label:n,decimalScale:2,fixedDecimalScale:!g,required:l,disabled:i,autoFocus:s,allowNegative:!1,keyboardType:"number-pad",customInput:a.x,placeholder:c,onValueChange:e=>{u&&u(e)},validate:()=>m?m(parseFloat(t||"").toString()):"",testID:p,valueIsNumericString:!0,thousandSeparator:!0,maxLength:d,onFocus:()=>{h(!0)},onBlur:()=>{h(!1)}})}},64156:(e,t,n)=>{"use strict";n.d(t,{f:()=>l});var o=n(50016),r=n(73478),a=n(23328);const l=e=>{let{size:t="large",value:n,label:l,format:i="MM/DD/YYYY",required:s,disabled:c,placeholder:d,validate:u,onChangeText:m,testID:p}=e;const g=i.replace(/([A-Z])/g,"#");return o.createElement(r.K9,{format:g,placeholder:d||i,size:t,label:l,value:n,required:s,disabled:c,keyboardType:"number-pad",customInput:a.x,validate:u,allowEmptyFormatting:!1,onValueChange:e=>{m&&m(e.formattedValue)},testID:p})}},24594:(e,t,n)=>{"use strict";n.d(t,{Tr:()=>C,US:()=>f});var o=n(50016),r=n(38325),a=n(7371),l=n(97585),i=n(19925),s=n(8289),c=n(23049),d=n(32553),u=n(14425),m=n(58876),p=n(90768),g=n(59898);const h=p.MoneyMask.prototype.getValue;p.MoneyMask.prototype.getValue=function(e,t){const n=e.indexOf("-")>=0,o=h.apply(this,[e,t]);return!n||!o||o.indexOf("-")>=0?o:o.startsWith("$")?"$-"+o.substring(1):"-"+o};const v=(0,o.forwardRef)(((e,t)=>{let{rightComponent:n,leftComponent:r,value:a,clearable:l=!1,disabled:s=!1,errorText:c,onChangeText:d,onClear:p,status:h="basic",mandatory:v=!1,label:y,style:b,size:E,showClearIcon:C,labelStyle:A,textStyle:S,errorTextComponent:w,...P}=e;const I=(0,o.useMemo)((()=>
1{if(r)return r}),[r]),x=(0,o.useMemo)((()=>(l||p)&&a&&!s&&C?o.createElement(o.Fragment,null,n,o.createElement(f,{onPress:()=>{d&&d(""),p&&p()}})):n?o.createElement(o.Fragment,null,n):void 0),[l,s,d,p,n,a,C]),{sm:D}=(0,i.Qs)();return o.createElement(u.Input,Object.assign({autoCorrect:!1,autoCapitalize:m.qK.NONE,label:()=>o.createElement(g.l,{labelStyle:A,required:v},y),onChangeText:d,status:c?"danger":h,caption:w||c,size:E||(D?"large":"medium"),value:a,disabled:s,accessoryLeft:I,accessoryRight:x,style:b,textStyle:S,ref:t},P))})),y=e=>{let{style:t,focused:n=!1,children:r,hasError:l=!1,size:c,...d}=e;const u=(0,i.DP)();let m=40;return"large"===c&&(m=48),"small"===c&&(m=32),o.createElement(a.A,Object.assign({style:(0,s.i_)({minHeight:m,backgroundColor:u["background-basic-color-1"],borderWidth:1,borderRadius:5,flex:1,borderColor:l?u["border-danger-color-1"]:u["border-basic-color-4"]},n&&{backgroundColor:u["background-basic-color-1"],borderColor:l?u["border-danger-color-1"]:u["color-primary-default"]},t)},d),r)},b=(0,o.forwardRef)(((e,t)=>{var n;let{caption:c,label:u,rightComponent:p,leftComponent:h,inputComponent:v,placeholder:b,value:E,onChangeText:C,onFocus:A,onBlur:S,inputMask:w,maskType:P,maskOptions:I,errorText:x,clearable:D=!1,onClear:T,mandatory:k=!1,disabled:B=!1,size:F,style:_,containerStyle:N,textStyle:R={},...L}=e;const[M,O]=(0,o.useState)(!1),z=(0,i.DP)(),{sm:j}=(0,i.Qs)(),W=(0,s.i_)({flex:1,paddingHorizontal:10,marginVertical:2,fontSize:15,paddingVertical:0,color:z["text-basic-color"]},r.A.select({web:{outlineColor:"transparent"}}),R),V=e=>{A&&A(e),O(!0)},H=e=>{S&&S(e),O(!1)},U=(0,o.useMemo)((()=>x||c?o.createElement(d.u8,{size:12,style:{color:x?z["text-danger-color"]:z["text-hint-color"]}},x||c):null),[c,x,z]);return o.createElement(a.A,null,o.createElement(g.l,{required:k},u),o.createElement(y,{style:(0,s.i_)({flexDirection:"row",alignItems:"center"},N),focused:M,size:F||(j?"large":"medium"),hasError:!!x},h,null!==(n=v?v({onFocus:A,onBlur:S,onChangeText:C,value:E,autoCorrect:!1,autoCapitalize:m.qK.NONE,placeholder:b,disabled:B,style:(0,s.i_)(W,_),placeholderTextColor:z["text-hint-color"],...L}):o.createElement(l.s6,Object.assign({autoCorrect:!1,style:(0,s.i_)(W,_),autoCapitalize:m.qK.NONE,onFocus:V,onBlur:H,editable:!B,type:P||"custom",options:{mask:w,...I},placeholder:b,value:E?String(E):"",placeholderTextColor:z["text-hint-color"],onChangeText:C,ref:t},L)))&&void 0!==n?n:null,p,(D||!!T)&&!!E&&!B&&o.createElement(f,{onPress:()=>{T&&T(),C&&C("")}})),U)})),f=e=>{let{onPress:t}=e;const n=(0,i.DP)();return o.createElement(c.Ay,{name:"close",size:18,style:{marginRight:5},onPress:t,color:n["text-hint-color"]})},E=(0,o.forwardRef)(((e,t)=>{let{maskType:n,inputMask:r,errorText:a,onFocus:l,onBlur:c,inputComponent:d,onChangeText:u,toRemoveRegex:m,validateInput:p,validateInputOnBlur:g,value:h,maskOptions:y,...f}=e;const{onBlur:E,onFocus:C}=(0,i.Lx)(),[A,S]=o.useState(a),[w,P]=(0,o.useState)(!1),I=e=>{l&&l(e),C()},x=(0,i.A8)({validateInput:p,validateInputOnBlur:g,onInputBlur:c,setError:S,toRemoveRegex:m}),D=e=>{x(e.nativeEvent.text),E(),P(!0)},T=(0,i.Gz)({validateInput:p,validateInputOnBlur:g,onChangeText:u,setError:S,toRemoveRegex:m}),k=!!h&&(!p||!p(h));(0,o.useEffect)((()=>{w&&T&&T(h||"")}),[w,k,h]),(0,o.useEffect)((()=>{A&&P(!0)}),[A]);const B=(0,o.useCallback)((e=>{const t=e.replace(s.o$,"");T&&T(t)}),[T]);return n||r||y||d?o.createElement(b,Object.assign({inputMask:r,maskType:n,maskOptions:y,onFocus:I,value:h,onBlur:D,inputComponent:d,errorText:A,onChangeText:B,ref:t},f)):o.createElement(v,Object.assign({onFocus:I,onBlur:D,value:h,errorText:A,onChangeText:B,ref:t},f))})),C=(0,i.L4)(E)},85921:(e,t,n)=>{"use strict";n.d(t,{C:()=>l});var o=n(50016),r=n(14425),a=n(59898);const l=e=>{let{label:t,required:n,validate:l,labelStyle:i,validateEmptyStateOnBlur:s,keepValidationStateOnFocus:c,captionComponent:d,...u}=e;const[m,p]=(0,o.useState)({}),g=(0,o.useCallback)((e=>{if(l){var t;const n=l(null!==e&&void 0!==e?e:""),r=n?"danger":null!==(t=u.status)&&void 0!==t?t:"basic",a=d?o.cloneElement(d,{text:n||""}):void 0;p((e=>e.status!==r||e.caption!==(a||n)?{status:r,caption:a||n}:e))}}),[l,d,u.status]);(0,o.useEffect)((()=>{u.value&&g(u.value.replace(/[^\d]/g,""))}),[u.value]);return o.createElement(r.Input,Object.assign({autoComplete:"new-password"},u,{label:t&&o.createElement(a.l,{labelStyle:i,required:n},t),onFocus:e=>{l&&!c&&p({}
1),u.onFocus&&u.onFocus(e)},onBlur:e=>{l&&(u.value||s)&&g(u.value),u.onBlur&&u.onBlur(e)},onChangeText:e=>{g(e),u.onChangeText&&u.onChangeText(e)}},m))}},59898:(e,t,n)=>{"use strict";n.d(t,{l:()=>a});var o=n(50016),r=n(32553);const a=e=>{let{children:t,required:n,labelStyle:a,...l}=e;return o.createElement(r.u8,Object.assign({},l,{size:12,weight:"500",color:"#003353",style:[{marginBottom:5},a]}),t,n&&o.createElement("span",{style:{color:"#EC002A"}}," *"))}},23328:(e,t,n)=>{"use strict";n.d(t,{x:()=>c});var o=n(50016),r=n(78267),a=n(7371),l=n(14425),i=n(59898),s=n(2490);const c=(0,o.forwardRef)(((e,t)=>{let{label:n,validate:r,required:c=!1,value:u="",onChangeText:m,onFocus:p,onBlur:g,status:h,...v}=e;const[y,b]=(0,o.useState)(!1),[f,E]=(0,o.useState)(!1),[C,A]=(0,o.useState)(""),S=(0,o.useCallback)((e=>{if(!r)return;const t=r(e);A(t||"")}),[r]),w=(0,o.useCallback)((e=>{m&&m(e)}),[m]),P=(0,o.useCallback)((e=>{b(!0),p&&p(e)}),[p]),I=(0,o.useCallback)((e=>{S(u),b(!1),E(!0),g&&g(e)}),[g,S,u]);(0,o.useEffect)((()=>{S(u)}),[u,S]);const x=!!C&&!y&&f;return o.createElement(a.A,{style:d.container},o.createElement(l.Input,Object.assign({autoComplete:"new-password",autoCapitalize:"none",autoCorrect:!1,ref:t,value:u,onChangeText:w,onFocus:P,onBlur:I,status:"basic",size:"large",style:[d.input,y?d.inputFocused:x?d.inputError:{}],label:n&&o.createElement(i.l,{labelStyle:[d.label,x&&d.labelError],required:c},n),caption:x?o.createElement(s.A,{text:C}):void 0,maxLength:v.maxLength||255},v)))})),d=r.A.create({container:{marginBottom:4},input:{borderWidth:2,borderRadius:4,borderColor:"#99ADBA"},inputFocused:{borderColor:"#00A0F3"},inputError:{borderColor:"#EC002A",backgroundColor:"#FFF2F4"},label:{fontFamily:"Inter, sans-serif",fontSize:12,fontWeight:"600",lineHeight:18,color:"#001929"},labelError:{color:"#EC002A"}})},23019:(e,t,n)=>{"use strict";n.d(t,{Y:()=>l});var o=n(50016),r=n(73478),a=n(23328);const l=e=>{let{format:t,placeholder:n,label:l,value:i,disabled:s,validate:c,required:d,onChangeText:u,onBlur:m,testID:p}=e;return o.createElement(r.K9,{format:t,placeholder:n,label:l,value:i,disabled:s,required:d,customInput:a.x,keyboardType:"number-pad",allowEmptyFormatting:!1,validate:c,onValueChange:e=>{u&&u(e.value)},onBlur:e=>m&&m(e),valueIsNumericString:!0,testID:p})}},16824:(e,t,n)=>{"use strict";n.d(t,{v:()=>s});var o=n(50016),r=n(73478),a=n(85921),l=n(89077),i=n(69991);const s=e=>{let{size:t="large",value:n,countryCode:s="US",label:c,required:d,disabled:u,placeholder:m,validate:p,validationError:g,onChangeText:h,testID:v,style:y,format:b="###-###-####"}=e;const[f,E]=(0,o.useState)((()=>{try{var e;return n?null===(e=(0,l.L)(n,s).nationalNumber)||void 0===e?void 0:e.toString():""}catch{return""}}));return o.createElement(r.K9,{format:b,placeholder:m,size:t,label:c,value:f,required:d,disabled:u,keyboardType:"number-pad",customInput:a.C,validate:e=>g?e&&(0,i.F)(e,"US")?"":g:p&&p(e),allowEmptyFormatting:!1,onValueChange:e=>{E(e.formattedValue);const t={raw:e.value,formatted:e.formattedValue,parsed:""};if(h){try{t.parsed=(0,l.L)(e.value,s).number.toString()}catch{t.parsed=e.value}h(t)}},testID:v,style:y})}},72722:(e,t,n)=>{"use strict";n.d(t,{J:()=>s});var o=n(50016),r=n(73478),a=n(89077),l=n(69991),i=n(23328);const s=e=>{let{size:t="large",value:n,countryCode:s="US",label:c,required:d,disabled:u,placeholder:m,validate:p,validationError:g,onChangeText:h,format:v="###-###-####",testID:y}=e;const b=e=>e.replace(/\D/g,""),[f,E]=(0,o.useState)((()=>{try{var e;return n&&(null===(e=(0,a.L)(n,s))||void 0===e?void 0:e.nationalNumber)||""}catch{return b(n||"")}}));(0,o.useEffect)((()=>{const e=b(f);let t="",o="";try{const e=(0,a.L)(n||"",s);o=(null===e||void 0===e?void 0:e.nationalNumber)||"",t=b(o)}catch{t=b(n||"")}t&&t!==e&&E(o||t)}),[f,n,s]);return o.createElement(r.K9,{format:v,placeholder:m,size:t,label:c,value:f,required:d,disabled:u,keyboardType:"number-pad",customInput:i.x,validate:e=>g?e&&(0,l.F)(e,s)?"":g:null===p||void 0===p?void 0:p(e),allowEmptyFormatting:!1,onValueChange:e=>{E(e.formattedValue);const t={raw:e.value,formatted:e.formattedValue,parsed:""};if(h){try{t.parsed=(0,a.L)(e.value,s).number.toString()}catch{t.parsed=e.value}h(t)}},testID:y})}},66387:(e,t,n)=>{"use strict";n.d(t,{a:()=>i});var o=n(50016),r=n(29731),a=n(32553),l=n(23328);const i=e=>{let{...t}=e;const{t:n}=(0,r.Bd)("global"),[i,s]=(0,o.useState)(!1),[c,d]=(0,o.useState)(!1),u=()=>{d((e=>!e))},m=(0,o.useCallback)((e=>o.createElement(o.Fragment,null,!t.disabled&&t.value&&!i&&o.createElement(a.u8,{style:{marginRight:8,color:"#00A0F3"},onPress:u}
1,n(c?"BtSecureInput.Hide":"BtSecureInput.Show")),"function"===typeof t.accessoryRight?t.accessoryRight(e):t.accessoryRight)),[t,i,c,n]);return o.createElement(l.x,Object.assign({},t,{secureTextEntry:!c,accessoryRight:m,onBlur:e=>{s(!1),d(!1),t.onBlur&&t.onBlur(e)},onFocus:e=>{s(!0),d(!0),t.onFocus&&t.onFocus(e)}}))}},83952:(e,t,n)=>{"use strict";n.d(t,{d:()=>l});var o=n(50016),r=n(73478),a=n(66387);const l=e=>{let{size:t="large",label:n,value:l,validate:i,validationError:s,required:c,onChangeText:d,testID:u}=e;return o.createElement(r.K9,{format:"###-##-####",placeholder:"000-00-0000",size:t,label:n,value:l,required:c,customInput:a.a,keyboardType:"number-pad",allowEmptyFormatting:!1,validate:e=>s?9!==(null===l||void 0===l?void 0:l.length)?s:"":i&&i(e),onValueChange:e=>{d&&d(e.value)},valueIsNumericString:!0,testID:u})}},73058:(e,t,n)=>{"use strict";n.d(t,{b:()=>l});var o=n(50016),r=n(73478),a=n(66387);const l=e=>{let{size:t="large",value:n,label:l,required:i,validate:s,validationError:c,onChangeText:d,testID:u}=e;return o.createElement(r.K9,{format:"##-#######",placeholder:"XX-XXXXXXX",size:t,label:l,value:n,required:i,customInput:a.a,keyboardType:"number-pad",allowEmptyFormatting:!1,validate:e=>c?9!==(null===n||void 0===n?void 0:n.length)?c:"":s&&s(e),onValueChange:e=>{d&&d(e.value)},valueIsNumericString:!0,testID:u})}},32553:(e,t,n)=>{"use strict";n.d(t,{QG:()=>d,Zz:()=>s,u8:()=>i,z_:()=>c});var o=n(14425),r=n(50016),a=n(8289),l=n(78267);const i=(0,r.forwardRef)(((e,t)=>{let{size:n=14,color:l="#335C75",weight:i="400",style:s,...c}=e;return r.createElement(o.Text,Object.assign({ellipsizeMode:"tail",style:(0,a.i_)({fontSize:n,fontWeight:i},l&&{color:l},s),ref:t},c))})),s=(0,r.forwardRef)(((e,t)=>{let{...n}=e;return r.createElement(d,Object.assign({size:20,weight:"600",ref:t},n))})),c=(0,r.forwardRef)(((e,t)=>{let{...n}=e;return r.createElement(d,Object.assign({ref:t},n))})),d=(0,r.forwardRef)(((e,t)=>{let{style:n,...o}=e;return r.createElement(i,Object.assign({style:[u.plainText,n],ref:t},o))})),u=l.A.create({plainText:{fontFamily:"Inter, sans-serif",fontSize:14,fontWeight:"500",color:"#001929",lineHeight:20}})},2490:(e,t,n)=>{"use strict";n.d(t,{A:()=>p,R:()=>u});var o=n(50016),r=n(38117),a=n(78267),l=n(7371),i=n(97076),s=n(8289),c=n(29731),d=function(e){return e.CORRECT="#00A0F3",e.WRONG="#EC002A",e}(d||{});const u=e=>{let{containerStyle:t,passwordValidation:n}=e;const{t:a}=(0,c.Bd)("global"),u=e=>e?d.CORRECT:d.WRONG;return o.createElement(l.A,{style:(0,s.i_)(m.container,t)},o.createElement(l.A,{style:m.iconContainer},o.createElement(i.FVU,{width:13,height:13})),o.createElement(r.A,{style:m.errorText},o.createElement(c.x6,{i18nKey:"integrations.pay-as-guest.enter-password.password-hint",t:a,components:{chrs:o.createElement(r.A,{key:"length",style:{color:u(n.length)}}),uprcs:o.createElement(r.A,{key:"uppercase",style:{color:u(n.uppercase)}}),nmbr:o.createElement(r.A,{key:"number",style:{color:u(n.number)}})}})))},m=a.A.create({container:{flexDirection:"row",alignItems:"center"},iconContainer:{marginBottom:2},errorText:{fontSize:12,lineHeight:14.4,color:"#EC002A",fontFamily:"Inter",fontWeight:"400",marginLeft:3}}),p=e=>{let{text:t,containerStyle:n}=e;return t?o.createElement(l.A,{style:(0,s.i_)(m.container,{marginTop:4},n)},o.createElement(l.A,{style:m.iconContainer},o.createElement(i.FVU,{width:13,height:13})),o.createElement(r.A,{style:m.errorText},t)):null}},14329:(e,t,n)=>{"use strict";n.d(t,{BtAlert:()=>Ne,tv:()=>Ee,hr:()=>L,BtButton:()=>g,BtCheckBox:()=>A.o,m:()=>ze,f3:()=>Qe,BtDatePicker:()=>D,BtDropdown:()=>T,KS:()=>Ye,Dy:()=>Ve,WG:()=>Le,BtInput:()=>o.Tr,C0:()=>Oe.C,xb:()=>tt.x,b_:()=>v,p4:()=>O,BtModal:()=>de,BtMonthYearPicker:()=>ee,sy:()=>Ge,vW:()=>qe.v,QG:()=>r.QG,BtProgress:()=>he,BtRadioButton:()=>E,HN:()=>C,BtScreen:()=>Pe,CZ:()=>Xe,BtSecureInput_v1:()=>je.a,BtSelect:()=>H,BtSidebar:()=>we,ZI:()=>He,BtStatus:()=>De,QU:()=>me,HG:()=>ge,pb:()=>Ue,BtText:()=>r.u8,BtTitle:()=>r.Zz,Col:()=>ce,LQ:()=>et,Row:()=>ie,Spacer:()=>c});var o=n(24594),r=n(32553),a=n(50016),l=n(78267),i=n(23049),s=n(7371);function c(e){let{height:t=16,width:n=0}=e;const o=(0,a.useMemo)((()=>({height:t,width:n})),[t,n]);return a.createElement(s.A,{style:o})}var d=n(19925),u=n(14425),m=n(67920);const p=e=>{let{evaProps:t,loading:n,accessoryLeft:o,color:r}=e;return n?a.createElement(s.A,{style:[t.style,{justifyContent:"center",alignItems:"center"}]},a.createElement(m.A,{size:"small",color:r})):"function"===typeof o?o():o},g=(0,a.forwardRef)(((e,t)=>{let{loading:n=!1,iconLeft:o,iconRight:r,accessoryLeft:l,size:i,children:s,...c}=e;const{sm:m}=(0,d.Qs)(),g="ghost"===c.appearance?"#99ADBA":"#FFFFFF",h=o?a.createElement(u.Icon,{fill:g,width:20,height:20,name:o}):null,v=r?a.createElement(u.Icon,{fill:g,width:20,height:20,name:r}):null;return a.createElement(u.Button,Object.assign({accessoryLeft:e=>a.createElement(p,{evaProps:e,loading:n,accessoryLeft:h||l||null,color:"outline"===c.appearance?"#00A0F3":"white"}),accessoryRight:v,size:i||(m?"large":"medium"),ref:t},c),s)}));n(8894),n(451),n(25662),l.A.create({centeredView:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.3)"},backdrop:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.1)"},modalContent:{backgroundColor:"white",borderRadius:12,padding:20,minHeight:200,minWidth:300,maxHeight:"90%",alignItems:"center",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:4,elevation:5},closeIconContainer:{width:"100%",alignItems:"flex-end"},closeIcon:{backgroundColor:"#F5F7F8",padding:10,borderRadius:5},content:{flex:1,alignItems:"center"},icon:{resizeMode:"cover",height:70,width:70,marginBottom:10},titleText:{width:"100%",lineHeight:28,textAlign:"center",marginBottom:12},buttonsContainer:{width:"100%",justifyContent:"space-evenly",marginBottom:20}});var h=n(4670);const v=e=>{let{onPress:t,title:n,color:o,icon:l,textStyle:i,testID:s="link",disabled:c=!1}=e;return a.createElement(h.A,{style:{flexDirection:"row",justifyContent:"center",alignItems:"center"},onPress:t,testID:s,disabled:c},a.createElement(r.u8,{color:o,weight:"500",style:i},n),l)};var y=n(24038);var b=n(5438),f=n(8289);const E=e=>{let{checked:t,onPress:n,label:o,disabled:l=!1,labelLeft:i=!1,containerStyle:s,radioProps:c,children:d,testID:m="",labelStyle:p}=e;const g=(0,f.i_)(i?{marginRight:10}:{marginLeft:10},{fontSize:16},p);return a.createElement(h.A,{disabled:l,style:(0,f.i_)({flexDirection:"row",alignItems:"center",paddingVertical:10},s),onPress:n,testID:m},i&&a.createElement(r.u8,{style:{marginRight:10,fontSize:16}}
1,o),a.createElement(u.Radio,Object.assign({onChange:n,checked:t,disabled:l},c)),!i,a.createElement(r.u8,{style:g},o),d)},C=(0,b.PA)((e=>{let{model:t,name:n,options:o,value:r,onChange:l,disabled:i,groupStyle:c,radioStyle:d,testID:u,labelStyle:m,error:p}=e;return t&&n&&(r=t[n]),a.createElement(a.Fragment,null,a.createElement(s.A,{style:c},o.map((e=>a.createElement(s.A,{key:e.value},a.createElement(E,{checked:e.value===r,label:e.label,onPress:()=>{return o=e.value,l&&l(o),void(t&&n&&t.setValue(n,o));var o},disabled:i,containerStyle:d,testID:"".concat(u||"radioButton",".").concat(e.value),labelStyle:m}))))),!!p&&a.createElement("p",{style:{color:"#dd4a2c",fontSize:12,fontWeight:400,fontFamily:"inherit"}},p))}));var A=n(47639),S=n(74161),w=n.n(S),P=n(59898);const I=new u.NativeDateService("en",{format:"MM/DD/YYYY",startDayOfWeek:1}),x="YYYY-MM-DD";const D=(0,b.PA)((0,a.forwardRef)(((e,t)=>{let{placeholder:n=" ",onChange:o,model:r,name:l,value:s,label:c,min:m,max:p,rightComponent:g,leftComponent:h,testID:v,noIcon:b=!1,clearIcon:E=!0,mandatory:C=!1,returnFormat:A="MM/DD/YYYY",onBlur:S,onFocus:D,style:T,size:k,...B}=e;const[F,_]=(0,a.useState)(null),{sm:N}=(0,d.Qs)();(0,a.useEffect)((()=>(s?_(w()(s)):r&&l&&r[l]&&_(w()(r[l])),()=>_(null))),[s]),(0,a.useEffect)((()=>{let e=F;r&&l&&(e=r[l],!e&&s&&r.setValue(l,s))}),[F]);const R=e=>{const t=e?function(e,t){const n=w()(e);return t?"date"===t?n.toDate():"moment"===t?n:n.format(t):n}(e,A):void 0;r&&l&&(r.setValue?r.setValue(l,t):r[l]=t),o&&o(t||null),_(w()(t))};return a.createElement(u.Datepicker,Object.assign({testID:v,placeholder:n,min:m?w()(m).toDate():w()("1940-01-01",x).toDate(),max:p?w()(p).toDate():w()("2040-01-01",x).toDate(),label:a.createElement(P.l,{required:C},c),date:F?F.toDate():void 0,size:k||(N?"large":"medium"),onSelect:e=>{R(e)},accessoryRight:g||(e=>{const t={...e,size:20,style:{position:"relative"},color:y.Tj.primary};return E&&F?a.createElement(i.Ay,Object.assign({},t,{onPress:()=>R(null),name:"close"})):b?a.createElement(a.Fragment,null):a.createElement(i.Ay,Object.assign({},t,{name:"calendar-month"}))}),onBlur:S,onFocus:D,accessoryLeft:h&&h,dateService:I,style:(0,f.i_)({marginTop:16},T),ref:t},B))}))),T=e=>{let{children:t,anchor:n,placement:o="bottom end",fullWidth:r=!1,...l}=e;const[i,s]=(0,a.useState)(!1),c=(0,a.useMemo)((()=>n?a.cloneElement(n,{...null===n||void 0===n?void 0:n.props,onPress:()=>{s(!0)}}):null),[n]);return c?a.createElement(u.OverflowMenu,Object.assign({anchor:()=>c,visible:i,placement:o,onBackdropPress:()=>s(!1),fullWidth:r},l),a.Children.map(t,(e=>e?a.cloneElement(e,{...null===e||void 0===e?void 0:e.props,onPress:()=>{var t;s(!1),null!==(t=e.props)&&void 0!==t&&t.onPress&&e.props.onPress()}}):null))):null},k=e=>{let{secureTextEntry:t,setSecureTextEntry:n,editable:o=!0}=e;const r=(0,d.DP)();return o?a.createElement(i.Ay,{name:t?"eye":"eye-off",size:20,style:{marginRight:10},onPress:()=>n(!t),color:r["text-hint-color"]}):null},B=(0,a.forwardRef)(((e,t)=>{let{style:n,inputMask:r,maxLength:l=11,onChangeText:i,disabled:s,errorText:c,toRemoveRegex:u,onFocus:m,onBlur:p,value:g,validateInput:h,...v}=e;const[y,b]=a.useState(c),[f,E]=(0,a.useState)(!1),[C,A]=(0,a.useState)(!g&&r?r:void 0),S=(0,a.useMemo)((()=>e=>{e.includes("*")&&(i&&i(e.replace("*","")),A(null!==r&&void 0!==r?r:"")),g&&!C&&A(r)}),[i,A,r]),w=(0,d.Gz)({validateInput:h,onChangeText:i,setError:b,handleMaskedStringChange:S,toRemoveRegex:u});return a.createElement(o.Tr,Object.assign({secureTextEntry:f,rightComponent:a.createElement(k,{secureTextEntry:f,setSecureTextEntry:E,editable:s}),onFocus:e=>{E(!1),m&&m(e)},onBlur:e=>{E(!0),p&&p(e)},value:g,errorText:y,inputMask:C||new Array(l).join("*"),ref:t,onChangeText:w},v))}));(0,d.L4)(B);var F=n(32572),_=n(97076);(0,f.JK)({Component:e=>{let{isCustomerModel:t=!1,value:n,nativeProps:r,options:l=[],apiSearchFn:i,displayKey:s="name",displayFn:c,valueKey:m="id",onChange:p,onSelection:g,extra:h,error:v,expanded:y,setExpanded:b,ifNotFound:f,label:E,isSearchBar:C=!1,SearchResultItem:A=null,collapsableViewHeading:S=null,autoCompleteType:w="off",onChangeText:P=(e=>{}),...I}=e;const[,x]=(0,a.useState)(!1),[D,T]=(0,a.useState)(""),k=(0,d.d7)(D,500),[B,N]=(0,a.useState)([]),[R,L]=(0,a.useState)(null),[,M]=(0,a.useState)(!1);(0,a.useEffect)((()=>{D?R&&C&&M(!0):(f&&f(!1),M(!1))}),[D,f,C,R]),(0,a.useEffect)((()=>{let e=!1;if(N([]),n)if(l.length>0){const e=l.find((e=>e[m]===n));N(l),L(e)}else i(n).then((t=>{var n,o;e||(N(t.items),L(t.items[0]),p&&p(null===(n=t.items)||void 0===n||null===(o=n[0])||void 0===o?void 0:o[m]))}));else L(null);return()=>{e=!0}}),[n]),(0,a.useEffect)((()=>{let e="";R?e=null===R||void 0===R?void 0:R[s]:g&&g(null),!C&&T(e)}),[R,s,C,g]),(0,a.useEffect)((()=>{N([]),i&&k?i(k).then((e=>{e.items.length?f&&f(!1,k):f&&f(!0,k),N(e.items)})):l.length>0&&N(l.filter((e=>e[s].toLowerCase().startsWith(k.toLowerCase()))).slice(0,5))}),[k,i]);const O=e=>{L(e),p&&p(t?e:e[m]),g&&g(e)};return a.createElement(u.Popover,{visible:y,onBackdropPress:()=>b(!1),fullWidth:!0,anchor:()=>a.createElement(o.Tr,Object.assign({label:E,onFocus:()=>{x(!0),b(!0)},onBlur:()=>{y||(x(!1),b(!1))},onClear:()=>{T(""),P("")},onChangeText:e=>{T(e),P(e)},editable:C||!R,value:D,leftComponent:C&&a.createElement(_.e$c,{style:{height:20,width:20}}),autoComplete:w},I))},a.createElement(F.A,{style:{maxHeight:400,width:"100%"}},0!==B.length&&S,B.map((e=>A?a.createElement(A,{option:e,onPress:t=>{T(""),null===t||void 0===t||t.preventDefault(),null===t||void 0===t||t.stopPropagation(),O(e)}}):a.createElement(u.MenuItem,{onPress:()=>{T(""),O(e)},key:e[m],title:c?c(e):e[s]}))),h))}});var N=n(343),R=n(29731);const L=e=>{let{label:t,required:n,searchParams:o,labelSelector:r,apiSearchFn:l,onSelect:i,testID:s,defaultSearchText:c="A",autoFocus:p=!1,...g}=e;const[h,v]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[f,E]=(0,a.useState)([]),C=(0,a.useRef)(null),[A,S]=(0,a.useState)(!1),{sm:w}=(0,d.Qs)(),{t:I}=(0,R.Bd)("global"),x=(0,a.useCallback)((async e=>{v(!0);const t={search:e,...o||{}},n=await l(t);v(!1),b(!1),n.length?E(n):e.length>=(null===c||void 0===c?void 0:c.length)&&E([{name:I("AutoCompleteInput.no-results-found")}])}),[]),D=(0,a.useMemo)((()=>(0,N.debounce)(x,300)),[x]);(0,a.useEffect)((()=>
1{if(s){var e,t,n,o;const r=null===C||void 0===C||null===(e=C.current)||void 0===e||null===(t=e.inputRef)||void 0===t||null===(n=t.current)||void 0===n||null===(o=n.textInputRef)||void 0===o?void 0:o.current;r&&"setAttribute"in r&&r.setAttribute("data-testid",s)}}),[s]),(0,a.useEffect)((()=>()=>{D.cancel()}),[D]);const T=e=>{var t,n,o,r,a;const l=f[e];null===C||void 0===C||null===(t=C.current)||void 0===t||null===(n=t.popoverRef)||void 0===n||null===(o=n.current)||void 0===o||null===(r=o.backdropConfig)||void 0===r||null===(a=r.onBackdropPress)||void 0===a||a.call(r),setTimeout((()=>S(!1)),200),i&&i(l)};(0,a.useEffect)((()=>{b(!0),D(c)}),[]),(0,a.useEffect)((()=>{if(p&&C.current){var e,t,n,o;const r=null===C||void 0===C||null===(e=C.current)||void 0===e||null===(t=e.inputRef)||void 0===t||null===(n=t.current)||void 0===n||null===(o=n.textInputRef)||void 0===o?void 0:o.current;r&&r.focus&&setTimeout((()=>{r.focus()}),100)}}),[p]);return a.createElement(u.Autocomplete,Object.assign({},g,{label:t&&a.createElement(P.l,{required:n},t),ref:C,accessoryRight:a.createElement(a.Fragment,null,h?a.createElement(m.A,{size:"small"}):null,g.accessoryRight),disabled:y,onSelect:T,onChangeText:e=>{g.onChangeText&&g.onChangeText(e),D(e||c)},onFocus:()=>S(!0)}),A?a.createElement(F.A,{style:w?{maxHeight:160}:{height:80}},f.map(((e,t)=>{const n=r(e);return a.createElement(u.AutocompleteItem,{key:t,title:n,onPress:()=>T(t),disabled:n===I("AutoCompleteInput.no-results-found")})}))):void 0)},M=l.A.create({wrapper:{...l.A.absoluteFillObject,alignItems:"center",justifyContent:"center"}});function O(){return a.createElement(s.A,{style:M.wrapper},a.createElement(m.A,{testID:"indicator"}))}var z=n(73957),j=n.n(z);const W=a.memo((0,a.forwardRef)(((e,t)=>{let{options:n=[],value:r,errorText:l,caption:i,keyName:s="id",labelName:c="name",label:m,onChange:p,sort:g=!1,primitiveArray:h=!1,mandatory:v=!1,status:y,clearable:b=!1,multiSelect:E,style:C,size:A,testID:S="default_test_id_select",...w}=e;const[I,x]=a.useState(void 0);let D;if((0,a.useEffect)((()=>{if(null===r||void 0===r)x(void 0);else if(j()(r))if(E){const e=[];r.map((t=>{const o=h?null===n||void 0===n?void 0:n.findIndex((e=>e===t)):n.findIndex((e=>e[s]===r[s]));o>=0&&e.push(new u.IndexPath(o))})),x(e)}else{const e=n.findIndex((e=>e[s]===r[s]));x(new u.IndexPath(e))}else if(E)x([]);else{const e=h?null===n||void 0===n?void 0:n.findIndex((e=>e===r)):n.findIndex((e=>e[s]===r));x(new u.IndexPath(e))}}),[s,E,n,h,r]),I&&n&&n.length>0)if(E&&I.length>0){const e=[];I.forEach((t=>{if(t.row>=0){var o;const r=h?n[t.row]:null===(o=n[t.row])||void 0===o?void 0:o[c];e.push(r)}})),D=e.join("; ")}else{var T;D=h?n[I.row]:null===(T=n[I.row])||void 0===T?void 0:T[c]}const k=(0,a.useMemo)((()=>{if(I&&b)return a.createElement(o.US,{onPress:()=>{x(void 0),p&&p(E?[]:null)}})}),[b,E,p,I]),B=(0,a.useMemo)((()=>(g?n.sort(((e,t)=>h?e.localeCompare(t):e[c].localeCompare(t[c]))):n).map(((e,t)=>a.createElement(u.SelectItem,{testID:"".concat(S,"-").concat(t),key:t,title:h?e:e[c]})))),[c,n,h,g,S]);let F;I&&(F=E||I.row>=0?I:void 0);const{sm:_}=(0,d.Qs)();return a.createElement(u.Select,Object.assign({caption:l||i,status:l?"danger":y||"basic",accessoryRight:k,value:D,size:A||(_?"large":"medium"),placeholder:w.placeholder||" ",selectedIndex:F,onSelect:e=>{if(x(e),p)if(E){const t=[];e.map((e=>{t.push(n[e.row])})),p(t)}else p(n[e.row])},label:a.createElement(P.l,{required:v,labelStyle:"thick-border"===w.appearance?V.labelStyle:{}},m),multiSelect:E,style:(0,f.i_)({minWidth:100},C),ref:t,testID:S},w),B)}))),V=l.A.create({labelStyle:{fontFamily:"Inter, sans-serif",fontWeight:"600",color:"#001929"}}),H=(0,f.JK)({Component:W});var U=n(35143),G=n(14324),Y=n(69824),Q=n.n(Y),q=n(58876);const K=[{"01":"Jan"},{"02":"Feb"},{"03":"Mar"},{"04":"Apr"},{"05":"May"},{"06":"Jun"},{"07":"Jul"},{"08":"Aug"},{"09":"Sep"},{10:"Oct"},{11:"Nov"},{12:"Dec"}],J=e=>{let{dir:t="right",onPress:n}=e;return a.createElement(h.A,{onPress:n,style:{width:30,height:30,alignItems:"center",justifyContent:"center",borderRadius:3}},a.createElement(i.Ay,{name:"right"===t?"chevron-right":"chevron-left",size:25,color:y.Tj.primary}))},Z=e=>{let{month:t,active:n,onPress:o}=e;return a.createElement(h.A,{style:{width:76,height:44,borderRadius:4,justifyContent:"center",alignItems:"center",marginTop:0,borderWidth:n?.5:0,borderColor:y.Tj.borderColor,backgroundColor:n?Q()(y.Tj.accentText).alpha(.1).rgb().string():"white"},onPress:o},a.createElement(r.u8,{size:15,weight:"400"},t))},X=e=>{let{value:t,onChange:n,onArrowClick:o}=e;return a.createElement(s.A,{style:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",paddingHorizontal:10}},a.createElement(U.A,{value:t,keyboardType:q.ui.Numeric,maxLength:4,style:{width:70,fontSize:18,fontWeight:"600",textAlign:"center",padding:4,borderWidth:1,borderColor:y.Tj.borderColor,borderRadius:4},onChangeText:n}),a.createElement(s.A,{style:{flexDirection:"row",width:65,justifyContent:"space-between"}},a.createElement(J,{onPress:()=>o(-1),dir:"left"}),a.createElement(J,{onPress:()=>o(1)})))};const $=(0,b.PA)((e=>
1{let{errorText:t="",label:n,mandatory:r=!1,value:l,onChange:i,minYear:d=1900,maxYear:m=2100,...p}=e;const h=w()(),[v,b]=(0,a.useState)(!1),[f,E]=(0,a.useState)(h.format("MM")),[C,A]=(0,a.useState)(h.format("YYYY"));(0,a.useEffect)((()=>{if(l&&/^((0?[1-9]|1[0-2])\/\d{4})$/.test(l)){const e=l.split("/"),t=1===e[0].length?"0"+e[0]:e[0];E(t),A(e[1])}else E(h.format("MM")),A(h.format("YYYY"))}),[l]);const S=e=>{if(!e)return!1;const t=parseInt(e);return 4===String(t).length&&(!(("string"===typeof d?parseInt(d):d)>parseInt(e))&&("string"===typeof m?parseInt(m):m)>=parseInt(e))},P=!S(C);return a.createElement(u.Popover,{visible:v,anchor:()=>a.createElement(G.A,{onPress:()=>b(!0)},a.createElement(o.Tr,Object.assign({errorText:t,value:l,label:n,mandatory:r,editable:!1,onClear:()=>i&&i("")},p))),onBackdropPress:()=>b(!1)},a.createElement(s.A,{style:{padding:10,justifyContent:"center",alignItems:"center"}},a.createElement(X,{onArrowClick:e=>{let t=parseInt(C);t&&!isNaN(t)||(t=parseInt(h.format("YYYY")));const n=t+e;S(n)&&A(String(n))},value:C,onChange:e=>{A(e)}}),a.createElement(s.A,{style:{flexDirection:"row",justifyContent:"space-between",width:305,flexWrap:"wrap",marginTop:10,paddingTop:10,borderTopColor:y.Tj.borderColor,borderBottomColor:y.Tj.borderColor,borderTopWidth:1,borderBottomWidth:1,marginBottom:10,paddingBottom:10}},K.map((e=>{const t=Object.entries(e)[0],n=t[0],o=t[1];return a.createElement(Z,{month:o,onPress:()=>E(n),active:n===f,key:n})}))),a.createElement(s.A,{style:{flexDirection:"row-reverse",width:"100%",paddingHorizontal:15}},a.createElement(g,{style:{width:80},onPress:()=>{const e="".concat(f,"/").concat(C);i&&i(e),b(!1)},disabled:P,size:"small"},"Select"),a.createElement(c,{width:10,height:10}),a.createElement(g,{appearance:"ghost",status:"basic",size:"small",onPress:()=>b(!1)},"Cancel"))))})),ee=(0,f.JK)({Component:$,valuePropertyName:"value",changePropertyName:"onChange"});var te=n(59243);const ne=[{key:"xl",value:y.fi.xl},{key:"lg",value:y.fi.lg},{key:"md",value:y.fi.md},{key:"sm",value:y.fi.sm},{key:"xs",value:y.fi.xs}];function oe(){const{width:e}=te.A.get("window"),t=ne.find((t=>t.value<=e));return t&&t.key||ne[ne.length-1].key}function re(){const[e,t]=(0,a.useState)(oe());return(0,a.useEffect)((()=>{const e=te.A.addEventListener("change",(()=>t(oe())));return e&&e.remove}),[]),e}const ae=e=>isFinite(e)&&e>=0;function le(e,t){const{xs:n,sm:o,md:r,lg:l,xl:i}=t;return(0,a.useMemo)((()=>{var t;return(null===(t={xl:[i,l,r,o,n],lg:[l,r,o,n],md:[r,o,n],sm:[o,n],xs:[n]}[e])||void 0===t?void 0:t.find(ae))||0}),[e,n,o,r,l,i])}const ie=e=>{let{children:t,style:n,onLayout:o}=e;const r=-le(re(),{xs:5,sm:10});return a.createElement(s.A,{style:(0,f.i_)({flexDirection:"row",flexWrap:"wrap",marginHorizontal:r},n),onLayout:o},t)},se={1:(100/12).toFixed(6)+"%",2:(100/12*2).toFixed(6)+"%",3:25..toFixed(6)+"%",4:(100/12*4).toFixed(6)+"%",5:(100/12*5).toFixed(6)+"%",6:50..toFixed(6)+"%",7:(100/12*7).toFixed(6)+"%",8:(100/12*8).toFixed(6)+"%",9:75..toFixed(6)+"%",10:(100/12*10).toFixed(6)+"%",11:(100/12*11).toFixed(6)+"%",12:100..toFixed(6)+"%"},ce=e=>{let{children:t,style:n,...o}=e;const r=re(),l=le(r,{xs:5,sm:10}),i=le(r,o),c=se[i];return a.createElement(s.A,{style:(0,f.i_)({paddingHorizontal:l,width:c},n)},t)},de=e=>{let{title:t,footer:n,children:o,onBackdropPress:l,visible:i=!1,onClose:c,containerStyle:d,showDivider:m=!0,customHeader:p,testID:g}=e;const h=(0,a.useMemo)((()=>p?null:t?"string"===typeof t?a.createElement(s.A,{style:{padding:20}},a.createElement(r.z_,null,t)):a.createElement(s.A,{style:{padding:13}},t):null),[p,t]);return a.createElement(u.Modal,{visible:i,onBackdropPress:l||c,backdropStyle:ue.backdrop,testID:g,style:ue.modal},p,h,a.createElement(F.A,{showsVerticalScrollIndicator:!1},a.createElement(s.A,{style:[ue.content,d]},o)),!!n&&a.createElement(s.A,null,m&&a.createElement(u.Divider,null),a.createElement(s.A,{style:{padding:20}},n)))},ue=l.A.create({modal:{backgroundColor:"#fff",borderRadius:12,maxHeight:"100%"},backdrop:{backgroundColor:"rgba(0, 0, 0, 0.3)"},scrollView:{height:"100%"},content:{padding:20,flex:1}}),me=e=>{let{label:t,disabled:n,...o}=e;return a.createElement(s.A,o)},pe=e=>{let{active:t,label:n,style:o,...l}=e;return a.createElement(h.A,Object.assign({style:[{borderBottomWidth:2,borderBottomColor:t?y.Tj.accentText:"transparent",paddingBottom:10,marginRight:20},o]},l),a.createElement(r.u8,{style:(0,f.i_)({textAlign:"center",fontWeight:"500",fontSize:14,lineHeight:22,color:"#335C75"},l.disabled&&{opacity:.5},t&&{color:y.Tj.accentText})},n))},ge=e=>{let{children:t,onTabSelect:n,activeIndex:o}=e;const[r,l]=(0,a.useState)(0),i=o||0===o?o:r,c=(0,a.useMemo)((()=>a.Children.toArray(t).filter((e=>!!e&&a.isValidElement(e)))),[t]);return a.createElement(a.Fragment,null,a.createElement(s.A,{style:{flexDirection:"row"}},c.map(((e,t)=>a.createElement(pe,{key:t,active:i===t,label:e.props.label,style:e.props.style,disabled:e.props.disabled,onPress:()=>(e=>{n?n(e):l(e)})(t),"aria-selected":i===t})))),a.createElement(u.Divider,{style:{marginBottom:16}}),c.find(((e,t)=>i===t)))};const he=n(31838);var ve=n(18521),ye=n(35790),be=n(63680);const fe=function(e){const{t:t}=(0,R.Bd)("global"),[{items:n=[],count:o=0},l]=(0,a.useState)({}),[c,d]=(0,a.useState)(""),[u,m]=(0,a.useState)({}),p=(0,a.useMemo)((()=>
1{if(e.defaultSortColumn)return e.defaultSortColumn;const{id:t,name:n,selector:o}=e.columns.find((e=>!1!==e.sortable))||{};return"string"===typeof o?o:"string"===typeof n?n:"string"===typeof t?t:"_id"}),[e.columns,e.defaultSortColumn]),[[g,h],v]=(0,a.useState)([p]),[b,E]=(0,a.useState)(1),[C,A]=(0,a.useState)(25),[S,w]=(0,a.useState)(!1),[P,I]=(0,a.useState)(""),x=(0,a.useRef)(null),[D,T]=(0,a.useState)(!1),{style:k={},title:B="",noTableHead:F=!1,disabled:_,CustomFilterComponent:L,filterPlaceholder:M,apiCaller:O,showOverflow:z,expandableRows:j=!1,expandableRowsComponent:W,expandableRowDisabled:V=null,expandableRowExpanded:H,extraApiParams:U={},conditionalRowStyles:G=[],showFilters:Y=!0,showPagination:Q=!0,store:q,refresher:K,testID:J="bt_api_table",filterWidth:Z="50%",hasFilterTouched:X,highlightOnHover:$=!0,...ee}=e,te=(0,a.useCallback)((()=>{x&&x.current&&x.current.cancel(),l({items:[],count:0}),w(!0),I(""),x.current=O({...u,...U,search:c,sortColumn:g,sortDirection:h,page:b,pageSize:C}),x.current.then((e=>{w(!1);const{items:t,count:n,...o}=e;q?q.setData({items:t,count:n||t.length||0,...o}):l({items:t||[],count:n||(null===t||void 0===t?void 0:t.length)||0,...o})})).catch((e=>{var t;w(!1),I((null===(t=e.data)||void 0===t?void 0:t.message)||e.message||e.toString())}))}),[O,c,U,u,g,h,b,C]);(0,a.useEffect)((()=>{_||S||e.data||te()}),[_,c,u,g,h,b,C,K]);const ne=(0,a.useMemo)((()=>L?a.createElement(L,{value:u,onChange:m,testID:"".concat(J,"_custom_filter_component")}):null),[u,K]),oe=(0,a.useMemo)((()=>a.createElement(Ce,{search:c,onSearch:d,placeholder:M,filters:ne,filterInputTestID:"".concat(J,"_filter_input"),filterWidth:Z})),[c,ne,d,K]);return(0,a.useEffect)((()=>{c.length>0&&(T(!0),X&&X(!0)),null!==u&&void 0!==u&&u.status&&(T(!0),X&&X(!0)),null!==u&&void 0!==u&&u.duration&&(T(!0),X&&X(!0))}),[c,u]),a.createElement(ve.Ay,Object.assign({},ee,{style:(0,f.i_)(k,z&&{overflow:"visible"}),onRowClicked:e.onItemPress,noHeader:!B,title:B,noTableHead:F,noContextMenu:!0,subHeader:e.searchable,subHeaderComponent:Y?oe:null,subHeaderAlign:"left",columns:e.columns,data:e.items?e.items.slice():q?q.items.slice():n,sortServer:!0,defaultSortField:g,defaultSortAsc:"desc"!==h,onSort:(0,a.useCallback)(((e,t)=>{const{id:n,name:o,selector:r}=e;v(["string"===typeof r?r:"string"===typeof o?o:"string"===typeof n?n:"_id",t])}),[]),pagination:Q,paginationServer:!0,paginationDefaultPage:b,paginationPerPage:C,paginationTotalRows:o,paginationRowsPerPageOptions:(0,a.useMemo)((()=>[25]),[]),onChangePage:(0,a.useCallback)((e=>E(e)),[]),onChangeRowsPerPage:(0,a.useCallback)((e=>A(e)),[]),progressPending:S,progressComponent:(0,a.useMemo)((()=>a.createElement(ye.A,{indeterminate:!0,visible:S,testID:"progress_bar"})),[S]),noDataComponent:(0,a.useMemo)((()=>P?a.createElement(r.u8,{style:{color:y.Tj.accent},testID:"".concat(J,"_error_text")},P):null!==e&&void 0!==e&&e.noDataComponent?null===e||void 0===e?void 0:e.noDataComponent:a.createElement(r.u8,{testID:"".concat(J,"_no_items_text")},t("noItems"))),[P,D]),highlightOnHover:$,customStyles:(0,N.merge)(Ae,e.style),conditionalRowStyles:G,sortIcon:(0,a.useMemo)((()=>a.createElement(s.A,{style:{lineHeight:16}},a.createElement(i.Ay,{name:"chevron-down",size:20,color:y.Tj.placeholder}))),[]),keyField:e.keyField,expandableRowsHideExpander:!0,expandOnRowClicked:!0,expandableRows:j,expandableRowsComponent:!!j&&W,expandableRowDisabled:V,expandableRowExpanded:H}))};fe.defaultProps={searchable:!0,disabled:!1,keyField:"id",testID:"api_table"};const Ee=(0,be.PA)(fe),Ce=a.memo((function(e){const[t,n]=(0,a.useState)(e.search),r=e.placeholder||"Business name, account number...",l=e.filterInputTestID||"api_table_filter_input",c=(0,a.useRef)((new Date).getTime());return(0,a.useEffect)((()=>{c.current=(new Date).getTime();const n=setTimeout((()=>e.onSearch(t)),500);return()=>clearTimeout(n)}),[t,c,e.onSearch]),(0,a.useEffect)((()=>{c.current<(new Date).getTime()&&n(e.search)}),[e.search]),a.createElement(s.A,{style:(0,f.i_)({width:"100%"},e.filters?{flexDirection:"row",flexWrap:"wrap"}:{alignItems:"center"})},a.createElement(o.Tr,{value:t,style:{width:e.filterWidth,backgroundColor:"#F7F9FC",borderWidth:1,borderColor:"#E4E9F2"},containerStyle:{borderWidth:1,borderColor:"#E4E9F2",height:40},onChangeText:n,placeholder:r,rightComponent:a.createElement(i.Ay,{name:"magnify",size:25,color:y.Tj.placeholder}),testID:l}),e.filters)}
1));Ce.defaultProps={};const Ae={table:{style:{backgroundColor:y.Tj.surface}},tableWrapper:{style:{backgroundColor:y.Tj.surface}},header:{style:{paddingLeft:0,paddingRight:0,minHeight:void 0}},subHeader:{style:{paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:32}},head:{style:{}},headRow:{style:{borderBottomColor:Q()(y.Tj.borderLight).alpha(.6).rgb().string(),minHeight:48},denseStyle:{}},headCells:{style:{color:y.Tj.primary,fontSize:16,lineHeight:1.5,fontWeight:"bold"},activeSortStyle:{color:y.Tj.primary,fontSize:16,lineHeight:1.5,fontWeight:"bold",width:"100%",div:{width:"100%"}},inactiveSortStyle:{color:y.Tj.primary,fontSize:16,lineHeight:1.5,fontWeight:"bold",width:"100%",div:{width:"100%"},span:{textDecoration:"none",div:{svg:{opacity:"0.2 !important"}}}}},contextMenu:{style:{},activeStyle:{}},cells:{style:{color:y.Tj.primary,fontSize:16,lineHeight:1.5,fontWeight:"400"}},rows:{style:{borderBottomColor:Q()(y.Tj.borderLight).alpha(.6).rgb().string()},selectedHighlightStyle:{},denseStyle:{},highlightOnHoverStyle:{backgroundColor:Q()(y.Tj.accentText).alpha(.08).rgb().string(),borderBottomColor:Q()(y.Tj.borderLight).alpha(.6).rgb().string(),outlineColor:Q()(y.Tj.borderLight).alpha(.6).rgb().string()},stripedStyle:{}},expanderRow:{style:{}},expanderCell:{style:{}},expanderButton:{style:{}},pagination:{style:{},pageButtonsStyle:{}},noData:{style:{}},progress:{style:{width:"100%"}}};var Se=n(38325);const we=e=>{let{onClose:t,visible:n,width:o=400,closeOnBackDropPress:l=!0,onBackdropPress:c,title:m,children:p,footer:g,footerStyle:h,headerStyle:v}=e;const b=e=>{27===e.keyCode&&n&&t()};(0,a.useEffect)((()=>("web"===Se.A.OS&&document.addEventListener("keydown",b,!1),()=>{"web"===Se.A.OS&&document.removeEventListener("keydown",b,!1)})),[]);const{screenWidth:E,sm:C}=(0,d.Qs)(),A=C?56:46;let S;a.useEffect((()=>{S&&n&&S.scrollTo({x:0,y:0,animated:!1})}),[S,n]);const w=(0,a.useMemo)((()=>m?"string"===typeof m?a.createElement(s.A,{style:(0,f.i_)({height:A,width:"100%"},v)},a.createElement(s.A,{style:{flexDirection:"row",alignItems:"center",flex:1,paddingHorizontal:10}},a.createElement(s.A,{style:{flex:1}},a.createElement(r.z_,null,m)),a.createElement(i.Ay,{name:"close-circle",size:20,onPress:t,color:y.Tj.primary})),a.createElement(u.Divider,null)):m:null),[A,v,t,m]),P=(0,a.useMemo)((()=>g?a.createElement(s.A,{style:(0,f.i_)({width:"100%"},h)},a.createElement(u.Divider,null),a.createElement(s.A,{style:{flex:1,padding:10,paddingVertical:C?20:10}},g)):null),[C,g,h]);return a.createElement(u.Modal,{visible:n,onBackdropPress:c||(l?t:void 0),backdropStyle:{backgroundColor:"rgba(0, 0, 0, 0.5)"},style:(0,f.i_)({height:"100vh",backgroundColor:"white",margin:0,padding:0},C?{left:E-o,width:o}:{width:E})},w,a.createElement(F.A,{style:{padding:10,flexGrow:1},ref:e=>S=e},p),P)},Pe=e=>{let{title:t,leftTitleAction:n,rightTitleAction:o,headerStyle:l,children:i,toTopScroller:c,loading:m,header:p,titleCentered:g=!1,containerStyle:h,footer:v}=e;const{sm:b}=(0,d.Qs)(),f=b?72:64;let E;(0,a.useEffect)((()=>{E&&E.scrollTo({x:0,y:0,animated:!0})}),[E,c]);const C=(0,a.useMemo)((()=>p||a.createElement(s.A,{style:[{width:"100%",flexDirection:"row",alignItems:"center",height:f,paddingHorizontal:b?20:10},y.r7,l]},n,a.createElement(s.A,{style:{flex:1,paddingHorizontal:10}},"string"===typeof t?a.createElement(r.Zz,{style:{textAlign:g?"center":"left",flex:1,fontSize:b?20:16,fontWeight:b?"600":"500"}},t):t),o)),[p,f,b,l,n,t,g,o]);return a.createElement(u.Layout,{style:{flex:1}},C,a.createElement(F.A,{style:{flexGrow:1,flex:1},contentContainerStyle:[{padding:b?20:10},h],ref:e=>E=e},m?a.createElement(O,null):i),v||null)};var Ie=n(38117),xe=n(97081);const De=e=>{var t;let{type:n="placed",size:o="default",testID:r}=e;const{sm:l}=(0,d.Qs)();return a.createElement(s.A,{testID:r,style:{paddingVertical:l||"default"===o?5:3,borderRadius:5,backgroundColor:xe.Od[n].bgColor,paddingHorizontal:l||"default"===o?8:5}},a.createElement(Ie.A,{style:{color:xe.Od[n].textColor,fontSize:l?14:12}},null===(t=xe.Od[n])||void 0===t?void 0:t.label))};var Te=n(4419);const ke=n(55179),Be=n(46638),Fe=n(79081),_e=e=>{let t,{type:n,icon:o}=e;return o||("warning"===n&&(t=Be),"danger"===n&&(t=Fe),"success"===n&&(t=ke),t?a.createElement(Te.A,{style:{resizeMode:"cover",height:70,width:70,marginBottom:10},source:t.hasOwnProperty("default")?t.default:t}):null)},Ne=e=>{let{type:t="default",visible:n,onClose:o,title:l,buttons:m,onBackdropPress:p,children:h,width:v,height:y,icon:b,titleStyle:E,verticalButtons:C,noCloseIcon:A=!1,margins:S,buttonsContainerStyle:w}=e;const{sm:P}=(0,d.Qs)();return a.createElement(u.Modal,{visible:n,onBackdropPress:p||o,backdropStyle:{backgroundColor:"rgba(0, 0, 0, 0.3)"},testID:"alert-modal"},a.createElement(u.Layout,{style:(0,f.i_)({borderRadius:12,minWidth:300,minHeight:200,padding:20},v&&{minWidth:v},y&&{minHeight:y},S&&{marginHorizontal:S}),testID:"alert-layout"},A?null:a.createElement(s.A,{style:{width:"100%",alignItems:"flex-end"},testID:"close-icon-container"},a.createElement(i.Ay,{name:"close",color:"#003353",size:14,style:{backgroundColor:"#F5F7F8",padding:10,alignItems:"center",justifyContent:"center",borderRadius:5},onPress:o?()=>o():void 0,testID:"close"})),a.createElement(s.A,{style:{alignItems:"center"}},t?a.createElement(_e,{type:t,icon:b}
1):null,"string"===typeof l?a.createElement(r.u8,{testID:"alert-title",size:P?28:18,weight:"600",style:[{width:"100%",lineHeight:P?36:28,textAlign:"center"},E]},l):l,a.createElement(c,null),h),a.createElement(c,{height:20}),a.createElement(s.A,{testID:"alert-btns-container",style:(0,f.i_)({flexDirection:C?"column":"row",width:"100%",justifyContent:"space-evenly",marginBottom:C?0:20},w)},null===m||void 0===m?void 0:m.map(((e,t)=>e.label?a.createElement(s.A,{key:t,testID:"alert-btn-"+"".concat(e.label)},a.createElement(g,e,e.label),C&&a.createElement(c,{height:13})):null)))))};var Re=n(36806);const Le=e=>{let{onChange:t,value:n,mandatory:o=!1,label:r,errorText:l,caption:i,placeholder:s,style:c,onSelect:p,onFocus:g,onBlur:h,testID:v,size:y,autoFocus:b=!1}=e;const{placePredictions:E,getPlacePredictions:C,isPlacePredictionsLoading:A,placesService:S}=(0,Re.A)({apiKey:"AIzaSyB7xAhGHa8kMhpUIjFym6LHaDJEbeQwtm4",options:{types:["geocode","establishment"],componentRestrictions:{country:"us"}}}),[w,I]=(0,a.useState)(n),{sm:x}=(0,d.Qs)(),D=(0,a.useRef)(null);(0,a.useEffect)((()=>{if(v){var e,t,n,o;const r=null===D||void 0===D||null===(e=D.current)||void 0===e||null===(t=e.inputRef)||void 0===t||null===(n=t.current)||void 0===n||null===(o=n.textInputRef)||void 0===o?void 0:o.current;r&&"setAttribute"in r&&r.setAttribute("data-testid",v)}}),[v]),(0,a.useEffect)((()=>{if(b&&D.current){var e,t,n,o;const r=null===D||void 0===D||null===(e=D.current)||void 0===e||null===(t=e.inputRef)||void 0===t||null===(n=t.current)||void 0===n||null===(o=n.textInputRef)||void 0===o?void 0:o.current;r&&r.focus&&setTimeout((()=>{r.focus()}),100)}}),[b]),(0,a.useEffect)((()=>{n&&n.trim()&&C({input:n})}),[n]);const T=e=>{I(e.formatted_address);const t=function(e){const{adr_address:t,address_components:n}=e,o={address:e.name};if(t){const e=(new DOMParser).parseFromString(t,"text/html"),n=e.querySelector(".locality");var r;if(n)o.city=null===(r=n.textContent)||void 0===r?void 0:r.trim();const l=e.querySelector(".street-address");var a;if(l)o.street=null===(a=l.textContent)||void 0===a?void 0:a.trim()}return n&&n.forEach((e=>{e.types.includes("administrative_area_level_1")?o.state=e.long_name:e.types.includes("postal_code")&&(o.zip=e.short_name)})),o}(e);p&&p(t)};return a.createElement(u.Autocomplete,{style:(0,f.i_)({minWidth:100},c),value:w,caption:l||i,placeholder:s,onSelect:e=>{null===S||void 0===S||S.getDetails({placeId:E[e].place_id},T)},onFocus:g,onBlur:h,size:y||(x?"large":"medium"),label:a.createElement(P.l,{required:o,labelStyle:{fontFamily:"Inter, sans-serif",fontWeight:"600",color:"#001929"}},r),onChangeText:e=>{e&&e.trim().length>=2&&C({input:e}),I(e),t&&t(e)},accessoryLeft:a.createElement(u.Icon,{name:"search-outline",fill:"#99adba"}),accessoryRight:()=>A&&w&&w.trim().length>=2?a.createElement(m.A,{size:"small"}):null,testID:v,ref:D,placement:"bottom end"},E.map(((e,t)=>a.createElement(u.AutocompleteItem,{key:t,title:e.description}))))};var Me=n(73478),Oe=n(85921);const ze=e=>{let{size:t,value:n,label:o,required:r,disabled:l,placeholder:i,onChangeText:s,testID:c,maxLength:d}=e;return a.createElement(Me.HG,{prefix:"$",size:t,value:n,label:o,decimalScale:2,required:r,disabled:l,allowNegative:!1,keyboardType:"number-pad",customInput:Oe.C,placeholder:i,onValueChange:e=>{s&&s(e.value)},testID:c,valueIsNumericString:!0,thousandSeparator:!0,maxLength:d})};var je=n(66387);const We=n.p+"static/media/encrypted-input-gradient.ea815cdb5b2ff66fc251.png",Ve=e=>{let{InputComponent:t=je.a,showBadge:n=!0,...o}=e;const{t:l}=(0,R.Bd)("global"),{sm:i}=(0,d.Qs)();let s,c,m;switch(o.size){case"small":s=32,c=-8,m=-8;break;case"medium":s=40,c=-11,m=-11;break;case"large":s=48,c=-20,m=-20;break;default:throw new Error("This size is not supported: "+o.size)}return a.createElement(t,Object.assign({textStyle:{width:"100%"}},o,{accessoryRight:n?a.createElement("div",{style:{height:s,marginTop:c,marginBottom:m,position:"relative",width:i?280:150,marginRight:-8}},a.createElement("img",{src:We,style:{width:"inherit",height:"inherit",borderTopRightRadius:4,borderBottomRightRadius:4}}),a.createElement(r.u8,{size:i?16:13,style:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:0,left:0,right:0,bottom:0,color:"white",fontWeight:"600"}},a.createElement(u.Icon,{fill:"white",name:"shield-outline",style:{width:i?22:15,marginRight:5,marginTop:2}}),a.createElement(R.x6,{t:l,values:{lineBreak:i?"":"\n"},i18nKey:"BtEncryptedInput.EncryptedAndSecured"}))):void 0}))},He=e=>{let{size:t="large",label:n,value:o,validate:r,validationError:l,required:i,onChangeText:s,testID:c,showBadge:d,style:u}=e;return a.createElement(Me.K9,{format:"###-##-####",placeholder:"000-00-0000",size:t,label:n,value:o,required:i,customInput:Ve,keyboardType:"number-pad",allowEmptyFormatting:!1,validate:e=>l?9!==(null===o||void 0===o?void 0:o.length)?l:"":r&&r(e),onValueChange:e=>{s&&s(e.value)},valueIsNumericString:!0,showBadge:d,style:u,testID:c})},Ue=e=>{let{size:t="large",value:n,label:o,required:r,validate:l,validationError:i,onChangeText:s,testID:c}=e;return a.createElement(Me.K9,{format:"#########",placeholder:"000000000",size:t,label:o,value:n,required:r,customInput:Ve,keyboardType:"number-pad",allowEmptyFormatting:!1,validate:e=>i?9!==(null===n||void 0===n?void 0:n.length)?i:"":l&&l(e),onValueChange:e=>{s&&s(e.value)},valueIsNumericString:!0,testID:c})},Ge=e=>{let{format:t,placeholder:n,size:o,label:r,value:l,disabled:i,validate:s,required:c,onChangeText:d,onBlur:u,testID:m,style:p}=e;return a.createElement(Me.K9,{format:t,placeholder:n,size:o,label:r,value:l,disabled:i,required:c,customInput:Oe.C,keyboardType:"number-pad",allowEmptyFormatting:!1,validate:s,onValueChange:e=>{d&&d(e.value)},onBlur:e=>u&&u(e),valueIsNumericString:!0,testID:m,style:p})},Ye=e=>{let{height:t=52}=e;const{t:n}=(0,R.Bd)("global");return a.createElement("div",{style:{height:t,borderRadius:12,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",background:"linear-gradient(270deg, #003C6C 0%, #00A0F3 100%)"}},a.createElement(u.Icon,{fill:"white",name:"shield-outline",style:{width:20,marginRight:5}}),a.createElement(r.u8,{color:"white",weight:"700",size:16},n("BtEncryptedAndSecuredBadge.Text")))},Qe=e=>{let{size:t="large",value:n,label:o,format:r,required:l,disabled:i,placeholder:s,validate:c,onChangeText:d,testID:u,style:m}=e;const p=r.replace(/([A-Z])/g,"#");return a.createElement(Me.K9,{format:p,placeholder:s||r,size:t,label:o,value:n,required:l,disabled:i,keyboardType:"number-pad",customInput:Oe.C,validate:c,allowEmptyFormatting:!1,onValueChange:e=>{d&&d(e.formattedValue)},testID:u,style:m})};var qe=n(16824),Ke=n(11071);const Je=Se.A.select({android:"keyboardDidShow",default:"keyboardWillShow"}),Ze=Se.A.select({android:"keyboardDidHide",default:"keyboardWillHide"}),Xe=e=>{const{mandatory:t=!1,options:n,onSelect:o,value:r,label:l,containerStyle:i}
1=e,[c,d]=a.useState(n),[m,p]=a.useState("bottom");a.useEffect((()=>{const e=Ke.A.addListener(Je,(()=>{p("top")})),t=Ke.A.addListener(Ze,(()=>{p("bottom")}));return()=>{e.remove(),t.remove()}}));const g=(0,a.useCallback)((e=>{o(e),d(n.filter((t=>((e,t)=>e.toLowerCase().includes(t.toLowerCase()))(t,e))))}),[o]);return a.createElement(s.A,{style:i},a.createElement(P.l,{required:t},l),a.createElement(u.Autocomplete,{value:r,placement:m,size:"large",onChangeText:g,onSelect:e=>o(c[e])},c.map(((e,t)=>a.createElement(u.AutocompleteItem,{key:t,title:e})))))};var $e=n(2490);const et=e=>{let{size:t="large",value:n,label:o,labelStyle:r,textStyle:l,required:i,disabled:s,placeholder:c,validate:d,onChangeText:u,onBlur:m,testID:p,style:g}=e;const[h,v]=(0,a.useState)((y=null!==n&&void 0!==n?n:"").startsWith("+1")?y.slice(2):y);var y;const b=(0,a.useCallback)((e=>{if(d)return d(e)}),[d]),f=e=>e.length?e.length<=3?"(".concat(e):e.length<=6?"(".concat(e.slice(0,3),") ").concat(e.slice(3)):e.length<=10?"(".concat(e.slice(0,3),") ").concat(e.slice(3,6),"-").concat(e.slice(6)):e.slice(0,10):"",E=a.createElement($e.A,{text:""});return a.createElement(Me.K9,{format:"(###) ###-####",placeholder:c,size:t,label:o,labelStyle:r,textStyle:l,value:h,required:i,disabled:s,keyboardType:"number-pad",customInput:Oe.C,validate:b,allowEmptyFormatting:!1,onValueChange:e=>{const t=e.value.replace(/[^\d]/g,""),n=f(t);v(n);u&&u({raw:t,formatted:n,parsed:t})},onChangeText:b,testID:p,onBlur:m,validateEmptyStateOnBlur:!0,keepValidationStateOnFocus:!0,captionComponent:E,style:g})};var tt=n(23328);n(72722),n(83952),n(73058),n(74881),n(23019),n(64156)},94573:(e,t,n)=>{"use strict";n.d(t,{E:()=>r,b:()=>a});var o=n(92584);const r={CertificateOfFormation:{type:o.L.ManualUploadCertificateOfFormation,required:!1},FiledArticles:{type:o.L.ManualUploadFiledArticles,required:!1},OperatingAgreementOrBylaws:{type:o.L.ManualUploadOperatingAgreement,required:!1},EinLetter:{type:o.L.ManualUploadEINLetter,required:!1},PersonalBackgroundExplanationLetter:{type:o.L.ManualUploadPersonalBackgroundExplanation,required:!1},AmendmentsCertificatesMinutes:{type:o.L.ManualUploadAmendmentsCertificatesMinutes,required:!1},ArchitecturalDocuments:{type:o.L.ManualUploadArchitecturalDocuments,required:!1},BuilderBudget:{type:o.L.ManualUploadBuilderBudget,required:!1}};function a(e){var t,n,o;const a={...r};if(!(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(n=t.sponsor)||void 0===n||null===(o=n.statements)||void 0===o?void 0:o.some((e=>!0===e.answer)))){const{PersonalBackgroundExplanationLetter:e,...t}=a;return t}return a}},92349:(e,t,n)=>{"use strict";n.d(t,{j:()=>o});let o=function(e){return e.ASC="asc",e.DESC="desc",e}({});o.ASC,o.DESC},92584:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});let o=function(e){return e.LenderApplicationDetails="LENDER_APPLICATION_DETAILS",e.LenderApplicationVerificationResults="LENDER_APPLICATION_VERIFICATION_RESULTS",e.ManualUploadCertificateOfFormation="MANUAL_UPLOAD_CERTIFICATE_OF_FORMATION",e.ManualUploadFiledArticles="MANUAL_UPLOAD_FILED_ARTICLES",e.ManualUploadOperatingAgreement="MANUAL_UPLOAD_OPERATING_AGREEMENT",e.ManualUploadEINLetter="MANUAL_UPLOAD_EIN_LETTER",e.ManualUploadPersonalBackgroundExplanation="MANUAL_UPLOAD_PERSONAL_BACKGROUND_EXPLANATION",e.ManualUploadAmendmentsCertificatesMinutes="MANUAL_UPLOAD_AMENDMENTS_CERTIFICATES_MINUTES",e.ManualUploadArchitecturalDocuments="MANUAL_UPLOAD_ARCHITECTURAL_DOCUMENTS",e.ManualUploadBuilderBudget="MANUAL_UPLOAD_BUILDER_BUDGET",e}({})}
1,80443:(e,t,n)=>{"use strict";n.d(t,{$M:()=>c,Lo:()=>u,MK:()=>a,Td:()=>m,UN:()=>o,iA:()=>p,oq:()=>d,tS:()=>i,u1:()=>r,v0:()=>l});let o=function(e){return e.GOOD_STANDING="GOOD_STANDING",e.PAST_DUE="PAST_DUE",e.PAID_OFF="PAID_OFF",e.CANCELED="CANCELED",e}({});const r={[o.GOOD_STANDING]:"Good Standing",[o.PAST_DUE]:"Past Due",[o.PAID_OFF]:"Paid Off",[o.CANCELED]:"Canceled"};let a=function(e){return e.CREDIT="credit",e.DRAW="draw",e.VIRTUAL_CARD="virtual",e.NO_SUPPLIER="noSupplier",e}({}),l=function(e){return e.ALL_TYPES="All Types",e.VIRTUAL_CARD="Virtual Card",e.DRAW="Regular Draw",e.CREDIT="Automated Trade Credit",e.NO_SUPPLIER="Direct Term",e}({}),i=function(e){return e.AMOUNT="amount",e.TRANSACTION_DATE="transactionDate",e}({});i.AMOUNT,i.TRANSACTION_DATE;let s=function(e){return e.AMOUNT_DUE="amountDue",e.DUE_DATE="dueDate",e}({});s.AMOUNT_DUE,s.DUE_DATE;let c=function(e){return e.TOTAL_AMOUNT="totalAmount",e.ISSUE_DATE="issueDate",e}({});c.TOTAL_AMOUNT,c.ISSUE_DATE;let d=function(e){return e.TOTAL_AMOUNT="totalAmount",e.NEXT_PAYMENT_DATE="nextPayDate",e.NEXT_PAYMENT_AMOUNT="nextPayAmount",e.AMOUNT_DUE="amountDue",e.ISSUE_DATE="issueDate",e}({});d.TOTAL_AMOUNT,d.ISSUE_DATE,d.AMOUNT_DUE,d.NEXT_PAYMENT_AMOUNT,d.NEXT_PAYMENT_DATE;let u=function(e){return e.DUE_NEXT="DUE_NEXT",e.PAST_DUE="PAST_DUE",e.CANCELLED="CANCELLED",e.CLOSED="PAID_OFF",e.REFINANCED="REFINANCED",e}({}),m=function(e){return e.ALL_STATUSES="All Status",e.PAID="Paid Off",e.REFINANCED="Refinanced",e.CANCELLED="Cancelled",e.PAST_DUE="Past Due",e.DUE_NEXT="Due Next",e}({}),p=function(e){return e.NONE="None",e.SUCCESS="Success",e.REJECTED="Rejected",e.PROCESSING="Processing",e.CANCELED="Canceled",e}({})},75187:(e,t,n)=>{"use strict";function o(e){return e?[e.address,e.city,e.state,e.zip].map((e=>null===e||void 0===e?void 0:e.trim())).filter((e=>!!e)).join(", "):""}n.d(t,{M:()=>o})},33469:(e,t,n)=>{"use strict";n.d(t,{h:()=>o});class o{static getCompanyName(e){var t,n;const o=null===e||void 0===e||null===(t=e.legalName)||void 0===t?void 0:t.trim(),r=null===e||void 0===e||null===(n=e.name)||void 0===n?void 0:n.trim();return o||r||""}static getFullCompanyName(e){var t,n;if(!e)return"";const o=null===(t=e.legalName)||void 0===t?void 0:t.trim(),r=null===(n=e.name)||void 0===n?void 0:n.trim();return o===r?null!==o&&void 0!==o?o:"":o&&r?"".concat(r," / ").concat(o):o||r||""}static getAvailableCreditAmount(e,t){var n,o;if(!e)return 0;const r=(null!==(n=e.limit)&&void 0!==n?n:0)-(null!==(o=e.balance)&&void 0!==o?o:0)-(null!==t&&void 0!==t?t:0);return Math.max(r,0)}}},61699:(e,t,n)=>{"use strict";n.d(t,{AI:()=>c,e8:()=>s,zQ:()=>i});var o=n(21786),r=n.n(o),a=n(59435),l=n(37525);function i(e,t){return null!==e&&void 0!==e||void 0===t?r()(null!==e&&void 0!==e?e:0).formatCurrency("0,0.00"):(0,a.isNumber)(t)?r()(t).formatCurrency("0,0.00"):t}function s(e){const t="whole"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"whole")?(null!==e&&void 0!==e?e:0)/100:null!==e&&void 0!==e?e:0;return r()(t).format({output:"percent",mantissa:2,trimMantissa:!0})}function c(e){if(!e)return"";try{const t=(0,l.l)(e,"US");if(t&&t.isValid())return t.formatNational()}catch(t){console.error(t)}return e}},91162:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var o=n(58876);class r{static getShortName(e){var t,n;return null===(t=(null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.accountName)||"")||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n[0]}static getLongName(e){if(!e)return"";if(e.paymentMethodType===o.mf.Bank){var t;const n=(null===(t=e.accountNumber)||void 0===t?void 0:t.slice(-3))||"";return"".concat(r.getShortName(e)," ***").concat(n)}{var n,a;const t=(null===(n=e.cardMetadata)||void 0===n||null===(a=n.lastFour)||void 0===a?void 0:a.slice(-3))||"";return"".concat(r.getShortName(e)," ***").concat(t)}}static escapeAccountNumber(e){return e?e.paymentMethodType===o.mf.Bank?(null===(t=e.accountNumber)||void 0===t?void 0:t.slice(-3))||"":(null===(n=e.accountNumber)||void 0===n?void 0:n.substring(9))||"":"";var t,n}}},54030:(e,t,n)=>{"use strict";n.d(t,{o:()=>s});var o=n(95199),r=n(88571),a=n(95590);const l="v1-invoice",i={invoiceNotes:"invoiceNotes",allInvoices:"allInvoices",singleInvoice:"singleInvoice",payablesInvoices:"payablesInvoices",vendorsList:"vendorsList"},s={domain:l,keys:i,invoiceNotes:(e,t)=>(0,o.j)({queryKey:[l,i.invoiceNotes,e],queryFn:()=>a.r.invoiceNotes(e),...t}),allInvoices:(e,t)=>(0,o.j)({queryKey:[l,i.allInvoices,e],queryFn:t=>{let{signal:n}=t;return a.r.allInvoices(e,{signal:n})},...t}),payablesInvoices:(e,t)=>(0,o.j)({queryKey:[l,i.payablesInvoices,e],queryFn:()=>a.r.payablesInvoices(e),...t}),vendorsList:(e,t)=>
1(0,o.j)({queryKey:[l,i.vendorsList,e],queryFn:()=>a.r.vendorsList(e).then((e=>({items:e.items,totalCount:e.count}))),...t}),allInvoicesInfinite:(e,t)=>(0,r.L)({queryKey:[l,i.allInvoices,"infinite",e],queryFn:t=>{let{pageParam:n,signal:o}=t;return a.r.allInvoices({...e,page:n},{signal:o})},initialPageParam:1,getNextPageParam:(e,t)=>{var n;return t.reduce(((e,t)=>{var n,o;return e+(null!==(n=null===(o=t.items)||void 0===o?void 0:o.length)&&void 0!==n?n:0)}),0)<(null!==(n=e.totalCount)&&void 0!==n?n:0)?t.length+1:void 0},...t}),singleInvoice:(e,t)=>(0,o.j)({queryKey:[l,i.singleInvoice,{id:e}],queryFn:t=>{let{signal:n}=t;return a.r.allInvoices({ids:[e]},{signal:n}).then((e=>e.items[0]))},...t})}},91818:(e,t,n)=>{"use strict";n.d(t,{s:()=>o,v:()=>r});let o=function(e){return e.Personal="personal",e.Business="business",e}({}),r=function(e){return e.Company="company",e.CustomerAccount="customerAccount",e.Guest="guest",e}({})},31652:(e,t,n)=>{"use strict";n.d(t,{y:()=>l});var o=n(95199),r=n(64256);const a="v2-credit",l={all:[a],creditPaymentOptions:(e,t)=>(0,o.j)({queryKey:[a,"creditPaymentOptions",e],queryFn:()=>r.A.creditPaymentOptions(e),...t}),availableSettlements:e=>(0,o.j)({queryKey:[a,"availableSettlements"],queryFn:()=>r.A.availableSettlements(),...e}),extensionOptions:(e,t)=>(0,o.j)({queryKey:[a,"extensionOptions",e],queryFn:()=>r.A.extensionOptions(e),...t}),findSettlements:(e,t)=>(0,o.j)({queryKey:[a,"findSettlements",e],queryFn:()=>r.A.findSettlements(e),...t}),loanPayableDetails:(e,t)=>(0,o.j)({queryKey:[a,"loanPayableDetails",e],queryFn:()=>r.A.loanPayableDetails(e),...t})}},24586:(e,t,n)=>{"use strict";n.d(t,{C:()=>l});var o=n(95199),r=n(88482);const a="v2-factoring",l={all:[a],customerReviewPlans:(e,t)=>(0,o.j)({queryKey:[a,"customerReviewPlans",e],queryFn:()=>r.A.customerReviewPlans(e),...t}),refiDraws:(e,t)=>(0,o.j)({queryKey:[a,"refiDraws",e],queryFn:()=>r.A.refiDraws(e),...t})}},32260:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var o=n(95199),r=n(88571),a=n(56224);const l="v2-invoice",i={all:[l],actionRequiredReceivables:(e,t)=>(0,o.j)({queryKey:[l,"actionRequiredReceivables",e],queryFn:()=>a.A.actionRequiredReceivables(e),...t}),getIhcPaymentInfo:(e,t)=>(0,o.j)({queryKey:[l,"getIhcPaymentInfo",e],queryFn:()=>a.A.getIhcPaymentInfo(e),...t}),getPricingPackageFee:(e,t)=>(0,o.j)({queryKey:[l,"getPricingPackageFee",e],queryFn:()=>a.A.getPricingPackageFee(e),...t}),paymentDetails:(e,t)=>(0,o.j)({queryKey:[l,"paymentDetails",e],queryFn:()=>a.A.paymentDetails(e),staleTime:1e4,...t}),groupedPaymentDetails:(e,t)=>(0,o.j)({queryKey:[l,"groupedPaymentDetails",e],queryFn:()=>a.A.groupedPaymentDetails(e),...t}),publicInvoiceView:(e,t)=>(0,o.j)({queryKey:[l,"publicInvoiceView",e],queryFn:()=>a.A.publicInvoiceView(e),...t}),unpaidSupplierInvoices:(e,t)=>(0,o.j)({queryKey:[l,"unpaidSupplierInvoices",e],queryFn:()=>a.A.unpaidSupplierInvoices(e),...t}),collectedPaymentReceipt:(e,t)=>(0,o.j)({queryKey:[l,"collectedPaymentReceipt",e],queryFn:()=>a.A.collectedPaymentReceipt(e),...t}),customerInvoices:(e,t)=>(0,o.j)({queryKey:[l,"customerInvoices",e],queryFn:()=>a.A.customerInvoices(e),...t}),customerInvoicesInfinite:(e,t)=>(0,r.L)({queryKey:[l,"customerInvoices","infinite",e],queryFn:t=>{let{pageParam:n}=t;return a.A.customerInvoices({...e,page:n})},initialPageParam:1,getNextPageParam:(e,t)=>{var n;return t.reduce(((e,t)=>{var n,o;return e+(null!==(n=null===(o=t.items)||void 0===o?void 0:o.length)&&void 0!==n?n:0)}),0)<(null!==(n=e.totalCount)&&void 0!==n?n:0)?t.length+1:void 0},...t})}},24574:(e,t,n)=>{"use strict";n.d(t,{c:()=>l});var o=n(95199),r=n(81942);const a="v2-project",l={all:[a],unassignedInvoices:(e,t)=>(0,o.j)({queryKey:[a,"unassignedInvoices",e],queryFn:()=>r.A.unassignedInvoices(e),...t}),linkCandidates:(e,t)=>(0,o.j)({queryKey:[a,"linkCandidates",e],queryFn:()=>r.A.linkCandidates(e),...t}),findAll:(e,t)=>(0,o.j)({queryKey:[a,"findAll",e],queryFn:()=>r.A.findAll(e),...t})}},70509:(e,t,n)=>{"use strict";n.d(t,{theme:()=>o,ui:()=>r});var o=n(24038),r=(n(8289),n(14329));n(19925)},23600:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/virtualCard.2292582b28a1a788e285.png"},62679:(e,t,n)=>{"use strict";e.exports=n.p+"static/media/TaxId.ea815cdb5b2ff66fc251.png"},79081:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAU1SURBVHgB7ZzPbxtFFMffzK73h38kmPyoUkhkFRQJ1APClSrBxZW4VKgSl9zTSznlLygHn+HIiVzKEZELUAEXpOwfUHojSA2CqIlSGidxE7v2er2703nb2nLWPxKvvWvHux8p3mjGv+brmTdvZt5bAgHB8nm6o+1I6uKsUDqsCYZdEbFclATa+jzTsOy4mrLtcoUlFqbMv3cPLYAd85ammRAABHyCASM7ubtyYi4uHh2XZRpXBvosu6IzUZqu71VLRk57UCNAGPjA0AV5lL0Xe/fDKam4f6AMKkIv0oqo/1XY0ofdc4b2hVGIdBripgoxCBCxCvViESo3/lyvwxAYWBAGK8K/n6WTQQvhhpqy8f7vM2UCeRsGwLMgaCP273yplgHiMEYkASrvPFyvgEc8CcKAzxhfvJgyrNczxbih2IK19OuVEy+9pW9BttfWZHPrJOmnwRwGthBjxdhB5ZONjWo/r+urUY/u3IunxmyInEe/Q+jCglxGMRr0I8qFBLnMYjS4qCjnCjIJYjS4iCi0V+V/q6vKpIiBoIuwfXtN7vWcroLg1Krv2gmYMEzZTmLbutV3rXj6+fPpcZ9avUCtOkEfCh3LjvWdCtFu6NQSYEJBhxK97E51bYJgd5oku9ENtCebuVybp90myD+3t5MQEpbE5TYbeUYQXMLbYkKCkIArdGxza9kZQXA/A0KGu81NQdjKj8Ko9zRGgbuXNAUpgKZCSFGviU1nzRGE79aSom4qEFJoncgNv8QRRMutyhBi0FnT+AmB8z8+XJ+aD9x2UMlapKL+ExH1QusfFaubWAcBM8+PS5zvhQ+H9P/Ap1pm13/mQ/XTtnIg18E2v4WAwWGDV4KzyxP9jzQEDPYGvMqG8J5OY6fucmYqcxAwy9mrx1Qr/DbSqbZVjFGj8aNW8W3J30Uc/8Uf88tij/pCH+W7vOd8DD6BdoQmbdXXowR+Aju0M9hhvlcnSmWBitQ0+Pzrn021LSWL12494aKgTfFVDc4CNQVakQUKEU2oOz4jzOCmWCSGi0gQF5EgLijGdEGEA0YNRD2kBTtWZXRenhlKKNIkYJclRvf1Z9GQeYOeFi16bAgWRDg
1cFComzeUyBgQBISfgmUFe2w87JiX5vG0Lut/LBL6mYevgFcZ+AJ/BECyMeXVmGTuWrIHPEFv5mhEUpZ9fm5xwA/cNs5SvwGdOatSZXJylP46dq6kAdhHr6n3eFe/385Kgwg+q1ZJjOpwektO+rwUxbMYZjJ/HqyMI/xWYUWE6hBRTEfVGMkHTU60fqcHMNmPIQWGr2RmagmDwPAbSQ8jANrdmVJxZy2BWAYQMd5vPCBK2XlI0ZcOdVtK22r2WLpYhJNy8OdPW1jZByMaGVYLJHzoYxIteuru8435I9uF6VRKMQJL+RoGSEqxuEc0dBUG/JPNR5nQSnTVs09Lyla7Lh56e8WZuVeEu/URFJR4pxZe9cmii4H8XUXqIiyiByEWUYuair2OIG/yNj5TEy8sw++B3pBm51G/Kqrc01XyePn3yfFovjWfGhDQTNzOZt047OV7nMdCG1DgOIfSys798VyXE280SBk91573l8HElccxejDTWtcQXpVm+DsOlBwzAUG+GAGmIpwKOl0chYJxuhuCGrawIBZhT/QwVR4OZTs3re1unxrCEaODfDVUYI9qtu7Kq1qVpWYhRa8AbqnAR8Lgkzk8IMpsPal5txHkElmSIPUcrJGIfLM4Ke89ORcE0iCQLtNMtd/BaorqZmV2wqruHVoafLnqZMbzwCnQULu4ca68cAAAAAElFTkSuQmCC"},55179:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAA2CAYAAACMRWrdAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAaRSURBVHgB1ZpdbBRVFMfPvTP7VW0L9gMoEIrErfBQEwQfFK3ESmJSEw2hCeWFxASJD7xgbBQSa0IwgLzwYBCf2yYSEhPwQUMiKGg0iAmQ1pIQSpC2sHxvZb/m3us5A7tu2/24d3a2qf9ks7M7587Mb865Z+49dxj4rMYzH9VarCky/6FTI2wekbZjgeKhKUZMppRgac6EiIfDcaFiidvr9sfBRzHwQQTTGJ/fkAzLeZbiFniQYFJAkt+frL13xw9Iz2Cbvtlk/b7whWYm2AKvMMVE3kwxOXaj85M74FGewFacPdAs0ukWv4GmqxJAI7BVl/qCyYlgK+OsFmZRBBi+lxwZ6u5L67bRBpstLxUTxz4og5mxK6/03dKx1wJb+dOeRWnHaoE5IMcWY9de2z1ezq4s2PKze5bxlNUIc0giBXdG3/p4tJRNSbC5CJVVOThebAeF31yFIlkhaFiG11hsf0EwShRzpU+VEg5qWlac7WsutG9GKFJKfxQLrKok+wkGtVyqDg7sRQmqDU9Cdzb7iIgrAOz8bISDPO9wfspS4HmkQdkyEMsMTX8U2NMNk+PhNstSnqCkEi0crM2WUl34s1aBKtSJa5kLqaK4921Lqk/x+7gC8TVn1hgYSqIDks8EW3Hzcv7/U867+OTehjBnrWAo8hBe4Dbc3AwVSEkYlDY74smDodT1/GfclD4WUty4X5GXLKEGoEIoEuOw2ZbQT8cEQ/F0oIXGr7nf2Q3yFrNUEAykFES54l+h3xeBT8LwbbHAOqw4RE3aUUjSoDz7Owdm6i26q0ypg35CZUVwXMAXpp4L4kwju+2CteF8ysRbbtbz2VPTlfUcnUu3DXmt8dt9rr0LlsrMbwADuYmiilBZuZ5z3KSkradD0mV5Eopynm7DJ+FRcaLQFSUUk5AMhB+zWBSGIGqadBuCYjsZM+vYlYrRU4mxX3Vs8ZnIrXc3THIHCy+gKSbw4cqgC3zU4nA9nHr5A/dT/MTQZdLX6psSEc6SSn82zFUH+KhaOwSH2zfCEoQrOc1QaOrI10FT4mGoBod0jvbwSSpYAz5q/8ouWPn0AriRfAA95/tLG3O+GjSlajIRPqPmV0J4V33rW7uf64Q3m6I5KPouJalUG2jKSgdtbjTaKJPiKbToU047lr8KW5euhbiThO0XjpWFck/N9R8vxMTBTCX74/GX3nM/lBCKiaB2LF/nbvecH4DhyZugJQVGlTFTsJIajt90E0H/6i0F4bYuWZuD6h06oQ/lQaZgJacTvcPfFYXbuLAddkc73e1DV3+GYxMXwUjMbCrDqRipba2gZNnrIfaZLX8OTIGjPkeZb1f0DdeGoA5dPQOmwrla2ZJbzpYWPAQwR7sByMvlbAhu+8XHCYHgBhCuf3UP1Nlhz1AkztiItjGu5nBek3mk34Cf0zHLT+HkLYI6Nn7BMxRJYn1E15aWpziHUEK7gWSnAfRiPR/ut/vX3P5XiSQWfXRtVVjEbTsmE06dZgMLoRScAM3RPUF1/PIlVCocBB83qYM8iEUSfOSd3ri76KYpDIlBmGUJrGDp2lI57jYyuemeBdU9/YZUImOzCMcGTcpyGVwVpW8XLBgL3AUDMQlHlNJPv16Fc6sxweGISZvJFHcXCV0w03CkvqaYfL+acASFRdTtRjVGTPMUhrSZG3lELGU0vnHDg7Gd1YAjKPz60LQyHBAsdy05sOGJ6C0Tr5FwNn3Zb89lPUXHNmqI3vorb636v7Fid7eoSweNa+d0V7liPf4kFDYoOWzxUsPP95Z7pOkGz57cG/W6eO6WuxXfpszqItgn2AkJYtALkCv01pX1uy7l/zVjtSW8MD3qdRmJLgyh+rDwchCn5h04EF2jaNbNpi4j0WCa4dhPcvWHBHaaEgSu0oAXyQBzIuPpGWFbsIbS/v2B5n8CzlL4H0hK+ffVzl0zEl/R4lDbD/taHFtWvdpbidIOH7++obdg+BadaI5gAwwpz6/8VFt0bcWgSGVfh2j98fNW7ANGtf1qi6BG11fwOkRWcyksS4VfvrRqHhSWT2Xs66YPcD9F2Y8ShQ4UyfglsVQsEDUpsvohJVU8fDc1OtT9mf8vieXreVzWzVhqUbUByUuQEhOF0nk5VfSGabUACSiYYLH2++duHu0+6in8fXl1tg2XR1P1soHZrJ5nlO3lGAQTmlQPFM6nRp5MPSqRL2D5IkiniUdoeYpWcty1gQIvOzuOLSKOTGTq7EdUd/EDJl//AgXc/BUqRhznAAAAAElFTkSuQmCC"},46638:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAXFSURBVHgB7Zw9bCNFFMff7Gf8cbGClIBOClgICSk64IQLCpqkJAKJhtMVFKlIBR3XcIULqqS8KlRpkE6pQBycqC5XRCjicjrpoDtEAIEuFyFjx/Ha+zXMm7V9a3vXiT92/LH5Savd7G6c7N9v3nsz82YJCILm8xK8sq3B5VkZjhMyaCcKv5BISC03GoYLquaCJVPIWDb8U3Lgj6xN8rs2CIBARFDKPns7q0M2q0DhqQ5qarC/ZZ1SqGQssI5MWDusEQIUImDogtCtnApZS4NTc2ZgEbqRNqpwf6E6bMsZ2j/MhZiDJCRABZEYYEEBKmT9wIIhMLAgdAdkgFxauBDtFBUTnuyXSR5cGIC+BeE+4k4uwQ6TMF5UyAcHFeiTvgRhYkiwe3UWyrIC4wgxHXjwuNiPtfQsCP3hPR2qv6cjdZjDAMO2LVfItZ+MXn6tp4ei3+WweYxbEzmLnprQuQWZUDEanFuUcwky4WI0OJcoZwoyJWI0OFMUqdtFem95BqZHDCTJg0IXQgXhobXwNAXTRvXfNM2HP3e4hXz/RmbsQ2s/qA6Bt67O8sQygEBBuN+gmgzTisISSi/L7qBDEN5UpstvhJGk+eWOTLvTQr5+Jw1xYemkw0e2CMK78Blbg7jAeuj8mX20WshcLJpKK23P3BSEj2uMekxjFLRZyXMLmV9KQFyZM5rJGheEx+RyYgbiipLWG3mJZyG7WR3iDCZr254GniCqPhLfYbn2YtWyvjEs67f6dgvPwSjA6RKGl5g8y2hMJRCN7bjfsp1fgOuOQ6+oEqyAaAoVtJCyxKMLmoxgmGWss90im3D6UyXyiiJLb+Mxm326YjrWJyAapgHOLkownxXeXLBZUKAoCHqyTUWRf1El5S+Jwmd4znXpjZpdy4Bo2FSrBOas8E6c7dAbwJsKva0r2u3GeU3V9giQPWYlGZdKX4JoUklFgqIqdCrBtMx3mRDX8ViR5Y3267JMPmWiFPEe716BpC+xJiPYfzDXfQv3EpE2sJngsWGZD3HDYzxHwf3Kf68w3IosgWVKIAjDqvGmgs5TV5RN36VF8EUbiehbeA+eq9n25yAQqaM+IyK8/EJqOtJu9+oKFBsOllJ3XVhuwgbFhFmH50jpbLsjDaPuYO9yB+u6whysEEFYzrGKThKdZZAjDYM52C/wd1wKq6IcrBBBWM7Bv2FCyFbDkfpBf1H3GS2MwsFKvKYrQro40iYzipbDLehaQtU3hDlYYjqRWojfkcpAb4bd5w+7QQhzsCmZSnDZGUopUhB+R6oq+t2w+7CArlsRnd/Bss5fdE3nWKaE/vhmCkw1ktEy9q0f4x47bkG+oxfQMljv+CEL2cUZVXsNosAwqhJopcj6/V4Kjp01d+AIQR335fqHFiEqTis24RNTd3IvQARUrdo6G5kbag6BKX+Ycx6Y9KX/JNZ2varhCJhR9S323W4GhdReQWtj283IxGAakJVdm3fs6L2ldKwHmRFZMcnqfqkeditC6sjHmqMjE3eeIMuHtaiazcSwxjSAuiA8B0hVqxBX0ka1kQc9z1QPVRNiy0LTGJqC8OJ5LKSPG+yZMbo0fmztyxSg7xrxiaXtmTvGU+lOLhObKoAiC7Uf75f8pwJ6u6+WIS482e941sAR9ykr1g0jsIg3eDzk/QOD9d2nN1ljA0FhFc2BgvCY/OGj0lQma7iY8cHj0B5z6IgZ7/QVn53CtGHPVbotLLoo/m/jYnlIGxcLiNq4WGLWRk/TEPyDjaPTiYg+GE3khZNel6z2v0wVl4+M64qJNMuh7j8qCVmm6mdMm1AFE8t+X5Yw+FJ3tJa911NQSI+21pUPXRyUyTUYaFrl4mUIbQz/dRk7H8kw/2si0lF8dJgprYqjfMMSokG0L1TBkvG/X9QgWVSH8kKVuZdqcHhoT9QLVcLwLOdnlZeBYuUjFvthfVvQK3cQ85IN84bjvXJnzST5fKRlGw3+BydrdW2OidHLAAAAAElFTkSuQmCC"},25662:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAU1SURBVHgB7ZzPbxtFFMffzK73h38kmPyoUkhkFRQJ1APClSrBxZW4VKgSl9zTSznlLygHn+HIiVzKEZELUAEXpOwfUHojSA2CqIlSGidxE7v2er2703nb2nLWPxKvvWvHux8p3mjGv+brmTdvZt5bAgHB8nm6o+1I6uKsUDqsCYZdEbFclATa+jzTsOy4mrLtcoUlFqbMv3cPLYAd85ammRAABHyCASM7ubtyYi4uHh2XZRpXBvosu6IzUZqu71VLRk57UCNAGPjA0AV5lL0Xe/fDKam4f6AMKkIv0oqo/1XY0ofdc4b2hVGIdBripgoxCBCxCvViESo3/lyvwxAYWBAGK8K/n6WTQQvhhpqy8f7vM2UCeRsGwLMgaCP273yplgHiMEYkASrvPFyvgEc8CcKAzxhfvJgyrNczxbih2IK19OuVEy+9pW9BttfWZHPrJOmnwRwGthBjxdhB5ZONjWo/r+urUY/u3IunxmyInEe/Q+jCglxGMRr0I8qFBLnMYjS4qCjnCjIJYjS4iCi0V+V/q6vKpIiBoIuwfXtN7vWcroLg1Krv2gmYMEzZTmLbutV3rXj6+fPpcZ9avUCtOkEfCh3LjvWdCtFu6NQSYEJBhxK97E51bYJgd5oku9ENtCebuVybp90myD+3t5MQEpbE5TYbeUYQXMLbYkKCkIArdGxza9kZQXA/A0KGu81NQdjKj8Ko9zRGgbuXNAUpgKZCSFGviU1nzRGE79aSom4qEFJoncgNv8QRRMutyhBi0FnT+AmB8z8+XJ+aD9x2UMlapKL+ExH1QusfFaubWAcBM8+PS5zvhQ+H9P/Ap1pm13/mQ/XTtnIg18E2v4WAwWGDV4KzyxP9jzQEDPYGvMqG8J5OY6fucmYqcxAwy9mrx1Qr/DbSqbZVjFGj8aNW8W3J30Uc/8Uf88tij/pCH+W7vOd8DD6BdoQmbdXXowR+Aju0M9hhvlcnSmWBitQ0+Pzrn021LSWL12494aKgTfFVDc4CNQVakQUKEU2oOz4jzOCmWCSGi0gQF5EgLijGdEGEA0YNRD2kBTtWZXRenhlKKNIkYJclRvf1Z9GQeYOeFi16bAgWRDg
1cFComzeUyBgQBISfgmUFe2w87JiX5vG0Lut/LBL6mYevgFcZ+AJ/BECyMeXVmGTuWrIHPEFv5mhEUpZ9fm5xwA/cNs5SvwGdOatSZXJylP46dq6kAdhHr6n3eFe/385Kgwg+q1ZJjOpwektO+rwUxbMYZjJ/HqyMI/xWYUWE6hBRTEfVGMkHTU60fqcHMNmPIQWGr2RmagmDwPAbSQ8jANrdmVJxZy2BWAYQMd5vPCBK2XlI0ZcOdVtK22r2WLpYhJNy8OdPW1jZByMaGVYLJHzoYxIteuru8435I9uF6VRKMQJL+RoGSEqxuEc0dBUG/JPNR5nQSnTVs09Lyla7Lh56e8WZuVeEu/URFJR4pxZe9cmii4H8XUXqIiyiByEWUYuair2OIG/yNj5TEy8sw++B3pBm51G/Kqrc01XyePn3yfFovjWfGhDQTNzOZt047OV7nMdCG1DgOIfSys798VyXE280SBk91573l8HElccxejDTWtcQXpVm+DsOlBwzAUG+GAGmIpwKOl0chYJxuhuCGrawIBZhT/QwVR4OZTs3re1unxrCEaODfDVUYI9qtu7Kq1qVpWYhRa8AbqnAR8Lgkzk8IMpsPal5txHkElmSIPUcrJGIfLM4Ke89ORcE0iCQLtNMtd/BaorqZmV2wqruHVoafLnqZMbzwCnQULu4ca68cAAAAAElFTkSuQmCC"},8894:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAA2CAYAAACMRWrdAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAaRSURBVHgB1ZpdbBRVFMfPvTP7VW0L9gMoEIrErfBQEwQfFK3ESmJSEw2hCeWFxASJD7xgbBQSa0IwgLzwYBCf2yYSEhPwQUMiKGg0iAmQ1pIQSpC2sHxvZb/m3us5A7tu2/24d3a2qf9ks7M7587Mb865Z+49dxj4rMYzH9VarCky/6FTI2wekbZjgeKhKUZMppRgac6EiIfDcaFiidvr9sfBRzHwQQTTGJ/fkAzLeZbiFniQYFJAkt+frL13xw9Iz2Cbvtlk/b7whWYm2AKvMMVE3kwxOXaj85M74FGewFacPdAs0ukWv4GmqxJAI7BVl/qCyYlgK+OsFmZRBBi+lxwZ6u5L67bRBpstLxUTxz4og5mxK6/03dKx1wJb+dOeRWnHaoE5IMcWY9de2z1ezq4s2PKze5bxlNUIc0giBXdG3/p4tJRNSbC5CJVVOThebAeF31yFIlkhaFiG11hsf0EwShRzpU+VEg5qWlac7WsutG9GKFJKfxQLrKok+wkGtVyqDg7sRQmqDU9Cdzb7iIgrAOz8bISDPO9wfspS4HmkQdkyEMsMTX8U2NMNk+PhNstSnqCkEi0crM2WUl34s1aBKtSJa5kLqaK4921Lqk/x+7gC8TVn1hgYSqIDks8EW3Hzcv7/U867+OTehjBnrWAo8hBe4Dbc3AwVSEkYlDY74smDodT1/GfclD4WUty4X5GXLKEGoEIoEuOw2ZbQT8cEQ/F0oIXGr7nf2Q3yFrNUEAykFES54l+h3xeBT8LwbbHAOqw4RE3aUUjSoDz7Owdm6i26q0ypg35CZUVwXMAXpp4L4kwju+2CteF8ysRbbtbz2VPTlfUcnUu3DXmt8dt9rr0LlsrMbwADuYmiilBZuZ5z3KSkradD0mV5Eopynm7DJ+FRcaLQFSUUk5AMhB+zWBSGIGqadBuCYjsZM+vYlYrRU4mxX3Vs8ZnIrXc3THIHCy+gKSbw4cqgC3zU4nA9nHr5A/dT/MTQZdLX6psSEc6SSn82zFUH+KhaOwSH2zfCEoQrOc1QaOrI10FT4mGoBod0jvbwSSpYAz5q/8ouWPn0AriRfAA95/tLG3O+GjSlajIRPqPmV0J4V33rW7uf64Q3m6I5KPouJalUG2jKSgdtbjTaKJPiKbToU047lr8KW5euhbiThO0XjpWFck/N9R8vxMTBTCX74/GX3nM/lBCKiaB2LF/nbvecH4DhyZugJQVGlTFTsJIajt90E0H/6i0F4bYuWZuD6h06oQ/lQaZgJacTvcPfFYXbuLAddkc73e1DV3+GYxMXwUjMbCrDqRipba2gZNnrIfaZLX8OTIGjPkeZb1f0DdeGoA5dPQOmwrla2ZJbzpYWPAQwR7sByMvlbAhu+8XHCYHgBhCuf3UP1Nlhz1AkztiItjGu5nBek3mk34Cf0zHLT+HkLYI6Nn7BMxRJYn1E15aWpziHUEK7gWSnAfRiPR/ut/vX3P5XiSQWfXRtVVjEbTsmE06dZgMLoRScAM3RPUF1/PIlVCocBB83qYM8iEUSfOSd3ri76KYpDIlBmGUJrGDp2lI57jYyuemeBdU9/YZUImOzCMcGTcpyGVwVpW8XLBgL3AUDMQlHlNJPv16Fc6sxweGISZvJFHcXCV0w03CkvqaYfL+acASFRdTtRjVGTPMUhrSZG3lELGU0vnHDg7Gd1YAjKPz60LQyHBAsdy05sOGJ6C0Tr5FwNn3Zb89lPUXHNmqI3vorb636v7Fid7eoSweNa+d0V7liPf4kFDYoOWzxUsPP95Z7pOkGz57cG/W6eO6WuxXfpszqItgn2AkJYtALkCv01pX1uy7l/zVjtSW8MD3qdRmJLgyh+rDwchCn5h04EF2jaNbNpi4j0WCa4dhPcvWHBHaaEgSu0oAXyQBzIuPpGWFbsIbS/v2B5n8CzlL4H0hK+ffVzl0zEl/R4lDbD/taHFtWvdpbidIOH7++obdg+BadaI5gAwwpz6/8VFt0bcWgSGVfh2j98fNW7ANGtf1qi6BG11fwOkRWcyksS4VfvrRqHhSWT2Xs66YPcD9F2Y8ShQ4UyfglsVQsEDUpsvohJVU8fDc1OtT9mf8vieXreVzWzVhqUbUByUuQEhOF0nk5VfSGabUACSiYYLH2++duHu0+6in8fXl1tg2XR1P1soHZrJ5nlO3lGAQTmlQPFM6nRp5MPSqRL2D5IkiniUdoeYpWcty1gQIvOzuOLSKOTGTq7EdUd/EDJl//AgXc/BUqRhznAAAAAElFTkSuQmCC"},451:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAXFSURBVHgB7Zw9bCNFFMff7Gf8cbGClIBOClgICSk64IQLCpqkJAKJhtMVFKlIBR3XcIULqqS8KlRpkE6pQBycqC5XRCjicjrpoDtEAIEuFyFjx/Ha+zXMm7V9a3vXiT92/LH5Savd7G6c7N9v3nsz82YJCILm8xK8sq3B5VkZjhMyaCcKv5BISC03GoYLquaCJVPIWDb8U3Lgj6xN8rs2CIBARFDKPns7q0M2q0DhqQ5qarC/ZZ1SqGQssI5MWDusEQIUImDogtCtnApZS4NTc2ZgEbqRNqpwf6E6bMsZ2j/MhZiDJCRABZEYYEEBKmT9wIIhMLAgdAdkgFxauBDtFBUTnuyXSR5cGIC+BeE+4k4uwQ6TMF5UyAcHFeiTvgRhYkiwe3UWyrIC4wgxHXjwuNiPtfQsCP3hPR2qv6cjdZjDAMO2LVfItZ+MXn6tp4ei3+WweYxbEzmLnprQuQWZUDEanFuUcwky4WI0OJcoZwoyJWI0OFMUqdtFem95BqZHDCTJg0IXQgXhobXwNAXTRvXfNM2HP3e4hXz/RmbsQ2s/qA6Bt67O8sQygEBBuN+gmgzTisISSi/L7qBDEN5UpstvhJGk+eWOTLvTQr5+Jw1xYemkw0e2CMK78Blbg7jAeuj8mX20WshcLJpKK23P3BSEj2uMekxjFLRZyXMLmV9KQFyZM5rJGheEx+RyYgbiipLWG3mJZyG7WR3iDCZr254GniCqPhLfYbn2YtWyvjEs67f6dgvPwSjA6RKGl5g8y2hMJRCN7bjfsp1fgOuOQ6+oEqyAaAoVtJCyxKMLmoxgmGWss90im3D6UyXyiiJLb+Mxm326YjrWJyAapgHOLkownxXeXLBZUKAoCHqyTUWRf1El5S+Jwmd4znXpjZpdy4Bo2FSrBOas8E6c7dAbwJsKva0r2u3GeU3V9giQPWYlGZdKX4JoUklFgqIqdCrBtMx3mRDX8ViR5Y3267JMPmWiFPEe716BpC+xJiPYfzDXfQv3EpE2sJngsWGZD3HDYzxHwf3Kf68w3IosgWVKIAjDqvGmgs5TV5RN36VF8EUbiehbeA+eq9n25yAQqaM+IyK8/EJqOtJu9+oKFBsOllJ3XVhuwgbFhFmH50jpbLsjDaPuYO9yB+u6whysEEFYzrGKThKdZZAjDYM52C/wd1wKq6IcrBBBWM7Bv2FCyFbDkfpBf1H3GS2MwsFKvKYrQro40iYzipbDLehaQtU3hDlYYjqRWojfkcpAb4bd5w+7QQhzsCmZSnDZGUopUhB+R6oq+t2w+7CArlsRnd/Bss5fdE3nWKaE/vhmCkw1ktEy9q0f4x47bkG+oxfQMljv+CEL2cUZVXsNosAwqhJopcj6/V4Kjp01d+AIQR335fqHFiEqTis24RNTd3IvQARUrdo6G5kbag6BKX+Ycx6Y9KX/JNZ2varhCJhR9S323W4GhdReQWtj283IxGAakJVdm3fs6L2ldKwHmRFZMcnqfqkeditC6sjHmqMjE3eeIMuHtaiazcSwxjSAuiA8B0hVqxBX0ka1kQc9z1QPVRNiy0LTGJqC8OJ5LKSPG+yZMbo0fmztyxSg7xrxiaXtmTvGU+lOLhObKoAiC7Uf75f8pwJ6u6+WIS482e941sAR9ykr1g0jsIg3eDzk/QOD9d2nN1ljA0FhFc2BgvCY/OGj0lQma7iY8cHj0B5z6IgZ7/QVn53CtGHPVbotLLoo/m/jYnlIGxcLiNq4WGLWRk/TEPyDjaPTiYg+GE3khZNel6z2v0wVl4+M64qJNMuh7j8qCVmm6mdMm1AFE8t+X5Yw+FJ3tJa911NQSI+21pUPXRyUyTUYaFrl4mUIbQz/dRk7H8kw/2si0lF8dJgprYqjfMMSokG0L1TBkvG/X9QgWVSH8kKVuZdqcHhoT9QLVcLwLOdnlZeBYuUjFvthfVvQK3cQ85IN84bjvXJnzST5fKRlGw3+BydrdW2OidHLAAAAAElFTkSuQmCC"},82590:()=>{},85515:()=>{},82474:()=>{},39630:()=>{},71040:()=>{}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.