1import{d as tt,u as et,U as st,a as T,X as at,h as ot,I as it,f as dt,g as rt,r as n,v as lt,j as i,o,l as t,s as c,k as z,n as nt,p as e,m as l,L as m,c as ct,q as p,E as P,F as y,x as w,Q as R,Y as W,Z as ft,$ as ut,a0 as mt,a1 as ht,a2 as bt,a3 as _t,a4 as pt,e as N,W as xt}from"./DZ7mik94.js";import yt from"./C_R9b47F.js";import"./rSTlLCgx.js";import"./CkncaXhN.js";import"./C1qMvYzb.js";const vt={class:"affiliate-page h-full overflow-y-auto p-4 md:p-6"},gt={class:"flex items-center gap-3 mb-6"},wt={class:"text-lg font-semibold text-gray-900"},$t={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"},kt={class:"bg-white rounded-xl border border-gray-100 p-5 flex flex-col justify-between"},Dt={class:"text-sm font-medium text-gray-500 mb-4"},jt={class:"flex items-center gap-3"},Ct={class:"px-3 py-1 bg-blue-50 text-blue-700 rounded-full text-sm font-semibold"},Lt={key:0,class:"px-3 py-1 bg-green-50 text-green-700 rounded-full text-sm font-semibold"},St={class:"mt-4 pt-4 border-t border-gray-50 flex justify-between items-center"},Ut={class:"text-sm text-gray-500"},It={class:"text-lg font-semibold text-gray-900"},Tt={class:"bg-slate-900 rounded-xl p-5 text-white shadow-lg shadow-slate-200"},qt={class:"flex items-center justify-between mb-4"},zt={class:"text-sm font-medium text-slate-400"},Rt={class:"flex gap-2"},Wt={class:"grid grid-cols-1 sm:grid-cols-3 gap-4 mb-3"},At={class:"text-xs text-slate-400 mb-1"},Vt={class:"text-lg font-bold"},Gt={class:"text-xs text-slate-400 mb-1"},Mt={class:"text-lg font-bold text-amber-400"},Bt={class:"text-xs text-slate-400 mb-1"},Ft={class:"text-lg font-bold text-green-400"},Pt={class:"text-[10px] text-slate-500 bg-black/20 px-2 py-1.5 rounded inline-block"},Nt={class:"grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6"},Qt={class:"bg-white rounded-lg border border-gray-100 p-4"},Et={class:"text-xs text-gray-500 mb-1"},Ht={class:"text-xl font-semibold text-green-600"},Yt={class:"bg-white rounded-lg border border-gray-100 p-4"},Xt={class:"text-xs text-gray-500 mb-1"},Zt={class:"text-xl font-semibold text-gray-900"},Jt={class:"bg-white rounded-lg border border-gray-100 p-4"},Kt={class:"text-xs text-gray-500 mb-1"},Ot={class:"flex items-center gap-1"},te={class:"mb-6"},ee={class:"text-xs font-medium text-gray-500 uppercase tracking-wide mb-2 block"},se={class:"flex gap-2"},ae=["value"],oe={class:"mb-6"},ie={class:"text-sm font-medium text-gray-900 mb-3"},de={class:"flex flex-col sm:flex-row gap-4 text-sm"},re={class:"flex items-center gap-2"},le={class:"text-gray-600"},ne={class:"flex items-center gap-2"},ce={class:"text-gray-600"},fe={class:"flex items-center gap-2"},ue={class:"text-gray-600"},me={class:"bg-white rounded-xl border border-gray-100 overflow-hidden min-h-[400px]"},he={class:"flex border-b border-gray-100 overflow-x-auto scrolbar-hide"},be={class:"ml-2 text-xs py-0.5 px-2 bg-gray-100 text-gray-600 rounded-full"},_e={class:"p-0"},pe={key:0},xe={key:0,class:"p-8 text-center text-gray-400 text-sm"},ye={key:1,class:"p-8 text-center text-gray-400 text-sm"},ve={key:2},ge={class:"md:hidden space-y-3"},we={class:"flex items-center gap-3 mb-3"},$e={class:"w-8 h-8 rounded-full bg-white flex items-center justify-center text-gray-500 text-xs font-medium shadow-sm"},ke={class:"font-medium text-gray-900"},De={class:"flex justify-between text-sm"},je={class:"text-gray-500"},Ce={class:"text-gray-900"},Le={class:"flex justify-between text-sm mt-1"},Se={class:"text-gray-500"},Ue={class:"hidden md:block overflow-x-auto"},Ie={class:"w-full text-left text-sm"},Te={class:"bg-gray-50/50 text-gray-500 border-b border-gray-100"},qe={class:"px-6 py-3 font-medium"},ze={class:"px-6 py-3 font-medium"},Re={class:"px-6 py-3 font-medium"},We={class:"divide-y divide-gray-50"},Ae={class:"px-6 py-4"},Ve={class:"flex items-center gap-3"},Ge={class:"w-8 h-8 rounded-full bg-gray-100 flex items-center justify-center text-gray-500 text-xs font-medium"},Me={class:"font-medium text-gray-900"},Be={class:"px-6 py-4 text-gray-500"},Fe={key:0},Pe={key:0,class:"p-8 text-center text-gray-400 text-sm"},Ne={key:1,class:"p-8 text-center text-gray-400 text-sm"},Qe={key:2},Ee={class:"md:hidden space-y-3"},He={class:"flex justify-between items-start mb-2"},Ye={class:"font-medium text-gray-900"},Xe={class:"text-xs text-gray-400"},Ze={class:"text-right"},Je={class:"font-medium text-green-600"},Ke={class:"text-xs text-gray-400"},Oe={class:"flex justify-between items-center pt-2 border-t border-gray-100"},ts={key:0,class:"text-[10px] text-gray-400"},es={class:"hidden md:block overflow-x-auto"},ss={class:"w-full text-left text-sm"},as={class:"bg-gray-50/50 text-gray-500 border-b border-gray-100"},os={class:"px-6 py-3 font-medium"},is={class:"px-6 py-3 font-medium"},ds={class:"px-6 py-3 font-medium"},rs={class:"px-6 py-3 font-medium"},ls={class:"divide-y divide-gray-50"},ns={class:"px-6 py-4 text-gray-500"},cs={class:"px-6 py-4"},fs={class:"text-gray-900"},us={class:"text-xs text-gray-400 ml-2"},ms={class:"px-6 py-4 font-medium text-green-600"},hs={class:"px-6 py-4"},bs={class:"flex flex-col gap-1"},_s={key:0,class:"text-[10px] text-gray-400"}
1,ps={key:1},xs={key:0,class:"p-8 text-center text-gray-400 text-sm"},ys={key:1},vs={class:"md:hidden space-y-3"},gs={class:"flex justify-between items-start mb-2"},ws={class:"font-medium text-gray-900"},$s=["title"],ks={class:"flex justify-between items-center text-xs text-gray-400"},Ds={key:0,class:"text-xs text-red-400 mt-2 bg-red-50 p-2 rounded"},js={class:"hidden md:block overflow-x-auto"},Cs={class:"w-full text-left text-sm"},Ls={class:"bg-gray-50/50 text-gray-500 border-b border-gray-100"},Ss={class:"px-6 py-3 font-medium"},Us={class:"px-6 py-3 font-medium"},Is={class:"px-6 py-3 font-medium"},Ts={class:"px-6 py-3 font-medium"},qs={class:"divide-y divide-gray-50"},zs={class:"px-6 py-4 text-gray-500"},Rs={class:"px-6 py-4 font-medium text-gray-900"},Ws={class:"px-6 py-4 text-gray-500"},As=["title"],Vs={class:"px-6 py-4"},Gs=["title"],Ms={key:0,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},Bs={class:"bg-white rounded-xl p-6 w-full max-w-md mx-4 shadow-xl"},Fs={class:"text-lg font-semibold text-gray-900 mb-4"},Ps={class:"mb-4"},Ns={class:"block text-sm font-medium text-gray-700 mb-1"},Qs={class:"text-2xl font-bold text-green-600"},Es={class:"mb-4"},Hs={class:"block text-sm font-medium text-gray-700 mb-1"},Ys=["max"],Xs={class:"mb-6"},Zs={class:"block text-sm font-medium text-gray-700 mb-1"},Js=["placeholder"],Ks={class:"flex gap-3 justify-end"},Os=["disabled"],ta={key:1,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},ea={class:"bg-white rounded-xl p-6 w-full max-w-md mx-4 shadow-xl"},sa={class:"text-lg font-semibold text-gray-900 mb-4"},aa={class:"mb-4"},oa={class:"block text-sm font-medium text-gray-700 mb-1"},ia={class:"text-2xl font-bold text-amber-600"},da={class:"mb-4"},ra={class:"block text-sm font-medium text-gray-700 mb-1"},la=["max"],na={class:"mb-6"},ca={class:"text-sm text-gray-500"},fa={class:"flex gap-3 justify-end"},ua=["disabled"],ma=tt({__name:"affiliate",setup(ha){const{t:r}=et();st(T(()=>({title:r("dashboard.affiliate.center_title")+" | WisGate"})));const{siteHostname:A}=at().public,f=ot(),h=it(),Q=dt(),E=rt(),D=n([]),$=n([]),j=n([]),C=n(!1),_=n("overview"),V=n(0),G=n(0),x=n(0),L=n(!1),S=n(!1),v=n(0),g=n(0),k=n(""),U=n(!1),I=n(!1);
1T(()=>N(f.info?.aff_history_quota||0));const M=T(()=>N(f.info?.aff_quota||0)),q=n(0),u=T(()=>{const s=M.value-q.value;return s>0?s:0}),H=()=>{v.value=u.value,k.value="",L.value=!0},Y=()=>{g.value=u.value,S.value=!0},X=async()=>{if(v.value<=0){h.add({severity:"error",summary:r("common.error"),detail:r("dashboard.affiliate.invalid_amount"),life:3e3});return}if(v.value>u.value){h.add({severity:"error",summary:r("common.error"),detail:r("dashboard.affiliate.insufficient_balance"),life:3e3});return}if(!k.value.trim()){h.add({severity:"error",summary:r("common.error"),detail:r("dashboard.affiliate.payment_info_required"),life:3e3});return}U.value=!0;try{await ft({amount:v.value,payment_info:k.value}),h.add({severity:"success",summary:r("common.success"),detail:r("dashboard.affiliate.withdrawal_submitted"),life:3e3}),L.value=!1,await f.getUserInfo()}catch(s){h.add({severity:"error",summary:r("common.error"),detail:s?.message||r("common.error"),life:3e3})}finally{U.value=!1}},Z=async()=>{if(g.value<=0){h.add({severity:"error",summary:r("common.error"),detail:r("dashboard.affiliate.invali
1d_amount"),life:3e3});return}if(g.value>u.value){h.add({severity:"error",summary:r("common.error"),detail:r("dashboard.affiliate.insufficient_balance"),life:3e3});return}I.value=!0;try{const s=ut(g.value);await mt({quota:s}),h.add({severity:"success",summary:r("common.success"),detail:r("dashboard.affiliate.transfer_success"),life:3e3}),S.value=!1,await f.getUserInfo()}catch(s){h.add({severity:"error",summary:r("common.error"),detail:s?.message||r("common.error"),life:3e3})}finally{I.value=!1}},J=async()=>{C.value=!0;try{const[s,d,b,a]=await Promise.all([ht({p:0,page_size:20}),bt({p:0,page_size:20}),_t(),pt({p:0,page_size:20})]);s?.items&&(D.value=s.items.map(F=>({...F,dateGroup:new Date(F.created_at*1e3).toLocaleDateString(void 0,{month:"short",day:"numeric"})}))),d?.items&&($.value=d.items),b&&(V.value=b.this_month||0,G.value=b.last_month||0,x.value=Math.round(b.mom_change||0),q.value=b.pending_withdrawal_usd||0),a?.items&&(j.value=a.items)}catch(s){console.error("Failed to fetch data:",s)}finally{C.value=!1}},B=s=>{if(s.is_settled&&s.settled_at)return new Date(s.settled_at*1e3).toLocaleDateString();const d=new Date(s.created_at*1e3);return new Date(d.getFullYear(),d.getMonth()+2,0).toLocaleDateString()},K=()=>{try{navigator.clipboard.writeText(`https://${A}/?aff=${f.info?.aff_code}`),h.add({severity:"success",summary:"Copied",detail:"Link copied to clipboard",life:2e3})}catch(s){console.error(s)}},O=()=>{Q.push(E("/hall/dashboard"))};return lt(()=>{J()}),(s,d)=>{const b=nt;return o(),i(y,null,[t("div",vt,[t("div",gt,[t("button",{onClick:O,class:"w-8 h-8 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center text-gray-500 transition-colors"},[z(b,{name:"lucide:x",class:"text-sm"})]),t("div",null,[t("h1",wt,e(s.$t("dashboard.affiliate.center_title")),1)])]),t("div",$t,[t("div",kt,[t("div",null,[t("h3",Dt,e(s.$t("dashboard.affiliate.level")),1),t("div",jt,[t("div",Ct,e(l(f).info?.aff_level===1?s.$t("dashboard.affiliate.level_partner"):s.$t("dashboard.affiliate.level_standard")),1),l(f).info?.aff_level===1?(o(),i("div",Lt,e(s.$t("dashboard.affiliate.commission_rate"))+": "+e(l(f).info?.aff_commission_rate||0)+"% ",1)):c("",!0)])]),t("div",St,[t("span",Ut,e(s.$t("dashboard.affiliate.total_referrals")),1),t("span",It,e(l(f).info?.aff_count||0),1)])]),t("div",Tt,[t("div",qt,[t("h3",zt,e(s.$t("dashboard.affiliate.quota")),1),t("div",Rt,[u.value>0?(o(),i("button",{key:0,onClick:Y,class:"px-3 py-1.5 bg-white/10 hover:bg-white/20 rounded-lg text-xs font-medium transition-colors backdrop-blur-sm"},e(s.$t("dashboard.affiliate.transfer")),1)):c("",!0),l(f).info?.aff_level===1&&u.value>0?(o(),i("button",{key:1,onClick:H,class:"px-3 py-1.5 bg-blue-500 hover:bg-blue-600 rounded-lg text-xs font-medium transition-colors shadow-sm"},e(s.$t("dashboard.affiliate.request_withdrawal")),1)):c("",!0)])]),t("div",Wt,[t("div",null,[t("p",At,e(s.$t("dashboard.affiliate.total_commission")),1),t("p",Vt,e(l(m)(M.value)),1)]),t("div",null,[t("p",Gt,e(s.$t("dashboard.affiliate.frozen")),1),t("p",Mt,e(l(m)(q.value)),1)]),t("div",null,[t("p",Bt,e(s.$t("dashboard.affiliate.available_balance")),1),t("p",Ft,e(l(m)(u.value)),1)])]),t("div",Pt,e(s.$t("dashboard.affiliate.balance_formula")),1)])]),t("div",Nt,[t("div",Qt,[t("p",Et,e(s.$t("dashboard.affiliate.this_month")),1),t("p",Ht,e(l(m)(V.value)),1)]),t("div",Yt,[t("p",Xt,e(s.$t("dashboard.affiliate.last_month")),1),t("p",Zt,e(l(m)(G.value)),1)]),t("div",Jt,[t("p",Kt,e(s.$t("dashboard.affiliate.mom_change")),1),t("div",Ot,[t("span",{class:p(["text-xl font-semibold",x.value>0?"text-green-600":x.value<0?"text-red-600":"text-gray-900"])},e(x.value>0?"+":"")+e(x.value.toFixed(1))+"% ",3),x.value!==0?(o(),ct(b,{key:0,name:x.value>0?"lucide:arrow-up":"lucide:arrow-down",class:p(["size-3.5",x.value>0?"text-green-600":"text-red-600"])},null,8,["name","class"])):c("",!0)])])]),t("div",te,[t("label",ee,e(s.$t("dashboard.affiliate.invite_link_label")),1),t("div",se,[t("input",{value:`https://${l(A)}/?aff=${l(f).info?.aff_code}`,readonly:"",class:"flex-1 px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm text-gray-700 focus:outline-none"},null,8,ae),t("button",{onClick:K,class:"px-4 py-2 bg-gray-900 hover:bg-gray-800 text-white text-sm font-medium rounded-lg transition-colors flex items-center gap-2"},[z(b,{name:"lucide:copy",class:"text-xs"}),P(" "+e(s.$t("dashboard.affiliate.copy")),1)])])]),t("div",oe,[t("h3",ie,e(s.$t("dashboard.affiliate.how_it_works")),1),t("div",de,[t("div",re,[d[8]||(d[8]=t("span",{class:"w-6 h-6 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center text-xs font-bold"},"1",-1)),t("span",le,e(s.$t("dashboard.affiliate.step_1")),1)]),t("div",ne,[d[9]||(d[9]=t("span",{class:"w-6 h-6 rounded-full bg-purple-100 text-purple-600 flex items-center justify-center text-xs font-bold"},"2",-1)),t("span",ce,e(s.$t("dashboard.affiliate.step_2")),1)]),t("div",fe,[d[10]||(d[10]=t("span",{class:"w-6 h-6 rounded-full bg-green-100 text-green-600 flex items-center justify-center text-xs font-bold"},"3",-1)),t("span",ue,e(s.$t("dashboard.affiliate.step_3")),1)])])]),t("div",me,[t("div",he,[t("button",{onClick:d[0]||(d[0]=a=>_.value="overview"),class:p(["px-4 md:px-6 py-3 md:py-4 text-sm font-medium transition-colors border-b-2 whitespace-nowrap flex-shrink-0",_.value==="overview"?"border-primary-600 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700"])},[P(e(s.$t("dashboard.affiliate.invited_users"))+" ",1),t("span",be,e($.value.length),1)],2),t("button",{onClick:d[1]||(d[1]=a=>_.value="logs"),class:p(["px-4 md:px-6 py-3 md:py-4 text-sm font-medium transition-colors border-b-2 whitespace-nowrap flex-shrink-0",_.value==="logs"?"border-primary-600 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700"])},e(s.$t("dashboard.affiliate.commission_history")),3),t("button",{onClick:d[2]||(d[2]=a=>_.value="withdrawals"),class:p(["px-4 md:px-6 py-3 md:py-4 text-sm font-medium transition-colors border-b-2 whitespace-nowrap flex-shrink-0",_.value==="withdrawals"?"border-primary-600 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700"])}
1,e(s.$t("dashboard.affiliate.withdrawal_history")),3)]),t("div",_e,[_.value==="overview"?(o(),i("div",pe,[C.value?(o(),i("div",xe,e(s.$t("dashboard.affiliate.loading")),1)):$.value.length===0?(o(),i("div",ye,e(s.$t("dashboard.affiliate.no_invited_users")),1)):(o(),i("div",ve,[t("div",ge,[(o(!0),i(y,null,w($.value,a=>(o(),i("div",{key:a.id,class:"p-4 bg-gray-50 rounded-lg border border-gray-100"},[t("div",we,[t("div",$e,e(a.username?.charAt(0)?.toUpperCase()||"?"),1),t("span",ke,e(a.username),1)]),t("div",De,[t("span",je,e(s.$t("dashboard.affiliate.joined")),1),t("span",Ce,e(a.created_at?new Date(a.created_at*1e3).toLocaleDateString():"-"),1)]),t("div",Le,[t("span",Se,e(s.$t("dashboard.affiliate.contribution")),1),d[11]||(d[11]=t("span",{class:"text-gray-900"},"-",-1))])]))),128))]),t("div",Ue,[t("table",Ie,[t("thead",Te,[t("tr",null,[t("th",qe,e(s.$t("dashboard.affiliate.user")),1),t("th",ze,e(s.$t("dashboard.affiliate.joined")),1),t("th",Re,e(s.$t("dashboard.affiliate.contribution")),1)])]),t("tbody",We,[(o(!0),i(y,null,w($.value,a=>(o(),i("tr",{key:a.id,class:"hover:bg-gray-50/50"},[t("td",Ae,[t("div",Ve,[t("div",Ge,e(a.username?.charAt(0)?.toUpperCase()||"?"),1),t("span",Me,e(a.username),1)])]),t("td",Be,e(a.created_at?new Date(a.created_at*1e3).toLocaleDateString():"-"),1),d[12]||(d[12]=t("td",{class:"px-6 py-4 text-gray-500"},"-",-1))]))),128))])])])]))])):c("",!0)]),_.value==="logs"?(o(),i("div",Fe,[C.value?(o(),i("div",Pe,e(s.$t("dashboard.affiliate.loading")),1)):D.value.length===0?(o(),i("div",Ne,e(s.$t("dashboard.affiliate.no_commission_records")),1)):(o(),i("div",Qe,[t("div",Ee,[(o(!0),i(y,null,w(D.value,a=>(o(),i("div",{key:a.id,class:"p-4 bg-gray-50 rounded-lg border border-gray-100"},[t("div",He,[t("div",null,[t("div",Ye,e(a.invitee_nickname),1),t("div",Xe,e(a.order_no),1)]),t("div",Ze,[t("div",Je,"+"+e(l(m)(a.benefit_amount)),1),t("div",Ke,e(new Date(a.created_at*1e3).toLocaleDateString()),1)])]),t("div",Oe,[t("span",{class:p(["inline-flex text-xs px-2 py-0.5 rounded-full font-medium",a.is_settled?"bg-green-50 text-green-600":"bg-amber-50 text-amber-600"])},e(a.is_settled?s.$t("dashboard.affiliate.settled"):s.$t("dashboard.affiliate.pending")),3),a.is_settled?c("",!0):(o(),i("span",ts,e(s.$t("dashboard.affiliate.est"))+": "+e(B(a)),1))])]))),128))]),t("div",es,[t("table",ss,[t("thead",as,[t("tr",null,[t("th",os,e(s.$t("dashboard.affiliate.time")),1),t("th",is,e(s.$t("dashboard.affiliate.source")),1),t("th",ds,e(s.$t("dashboard.affiliate.amount")),1),t("th",rs,e(s.$t("dashboard.affiliate.status")),1)])]),t("tbody",ls,[(o(!0),i(y,null,w(D.value,a=>(o(),i("tr",{key:a.id,class:"hover:bg-gray-50/50"},[t("td",ns,e(new Date(a.created_at*1e3).toLocaleString()),1),t("td",cs,[t("span",fs,e(a.invitee_nickname),1),t("span",us,e(a.order_no),1)]),t("td",ms," +"+e(l(m)(a.benefit_amount)),1),t("td",hs,[t("div",bs,[t("span",{class:p(["inline-flex text-xs px-2 py-0.5 rounded-full font-medium w-fit",a.is_settled?"bg-green-50 text-green-600":"bg-amber-50 text-amber-600"])},e(a.is_settled?s.$t("dashboard.affiliate.settled"):s.$t("dashboard.affiliate.pending")),3),a.is_settled?c("",!0):(o(),i("span",_s,e(s.$t("dashboard.affiliate.est"))+": "+e(B(a)),1))])])]))),128))])])])]))])):c("",!0),_.value==="withdrawals"?(o(),i("div",ps,[j.value.length===0?(o(),i("div",xs,e(s.$t("dashboard.affiliate.no_withdrawal_records")),1)):(o(),i("div",ys,[t("div",vs,[(o(!0),i(y,null,w(j.value,a=>(o(),i("div",{key:a.id,class:"p-4 bg-gray-50 rounded-lg border border-gray-100"},[t("div",gs,[t("div",ws,e(l(m)(a.amount)),1),t("span",{class:p(["text-xs px-2 py-0.5 rounded-full font-medium",a.status==="completed"||a.status==="approved"?"bg-green-50 text-green-600":a.status==="rejected"?"bg-red-50 text-red-600":"bg-blue-50 text-blue-600"])},e(s.$t("dashboard.affiliate.status_"+a.status)),3)]),t("div",{class:"text-sm text-gray-500 mb-2 truncate",title:a.payment_info},e(a.payment_info),9,$s),t("div",ks,[t("span",null,e(new Date(a.created_at*1e3).toLocaleString()),1)]),a.note?(o(),i("p",Ds,e(a.note),1)):c("",!0)]))),128))]),t("div",js,[t("table",Cs,[t("thead",Ls,[t("tr",null,[t("th",Ss,e(s.$t("dashboard.affiliate.time")),1),t("th",Us,e(s.$t("dashboard.affiliate.amount")),1),t("th",Is,e(s.$t("dashboard.affiliate.info")),1),t("th",Ts,e(s.$t("dashboard.affiliate.status")),1)])]),t("tbody",qs,[(o(!0),i(y,null,w(j.value,a=>(o(),i("tr",{key:a.id,class:"hover:bg-gray-50/50"}
1,[t("td",zs,e(new Date(a.created_at*1e3).toLocaleString()),1),t("td",Rs,e(l(m)(a.amount)),1),t("td",Ws,[t("span",{class:"block max-w-[200px] truncate",title:a.payment_info},e(a.payment_info),9,As)]),t("td",Vs,[t("span",{class:p(["text-xs px-2 py-0.5 rounded-full font-medium",a.status==="completed"||a.status==="approved"?"bg-green-50 text-green-600":a.status==="rejected"?"bg-red-50 text-red-600":"bg-blue-50 text-blue-600"])},e(s.$t("dashboard.affiliate.status_"+a.status)),3),a.note?(o(),i("p",{key:0,class:"text-[10px] text-gray-400 mt-1 max-w-[150px] truncate",title:a.note},e(a.note),9,Gs)):c("",!0)])]))),128))])])])]))])):c("",!0)])]),L.value?(o(),i("div",Ms,[t("div",Bs,[t("h3",Fs,e(s.$t("dashboard.affiliate.request_withdrawal")),1),t("div",Ps,[t("label",Ns,e(s.$t("dashboard.affiliate.available_balance")),1),t("p",Qs,e(l(m)(u.value)),1)]),t("div",Es,[t("label",Hs,e(s.$t("dashboard.affiliate.withdrawal_amount")),1),R(t("input",{"onUpdate:modelValue":d[3]||(d[3]=a=>v.value=a),type:"number",step:"0.01",max:u.value,class:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"},null,8,Ys),[[W,v.value,void 0,{number:!0}]])]),t("div",Xs,[t("label",Zs,e(s.$t("dashboard.affiliate.payment_info_label")),1),R(t("textarea",{"onUpdate:modelValue":d[4]||(d[4]=a=>k.value=a),rows:"3",placeholder:s.$t("dashboard.affiliate.payment_info_placeholder"),class:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none"},null,8,Js),[[W,k.value]])]),t("div",Ks,[t("button",{onClick:d[5]||(d[5]=a=>L.value=!1),class:"px-4 py-2 text-gray-600 hover:text-gray-800 font-medium transition-colors"},e(s.$t("common.cancel")),1),t("button",{onClick:X,disabled:U.value,class:"px-4 py-2 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium rounded-lg transition-colors"},e(U.value?s.$t("common.submitting"):s.$t("dashboard.affiliate.submit_withdrawal")),9,Os)])])])):c("",!0),S.value?(o(),i("div",ta,[t("div",ea,[t("h3",sa,e(s.$t("dashboard.affiliate.transfer_title")),1),t("div",aa,[t("label",oa,e(s.$t("dashboard.affiliate.available_balance")),1),t("p",ia,e(l(m)(u.value)),1)]),t("div",da,[t("label",ra,e(s.$t("dashboard.affiliate.transfer_amount")),1),R(t("input",{"onUpdate:modelValue":d[6]||(d[6]=a=>g.value=a),type:"number",step:"0.01",max:u.value,class:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-gray-500 focus:border-transparent"},null,8,la),[[W,g.value,void 0,{number:!0}]])]),t("div",na,[t("p",ca,e(s.$t("dashboard.affiliate.transfer_note")),1)]),t("div",fa,[t("button",{onClick:d[7]||(d[7]=a=>S.value=!1),class:"px-4 py-2 text-gray-600 hover:text-gray-800 font-medium transition-colors"},e(s.$t("common.cancel")),1),t("button",{onClick:Z,disabled:I.value,class:"px-4 py-2 bg-gray-900 hover:bg-gray-800 disabled:bg-gray-600 text-white font-medium rounded-lg transition-colors"},e(I.value?s.$t("common.submitting"):s.$t("dashboard.affiliate.transfer")),9,ua)])])])):c("",!0),z(l(yt))],64)}}}),va=xt(ma,[["__scopeId","data-v-b4a0368f"]]);export{va 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.