1"use strict";(globalThis.webpackChunkplatform_homnifi_com||=[]).push([[6277],{86277(e,t,a){a.r(t),a.d(t,{default:()=>T});var l=a(65043),s=a(65335),r=a(59868),i=a(39928),n=a(9320),o=a(73686),d=a(44928),c=a(61699),x=a(20494),m=a(63045),u=a(78173),f=a(46636),h=a(70579);const p=()=>{const e={limit:10,page:1,timeperiod:"alltime",type:"all"},{getMyFriendsHistory:t}=(0,r.a)(),{allHistory:a,getMyFriendsHistoryLoading:s}=(0,o.d4)(u.Ik),[i,n]=(0,l.useState)("");return(0,l.useEffect)(()=>{t({page:1,limit:10,query:i,fromDate:null===e||void 0===e?void 0:e.fromDate,toDate:null===e||void 0===e?void 0:e.toDate})},[i,e]),(0,l.useEffect)(()=>{t({page:1,limit:10})},[]),(0,h.jsx)(d.A,{className:"col-span-12 p-5",children:(0,h.jsxs)("section",{className:"flex flex-col items-start justify-between gap-4",children:[(0,h.jsx)("h2",{className:"font-semibold text-sm text-primaryDark",children:"All History"}),(0,h.jsx)(x.A,{rows:a?a.list.map((e,t)=>{var a,l,s,r;return{user:(0,h.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,h.jsx)("div",{className:"relative flex ",children:(0,h.jsx)(c.A,{children:null!==e&&void 0!==e&&null!==(a=e.fromUser)&&void 0!==a&&a.profilePicture?(0,h.jsx)("img",{src:null===e||void 0===e||null===(l=e.fromUser)||void 0===l?void 0:l.profilePicture,alt:"profilePicture",className:"w-4 h-4"}):(0,h.jsx)(m.ny,{className:"w-4 h-4"})})}),(0,h.jsxs)("div",{className:"flex flex-col items-start justify-center",children:[(0,h.jsxs)("p",{className:"text-sm font- text-cardPrimaryText",children:[e.fromUser.firstName||"",e.fromUser.lastName||""]}),(0,h.jsx)("p",{className:"text-xs font-normal text-gray-500 ",children:e.fromUser.email})]})]},t),totalMachines:(0,h.jsxs)("p",{className:"text-xs font-normal text-cardPrimaryText",children:[" ",e.totalMachines]}),totalRewards:(0,h.jsxs)("p",{className:"text-xs font-normal text-cardPrimaryText",children:[e.totalTokenAmount," ",e.token.name]}),joinedDate:(0,h.jsx)("p",{className:"text-xs font-normal text-cardPrimaryText",children:null!==e&&void 0!==e&&e.fromUser.joinedDate?(0,f.A)(null===e||void 0===e||null===(s=e.fromUser)||void 0===s?void 0:s.joinedDate):(0,f.A)(null===e||void 0===e||null===(r=e.fromUser)||void 0===r?void 0:r.createdAt)})}}):[],headCells:[{id:"user",label:"User",dataClass:"w-[25%]"},{id:"totalMachines",label:"Total Machines",dataClass:"w-[25%]"},{id:"totalRewards",label:"Total Rewards",dataClass:"w-[25%]"},{id:"joinedDate",label:"Joined Date",dataClass:"w-[25%]"}],isLoading:s,searchIsLoading:!1,page:e.page,totalPages:a?a.totalPages:1,handlePageChange:e=>{t({page:e,limit:10})},emptyDataMessage:"No Friends!",setSearchValue:n,searchValue:i,showTotalRecords:!1,searchFieldPlaceholderText:"Search",height:"auto",paginationPosition:"right",headStyles:"!font-normal text-primaryGrey",showDateFilter:!1})]})})};var g=a(72561);const j=e=>{let{title:t,value:a,containerClassName:l,valueClassName:s,titleClassName:r,loading:i}=e;return(0,h.jsxs)(d.A,{className:l,children:[(0,h.jsx)("h1",{className:`text-sm font-normal ${r}`,children:t}),(0,h.jsx)("span",{className:`text-lg font-medium ${s}`,children:i?(0,h.jsx)(g.A,{animationValue:"pulse",width:60,height:40}):a.toLocaleString()})]})};var y=a(58817);const v=()=>{var e;const{referrals:t,referralsLoading:a}=(0,o.d4)(y.W),{getTotalRewardsLoading:s,totalRewards:r}=(0,o.d4)(u.Ik),[i,n]=(0,l.useState)("");return(0,h.jsxs)(d.A,{className:"xl:col-span-1 col-span-2 h-[400px] overflow-y-auto bg-white",children:[(0,h.jsxs)("article",{className:"mx-6 py-3 mt-4 text-cardPrimaryText font-normal text-base flex items-center justify-between",children:[(0,h.jsx)("span",{className:"font-semibold text-sm",children:"My Friends"}),(0,h.jsx)("aside",{className:"flex items-center gap-2",children:i?(0,h.jsxs)("div",{className:"text-extraDarkBlue flex items-center gap-2 bg-extralightGray w-max py-3 px-4 rounded-lg",children:[i," ",(0,h.jsx)("button",{onClick:()=>n(""),children:(0,h.jsx)(m.X6,{className:"w-4 h-4"})})]}):(0,h.jsx)("div",{className:"w-4 h-4"})})]}),(0,h.jsxs)("article",{className:" flex h-full flex-col gap-4 justify-between p-6",children:[(0,h.jsx)("div",{className:"bg-borderCardsGradient p-[1px] rounded-md",children:(0,h.jsx)(j,{title:"Your Total Friends",value:(null===t||void 0===t?void 0:t.referralsCount)||0,titleClassName:"text-primaryGrey font-normal text-xs",valueClassName:"text-defaultExtraBlack font-medium text-sm",containerClassName:"p-4 gap-2 border-none bg-white !rou
1nded-md",loading:a})}),(0,h.jsxs)("div",{className:"grid grid-cols-12 gap-3",children:[(0,h.jsx)(j,{title:"Your Active Friends",value:(null===t||void 0===t?void 0:t.activeReferrals)||0,titleClassName:"text-primaryGrey font-normal text-xs text-white",valueClassName:"text-defaultExtraBlack font-medium text-sm text-white",containerClassName:"p-4 gap-2 border-none bg-white md:col-span-6 col-span-12 bg-greenCardGradient text-white !rounded-md"}),(0,h.jsx)(j,{title:"Your Inactive Friends",value:(null===t||void 0===t?void 0:t.inactiveReferrals)||0,titleClassName:"text-primaryGrey font-normal text-xs !text-white",valueClassName:"text-defaultExtraBlack font-medium text-sm !text-white",containerClassName:"p-4 gap-2 border-none bg-white md:col-span-6 col-span-12 !text-white bg-redCardGradient !rounded-md",loading:a})]}),(0,h.jsx)("div",{className:"bg-borderCardsGradient p-[1px] rounded-md",children:(0,h.jsx)(j,{title:"Total Rewards",value:`${(null===r||void 0===r?void 0:r.totalRewards)||0} ${(null===r||void 0===r||null===(e=r.token)||void 0===e?void 0:e.name)||""}`,titleClassName:"text-primaryGrey font-normal text-xs",valueClassName:"text-defaultExtraBlack font-medium text-sm",containerClassName:"p-4 gap-2 border-none bg-white !rounded-md",loading:s})})]})]})};var w=a(75837),N=a(91036);const b=()=>{const[e,t]=(0,l.useState)(""),{user:a}=(0,w.A)(),s=`${n.h3.DASHBOARD_REFERRAL}${null===a||void 0===a?void 0:a.referralCode}`,r=null===a||void 0===a?void 0:a.referralCode,i=async e=>{try{navigator.clipboard&&navigator.clipboard.writeText?await navigator.clipboard.writeText(e):o(e)}catch(t){o(e)}},o=e=>{const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),t.setSelectionRange(0,99999);try{document.execCommand("copy")}catch(a){console.error("Fallback copy to clipboard failed: ",a)}document.body.removeChild(t)};return(0,h.jsxs)("article",{className:"flex flex-col items-center w-full gap-2 px-5 py-4 border rounded-lg border-blueGrey lg:flex-row",children:[(0,h.jsxs)("div",{className:"flex flex-col w-full gap-2 lg:w-2/4",children:[(0,h.jsx)("h2",{className:"text-sm font-medium",children:"Your Referral Code"}),(0,h.jsxs)("div",{className:"flex items-center w-full gap-2 p-2 border rounded-lg border-primary",children:[(0,h.jsx)("input",{type:"text",className:"w-full text-xs truncate bg-transparent outline-none",value:r}),(0,h.jsx)("button",{className:"flex items-center gap-2 px-2 py-1 text-xs font-normal text-white rounded-md bg-primary",onClick:()=>{i(r||""),N.oR.success("Copied!"),t("code"),setTimeout(()=>{t("")},5e3)},children:"code"===e?(0,h.jsxs)(h.Fragment,{children:["Copied",(0,h.jsx)(m.ym,{className:"w-4 h-4"})]}):(0,h.jsxs)(h.Fragment,{children:["Copy",(0,h.jsx)(m.Td,{className:"w-4 h-4"})]})})]})]}),(0,h.jsxs)("div",{className:"flex flex-col w-full gap-2 lg:w-2/4",children:[(0,h.jsx)("h2",{className:"text-sm font-medium",children:"Your Referral Link"}),(0,h.jsxs)("div",{className:"flex items-center w-full gap-2 p-2 border rounded-lg border-primary",children:[(0,h.jsx)("input",{type:"text",className:"w-full text-xs truncate bg-transparent outline-none",value:s,disabled:!0}),(0,h.jsx)("button",{className:"flex items-center gap-2 px-2 py-1 text-xs font-normal text-white rounded-md bg-primary",onClick:()=>{i(s||""),t("link"),N.oR.success("Link Copied!"),setTimeout(()=>{t("")},5e3)},children:"link"===e?(0,h.jsxs)(h.Fragment,{children:["Copied",(0,h.jsx)(m.ym,{className:"w-4 h-4"})]}):(0,h.jsxs)(h.Fragment,{children:["Copy",(0,h.jsx)(m.Td,{className:"w-4 h-4"})]})})]})]}),(0,h.jsxs)("div",{className:"flex flex-col justify-end w-full gap-2 lg:w-1/4",children:[(0,h.jsx)("h2",{className:"invisible text-sm font-medium",children:"Scan QR Code"}),(0,h.jsxs)("button",{className:"text-white w-max bg-primary max-lg:self-end text-xs font-normal flex items-center justify-center gap-2 rounded-md h-[40px] px-4 py-2",children:["QR Code ",(0,h.jsx)(m.yV,{className:"w-4 h-4"})]})]})]})};var C=a(99349),k=a(23960),F=a(94219);const R=()=>{const[e,t]=(0,l.useState)("weekly"),{rewardChart:a}=(0,o.d4)(u.Ik),{getRewardsChart:s}=(0,r.a)();return(0,h.jsxs)(d.A,{className:"xl:col-span-1 col-span-2 h-[400px] overflow-y-auto bg-white",children:[(0,h.jsxs)("article",{className:"mx-6 py-3 text-cardPrimaryText font-normal text-base flex items-center justify-between border-b border-borderLightGray",children:[(0,h.jsx)("span",{className:"font-semibold text-sm",children:"Total Rewards"}),(0,h.jsxs)("aside",{className:"flex items-center gap-2 flex-col-reverse xs:flex-row",children:[e?(0,h.jsxs)("div",{className:"text-extraDarkBlue flex items-center gap-2 bg-extralightGray w-max py-2 px-4 roun
1ded-lg",children:[e," ",(0,h.jsx)("button",{onClick:()=>t(""),children:(0,h.jsx)(m.X6,{className:"w-4 h-4"})})]}):"",(0,h.jsx)(C.A,{buttonText:"Filters",StartIcon:(0,h.jsx)(m._S,{className:"w-4 h-4"}),EndIcon:(0,h.jsx)(h.Fragment,{}),onItemClick:e=>{t(e)},data:[{key:"yearly",label:"Yearly"},{key:"monthly",label:"Monthly"},{key:"weekly",label:"Weekly"}]||[],callBack:e=>{t(e),s(e)}})]})]}),(0,h.jsx)("article",{className:"w-full h-full",children:(0,h.jsx)(k.A,{data:[{id:"Reward",data:a}],defs:F.$3,fill:F.sL,margin:{top:50,right:50,bottom:50,left:50},isInteractive:!0,enablePoints:!1,enableGridX:!0,enableGridY:!0,colors:["#0E173F"],axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:0,legend:"",legendOffset:36,legendPosition:"middle",truncateTickAt:0},legends:[],axisLeft:{tickSize:5,tickPadding:5,tickRotation:0,legend:"",legendOffset:36,legendPosition:"middle",truncateTickAt:0},tootlipColor:"#292929",showSub:!0})})]})},T=()=>{const{getActiveMembershipStats:e}=(0,i.g)(),{getFriendsTotalRewards:t,getRewardsChart:a}=(0,r.a)();return(0,l.useEffect)(()=>{!async function(){try{await Promise.allSettled([e(),t(),a()])}catch(l){console.error("Error fetching data:",l)}}()},[]),(0,h.jsxs)("section",{className:"flex flex-col gap-4",children:[(0,h.jsx)(s.A,{title:"My Friends"}),(0,h.jsxs)("div",{className:"relative",children:["DEV"===n.Kk?(0,h.jsx)(h.Fragment,{}):(0,h.jsx)("div",{className:"flex items-center justify-center w-full h-full bg-white/10 backdrop-blur absolute rounded-lg",style:{zIndex:30},children:(0,h.jsx)("span",{className:"uppercase text-4xl",children:"coming soon"})}),(0,h.jsxs)("article",{className:"flex flex-col gap-4",children:[(0,h.jsx)(b,{}),(0,h.jsxs)("div",{className:"grid grid-flow-col-dense grid-cols-2 xl:grid-rows-1 grid-rows-2 gap-5",children:[(0,h.jsx)(v,{}),(0,h.jsx)(R,{})]}),(0,h.jsx)(p,{})]})]})]})}},94219(e,t,a){a.d(t,["$3",0,[{id:"gradient1",type:"linearGradient",colors:[{offset:0,color:"#0E173F"},{offset:100,color:"#FFFFFF"}]}],"nZ",0,[{id:"gradient1",type:"linearGradient",colors:[{offset:0,color:"#F2F4F7"},{offset:70,color:"#F2F4F7"}]}],"sL",0,[{match:"*",id:"gradient1"}]])}}]); 2//# sourceMappingURL=6277.d8077b5b.chunk.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.