1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6e7b68b3-42eb-4342-9b50-002a11744a8f",e._sentryDebugIdIdentifier="sentry-dbid-6e7b68b3-42eb-4342-9b50-002a11744a8f")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4649],{20457:function(e,t,r){r.d(t,{Z:function(){return N}});var a=r(85893),n=r(67294),o=r(8186),i=r(48899),s=r(90092),c=r(43695),l=r(8455),d=r(64831),u=r(73636),f=r(68029),m=r(12553),p=r(74032),h=r(38491),v=r(87579),g=r(68598),x=r(69255),b=r(11163),w=r(6459),y=r(91816),T=r(4234),j=r(34614),_=r(19164),D=r(21360),I=r(57391),R=r(70010),S=r(26972),C=r(12519),k=r(14804);let E=e=>{let{label:t,value:r,capitalize:n=!1}=e;return(0,a.jsxs)(u.U,{justify:"space-between",align:"start",children:[(0,a.jsx)(s.x,{fontSize:"sm",color:"gray.500",minW:"110px",children:t}),(0,a.jsx)(s.x,{fontSize:"sm",fontWeight:"medium",textAlign:"right",textTransform:n?"capitalize":"none",flex:1,children:r})]})};var z=e=>{var t,r,n;let{isOpen:i,onClose:c,transaction:l}=e,h=(0,w.p)(),v=null!==(t=(0,y.S)({base:"bottom",md:"right"}))&&void 0!==t?t:"bottom";if(!l)return null;let b=(e,t)=>{navigator.clipboard.writeText(e).then(()=>{h({title:"".concat(t," copied"),status:"success",duration:1500,isClosable:!0,position:"top"})})},z=()=>{var e,t,r,a,n,o,i;switch(l.referenceType){case"payment":if((null===(e=l.metadata)||void 0===e?void 0:e.type)==="wallet_topup")return"Wallet Top-up";if((null===(t=l.metadata)||void 0===t?void 0:t.type)==="immediate_payment")return"DEBIT"===l.direction?"Upfront Payment Sent":"Upfront Payment Received";return"DEBIT"===l.direction?"Payment for Service":"Payment Received";case"escrow_lock":return"Escrow Lock";case"escrow_release":return"Escrow Released";case"deposit_lock":return"Deposit Held";case"deposit_release":return"CREDIT"===l.direction?"Deposit Claimed":"Deposit Returned";case"platform_fee":return"Platform Fee";case"withdrawal":case"transfer":return"DEBIT"===l.direction?"Transfer to Bank":"Transfer Refunded";case"transfer_with_fee":return"Transfer to Bank";case"transfer_fee":return"Transfer Fee";case"refund":if((null===(r=l.metadata)||void 0===r?void 0:r.type)==="withdrawal"||(null===(a=l.metadata)||void 0===a?void 0:a.type)==="transfer"||(null===(n=l.metadata)||void 0===n?void 0:n.type)==="transfer_refund"||(null===(o=l.metadata)||void 0===o?void 0:o.referenceType)==="withdrawal"||(null===(i=l.metadata)||void 0===i?void 0:i.referenceType)==="transfer")return"Transfer Returned";return"Refund";case"topup":return"Wallet Top-up";default:return l.referenceType.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}},N=()=>{var e;if("transfer_with_fee"===l.referenceType&&(null===(e=l.metadata)||void 0===e?void 0:e.withdrawalStatus))switch(l.metadata.withdrawalStatus){case"pending":case"processing":return"Processing";case"success":break;case"failed":return"Failed";case"reversed":return"Reversed"}return"Completed"},A=(()=>{var e,t,r,a,n,o,i,s,c,d,u,f,m,p;let h="CREDIT"===l.direction;switch(l.referenceType){case"transfer_with_fee":case"transfer":case"withdrawal":{let a=[];(null===(e=l.metadata)||void 0===e?void 0:e.bankName)&&a.push(l.metadata.bankName),(null===(t=l.metadata)||void 0===t?void 0:t.accountNumber)&&a.push("(".concat(l.metadata.accountNumber,")"));let n=a.length>0?"Transfer to ".concat(a.join(" ")):"Transfer to Bank",o=(null===(r=l.metadata)||void 0===r?void 0:r.transferAmount)?" â â¦".concat(Number(l.metadata.transferAmount).toLocaleString()):"";return"".concat(n).concat(o)}case"transfer_fee":return"Transfer processing fee";case"topup":return(null===(a=l.metadata)||void 0===a?void 0:a.description)||((null===(n=l.metadata)||void 0===n?void 0:n.gateway)?"Wallet top-up via ".concat(l.metadata.gateway):"Wallet Top-up");case"payment":return(null===(o=l.metadata)||void 0===o?void 0:o.description)||(h?"Payment received":"Payment for service");case"escrow_lock":return(null===(i=l.metadata)||void 0===i?void 0:i.description)||"Funds held in escrow";case"escrow_release":return(null===(s=l.metadata)||void 0===s?void 0:s.description)||"Funds released from escrow";case"deposit_lock":return(null===(c=l.metadata)||void 0===c?void 0:c.description)||"Deposit held in escrow";case"deposit_release":if((null===(d=l.metadata)||void 0===d?void 0:d.type)==="damage_deposit_claim")return(null===(u=l.metadata)||void 0===u?void 0:u.reason)?"Deposit claim â ".concat(l.metadata.reason):"Deposit claimed";return"Deposit returned to customer";case"refund":return(null===(f=l.metadata)||void 0===f?void 0:f.reason)?"Refund â ".concat(l.metadata.reason):"Refund";case"platform_fee":return"Platform service fee";default:return(null===(m=l.metadata)||void 0===m?void 0:m.description)||(null===(p=l.metadata)||void 0===p?void 0:p.narration)||""}})(),W=(()=>{var e,t,r,a,n;let o=[];switch(l.referenceType){case"transfer_with_fee":(null===(e=l.metadata)||void 0===e?void 0:e.transferAmount)&&o.push({label:"Transfer Amount",value:"â¦".concat(Number(l.metadata.transferAmount).toLocaleStr
1ing())}),(null===(t=l.metadata)||void 0===t?void 0:t.feeAmount)&&o.push({label:"Transfer Fee",value:"â¦".concat(Number(l.metadata.feeAmount).toLocaleString())});break;case"topup":case"payment":break;case"escrow_release":(null===(r=l.metadata)||void 0===r?void 0:r.releaseReason)&&o.push({label:"Release Reason",value:l.metadata.releaseReason.replace(/_/g," ")});break;case"deposit_release":(null===(a=l.metadata)||void 0===a?void 0:a.reason)&&o.push({label:"Claim Reason",value:l.metadata.reason});break;case"refund":(null===(n=l.metadata)||void 0===n?void 0:n.originalReference)&&o.push({label:"Original Reference",value:l.metadata.originalReference})}return o})();return(0,a.jsxs)(T.dy,{isOpen:i,onClose:c,placement:v,size:"right"===v?"sm":"md",children:[(0,a.jsx)(j.Z,{}),(0,a.jsxs)(_.s,{borderTopRadius:"bottom"===v?"20px":"0",maxH:"bottom"===v?"85vh":"100vh",children:[(0,a.jsx)(D.o,{}),(0,a.jsx)(I.x,{pb:2,borderBottomWidth:"1px",children:(0,a.jsxs)(u.U,{spacing:3,children:[(0,a.jsx)(f.x,{p:2,borderRadius:"full",bg:"CREDIT"===l.direction?"green.50":"red.50",children:(0,a.jsx)(m.J,{as:"CREDIT"===l.direction?g.Z:x.Z,boxSize:5,color:"CREDIT"===l.direction?"green.500":"red.500"})}),(0,a.jsxs)(o.g,{align:"start",spacing:0,children:[(0,a.jsx)(s.x,{fontSize:"md",fontWeight:"bold",children:z()}),(0,a.jsxs)(u.U,{spacing:2,children:[(0,a.jsx)(p.C,{colorScheme:"CREDIT"===l.direction?"green":"red",fontSize:"xs",children:"CREDIT"===l.direction?"Inflow":"Outflow"}),(0,a.jsx)(p.C,{colorScheme:"Completed"===N()?"green":"Failed"===N()||"Reversed"===N()?"red":"orange",fontSize:"xs",variant:"subtle",children:N()})]})]})]})}),(0,a.jsx)(R.f,{children:(0,a.jsxs)(o.g,{spacing:5,align:"stretch",py:3,children:[(0,a.jsxs)(f.x,{textAlign:"center",py:4,children:[(0,a.jsxs)(s.x,{fontSize:"3xl",fontWeight:"bold",color:"CREDIT"===l.direction?"green.600":"red.600",children:["CREDIT"===l.direction?"+":"-",l.amountFormatted||"â¦".concat(l.amount.toFixed(2))]}),(0,a.jsx)(s.x,{fontSize:"sm",color:"gray.500",children:z()})]}),(0,a.jsx)(d.i,{}),(0,a.jsxs)(o.g,{spacing:3,align:"stretch",children:[(0,a.jsx)(E,{label:"Date & Time",value:(e=>{let t=new Date(e);return new Intl.DateTimeFormat("en-NG",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(t)})(l.createdAt)}),!!A&&(0,a.jsx)(E,{label:"Description",value:A}),W.map((e,t)=>(0,a.jsx)(E,{label:e.label,value:e.value},t)),(l.referenceId||l.transactionId)&&(0,a.jsxs)(u.U,{justify:"space-between",align:"start",children:[(0,a.jsx)(s.x,{fontSize:"sm",color:"gray.500",minW:"110px",children:"Transaction Ref"}),(0,a.jsxs)(u.U,{spacing:1,flex:1,justify:"end",children:[(0,a.jsx)(S.u,{label:null!==(r=l.referenceId)&&void 0!==r?r:l.transactionId,placement:"top",hasArrow:!0,children:(0,a.jsx)(s.x,{fontSize:"sm",fontWeight:"medium",textAlign:"right",noOfLines:1,maxW:"180px",children:null!==(n=l.referenceId)&&void 0!==n?n:l.transactionId})}),(0,a.jsx)(C.h,{"aria-label":"Copy transaction reference",icon:(0,a.jsx)(k.Z,{size:14}),size:"xs",variant:"ghost",colorScheme:"blue",onClick:()=>{var e;return b(null!==(e=l.referenceId)&&void 0!==e?e:l.transactionId,"Transaction Ref")}})]})]})]})]})})]})]})},N=e=>{let{transactions:t,loading:r,showLimit:w=!1}=e,y=(0,b.useRouter)(),[T,j]=(0,n.useState)(null),[_,D]=(0,n.useState)(!1),I=e=>{j(e),D(!0)},R=e=>{let t=new Date(e);return new Intl.DateTimeFormat("en-NG",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t)},S=e=>{var t,r,a,n,o,i,s,c,l;switch(e.referenceType){case"payment":if((null===(t=e.metadata)||void 0===t?void 0:t.type)==="wallet_topup")return"Wallet Top-up";if((null===(r=e.metadata)||void 0===r?void 0:r.type)==="immediate_payment")return"DEBIT"===e.direction?"Upfront payment sent":"Upfront payment received";return"DEBIT"===e.direction?"Payment for service":"Payment received";case"escrow_lock":return"Funds locked in escrow";case"escrow_release":return"Escrow funds released";case"deposit_lock":return"Deposit held";case"deposit_release":return"CREDIT"===e.direction?"Deposit claimed":"Deposit returned to customer";case"platform_fee":return"Platform fee";case"withdrawal":case"transfer":return"DEBIT"===e.direction?"Transfer to bank":"Transfer refunded";case"transfer_with_fee":if((null===(a=e.metadata)||void 0===a?void 0:a.transferAmount)&&(null===(n=e.metadata)||void 0===n?void 0:n.feeAmount))return"Transfer: â¦".concat(e.metadata.transferAmount.toLocaleStr
1ing()," + Fee: â¦").concat(e.metadata.feeAmount.toLocaleString());return"Transfer to bank";case"transfer_fee":return"Transfer fee";case"refund":if((null===(o=e.metadata)||void 0===o?void 0:o.type)==="withdrawal"||(null===(i=e.metadata)||void 0===i?void 0:i.type)==="transfer"||(null===(s=e.metadata)||void 0===s?void 0:s.type)==="transfer_refund"||(null===(c=e.metadata)||void 0===c?void 0:c.referenceType)==="withdrawal"||(null===(l=e.metadata)||void 0===l?void 0:l.referenceType)==="transfer")return"Transfer returned to wallet";return"Refund";case"topup":return"Wallet Top-up";default:return e.referenceType}};if(r)return(0,a.jsxs)(o.g,{py:8,children:[(0,a.jsx)(i.$,{size:"xl",color:"#222E50"}),(0,a.jsx)(s.x,{color:"gray.500",children:"Loading transactions..."})]});if(0===t.length)return(0,a.jsx)(c.Z,{children:(0,a.jsx)(l.e,{children:(0,a.jsxs)(o.g,{py:8,children:[(0,a.jsx)(v.Z,{size:36,color:"#222E50"}),(0,a.jsx)(s.x,{color:"gray.600",textAlign:"center",children:"No transactions yet"}),(0,a.jsx)(s.x,{fontSize:"sm",color:"gray.400",textAlign:"center",children:"Your transaction history will appear here"})]})})});let C=w?t.slice(0,10):t;return(0,a.jsxs)(o.g,{spacing:4,align:"stretch",children:[(0,a.jsx)(c.Z,{children:(0,a.jsx)(l.e,{p:0,children:(0,a.jsx)(o.g,{divider:(0,a.jsx)(d.i,{}),spacing:0,align:"stretch",children:C.map(e=>(0,a.jsxs)(u.U,{p:{base:3,md:4},justify:"space-between",align:"start",spacing:{base:2,md:3},_hover:{bg:"gray.50"},cursor:"pointer",onClick:()=>I(e),transition:"background 0.15s ease",children:[(0,a.jsxs)(u.U,{spacing:{base:2,md:3},align:"start",flex:1,minW:0,children:[(0,a.jsx)(f.x,{p:{base:1.5,md:2},borderRadius:"full",bg:"CREDIT"===e.direction?"green.50":"red.50",flexShrink:0,children:(0,a.jsx)(m.J,{as:"CREDIT"===e.direction?g.Z:x.Z,boxSize:{base:4,md:5},color:"CREDIT"===e.direction?"green.500":"red.500"})}),(0,a.jsxs)(o.g,{align:"start",spacing:0,minW:0,children:[(0,a.jsx)(s.x,{fontWeight:"medium",fontSize:{base:"xs",md:"sm"},noOfLines:2,children:S(e)}),(0,a.jsx)(s.x,{fontSize:"xs",color:"gray.500",children:R(e.createdAt)})]})]}),(0,a.jsxs)(o.g,{align:"end",spacing:0,flexShrink:0,children:[(0,a.jsxs)(s.x,{fontWeight:"semibold",fontSize:{base:"sm",md:"md"},color:"CREDIT"===e.direction?"green.600":"red.600",whiteSpace:"nowrap",children:["CREDIT"===e.direction?"+":"-",e.amountFormatted||"â¦".concat(e.amount.toFixed(2))]}),(0,a.jsx)(p.C,{colorScheme:"CREDIT"===e.direction?"green":"red",fontSize:"xs",textTransform:"lowercase",children:e.referenceType.split("_")[0]})]})]},e.id))})})}),w&&t.length>10&&(0,a.jsxs)(s.x,{fontSize:"14px",color:"gray.500",textAlign:"center",mt:2,children:["Showing 10 of ",t.length," transactions."," ",(0,a.jsx)(h.z,{size:"sm",colorScheme:"blue",variant:"link",onClick:()=>y.push("/mesh/meshpay/transactions"),_hover:{transform:"scale(1.05)"},transition:"all 0.2s",children:"See all transactions"})," ","to view more."]}),(0,a.jsx)(z,{isOpen:_,onClose:()=>D(!1),transaction:T})]})}},16571:function(e,t,r){r.d(t,{Cs:function(){return p},G5:function(){return u},Jp:function(){return h},MP:function(){return d},Mx:function(){return c},P_:function(){return l},f1:function(){return o},fg:function(){return s},h_:function(){return m},pd:function(){return n},un:function(){return f},zU:function(){return i}});var a=r(2248);let n=e=>(0,a.X8)("get","".concat(a.Ne,"/core/wallet/balance").concat(e?"?businessId=".concat(e):"")),o=e=>(0,a.X8)("get","".concat(a.Ne,"/core/wallet/transactions"),{params:e}),i=e=>(0,a.X8)("get","".concat(a.Ne,"/core/wallet/escrow").concat(e?"?businessId=".concat(e):"")),s=(e,t)=>(0,a.X8)("get","".concat(a.Ne,"/core/request/artisan/").concat(e,"/payment-history").concat(t?"?businessId=".concat(t):"")),c=e=>(0,a.X8)("post","".concat(a.Ne,"/core/wallet/topup"),e),l=e=>(0,a.X8)("post","".concat(a.Ne,"/core/wallet/topup/verify"),e),d=e=>(0,a.X8)("post","".concat(a.Ne,"/core/wallet/transfer"),e),u=()=>(0,a.X8)("get","".concat(a.Ne,"/core/wallet/banks")),f=(e,t)=>(0,a.X8)("post","".concat(a.Ne,"/core/wallet/resolve-account"),{accountNumber:e,bankCode:t}),m=e=>(0,a.X8)("get","".concat(a.Ne,"/core/wallet/virtual-accounts").concat(e?"?businessId=".concat(e):"")),p=()=>(0,a.X8)("post","".concat(a.Ne,"/core/wallet/virtual-accounts/create"),{}),h=(e,t)=>(0,a.X8)("post","".concat(a.Ne,"/core/wallet/virtual-accounts/confirm-transfer"),{virtualAccountId:e,expectedAmount:t})}}]);
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.