1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-4N2cIpx7.js","assets/index-BDyoVFKC.js","assets/isDeepEqual-9fLdqRtr.js","assets/FirstPage-VhiVPwkY.js","assets/TableCell-yOWpYpJm.js","assets/useOnMount-BMagc4kt.js","assets/useEnhancedEffect-BRrVnPm7.js","assets/FormControlLabel-DLXJ0sMX.js","assets/LinearProgress-060lk_HM.js","assets/ToggleButton-b27dHmi5.js","assets/Checkbox-CAm0CMA-.js","assets/ClickAwayListener-nFHICJLU.js","assets/DateCell-35be214c.esm-C2RCxtn-.js","assets/getTransactionDetailsMessage-1cb8973a.esm-Dupd4tBG.js","assets/Warning-DOIiTfnO.js","assets/InlineDetailsRow-be4c2f4a.esm-CBLikoKo.js"])))=>i.map(i=>d[i]); 2import{u as We,ai as qe,l as Ge,s as $e,V as Ke,q as d,r as l,m as oe,a4 as le,j as t,I as c,M as B,ag as Ue,J as se,K as ue,B as T,x as F,w as de,F as ce,S as fe,_ as z,aI as Je,y as Ye,P as ve}from"./index-BDyoVFKC.js";import{W as ge}from"./Warning-DOIiTfnO.js";import{i as Xe,t as Ze,f as et,g as tt}from"./getTransactionDetailsMessage-1cb8973a.esm-Dupd4tBG.js";function L(a){if(a==null)return!1;if(typeof a=="number")return Number.isFinite(a)&&a>0;if(typeof a=="string"){var s=a.trim().toLowerCase();return!(s===""||s==="0"||s==="null"||s==="undefined")}return!1}function he(a,s){var u=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);s&&(i=i.filter(function(h){return Object.getOwnPropertyDescriptor(a,h).enumerable})),u.push.apply(u,i)}return u}function me(a){for(var s=1;s<arguments.length;s++){var u=arguments[s]!=null?arguments[s]:{};s%2?he(Object(u),!0).forEach(function(i){Ye(a,i,u[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(u)):he(Object(u)).forEach(function(i){Object.defineProperty(a,i,Object.getOwnPropertyDescriptor(u,i))})}return a}var rt=l.lazy(function(){return z(()=>import("./index-4N2cIpx7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(function(a){return{default:a.DataGridPro}})}),nt=l.lazy(function(){return z(()=>import("./DateCell-35be214c.esm-C2RCxtn-.js"),__vite__mapDeps([12,13,1,14]))}),it=l.lazy(function(){return z(()=>import("./InlineDetailsRow-be4c2f4a.esm-CBLikoKo.js"),__vite__mapDeps([15,1,13,14]))}),xe=function(s){var u=s.isAdmin,i=u===void 0?!1:u,h=s.memberId,D=s.failureBanner,A=s.onEditBillingClick,pe=We(),f=qe(pe.breakpoints.down("md")),x=Ge(),Se=$e(),S=Se.state,ye=Ke(),V=d(ye,2),p=V[0],be=V[1],je=l.useState(!1),Q=d(je,2),P=Q[0],I=Q[1],we=l.useState(!1),H=d(we,2),k=H[0],y=H[1],Ce=l.useState(!1),W=d(Ce,2),q=W[0],_e=W[1],b,j,w;S&&(b=S.refundStatus,j=S.outsideRefundStatus,w=S.refundErrorMessage);var De=l.useState(0),G=d(De,2),C=G[0],Pe=G[1],Ie=l.useState(!0),$=d(Ie,2),K=$[0],ke=$[1],Oe=oe({query:Xe,variables:{memberId:h,invoiceNumber:C},pause:K}),U=d(Oe,2),v=U[0],Re=U[1],Ee=l.useState({pageSize:parseInt(p.get("pageSize"))||10,page:parseInt(p.get("page"))||0}),J=d(Ee,2),m=J[0],Ne=J[1],Me=oe({query:Ze,variables:{page:m.page,pageSize:m.pageSize,memberId:h}}),Y=d(Me,2),X=Y[0],Z=Y[1],g=X.data,O=X.fetching,o=g==null?void 0:g.transactionHistories,Be=l.useState([]),ee=d(Be,2),R=ee[0],E=ee[1],Te=l.useState(!1),te=d(Te,2),Fe=te[0],Le=te[1];l.useEffect(function(){if(!O){if(o!==null){var r={id:"nextbilling",date:o==null?void 0:o.nextBillingDate,status:"Next Billing",invoiceNumber:null},e=(o==null?void 0:o.nextBillingDate)&&m.page===0;E(e?[r].concat(le(o==null?void 0:o.transactions)):o==null?void 0:o.transactions)}else(g==null?void 0:g.transactionHistories)===null&&E([]);g||Le(!0)}},[O,g,m.page]);var ze=function(){Z()};l.useEffect(function(){q||(I(b==="success"||j==="success"),y(b==="failure"||j==="failure"))},[b,j,q]),l.useEffect(function(){D&&y(D)},[D]),l.useEffect(function(){var r;if(v&&v!==null&&v!==void 0&&(r=v.data)!==null&&r!==void 0&&(r=r.invoicePdf)!==null&&r!==void 0&&r.pdfData){var e,n=new URLSearchParams(p);x("".concat(C,".pdf?").concat(n.toString()),{state:v==null||(e=v.data)===null||e===void 0||(e=e.invoicePdf)===null||e===void 0?void 0:e.pdfData})}},[v,C,p]);var re=function(e){L(e)&&K&&(ke(!1),Pe(e),Re())},ne=function(e){return C!==e?e:t.jsx(c,{pl:2,children:t.jsx(Je,{size:25,color:"secondary"})})},N=function(e,n){return tt(e,n)},Ae=function(e){var n=(N(e,i)||"").trim();return f&&(e==null?void 0:e.id)!=="nextbilling"&&n.length>0},ie=[{field:"Refunded",headerName:"",maxWidth:20,align:"right",paddingLeft:"20px",sortable:!1,renderCell:function(e){var n;return t.jsx(c,{children:i&&e!==null&&e!==void 0&&(n=e.row)!==null&&n!==void 0&&n.isRefundedExternally?t.jsx(ge,{color:"action"}):t.jsx(t.Fragment,{})})}},{field:"date",headerName:"Date",flex:f?.4:.2,colSpan:function(e,n,_,He){return Ae(n)?He.current.getVisibleColumns().length:1},renderCell:function(e){return f?t.jsx(it,{params:e,row:e.row,memberId:h,formatDate:et,detailsText:N(e.row,i),openPdfViewer:re,displayInvoiceNumber:ne,navigate:x}):t.jsx(nt,{row:e.row,value:e.value})}},{field:"status",headerName:"Status",flex:f?.3:.2,renderCell:function(e){return t.jsx(c,{color:e.value==="Declined"?"error.dark":null,children:i&&e.value==="Declined"&&e.row.providerTransactionDetail
2s?t.jsx(B,{component:"button",color:"error.dark",onClick:function(_){return _.preventDefault()},children:e.value}):e.value})}}].concat(le(f?[]:[{field:"details",headerName:"Details",flex:.5,renderCell:function(e){return t.jsx(c,{mr:2,sx:{whiteSpace:"normal",wordBreak:"break-word",overflowWrap:"anywhere",lineHeight:1.4},children:N(e==null?void 0:e.row,i)})}}]),[{field:"amount",headerName:"Amount",type:"number",flex:f?.3:.2,align:"left",headerAlign:"left",renderCell:function(e){var n;return t.jsx(c,{children:e!=null&&e.value?(e==null||(n=e.row)===null||n===void 0?void 0:n.status)==="Refund"?"($".concat(parseFloat(e==null?void 0:e.value).toFixed(2),")"):"$"+parseFloat(e==null?void 0:e.value).toFixed(2):""})}},{field:"invoiceNumber",headerName:"Invoice",flex:f?.3:.2,renderCell:function(e){return t.jsx(c,{sx:{cursor:"pointer",color:"secondary.main"},children:L(e==null?void 0:e.value)?t.jsx(B,{component:"button",tabIndex:e.tabIndex,color:"secondary.main",onClick:function(){re(e==null?void 0:e.value)},sx:{cursor:"pointer"},children:ne(e==null?void 0:e.value)}):t.jsx(t.Fragment,{})})}}]),M=l.useRef({Refunded:!1,date:!0,status:!0,amount:!0,invoiceNumber:!0}),Ve=i?ie:ie.filter(function(r){return r.field!=="Refunded"});i&&(M.current=me(me({},M.current),{},{Refunded:!0}));function Qe(r){var e,n;if(r.field==="date"&&r.id!=="nextbilling"&&L((e=r.row)===null||e===void 0?void 0:e.invoiceNumber)){var _=new URLSearchParams(p);x("".concat(r.row.invoiceNumber,"/").concat(r.id,"?").concat(_.toString()),{state:{memberId:h,data:r.row}})}i&&r.field=="status"&&r.formattedValue==="Declined"&&(n=r.row)!==null&&n!==void 0&&n.providerTransactionDetails&&x("".concat(r.id,"/transactionDetails"),{state:{data:r.row.providerTransactionDetails}})}function ae(){P&&I(!1),k&&y(!1),_e(!0),x(".",{state:{}})}return t.jsxs(Ue,{maxWidth:!1,children:[t.jsxs(c,{sx:{top:0,left:0,right:0,zIndex:999},children:[P?t.jsx(se,{severity:"success",action:t.jsx(T,{id:"dismiss-button-success",color:"inherit",size:"small",onClick:function(){return ae()},children:"DISMISS"}),children:t.jsx(ue,{children:"Success! The refund was processed successfully. Banks may take 3-5 days to process the refund."})}):t.jsx(t.Fragment,{}),k?t.jsx(se,{severity:"error",action:t.jsx(T,{color:"inherit",size:"small",onClick:function(){ae()},children:"DISMISS"}),children:t.jsx(ue,{children:w??"Your request failed!"})}):t.jsx(t.Fragment,{})]}),t.jsx(F,{spacing:2,mt:P||k?7:0,children:t.jsx(de,{container:!0,justifyContent:"flex-end",children:t.jsx(de,{children:(o==null?void 0:o.totalCount)!==0?A&&t.jsx(B,{onClick:function(){return A()},color:"secondary.main",sx:{cursor:"pointer"},component:"button",children:t.jsx(ce,{children:"Edit Billing Information"})}):t.jsx(t.Fragment,{})})})}),O?t.jsx(fe,{variant:"rectangular",height:280,width:"auto","data-testid":"skeletonLoader","aria-busy":"true"}):t.jsx(l.Suspense,{fallback:t.jsx(c,{pt:1,children:t.jsx(fe,{variant:"rectangular",height:280,width:"auto","data-testid":"gridLoader"})}),children:t.jsx(c,{pt:1,children:t.jsx(rt,{"aria-label":"transaction-table",rows:R??[],columns:Ve,rowCount:(o==null?void 0:o.totalCount)||0,initialState:{columns:{columnVisibilityModel:M.current}},pageSize:m.pageSize,pagination:!0,paginationMode:"server",paginationModel:m,onPaginationModelChange:function(e){l.startTransition(function(){Ne(e),be({page:e.page.toString(),pageSize:e.pageSize.toString()}),ze()})},pageSizeOptions:[5,10,25,50],hideFooterSelectedRowCount:!0,getRowId:function(e){return e.id},onCellClick:Qe,getRowHeight:function(){return"auto"},autoHeight:!0,columnBuffer:i?5:4,"data-testid":"transaction-table",experimentalFeatures:{ariaV7:!0},sx:{border:"none","& .MuiDataGrid-columnHeaderTitle":{fontWeight:"bold"},"& .MuiDataGrid-row":{minHeight:"52px !important"},"& .MuiDataGrid-cell":{minHeight:"52px !important",display:"flex !important",alignItems:"flex-start !important",padding:f?"12px 8px":"16px"}},slots:{noRowsOverlay:function(){return Fe?t.jsxs(F,{height:"100%",alignItems:"center",justifyContent:"center",direction:"row",children:["We are having trouble retrieving the payment history. Click"," ",t.jsx(T,{variant:"text",onClick:Z,children:"RELOAD"}),"to try again."]}):t.jsx(F,{height:"100%",alignItems:"center",justifyContent:"center",children:"No transactions foun
2d."})}}})})}),i?t.jsxs(c,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap"},children:[t.jsx(ge,{color:"action"}),t.jsx(ce,{sx:{fontSize:"0.875rem"},children:"Â Refund Check/Dispute"})]}):t.jsx(t.Fragment,{})]})};xe.propTypes={isAdmin:ve.bool.isRequired,memberId:ve.string.isRequired};var st=Object.freeze({__proto__:null,default:xe});export{st as P,L as h}; 3//# sourceMappingURL=PaymentListPage-8ea0f075.esm-EyVa4Ohn.js.map
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.