PageSourceSearch

https://workspace.sarv.com/assets/myPlans-C8qtUcPH.js

js sarv.com collected 2026-09-24 19:35:16 UTC 35,387 bytes, 1 lines download raw bytes

1import{r as i,j as e,P as c}from"./react-CRjXmzdu.js";import{ab as at,av as Z,aw as de,D as J,p as G,a as ee,L as be,r as pe,d as it,g as Me,i as $e,ax as Se,ay as rt,az as lt}from"./index-De75rBSf.js";import"./vendor-IdvdfVCJ.js";import{u as te}from"./i18n-89tvej9L.js";import{T as ye}from"./TablePaginationBar-fOBcNDGe.js";import{f as _e,P as je,E as we,c9 as ct,n as Ce,o as ve,p as ke,q,v as Pe,t as F,T as f,bK as le,k as ie,aO as ce,a2 as M,G as O,B as $,s as E,ca as dt,cb as pt,a as ge,aa as xt,_ as ht,cc as ut,bG as gt,cd as ft,ce as mt,cf as Ie,as as Te,aC as Ae,aD as De,b9 as We,I as bt,cg as yt,ch as jt,l as wt,m as Ct,bt as vt}from"./mui-CNr6W-ty.js";import{I as Y}from"./iconify-BNxKwMGw.js";import{d as fe}from"./date-utils-Cj6NCtA4.js";import{u as Fe,e as Ne,a as kt}from"./router-BDpR9Pxq.js";import{b as Pt}from"./redux-Dts5QXDw.js";import{C as St}from"./customModal-05N-qTVU.js";import{d as It}from"./razorpay-ByxvYY9g.js";import{S as me}from"./SecureTextField-DanQiLjW.js";import"./react-query-Cwaq9TKo.js";import"./lodash-CpjO0APP.js";import"./ui-utils-DqNXFlDe.js";import"./http-3ukMoIbY.js";import"./sanitize-RB1-lMRI.js";import"./validation-B8dh9o27.js";import"./emotion-CfcNTy1E.js";import"./firebase-UICncsdF.js";const Tt=new be("myPlansSection"),At=E(F)(({theme:t})=>({background:`linear-gradient(${t.palette.action.hover}, ${t.palette.action.hover}), ${t.palette.background.paper}`,color:t.palette.text.primary,zIndex:3,"&:hover":{color:t.palette.text.primary}}));function Oe({usersList:t=[],count:T,isListLoading:b,page:P,setPage:D,rowsPerPage:L,setRowsPerPage:y,setLoad:w,calcSize:x=201,onRenewPlan:S}){const{t:n}=te(),C=[{id:"product",label:n("console.plans.productName"),minWidth:170},{id:"plan_name",label:n("console.plans.planName"),minWidth:170},{id:"planId",label:"Plan ID",minWidth:220},{id:"storagePerLicenseGb",label:"Storage",minWidth:120,align:"center"},{id:"status",label:n("console.plans.status"),minWidth:130,align:"center"},{id:"purchaseDate",label:"Purchase Date",minWidth:170},{id:"expiryDate",label:n("console.plans.expiryDate"),minWidth:170},{id:"purchased_licenses",label:n("console.plans.licence"),minWidth:90,align:"center"},{id:"left_licenses",label:n("console.plans.licenceLeft"),minWidth:100,align:"center"},...at("plans_action_column")?[{id:"actions",label:n("console.plans.actions"),minWidth:180,align:"center"}]:[]],[I,z]=i.useState(""),[a,m]=i.useState(!1),[g,B]=i.useState(""),[o,l]=i.useState(100),[u,W]=i.useState(""),v=_e(),V=(p,h)=>{D(h),w&&w(!0)},d=p=>{y(Number(p.target.value)),D(0),w&&w(!0)},A=async p=>{try{l(100),B(p),m(!0);const{userPassword:h}=await ee("fetchPassword",{email:p});z(h),J(h),G(n("console.plans.passwordCopied"));const s=setInterval(()=>{l(r=>r<=0?0:r-10)},1e3);W(s)}catch(h){Tt.error(h),pe(h?.message||"Network error!")}finally{m(!1)}},K=(p,h,s,r)=>{let R="default";return s==="active"?R="success":s==="expiring_soon"?R="warning":r?.isExpired&&(R="error"),e.jsxs(ie,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",sx:{width:"100%"},children:[e.jsx(ce,{label:Z(s||"inactive"),color:R,size:"small"}),r?.isExpiringSoon&&!r?.isExpired&&e.jsx(ce,{label:n("console.plans.renewSoon"),size:"small",variant:"outlined",color:"warning"})]})},ne=(p,h,s,r)=>{const R=r?.startedAt||r?.startDate||r?.start_date||s;if(!R)return"--";const{date:xe,time:se}=de(R);return e.jsxs(ie,{spacing:.5,children:[e.jsx(f,{variant:"body2",sx:{fontWeight:600},children:xe}),e.jsx(f,{variant:"caption",color:"text.secondary",children:se})]})},j=(p,h,s,r)=>{if(!s)return"--";const{date:R,time:xe}=de(s);let se="text.secondary";return r?.isExpired?se="error.main":r?.isExpiringSoon&&(se="warning.main"),e.jsxs(ie,{spacing:.5,children:[e.jsx(f,{variant:"body2",sx:{fontWeight:600},children:R}),e.jsx(f,{variant:"caption",color:se,children:xe})]})},N=(p,h,s,r)=>{const R=s||r?.plan_id||"--";return R==="--"?R:e.jsx(M,{title:n("console.plans.checkToCopy"),componentsProps:{tooltip:{sx:{bgcolor:"grey.700"}}},children:e.jsx(f,{variant:"body2",sx:{fontFamily:"monospace",cursor:"pointer"},onClick:()=>{J(R),G("Plan ID copied")},children:R})})},U=(p,h,s,r)=>
1{const R=s??r?.storagePerLicenseGb??r?.storage??r?.limits?.storageGb??r?.left_storage??null;return R==null||R===""?"--":`${R} GB`},H=(p,h,s,r)=>e.jsx(ie,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:r?.showRenewButton&&(r?.isExpired||r?.isExpiringSoon||r?.status==="expiring_soon")?e.jsx(O,{size:"small",variant:"contained",color:"primary",onClick:()=>S?.(r),sx:{backgroundColor:"primary.main",color:"#fff","&:hover":{backgroundColor:"primary.dark"}},children:n("console.plans.renewPlan")}):e.jsx(f,{variant:"body2",color:"text.secondary",children:"--"})}),oe=(p,h,s,r)=>s?e.jsxs($,{sx:{width:"100%",display:"flex",flexDirection:"row",gap:"7px",alignItems:"center",justifyContent:"center"},children:[I&&g===r?.email&&I,e.jsx(M,{title:I&&g===r?.email?n("console.plans.passwordCopiedTooltip"):n("console.plans.copyPassword"),componentsProps:{tooltip:{sx:{bgcolor:"grey.700"}}},children:e.jsx(O,{loading:g===r?.email?a:!1,loadingPosition:"start",size:"small",color:g===r?.email&&I?"success":"primary",sx:{borderRadius:"50%",minWidth:"auto"},onClick:()=>A(r?.email),children:!(g===r?.email&&a)&&e.jsx(Y,{icon:"prime:copy",width:"20px"})})})]}):e.jsx(e.Fragment,{children:"--"}),k=(p,h,s)=>s?e.jsx(M,{title:n("console.plans.signedUpGoogle"),componentsProps:{tooltip:{sx:{bgcolor:"grey.300"}}},children:e.jsx(Y,{icon:"heroicons-solid:shield-check",color:v.palette.primary.main,width:"20px"})}):"--",_=(p,h,s,r)=>s?e.jsxs($,{sx:{width:"100%",display:"flex",flexDirection:"row",gap:"7px",alignItems:"center",justifyContent:"flex-start"},children:[e.jsx(M,{title:n("console.plans.checkToCopy"),componentsProps:{tooltip:{sx:{bgcolor:"grey.700"}}},children:e.jsx(f,{variant:"inherit",onClick:()=>{J(s),G(n("console.plans.mobileNumCopied"))},children:s})}),r?.forceVerify?e.jsx(M,{title:n("console.plans.forcefullyVerify"),componentsProps:{tooltip:{sx:{bgcolor:"grey.300"}}},children:e.jsx(Y,{icon:"mdi:shield",width:"15px",style:{color:v.palette.warning.main}})}):r?.isMobileVerified===1?e.jsx(M,{title:n("console.plans.verifiedLabel"),componentsProps:{tooltip:{sx:{bgcolor:"grey.300"}}},children:e.jsx(Y,{icon:"bitcoin-icons:verify-filled",width:"20px",style:{color:v.palette.success.main}})}):e.jsx(M,{title:n("console.plans.unverifiedLabel"),componentsProps:{tooltip:{sx:{bgcolor:"grey.300"}}},children:e.jsx(Y,{icon:"mdi:cross-circle-outline",width:"15px",style:{color:v.palette.error.main}})})]}):"--",Je=(p,h,s)=>s?e.jsx(M,{title:n("console.plans.checkToCopy"),componentsProps:{tooltip:{sx:{bgcolor:"grey.300"}}},children:e.jsx(f,{variant:"inherit",onClick:()=>{J(s),G(n("console.plans.userIdCopied"))},children:s})}):"--",Ke=(p,h,s,r)=>s?e.jsxs($,{sx:{width:"100%",display:"flex",flexDirection:"row",gap:"7px",alignItems:"center",justifyContent:"flex-start"},children:[e.jsx(M,{title:n("console.plans.checkToCopy"),componentsProps:{tooltip:{sx:{bgcolor:"grey.700"}}},children:e.jsx(f,{variant:"inherit",onClick:()=>{J(s),G(n("console.plans.emailCopied"))},children:s})}),r?.forceVerify?e.jsx(M,{title:n("console.plans.forcefullyVerify"),componentsProps:{tooltip:{sx:{bgcolor:"grey.300"}}},children:e.jsx(Y,{icon:"mdi:shield",width:"15px",style:{color:v.palette.warning.main}})}):r?.isEmailVerified===1?e.jsx(M,{title:n("console.plans.verifiedLabel"),componentsProps:{tooltip:{sx:{bgcolor:"grey.300"}}},children:e.jsx(Y,{icon:"bitcoin-icons:verify-filled",width:"20px",style:{color:v.palette.success.main}})}):e.jsx(M,{title:n("console.plans.unverifiedLabel"),componentsProps:{tooltip:{sx:{bgcolor:"grey.300"}}},children:e.jsx(Y,{icon:"mdi:cross-circle-outline",width:"15px",style:{color:v.palette.error.main}})})]}):"--",Xe=(p,h,s,r)=>s?e.jsx(f,{variant:"body2",children:n("console.plans.manualVerification")}):r?.verified?e.jsx(f,{variant:"body2",children:n("console.plans.selfVerification")}):"--",Qe=(p,h,s)=>e.jsx($,{sx:{width:"100%",display:"flex",flexDirection:"row",gap:"7px",alignItems:"center",justifyContent:"flex-start"},children:e.jsx(M,{title:n("console.plans.checkToCopy"),componentsProps:{tooltip:{sx:{bgcolor:"grey.300"}}},children:e.jsx(f,{variant:"inherit",onClick:()=>{J(s),G(n("console.plans.nameCopied"))},children:Z(s)})})}),Ze=(p,h,s)=>e.jsx($,{sx:{width:"100%",display:"flex",flexDirection:"row",gap:"7px",alignItems:"center",justifyContent:"flex-start"},children:e.jsx(M,{title:n("console.plans.checkToCopy"),componentsProps:{tooltip:{sx:{bgcolor:"grey.300"}}},children:e.jsx(f,{variant:"inherit",onClick:()=>{J(s),G(n("console.plans.userNameCopied"))},children:Z(s)})})}),et=(p,h,s)=>
1Z(s),tt=(p,h,s)=>{const{date:r,time:R}=de(s);return`${r}, ${R}`},nt=(p,h,s)=>e.jsx(M,{title:s==="l4"?"Admin (L4)":"User (L1)",componentsProps:{tooltip:{sx:{bgcolor:"grey.300"}}},children:s==="l4"?"L4":"L1"}),ot=(p,h,s)=>s!==void 0?s:"--",st={name:Qe,userStatus:K,mobile:_,email:Ke,userId:Je,password:oe,isGoogleLogin:k,actions:H,verifiedForcefully:Xe,origin:et,permission:nt,createdAt:tt,userName:Ze,status:K,purchaseDate:ne,expiryDate:j,planId:N,storagePerLicenseGb:U};return i.useEffect(()=>{o||(clearInterval(u),B(""),W(""),z(""))},[o]),e.jsxs(je,{sx:{width:"100%",overflow:"hidden",borderRadius:"0px",boxShadow:"none"},children:[!t.length&&!b?e.jsx(we,{icon:e.jsx(ct,{}),title:n("console.plans.noPlansFound"),description:n("console.plans.noPlansDescription"),sx:{width:"100%",minHeight:260}}):e.jsx(Ce,{sx:{maxHeight:window.innerHeight-x,"&::-webkit-scrollbar":{width:"4px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:v.palette.grey[400],borderRadius:"8px"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:v.palette.grey[600]},scrollbarWidth:"thin",scrollbarColor:`${v.palette.grey[400]} transparent`},children:e.jsxs(ve,{stickyHeader:!0,"aria-label":"sticky table",size:"small",children:[e.jsx(ke,{sx:{backgroundColor:"action.hover",borderTop:"1px solid",borderBottom:"1px solid",borderColor:"divider",wordBreak:"keep-all",whiteSpace:"nowrap"},children:e.jsx(q,{children:C.map(p=>e.jsx(At,{align:p.align,style:{minWidth:p.minWidth},sx:{background:`linear-gradient(${v.palette.action.hover}, ${v.palette.action.hover}), ${v.palette.background.paper} !important`,zIndex:"3 !important"},children:p.label},p.id))})}),e.jsxs(Pe,{children:[!b&&!!t.length&&t.map(p=>e.jsx(q,{hover:!0,role:"checkbox",tabIndex:-1,children:C.map(h=>{const{id:s}=h,r=p[s];return e.jsx(F,{align:h.align,sx:{color:"grey.700",fontWeight:500},children:h.format&&typeof r=="number"?h.format(r):(st?.[s]||ot)(s,h?.align,p[s],p)},s)})},p.code)),b&&e.jsxs(e.Fragment,{children:[e.jsx(q,{hover:!0,role:"checkbox",tabIndex:-1,children:C.map(p=>{const{id:h}=p;return e.jsx(F,{align:p.align,sx:{color:"grey.300",fontWeight:500},children:e.jsx(f,{component:"div",variant:"body1",sx:{maxWidth:"70%"},children:e.jsx(le,{})},"body1")},h)})}),e.jsx(q,{hover:!0,role:"checkbox",tabIndex:-1,children:C.map(p=>{const{id:h}=p;return e.jsx(F,{align:p.align,sx:{color:"grey.300",fontWeight:500},children:e.jsx(f,{component:"div",variant:"body1",sx:{maxWidth:"70%"},children:e.jsx(le,{})},"body1")},h)})})]})]})]})}),t.length>0&&e.jsx(ye,{count:T,page:P,rowsPerPage:L,onPageChange:V,onRowsPerPageChange:d})]})}Oe.propTypes={usersList:c.array,count:c.number,isListLoading:c.bool,page:c.number,setPage:c.func,rowsPerPage:c.number,setRowsPerPage:c.func,setLoad:c.func,calcSize:c.number,onRenewPlan:c.func};const Dt=E(F)(({theme:t})=>({background:`linear-gradient(${t.palette.action.hover}, ${t.palette.action.hover}), ${t.palette.background.paper}`,color:t.palette.text.primary,zIndex:3,"&:hover":{color:t.palette.text.primary}})),Re=[{id:"plan_name",label:"Addon Name",minWidth:170},{id:"addon_type",label:"Type",minWidth:120},{id:"storage_capacity",label:"Total Capacity",minWidth:120},{id:"available_capacity",label:"Available Capacity",minWidth:120},{id:"purchaseDate",label:"Purchase Date",minWidth:170}];function He({addonsList:t=[],count:T,isListLoading:b,page:P,setPage:D,rowsPerPage:L,setRowsPerPage:y,setLoad:w,calcSize:x=201}){const{t:S}=te(),n=(a,m)=>{D(m),w&&w(!0)},C=a=>{y(Number(a.target.value)),D(0),w&&w(!0)},I=(a,m="")=>e.jsxs(f,{variant:"inherit",children:[a," ",m]}),z=a=>{const m=a?.startedAt||a?.startDate||a?.start_date;if(!m)return e.jsx(f,{variant:"inherit",children:"--"});const{date:g,time:B}=de(m);return e.jsxs(ie,{spacing:.5,children:[e.jsx(f,{variant:"body2",sx:{fontWeight:600},children:g}),e.jsx(f,{variant:"caption",color:"text.secondary",children:B})]})};return e.jsxs(je,{sx:{width:"100%",overflow:"hidden",borderRadius:"0px",boxShadow:"none"},children:[!t.length&&!b?e.jsx(we,{icon:e.jsx(dt,{}),title:S("console.plans.noAddonsFound"),description:S("console.plans.noAddonsDescription"),sx:{width:"100%",minHeight:260}}):e.jsx(Ce,{sx:a=>({maxHeight:window.innerHeight-x,"&::-webkit-scrollbar":{width:"4px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:a.palette.grey[400],borderRadius:"8px"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:a.palette.grey[600]},scrollbarWidth:"thin",scrollbarColor:`${a.palette.grey[400]} transparent`}),children:e.jsxs(ve,{stickyHeader:!0,"aria-label":"sticky table",size:"small",children:[e.jsx(ke,{sx:{backgroundColor:"action.hover",borderTop:"1px solid",borderBottom:"1px solid",borderColor:"divider",wordBreak:"keep-all",whiteSpace:"nowrap"},children:e.jsx(q,{children:Re.map(a=>
1e.jsx(Dt,{align:a.align,style:{minWidth:a.minWidth},children:a.label},a.id))})}),e.jsxs(Pe,{children:[!b&&!!t.length&&t.map((a,m)=>{const g=a.limits?.unit||"";return e.jsxs(q,{hover:!0,role:"checkbox",tabIndex:-1,children:[e.jsx(F,{sx:{color:"grey.700",fontWeight:500},children:e.jsx(f,{variant:"inherit",children:a.plan_name||"--"})}),e.jsx(F,{sx:{color:"grey.700",fontWeight:500},children:e.jsx(f,{variant:"inherit",sx:{textTransform:"capitalize"},children:a.addon_type||"--"})}),e.jsx(F,{sx:{color:"grey.700",fontWeight:500},children:I(a.storage,g)}),e.jsx(F,{sx:{color:"grey.700",fontWeight:500},children:I(a.left_storage,g)}),e.jsx(F,{sx:{color:"grey.700",fontWeight:500},children:z(a)})]},a.id||m)}),b&&e.jsx(e.Fragment,{children:[...Array(2)].map((a,m)=>e.jsx(q,{hover:!0,role:"checkbox",tabIndex:-1,children:Re.map(g=>e.jsx(F,{align:g.align,sx:{color:"grey.300",fontWeight:500},children:e.jsx(f,{component:"div",variant:"body1",sx:{maxWidth:"70%"},children:e.jsx(le,{})},"body1")},g.id))},`skeleton-${m}`))})]})]})}),t.length>0&&e.jsx(ye,{count:T||t.length,page:P,rowsPerPage:L,onPageChange:n,onRowsPerPageChange:C})]})}He.propTypes={addonsList:c.array,count:c.number,isListLoading:c.bool,page:c.number,setPage:c.func,rowsPerPage:c.number,setRowsPerPage:c.func,setLoad:c.func,calcSize:c.number};const Wt=E("div")(({theme:t})=>({position:"relative",borderRadius:"8px",backgroundColor:ge(t.palette.grey[600],.15),"&:hover":{backgroundColor:ge(t.palette.grey[500],.25)},marginLeft:0,width:"100%",[t.breakpoints.up("sm")]:{width:"auto"}})),Rt=E("div")(({theme:t})=>({padding:t.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"})),Lt=E(xt)(({theme:t})=>({color:t.palette.grey[700],"& .MuiInputBase-input":{padding:t.spacing(1,1,1,0),paddingLeft:`calc(1em + ${t.spacing(4)})`,transition:t.transitions.create("width"),width:"100%",[t.breakpoints.up("md")]:{width:"20ch"}}})),qe=({text:t,...T})=>e.jsxs(Wt,{children:[e.jsx(Rt,{children:e.jsx(pt,{sx:{color:"grey.500"}})}),e.jsx(Lt,{placeholder:t,inputProps:{"aria-label":"search"},...T})]});qe.propTypes={text:c.string};const zt=t=>({type:"UPDATE_BALANCE",payload:t}),he=new be("AddAmountModal"),Ue=({open:t,setOpen:T,fetchTransActionsList:b})=>{const{t:P}=te(),[D,L]=i.useState(null),[y,w]=i.useState(!1),x=Fe(),[S]=Ne(),n=Pt(),C=S.get("order_id"),I=i.useCallback(async()=>{try{const{balance:o}=await ee("fetchWalletBalance");n(zt(parseFloat(o))),b()}catch(o){he.error(o)}},[n,b]),z=()=>{T(!1),x("/settings?tab=transactions",{replace:!0})},a=i.useCallback(async o=>{try{const{message:l}=await it("verifyPayment",o);G(l),I(),x("/settings?tab=transactions",{replace:!0})}catch(l){he.error(l)}},[I,x]),m=i.useCallback(async o=>{try{w(!0),await It({order:{id:o}},a),w(!1),T(!1)}catch(l){he.error(l)}},[a,T]),g=i.useCallback(async()=>{if(!Me("addWalletAmount",3,6e4)){const l=$e("addWalletAmount");pe(P("console.wallet.tooManyAttempts",{time:l}));return}w(!0);const{order:{id:o}}=await ee("createOrder",{amount:D});x(`/settings?tab=transactions&order_id=${o}`)},[D,x,P]);i.useEffect(()=>{C&&m(C)},[C,m]);const B=e.jsxs($,{sx:{mt:1,display:"flex",flexDirection:"column",gap:"10px",padding:"20px"},children:[e.jsxs($,{sx:{display:"flex",gap:"6px",flexDirection:"column"},children:[e.jsx(f,{sx:{fontSize:"14px",color:"grey.400"},children:P("console.wallet.addMoneyToWallet")}),e.jsx(me,{id:"addAmmount",placeholder:P("console.wallet.enterAmount"),type:"number",InputProps:{startAdornment:e.jsx(ht,{position:"start",children:e.jsx(ut,{})})},size:"small",fullWidth:!0,value:D,onChange:o=>L(o.target.value),sanitize:!0,validate:!0,maxLength:10})]}),e.jsxs($,{sx:{display:"flex",gap:"6px",flexDirection:"row"},children:[e.jsx(O,{variant:"outlined",size:"small",onClick:()=>L(o=>Number(o)+1e3),children:"+ 1000"}),e.jsx(O,{variant:"outlined",size:"small",onClick:()=>L(o=>Number(o)+3e3),children:"+ 3000"}),e.jsx(O,{variant:"outlined",size:"small",onClick:()=>L(o=>Number(o)+5e3),children:"+ 5000"})]}),e.jsx($,{sx:{display:"flex",flexDirection:"row",mt:"20px",justifyContent:"center"},children:e.jsx(O,{variant:"contained",sx:{boxShadow:"none",minWidth:"180px"},disabled:!D,loading:y,onClick:()=>g(),children:P("console.wallet.continue")})})]});return e.jsx(St,{open:t,title:P("console.wallet.addAmount"),description:B,close:()=>z()})};
1Ue.propTypes={open:c.bool,setOpen:c.func,fetchTransActionsList:c.func};const ue=E("div")(()=>({display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"10px",width:"100%"})),X=E("div")(()=>({display:"flex",flexDirection:"column",width:"calc(100%/2 - 5px)",gap:"5px"})),Q=E(f)(({theme:t})=>({fontSize:"14px",fontWeight:500,color:t.palette.grey[600]})),re={"& .MuiInputBase-input":{fontSize:"14px"}},Le={...re,"& .MuiPickersSectionList-root, & .MuiPickersInputBase-sectionsContainer":{fontSize:"14px",fontFamily:"inherit"},"& .MuiPickersSectionList-sectionContent, & .MuiPickersInputBase-sectionContent":{fontSize:"14px",fontFamily:"inherit"}},Bt=38,Et=8,ze={PaperProps:{style:{maxHeight:Bt*4.5+Et,width:"auto"}}};function Be(t,T,b){return{fontWeight:T.indexOf(t)===-1?b.typography.fontWeightRegular:b.typography.fontWeightMedium}}const Ge=({anchorEl:t,open:T,handleClose:b,reset:P,apply:D,isFilterApplied:L})=>{const{t:y}=te(),w=_e(),[x,S]=i.useState(null),[n,C]=i.useState(null),[I,z]=i.useState(null),[a,m]=i.useState(null),[g,B]=i.useState([]),[o,l]=i.useState([]),u=d=>{const{target:{value:A}}=d;B(typeof A=="string"?A.split(","):A)},W=d=>{const{target:{value:A}}=d;l(A)};i.useEffect(()=>{L||(S(null),C(null),z(""),m(""),B([]),l([]))},[L]);const v=()=>{S(null),C(null),z(""),m(""),B([]),l([]),P()},V=()=>{if(!Me("walletFilter",5,6e4)){const A=$e("walletFilter");pe(y("console.wallet.tooManyFilterAttempts",{time:A}));return}const d={paymentId:a,orderId:I,status:g,method:o};x&&(d.from=Number(new Date(x))),n&&(d.to=Number(new Date(n))),D(d),b()};return e.jsx(gt,{id:"filter-button",anchorEl:t,open:T,onClose:b,MenuListProps:{"aria-labelledby":"filter-button"},children:e.jsxs($,{sx:{display:"flex",flexDirection:"column",padding:"20px",gap:"15px"},children:[e.jsx(ft,{dateAdapter:mt,children:e.jsxs(ue,{children:[e.jsxs(X,{children:[e.jsx(Q,{children:y("console.wallet.from")}),e.jsx(Ie,{format:"DD/MM/YY",slotProps:{textField:{size:"small",sx:Le}},value:x,onChange:d=>S(d),maxDate:n||void 0})]}),e.jsxs(X,{children:[e.jsx(Q,{children:y("console.wallet.to")}),e.jsx(Ie,{format:"DD/MM/YY",slotProps:{textField:{size:"small",sx:Le}},value:n,onChange:d=>C(d),minDate:x||void 0})]})]})}),e.jsxs(ue,{children:[e.jsxs(X,{children:[e.jsx(Q,{children:y("console.wallet.orderIdLabel")}),e.jsx(me,{size:"small",type:"text",placeholder:y("console.wallet.enterOrderId"),value:I,onChange:d=>z(d.target.value),sanitize:!0,validate:!0,maxLength:100,securityOptions:{checkCommand:!1},sx:re})]}),e.jsxs(X,{children:[e.jsx(Q,{children:y("console.wallet.paymentIdLabel")}),e.jsx(me,{size:"small",type:"text",placeholder:y("console.wallet.enterPaymentId"),value:a,onChange:d=>m(d.target.value),sanitize:!0,validate:!0,maxLength:100,securityOptions:{checkCommand:!1},sx:re})]})]}),e.jsxs(ue,{children:[e.jsxs(X,{children:[e.jsx(Q,{children:y("console.wallet.status")}),e.jsx(Te,{children:e.jsx(Ae,{id:"demo-multiple-chip",multiple:!0,size:"small",value:g,onChange:u,sx:re,displayEmpty:!0,input:e.jsx(We,{id:"select-multiple-chip"}),renderValue:d=>d.length===0?e.jsx(f,{sx:{fontSize:"14px",color:"text.disabled"},children:"Select Status"}):e.jsx($,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:d.map(A=>e.jsx(ce,{label:A.charAt(0).toUpperCase()+A.slice(1)},A))}),MenuProps:ze,children:["captured","failed"].map(d=>e.jsx(De,{value:d,style:Be(d,g,w),children:d.charAt(0).toUpperCase()+d.slice(1)},d))})})]}),e.jsxs(X,{children:[e.jsx(Q,{children:y("console.wallet.method")}),e.jsx(Te,{children:e.jsx(Ae,{id:"demo-multiple-chip",multiple:!0,size:"small",value:o,onChange:W,sx:re,displayEmpty:!0,input:e.jsx(We,{id:"select-multiple-chip"}),renderValue:d=>d.length===0?e.jsx(f,{sx:{fontSize:"14px",color:"text.disabled"},children:"Select Method"}):e.jsx($,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:d.map(A=>e.jsx(ce,{label:A.charAt(0).toUpperCase()+A.slice(1)},A))}),MenuProps:ze,children:["card","netbanking","wallet","emi","upi"].map(d=>e.jsx(De,{value:d,style:Be(d,g,w),children:d.charAt(0).toUpperCase()+d.slice(1)},d))})})]})]}),e.jsxs($,{sx:{display:"flex",width:"100%",justifyContent:"flex-end",gap:"8px",mt:"10px"},children:[e.jsx(O,{variant:"contained",color:"primary",sx:{boxShadow:"none"},onClick:()=>V(),children:y("console.wallet.apply")}),e.jsx(O,{variant:"outlined",color:"warning",sx:{boxShadow:"none"},onClick:()=>v(),children:y("console.wallet.resetFilters")}),e.jsx(O,{variant:"outlined",sx:{boxShadow:"none"},onClick:()=>b(),children:y("console.wallet.close")})]})]})})};Ge.propTypes={anchorEl:c.object,open:c.bool.isRequired,handleClose:c.func.isRequired,reset:c.func.isRequired,apply:c.func.isRequired,isFilterApplied:c.bool.isRequired};const Mt=E("div")(({theme:t})=>({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",[t.breakpoints.down("sm")]:{flexWrap:"nowrap",gap:"8px"}})),Ve=({findForSearchQuery:t,apply:T,reset:b,search:P,isFilterApplied:D,filterData:L,setFilterData:y,fetchTransActionsList:w})=>{const[x,S]=i.useState(""),[n,C]=i.useState(null),[I,z]=i.useState(!1),a=!!n,[m]=Ne(),g=l=>{l.key==="Enter"&&t(x)},B=l=>{C(l.currentTarget)},o=()=>{C(null)};return i.useEffect(()=>{S(P)},[P]),i.useEffect(()=>{m.get("payment")&&z(!0)},[m]),e.jsxs(Mt,{children:[e.jsx($,{sx:{flex:{xs:"1 1 auto",sm:"0 1 auto"},minWidth:0,"& .MuiInputBase-input":{py:"6px"}},children:e.jsx(qe,{text:"Search Transactions...",value:x,onChange:l=>S(l.target.value),onKeyDown:g})}),e.jsx(O,{variant:"contained",color:"primary",sx:{flexShrink:0,boxShadow:"none",px:2,textTransform:"none",fontSize:"13px"},onClick:()=>t(x),children:"Search"}
1),e.jsx(O,{variant:"outlined",sx:{display:{xs:"none",sm:"inline-flex"},boxShadow:"none",px:2,fontSize:"13px",textTransform:"capitalize"},id:"filter-button","aria-controls":a?"filter-button":void 0,"aria-haspopup":"true","aria-expanded":a?"true":void 0,onClick:B,children:"filters"}),e.jsx(bt,{"aria-label":"filters",sx:{display:{xs:"inline-flex",sm:"none"},flexShrink:0,border:"1px solid",borderColor:"divider",borderRadius:"8px"},id:"filter-button-mobile","aria-controls":a?"filter-button-mobile":void 0,"aria-haspopup":"true","aria-expanded":a?"true":void 0,onClick:B,children:e.jsx(yt,{fontSize:"small"})}),e.jsx(Ge,{anchorEl:n,open:a,handleClose:o,reset:b,apply:T,isFilterApplied:D,filterData:L,setFilterData:y}),e.jsx(Ue,{open:I,setOpen:z,fetchTransActionsList:w})]})};Ve.propTypes={findForSearchQuery:c.func.isRequired,apply:c.func.isRequired,reset:c.func.isRequired,search:c.string.isRequired,isFilterApplied:c.bool.isRequired,filterData:c.object.isRequired,setFilterData:c.func.isRequired,fetchTransActionsList:c.func.isRequired};const $t=E(F)(({theme:t})=>({background:`linear-gradient(${t.palette.action.hover}, ${t.palette.action.hover}), ${t.palette.background.paper}`,color:t.palette.text.primary,zIndex:3,height:"40px",padding:"0 16px",whiteSpace:"nowrap",wordBreak:"keep-all",borderBottom:`1px solid ${t.palette.divider}`,"&:hover":{color:t.palette.text.primary},[t.breakpoints.down("sm")]:{padding:"0 12px"}}));function Ye({usersList:t=[],count:T,isListLoading:b,page:P,setPage:D,rowsPerPage:L,setRowsPerPage:y,setLoad:w}){const{t:x}=te(),S=[{id:"orderId",label:x("console.wallet.orderId"),width:"14%",align:"left"},{id:"paymentId",label:x("console.wallet.paymentId"),width:"14%",align:"left"},{id:"amount",label:x("console.wallet.amount"),width:"14%",align:"left"},{id:"currency",label:x("console.wallet.currency"),width:"14%",align:"left"},{id:"status",label:x("console.wallet.status"),width:"14%",align:"left"},{id:"method",label:x("console.wallet.method"),width:"14%",align:"left"},{id:"createdAt",label:x("console.wallet.createdAt"),width:"14%",align:"left"}],n=(o,l)=>{D(l),w(!0)},C=o=>{y(Number(o.target.value)),D(0),w(!0)},I=(o,l,u)=>e.jsx($,{sx:{width:"100%",display:"flex",flexDirection:"row",gap:"7px",alignItems:"center",justifyContent:"flex-start"},children:e.jsx(f,{variant:"inherit",children:Z(u)})}),z=(o,l,u)=>e.jsx($,{sx:{width:"100%",display:"flex",flexDirection:"row",gap:"7px",alignItems:"center",justifyContent:"flex-start"},children:e.jsx(f,{variant:"inherit",children:u==="upi"?"UPI":Z(u)})}),a=(o,l,u)=>u?e.jsx(M,{title:x("console.wallet.checkToCopy"),componentsProps:{tooltip:{sx:{bgcolor:"grey.300"}}},children:e.jsx(f,{variant:"inherit",onClick:()=>{J(u),G(x("console.wallet.emailCopied"))},children:u})}):"--",m=(o,l,u)=>{const W=fe(u).format("DD/MM/YY"),v=fe(u).format("h:mm a");return`${W}, ${v}`},g=(o,l,u)=>u!==void 0?u:"--",B={email:a,createdAt:m,status:I,method:z};return e.jsxs(je,{sx:{width:"100%",overflow:"hidden",borderRadius:"8px",border:"1px solid",borderColor:"divider",display:"flex",flexDirection:"column",boxShadow:"none"},children:[!b&&!t.length?e.jsx(we,{icon:e.jsx(jt,{}),title:x("console.wallet.noMoreData"),description:x("console.wallet.noTransactionsDescription"),sx:{width:"100%",minHeight:260}}):e.jsx(Ce,{sx:{maxHeight:window.innerHeight-340,overflowX:"auto"},children:e.jsxs(ve,{stickyHeader:!0,"aria-label":"sticky table",size:"small",children:[e.jsx(ke,{children:e.jsx(q,{sx:{height:"40px"},children:S.map(o=>e.jsx($t,{align:o.align,style:{width:o.width},sx:l=>({borderBottom:`1px solid ${l.palette.divider} !important`,background:`linear-gradient(${l.palette.action.hover}, ${l.palette.action.hover}), ${l.palette.background.paper} !important`,zIndex:"3 !important"}),children:o.label},o.id))})}),e.jsxs(Pe,{children:[!b&&!!t.length&&t.map((o,l)=>e.jsx(q,{hover:!0,role:"checkbox",tabIndex:-1,sx:u=>({height:"39px",backgroundColor:l%2!==0?ge(u.palette.grey[500],.06):"transparent"}),children:S.map(u=>{const{id:W}=u,v=o[W];return e.jsx(F,{align:u.align,sx:{color:"grey.600",fontWeight:500,borderBottom:"1px solid",borderColor:"divider",wordBreak:"keep-all",whiteSpace:"nowrap"},children:u.format&&typeof v=="number"?u.format(v):(B?.[W]||g)(W,u?.align,o[W],o,l)},W)})},o.code)),b&&e.jsxs(e.Fragment,{children:[e.jsx(q,{hover:!0,role:"checkbox",tabIndex:-1,sx:{height:"39px"},children:S.map(o=>{const{id:l}=o;return e.jsx(F,{align:o.align,sx:{color:"grey.300",fontWeight:500},children:e.jsx(f,{component:"div",variant:"body1",sx:{maxWidth:"70%"},children:e.jsx(le,{})},"body1")},l)})}),e.jsx(q,{hover:!0,role:"checkbox",tabIndex:-1,sx:{height:"39px",backgroundColor:"grey.200"},children:S.map(o=>{const{id:l}=o;return e.jsx(F,{align:o.align,sx:{color:"grey.300",fontWeight:500},children:e.jsx(f,{component:"div",variant:"body1",sx:{maxWidth:"70%"},children:e.jsx(le,{})},"body1")},l)})})]})]})]})}),t?.length>0&&e.jsx(ye,{count:T,page:P,rowsPerPage:L,onPageChange:n,onRowsPerPageChange:C})]})}Ye.propTypes={usersList:c.array,count:c.number.isRequired,isListLoading:c.bool.isRequired,page:c.number.isRequired,setPage:c.func.isRequired,rowsPerPage:c.number.isRequired,setRowsPerPage:c.func.isRequired,setLoad:c.func.isRequired};const _t=E("div")(({theme:t})=>({backgroundColor:t.palette.background.default,display:"flex",justifyContent:"flex-start",alignItems:"center",flexDirection:"column",height:"100%",overflowY:"scroll",overflow:"hidden",[t.breakpoints.down("sm")]:{height:"auto"}})),Ft=E("div")(({theme:t})=>({height:"auto",maxHeight:"calc(100%)",display:"flex",flexDirection:"column",overflow:"hidden",
1width:"100%",[t.breakpoints.down("sm")]:{width:"100%"}})),Nt=E("div")(({theme:t})=>({display:"flex",flexDirection:"column",gap:"10px",padding:"5px 5px 20px 5px",[t.breakpoints.down("sm")]:{alignItems:"flex-start"}})),Ot=E("div")(({theme:t})=>({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",[t.breakpoints.down("sm")]:{flexDirection:"column",alignItems:"flex-start",gap:"10px",flexWrap:"wrap"}})),Ht=E(f)(({theme:t})=>({color:t.palette.grey[700],fontSize:"20px",fontWeight:600})),qt=()=>{const{t}=te(),[T,b]=i.useState(0),[P,D]=i.useState(25),[L,y]=i.useState([]),[w,x]=i.useState(!1),[S,n]=i.useState(0),[C,I]=i.useState([]),[z,a]=i.useState(!1),[m,g]=i.useState(""),[B,o]=i.useState(!1),[l,u]=i.useState({email:"",mobile:"",userId:"",status:null,type:null,permissions:null,from:null,to:null}),W=i.useCallback(async()=>{try{x(!0);const N={skip:P*T,limit:P,...l};m&&(N.search=m);const{count:U=0,result:H=[]}=await ee("getTransactionsList",N)||{};y(H),n(U)}catch(j){pe(j?.message||"Network error!")}finally{x(!1)}},[T,P,l,m]),v=j=>{if(g(j),j?.trim()){b(0),a(!0),C.includes("search")||I([{key:"search",value:j}]),o(!1);return}const N=C.filter(U=>U?.key!=="search");I([...N]),y([]),o(!1),b(0),a(!0)};i.useEffect(()=>{z&&(W(),a(!1))},[z,W]);const V=()=>{I([]),g(""),u({status:null,method:null,orderId:"",paymentId:"",from:null,to:null}),o(!1),a(!0)};i.useEffect(()=>{W()},[W]);const d={orderId:"OrderId",paymentId:"PaymentIUd",status:"Status",method:"Method",from:"From",to:"To"},A=j=>["From","To"].includes(j?.key)?fe(j?.value).format("DD/MM/YY"):j?.value,K=j=>{y([]),g(""),o(!0);const N=[];Object.keys(j).forEach(H=>{["status","method"].includes(H)?(j[H]||[]).forEach(oe=>{N.push({key:d[H],value:oe})}):j[H]&&N.push({key:d[H],value:j[H]})}),I(N);const U=JSON.parse(JSON.stringify(j));u(U),b(0),a(!0)},ne=()=>{V()};return e.jsx(_t,{children:e.jsxs(Ft,{children:[e.jsxs(Nt,{children:[e.jsxs(Ot,{children:[e.jsx(Ht,{children:t("console.wallet.transactionHistory")}),e.jsx(Ve,{findForSearchQuery:v,fetchTransActionsList:W,apply:K,reset:ne,search:m,isFilterApplied:B,filterData:l,setFilterData:u})]}),!!C.length&&e.jsxs($,{sx:{display:"flex",flexDirection:"row",gap:"6px",alignItems:"center",flexWrap:"wrap"},children:[C.map(j=>e.jsx(M,{title:A(j),children:e.jsx(ce,{label:A(j)||j?.key,variant:"outlined",size:"small"})},`filter-${j.key}-${j.value}`)),e.jsx(O,{variant:"outlined",size:"small",color:"warning",onClick:()=>V(),children:t("console.wallet.clearFilter")})]})]}),e.jsx(Ye,{page:T,setPage:b,rowsPerPage:P,setRowsPerPage:D,setLoad:a,usersList:L,count:S,isListLoading:w,fetchTransActionsList:W})]})})},Ee=new be("myPlans"),ae=[{key:"licenses",label:"Licenses"},...rt?[{key:"addons",label:"Add-ons"}]:[],...lt?[{key:"transactions",label:"Transactions"}]:[]],Ut=E("div")(({theme:t})=>({backgroundColor:t.palette.background.default,display:"flex",alignItems:"center",flexDirection:"column",padding:"62px 0px 12px 82px",height:"100%",overflowY:"scroll","&::-webkit-scrollbar":{width:"4px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:t.palette.grey[400],borderRadius:"8px"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:t.palette.grey[600]},scrollbarWidth:"thin",scrollbarColor:`${t.palette.grey[400]} transparent`,[t.breakpoints.down("sm")]:{padding:"62px 14px 14px 14px",height:"100%"}})),Gt=E("div")(({theme:t})=>({height:"auto",maxHeight:"calc(100%)",display:"flex",flexDirection:"column",borderRadius:"6px",border:"1px solid",overflow:"hidden",backgroundColor:t.palette.card.main,borderColor:t.palette.grey[300],alignSelf:"stretch",[t.breakpoints.down("sm")]:{alignSelf:"stretch",maxHeight:"none",flexShrink:0}})),Vt=E("div")(({theme:t})=>({display:"flex",flexDirection:"row",alignItems:"center",padding:"12px",justifyContent:"space-between",[t.breakpoints.down("sm")]:{gap:"8px",padding:"8px"}})),Yt=E("div")(()=>({})),mn=()=>{const[t,T]=i.useState([]),[b,P]=i.useState([]),[D,L]=i.useState(!1),[y,w]=i.useState(!1),x=Fe(),S=kt(),[n,C]=i.useState(()=>S.state?.activeTab??0),[I,z]=i.useState(0),[a,m]=i.useState(0),[g,B]=i.useState(25),[o,l]=i.useState(0),[u,W]=i.useState(0),[v,V]=i.useState(25);i.useEffect(()=>{const k=document.body.style.overflow,_=document.documentElement.style.overflow;return document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",()=>{document.body.style.overflow=k,document.documentElement.style.overflow=_}},[]);const d=(k,_)=>{C(_)},A=i.useCallback(async()=>
1{try{L(!0);const{data:k=[],count:_=0}=await ee("assignedPlanDetails",{from:a*g,size:g})||{};T(k),z(_)}catch(k){Ee.error(k)}finally{L(!1)}},[a,g]),K=i.useCallback(async()=>{try{w(!0);const k=await ee("fetchAssignedAddonPlans",{from:u*v})||{},_=k?.data||k?.addon||k?.addons||[];P(Array.isArray(_)?_:[]),l(k?.count??(Array.isArray(_)?_.length:0))}catch(k){Ee.error(k)}finally{w(!1)}},[u,v]);i.useEffect(()=>{A()},[A]),i.useEffect(()=>{ae[n]?.key==="addons"&&K()},[n,K]);const ne=!1,j="outlined";let N="primary";ne?.isExpired&&(N="error");const U=k=>{const _=k?.subId||k?.sub_id||k?.planId||k?.plan_id;_&&x(`/checkout?renewPlanId=${encodeURIComponent(_)}`,{state:{from:`${S.pathname}${S.search}`}})},H=()=>{x("/plans")},oe=t?.length===0&&b?.length===0&&D===!1&&y===!1;return e.jsx(Ut,{children:e.jsxs(Gt,{children:[e.jsxs(Vt,{sx:{pb:0},children:[e.jsx(wt,{value:n,onChange:d,variant:"scrollable",scrollButtons:"auto",sx:{backgroundColor:k=>k.palette.background.default},children:ae.map(k=>e.jsx(Ct,{label:k.label},k.key))}),Se&&e.jsx(O,{variant:j,color:N,sx:{mb:1,fontWeight:700,minWidth:"148px"},onClick:H,children:"Upgrade Now"})]}),e.jsxs(Yt,{children:[ae[n]?.key==="licenses"&&(oe?e.jsxs(vt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2,py:6},children:[e.jsx(f,{variant:"body2",sx:{fontWeight:600,textAlign:"center",padding:"0 12px"},children:"No plans or add-ons found. Please upgrade your plan to access more features."}),Se&&e.jsx(O,{variant:j,color:N,sx:{fontWeight:700,minWidth:"148px"},onClick:H,children:"Upgrade Now"})]}):e.jsx(Oe,{usersList:t,count:I,isListLoading:D,rowsPerPage:g,setRowsPerPage:B,page:a,setPage:m,onRenewPlan:U})),ae[n]?.key==="addons"&&e.jsx(He,{addonsList:b,count:o,isListLoading:y,rowsPerPage:v,setRowsPerPage:V,page:u,setPage:W}),ae[n]?.key==="transactions"&&e.jsx(qt,{})]})]})})};export{mn 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.