PageSourceSearch

https://dashboard.velocity.in/assets/index-Z-SNNVo5.js

js velocity.in collected 2026-10-01 11:33:43 UTC 26,399 bytes, 1 lines download raw bytes

1import{j as e,eq as T,dl as Se,dR as te,C as me,bW as Y,ex as qe,Z as Ie,e7 as ue,d2 as ae,kl as Ae,Q as Le,aP as $,c as S,bw as Fe,eZ as Te,ak as W,hm as pe,gW as Be,r as p,M as E,n as K,v as k,a1 as D,d1 as O,d as Me,o as G,p as U,L as w,F as P,aA as Ee,fw as Ve,x as _e,W as z,U as he,db as $e,P as ze,bk as xe,i4 as I,gF as ne,d4 as ie,gG as He,cu as Ye,a5 as We,Y as Ke,by as Oe,u as Ge,q as Ue,fa as Ze}from"./index-BYjmYzu-.js";import{s as V,N as Je}from"./new_vendor_customer-2jaHrB49.js";import{C as B}from"./col-DSokC5oO.js";import{g as Z,a as je}from"./utils-BZTh1pv3.js";import{b as Qe,c as Xe,r as ve,m as es,s as ss,d as ts,e as ye}from"./index-DlGRYUYt.js";import{M as Ne}from"./modal_component-CgKrFsb7.js";import{M as Ce}from"./modal_header-su8lU-Gk.js";import{F as as}from"./formik_datepicker-BzUdxBt3.js";import{a as ns}from"./index-m16DZvkM.js";import{a as ke,b as is,p as rs,q as os}from"./index-DAkkRkhc.js";import{v as M}from"./form_utils-BRD3em_d.js";import{a as cs}from"./date-tEKqmKn2.js";import{c as ls}from"./feature_utils-DDT4JeF1.js";import{F as ds}from"./constants-DWya29Vt.js";import{R as ms}from"./MenuFoldOutlined-CG1Z5Jtt.js";import{A as J}from"./index-CKmpMa3z.js";import{s as f,a as x}from"./new_payment_request.module-CtIR-xi7.js";import{u as us}from"./index-DaqPscqA.js";import{R as ps}from"./rbac_button_wrapper-Bdh6PdN4.js";import{A as fe}from"./account_details_card-BmFIQga0.js";import{I as re}from"./common_card_components-uRdztIn7.js";import{D as _s,C as hs}from"./dropdown_item-D-YCmEUf.js";import{P as xs}from"./index-Da89g_ZO.js";import{M as oe}from"./dropdown-CVdns1v5.js";import{g as js}from"./format_date_utils-BUOZNjAG.js";import{d as ce,I as vs,b as _,V as ys,c as A,D as Ns}from"./drawer_component-rm7-1vJU.js";import{P as Cs}from"./payment_details-DlT8eU0o.js";import{L as ks}from"./index-Cyc1eiiQ.js";import{I as fs}from"./infinte_scroll_container-B6ZGJA3m.js";import{C as bs}from"./common_page-Bxr-oQPy.js";import{s as ws}from"./payments_requests.module-BaB2F2MC.js";import"./react-number-format.es-HDPTMfGw.js";import"./index-BNQX9KrA.js";import"./DialogWrap-BcWh8mEF.js";import"./Portal-BnIU9h3K.js";import"./getScrollBarSize-BX5bDlpW.js";import"./useId-CCfbXMy0.js";/* empty css               */import"./utc-T2Ax4Tha.js";import"./Dropdown-Dy0ThnTD.js";import"./isNumeric-OYazz19Q.js";import"./modal_component-6RNUWz7c.js";import"./modal_header-BCd36PwY.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./tiny-invariant-CopsF_GD.js";import"./index-CZNe-HiK.js";const gs=({vendorCustomer:t})=>{const{email:s,gstin:a,phone:n,gst_number:i,contact:o}=t||{},r=[{label:"Email",value:s},{label:"Contact Number",value:n},{label:"GST",value:a}];return e.jsxs("section",{className:ce.vendorInfoPanel,children:[e.jsx("h5",{className:ce.sectionTitle,children:"CUSTOMER INFO"}),r.map((c,l)=>e.jsx(vs,{keyText:c.label,value:c.value},c.label+l))]})},Ds=({requestDetails:t})=>{const{composite_status:s,total_amount:a,reject_reason:n,amount:i,gst_amount:o,invoice_document:r,payment_link:{status:c}}=t,m={pending:()=>e.jsxs("div",{className:_.grey,children:[e.jsx(te,{}),e.jsx("span",{className:_.statusLabel,children:"Payment Link Sent"})]}),settled:()=>e.jsxs("div",{className:_.green,children:[e.jsx(T,{}),e.jsx("span",{className:_.statusLabel,children:"Paid"})]}),seen:()=>e.jsxs("div",{className:_.blue,children:[e.jsx(te,{}),e.jsx("span",{className:_.statusLabel,children:"Payment Link Viewed"})]}),attempted:()=>e.jsxs("div",{className:_.blue,children:[e.jsx(Se,{}),e.jsx("span",{className:_.statusLabel,children:"Payment Attempted"})]}),initiated:()=>e.jsxs("div",{className:_.blue,children:[e.jsx(T,{}),e.jsx("span",{className:_.statusLabel,children:"Payment Initiated"})]}),success:()=>e.jsxs("div",{className:_.blue,children:[e.jsx(T,{}),e.jsx("span",{className:_.statusLabel,children:"Payment Success"})]})}[c];return e.jsxs("div",{className:_.transferDetails,children:[e.jsxs("div",{children:[e.jsx("span",{className:_.createdAt,children:"AMOUNT"}),e.jsx("div",{className:_.transferAmount,children:Z(parseFloat(i||0))}),e.jsx("div",{className:_.statusContainer,children:e.jsx(m,{})})]}),e.jsx(ys,{invoice_document:{url:r,name:r}})]})},Ps=({vendorCustomer:t={}})=>{const{name:s}=t||{};return e.jsxs("div",{className:A.vendorDetailsContainer,children:[e.jsx(J,{shape:"square",size:60,className:A.dis
1playName,children:s==null?void 0:s[0]}),e.jsx("div",{className:A.vendorDetailsCard,children:e.jsx("div",{children:e.jsx(me,{align:"center",children:e.jsx(Y,{title:s,children:e.jsx("h4",{className:A.vendorName,children:qe(Ie(s),25)})})})})})]})},Rs="_sectionTitle_mr10b_42",Ss="_payRequestCopyPanel_mr10b_49",qs="_copyContainer_mr10b_53",Is="_url_mr10b_63",L={sectionTitle:Rs,payRequestCopyPanel:Ss,copyContainer:qs,url:Is};function As({requestDetails:t}){const{payment_link:{payment_link_url:s}}=t||{},a=n=>{navigator.clipboard.writeText(n)};return e.jsxs("section",{className:L.payRequestCopyPanel,children:[e.jsx("h5",{className:L.sectionTitle,children:"PAYMENT LINK"}),e.jsxs("div",{className:L.copyContainer,children:[e.jsx("span",{className:L.url,children:s}),e.jsx(Y,{title:"Payment link copied!",trigger:"click",placement:"topRight",children:e.jsx(ue,{onClick:()=>a(s)})})]})]})}const Ls="_sectionTitle_8qlrb_42",Fs="_reminderPanel_8qlrb_49",Ts="_reminderCtas_8qlrb_58",Bs="_whatsappIcon_8qlrb_62",F={sectionTitle:Ls,reminderPanel:Fs,reminderCtas:Ts,whatsappIcon:Bs};function Ms({sendReminder:t}){return e.jsxs("section",{className:F.reminderPanel,children:[e.jsx("h5",{className:F.sectionTitle,children:"SEND REMINDER"}),e.jsxs("div",{className:F.reminderCtas,children:[e.jsx(ae,{size:"small",onClick:()=>t("whatsapp"),children:e.jsx(Ae,{className:F.whatsappIcon})}),e.jsx(ae,{size:"small",onClick:()=>t("email"),children:e.jsx(Le,{})})]})]})}const Es=t=>[{title:"Name",size:6,key:"title"},{title:"Invoice Amount",size:13,key:"amount"},{title:"Actions",size:5,key:"actions"}],Vs=({checkAllCards:t})=>{const s=Es();return e.jsx($,{gutter:0,align:"middle",className:V.headerRow,children:s.map(a=>e.jsx(B,{span:a.size,children:e.jsx("span",{className:V.listHeader,children:a.title})},a.key))})},$s="_summaryContainer_x9j6i_10",zs="_totalDue_x9j6i_16",Hs="_label_x9j6i_20",Ys="_value_x9j6i_24",Ws="_otherDataContainer_x9j6i_29",Ks="_otherData_x9j6i_29",Os="_overdue_x9j6i_47",Gs="_left_x9j6i_50",N={summaryContainer:$s,totalDue:zs,label:Hs,value:Ys,otherDataContainer:Ws,otherData:Ks,overdue:Os,left:Gs},Us=()=>{const{paymentSummary:t,isLoading:s}=Qe();return s?e.jsx(S,{}):e.jsxs("div",{className:N.summaryContainer,children:[e.jsxs("div",{className:N.left,children:[e.jsxs("div",{className:N.totalDue,children:[e.jsx("span",{className:N.label,children:"Total Due"}),e.jsx("span",{className:N.value,children:je(t.total_due_amount)})]}),e.jsx(Fe,{type:"vertical"})]}),e.jsxs("div",{className:N.otherDataContainer,children:[e.jsx(H,{label:t.overdue_amount,value:"Overdue",overdue:!0}),e.jsx(H,{label:t.due_15_days,value:"Due in 15 days"}),e.jsx(H,{label:t.due_30_days,value:"Due in 30 days"})]})]})},H=({label:t,value:s,overdue:a=!1})=>e.jsxs("div",{className:W(N.otherData,a?N.overdue:void 0),children:[e.jsx("span",{className:N.label,children:je(t)}),e.jsxs("span",{className:N.value,children:[a&&e.jsx(Te,{})," ",s]})]}),Zs="_container_1r9g6_10",Js="_title_1r9g6_13",Qs="_item_1r9g6_19",Xs="_itemList_1r9g6_33",et="_closeIcon_1r9g6_39",st="_itemDiv_1r9g6_44",tt="_itemDivNoInput_1r9g6_49",at="_add_1r9g6_52",nt="_inputAddDiv_1r9g6_66",y={container:Zs,title:Js,item:Qs,itemList:Xs,closeIcon:et,itemDiv:st,itemDivNoInput:tt,add:at,inputAddDiv:nt},it=({showInput:t,handleAdd:s,setShowInput:a,input:n,resetInput:i})=>{const o=()=>{if(t){s(n,i);return}a(!0)};return e.jsx("div",{className:y.add,onClick:o,children:e.jsx(pe,{})})},rt=({item:t,index:s,removeItem:a})=>{const n=s===0;return e.jsxs("div",{className:y.item,children:[t,!n&&e.jsx(Be,{className:y.closeIcon,onClick:()=>a(s)})]})},le=({list:t=[],title:s,handleAdd:a,removeItem:n})=>{const[i,o]=p.useState(""),[r,c]=p.useState(!1),l=()=>e.jsx(it,{showInput:r,handleAdd:a,setShowInput:c,input:i,resetInput:()=>{o(""),c(!1)}});return e.jsxs("div",{className:y.container,children:[e.jsx("div",{className:y.title,children:s}),e.jsxs("div",{className:y.itemList,children:[t.map((m,u)=>{const h=u===t.length-1;return e.jsxs("div",{className:W(y.itemDiv,r?void 0:y.itemDivNoInput),children:[e.jsx(rt,{item:m,index:u,removeItem:n}),h&&!r&&e.jsx(l,{})]},m)}),r&&e.jsxs("div",{className:y.inputAddDiv,children:[e.jsx("input",{className:y.item,onChange:m=>o(m.target.value),value:i}),e.jsx(l,{})]})]})]})},ot="_amount_wjkbd_10",ct="_ccFeesRow_wjkbd_17",lt="_includeFeesContainer_wjkbd_23",dt="_title_wjkbd_27",mt="_moneyInfo_wjkbd_30",ut="_value_wjkbd_35",pt="_dueDateInvoiceRow_wjkbd_38",_t="_icon_wjkbd_45",ht="_includePaymentLinks_wjkbd_54",xt="_header_wjkbd_63",jt="_description_wjkbd_67",vt="_sendHeader_wjkbd_71",yt="_requestModeTitle_wjkbd_81",Nt="_whatsappImg_wjkbd_84",Ct="_whatsappTitle_wjkbd_87",kt="_whatsappTitleContainer_wjkbd_92",ft="_submitBtn_wjkbd_95",bt="_container_wjkbd_114",wt="_sendRequestList_wjkbd_117",d={amount:ot,ccFeesRow:ct,includeFeesContainer:lt,title:dt,moneyInfo:mt,value:ut,dueDateInvoiceRow:pt,icon:_t,includePaymentLinks:ht,header:xt,description:jt,sendHeader:vt,requestModeTitle:yt,whatsappImg:Nt,whatsappTitle:Ct,whatsappTitleContainer:kt,submitBtn:ft,container:bt,sendRequestList:wt},gt=()=>{const t=X(),s=Q(),a=(i,o)=>
1{if(!k.email(i)){D("Please enter valid email!");return}if(s!=null&&s.email_list.includes(i)){D("Email already added!");return}t({type:"update_email_list",payload:i}),o()},n=(i,o)=>{if(!k.phoneNumber(i)){D("Please enter valid phone");return}if(s!=null&&s.whatsapp_list.includes(i)){D("Contact already added!");return}t({type:"update_whatsapp_list",payload:i}),o()};return e.jsxs(me,{direction:"vertical",size:"middle",className:d.sendRequestList,children:[e.jsx(le,{list:s==null?void 0:s.email_list,removeItem:i=>{const o=s.email_list;o.splice(i,1),t({type:"reset_email_list",payload:o})},title:e.jsxs("div",{children:[e.jsx(E,{name:"email",defaultChecked:!0}),e.jsx("span",{className:d.requestModeTitle,children:"Email"})]}),handleAdd:a}),e.jsx(le,{list:s==null?void 0:s.whatsapp_list,removeItem:i=>{const o=s.whatsapp_list;o.splice(i,1),t({type:"reset_whatsapp_list",payload:o})},title:e.jsxs("div",{className:d.whatsappTitleContainer,children:[e.jsx(E,{name:"whatsapp",defaultChecked:!0}),e.jsxs("div",{className:d.whatsappTitle,children:[e.jsx("span",{className:d.requestModeTitle,children:"Whatsapp"}),e.jsx("img",{alt:"whatsapp",src:K("whatsapp.png"),className:d.whatsappImg})]})]}),handleAdd:n})]})},Dt=()=>{const{mutate:t}=O(),{profile:s}=Me(),a=X(),n=Q(),{paymentsAccount:i}=ns();ke();const o=ls(s,ds.RECEIVABLES_INSTANT_SETTLEMENT),r={amount:"",include_fees:!0,remarks:"",payment_link:!0,email:!0,whatsapp:!0,due_date:"",source_payments_user_id:""};return e.jsx("div",{className:d.container,children:e.jsx(G,{enableReinitialize:!0,initialValues:r,onSubmit:async(c,l)=>{var se;const{amount:m,include_fees:u,remarks:h,payment_link:C,email:R,whatsapp:q,due_date:ee}=c;if(!ee){D("Please select due date"),l.setSubmitting(!1);return}if(!R&&!q){D("Please select either email or whatsapp"),l.setSubmitting(!1);return}const{ok:De,data:Pe}=await Xe({amount:m,include_fees:u,remarks:h,payment_link:C,due_date:ee.format("YYYY-MM-DD"),whatsapp_list:q?n.whatsapp_list:[],email_list:R?n.email_list:[],source_payments_user_id:(se=n.current_vendor)==null?void 0:se.payments_user_id});if(De){const Re=Pe.result.payment_link.payment_link_url;a({type:"update_payment_link",payload:Re}),ve({mutate:t})}},children:({values:c})=>{const{amount:l,include_fees:m}=c,u=m?cs(parseFloat(l),i.payment_charges,o):l;return e.jsx("div",{children:e.jsxs(U,{noValidate:!0,className:d.form,children:[e.jsx(w,{prefix:e.jsx("span",{children:"₹"}),component:P,name:"amount",size:"large",type:"number",label:"Amount",placeholder:"Enter the payment amount",wrapperClassName:d.amount,validate:M([{test:k.required,message:"Invoice amount is required"},{test:h=>Number(h)>=2,message:"Amount cannot be less than ₹2"}])}),e.jsxs("div",{className:d.ccFeesRow,children:[e.jsxs("div",{className:d.includeFeesContainer,children:[e.jsx(E,{name:"include_fees",className:d.checkbox,defaultChecked:r.include_fees}),e.jsx("span",{className:d.title,children:"Include credit card fees"})]}),e.jsx("div",{className:d.moneyInfo,children:e.jsxs("span",{children:["You will recieve"," ",e.jsx("span",{className:d.value,children:Z(l?u:0)})]})})]}),e.jsx(w,{prefix:e.jsx(ms,{className:d.icon}),component:P,name:"remarks",size:"small",label:"Remarks",placeholder:"Remarks",wrapperClassName:d.labeledInput}),e.jsx("div",{className:d.dueDateInvoiceRow,children:e.jsx(w,{prefix:e.jsx(Ve,{className:d.icon}),component:as,required:!0,name:"due_date",size:"small",format:"DD MMM, YYYY",label:"Due Date",disabledDate:h=>{const C=Ee().add(-1,"day");return C&&C>h},wrapperClassName:d.dateInput})}),e.jsxs("div",{className:d.includePaymentLinks,children:[e.jsx(E,{name:"payment_link",className:d.checkbox,size:"large",defaultChecked:r.payment_link}),e.jsxs("div",{className:d.header,children:[e.jsx("span",{className:d.title,children:"Create a payment link"}),e.jsx("span",{className:d.description,children:"Get a payment link to share"})]})]}),e.jsx("div",{className:d.sendHeader,children:e.jsx("span",{className:d.requestModeHeader,children:"Send Request via"})}),e.jsx(gt,{}),e.jsx(_e,{Component:z,className:d.submitBtn,children:"Send Request"})]})})}})})},Pt="_vendorCard_1rci8_10",Rt="_vendorContent_1rci8_37",St="_name_1rci8_42",qt="_bankDetail
1s_1rci8_47",g={vendorCard:Pt,vendorContent:Rt,name:St,bankDetails:qt},It=({customer:t,onClick:s})=>{const{display_name:a,gst_number:n}=t;return e.jsxs("div",{className:g.vendorCard,onClick:()=>s(t),children:[e.jsx(J,{shape:"square",className:g.vendorImage,children:he(a)}),e.jsxs("div",{className:g.vendorContent,children:[e.jsx("div",{className:g.name,children:a}),e.jsxs("div",{className:g.bankDetails,children:[e.jsx($e,{}),e.jsx("span",{className:g.account,children:n})]})]})]})},At=()=>{const{buyers:t,isLoading:s}=us(""),a=X();return s?e.jsx(S,{}):e.jsx("div",{className:f.container,children:e.jsx(G,{enableReinitialize:!0,initialValues:{vendor_name:""},children:({values:n})=>{const{vendor_name:i}=n,o=t.filter(r=>r==null?void 0:r.display_name.toLowerCase().includes(i==null?void 0:i.toLowerCase()));return e.jsxs("div",{children:[e.jsx(U,{noValidate:!0,className:f.form,children:e.jsx(w,{prefix:e.jsx(ze,{className:f.icon}),showSearch:!0,component:P,required:!0,name:"vendor_name",size:"small",label:e.jsxs($,{justify:"space-between",children:[e.jsx("span",{children:"Customer Name"}),e.jsx("span",{onClick:()=>a({type:"add_new_vendor_form"}),className:f.newVendor,children:"+ New Customer"})]}),placeholder:"John Doe",wrapperClassName:f.labeledInput})}),e.jsxs("div",{className:f.fullFlex,children:[e.jsxs("div",{className:f.vendorCount,children:[`${o.length} ${xe("Customer",o.length)} found`," "]}),o.map(r=>e.jsx(It,{onClick:()=>{a({type:"selected_vendor_customer",payload:r})},customer:r},r.uuid))]})]})}})})},Lt="_image_arlm7_10",Ft="_text_arlm7_15",Tt="_header_arlm7_23",Bt="_paymentLinkDiv_arlm7_33",Mt="_title_arlm7_37",Et="_icon_arlm7_54",Vt="_link_arlm7_58",$t="_linkBtnContainer_arlm7_70",zt="_container_arlm7_75",v={image:Lt,text:Ft,header:Tt,paymentLinkDiv:Bt,title:Mt,icon:Et,link:Vt,linkBtnContainer:$t,container:zt},Ht=()=>{const t=Q(),s=t==null?void 0:t.payment_link_url,a=t==null?void 0:t.current_vendor;return e.jsxs("div",{className:v.container,children:[e.jsx("div",{className:v.image,children:e.jsx("img",{src:K("payment_req_success.svg"),alt:"Success"})}),e.jsx("div",{className:v.header,children:e.jsx("span",{children:"Payment Request Sent"})}),e.jsxs("p",{className:v.text,children:["The link has been sent to ",e.jsxs("b",{children:["“",a==null?void 0:a.display_name,"”."]})]}),e.jsx("p",{className:v.text,children:"You will be notified when the contact completes the payment."}),e.jsxs("div",{className:v.paymentLinkDiv,children:[e.jsx("span",{className:v.title,children:"Payment Link"}),e.jsx("div",{className:v.linkBtnContainer,children:e.jsxs("div",{className:v.link,children:[e.jsx("span",{children:s}),e.jsx(Y,{title:"Payment link copied!",trigger:"click",children:e.jsx(ue,{className:v.icon,onClick:()=>navigator.clipboard.writeText(s)})})]})})]})]})},be={modalState:"SelectVendorCustomer",current_vendor:void 0,invoice_document:void 0,email_list:[],whatsapp_list:[],payment_link_url:void 0},Yt=(t,s)=>{const{type:a,payload:n}=s;switch(a){case"select_vendor_customer":return be;case"selected_vendor_customer":return{...t,current_vendor:n,email_list:[n.email],whatsapp_list:[n.phone],modalState:"PaymentRequestForm"};case"add_new_vendor_form":return{...t,modalState:"AddNewVendorForm"};case"add_new_vendor":return{...t,modalState:"PaymentRequestForm",current_vendor:n,email_list:[n.email],whatsapp_list:[n.phone]};case"add_invoice_file":return{...t,invoice_document:n};case"remove_invoice_file":return{...t,invoice_document:void 0};case"update_email_list":return{...t,email_list:[...t.email_list,n]};case"reset_email_list":return{...t,email_list:n||[]};case"update_whatsapp_list":return{...t,whatsapp_list:[...t.whatsapp_list,n]};case"reset_whatsapp_list":return{...t,whatsapp_list:n||[]};case"update_payment_link":return{...t,payment_link_url:n,modalState:"PaymentRequestSuccess"}}},we=p.createContext(null),ge=p.createContext(null),Wt=({onClose:t})=>{var l,m,u;const[s,a]=p.useReducer(Yt,be),i={SelectVendorCustomer:At,AddNewVendorForm:Je,PaymentRequestForm:Dt,PaymentRequestSuccess:Ht}[s.modalState],o={SelectVendorCustomer:"Select Customer",AddNewVendorForm:e.jsxs("div",{className:x.requestData,children:[e.jsx("span",{className:x.header,children:"New Payment Request"}),e.jsx(ps,{children:e.jsx("span",{className:W(x.vendorName,x.center),children:"Add Customer"})})]}),PaymentRequestForm:(l=s==null?void 0:s.current_vendor)!=null&&l.display_name?e.jsxs($,{className:x.paymentRequestFormHeader,children:[e.jsx(J,{size:"large",shape:"square",className:x.avatar,children:he((m=s==null?void 0:s.current_vendor)==null?void 0:m.display_name)}),e.jsxs("div",{className:x.requestData,children:[e.jsx("span",{className:x.header,children:"Requesting"}),e.jsx("span",{className:x.vendorName,children:((u=s==null?void 0:s.current_vendor)==null?void 0:u.display_name)||""})]})]}):""},r={SelectVendor:void 0,AddNewVendorForm:()=>a({type:"select_vendor_customer"}),PaymentRequestForm:()=>a({type:"select_vendor_customer"})},c=()=>{const h=s.modalState,C=!!r[h];return e.jsx(Ce,{title:o[h],showBackButton:C,onClose:t,onBack:r[h]})};return e.jsx("div",{className:x.container,children:e.jsx(we.Provider,{value:s,children:e.jsx(ge.Provider,{value:a,children:e.jsx(Ne,{Component:i,Header:c,modalClassWrap:x.container})})})})},Q=()=>p.useContext(we),X=()=>
1p.useContext(ge),Kt="_icon_w8fc9_20",Ot="_bankDetails_w8fc9_27",Gt="_vendorInfo_w8fc9_31",Ut="_ifsc_w8fc9_34",Zt="_bankInfoSubmit_w8fc9_37",Jt="_infoText_w8fc9_41",j={icon:Kt,bankDetails:Ot,vendorInfo:Gt,ifsc:Ut,bankInfoSubmit:Zt,infoText:Jt};function Qt({onBankSubmit:t}){const[s,a]=p.useState({BANK:"",BRANCH:""}),n=p.useRef(null),i=async r=>{const c=r.target.value;if(!k.ifsc(c))return;const l=await is(c);l&&a(l)},o=async(r,c)=>{c.setSubmitting(!0);const l=r.account_number?await rs({account_no:r.account_number,ifsc:r.ifsc_code}):{};if(l!=null&&l.pennydrop_error){c.setSubmitting(!1);return}const m=l.account_name;t({account_number:r.bank_account_number,ifsc:r.ifsc,branch:s.BRANCH,bank_name:s.BANK,holder_name:m,name:m})};return e.jsxs("div",{className:j.vendorInfo,children:[e.jsx("div",{className:j.infoText,children:"Please add a bank account where all your payments will be credited."}),e.jsx(G,{enableReinitialize:!1,onSubmit:o,innerRef:n,initialValues:{bank_account_number:"",bank_account_number_confirm:"",ifsc:""},children:({isSubmitting:r})=>e.jsxs(U,{noValidate:!0,className:j.form,children:[e.jsx(w,{prefix:e.jsx(ie,{className:j.icon}),component:P,required:!0,name:"bank_account_number",size:"small",onPaste:I,onCopy:I,onKeyDown:c=>ne(c,[]),label:"Account Number",placeholder:"Beneficiary Account Number",wrapperClassName:j.labeledInput,validate:M([{test:k.required,message:"Account Number is required"}])}),e.jsx(w,{prefix:e.jsx(ie,{className:j.icon}),component:P,required:!0,name:"bank_account_number_confirm",size:"small",onPaste:I,onCopy:I,onKeyDown:c=>ne(c,[]),label:"Account Number",placeholder:"Beneficiary Account Number",wrapperClassName:j.labeledInput,validate:M([{test:k.required,message:"Account Number is required"},{test:c=>n.current.values.bank_account_number===c,message:"Account Numbers should match"}])}),e.jsx(w,{prefix:e.jsx(He,{className:j.icon}),component:P,size:"small",name:"ifsc",onChange:i,label:"IFSC Code",placeholder:"BANK0000251",wrapperClassName:j.ifsc,validate:M([{test:k.required,message:"IFSC is required"},{test:k.ifsc,message:"Enter valid IFSC"}])}),s&&e.jsxs("div",{className:j.bankDetails,children:[s.BANK," ",s.BRANCH&&e.jsx(e.Fragment,{children:","})," ",s.BRANCH]}),e.jsx(_e,{Component:z,loading:r,size:"medium",className:j.bankInfoSubmit,styles:{},children:e.jsx("span",{className:"text-base",children:"NEXT"})})]})})]})}const Xt="_btnContainer_1is29_10",ea="_cardContainer_1is29_21",de={btnContainer:Xt,cardContainer:ea};function sa({bankDetails:t,onBack:s,onClose:a}){const{mutate:n}=O(),[i,o]=p.useState(!1),r=async()=>{o(!0);const{ok:c}=await os({vendorBankAccountData:t});o(!1),c&&(await We(Ke.payments.getVendorBankAccounts,n),a())};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:de.cardContainer,children:e.jsx(fe,{accountDetails:t})}),e.jsxs("div",{className:de.btnContainer,children:[e.jsx(Ye,{onClick:s,disabled:i,children:"GO BACK"}),e.jsx(z,{onClick:r,loading:i,children:"CONFIRM"})]})]})}const ta=[Qt,sa],aa=["Add your bank account","Confirm Details"];function na({onClose:t}){const[s,a]=p.useState(1),[n,i]=p.useState(null),o=ta[s-1],r=aa[s-1],c=u=>{i(u),a(2)},l=()=>{a(1)},m=()=>e.jsx(Ce,{title:r,onBack:l,showBackButton:s===2,topFixedHeader:!0,onClose:t});return e.jsx(e.Fragment,{children:e.jsx(Ne,{Header:m,Component:o,open:!0,onClose:t,onBankSubmit:c,bankDetails:n,onBack:l})})}const ia="_recordsCount_1asrk_58",ra="_totalNewRequestDiv_1asrk_63",oa="_totalRecordsLoading_1asrk_69",b={recordsCount:ia,totalNewRequestDiv:ra,totalRecordsLoading:oa},ca=()=>{var i;const{vendorBusiness:t}=ke(),s=(i=t==null?void 0:t[0])==null?void 0:i.bank_account,[a,n]=p.useState(!1);return s?e.jsx(fe,{accountDetails:s,showHeading:!0}):e.jsxs(e.Fragment,{children:[a&&e.jsx(na,{onClose:()=>n(!1)}),e.jsxs("div",{className:b.addBankContainer,children:[e.jsx("img",{src:K("add_bank_graphic.png"),alt:"Add Bank Graphic"}),e.jsx("p",{className:b.title,children:"Add your bank account to start receiving payments"}),e.jsx("p",{className:b.description,children:"Link bank account to get all your payments into your account directly"}),e.jsx(Oe,{onClick:()=>n(!0),children:e.jsxs(e.Fragment,{children:[e.jsx(pe,{}),"ADD"]})})]})]})},la=({uuid:t})=>{const{mutate:s}=O(),a=async()=>{const{ok:n}=await es({uuid:t});n&&ve({mutate:s})};return e.jsx(xs,{title:"Are you sure want to mark this payment request as paid",okText:"Yes",cancelText:"No",onConfirm:a,onCancel:n=>n.stopPropagation(),children:e.jsx("div",{children:e.jsx(_s,{cta:"MARK PAID",color:"green",IconComponent:T})})})},da=({payment_request:t})=>{const{uuid:s}=t;return e.jsx(oe,{children:e.jsx(oe.Item,{children:e.jsx(la,{uuid:s})},"1")})};function ma(t){var R;const{item:s,selectedRowKeys:a,onCheckPaymentRequest:n,onCardClick:i}=t;if(!(s!=null&&s.payment_link))return;const{vendor_customer:{name:o},amount:r,payment_link:{status:c},due_date:l,uuid:m}=s;a==null||a.find(q=>q.uuid===m);const u=()=>{i(s)},h={pending:"Payment link sent",seen:"Payment Link Viewed",attempted:"Payment attempted",initiated:"Payment initiated",settled:"Payment settled",success:"Payment success"},C=["pending","seen"].includes((R=s==null?void 0:s.payment_link)==null?void 0:R.status);return e.jsx("div",{className:V.cardContainer,children:e.jsxs($,{gutter:0,align:"middle",children:[e.jsx(B,{span:6,onClick:u,children:e.jsx(re,{title:o,description:"due on "+js(l)})}),e.jsx(B,{span:13,onClick:u,children:e.jsx(re,{title:Z(r),description:h[c]})}),e.jsx(B,{span:4,className:V.actionsCol,children:C&&e.jsx(hs,{menu:e.jsx(da,{payment_request:s})})})]})})}const ua=["pending","seen"];function pa(t){const{singleRequestData:s}=t,a={...s},{status:n,payment_link:i,vendor_customer:o,uuid:r}=a,c=n==="paid",l=ua.includes(i.status),m=u=>{ss({uuid:r,channel:u})};return e.jsxs(e.Fragment,{children:[e.jsx(Ps,{vendorCustomer:o}),e.jsx(Ds,{requestDetails:a}),e.jsx(As,{requestDetails:a}),l&&e.jsx(Ms,{sendReminder:m}),c&&e.jsx(Cs,{payments:[i]}),e.jsx(gs,{vendorCustomer:o||{}})]})}const _a=({uuid:t,onDrawerClose:s})=>{const{paymentRequestItem:a,isLoading:n}=ts(t);return e.jsx(Ns,{onClose:s,title:"Request Details",Component:pa,singleRequestData:a,dataLoaded:!n})},ha=({page:t})=>{const{payment_requests:s,isLoading:a}=ye({pageNumber:t}),[n,i]=p.useState(!1),[o,r]=p.useState(null),c=s,l=u=>{r(u),i(!0)},m=()=>{r(null),i(!1)};return a?e.jsx(S,{}):e.jsxs(e.Fragment,{children:[o&&n&&e.jsx(_a,{uuid:o==null?void 0:o.uuid,onDrawerClose:m}),e.jsx(ks,{split:!0,rowKey:u=>u.uuid,dataSource:c,renderItem:u=>e.jsx(ma,{item:u,onCardClick:()=>l(u)})})]})};function xa(){const[t,s]=Ge(),a=Ue(t),{isLoading:n,meta:i}=ye(a),o=a.pageNumber?Number(a.pageNumber):1,r=Math.min(i.total,o*i.per_page),[c,l]=p.useState([]),[m,u]=p.useState(!1),h=()=>{!n&&Ze(i)&&s({...a,pageNumber:(i.current_page+1).toString()})};return n&&o===1?e.jsx(S,{showText:!1}):e.jsx(bs,{RightColComponent:e.jsx(ca,{}),children:e.jsxs(e.Fragment,{children:[m&&e.jsx(Wt,{onClose:()=>u(!1)}),e.jsx(Us,{}),e.jsxs("div",{className:b.totalNewRequestDiv,children:[n?e.jsx("div",{className:b.totalRecordsLoading,children:e.jsx(S,{size:"small",showText:!1})}):e.jsxs("div",{className:b.recordsCount,children:[r," ",xe("Request",r)]}),e.jsx(z,{className:b.newPaymentRequest,size:"medium",onClick:()=>u(!0),children:"New Payment Request"})]}),e.jsx(Vs,{}),e.jsx(fs,{loadMore:h,current_page:o,PageComponent:ha})]})})}const dn=()=>e.jsx("div",{className:ws.mainContainer,children:e.jsx(xa,{})});
1export{dn as Component};

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.