1import{r as N,j as e,F as t,c2 as ne,l as O,N as de,aR as T,E,ae as z,a as S,g as ce,c as _,b6 as te,aI as U}from"./vendor-1d74b2ae.js";import{u as C,P as ie,h as v,a as h,L as $,T as re,B as p,C as W,f as me,M as f,N as y,I as L,a4 as oe,b as k,c as xe,S as pe,E as c,J as m}from"./common-8eebc293.js";import{f5 as u,fG as he,fH as fe,fI as ue,fJ as ge,fK as je,fL as be,fM as ve,fN as we,fO as Ne,fP as ye,fQ as Ce,fR as _e,fS as ke,fT as Pe,fU as Re,fV as Se}from"./vendor-public-edfaeecb.js";import{G as Ae,U as Me,T as Ie,S as P,s as qe,P as Oe,f as Ue}from"./shared/admin-page/index-8f1ef6d6.js";import{o as A,u as B,e as H,i as De}from"./vendor-mobx-9bcd0cfc.js";import{e as Te}from"./vendor-date-dedbd86c.js";import{g as R}from"./vendor-gsap-91f4e0d4.js";import"./vendor-validator-c5a947c3.js";import"./vendor-lodash-63b40c16.js";import"./vendor-radix-d8835179.js";import"./vendor-uikit-ad5d9843.js";import"./vendor-chance-40fab87c.js";import"./vendor-howler-79d8dd48.js";import"./vendor-icons-774ececc.js";import"./vendor-react-266748de.js";import"./vendor-charts-f1ff1384.js";const Ee=({code:s,onClose:i})=>{const{general:a}=C(),l=B(()=>({usersIds:[]})),r=async()=>{var d;if(!s||!["owner","admin"].includes(((d=a.user)==null?void 0:d.role)??""))return;const o=await a.getCreatorPromoCodeUsersIds(s.id);o&&(l.usersIds=o)};return N.useEffect(()=>{r()},[s]),s?e.jsx(ie,{size:"md",type:v.ADMIN_PROMO_CODE_INFO,onClose:i,children:e.jsxs("div",{className:"flex flex-col p-4 pt-0",children:[e.jsxs("h3",{className:"flex gap-3 text-lg",children:[e.jsx("span",{className:"relative text-gold-500",children:e.jsx(h,{name:"Info",size:26})}),e.jsx(t,{id:"affiliates.creator_panel_promo_code_info_popup.title",values:{code:s==null?void 0:s.code}})]}),e.jsx("hr",{className:"mb-3 mt-8 opacity-10"}),e.jsx("div",{className:"p-2",children:ne(s)?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-md mt-4",children:e.jsx(t,{id:"affiliates.creator_panel_promo_code_info_popup.requirements_label"})}),e.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-3",children:[(s==null?void 0:s.affiliateUsersOnly)&&e.jsxs("div",{className:"flex items-center p-2 ",children:[e.jsx("span",{className:"mr-2 text-gold-500",children:e.jsx(h,{name:"Checkmark"})}),e.jsx("p",{children:e.jsx(t,{id:"affiliates.creator_panel_promo_code_info_popup.only_affiliate_label"})})]}),(s==null?void 0:s.activeUsersOnly)&&e.jsxs("div",{className:"flex items-center p-2",children:[e.jsx("span",{className:"mr-2 text-gold-500",children:e.jsx(h,{name:"Checkmark"})}),e.jsx("p",{children:e.jsx(t,{id:"affiliates.creator_panel_promo_code_info_popup.only_active_affiliate_label"})})]}),(s==null?void 0:s.kycRequired)&&e.jsxs("div",{className:"flex items-center p-2",children:[e.jsx("span",{className:"mr-2 text-gold-500",children:e.jsx(h,{name:"Checkmark"})}),e.jsx("p",{children:e.jsx(t,{id:"affiliates.creator_panel_promo_code_info_popup.kyc_required_label"})})]}),!!(s!=null&&s.depositedCoinsRequired&&s.depositedCoinsRequired>0)&&e.jsxs("div",{className:"flex items-center p-2",children:[e.jsx("span",{className:"mr-2 text-gold-500",children:e.jsx(h,{name:"Checkmark"})}),e.jsxs("p",{children:[e.jsx(t,{id:"affiliates.creator_panel_promo_code_info_popup.deposited_coins_required_label",values:{coins:s.depositedCoinsRequired}}),!!(s.daysForDepositedCoinsRequired&&s.daysForDepositedCoinsRequired>0)&&e.jsx(t,{id:"affiliates.creator_panel_promo_code_info_popup.deposited_coins_last_days_required_label",values:{days:s.daysForDepositedCoinsRequired}})]})]})]})]}):e.jsx("span",{className:"text-md mt-4",children:e.jsx(t,{id:"affiliates.creator_panel_promo_code_info_popup.no_requirements_label"})})}),l.usersIds.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"mb-3 mt-4 opacity-10"}),e.jsxs("div",{className:"p-2 pb-0",children:[e.jsx("span",{className:"mt-4",children:e.jsx(t,{id:"affiliates.creator_panel_promo_code_info_popup.claimed_by_label",values:{users_lenght:l.usersIds.length}})}),e.jsx("p",{className:"pl-2",children:l.usersIds.map(o=>`#${o}`).join(", ")})]})," "]})]})}):null},ze=A(Ee),Le=[{Header:e.jsx(t,{id:"affiliates.creator_panel_past_promo_codes_table_header.code"}
1),accessor:"code",minWidth:99},{Header:e.jsx(t,{id:"affiliates.creator_panel_past_promo_codes_table_header.amount"}),accessor:"amount",minWidth:150},{Header:e.jsx(t,{id:"affiliates.creator_panel_past_promo_codes_table_header.value"}),accessor:"value",minWidth:100,Cell:s=>e.jsx(W,{coins:!0,value:s.value})},{Header:e.jsx(t,{id:"common.label.created_at"}),accessor:"createdAt",minWidth:100,Cell:s=>me(new Date(s.value))},{Header:e.jsx(t,{id:"common.label.status"}),accessor:"status",minWidth:100},{Header:e.jsx(t,{id:"common.label.actions",defaultMessage:"Actions"}),accessor:"actions",minWidth:110}],$e=({store:s})=>{const{ui:i,locale:a}=C(),l=r=>{window.confirm(a.translateMessage("affiliates.creator_panel.cancel_code_warning"))&&s.cancelCreatorPromoCode(r)};return e.jsxs("div",{className:"flex w-full flex-col overflow-hidden rounded-b-xl bg-dark-200",children:[e.jsx("h3",{className:"pl-7.5",children:e.jsx(t,{id:"affiliates.creator_panel_label.past_promo_codes"})}),s.isLoadingPastCodes?e.jsx($,{className:"mb-4 h-full w-full"}):e.jsxs(e.Fragment,{children:[e.jsx(re,{keyId:"id",backgroundStyle:"solid-dark",data:s.pastPromoCodes.data.map(r=>({code:e.jsx("button",{onClick:()=>{s.viewingPromoCode=r,i.tryOpenPopup(v.ADMIN_PROMO_CODE_INFO)},children:r.code.toUpperCase()}),amount:r.maxUses,value:r.coins,createdAt:r.createdAt,status:e.jsxs("span",{className:r.usedCnt<r.maxUses?"text-green-600":"text-gray-600",children:[r.usedCnt<r.maxUses?e.jsx(t,{id:"affiliates.creator_panel_label.code_active"}):e.jsx(t,{id:"affiliates.creator_panel_label.code_inactive"})," ",e.jsxs("span",{className:"text-white/30",children:["(",r.usedCnt,"/",r.maxUses,")"]})]}),actions:r.usedCnt<r.maxUses?e.jsx(p,{backgroundColor:"secondary",size:"small",onClick:()=>l(r.id),children:e.jsx(t,{id:"common.button.cancel"})}):e.jsx("span",{className:"text-gray-600",children:"-"})})),columns:Le}),e.jsxs("div",{className:"table-footer border-1 flex items-center justify-between bg-dark-200 p-6",children:[e.jsxs(p,{backgroundColor:"secondary",size:"small",className:"group",disabled:s.pastPromoCodes.page<=1,onClick:()=>s.loadPastPromoCodes(s.pastPromoCodes.page-1),children:[e.jsx(h,{name:"Arrow",size:18,className:"rotate-90 transition-colors group-hover:text-gold-500"}),e.jsx("span",{children:e.jsx(t,{id:"common.button.previous"})})]}),e.jsx("p",{children:s.pastPromoCodes.totalPages<=0?a.translateMessage("common.label.no_items_found"):a.translateMessage("common.label.page",{page_number:s.pastPromoCodes.page,total_pages:s.pastPromoCodes.totalPages})}),e.jsxs(p,{backgroundColor:"secondary",size:"small",className:"group",disabled:s.pastPromoCodes.page+1>s.pastPromoCodes.totalPages,onClick:()=>s.loadPastPromoCodes(s.pastPromoCodes.page+1),children:[e.jsx("span",{children:e.jsx(t,{id:"common.button.next"})}),e.jsx(h,{name:"Arrow",size:18,className:"-rotate-90 transition-colors group-hover:text-gold-500"})]})]})]}),e.jsx(ze,{code:s.viewingPromoCode,onClose:()=>{i.tryClosePopup(v.ADMIN_PROMO_CODE_INFO),setTimeout(()=>s.viewingPromoCode=null,200)}})]})},Fe=H($e),We=({checked:s,onClick:i,title:a})=>e.jsxs("label",{className:"relative inline-flex w-full cursor-pointer items-center lg:w-auto",children:[e.jsx("input",{type:"checkbox",className:"peer sr-only",checked:s,onClick:i}),e.jsxs("div",{className:"peer flex w-full select-none items-center justify-start gap-3 border-2 border-white/10 bg-white/5 px-3 py-3 text-white/90 transition hover:bg-white/10 hover:text-white peer-checked:border-gold-500/50 peer-checked:text-white md:gap-5 md:px-5 md:py-5 [&_.square]:peer-checked:border-gold-500 [&_.square]:peer-checked:bg-gold-500 [&_.text-sm]:peer-checked:text-white/80 [&_.title]:peer-checked:text-white",children:[e.jsx("span",{className:"square h-3 w-3 min-w-3 border-2 border-white/30 transition-colors"}),e.jsx("div",{className:"flex flex-col",children:e.jsx("span",{className:"title text-white/80",children:a})})]})]},0),D=A(We),Be=({store:s})=>{const{general:i,locale:a}=C();return e.jsxs(ie,{size:"md",type:v.PROMO_CODES_REQUIRMENTS,onClose:()=>f.success(a.translateMessage("affiliates.creator_panel.success_saved_requirements")),children:[e.jsxs("h3",{className:"flex gap-3 text-lg",children:[e.jsx("span",{className:"relative text-gold-500",children:e.jsx(h,{name:"Settings",size:26})}),e.jsx(t,{id:"affiliates.creator_panel_input.promo_codes_requirements",defaultMessage:"Promo Codes Requirements"})]}),e.jsx("hr",{className:"mb-3 mt-4 opacity-10"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{checked:s.promoCode.affiliateUsersOnly,onClick:()=>{s.promoCode.affiliateUsersOnly=!s.promoCode.affiliateUsersOnly,s.promoCode.affiliateUsersOnly||(s.promoCode.activeUsersOnly=!1)},title:a.translateMessage("affiliates.creator_panel_input.affiliate_users_only_label")}),e.jsx(D,{checked:s.promoCode.activeUsersOnly,onClick:()=>{s.promoCode.activeUsersOnly=!s.promoCode.activeUsersOnly,s.promoCode.activeUsersOnly&&(s.promoCode.affiliateUsersOnly=!0)},title:a.translateMessage("affiliates.creator_panel_input.active_required_label")}),i.user.role==="owner"&&e.jsxs(e.Fragment,{children:[e.jsx(D,{checked:s.promoCode.kycRequired,onClick:()=>{s.promoCode.kycRequired=!s.promoCode.kycRequired},title:a.translateMessage("affiliates.creator_panel_input.kyc_required")}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(D,{checked:s.depositedCoinsRequired,onClick:()=>{s.depositedCoinsRequired=!s.depositedCoinsRequired,s.promoCode.depositedCoinsRequired=0,s.promoCode.daysForDepositedCoinsRequired=0},title:a.translateMessage("affiliates.creator_panel_input.deposited_coins_required")}),e.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[e.jsxs("div",{className:"items-center",children:[e.jsx("h3",{className:"text-sm md:mb-1",children:e.jsx(t,{id:"affiliates.creator_panel_input.deposited",defaultMessage:"Deposited:"})}),e.jsxs("div",{className:"flex w-full items-center rounded-[4px] bg-white/5 py-2",children:[e.jsx(h,{name:"Dollar",size:18,className:"mx-1"}),e.jsx(y,{className:"w-full bg-white/5",value:s.promoCode.depositedCoinsRequired,onChange:l=>s.promoCode.depositedCoinsRequired=+l.currentTarget.value,valueIsNumericString:!0,allowNegative:!1,decimalScale:0,readOnly:!s.depositedCoinsRequired})]})]}),e.jsxs("div",{className:"items-center",children:[e.jsx("h3",{className:"text-sm md:mb-1",children:e.jsx(t,{id:"affiliates.creator_panel_input.in_the_last_days",defaultMessage:"in the last (days):"})}),e.jsx("div",{className:"flex w-full rounded-[4px] bg-white/5 px-4 py-2",children:e.jsx(y,{className:"w-full py-2",value:s.promoCode.daysForDepositedCoinsRequired,onChange:l=>s.promoCode.daysForDepositedCoinsRequired=+l.currentTarget.value,valueIsNumericString:!0,allowNegative:!1,decimalScale:0,readOnly:!s.depositedCoinsRequired})})]})]})]})]})]})]})},He=H(Be),Ge=({store:s,hasTipAccess:i})=>{const{locale:a}=C();return i&&e.jsx("div",{className:"mx-auto flex max-w-[1444px] flex-col",children:e.jsxs("div",{className:"mt-2.5 rounded-xl bg-dark-600 px-7.5 py-5",children:[e.jsx("h1",{className:"mb-2.5 text-sm font-bold text-white",children:e.jsx(t,{id:"affiliates.creator_panel_label.tipping_system"})}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsx("div",{className:"flex flex-col items-center",children:e.jsx(y,{type:"text",className:"w-full rounded-[4px] !border-gray-800 !bg-gray-900 !bg-opacity-60 !p-2.5 !pl-3.5 !text-sm font-medium placeholder-white/40 focus:!ring-1 focus:!ring-gold-700",placeholder:a.translateMessage("affiliates.creator_panel_input.enter_user_id_placeholder"),value:s.tipUserData.userId,onChange:l=>{const r=l.currentTarget.value;s.tipUserData.userId=+r||void 0},decimalScale:0})}),e.jsxs("div",{className:"relative flex flex-col items-center",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 transition-colors",children:e.jsx(h,{name:"DollarCircle",size:20})}),e.jsx(y,{type:"text",className:"w-full rounded-[4px] !border-gray-800 !bg-gray-900 !bg-opacity-60 !p-2.5 !pl-10 !text-sm font-medium placeholder-white/40 focus:!ring-1 focus:!ring-gold-700",placeholder:a.translateMessage("affiliates.creator_panel_input.enter_code_value_placeholder"),value:s.tipUserData.usd,onChange:l=>{const r=l.currentTarget.value;s.tipUserData.usd=+r||0},decimalScale:2})]}),e.jsx("div",{className:"flex flex-col items-center",children:e.jsxs(p,{className:"w-full justify-center",backgroundColor:"green",disabled:!s.tipUserData.userId||s.tipUserData.usd<.5,onClick:s.sendTip,children:[e.jsx(t,{id:"affiliates.creator_panel_button.tip"})," ",e.jsx(W,{value:s.tipUserData.usd})]})})]})]})})},Ve=H(Ge),Ye=()=>{const{general:s,ui:i,locale:a}=C(),l=B(()=>({promoCode:{code:"",amount:1,usd:1,affiliateUsersOnly:!0,activeUsersOnly:!0,kycRequired:!1,depositedCoinsRequired:0,daysForDepositedCoinsRequired:0},depositedCoinsRequired:!1,tipUserData:{userId:void 0,usd:1}
1,_loadingPastCodes:!1,pastPromoCodes:void 0,viewingPromoCode:null,async createCreatorPromoCode(){const{code:o,amount:d,usd:x,affiliateUsersOnly:j,activeUsersOnly:w,kycRequired:b,depositedCoinsRequired:M,daysForDepositedCoinsRequired:I}=this.promoCode;if(o.length&&!(d<1||x<.25))try{await s.createCreatorPromoCode({code:o,amount:d,coins:O(x),affiliateUsersOnly:j,activeUsersOnly:w,kycRequired:b,depositedCoinsRequired:O(M),daysForDepositedCoinsRequired:I}),await this.loadPastPromoCodes(1),f.success("affiliates.creator_panel.success_create_code",{code:o.toUpperCase()})}catch(q){f.error(q)}},async loadPastPromoCodes(o){if(!this._loadingPastCodes&&!(o<1))try{this._loadingPastCodes=!0,this.pastPromoCodes=await s.getCreatorPromoCodes(o)}catch(d){f.error(d)}finally{this._loadingPastCodes=!1}},async cancelCreatorPromoCode(o){var d;try{await s.cancelCreatorPromoCode(o),await this.loadPastPromoCodes(((d=this.pastPromoCodes)==null?void 0:d.page)??1),f.success("affiliates.creator_panel.success_cancel_code")}catch(x){f.error(x)}},async sendTip(){const{userId:o,usd:d}=this.tipUserData;if(!(!o||d<.5))try{await s.sendTip({userId:o,coins:O(d)}),f.success("affiliates.creator_panel.success_tip",{user_id:String(o)})}catch(x){f.error(x)}},get isLoadingPastCodes(){return this._loadingPastCodes||!this.pastPromoCodes}}));if(!s.user)return e.jsx(de,{to:"/",replace:!0});N.useEffect(()=>{T(s.user,"creator")&&l.loadPastPromoCodes(1)},[]);const r=T(s.user,"creator")||E(s.user,z.AccessSendTip);return e.jsxs("div",{id:"creator-panel",className:"mx-4 mt-5 md:mx-6",children:[T(s.user,"creator")&&e.jsxs("div",{className:"mx-auto flex max-w-[1444px] flex-col ",children:[e.jsxs("div",{className:"mt-2.5 rounded-t-xl bg-dark-600 px-7.5 py-5",children:[e.jsx("h1",{className:"mb-2.5 text-sm font-bold text-white",children:e.jsx(t,{id:"affiliates.creator_panel_label.create_promo_code"})}),e.jsx(He,{store:l}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 lg:grid-cols-5 lg:gap-3",children:[e.jsx("div",{className:"flex flex-col items-center justify-center",children:e.jsx(L,{type:"text",className:"w-full",placeholder:a.translateMessage("affiliates.creator_panel_input.enter_code_placeholder"),value:l.promoCode.code,onChange:o=>l.promoCode.code=o.currentTarget.value,backgroundColor:"bg-gray-900 bg-opacity-60",border:!1})}),e.jsxs("div",{className:"relative flex flex-col items-center justify-center",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 transition-colors",children:e.jsx(h,{name:"PlusCircle",size:20})}),e.jsx(y,{type:"text",className:"w-full rounded-[4px] !border-gray-800 !bg-gray-900 !bg-opacity-60 !p-2.5 !pl-10 !text-sm font-medium placeholder-white/40 focus:!ring-1 focus:!ring-gold-700",placeholder:a.translateMessage("common.input.enter_amount"),value:l.promoCode.amount,onChange:o=>{const d=o.currentTarget.value;l.promoCode.amount=+d||0},decimalScale:0})]}),e.jsxs("div",{className:"relative flex flex-col items-center justify-center",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 transition-colors",children:e.jsx(h,{name:"DollarCircle",size:20})}),e.jsx(y,{type:"text",className:"w-full rounded-[4px] !border-gray-800 !bg-gray-900 !bg-opacity-60 !p-2.5 !pl-10 !text-sm font-medium placeholder-white/40 focus:!ring-1 focus:!ring-gold-700",placeholder:a.translateMessage("affiliates.creator_panel_input.enter_code_value_placeholder"),value:l.promoCode.usd,onChange:o=>{const d=o.currentTarget.value;l.promoCode.usd=+d||0},decimalScale:2})]}),e.jsx("div",{className:"flex flex-col items-center",children:e.jsx(p,{className:"w-full justify-center text-xs md:text-base",onClick:()=>i.togglePopup(v.PROMO_CODES_REQUIRMENTS),children:e.jsx(t,{id:"affiliates.creator_panel_input.requirements",defaultMessage:"Requirements"})})}),e.jsx("div",{className:"flex flex-col items-center",children:e.jsx(p,{className:"w-full justify-center",backgroundColor:"green",disabled:!l.promoCode.code.length||l.promoCode.amount<1||l.promoCode.amount>1e3||l.promoCode.usd<.5,onClick:l.createCreatorPromoCode,children:e.jsx(t,{id:"affiliates.creator_panel_button.create"})})})]}),e.jsx("hr",{className:"my-3 h-1 border-gray-900"}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("div",{className:"",children:[e.jsx(t,{id:"affiliates.creator_panel_label.total"}),":"," ",e.jsx(W,{value:l.promoCode.amount*O(l.promoCode.usd),coins:!0})]})})]}),e.jsx(Fe,{store:l})]}),e.jsx(Ve,{store:l,hasTipAccess:r})]})},Je=A(Ye),le=({selected:s,onChange:i})=>e.jsxs("div",{className:"flex h-11 items-center rounded-lg bg-dark-100 px-4",children:[e.jsx("span",{className:"text-sm text-gray-light/60",children:e.jsx(t,{id:"common.data_picker.from"})}
1)," ",e.jsx(Te,{className:"w-[108px] cursor-pointer !border-none bg-transparent text-sm text-gray-light focus:border-none",selected:s,onChange:i}),e.jsx(h,{name:"Calendar"})]}),Qe=({chartStatsReq:s,handleChartFilter:i,loadingChart:a,chartStats:l})=>{const r=N.useRef(null),[o,d]=N.useState(2);return N.useEffect(()=>{if(!r.current)return;const x=()=>{if(!r.current)return;const w=r.current.clientWidth;let b=0;w>640?b=2:w>480&&(b=1),d(b)},j=new ResizeObserver(x);return j.observe(r.current),x(),()=>j.disconnect()},[]),e.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-2xl bg-dark-600 p-6",children:[e.jsxs("div",{className:o===2?"flex flex-row items-center justify-between gap-3":"flex flex-col items-stretch gap-3",ref:r,children:[e.jsxs("div",{className:o===2?"flex gap-3 overflow-hidden":"grid grid-cols-2 gap-3 overflow-hidden",children:[e.jsx(p,{backgroundColor:s.type===S.MONEY_EARNED?"primary":"secondary",onClick:()=>i({type:S.MONEY_EARNED}),children:e.jsx("span",{className:"flex w-full items-center justify-center",children:e.jsx(t,{id:"affiliates.dashboard_label.money_earned"})})}),e.jsx(p,{backgroundColor:s.type===S.REFERRALS?"primary":"secondary",onClick:()=>i({type:S.REFERRALS}),children:e.jsx("span",{className:"flex w-full items-center justify-center",children:e.jsx(t,{id:"affiliates.dashboard_label.referees"})})})]}),e.jsxs("div",{className:o===0?"flex flex-col items-stretch gap-3":"grid grid-cols-2 gap-3",children:[e.jsx(le,{selected:new Date(s.fromMs??Date.now()),onChange:x=>{x&&i({fromMs:x.getTime()})}}),e.jsx(le,{selected:new Date(s.toMs??Date.now()),onChange:x=>{x&&i({toMs:x.getTime()})}})]})]}),e.jsx("div",{className:"mt-2 flex h-full w-full",children:a?e.jsx($,{className:"h-full w-full"}):e.jsx(Ae,{data:l})})]})},Xe=()=>{var o,d,x,j,w,b,M,I,q,G,V,Y,J,Q,X,K,Z,ee,se,ae;const{general:s,locale:i}=C(),a=B(()=>({affiliateCode:null,overview:null,loadingUsers:!1,usersReq:{page:1,codeId:null},users:null,chartStatsReq:{fromMs:new Date(Date.now()-3*24*60*60*1e3).getTime(),toMs:Date.now(),type:S.MONEY_EARNED,codeId:null},chartStats:[],onInit:async()=>{var n;if(await a.fetchOverview(null),s.user&&E(s.user,z.AdminAffiliates)&&(a.adminReservedCodes=await s.adminGetReservedCodes()),!((n=a.overview)!=null&&n.code)){a.loadingUsers=!1;return}a.fetchChartStats(),a.fetchUsers(1)},fetchOverview:async n=>{a.overview=await s.getAffiliateOverview(n),a.affiliateCode=a.overview.code},fetchChartStats:async()=>{a.chartStats=await s.getAffiliateStatistics(a.chartStatsReq)},async fetchUsers(n){if(!this.loadingUsers){this.loadingUsers=!0;try{this.users=await s.getAffiliateUsers({...this.usersReq,page:n}),this.usersReq.page=n}catch(g){f.error(g)}finally{this.loadingUsers=!1}}},async updateAffiliateCode(){var n;if(!(!this.affiliateCode||!te(this.affiliateCode)||this.adminSelectedCodeId))try{const g=await s.updateAffiliateCode(this.affiliateCode);f.success(g.translationId,g.values),(n=a.overview)!=null&&n.code||this.onInit()}catch(g){f.error(g)}},async claimMoney(){var n;if(!(!((n=this.overview)!=null&&n.data)||this.overview.data.claimableCoins<=0||this.adminSelectedCodeId))try{await s.claimAffiliateFunds(),await this.fetchOverview(null)}catch(g){f.error(g)}},adminSelectedCodeId:null,adminReservedCodes:[],adminCodeValue:null,async adminReserveCode(){if(this.adminCodeValue)try{await s.adminReserveCode(this.adminCodeValue),this.adminCodeValue=null,a.adminReservedCodes=await s.adminGetReservedCodes()}catch(n){f.error(n)}},loadingCodePreview:!1,async adminHandleCodePreview(n){if(!this.loadingCodePreview){this.loadingCodePreview=!0;try{this.adminSelectedCodeId=this.adminSelectedCodeId===n?null:n,this.chartStatsReq.codeId=this.adminSelectedCodeId,this.usersReq.codeId=this.adminSelectedCodeId,await Promise.all([this.fetchOverview(this.adminSelectedCodeId),this.fetchChartStats(),this.fetchUsers(1)])}finally{this.loadingCodePreview=!1}}},loadingChart:!1,async handleChartFilter(n){if(!this.loadingChart)try{if(this.loadingChart=!0,n.type&&(this.chartStatsReq.type=n.type),n.fromMs){if(n.fromMs>this.chartStatsReq.toMs)return;this.chartStatsReq.fromMs=n.fromMs}if(n.toMs){if(n.toMs<this.chartStatsReq.fromMs)return;this.chartStatsReq.toMs=n.toMs}await this.fetchChartStats()}finally{this.loadingChart=!1}}}));N.useEffect(()=>{a.onInit()},[]);const l=((d=(o=a.overview)==null?void 0:o.data)==null?void 0:d.totalDepositedCoins)||0,r=ce(l||0);return e.jsxs(e.Fragment,{children:[e.jsx(oe,{title:i.translateMessage("affiliates.page_meta.title"),description:i.translateMessage("affiliates.page_meta.description")}),e.jsxs("div",{id:"dashboard",className:"mx-4 md:mx-6",children:[s.user&&E(s.user,z.AdminAffiliates)&&e.jsxs("div",{className:"mx-auto mt-5 flex max-w-[1444px] flex-col rounded-2xl bg-dark-600 p-7.5",children:[e.jsx("h3",{className:"text-sm font-bold text-white",children:e.jsx(t,{id:"affiliates.dashboard_label.reserved_codes"})}),e.jsxs("div",{className:"mt-2 flex flex-col items-center",children:[e.jsx(L,{value:a.adminCodeValue??void 0,type:"text",className:"w-full",placeholder:i.translateMessage("affiliates.dashboard_input.reserved_codes_placeholder"),backgroundColor:"bg-gray-900 bg-opacity-60",border:!1,onChange:n=>a.adminCodeValue=n.currentTarget.value,endAdornment:e.jsx(p,{className:"ml-2",backgroundColor:"dark",onClick:a.adminReserveCode,children:e.jsx(t,{id:"affiliates.dashboard_button.add_reserved_codes"})})}),e.jsx("div",{className:"mt-5",children:a.adminReservedCodes.map(n=>{const g=a.adminSelectedCodeId===n.id;return e.jsx("div",{className:`mr-1 inline rounded-lg bg-gray-900 bg-opacity-60 p-2 ${g?"border border-green-500":""}`,children:e.jsx("span",{className:`${a.loadingCodePreview?"cursor-wait":"cursor-pointer"}`,onClick:()=>a.adminHandleCodePreview(n.id),children:n.code})},n.code)})})]})]}),a.overview?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mx-auto mt-10 flex max-w-[1444px] grid-rows-2 flex-col gap-4 overflow-hidden lg:grid lg:grid-cols-[458px_1fr_1fr_1fr]",children:[e.jsx("div",{className:"box row-span-2 row-start-1 rounded-2xl bg-dark-200",children:e.jsxs("div",{className:"flex flex-col p-6",children:[e.jsx("div",{className:"user grid grid-cols-[85px_1fr] items-center gap-6",children:e.jsx(Me,{user:((x=a.overview.data)==null?void 0:x.user)??s.user,depositedCoins:l})}),e.jsx("hr",{className:"my-6 h-[1px] border-0 bg-dark-100 opacity-60"}),e.jsx("div",{className:"tier",children:e.jsx(Ie,{depositedCoins:l})})]})}),e.jsx(P,{className:"col-start-2",text:"All referees",value:((w=(j=a.overview)==null?void 0:j.data)==null?void 0:w.referrals)||0}),e.jsx(P,{className:"col-start-3",text:"Active referees",value:((M=(b=a.overview)==null?void 0:b.data)==null?void 0:M.activeReferrals)||0}),e.jsx(P,{className:"col-start-4",text:"Total deposited",value:k(_(((q=(I=a.overview)==null?void 0:I.data)==null?void 0:q.totalDepositedCoins)||0))}),e.jsx(P,{className:"col-start-5",text:"Total opened",value:k(_(((V=(G=a.overview)==null?void 0:G.data)==null?void 0:V.totalWageredCoins)||0))}),e.jsx(P,{className:"col-start-6",text:"Commissions paid",value:k(_(((J=(Y=a.overview)==null?void 0:Y.data)==null?void 0:J.earnedCoins)||0))}),e.jsx("div",{className:"box col-start-2 col-end-7 rounded-2xl bg-dark-100",children:e.jsxs("div",{className:"flex flex-row items-center justify-between p-6",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h3",{className:"text-lg font-bold text-white",children:k(_(((X=(Q=a.overview)==null?void 0:Q.data)==null?void 0:X.claimableCoins)||0))}),e.jsx("p",{className:"mt-2 text-sm text-gray-light",children:e.jsx(t,{id:"affiliates.dashboard_label.available_funds"})})," "]}),e.jsx("div",{className:"",children:e.jsxs(p,{onClick:a.claimMoney,className:"min-w-[155px] justify-center",backgroundColor:"green",disabled:(((Z=(K=a.overview)==null?void 0:K.data)==null?void 0:Z.claimableCoins)??0)<=0||a.adminSelectedCodeId!==null,children:[e.jsx(t,{id:"affiliates.dashboard_label.claim"})," ",k(_(((se=(ee=a.overview)==null?void 0:ee.data)==null?void 0:se.claimableCoins)||0))]})})]})})]}),e.jsxs("div",{className:"mx-auto mt-6 grid max-w-[1444px] grid-cols-1 gap-6 md:grid-cols-2",children:[e.jsx(Qe,{chartStatsReq:a.chartStatsReq,handleChartFilter:a.handleChartFilter,loadingChart:
1a.loadingChart,chartStats:a.chartStats}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"mb-6 rounded-2xl bg-dark-600 p-7.5",children:[e.jsx("h3",{className:"text-sm font-bold text-white",children:e.jsx(t,{id:"affiliates.dashboard_label.affiliate_code"})}),e.jsxs("div",{className:"mt-3 flex items-center",children:[e.jsx(L,{className:"mr-3 w-full",placeholder:"Enter your code...",value:a.affiliateCode??void 0,onChange:n=>a.affiliateCode=n.currentTarget.value,disabled:a.adminSelectedCodeId!==null}),e.jsx(p,{className:"ml-auto",onClick:a.updateAffiliateCode,disabled:a.affiliateCode===((ae=a.overview)==null?void 0:ae.code)||!te(a.affiliateCode??"")||a.adminSelectedCodeId!==null,children:e.jsx(t,{id:"common.button.save"})})]}),e.jsx("div",{className:"mt-2 flex items-center",children:e.jsx(L,{className:"w-full py-0.5",inputClassName:"text-gray-700 py-2.5",wrapperClassName:"border border-gray-800 rounded-[4px]",border:!1,placeholder:`${window.location.origin}/r/`,value:`${window.location.origin}/r/${a.affiliateCode??""}`,endAdornment:e.jsx(h,{className:"mr-2 cursor-pointer items-center opacity-50 transition-opacity hover:opacity-100",name:"Copy",onClick:()=>xe(`${window.location.origin}/r/${a.affiliateCode??""}`)}),readOnly:!0})})]}),a.users?a.loadingUsers?e.jsx($,{className:"h-full w-full"}):e.jsxs("div",{className:"flex w-full flex-col",children:[e.jsx(re,{keyId:"stats",backgroundStyle:"solid-dark",data:a.users.data,columns:qe}),e.jsxs("div",{className:"table-footer border-1 flex items-center justify-between rounded-2xl bg-dark-200 p-6",children:[e.jsxs(p,{backgroundColor:"secondary",size:"small",className:"group",disabled:a.usersReq.page<=1,onClick:()=>a.fetchUsers(a.usersReq.page-1),children:[e.jsx(h,{name:"Arrow",size:18,className:"rotate-90 transition-colors group-hover:text-gold-500"}),e.jsx("span",{children:e.jsx(t,{id:"common.button.previous"})})]}),e.jsx("p",{children:a.users.totalPages<=0?i.translateMessage("common.label.no_items_found"):i.translateMessage("common.label.page",{page_number:a.usersReq.page,total_pages:a.users.totalPages})}),e.jsxs(p,{backgroundColor:"secondary",size:"small",className:"group",disabled:a.usersReq.page+1>a.users.totalPages,onClick:()=>a.fetchUsers(a.usersReq.page+1),children:[e.jsx("span",{children:e.jsx(t,{id:"common.button.next"})}),e.jsx(h,{name:"Arrow",size:18,className:"-rotate-90 transition-colors group-hover:text-gold-500"})]})]})]}):null]})]}),a.overview.code&&(T(s.user,"creator")||E(s.user,z.AccessSendTip))&&e.jsx(Je,{}),e.jsx("div",{className:"mx-auto mt-8 max-w-[710px]",children:e.jsx(Oe,{level:r.level})})]}):e.jsx($,{className:"mt-10 h-full w-full"})]})]})},gs=A(Xe);var Ke=Object.defineProperty,Ze=Object.getOwnPropertyDescriptor,es=(s,i,a,l)=>{for(var r=l>1?void 0:l?Ze(i,a):i,o=s.length-1,d;o>=0;o--)(d=s[o])&&(r=(l?d(i,a,r):d(r))||r);return l&&r&&Ke(i,a,r),r};let F=class extends pe{constructor(){super(...arguments),this.state={step:1,hover:!1},this.bgAnimateLeft=R.timeline(),this.bgAnimateRight=R.timeline(),this.bgAnimateLine1=R.timeline(),this.bgAnimateLine2=R.timeline(),this.handleMouseEnter=s=>{this.setState({hover:!0});const i=s==null?void 0:s.currentTarget,a=i==null?void 0:i.getAttribute("data-step");this.setState({step:parseInt(a||"1")})},this.handleMouseLeave=()=>{this.setState({hover:!1})}}componentDidMount(){document.querySelectorAll(".how-it-works-steps > div").forEach(o=>{o.addEventListener("mouseenter",this.handleMouseEnter),o.addEventListener("mouseleave",this.handleMouseLeave)}),this.animationInterval=setInterval(()=>{this.state.hover||(this.setState({step:this.state.step+1}),this.state.step>=3&&this.setState({step:1}))},3e3);const s=document.querySelectorAll(".bg-line-1"),i=document.querySelectorAll(".bg-line-2");if(this.bgAnimateLine1.set(s,{y:"-100%"}).to(s,{y:"200%",ease:"none",repeat:-1,duration:3,repeatDelay:6}),this.bgAnimateLine2.set(i,{y:"-100%"}).to(i,{y:"200%",ease:"none",repeat:-1,duration:2,repeatDelay:6}),window.innerWidth<768)return;const a=document.querySelectorAll(".header-bg-animate-group"),l=document.querySelectorAll(".header-bg-animate-left"),r=document.querySelectorAll(".header-bg-animate-right");a.forEach(o=>{const d=[];for(let x=0;x<o.children.length;x++){const j=o.children[x];d.push(j)}
1d.forEach(x=>{o.appendChild(x.cloneNode(!0))})}),this.bgAnimateLeft.to(l,{x:"-100%",ease:"none",repeat:-1,duration:60}),R.timeline({repeat:-1}).set(r,{x:"-100%"}).to(r,{x:"0%",ease:"none",repeat:-1,duration:60})}componentWillUnmount(){document.querySelectorAll(".how-it-works-steps > div").forEach(s=>{s.removeEventListener("mouseenter",i=>this.handleMouseEnter(i)),s.removeEventListener("mouseleave",this.handleMouseLeave)}),clearInterval(this.animationInterval),this.bgAnimateLeft.kill(),this.bgAnimateRight.kill(),this.bgAnimateLine1.kill(),this.bgAnimateLine2.kill()}render(){return e.jsxs(e.Fragment,{children:[e.jsx(oe,{title:this.store.locale.translateMessage("affiliates.page_meta.title"),description:this.store.locale.translateMessage("affiliates.page_meta.description")}),e.jsx("div",{className:"container mx-auto mt-8 px-4 md:px-6",children:e.jsxs("div",{className:"mx-auto flex w-full flex-col gap-16 md:gap-24",children:[e.jsxs("div",{className:c("relative overflow-hidden rounded-2xl bg-gray-900 py-12 md:py-20",m),children:[e.jsxs("div",{className:"relative z-10 flex flex-col items-center text-center",children:[e.jsxs("div",{className:"mb-5 flex items-center gap-8 text-gold-500 md:gap-15",children:[e.jsx("span",{className:"hidden h-[5px] w-[5px] bg-gold-500 md:block"}),e.jsx("span",{className:"h-[5px] w-[5px] bg-gold-500"}),e.jsx("span",{className:"h-[5px] w-[5px] bg-gold-500"}),e.jsx(h,{name:"Crown",size:38}),e.jsx("span",{className:"h-[5px] w-[5px] bg-gold-500"}),e.jsx("span",{className:"h-[5px] w-[5px] bg-gold-500"}),e.jsx("span",{className:"hidden h-[5px] w-[5px] bg-gold-500 md:block"})]}),e.jsxs("h1",{className:"text-[36px] font-extrabold leading-[55px] lg:text-[50px] lg:leading-[72px]",children:[e.jsx("span",{className:"text-[52px] text-gold-500 lg:text-[66px]",children:"Royale"})," ",e.jsx("br",{className:""}),e.jsx(t,{id:"affiliates.label.title"})]}),e.jsx("p",{className:"mt-4 px-4 text-sm text-white/90 md:text-base lg:text-lg",children:e.jsx(t,{id:"affiliates.label.info"})}),this.store.general.isLoggedIn?e.jsx(U,{to:"/affiliates/dashboard",children:e.jsx(p,{className:"mt-10 min-w-[180px] justify-center px-10",size:"large",children:e.jsx(t,{id:"affiliates.button.view_dashboard"})})}):e.jsx(p,{className:"mt-10 min-w-[180px] justify-center px-10",size:"large",backgroundColor:"secondary-light",onClick:()=>this.store.ui.tryOpenPopup(v.AUTHENTICATION),children:e.jsx(t,{id:"common.user.need_to_be_logged"})})]}),e.jsxs("div",{className:"absolute left-1/2 top-0 h-full w-full min-w-[800px] -translate-x-1/2 lg:min-w-[1200px]",children:[e.jsx("div",{className:"absolute -left-2 top-0 hidden h-[424px] w-1 md:block",children:e.jsxs("div",{className:"absolute left-1/2 flex h-full w-[1272px] -translate-x-1/2 rotate-45 transform flex-col",children:[e.jsx("span",{className:"absolute -top-7 left-10 hidden h-1 w-full bg-white/5 md:block"}),e.jsx("div",{className:"flex h-full w-full",children:e.jsxs("div",{className:"header-bg-animate-group header-bg-animate-left flex h-full w-full gap-3",children:[e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx(u,{width:110,height:110,className:"opacity-30"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx("img",{src:he,className:"opacity-30",width:120,height:120,alt:"Supreme box"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx(u,{width:110,height:110,className:"opacity-30"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx("img",{src:fe,className:"opacity-30",width:120,height:120,alt:"Yeezy box"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx(u,{width:110,height:110,className:"opacity-30"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx("img",{src:ue,className:"opacity-30",width:120,height:120,alt:"Apple box"})})]})}),e.jsx("div",{className:"flex h-full w-full",children:e.jsxs("div",{className:"header-bg-animate-group header-bg-animate-right flex h-full w-full gap-3",children:[e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx("img",{src:ge,className:"opacity-30",width:120,height:120,alt:"Gold box"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx(u,{width:110,height:110,className:"opacity-30"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx("img",{src:je,className:"opacity-30",width:120,height:120,alt:"Lego box"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx(u,{width:110,height:110,className:"opacity-30"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx("img",{src:be,className:"opacity-30",width:120,height:120,alt:"PS box"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx(u,{width:110,height:110,className:"opacity-30"})})]})})]})}),e.jsx("div",{className:"absolute right-14 top-0 hidden h-[424px] w-1 md:block",children:e.jsxs("div",{className:"absolute left-1/2 flex h-full w-[1272px] -translate-x-1/2 rotate-45 transform flex-col",children:[e.jsx("span",{className:"absolute -bottom-4 left-0 hidden h-1 w-full bg-white/5 md:block"}),e.jsx("div",{className:"flex h-full w-full",children:e.jsxs("div",{className:"header-bg-animate-group header-bg-animate-left flex h-full w-full gap-3",children:[e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx("img",{src:ve,className:"opacity-30",width:120,height:120,alt:"Jordan box"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx(u,{width:110,height:110,className:"opacity-30"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx("img",{src:we,className:"opacity-30",width:120,height:120,alt:"Vuitton box"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx(u,{width:110,height:110,className:"opacity-30"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx("img",{src:Ne,className:"opacity-30",width:120,height:120,alt:"OffWhite box"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx(u,{width:110,height:110,className:"opacity-30"})})]})}),e.jsx("div",{className:"flex h-full w-full",children:e.jsxs("div",{className:"header-bg-animate-group header-bg-animate-right flex h-full w-full gap-3",children:[e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx(u,{width:110,height:110,className:"opacity-30"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx("img",{src:ye,className:"opacity-30",width:120,height:120,alt:"Rolex box"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx(u,{width:110,height:110,className:"opacity-30"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx("img",{src:Ce,className:"opacity-30",width:120,height:120,alt:"Womens box"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx(u,{width:110,height:110,className:"opacity-30"})}),e.jsx("div",{className:c("flex h-[200px] min-h-[200px] w-[200px] min-w-[200px] items-center justify-center bg-dark-200",m),children:e.jsx("img",{src:_e,className:"opacity-30",width:120,height:120,alt:"Xbox box"})})]})})]})})]})]}),e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx("h2",{className:"text-3xl font-extrabold",children:e.jsx(t,{id:"affiliates.label.how_works"})}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2 lg:gap-8",children:[e.jsxs("div",{className:"how-it-works-steps flex flex-col gap-2",children:[e.jsxs("div",{className:"relative flex flex-col overflow-hidden rounded-2xl bg-gray-900 py-6 pl-10 pr-6 transition-colors hover:bg-gray-800/50 md:flex-row md:items-center md:gap-6","data-step":"1",children:[e.jsx("span",{className:`translate absolute left-0 top-1/2 h-5 w-5 -translate-x-1/2 -translate-y-1/2 rotate-45 transform transition-colors ${this.state.step===1?"bg-gold-400":"bg-gray-800"}`}),e.jsxs("div",{className:"border-white/10 pr-4 text-2xl font-bold md:border-r-2 md:pr-6",children:["01",e.jsx("span",{className:"text-gold-500",children:"."})]}),e.jsx("span",{className:"text-sm text-white/90 md:text-base",children:e.jsx(t,{id:"affiliates.label.how_works_1"})})]}),e.jsxs("div",{className:"relative flex flex-col overflow-hidden rounded-2xl bg-gray-900 py-6 pl-10 pr-6 transition-colors hover:bg-gray-800/50 md:flex-row md:items-center md:gap-6","data-step":"2",children:[e.jsx("span",{className:`translate absolute left-0 top-1/2 h-5 w-5 -translate-x-1/2 -translate-y-1/2 rotate-45 transform transition-colors ${this.state.step===2?"bg-gold-400":"bg-gray-800"}`}),e.jsxs("div",{className:"border-white/10 pr-4 text-2xl font-bold md:border-r-2 md:pr-6",children:["02",e.jsx("span",{className:"text-gold-500",children:"."})]}),e.jsx("span",{className:"text-sm text-white/90 md:text-base",children:e.jsx(t,{id:"affiliates.label.how_works_2"})})]}),e.jsxs("div",{className:"relative flex flex-col overflow-hidden rounded-2xl bg-gray-900 py-6 pl-10 pr-6 transition-colors hover:bg-gray-800/50 md:flex-row md:items-center md:gap-6","data-step":"3",children:[e.jsx("span",{className:`translate absolute left-0 top-1/2 h-5 w-5 -translate-x-1/2 -translate-y-1/2 rotate-45 transform transition-colors ${this.state.step===3?"bg-gold-400":"bg-gray-800"}`}),e.jsxs("div",{className:"border-white/10 pr-4 text-2xl font-bold md:border-r-2 md:pr-6",children:["03",e.jsx("span",{className:"text-gold-500",children:"."})]}),e.jsx("span",{className:"text-sm text-white/90 md:text-base",children:e.jsx(t,{id:"affiliates.label.how_works_3"})})]})]}),e.jsxs("div",{className:c("relative mt-3 h-[328px] overflow-hidden rounded-2xl bg-gradient-to-b from-white/[2%] to-white/[17%] lg:mt-0",m),children:[e.jsx("div",{className:"how-it-works-illustraion absolute left-1/2 top-1/2 z-10 w-[170px] -translate-x-1/2 -translate-y-1/2 transform",children:e.jsx("img",{src:ke,width:512,height:512,className:"relative top-4 scale-75 md:scale-100",alt:"Throne image"})}),e.jsx("div",{className:`absolute left-1/2 top-1/2 z-10 w-[512px] -translate-x-1/2 transform transition duration-1000 ${this.state.step===3?"-translate-y-1/2 opacity-100":"-translate-y-[70%] opacity-0"}`,children:e.jsx("img",{src:Pe,width:512,height:512,className:"relative -top-20",alt:"Money image"})}),e.jsx("span",{className:"absolute bottom-0 left-0 h-[108px] w-full border-t-2 border-black/60 bg-gradient-to-b from-black/30 to-transparent"}
1),e.jsx("div",{className:`absolute bottom-[108px] left-0 flex w-full items-end justify-center gap-10 transition duration-1000 ${this.state.step<2?"opacity-50 grayscale":""}`,children:e.jsx("span",{className:"h-[210px] w-[160px] bg-gradient-to-t from-gold-500 to-transparent opacity-20 md:w-[232px]"})}),e.jsxs("div",{className:`absolute bottom-[108px] left-0 flex w-full items-end justify-center gap-6 transition-all duration-1000 md:gap-10 ${this.state.step<2?"h-[50px] opacity-50 grayscale":"h-[120px]"} ${this.state.step===3?"!h-[180px]":""}`,children:[e.jsx("span",{className:"h-[33%] w-2 bg-gradient-to-t from-gold-500 to-transparent opacity-20"}),e.jsx("span",{className:"h-[66%] w-2 bg-gradient-to-t from-gold-500 to-transparent opacity-40"}),e.jsx("span",{className:"h-full w-2 bg-gradient-to-t from-gold-500 to-transparent opacity-70"}),e.jsx("span",{className:"h-[250px] w-[180px] md:w-[232px]"}),e.jsx("span",{className:"h-full w-2 bg-gradient-to-t from-gold-500 to-transparent opacity-70"}),e.jsx("span",{className:"h-[66%] w-2 bg-gradient-to-t from-gold-500 to-transparent opacity-40"}),e.jsx("span",{className:"h-[33%] w-2 bg-gradient-to-t from-gold-500 to-transparent opacity-20"})]})]})]})]}),e.jsxs("div",{className:"flex flex-col justify-center gap-3 rounded-2xl bg-gray-900/70 px-6 py-6 text-white/70 md:flex-row",children:[e.jsx(h,{name:"Community",size:24}),e.jsx("span",{children:e.jsx(t,{id:"affiliates.label.referred_users_bonus"})})]})]}),e.jsx("div",{className:"h-1 bg-white/5 lg:my-0"}),e.jsxs("div",{className:"flex flex-col gap-8 lg:flex-row",children:[e.jsxs("div",{className:"relative flex w-full items-center justify-center overflow-hidden rounded-2xl bg-gray-900",children:[e.jsx("div",{className:"relative z-10 p-8",children:e.jsx("img",{src:Re,width:512,height:512,alt:"Graph image",className:"max-w-[98%] md:max-w-[500px]"})}),e.jsx("div",{className:"absolute left-0 top-0 h-full w-1",children:e.jsx("div",{className:"absolute left-1/2 h-full w-[1800px] -translate-x-1/2 rotate-45 transform bg-white/5"})})]}),e.jsxs("div",{className:"min-w-1/2 order-first flex w-full flex-col justify-center gap-6 lg:order-last",children:[e.jsx("h2",{className:"text-3xl font-extrabold",children:e.jsx(t,{id:"affiliates.label.live_referral_statistics"})}),e.jsx("div",{className:"flex flex-col gap-3 text-white/80 md:mb-8 lg:text-lg",children:e.jsx(t,{id:"affiliates.label.live_referral_statistics_info"})}),this.store.general.isLoggedIn?e.jsx(U,{to:"/affiliates/dashboard",children:e.jsx(p,{className:"border-2 border-white/20 !transition-colors hover:border-gold-500",size:"large",backgroundColor:"transparent",children:e.jsx(t,{id:"affiliates.button.view_dashboard"})})}):e.jsx("div",{children:e.jsx(p,{className:"border-2 border-white/10 !text-white/60 !transition-colors hover:border-white/30",size:"large",backgroundColor:"transparent",onClick:()=>this.store.ui.tryOpenPopup(v.AUTHENTICATION),children:e.jsx(t,{id:"affiliates.button.login_to_view_dashboard"})})})]})]}),e.jsx("div",{className:"flex flex-col gap-8",children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx("h2",{className:"text-3xl font-extrabold",children:e.jsx(t,{id:"affiliates.label.partner_levels"})}),e.jsxs("div",{className:"grid gap-1 sm:gap-2 md:grid-cols-2 md:gap-3 lg:grid-cols-3",children:[Ue.map((s,i)=>e.jsxs("div",{className:"group flex gap-4 rounded-2xl bg-dark-600 px-6 py-5 transition-colors hover:bg-gray-900 md:gap-7",children:[e.jsxs("div",{className:`relative flex h-12 w-12 min-w-12 items-center justify-center rounded-full border-2 bg-dark-600 ${i===9?"bg-gold-500/20":""}`,style:{borderColor:s.borderColor||"red"},children:[e.jsx("span",{children:i+1}),i===9&&e.jsx("span",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 scale-[125%] transform",children:e.jsx(Se,{className:"relative -left-0.5"})})]}),e.jsx("div",{className:"h-full w-0.5 bg-white/5"}),e.jsxs("div",{className:"flex w-full items-end justify-between md:justify-start",children:[e.jsxs("div",{className:"flex flex-col gap-1 md:w-[55%]",children:[e.jsx("span",{className:"text-sm md:text-base",children:s.toNextLevel}),e.jsx("span",{className:"text-xs text-white/50 transition-colors group-hover:text-white/80",children:e.jsx(t,{id:"affiliates.label.partner_levels_next_tier"})})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm",children:s.percentage}),e.jsx("span",{className:"text-xs text-white/50 transition-colors group-hover:text-white/80",children:e.jsx(t,{id:"affiliates.label.partner_levels_percentage"})})]})]})]},i)),e.jsx("div",{className:"bg-dark-600"}),e.jsx("div",{className:"bg-dark-600"})]})]})}),e.jsxs("div",{className:"relative overflow-hidden rounded-2xl bg-dark-600 pb-10 pt-20 md:pb-12",children:[e.jsx("span",{className:"absolute left-1/2 top-0 z-10 block h-[60px] w-[60px] -translate-x-1/2 -translate-y-1/2 rotate-45 transform bg-dark-
1500 md:h-[82px] md:w-[82px]"}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center text-center",children:[e.jsxs("div",{className:"mb-5 flex items-center gap-15 text-gold-500",children:[e.jsx("span",{className:"h-[12px] w-[12px] rotate-45 bg-gray-800"}),e.jsx("span",{className:"h-[14px] w-[14px] rotate-45 bg-gold-500"}),e.jsx("span",{className:"h-[12px] w-[12px] rotate-45 bg-gray-800"})]}),e.jsx("p",{className:"mb-3 mt-4 text-white/50 lg:text-xl",children:e.jsx(t,{id:"affiliates.label.waiting_for"})}),e.jsx("h2",{className:"text-2xl font-bold md:text-[36px] md:leading-[55px] lg:text-[46px] lg:leading-[60px]",children:e.jsx(t,{id:"affiliates.label.get_your_link"})}),e.jsxs("div",{className:"relative mt-10",children:[this.store.general.isLoggedIn?e.jsx(U,{to:"/affiliates/dashboard",children:e.jsx(p,{className:"md:px-28",size:"large",children:e.jsx(t,{id:"affiliates.button.view_dashboard"})})}):e.jsx(p,{className:"md:px-28",size:"large",backgroundColor:"secondary-light",onClick:()=>this.store.ui.tryOpenPopup(v.AUTHENTICATION),children:e.jsx(t,{id:"common.user.need_to_be_logged"})}),e.jsx("span",{className:"absolute -right-10 top-1/2 hidden h-1 w-[230px] -translate-y-1/2 translate-x-full transform bg-gradient-to-l from-transparent to-gold-500 opacity-70 sm:block"}),e.jsx("span",{className:"absolute -left-10 top-1/2 hidden h-1 w-[230px] -translate-x-full -translate-y-1/2 transform bg-gradient-to-r from-transparent to-gold-500 opacity-70 sm:block"})]}),e.jsxs("div",{className:"mt-10 flex gap-2 text-sm text-white/60 sm:gap-4 md:mt-16 md:text-base",children:[e.jsx("span",{children:e.jsx(t,{id:"common.label.need_more_help"})}),e.jsx("span",{className:"hidden md:block",children:e.jsx(h,{name:"Help",size:24})}),e.jsx("span",{children:e.jsx(t,{id:"common.label.visit_faq_page",values:{link:s=>e.jsx(U,{to:"/faq",className:"text-white transition-colors hover:text-gold-500",children:s})}})})]})]}),e.jsxs("div",{className:"absolute left-1/2 top-0 h-full w-full min-w-[1000px] -translate-x-1/2 transform",children:[e.jsx("div",{className:"absolute -top-[400px] left-0 h-0 w-0",children:e.jsx("div",{className:"absolute left-1/2 h-[700px] w-[700px] -translate-x-1/2 rotate-45 transform bg-gradient-to-b from-white/5 to-transparent",children:e.jsx("span",{className:"bg-line-1 absolute bottom-0 right-0 block h-full w-1 bg-gradient-to-b from-transparent to-gold-500/60"})})}),e.jsx("div",{className:"absolute -top-[400px] left-0 h-0 w-0",children:e.jsx("div",{className:"absolute left-1/2 h-[550px] w-[550px] -translate-x-1/2 rotate-45 transform bg-gradient-to-b from-white/5 to-transparent",children:e.jsx("span",{className:"bg-line-2 absolute bottom-0 right-0 block h-full w-0.5 bg-gradient-to-b from-transparent to-white/20"})})}),e.jsx("div",{className:"absolute -top-[400px] right-0 h-0 w-0",children:e.jsx("div",{className:"absolute left-1/2 h-[700px] w-[700px] -translate-x-1/2 -rotate-45 transform bg-gradient-to-b from-white/5 to-transparent",children:e.jsx("span",{className:"bg-line-1 absolute bottom-0 left-0 block h-full w-1 bg-gradient-to-b from-transparent to-gold-500/60"})})}),e.jsx("div",{className:"absolute -top-[400px] right-0 h-0 w-0",children:e.jsx("div",{className:"absolute left-1/2 h-[550px] w-[550px] -translate-x-1/2 -rotate-45 transform bg-gradient-to-b from-white/5 to-transparent",children:e.jsx("span",{className:"bg-line-2 absolute bottom-0 left-0 block h-full w-0.5 bg-gradient-to-b from-transparent to-white/20"})})})]})]})]})})]})}};F=es([De("store"),A],F);const js=F;export{js as Affiliates,gs as AffiliatesDashboard,js 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.