1import{d4 as Be,ax as De,aJ as Ie,r as b,dI as Pe,e7 as Te,c_ as Fe,en as Ue,eo as Le,ep as Re,e2 as $,di as Ee,j as e,L as _,K,cS as Oe,cT as qe,cU as V,k as H,cV as z,b7 as S,ea as $e,as as p,b3 as He,bN as Me,bO as We,bP as Qe,cI as Ge,b9 as Y,ao as T,N as re,e3 as _e,al as Ke,b5 as ne,bf as le,X as Ve,dG as ze,t as Ye,bC as Je,eq as Xe,er as Ze,es as et,et as tt,eu as at,ev as st,ew as rt,ex as nt,aI as h}from"./index-CpeGhXo5.js";import{a as lt}from"./Panel-Cf_wAUzv.js";import{e as oe,j as ot}from"./financeMappers-CUv1G2pV.js";import{u as it,a as dt}from"./companySettingsMockApi-D8Uh5efq.js";import{u as ct}from"./filters-DQMtevU2.js";import{g as ie,b as de,d as xt}from"./expenseDraft-DqR0Jp71.js";import{F as ut}from"./file-check-DgOG7DHv.js";import{Q as ce}from"./qr-code-aLso372O.js";const mt=["HDFC Bank","ICICI Bank","Kotak Mahindra Bank","State Bank of India (SBI)","Axis Bank","Bank of Baroda","Punjab National Bank (PNB)","HSBC Bank","Citi Bank","Standard Chartered Bank","Yes Bank","IndusInd Bank","IDFC FIRST Bank","Federal Bank"],bt=["Current","Savings","Overdraft (OD)","Cash Credit (CC)","Escrow Account","Foreign Currency (EEFC)","NRO / NRE"],pt=[{value:"Visa",label:"Visa Commercial"},{value:"Mastercard",label:"Mastercard Business"},{value:"RuPay",label:"RuPay Corporate"},{value:"Amex",label:"American Express Corporate"}],ht=[{value:"Corporate Credit Card",label:"Corporate Credit Card"},{value:"Business Debit Card",label:"Business Debit Card"},{value:"Virtual Card",label:"Virtual SaaS Card"},{value:"Forex Card",label:"Forex Travel Card"}],o="w-full h-9 px-3 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 text-xs text-slate-800 dark:text-slate-100 placeholder:text-slate-400 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 transition-colors shadow-2xs";function i({label:v,required:F,error:U,hint:d,children:f}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between min-h-[18px]",children:[e.jsxs("label",{className:"text-[11px] font-semibold text-slate-700 dark:text-slate-300 tracking-tight whitespace-nowrap",children:[v," ",F&&e.jsx("span",{className:"text-red-500",children:"*"})]}),d&&e.jsx("span",{className:"text-[10px] text-slate-400 dark:text-slate-500 font-normal truncate ml-1",children:d})]}),f,U&&e.jsx("p",{className:"text-[10px] text-red-500 font-medium",children:U})]})}function wt(){const v=Be(),F=De(),[U]=Ie(),d=U.get("editId"),[f,L]=b.useState(!1),[M,C]=b.useState("particulars"),[xe,W]=b.useState(!1),J=b.useRef(null),{isFinanceHead:w}=Pe(),{data:R,refetch:ue}=Te({limit:500}),{data:X=[]}=it(),{data:Z=[]}=dt(),{data:ee=[]}=Fe(),[me]=Ue(),[be]=Le(),[pe]=Re(),he=b.useMemo(()=>{const t=["Tekki Web Solutions Pvt. Ltd."],a=new Set(["Tekki Web Solutions Pvt. Ltd."]);(X||[]).forEach(r=>{r?.name&&!a.has(r.name.trim())&&(t.push(r.name.trim()),a.add(r.name.trim()))}),(Z||[]).forEach(r=>{r?.name&&!a.has(r.name.trim())&&(t.push(r.name.trim()),a.add(r.name.trim()))}),(ee||[]).forEach(r=>{r?.name&&!a.has(r.name.trim())&&(t.push(r.name.trim()),a.add(r.name.trim()))});try{["hrms_company_settings_subs","mock_sub_companies_data","hrms_company_entities"].forEach(r=>{const m=localStorage.getItem(r);if(m){const c=JSON.parse(m);Array.isArray(c)&&c.forEach(u=>{const l=u.name||u.companyName;l&&!a.has(l.trim())&&(t.push(l.trim()),a.add(l.trim()))})}})}catch{}return t},[X,Z,ee]),Q=ct(),te=Q.company&&Q.company!=="All Companies"?Q.company:"Tekki Web Solutions Pvt. Ltd.",[s,x]=b.useState({company:te,account:"",bank:"",accountNo:"",type:"Current",branch:"",bankAddress:"",ifscCode:"",swiftCode:"",upiId:"",qrCodeUrl:"",balance:"",beginningBalance:"0",totalDeposits:"0",totalWithdrawals:"0",lastUpdated:$(!0),custodian:"",status:"Active"}),[A,G]=b.useState({});b.useEffect(()=>{if(!d)return;const a=(R?.items??[]).map(oe).find(r=>String(r.id)===String(d));a&&x({company:a.company||"Tekki Web Solutions Pvt. Ltd.",account:a.account||"",bank:a.bank||"",accountNo:a.accountNo||"",type:a.type||"Current",branch:a.branch||"",bankAddress:a.bankAddress||"",ifscCode:a.ifscCode||"",swiftCode:a.swiftCode||"",upiId:a.upiId||"",qrCodeUrl:a.qrCodeUrl||"",balance:(a.balance??"").toString(),beginningBalance:(a.beginningBalance??"0").toString(),totalDeposits:(a.totalDeposits??"0").toString(),totalWithdrawals:(a.totalWithdrawals??"0").toString(),lastUpdated:a.lastUpdated||$(!0),custodian:a.custodian||"",status:a.status||"Active"})},[d,R]);const E=b.useMemo(()=>{const t=parseFloat(s.beginningBalance)||0,a=parseFloat(s.totalDeposits)||0,r=parseFloat(s.totalWithdrawals)||0,m=parseFloat(s.balance);return!isNaN(m)&&s.balance.trim()!==""?m:t+a-r},[s.beginningBalance,s.totalDeposits,s.totalWithdrawals,s.balance]),{data:O}=Ee({limit:500,status:"Active"}),ge=b.useMemo(()=>{const r=(O?.items||(Array.isArray(O)?O:[])).filter(c=>{const u=(c.departmentName||c.department?.name||c.dept||"").toLowerCase(),l=(c.designation||
1c.jobTitle||c.role||"").toLowerCase(),g=`${c.firstName||""} ${c.lastName||""}`.toLowerCase(),q=u.includes("finance")||u.includes("account")||u.includes("growth"),we=l.includes("finance")||l.includes("cfo")||l.includes("account")||l.includes("treasury")||l.includes("controller")||l.includes("cashier")||l.includes("audit"),Ae=l.includes("chief executive")||l.includes("chief operating")||l.includes("ceo")||l.includes("coo")||u.includes("board"),Se=g.includes("pawandeep")||g.includes("hemant")||g.includes("tisha")||g.includes("sarbjit")||g.includes("gurcharan");return q||we||Ae||Se}).map(c=>{const u=`${c.firstName||""} ${c.lastName||""}`.trim()||c.name||"Finance Staff",l=c.designation||c.jobTitle?` (${c.designation||c.jobTitle})`:"";return`${u}${l}`}),m=["Pawandeep Kaur (Chief Financial Officer)","Hemant (Finance Executive)","Tisha Verma (Finance Assistant & Data Entry)","Sarbjit Grewal (Chief Executive Officer)","Gurcharan Singh Kang (Chief Operating Officer)"];return Array.from(new Set([...m,...r]))},[O]),B=b.useMemo(()=>{if(s.accountNo||s.bank)return{id:d||void 0,accountNo:s.accountNo,bank:s.bank};if(d){const a=(R?.items??[]).map(oe).find(r=>String(r.id)===String(d))||seedBankAccounts.find(r=>String(r.id)===String(d));return a?{id:d,accountNo:a.accountNo,bank:a.bank}:{id:d}}return null},[d,s.accountNo,s.bank,R]),[k,D]=b.useState(()=>B?ie(B):[]);b.useEffect(()=>{D(B?ie(B):[])},[B]);const[ae,y]=b.useState(!1),[j,I]=b.useState(null),[n,N]=b.useState({cardNickname:"",cardHolderName:s.account||s.company||"Pawandeep Kaur Grewal",last4:"",cardNetwork:"Visa",cardType:"Corporate Credit Card",expiryDate:"12/28",monthlyLimit:"500000",custodianName:"Pawandeep Kaur (Chief Financial Officer)"}),fe=t=>{I(t.id),N({cardNickname:t.cardNickname,cardHolderName:t.cardHolderName,last4:t.last4,cardNetwork:t.cardNetwork,cardType:t.cardType,expiryDate:t.expiryDate,monthlyLimit:t.monthlyLimit.toString(),custodianName:t.custodianName}),y(!0)},Ne=t=>{t.preventDefault();const a=n.last4.replace(/\D/g,"");if(a.length!==4){h.error("Please enter a valid 4-digit card ending (e.g. 4521)");return}const r=s.accountNo?s.accountNo.replace(/\D/g,""):"",m=r.length>=4?r.slice(-4):"â¢â¢â¢â¢",c=`${s.bank||"Bank"} â¢â¢ ${m} (${s.type||"Current"})`;if(j){const u=k.find(g=>g.id===j),l={id:j,bankAccountId:d||(s.accountNo?`bank-${s.accountNo}`:u?.bankAccountId)||`bank-${Date.now()}`,bankAccountName:c,cardNickname:n.cardNickname.trim()||`${s.bank||"Corporate"} ${n.cardNetwork} Card`,cardHolderName:n.cardHolderName.trim()||s.account||"Company Custodian",last4:a,cardNetwork:n.cardNetwork,cardType:n.cardType,expiryDate:n.expiryDate.trim()||"12/28",monthlyLimit:parseFloat(n.monthlyLimit)||5e5,currentSpend:u?.currentSpend||0,status:u?.status||"Active",custodianName:n.custodianName};de(l),D(g=>g.map(q=>q.id===j?l:q)),y(!1),I(null),h.success(`Connected Card (â¢â¢${a}) updated successfully`)}else{const u={id:`card-${Date.now()}`,bankAccountId:d||(s.accountNo?`bank-${s.accountNo}`:`bank-${Date.now()}`),bankAccountName:c,cardNickname:n.cardNickname.trim()||`${s.bank||"Corporate"} ${n.cardNetwork} Card`,cardHolderName:n.cardHolderName.trim()||s.account||"Company Custodian",last4:a,cardNetwork:n.cardNetwork,cardType:n.cardType,expiryDate:n.expiryDate.trim()||"12/28",monthlyLimit:parseFloat(n.monthlyLimit)||5e5,currentSpend:0,status:"Active",custodianName:n.custodianName};de(u),D(l=>[...l,u]),y(!1),h.success(`Connected Card (â¢â¢${u.last4}) linked successfully`)}N({cardNickname:"",cardHolderName:s.account||s.company||"Pawandeep Kaur Grewal",last4:"",cardNetwork:"Visa",cardType:"Corporate Credit Card",expiryDate:"12/28",monthlyLimit:"500000",custodianName:"Pawandeep Kaur (Chief Financial Officer)"})},ke=t=>{xt(t),D(a=>a.filter(r=>r.id!==t)),j===t&&(I(null),y(!1)),h.success("Card unlinked from bank account")},je=t=>{const a=t.target.files?.[0];if(!a)return;if(!a.type.startsWith("image/")){h.error("Please select a valid image file (PNG, JPG, or WebP)");return}const r=new FileReader;r.onload=()=>{x(m=>({...m,qrCodeUrl:r.result})),h.success("UPI QR Code uploaded successfully")}
1,r.readAsDataURL(a)},ve=()=>{if(!s.upiId.trim()){h.error("Please enter a valid UPI ID (VPA) first");return}const t=s.upiId.trim(),a=encodeURIComponent(s.account.trim()||s.company.trim()||"Tekki Web Solutions"),r=`https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=upi://pay?pa=${t}&pn=${a}&cu=INR`;x(m=>({...m,qrCodeUrl:r})),h.success("UPI QR Code generated dynamically from UPI ID")},se=()=>{const t={};return s.company.trim()||(t.company="Company name is required"),s.bank.trim()||(t.bank="Bank name is required"),s.account.trim()||(t.account="Account holder name is required"),s.accountNo.trim()?/^\d+$/.test(s.accountNo.trim())||(t.accountNo="Account number must contain numbers only"):t.accountNo="Account number is required (numbers only)",G(t),Object.keys(t).length===0},P=async(t=!1)=>{if(!se()){C("particulars"),h.error("Please fill in all required bank particulars");return}L(!0);const a=parseFloat(s.beginningBalance)||0,r=parseFloat(s.totalDeposits)||0,m=parseFloat(s.totalWithdrawals)||0,c=E,u=ot({company:s.company.trim(),account:s.account.trim(),bank:s.bank.trim(),accountNo:s.accountNo.trim(),type:s.type,branch:s.branch.trim(),bankAddress:s.bankAddress.trim(),ifscCode:s.ifscCode.trim().toUpperCase(),swiftCode:s.swiftCode.trim().toUpperCase(),upiId:s.upiId.trim(),qrCodeUrl:s.qrCodeUrl.trim(),balance:c,beginningBalance:a,totalDeposits:r,totalWithdrawals:m,lastUpdated:s.lastUpdated||$(!0)});try{d&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(String(d))?(await be({id:d,body:u}).unwrap(),h.success("Bank account updated successfully")):(await me(u).unwrap(),h.success("Bank account created successfully"));try{const g=`bank_account_custom_${s.accountNo.trim()}`;localStorage.setItem(g,JSON.stringify({branch:s.branch.trim(),bankAddress:s.bankAddress.trim(),ifscCode:s.ifscCode.trim().toUpperCase(),swiftCode:s.swiftCode.trim().toUpperCase(),upiId:s.upiId.trim(),qrCodeUrl:s.qrCodeUrl.trim()}))}catch{}await ue(),t?(x({company:te,account:"",bank:"",accountNo:"",type:"Current",branch:"",bankAddress:"",ifscCode:"",swiftCode:"",upiId:"",qrCodeUrl:"",balance:"",beginningBalance:"0",totalDeposits:"0",totalWithdrawals:"0",lastUpdated:$(!0),custodian:"",status:"Active"}),C("particulars")):F(`${v}/bank-accounts`)}catch(l){h.error(l?.data?.message||"Failed to save bank account. Please try again.")}finally{L(!1)}},Ce=async()=>{if(d){L(!0);try{await pe(d).unwrap(),h.success("Bank account removed from organization ledger"),F(`${v}/bank-accounts`)}catch(t){h.error(t?.data?.message||"Failed to delete bank account")}finally{L(!1),W(!1)}}},ye=b.useMemo(()=>{const t=s.accountNo.replace(/\s+/g,"");return t?t.length<=4?`â¢â¢â¢â¢ â¢â¢â¢â¢ â¢â¢â¢â¢ ${t}`:`â¢â¢â¢â¢ â¢â¢â¢â¢ â¢â¢â¢â¢ ${t.slice(-4)}`:"â¢â¢â¢â¢ â¢â¢â¢â¢ â¢â¢â¢â¢ â¢â¢â¢â¢"},[s.accountNo]);return e.jsxs("div",{className:"w-full flex-1 flex flex-col bg-slate-50/50 dark:bg-slate-950/50",children:[e.jsx("div",{className:"px-6 py-3.5 border-b border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900",children:e.jsx(lt,{title:d?"Edit Bank Account":"New Bank Account",subtitle:"Configure organization bank details, opening balance, and digital payment identifiers",accent:"mod-finance",actions:e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(_,{to:`${v}/bank-accounts`,className:"h-8 px-3 rounded-md border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 hover:bg-slate-50 dark:hover:bg-slate-800 text-xs font-semibold text-slate-700 dark:text-slate-200 inline-flex items-center gap-1.5 transition-colors shadow-2xs",children:[e.jsx(K,{className:"w-3.5 h-3.5"})," Back to Bank Accounts"]})})})}),e.jsx("div",{className:"flex-1 flex flex-col",children:e.jsxs(Oe,{value:M,onValueChange:C,className:"w-full flex-1 flex flex-col",children:[e.jsxs("div",{className:"px-6 border-b border-slate-200 dark:border-slate-800 bg-slate-50/80 dark:bg-slate-900/80 flex items-center justify-between",children:[e.jsxs(qe,{className:"h-auto p-0 bg-transparent gap-8",children:[e.jsxs(V,{value:"particulars",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-blue-600 dar
1k:data-[state=active]:border-blue-400 data-[state=active]:bg-transparent data-[state=active]:text-blue-600 dark:data-[state=active]:text-blue-400 text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-200 text-xs font-bold px-0 py-3 shadow-none transition-all cursor-pointer flex items-center gap-2",children:[e.jsx("span",{children:"1. Account Particulars & Digital Remittance"}),Object.keys(A).length>0&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"})]}),e.jsxs(V,{value:"balances",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-blue-600 dark:data-[state=active]:border-blue-400 data-[state=active]:bg-transparent data-[state=active]:text-blue-600 dark:data-[state=active]:text-blue-400 text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-200 text-xs font-bold px-0 py-3 shadow-none transition-all cursor-pointer flex items-center gap-2",children:[e.jsx(ut,{className:"w-3.5 h-3.5 text-blue-600"}),e.jsx("span",{children:"2. Ledger Balances & Audit Controls"})]}),e.jsxs(V,{value:"cards",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-blue-600 dark:data-[state=active]:border-blue-400 data-[state=active]:bg-transparent data-[state=active]:text-blue-600 dark:data-[state=active]:text-blue-400 text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-200 text-xs font-bold px-0 py-3 shadow-none transition-all cursor-pointer flex items-center gap-2",children:[e.jsx(H,{className:"w-3.5 h-3.5 text-blue-600"}),e.jsx("span",{children:"3. Connected Cards (Debit & Credit)"}),k.length>0&&e.jsx("span",{className:"px-1.5 py-0.2 rounded-full text-[10px] font-bold bg-blue-100 text-blue-800 dark:bg-blue-900/60 dark:text-blue-200",children:k.length})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"text-[11px] font-medium text-slate-400",children:M==="particulars"?"Tab 1: Particulars & Wire":M==="balances"?"Tab 2: Balances & Audit":"Tab 3: Connected Cards & Plastics"})})]}),e.jsxs("div",{className:"w-full flex-1 grid grid-cols-1 lg:grid-cols-12 gap-0 bg-white dark:bg-slate-900",children:[e.jsxs("div",{className:"lg:col-span-8 p-6 border-b lg:border-b-0 lg:border-r border-slate-200 dark:border-slate-800 flex flex-col justify-between space-y-6",children:[e.jsxs(z,{value:"particulars",className:"space-y-6 mt-0",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between pb-1.5 border-b border-slate-100 dark:border-slate-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-600 dark:bg-blue-400 shrink-0"}),e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-slate-800 dark:text-slate-200",children:"Organization & Bank Classification"})]}),e.jsx("span",{className:"text-[10px] text-slate-400 font-medium",children:"Corporate identity linkage"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(i,{label:"Company Name",required:!0,error:A.company,hint:"Associated Legal Entity",children:e.jsx(S,{value:s.company,onChange:t=>x(a=>({...a,company:t})),options:he.map(t=>({value:t,label:t})),placeholder:"Select Company Entity...",searchPlaceholder:"Search legal entities...",triggerClassName:o,enableEditDeleteAdd:!1})}),e.jsx(i,{label:"Bank Name",required:!0,error:A.bank,hint:"Financial Institution",children:e.jsx($e,{value:s.bank,onChange:t=>x(a=>({...a,bank:t})),options:mt,placeholder:"Search or Select Bank",storageKey:"bank_custom_institutions",className:o})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsx(i,{label:"Account Holder Name",required:!0,error:A.account,hint:"Exact name on bank record",children:e.jsx("input",{type:"text",value:s.account,onChange:t=>x(a=>({...a,account:t.target.value})),className:o,placeholder:"e.g. Tekki Web Solutions Pvt. Ltd."})}),e.jsx(i,{label:"Account Number",required:!0,error:A.accountNo,hint:"Primary bank account number (numbers only)",children:e.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:s.accountNo,onChange:t=>{const a=t.target.value.replace(/\D/g,"");x(r=>({...r,accountNo:a})),G(a?r=>{const m={...r};return delete m.accountNo,m}:r=>({...r,accountNo:"Account number is required (numbers only)"}))},className:p(o,"font-mono font-semibold",A.accountNo&&"border-rose-500 focus:ring-rose-500"),placeholder:"e.g. 180000200007586"})}),e.jsx(i,{label:"Account Type",hint:w?"Corporate account category":"Restricted: Finance Head only",children:e.jsx(He,{children:e.jsxs(Me,{children:[e.jsx(We,{asChild:!0,children:e.jsx("div",{className:"w-full",children:e.jsx(S,{value:s.type,onCh
1ange:t=>x(a=>({...a,type:t})),options:bt.map(t=>({value:t,label:t})),placeholder:"Select Account Type...",searchPlaceholder:"Search account types...",disabled:!w,triggerClassName:p(o,!w&&"opacity-75 cursor-not-allowed bg-slate-50"),enableEditDeleteAdd:!1})})}),!w&&e.jsx(Qe,{className:"text-xs",children:"Only the Department Head (CFO Pawandeep Kaur) or Super Admin can alter corporate account types."})]})})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between pb-1.5 border-b border-slate-100 dark:border-slate-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-600 dark:bg-emerald-400 shrink-0"}),e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-slate-800 dark:text-slate-200",children:"Invoicing, Wire Transfer & QR Details"})]}),e.jsx("span",{className:"text-[10px] text-emerald-600 font-semibold",children:"Auto-fetches on client invoices"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(i,{label:"Branch Name",hint:"Home Branch Location",children:e.jsx("input",{type:"text",value:s.branch,onChange:t=>x(a=>({...a,branch:t.target.value})),className:o,placeholder:"e.g. Civil Lines, Ludhiana"})}),e.jsx(i,{label:"IFSC Code (Domestic)",hint:"For NEFT / RTGS / IMPS",children:e.jsx("input",{type:"text",value:s.ifscCode,onChange:t=>x(a=>({...a,ifscCode:t.target.value.toUpperCase()})),className:p(o,"font-mono uppercase font-bold"),placeholder:"e.g. HDFC0000034"})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(i,{label:"SWIFT / BIC Code (Foreign Inward)",hint:"Required for foreign remittances",children:e.jsx("input",{type:"text",value:s.swiftCode,onChange:t=>x(a=>({...a,swiftCode:t.target.value.toUpperCase()})),className:p(o,"font-mono uppercase font-bold"),placeholder:"e.g. HDFCINBB"})}),e.jsx(i,{label:"UPI ID (VPA)",hint:"Scan-and-pay identifier",children:e.jsx("input",{type:"text",value:s.upiId,onChange:t=>x(a=>({...a,upiId:t.target.value})),className:p(o,"font-mono text-blue-600 font-semibold"),placeholder:"e.g. tekkiweb@hdfcbank"})})]}),e.jsx(i,{label:"Full Branch Address (Prints on Invoices)",hint:"Official postal address of the branch",children:e.jsx("input",{type:"text",value:s.bankAddress,onChange:t=>x(a=>({...a,bankAddress:t.target.value})),className:o,placeholder:"e.g. Ground Floor, B-24-2594, Taraf saidan, Sunder Nagar, Ludhiana, Punjab-141007, INDIA."})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between pb-1.5 border-b border-slate-100 dark:border-slate-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-violet-600 dark:bg-violet-400 shrink-0"}),e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-slate-800 dark:text-slate-200",children:"UPI QR Code (Scan to Pay for Invoices)"})]}),e.jsx("span",{className:"text-[10px] text-slate-400 font-medium",children:"Rendered directly on domestic tax invoices"})]}),e.jsxs("div",{className:"p-4 rounded-xl border border-dashed border-slate-300 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/30 flex flex-col sm:flex-row items-center gap-6",children:[e.jsx("div",{className:"w-28 h-28 rounded-lg border border-slate-200 dark:border-slate-700 bg-white p-2 shrink-0 flex items-center justify-center shadow-xs",children:s.qrCodeUrl?e.jsx("img",{src:s.qrCodeUrl,alt:"UPI QR Code",className:"w-full h-full object-contain"}):e.jsxs("div",{className:"text-center p-2",children:[e.jsx(ce,{className:"w-8 h-8 text-slate-300 mx-auto mb-1"}),e.jsx("span",{className:"text-[9px] text-slate-400 font-medium block",children:"No QR Attached"})]})}),e.jsxs("div",{className:"space-y-2 flex-1 text-center sm:text-left",children:[e.jsx("h4",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:"Configure UPI QR Code for Instant Client Remittances"}),e.jsx("p",{className:"text-[11px] text-slate-500 max-w-md",children:"Upload your bank branch QR sticker image (PNG, JPG, WebP) or automatically generate an encrypted QR code using your UPI VPA address."}),e.jsxs("div",{className:"flex items-center justify-center sm:justify-start gap-2.5 pt-1",children:[e.jsx("input",{ref:J,type:"file",accept:"image/*",onChange:je,className:"hidden"}),e.jsxs("button",{type:"button",onClick:()=>J.current?.click(),className:"h-8 px-3 rounded-md bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 hover:bg-slate-50 dark:hover:bg-slate-700 text-xs font-semibold text-slate-700 dark:text-slate-200 inline-flex items-center gap-1.5 transition-colors shadow-2xs cursor-pointer",children:[e.jsx(Ge,{className:"w-3.5 h-3.5 text-blue-600"})," Upload QR Image"]}),e.jsxs("button",{type:"button",onClick:ve,className:"h-8 px-3 rounded-md bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-900 text-blue-700 dark:text-blue-300 hover:bg-blue-100 text-xs font-semibold inline-flex items-center gap-1.5 transition-colors cursor-pointer",children:[e.jsx(ce,{className:"w-3.5 h-3.5"})," Auto-Generate from UPI"]}),s.qrCodeUrl&&e.jsx("button",{type:"button",onClick:()=>x(t=>({...t,qrCodeUrl:""})),className:"h-8 px-2.5 rounded-md text-slate-400 hover:text-rose-600 hover:bg-rose-50 dark:hover:bg-rose-950/40 text-xs transition-colors cursor-pointer",title:"Remove QR Code",children:e.jsx(Y,{className:"w-3.5 h-3.5"})})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-slate-100 dar
1k:border-slate-800",children:[e.jsx(_,{to:`${v}/bank-accounts`,className:"h-9 px-4 rounded-lg border border-slate-200 dark:border-slate-800 hover:bg-slate-100 dark:hover:bg-slate-800 text-xs font-semibold text-slate-600 dark:text-slate-400 inline-flex items-center gap-1.5 transition-colors",children:"Cancel"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{type:"button",onClick:()=>P(!0),disabled:f,className:"h-9 px-4 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 hover:bg-slate-50 dark:hover:bg-slate-800 text-xs font-bold text-slate-700 dark:text-slate-200 inline-flex items-center gap-1.5 shadow-2xs transition-colors cursor-pointer",children:[e.jsx(T,{className:"w-3.5 h-3.5 text-blue-600"})," Save & Add Another"]}),e.jsxs("button",{type:"button",onClick:()=>{se()&&C("balances")},className:"h-9 px-5 rounded-lg bg-blue-600 hover:bg-blue-700 text-white font-bold text-xs shadow-md transition-all inline-flex items-center gap-1.5 cursor-pointer",children:["Next: Balances & Audit ",e.jsx(re,{className:"w-3.5 h-3.5"})]})]})]})]}),e.jsxs(z,{value:"balances",className:"space-y-6 mt-0",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between pb-1.5 border-b border-slate-100 dark:border-slate-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-600 dark:bg-blue-400 shrink-0"}),e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-slate-800 dark:text-slate-200",children:"Ledger & Balance Metrics (INR)"})]}),e.jsx("span",{className:"text-[10px] text-slate-400 font-medium",children:"Reconciled balance metrics"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(i,{label:"Beginning Balance (Opening)",hint:"Initial ledger balance (â¹)",children:e.jsx("input",{type:"number",value:s.beginningBalance,onChange:t=>x(a=>({...a,beginningBalance:t.target.value})),className:p(o,"font-mono font-semibold"),placeholder:"0.00"})}),e.jsx(i,{label:"Current Balance",hint:"Auto-calculated if left blank",children:e.jsx("input",{type:"number",value:s.balance!==""?s.balance:E,onChange:t=>x(a=>({...a,balance:t.target.value})),className:p(o,"font-mono font-bold text-blue-600 dark:text-blue-400"),placeholder:E.toString()})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(i,{label:"Total Deposits (Credits)",hint:"Cumulative credit inflows (â¹)",children:e.jsx("input",{type:"number",value:s.totalDeposits,onChange:t=>x(a=>({...a,totalDeposits:t.target.value})),className:p(o,"font-mono font-semibold text-emerald-600"),placeholder:"0.00"})}),e.jsx(i,{label:"Total Withdrawals (Debits)",hint:"Cumulative debit outflows (â¹)",children:e.jsx("input",{type:"number",value:s.totalWithdrawals,onChange:t=>x(a=>({...a,totalWithdrawals:t.target.value})),className:p(o,"font-mono font-semibold text-rose-600"),placeholder:"0.00"})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between pb-1.5 border-b border-slate-100 dark:border-slate-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-500 shrink-0"}),e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-slate-800 dark:text-slate-200",children:"Audit Schedule & Compliance Sign-off"})]}),e.jsx("span",{className:"text-[10px] text-slate-400 font-medium",children:"Statutory internal control"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsx(i,{label:"Last Checked Date & Time",hint:"PMS-style picker",children:e.jsx(_e,{value:s.lastUpdated,onChange:t=>x(a=>({...a,lastUpdated:t})),showTime:!0,className:o})}),e.jsx(i,{label:"Account Custodian / Manager",hint:"Designated reporting authority",children:e.jsx("input",{type:"text",value:s.custodian,onChange:t=>x(a=>({...a,custodian:t.target.value})),className:o,placeholder:"e.g. Finance Officer / Treasury Lead"})}),e.jsx(i,{label:"Operational Status",hint:"Account activity state",children:e.jsx(S,{value:s.status,onChange:t=>x(a=>({...a,status:t})),options:[{value:"Active",label:"Active & Reconciled"},{value:"Dormant",label:"Dormant"},{value:"Frozen",label:"Frozen / Blocked"}],placeholder:"Select Status...",searchPlaceholder:"Search status...",triggerClassName:o,enableEditDeleteAdd:!1})})]})]}),d&&e.jsxs("div",{className:"p-4 rounded-xl border border-rose-200 dark:border-rose-900/50 bg-rose-50/40 dark:bg-rose-950/20 flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-rose-700 dark:text-rose-400 font-bold text-xs",children:[e.jsx(Ke,{className:"w-4 h-4"})," Danger Zone: Delete Bank Account"]}),e.jsx("p",{className:"text-[11px] text-slate-500 dark:text-slate-400",children:"Only the Department Head / Super Admin can remove a registered bank account from the master ledger."})]}),e.jsxs("button",{type:"button",onClick:()=>W(!0),disabled:!w||f,className:p("h-8 px-3 rounded-md bg-rose-600 hover:bg-rose-700 text-white font-semibold text-xs transition-colors inline-flex items-center gap-1.5 shrink-0 cursor-pointer shadow-xs",!w&&"opacity-50 cursor-not-allowed"),children:[e.jsx(Y,{className:"w-3.5 h-3.5"})," Delete Account"]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-slate-100 dar
1k:border-slate-800",children:[e.jsxs("button",{type:"button",onClick:()=>C("particulars"),className:"h-9 px-4 rounded-lg border border-slate-200 dark:border-slate-800 hover:bg-slate-100 dark:hover:bg-slate-800 text-xs font-semibold text-slate-600 dark:text-slate-400 inline-flex items-center gap-1.5 transition-colors cursor-pointer",children:[e.jsx(K,{className:"w-3.5 h-3.5"})," Back to Particulars"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{type:"button",onClick:()=>C("cards"),className:"h-9 px-4 rounded-lg bg-blue-50 dark:bg-blue-950/60 hover:bg-blue-100 dark:hover:bg-blue-900/60 border border-blue-200 dark:border-blue-800 text-xs font-bold text-blue-700 dark:text-blue-300 inline-flex items-center gap-1.5 transition-colors cursor-pointer",children:[e.jsx("span",{children:"Next: Connected Cards"}),e.jsx(re,{className:"w-3.5 h-3.5"})]}),e.jsxs("button",{type:"button",onClick:()=>P(!0),disabled:f,className:"h-9 px-4 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 hover:bg-slate-50 dark:hover:bg-slate-800 text-xs font-bold text-slate-700 dark:text-slate-200 inline-flex items-center gap-1.5 shadow-2xs transition-colors cursor-pointer",children:[e.jsx(T,{className:"w-3.5 h-3.5 text-blue-600"})," Save & Add Another"]}),e.jsxs("button",{type:"button",onClick:()=>P(!1),disabled:f,className:"h-9 px-6 rounded-lg bg-blue-600 hover:bg-blue-700 text-white font-bold text-xs shadow-md transition-all inline-flex items-center gap-2 cursor-pointer",children:[e.jsx(ne,{className:"w-3.5 h-3.5"}),f?"Saving...":d?"Update Bank Account":"Save Bank Account"]})]})]})]}),e.jsxs(z,{value:"cards",className:"space-y-6 mt-0",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-slate-100 dark:border-slate-800",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4 text-blue-600"}),e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-slate-800 dark:text-slate-200",children:"Connected Corporate Cards & Plastics"})]}),e.jsx("p",{className:"text-[11px] text-slate-500 dark:text-slate-400 mt-0.5",children:"Link corporate credit cards and business debit cards issued on this account for seamless expense tracking and automated bank statement mapping."})]}),!ae&&e.jsxs("button",{type:"button",onClick:()=>y(!0),className:"h-8 px-3 rounded-lg bg-blue-600 hover:bg-blue-700 text-white font-semibold text-xs transition-all inline-flex items-center gap-1.5 shadow-xs cursor-pointer",children:[e.jsx(T,{className:"w-3.5 h-3.5"})," Link New Card"]})]}),ae&&e.jsxs("form",{onSubmit:Ne,className:"p-4 rounded-xl border border-blue-200 dark:border-blue-900/60 bg-blue-50/30 dark:bg-blue-950/20 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-blue-100 dark:border-blue-900/40",children:[e.jsxs("span",{className:"text-xs font-bold text-blue-900 dark:text-blue-300 flex items-center gap-1.5",children:[j?e.jsx(le,{className:"w-3.5 h-3.5"}):e.jsx(T,{className:"w-3.5 h-3.5"}),j?`Edit Banking Card (â¢â¢${n.last4||"Card"})`:"Configure New Banking Card"]}),e.jsx("button",{type:"button",onClick:()=>{y(!1),I(null)},className:"text-xs text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 p-1 cursor-pointer",children:e.jsx(Ve,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6 items-start",children:[e.jsxs("div",{className:"lg:col-span-7 grid grid-cols-1 sm:grid-cols-2 gap-3.5",children:[e.jsx(i,{label:"Card Network",required:!0,hint:"Payment Gateway",children:e.jsx(S,{value:n.cardNetwork,onChange:t=>N(a=>({...a,cardNetwork:t})),options:pt,placeholder:"Select Card Network...",searchPlaceholder:"Search network (Visa, Mastercard...)",triggerClassName:o,enableEditDeleteAdd:!1})}),e.jsx(i,{label:"Card Type",required:!0,hint:"Classification",children:e.jsx(S,{value:n.cardType,onChange:t=>N(a=>({...a,cardType:t})),options:ht,placeholder:"Select Card Type...",searchPlaceholder:"Search card type...",triggerClassName:o,enableEditDeleteAdd:!1})}),e.jsx(i,{label:"Card Nickname / Label",hint:"e.g. Primary Travel Card",children:e.jsx("input",{type:"text",value:n.cardNickname,onChange:t=>N(a=>({...a,cardNickname:t.target.value})),className:o,placeholder:"e.g. Executive Regalia"})}),e.jsx(i,{label:"Last 4 Digits",required:!0,hint:"e.g. 4521",children:e.jsx("input",{type:"text",maxLength:4,value:n.last4,onChange:t=>N(a=>({...a,last4:t.target.value.replace(/\D/g,"")})),className:p(o,"font-mono font-bold tracking-widest text-center text-sm"),placeholder:"4521"})}),e.jsx(i,{label:"Cardholder Name (Embossed)",required:!0,hint:"Exact name on card",children:e.jsx("input",{type:"text",value:n.cardHolderName,onChange:t=>N(a=>({...a,cardHolderName:t.target.value})),className:o,placeholder:"Pawandeep Kaur Grewal"})}),e.jsx(i,{label:"Card Custodian (HRMS)",required:!0,hint:"Staff responsible for card",children:e.jsx(S,{value:n.custodianName,onChange:t=>N(a=>({...a,custodianName:t})),options:ge.map(t=>({value:t,label:t})),placeholder:"Select staff custodian...",searchPlaceholder:"Search staff name...",triggerClassName:o,enableEditDeleteAdd:!1})}),e.jsx(i,{label:"Expiry Date",hint:"MM/YY",children:e.jsx("input",{type:"text",maxLength:5,value:n.expiryDate,onChange:t=>N(a=>({...a,expiryDate:t.target.value})),className:p(o,"font-mono text-center"),placeholder:"12/28"})}),e.jsx(i,{label:"Monthly Spend Limit (â¹)",hint:"Card spend ceiling",children:e.jsx("input",{type:"number",value:n.monthlyLimit,onChange:t=>N(a=>({...a,monthlyLimit:t.target.value})),className:p(o,"font-mono font-semibold"),placeholder:"500000"})})]}),e.jsxs("div",{className:"lg:col-span-5 flex flex-col items-center justify-center p-3",children:[e.jsxs("div",{className:p("w-full max-w-[280px] h-[168px] rounded-xl p-4 text-white shadow-xl relative overflow-hidden flex flex-col justify-between border transition-all select-none",n.cardNetwork==="Visa"?"bg-gradient-to-tr from-slate-900 via-blue-950 to-indigo-900 border-blue-500/30":n.cardNetwork==="Mastercard"?"bg-gradient-to-tr from-slate-950 via-neutral-900 to-rose-950 border-rose-500/30":n.cardNetwork==="Amex"?"bg-gradient-to-tr from-cyan-950 via-slate-900 to-slate-950 border-cyan-500/30":"bg-gradient-to-tr from-emerald-950 via-slate-900 to-indigo-950 border-emerald-500/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"w-8 h-6 rounded bg-gradient-to-br from-amber-200 via-amber-400 to-amber-600 border border-amber-300/60 shadow-inner flex items-center justify-center",children:e.jsxs("div",{className:"w-5 h-3 border border-amber-800/40 rounded-xs grid grid-cols-2 gap-0.5 p-0.5",children:[e.jsx("div",{className:"border border-amber-800/40 rounded-2xs"}),e.jsx("div",{className:"border border-amber-800/40 rounded-2xs"})]})}),e.jsx("span",{className:"text-[11px] font-black tracking-wider up
1percase font-mono",children:n.cardNetwork})]}),e.jsxs("div",{className:"font-mono text-sm tracking-widest text-slate-100 font-extrabold text-shadow-sm my-1",children:["â¢â¢â¢â¢ â¢â¢â¢â¢ â¢â¢â¢â¢ ",n.last4||"4521"]}),e.jsxs("div",{className:"flex items-end justify-between border-t border-white/10 pt-1 text-[9px]",children:[e.jsxs("div",{className:"max-w-[170px] truncate",children:[e.jsx("span",{className:"text-white/60 uppercase text-[7.5px] block",children:"Cardholder"}),e.jsx("span",{className:"font-bold uppercase tracking-wider block truncate",children:n.cardHolderName||"CORPORATE HOLDER"})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:"text-white/60 uppercase text-[7.5px] block",children:"Valid Thru"}),e.jsx("span",{className:"font-mono font-bold",children:n.expiryDate||"12/28"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-4 w-full max-w-[280px]",children:[e.jsx("button",{type:"button",onClick:()=>{y(!1),I(null)},className:"flex-1 h-8 rounded-lg border border-slate-200 dark:border-slate-800 text-xs font-semibold text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-800 cursor-pointer",children:"Cancel"}),e.jsx("button",{type:"submit",className:"flex-1 h-8 rounded-lg bg-blue-600 hover:bg-blue-700 text-white text-xs font-bold shadow-xs cursor-pointer",children:j?"Update Card":"Save & Link Card"})]})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-slate-200 dark:border-slate-800 overflow-hidden bg-white dark:bg-slate-900",children:[e.jsxs("div",{className:"px-4 py-2.5 bg-slate-50 dark:bg-slate-800/60 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between text-xs font-semibold text-slate-700 dark:text-slate-300",children:[e.jsxs("span",{children:["Active Linked Cards (",k.length,")"]}),e.jsx("span",{className:"text-[11px] text-slate-400 font-normal",children:"Auto-detected in statement import & expenses"})]}),k.length===0?e.jsxs("div",{className:"p-8 text-center space-y-2",children:[e.jsx(H,{className:"w-8 h-8 text-slate-300 dark:text-slate-600 mx-auto"}),e.jsx("h4",{className:"text-xs font-bold text-slate-700 dark:text-slate-300",children:"No Cards Connected Yet"}),e.jsx("p",{className:"text-[11px] text-slate-400 max-w-sm mx-auto",children:'Click "+ Link New Card" above to register debit or credit cards connected to this bank account.'})]}):e.jsx("div",{className:"divide-y divide-slate-100 dark:divide-slate-800",children:k.map(t=>e.jsxs("div",{className:"p-3.5 flex items-center justify-between hover:bg-slate-50/80 dark:hover:bg-slate-800/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-8 rounded-md bg-slate-900 text-white font-mono text-[10px] font-bold flex items-center justify-center shadow-xs shrink-0",children:t.last4}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h5",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:t.cardNickname}),e.jsx("span",{className:"px-1.5 py-0.2 rounded text-[9.5px] font-bold bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-300 border border-blue-200 dark:border-blue-900",children:t.cardType}),e.jsx("span",{className:"px-1.5 py-0.2 rounded text-[9.5px] font-semibold bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-300",children:t.cardNetwork})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-slate-400 mt-0.5",children:[e.jsxs("span",{children:["Holder: ",e.jsx("strong",{className:"text-slate-600 dark:text-slate-300",children:t.cardHolderName})]}),e.jsx("span",{children:"â¢"}),e.jsxs("span",{children:["Custodian: ",t.custodianName]}),e.jsx("span",{children:"â¢"}),e.jsxs("span",{children:["Expires: ",t.expiryDate]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"text-right mr-2",children:[e.jsx("span",{className:"text-[10px] text-slate-400 uppercase font-semibold block",children:"Monthly Limit"}),e.jsxs("span",{className:"font-mono text-xs font-bold text-slate-700 dark:text-slate-300",children:["â¹",t.monthlyLimit.toLocaleStr
1ing("en-IN")]})]}),e.jsx("button",{type:"button",onClick:()=>fe(t),className:"p-1.5 rounded-lg text-slate-400 hover:text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-950/40 transition-colors cursor-pointer",title:"Edit Card",children:e.jsx(le,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:()=>ke(t.id),className:"p-1.5 rounded-lg text-slate-400 hover:text-rose-600 hover:bg-rose-50 dark:hover:bg-rose-950/40 transition-colors cursor-pointer",title:"Unlink Card",children:e.jsx(Y,{className:"w-3.5 h-3.5"})})]})]},t.id))})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-slate-100 dark:border-slate-800",children:[e.jsxs("button",{type:"button",onClick:()=>C("balances"),className:"h-9 px-4 rounded-lg border border-slate-200 dark:border-slate-800 hover:bg-slate-100 dark:hover:bg-slate-800 text-xs font-semibold text-slate-600 dark:text-slate-400 inline-flex items-center gap-1.5 transition-colors cursor-pointer",children:[e.jsx(K,{className:"w-3.5 h-3.5"})," Back to Balances & Audit"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{type:"button",onClick:()=>P(!0),disabled:f,className:"h-9 px-4 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 hover:bg-slate-50 dark:hover:bg-slate-800 text-xs font-bold text-slate-700 dark:text-slate-200 inline-flex items-center gap-1.5 shadow-2xs transition-colors cursor-pointer",children:[e.jsx(T,{className:"w-3.5 h-3.5 text-blue-600"})," Save & Add Another"]}),e.jsxs("button",{type:"button",onClick:()=>P(!1),disabled:f,className:"h-9 px-6 rounded-lg bg-blue-600 hover:bg-blue-700 text-white font-bold text-xs shadow-md transition-all inline-flex items-center gap-2 cursor-pointer",children:[e.jsx(ne,{className:"w-3.5 h-3.5"}),f?"Saving...":d?"Update Bank Account":"Save Bank Account"]})]})]})]})]}),e.jsx("div",{className:"lg:col-span-4 p-6 bg-slate-50/40 dark:bg-slate-950/40 space-y-6",children:e.jsxs("div",{className:"sticky top-6 space-y-6",children:[e.jsxs("div",{className:"relative overflow-hidden rounded-2xl p-6 bg-gradient-to-tr from-slate-900 via-indigo-950 to-blue-900 text-white shadow-xl border border-slate-800/80",children:[e.jsx("div",{className:"absolute top-0 right-0 -mt-8 -mr-8 w-40 h-40 bg-blue-500/20 rounded-full blur-3xl pointer-events-none"}),e.jsx("div",{className:"absolute bottom-0 left-0 -mb-8 -ml-8 w-36 h-36 bg-emerald-500/20 rounded-full blur-2xl pointer-events-none"}),e.jsxs("div",{className:"flex items-center justify-between relative z-10 mb-5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/10 backdrop-blur-md flex items-center justify-center border border-white/20",children:e.jsx(ze,{className:"w-4 h-4 text-white"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-white/60 font-semibold uppercase tracking-wider block",children:"Bank Account"}),e.jsx("h4",{className:"text-sm font-extrabold tracking-tight text-white",children:s.bank||"Select Bank"})]})]}),e.jsx("span",{className:"px-2.5 py-0.5 rounded-full text-[10px] font-extrabold uppercase tracking-wider bg-white/20 border border-white/30 text-white backdrop-blur-sm",children:s.type||"CURRENT"})]}),e.jsxs("div",{className:"flex items-center justify-between mb-4 relative z-10",children:[e.jsx("div",{className:"w-10 h-8 rounded-md bg-gradient-to-br from-amber-200 via-amber-400 to-amber-600 border border-amber-300/60 shadow-inner flex items-center justify-center",children:e.jsxs("div",{className:"w-6 h-4 border border-amber-800/40 rounded-sm grid grid-cols-2 gap-0.5 p-0.5",children:[e.jsx("div",{className:"border border-amber-800/40 rounded-xs"}),e.jsx("div",{className:"border border-amber-800/40 rounded-xs"})]})}),e.jsx(H,{className:"w-5 h-5 text-white/40"})]}),e.jsx("div",{className:"relative z-10 mb-4 font-mono text-base font-black tracking-widest text-slate-100 text-shadow-sm",children:ye}),e.jsxs("div",{className:"flex items-end justify-between relative z-10 pt-2 border-t border-white/15",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] uppercase tracking-widest text-white/60 block font-semibold",children:"Account Holder"}),e.jsx("p",{className:"text-xs font-bold uppercase tracking-wider text-white truncate max-w-[170px]",children:s.account||s.company||"CORPORATE ENTITY"})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:"text-[9px] uppercase tracking-widest text-white/60 block font-semibold",children:"Live Balance"}),e.jsxs("p",{className:"text-sm font-mono font-black text-emerald-400",children:["â¹",E.toLocaleStr
1ing("en-IN")]})]})]})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 shadow-2xs space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 dark:border-slate-800 pb-2",children:[e.jsxs("h4",{className:"text-xs font-bold uppercase tracking-wider text-slate-800 dark:text-slate-200 flex items-center gap-1.5",children:[e.jsx(Ye,{className:"w-3.5 h-3.5 text-blue-600"})," Account Identity Summary"]}),e.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-emerald-50 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-300",children:s.status})]}),e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex justify-between py-1 border-b border-slate-100 dark:border-slate-800/60",children:[e.jsx("span",{className:"text-slate-500",children:"Branch"}),e.jsx("span",{className:"font-medium text-slate-800 dark:text-slate-200 text-right max-w-[180px] truncate",children:s.branch||"â"})]}),e.jsxs("div",{className:"flex justify-between py-1 border-b border-slate-100 dark:border-slate-800/60",children:[e.jsx("span",{className:"text-slate-500",children:"IFSC Code"}),e.jsx("span",{className:"font-mono font-bold text-slate-800 dark:text-slate-200",children:s.ifscCode||"â"})]}),e.jsxs("div",{className:"flex justify-between py-1 border-b border-slate-100 dark:border-slate-800/60",children:[e.jsx("span",{className:"text-slate-500",children:"SWIFT / BIC"}),e.jsx("span",{className:"font-mono font-bold text-slate-800 dark:text-slate-200",children:s.swiftCode||"â"})]}),e.jsxs("div",{className:"flex justify-between py-1 border-b border-slate-100 dark:border-slate-800/60",children:[e.jsx("span",{className:"text-slate-500",children:"UPI ID"}),e.jsx("span",{className:"font-mono font-semibold text-blue-600 dark:text-blue-400",children:s.upiId||"â"})]}),e.jsxs("div",{className:"flex justify-between py-1 border-b border-slate-100 dark:border-slate-800/60",children:[e.jsx("span",{className:"text-slate-500",children:"Connected Cards"}),e.jsxs("span",{className:"font-medium text-blue-600 dark:text-blue-400 text-right",children:[k.length," Active ",k.length===1?"Card":"Cards"]})]}),e.jsxs("div",{className:"flex justify-between py-1",children:[e.jsx("span",{className:"text-slate-500",children:"Custodian"}),e.jsx("span",{className:"font-medium text-slate-700 dark:text-slate-300 text-right max-w-[180px] truncate",children:s.custodian})]})]})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-blue-50/60 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-900/50 flex items-start gap-3 text-xs",children:[e.jsx(Je,{className:"w-4 h-4 text-blue-600 shrink-0 mt-0.5"}),e.jsxs("p",{className:"text-slate-600 dark:text-slate-300 leading-relaxed text-[11px]",children:["Updating this bank account instantly synchronizes its branch address, IFSC, SWIFT, and UPI QR code across all active invoices in ",e.jsx(_,{to:`${v}/invoices/new`,className:"text-blue-600 font-bold hover:underline",children:"New Invoice"})," and client PDF exports."]})]})]})})]})]})}),e.jsx(Xe,{open:xe,onOpenChange:W,children:e.jsxs(Ze,{children:[e.jsxs(et,{children:[e.jsx(tt,{children:"Delete Bank Account?"}),e.jsxs(at,{children:["Are you sure you want to delete bank account ",e.jsx("span",{className:"font-bold text-slate-900",children:s.accountNo})," (",s.bank,")? This action cannot be undone and will remove it from the organization ledger."]})]}),e.jsxs(st,{children:[e.jsx(rt,{children:"Cancel"}),e.jsx(nt,{onClick:Ce,className:"bg-rose-600 hover:bg-rose-700 text-white",children:"Confirm Delete"})]})]})})]})}export{wt as NewBankAccountPage,wt as default};
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.