1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,576076,e=>{"use strict";var a=e.i(645992);e.s(["RefreshCw",()=>a.default])},645992,e=>{"use strict";let a=(0,e.i(889522).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["default",()=>a])},888391,e=>{"use strict";let a=(0,e.i(889522).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["default",()=>a])},42014,(e,a,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={callServer:function(){return l.callServer},createServerReference:function(){return c.createServerReference},findSourceMapURL:function(){return d.findSourceMapURL}};for(var t in s)Object.defineProperty(r,t,{enumerable:!0,get:s[t]});let l=e.r(742673),d=e.r(581792),c=e.r(510354)},204544,e=>{"use strict";var a=e.i(475507);e.s(["Calendar",()=>a.default])},856933,678779,632947,e=>{"use strict";var a=e.i(889522);let r=(0,a.default)("gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);e.s(["default",()=>r],856933);let s=(0,a.default)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);e.s(["default",()=>s],678779);let t=(0,a.default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);e.s(["default",()=>t],632947)},260296,e=>{"use strict";var a=e.i(466471),r=e.i(884702),s=e.i(42014),t=(0,s.createServerReference)("00d939a0959131f558f720e310f32eeb8589d61303",s.callServer,void 0,s.findSourceMapURL,"copyReferralLink"),l=(0,s.createServerReference)("00007089df36316a27e87a5df60d866a2f6efbe74f",s.callServer,void 0,s.findSourceMapURL,"getUserCheckinData"),d=(0,s.createServerReference)("0093b2fb3b3c84ff71df2ca49f257b8137b7620ddd",s.callServer,void 0,s.findSourceMapURL,"getUserReferralData"),c=(0,s.createServerReference)("0092098837a2021b4f650b88741fe75bf3b7cbfc95",s.callServer,void 0,s.findSourceMapURL,"getUserReferralStats"),i=(0,s.createServerReference)("00ae97243df4003336489aac15eb3249827e82f7b4",s.callServer,void 0,s.findSourceMapURL,"performDailyCheckin"),n=e.i(204544),o=e.i(888391),o=o,h=e.i(856933),h=h,m=e.i(678779),m=m,u=e.i(576076),x=e.i(632947),x=x,f=e.i(247835),p=e.i(779342);let g="pending",y="active",j="expired",b="failed",v={[g]:"yellow",[y]:"green",[j]:"gray",[b]:"red"};var N=e.i(536355),w=e.i(511398),k=e.i(960568);function C(e){let r,s,t,l,d=(0,N.c)(10),{message:c,buttonText:i}=e,{setIsShowSignModal:n}=(0,k.useAppContext)();d[0]!==n?(r=()=>{n(!0)},d[0]=n,d[1]=r):r=d[1];let o=r;return d[2]!==c?(s=(0,a.jsx)("h2",{className:"text-2xl font-medium",children:c}),d[2]=c,d[3]=s):s=d[3],d[4]!==i||d[5]!==o?(t=(0,a.jsx)(w.Button,{size:"lg",onClick:o,className:"bg-primary hover:bg-primary/90 text-primary-foreground",children:i}),d[4]=i,d[5]=o,d[6]=t):t=d[6],d[7]!==s||d[8]!==t?(l=(0,a.jsx)("div",{className:"flex h-[calc(100vh-12rem)] items-center justify-center",children:(0,a.jsxs)("div",{className:"space-y-6 text-center",children:[s,t]})}),d[7]=s,d[8]=t,d[9]=l):l=d[9],l}var T=e.i(615978),S=e.i(686247),R=e.i(118621),M=e.i(273792),I=e.i(330771);function L(){let e=(0,f.useTranslations)("referral"),{user:s,fetchUserCredits:N}=(0,k.useAppContext)(),[L,D]=(0,r.useState)(""),[U,$]=(0,r.useState)(""),[B,E]=(0,r.useState)(!0),[F,H]=(0,r.useState)(null),[_,A]=(0,r.useState)(null),[P,q]=(0,r.useState)(!1),[O,z]=(0,r.useState)(!0),[W,K]=(0,r.useState)(null),[V,Y]=(0,r.useState)([]),[G,X]=(0,r.useState)(!0),[J,Q]=(0,r.useState)(null),[Z,ee]=(0,r.useState)("whatsapp"),[ea,er]=(0,r.useState)(""),es=(0,r.useRef)(!1),et=(0,r.useRef)(!1),el=(0,r.useRef)(!1),ed=(0,r.useRef)(null),ec=(0,r.useMemo)(()=>s?.id||null,[s?.id]),ei=(0,r.useCallback)(async()=>
1{if(s?.id){z(!0);try{let e=await l();e.success&&e.data&&(A(e.data),et.current=!0)}catch(e){}finally{z(!1)}}},[s?.id]);(0,r.useEffect)(()=>{if(!s?.id){E(!1),es.current=!1,ed.current=null;return}es.current&&ed.current===s.id||(ed.current!==s.id&&(es.current=!1,et.current=!1,el.current=!1,ed.current=s.id),(async()=>{E(!0),H(null);try{let e=await d();e.success&&e.data?(e.data.referralLink&&D(e.data.referralLink),e.data.referralCode&&$(e.data.referralCode),es.current=!0):H(e.message)}catch(e){H("Failed to load referral data")}finally{E(!1)}})())},[ec,s]),(0,r.useEffect)(()=>{s?.id?et.current&&ed.current===s.id||(async()=>{z(!0);try{let e=await l();e.success&&e.data&&(A(e.data),et.current=!0)}catch(e){}finally{z(!1)}})():z(!1)},[ec,s]),(0,r.useEffect)(()=>{s?.id?el.current&&ed.current===s.id||(async()=>{X(!0),Q(null);try{let e=await c();e.success?(e.stats&&K(e.stats),e.referralHistory&&Y(e.referralHistory),el.current=!0):Q(e.message)}catch(e){Q("Failed to load referral statistics")}finally{X(!1)}})():X(!1)},[ec,s]),(0,r.useEffect)(()=>{er({copy:e("referral.shareMessageCopy"),twitter:e("referral.shareMessageTwitter"),facebook:e("referral.shareMessageFacebook"),linkedin:e("referral.shareMessageLinkedin"),telegram:e("referral.shareMessageTelegram"),whatsapp:e("referral.shareMessageWhatsapp")}[Z]+(L?` ${L}`:""))},[Z,L,e]);let en=async()=>{if(s){if(await ei(),_?.hasCheckedInToday)return void p.toast.info(e("checkIn.checkedInToday"));q(!0);try{let a=await i();if(a.success&&a.data){let e={hasCheckedInToday:!0,consecutiveDays:a.data.consecutiveDays,nextDayReward:a.data.nextDayReward,todayReward:a.data.creditsEarned};A(e),el.current=!1,N(),setTimeout(()=>{s?.id&&(async()=>{try{let e=await c();e.success&&(e.stats&&K(e.stats),e.referralHistory&&Y(e.referralHistory),el.current=!0)}catch(e){}})()},1e3),p.toast.success(`Check-in successful! You earned ${a.data.creditsEarned} credits!`)}else a.message&&a.message.toLowerCase().includes("already")?(await ei(),p.toast.info(e("checkIn.checkedInToday"))):p.toast.error(a.message)}catch(e){p.toast.error("Failed to perform check-in. Please try again.")}finally{q(!1)}}},eo=async()=>{try{let a=await t();a.success&&a.referralLink?(navigator.clipboard.writeText(a.referralLink),p.toast.success(e("referral.copiedButton"))):p.toast.error(a.message)}catch(e){p.toast.error("Failed to copy referral link")}},eh=async e=>{try{let a=encodeURIComponent(ea),r=encodeURIComponent(L),s="";switch(e){case"copy":await navigator.clipboard.writeText(ea),p.toast.success("Share message copied to clipboard");return;case"twitter":s=`https://twitter.com/intent/tweet?text=${a}`;break;case"facebook":s=`https://www.facebook.com/sharer/sharer.php?u=${r}"e=${a}`;break;case"linkedin":s=`https://www.linkedin.com/sharing/share-offsite/?url=${r}&summary=${a}`;break;case"telegram":s=`https://t.me/share/url?url=${r}&text=${a}`;break;case"whatsapp":s=`https://wa.me/?text=${a}`;break;default:return}s&&window.open(s,"_blank","width=600,height=400")}catch(e){p.toast.error("Failed to share message")}};return(0,a.jsx)("section",{className:"mx-auto min-h-screen py-4",children:(0,a.jsxs)("div",{className:"container mx-auto max-w-7xl px-6",children:[s?(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-8 lg:grid-cols-2",children:[(0,a.jsxs)(S.Card,{className:"bg-card border-border",children:[(0,a.jsxs)(S.CardHeader,{className:"flex flex-row items-center space-y-0 pb-2",children:[(0,a.jsx)(n.Calendar,{className:"text-primary mr-2 h-5 w-5"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(S.CardTitle,{className:"text-lg",children:e("checkIn.title")}),(0,a.jsx)(S.CardDescription,{children:e("checkIn.description")})]}),(0,a.jsx)(w.Button,{variant:"ghost",size:"icon",onClick:ei,disabled:O,className:"h-8 w-8",title:"Refresh check-in status",children:(0,a.jsx)(u.RefreshCw,{className:`h-4 w-4 ${O?"animate-spin":""}`})})]}),(0,a.jsxs)(S.CardContent,{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-muted-foreground text-sm",children:e("checkIn.consecutiveDaysText")}),(0,a.jsx)("span",{className:"text-2xl font-bold",children:`${_?.consecutiveDays||0} ${e("checkIn.day")}`})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-muted-foreground text-sm",children:_?.hasCheckedInToday?e("checkIn.tomorrowRewardText"):e("checkIn.todayRew
1ardText")}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(h.default,{className:"text-primary h-4 w-4"}),(0,a.jsx)("span",{className:"font-medium",children:_?.hasCheckedInToday?_.nextDayReward:_?.todayReward||2})]})]}),(0,a.jsxs)("div",{className:"bg-muted rounded-lg p-4 text-center",children:[(0,a.jsx)("div",{className:"text-muted-foreground mb-2 text-sm",children:new Date().toLocaleDateString("en-US",{month:"short",year:"numeric"})}),(0,a.jsxs)("div",{className:"grid grid-cols-7 gap-1 text-xs",children:[["S","M","T","W","T","F","S"].map((e,r)=>(0,a.jsx)("div",{className:"text-muted-foreground p-2",children:e},r)),(()=>{let e=new Date,r=e.getMonth(),s=e.getFullYear(),t=e.getDate(),l=new Date(s,r+1,0).getDate(),d=new Date(s,r,1).getDay(),c=[];for(let e=0;e<d;e++)c.push((0,a.jsx)("div",{className:"p-2"},`empty-${e}`));for(let e=1;e<=l;e++){let r=e===t,s=_?.hasCheckedInToday&&r;c.push((0,a.jsx)("div",{className:`rounded p-2 ${r?s?"bg-primary text-primary-foreground":"bg-secondary text-secondary-foreground":""}`,children:e},e))}return c})()]})]}),(0,a.jsx)(w.Button,{className:"w-full",onClick:en,disabled:P||_?.hasCheckedInToday,children:P?e("checkIn.processing"):_?.hasCheckedInToday?e("checkIn.checkedInToday"):e("checkIn.buttonText")})]})]}),(0,a.jsxs)(S.Card,{className:"bg-card border-border",children:[(0,a.jsxs)(S.CardHeader,{className:"flex flex-row items-center space-y-0 pb-2",children:[(0,a.jsx)(x.default,{className:"text-primary mr-2 h-5 w-5"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(S.CardTitle,{className:"text-lg",children:e("referral.title")}),(0,a.jsx)(S.CardDescription,{children:e("referral.description")})]}),(0,a.jsx)(T.Badge,{variant:"outline",className:"bg-primary/10 text-primary border-primary/30",children:e("referral.rewardBannerText")})]}),(0,a.jsx)(S.CardContent,{className:"space-y-4",children:B?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"bg-muted h-8 animate-pulse rounded-md"}),(0,a.jsx)("div",{className:"bg-muted h-16 animate-pulse rounded-md"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(M.Label,{className:"text-sm",children:e("referral.referralLinkLabel")}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(R.Input,{value:L,readOnly:!0,className:"bg-muted text-sm"}),(0,a.jsx)(w.Button,{variant:"outline",size:"icon",onClick:eo,children:(0,a.jsx)(m.default,{className:"h-4 w-4"})})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(M.Label,{className:"text-sm",children:e("referral.shareToLabel")}),(0,a.jsxs)(I.Tabs,{value:Z,onValueChange:e=>ee(e),children:[(0,a.jsxs)(I.TabsList,{className:"mb-4 grid grid-cols-6",children:[(0,a.jsx)(I.TabsTrigger,{value:"copy",className:"flex items-center gap-1.5",children:(0,a.jsx)(m.default,{className:"text-primary h-4 w-4 shrink-0"})}),(0,a.jsx)(I.TabsTrigger,{value:"twitter",className:"flex items-center gap-1.5",children:(0,a.jsx)("span",{className:"text-xs",children:"X"})}),(0,a.jsx)(I.TabsTrigger,{value:"facebook",className:"flex items-center gap-1.5",children:(0,a.jsx)("span",{className:"text-xs",children:"FB"})}),(0,a.jsx)(I.TabsTrigger,{value:"linkedin",className:"flex items-center gap-1.5",children:(0,a.jsx)("span",{className:"text-xs",children:"in"})}),(0,a.jsx)(I.TabsTrigger,{value:"telegram",className:"flex items-center gap-1.5",children:(0,a.jsx)("span",{className:"text-xs",children:"TG"})}),(0,a.jsx)(I.TabsTrigger,{value:"whatsapp",className:"flex items-center gap-1.5",children:(0,a.jsx)("span",{className:"text-xs",children:"WA"})})]}),(0,a.jsxs)(I.TabsContent,{value:Z,className:"space-y-3",children:[(0,a.jsx)("textarea",{className:"ring-offset-background placeholder:text-muted-foreground bg-muted border-border focus-visible:ring-ring flex min-h-[100px] w-full rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",value:ea,onChange:e=>er(e.target.value)}),(0,a.jsxs)(w.Button,{className:"w-full gap-2",onClick:()=>eh(Z),children:[(0,a.jsx)("div",{className:"h-4 w-4",children:"copy"===Z&&
1(0,a.jsx)(o.default,{className:"h-4 w-4"})}),(0,a.jsxs)("span",{children:["copy"===Z&&"Copy Message","twitter"===Z&&"Share on Twitter","facebook"===Z&&"Share on Facebook","linkedin"===Z&&"Share on LinkedIn","telegram"===Z&&"Share on Telegram","whatsapp"===Z&&"Share on WhatsApp"]})]})]})]})]}),(0,a.jsxs)("div",{className:"bg-muted space-y-2 rounded-lg p-4",children:[(0,a.jsx)("div",{className:"text-sm font-medium",children:e("stats.title")}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-4 text-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-lg font-bold",children:W?.totalReferred||0}),(0,a.jsx)("div",{className:"text-muted-foreground text-xs",children:e("referral.completedText")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-lg font-bold",children:W?.pendingReferred||0}),(0,a.jsx)("div",{className:"text-muted-foreground text-xs",children:e("referral.pendingText")})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"text-lg font-bold",children:[(0,a.jsx)(h.default,{className:"mr-1 inline h-4 w-4"}),W?.totalCreditsEarned||0]}),(0,a.jsx)("div",{className:"text-muted-foreground text-xs",children:e("referral.earnedText")})]})]})]})]})})]})]}):(0,a.jsx)(C,{message:e("loginPrompt.message"),buttonText:e("loginPrompt.loginButton")}),s&&(0,a.jsx)("div",{className:"mt-8",children:(0,a.jsxs)(S.Card,{className:"bg-card border-border",children:[(0,a.jsxs)(S.CardHeader,{children:[(0,a.jsx)(S.CardTitle,{children:e("history.referrals.title")}),(0,a.jsx)(S.CardDescription,{children:e("history.referrals.description")})]}),(0,a.jsx)(S.CardContent,{children:(0,a.jsx)("div",{className:"border-border rounded-md border",children:(0,a.jsx)("div",{className:"relative w-full overflow-auto",children:(0,a.jsxs)("table",{className:"w-full caption-bottom text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-border bg-muted border-b",children:[(0,a.jsx)("th",{className:"h-12 px-4 text-left font-medium",children:e("history.referrals.columns.date")}),(0,a.jsx)("th",{className:"h-12 px-4 text-left font-medium",children:"Invited User"}),(0,a.jsx)("th",{className:"h-12 px-4 text-center font-medium",children:"Status"}),(0,a.jsx)("th",{className:"h-12 px-4 text-right font-medium",children:e("history.referrals.columns.credits")})]})}),(0,a.jsx)("tbody",{children:G?[,,,].fill(0).map((e,r)=>(0,a.jsxs)("tr",{className:"border-border border-b",children:[(0,a.jsx)("td",{className:"p-4 align-middle",children:(0,a.jsx)("div",{className:"bg-muted h-4 w-20 animate-pulse rounded-md"})}),(0,a.jsx)("td",{className:"p-4 align-middle",children:(0,a.jsx)("div",{className:"bg-muted h-4 w-32 animate-pulse rounded-md"})}),(0,a.jsx)("td",{className:"p-4 text-center align-middle",children:(0,a.jsx)("div",{className:"bg-muted mx-auto h-4 w-16 animate-pulse rounded-md"})}),(0,a.jsx)("td",{className:"p-4 text-right align-middle",children:(0,a.jsx)("div",{className:"bg-muted ml-auto h-4 w-16 animate-pulse rounded-md"})})]},r)):0===V.length?(0,a.jsx)("tr",{className:"border-border border-b",children:(0,a.jsx)("td",{colSpan:4,className:"text-muted-foreground p-4 text-center",children:e("history.referrals.empty")})}):V.map(r=>(0,a.jsxs)("tr",{className:"border-border border-b",children:[(0,a.jsx)("td",{className:"p-4 align-middle",children:r.date}),(0,a.jsx)("td",{className:"p-4 align-middle",children:(0,a.jsx)("span",{className:"text-muted-foreground",children:r.referredUserEmail||"User"})}),(0,a.jsx)("td",{className:"p-4 text-center align-middle",children:(r=>{if(!r)return(0,a.jsx)(T.Badge,{className:"bg-gray-600 text-white",children:"Unknown"});let s=v[r]||"gray",t={[g]:"pending",[y]:"active",[j]:"expired",[b]:"failed"}[r]||"unknown",l=e(`referral.status.${t}`);return(0,a.jsx)(T.Badge,{className:{green:"bg-green-600 text-white",yellow:"bg-yellow-600 text-white",gray:"bg-gray-600 text-white",red:"bg-red-600 text-white"}[s]||"bg-gray-600 text-white",children:l})})(r.status)}),(0,a.jsx)("td",{className:"p-4 text-right align-middle",children:(0,a.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,a.jsx)(h.default,{className:`h-4 w-4 ${r.creditsEarned>0?"text-primary":"text-muted-foreground"}`}),(0,a.jsx)("span",{className:r.creditsEarned>0?"":"text-muted-foreground line-through",children:r.creditsEarned})]})})]},r.id))})]})})})})]})})]})})}e.s(["default",()=>L],260296)}]);
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.