1import{j as e}from"./motion-CJNSdhGKnc-_.js";import{r as t,d as s,u as a}from"./router-CXLJia_l3snl.js";import{N as r,c as l}from"./Navbar-DmwIECVJWJ1P.js";import{B as o,L as n,D as i,C as d,a as c,b as h,P as x,c as m,f as u,p,d as b,e as f,A as g,i as w}from"./charts-DKT60pTH79t8.js";import{S as j}from"./Sparkline-DG0LVWtx1Efn.js";import{h as v,c as N,f as y,a as k,s as _}from"./vendor-BgoFD1j3l9n0.js";import{n as C}from"./npt_logo-SXmI9q4i_K7F.js";import{E as B}from"./react-error-boundary.esm-DZCFCpOFmUpz.js";import{l as A}from"./lodash-CYEIuqqCEe6h.js";import{a as S,u as F}from"./index-CH3jd6p8udHl.js";import{n as M,N as D}from"./NotificationSettingsCard-BTV_K6DnVeGL.js";import"./react-core-B_uAldPxKYCH.js";import"./utils-Br8yT8O4EYoW.js";import"./ui-DXA_mAoPM_7Y.js";d.register(c,h,x,m,u,p,b,f,g,w);const E={sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},P=e=>{const t=["sun","mon","tue","wed","thu","fri","sat"],s=e.getDay(),a=[];for(let r=0;r<7;r++){const e=(s-r+7)%7;a.push(t[e])}return a},L=e=>{let t,s;return e>=1e12?(t=e/1e12,s="TH/s"):e>=1e9?(t=e/1e9,s="GH/s"):e>=1e6?(t=e/1e6,s="MH/s"):e>=1e3?(t=e/1e3,s="kH/s"):(t=e,s="H/s"),{value:t,unit:s,formatted:`${t.toFixed(2)} ${s}`}},T=(e,t)=>{if(!e)return{labels:[],data:[]};const s=[...e.upcoming_payouts_details||[]].sort((e,t)=>e.job_id-t.job_id).slice(-t);return{labels:s.map(e=>`Job ${e.job_id}`),data:s.map(e=>e.amount)}},W=(e,t,s)=>{const a="block_rewards"===t;return{maintainAspectRatio:!1,animation:{duration:700,easing:"easeOutQuart"},scales:{x:{grid:{display:!1,drawBorder:!1,drawTicks:!1,offset:a},ticks:{color:"rgba(255,255,255,0.45)",maxRotation:0,minRotation:0,autoSkip:!0,maxTicksLimit:a?10:"Week"===s?7:8,padding:10,callback:function(t){if(a)return e[Number(t)]?.split(" ")[1]||"";const r="string"==typeof t?parseInt(t,10):t;if(isNaN(r))return"";if("Week"===s&&e.length>0){const e=96,t=Math.floor(r/e);if(t<7&&r%e===0){const e=P(new Date);return E[e[t]]||""}return""}if("Day"===s&&e.length>0){const t=e.length;return r%Math.floor(t/6)===0&&e[r]||""}return e[r]||""},font:{size:11,family:"Inter"}},border:{display:!1},title:{display:a,text:"Job ID",color:"rgba(255,255,255,0.4)",font:{size:10}}},y:{grid:{color:"rgba(255,255,255,0.08)",borderDash:[4,4],display:!0,drawBorder:!1,drawTicks:!1},beginAtZero:!1,grace:"10%",ticks:{color:"rgba(255,255,255,0.4)",padding:10,callback:function(e){const s="string"==typeof e?parseFloat(e):e;if(isNaN(s))return"0";if("hashrate"===t){const{value:e,unit:t}=L(s);return`${Math.round(e)} ${t}`}return a?`${s.toFixed(1)}`:s>=1e6?(s/1e6).toFixed(1)+"M":s>=1e3?(s/1e3).toFixed(1)+"k":s.toLocaleString()},font:{size:11,family:"Inter"}},border:{display:!1},title:{display:!1}}},plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1,backgroundColor:"rgba(23, 23, 28, 0.95)",titleColor:"#ffffff",bodyColor:"rgba(255,255,255,0.8)",borderColor:"rgba(255,255,255,0.1)",borderWidth:1,cornerRadius:6,padding:12,boxPadding:4,displayColors:!0,usePointStyle:!0,titleFont:{family:"Inter",size:13,weight:"bold"},bodyFont:{family:"Inter",size:12},callbacks:{label:function(e){const t=Number(e.raw)||0,s=e.dataset.label;if(a)return`Amount: ${t.toFixed(2)} NPT`;if("Hashrate"===s){const{value:e,unit:s}=L(t);return`Hashrate: ${e.toFixed(2)} ${s}`}return`${s}: ${t.toLocaleString()}`},title:function(t){return t.length>0&&e[t[0].dataIndex]||""}}}},interaction:{mode:"nearest",intersect:!1},responsive:!0,layout:{padding:{bottom:10,top:10,left:10,right:10}}}},H=(e,t,s,a)=>{if(!e)return{data:[],dateMap:new Map};const r="7days"===a?P(new Date):(e=>{const t=["sun","mon","tue","wed","thu","fri","sat"],s=e.getDay(),a=[];for(let r=0;r<14;r++){const e=(s-r+14)%7;a.push(t[e])}return a})(new Date),l=r.length,o=new Map;if("shares"===s){const t=Array(l).fill(0),s=e.analytics_shares_168h||[],a=new Date;a.setHours(23,59,59,999);const n=new Map;for(let e=0;e<l;e++){const t=new Date(a);t.setDate(a.getDate()-(l-1-e)),t.setHours(0,0,0,0);const s=E[r[e]];n.set(s,t)}return s.forEach(e=>{const s=new Date(e.timestamp),r=Math.floor((a.getTime()-s.getTime())/864e5);if(r>=0&&r<l){const s=l-1-r;s>=0&&s<t.length&&(t[s]+=e.value||0)}}),{data:t.map((e,t)=>{const s=E[r[t]],a=n.get(s);return o.set(s,a),{id:`shares-${t}`,value:e,label:s,actualDate:a}}),dateMap:o}}{if(!t?.recent_solutions_168h)return{data:[],dateMap:new Map};const s=new Map;
1t.recent_solutions_168h.forEach(e=>{s.set(e.job_id,new Date(e.confirmed_at))});const a=new Array(l).fill(0),n=new Map,i=new Date;i.setHours(23,59,59,999);for(let e=0;e<l;e++){const t=new Date(i);t.setDate(i.getDate()-(l-1-e)),t.setHours(0,0,0,0);const s=E[r[e]];n.set(s,t)}return e.upcoming_payouts_details.forEach(e=>{const t=s.get(e.job_id);if(!t)return;const r=Math.floor((i.getTime()-t.getTime())/864e5);if(r>=0&&r<l){const t=l-1-r;t>=0&&t<a.length&&(a[t]+=e.amount)}}),{data:a.map((e,t)=>{const s=E[r[t]],a=n.get(s);return o.set(s,a),{id:`rewards-${t}`,value:parseFloat(e.toFixed(2)),label:s,actualDate:a}}),dateMap:o}}},$={plugins:{legend:{position:"bottom",labels:{color:"white",font:{size:12,family:"Inter"},padding:20,boxWidth:20}},tooltip:{backgroundColor:"rgba(20, 20, 30, 0.9)",titleColor:"#ffffff",bodyColor:"#ffffff",borderColor:"#C798E8",borderWidth:1,cornerRadius:8,padding:12,callbacks:{title:function(e){const t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].indexOf(e[0].label);if(-1!==t){const e=new Date,s=(e.getDay()-t+7)%7,a=new Date(e);return a.setDate(e.getDate()-s),a.toLocaleDateString()}return e[0].label},label:function(e){const t=e.raw,s=e.dataset.label||"";return"Shares"===s?`${t.toLocaleString()} Shares`:"Rewards"===s?`${t.toFixed(2)} NPT`:`${t.toLocaleString()}`}}}},responsive:!0,maintainAspectRatio:!1,cutout:"60%"};function z({error:t}){let s="An error occurred. Please try again later.";return t instanceof Error?s=t.message:"string"==typeof t&&(s=t),e.jsxs("div",{className:"text-red-400 text-center p-4",children:[e.jsx("span",{children:"An error occurred. Please try again later."}),e.jsx("pre",{className:"text-xs mt-2",children:s})]})}const O=()=>{const{t:d}=S(),[c,h]=t.useState(""),[x,m]=t.useState(null),[u,p]=t.useState(null),[b,f]=t.useState(null),[g,w]=t.useState("hashrate"),[P,O]=t.useState("Day"),[R]=t.useState("7days"),[V,U]=t.useState(100),[J]=t.useState(void 0),[G,q]=t.useState(!1),[K,Q]=t.useState(null),{id:Y}=s(),[Z,X]=t.useState(1),[ee,te]=t.useState(25),[se,ae]=t.useState(1),[re,le]=t.useState(1),[oe,ne]=t.useState("hashrate"),[ie,de]=t.useState("desc"),[ce,he]=t.useState(""),[xe,me]=t.useState([]),[ue,pe]=t.useState(new Set),[be,fe]=t.useState(!0),[ge,we]=t.useState("shares"),je=a(),{showToast:ve}=F(),[Ne,ye]=t.useState("granted"===M.getPermission()),[ke,_e]=t.useState(!1),Ce=t.useRef(null),[Be,Ae]=t.useState(!1),[Se,Fe]=t.useState(!1),[Me,De]=t.useState(!1),Ee=x||b;t.useEffect(()=>{const e=x?.portal_token||Y;if(!e)return;let t=!1;return v(e).then(e=>{t||Ae(!!e.wallet)}).catch(()=>{}),()=>{t=!0}},[x,Y]);t.useEffect(()=>{const e=localStorage.getItem("npt_addresses");if(e){const t=JSON.parse(e);me(t)}const t=localStorage.getItem(`npt_deleted_workers_${c}`);if(t){const e=JSON.parse(t);pe(new Set(e))}},[c]);const Pe=e=>{if(!e||0===e.length)return 0;const t=e.map(e=>e.value).filter(e=>null!=e&&e>=0);if(0===t.length)return 0;return t.reduce((e,t)=>e+t,0)/t.length},Le=Ee?.analytics_hashrate_24h?Pe(Ee.analytics_hashrate_24h.slice(-4)):0,Te=Ee?.analytics_hashrate_24h?Pe(Ee.analytics_hashrate_24h):0,We=Ee?.analytics_hashrate_168h?Pe(Ee.analytics_hashrate_168h):0,He=async e=>{const t=e||c.trim();if(t){if(!G){q(!0),Q(null);try{let e=t;if(t.length>40)try{const s=await k(t);e=s[0]?.portal_token||t}catch(s){}const[r,l]=await Promise.all([N(e),y()]);if(!r||!r.user_stats)throw new Error("Invalid NPT address or Portal Token. Please check your input.");if(!Y||Y!==e)return void je(`/npt_dashboard/${e}`);f(x),m(r),p(l);try{const e=[...new Set([t,...xe])].slice(0,10);me(e),localStorage.setItem("npt_addresses",JSON.stringify(e))}catch(a){}}catch(r){const e=r instanceof Error?r.message:"Unknown error";Q(`Failed to fetch user data: ${e}`)}finally{q(!1)}}}else Q("Please enter a valid NPT address or Portal Token.")};t.useEffect(()=>{if(Y){h(Y);const e=async()=>{try{q(!0),Q(null);const[e,t]=await Promise.all([N(Y),y()]);f(x),m(e),p(t)}catch(e){const t=e instanceof Error?e.message:"Unknown error";Q(`Failed to fetch user data: ${t}`)}finally{q(!1)}};e();const t=setInterval(e,3e4);return()=>clearInterval(t)}},[Y]),t.useEffect(()=>{const e=A.debounce(He,500);return c&&!Y&&e(c),()=>e.cancel()},[c]),t.useEffect(()=>{if(!c||Y)return;const e=setInterval(()=>He(c),3e4);return()=>clearInterval(e)},[c,Y]);const $e=(e,t)=>
1{e(t)},ze=Ee?.user_stats?.estimated_hashrate||0,{value:Oe,unit:Ie,formatted:Re}=L(ze),Ve=t.useMemo(()=>Ee?.analytics_shares_168h?Ee.analytics_shares_168h.reduce((e,t)=>e+(t.value||0),0):0,[Ee?.analytics_shares_168h]),Ue=(()=>{const e=parseFloat(Ee?.total_pending_amount||"0");if(e>0)return e.toFixed(2);return(Ee?.upcoming_payouts_details||[]).reduce((e,t)=>e+(t.amount||0),0).toFixed(2)})(),Je=(Ee?.successful_payments?.reduce((e,t)=>e+t.amount,0)||0).toFixed(2),Ge=(parseFloat(Je)+parseFloat(Ue)).toFixed(2),qe=t.useMemo(()=>Ee?.workers?.filter(e=>{if(!e.last_updated)return!1;const t=new Date(e.last_updated).getTime();return Date.now()-t<=864e5}).length||0,[Ee]),Ke=t.useMemo(()=>Ee?.workers?.filter(e=>{if(!e.last_updated)return!1;const t=new Date(e.last_updated).getTime();return Date.now()-t<=6048e5}).length||0,[Ee]),{totalWorkersPages:Qe,paginatedWorkers:Ye}=t.useMemo(()=>{const e=[...Ee?.workers?.filter(e=>{if(ue.has(e.id))return!1;return(e.name||`Worker ${e.id}`).toLowerCase().includes(ce.toLowerCase())})||[]].sort((e,t)=>{const s=Date.now()-(e.last_seen?new Date(e.last_seen).getTime():0)>12e5?"Offline":"Online",a=Date.now()-(t.last_seen?new Date(t.last_seen).getTime():0)>12e5?"Offline":"Online";let r=0;switch(oe){case"name":const l=e.name||`Worker ${e.id}`,o=t.name||`Worker ${t.id}`;r=l.localeCompare(o);break;case"status":r=s.localeCompare(a);break;case"hashrate":r=(e.estimated_hashrate||0)-(t.estimated_hashrate||0);break;case"shares":r=(e.shares_count_24h||0)-(t.shares_count_24h||0);break;case"last_seen":r=(e.last_seen?new Date(e.last_seen).getTime():0)-(t.last_seen?new Date(t.last_seen).getTime():0);break;default:r=0}return"asc"===ie?r:-r}),t=e.length;return{totalWorkersPages:Math.ceil(t/25),paginatedWorkers:e.slice(25*(Z-1),25*Z)}},[Ee,ce,oe,ie,Z,ue]),{totalPayoutsPages:Ze,paginatedPayouts:Xe}=t.useMemo(()=>{const e=[...Ee?.upcoming_payouts_details||[]].sort((e,t)=>t.job_id-e.job_id),t=e.length;return{totalPayoutsPages:Math.ceil(t/ee),paginatedPayouts:e.slice((se-1)*ee,se*ee)}},[Ee,ee,se]),{totalSuccessfulPaymentsPages:et,paginatedSuccessfulPayments:tt}=t.useMemo(()=>{const e=Ee?.successful_payments?[...Ee.successful_payments].sort((e,t)=>new Date(t.created_at).getTime()-new Date(e.created_at).getTime()):[],t=e.length;return{totalSuccessfulPaymentsPages:Math.max(1,Math.ceil(t/10)),paginatedSuccessfulPayments:e.slice(10*(re-1),10*re)}},[Ee,re]),st=t.useMemo(()=>"block_rewards"===g?T(Ee,V):((e,t)=>{if(!e)return{labels:[],hashrateData:[],sharesData:[]};const s="Week"===t,a=s?e.analytics_hashrate_168h||[]:e.analytics_hashrate_24h||[],r=s?e.analytics_shares_168h||[]:e.analytics_shares_24h||[];if(!a.length&&!r.length)return{labels:[],hashrateData:[],sharesData:[]};const l=new Set;a.forEach(e=>l.add(e.timestamp)),r.forEach(e=>l.add(e.timestamp));const o=Array.from(l).sort((e,t)=>new Date(e).getTime()-new Date(t).getTime()),n=new Map(a.map(e=>[e.timestamp,e.value])),i=new Map(r.map(e=>[e.timestamp,e.value])),d=[],c=[],h=[];return o.forEach(e=>{const t=new Date(e),a=s?`${E[["sun","mon","tue","wed","thu","fri","sat"][t.getUTCDay()]]} ${t.getUTCHours()}:${String(t.getUTCMinutes()).padStart(2,"0")}`:`${t.getUTCHours()}:${String(t.getUTCMinutes()).padStart(2,"0")}`;d.push(a),c.push(n.has(e)?n.get(e):null),h.push(i.has(e)?i.get(e):null)}),{labels:d,hashrateData:c,sharesData:h}})(Ee,P),[Ee,g,V,P]),at=t.useMemo(()=>st.labels,[st.labels]),rt=t.useMemo(()=>"hashrateData"in st?st.hashrateData:[],[st]),lt=t.useMemo(()=>"sharesData"in st?st.sharesData:[],[st]),ot=t.useMemo(()=>((e,t)=>W(e,t,"Day"))(at,g),[at,g]),nt=t.useMemo(()=>((e,t,s)=>W(e,t,s))(at,g,P),[at,g,P]),it=t.useMemo(()=>{if(0===at.length)return e.jsx("div",{className:"h-full flex items-center justify-center text-white text-sm",children:e.jsx("span",{children:"No user data available to display."})});const t="block_rewards"===g?`block-${V}-${at.length}`:`line-${P}-${at.length}`;if("block_rewards"===g){const{data:s}=T(Ee,V),a={labels:at,datasets:[{label:"Your Amount (NPT)",data:s.map(e=>e??0),backgroundColor:"#7B61FF",borderColor:"#7B61FF",borderWidth:1}]};return e.jsx("div",{style:{height:"100%",position:"relative"},children:e.jsx(o,{data:a,options:ot})},t)}const s={labels:at,datasets:[{label:"Hashrate",data:rt,borderColor:"#C798E8",backgroundColor:e=>{const{ctx:t,chartArea:s}=e.chart;if(!s)return"rgba(199,152,232,0)";const a=t.createLinearGradient(0,s.top,0,s.bottom);return a.addColorStop(0,"rgba(199,152,232,0.45)"),a.addColorStop(.6,"rgba(199,152,232,0.08)"),a.addColorStop(1,"rgba(199,152,232,0)"),a},borderWidth:2.5,pointRadius:0,pointHoverRadius:6,pointHoverBackgroun
1dColor:"#C798E8",pointHoverBorderColor:"#ffffff",pointHoverBorderWidth:2,tension:.4,fill:!0,hidden:"hashrate"!==g},{label:"Shares",data:lt,borderColor:"#7B61FF",backgroundColor:e=>{const{ctx:t,chartArea:s}=e.chart;if(!s)return"rgba(123,97,255,0)";const a=t.createLinearGradient(0,s.top,0,s.bottom);return a.addColorStop(0,"rgba(123,97,255,0.45)"),a.addColorStop(.6,"rgba(123,97,255,0.08)"),a.addColorStop(1,"rgba(123,97,255,0)"),a},borderWidth:2.5,pointRadius:0,pointHoverRadius:6,pointHoverBackgroundColor:"#7B61FF",pointHoverBorderColor:"#ffffff",pointHoverBorderWidth:2,tension:.4,fill:!0,hidden:"shares"!==g}]};return e.jsx("div",{style:{height:"100%",position:"relative"},children:e.jsx(n,{data:s,options:nt})},t)},[at,g,Ee,V,rt,lt,ot,nt,P]),dt="block_rewards"===g;return t.useEffect(()=>{(Ee||K)&&fe(!1)},[Ee,K]),be&&!Ee&&G?e.jsxs("div",{className:"fixed inset-0 z-50 bg-[#111216] flex flex-col items-center pt-16",children:[e.jsx(r,{className:"relative z-50"}),e.jsx("div",{className:"flex-grow flex items-center justify-center",children:e.jsxs("div",{className:"text-white text-lg flex flex-col items-center",children:[e.jsxs("svg",{className:"animate-spin -ml-1 mr-3 h-8 w-8 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e.jsx("span",{className:"mt-4",children:"Loading user data..."})]})})]}):e.jsxs(B,{FallbackComponent:z,children:[e.jsxs("div",{className:"min-h-screen bg-[#111216] flex flex-col items-center py-10 px-2",children:[e.jsx(r,{}),e.jsxs("div",{className:"w-full max-w-7xl mx-auto",children:[e.jsx("header",{className:"mb-10 pt-16",children:e.jsxs("div",{className:"flex flex-col md:flex-row items-end justify-between gap-6 mb-8",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute inset-0 bg-[#BE63EA] rounded-full blur-xl opacity-20 group-hover:opacity-30 transition-opacity"}),e.jsx("img",{src:C,alt:"NPT Logo",className:"relative w-14 h-14 drop-shadow-lg"})]}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-white tracking-tight mb-1",children:d.dashboard.title}),e.jsx("p",{className:"text-white/40 text-sm font-medium",children:d.dashboard.subtitle})]})]}),e.jsxs("div",{className:"flex items-center gap-3 w-full md:w-auto",children:[e.jsxs("div",{className:"relative flex-1 md:w-80",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx("svg",{className:"h-4 w-4 text-white/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),e.jsx("input",{type:"text",value:c,onChange:e=>h(e.target.value),placeholder:d.dashboard.addressPlaceholder,list:"saved-addresses",className:"w-full pl-10 pr-4 py-2.5 rounded-lg bg-[#181A20] text-white text-sm border border-[#2A2B32] focus:border-[#BE63EA] focus:ring-1 focus:ring-[#BE63EA] focus:outline-none transition-all placeholder:text-white/20"}),e.jsx("datalist",{id:"saved-addresses",children:xe.map((t,s)=>e.jsx("option",{value:t,label:t.length>40?`${t.slice(0,20)}...${t.slice(-20)}`:t},s))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[(x?.portal_token||Y)&&e.jsxs("div",{className:"flex items-center gap-2 px-3 h-[42px] rounded-lg bg-[#181A20] border border-[#2A2B32]",title:Be?"Own wallet enabled â permanent, cannot be reverted":"Enable payouts to your own wallet (permanent)",children:[e.jsx("span",{className:"text-xs font-medium text-white/60 hidden xl:inline",children:"Own wallet"}),e.jsx("button",{type:"button",onClick:()=>{Be||Se||!x?.portal_token&&!Y||De(!0)},disabled:Be||Se||!(x?.portal_token||Y),role:"switch","aria-checked":Be,"aria-label":"Enable payouts to your own wallet",className:l("relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-[#00C4B4]",{"bg-[#00C4B4]":Be,"bg-[#2A2B32]":!Be,"cursor-not-allowed opacity-70":Be||Se,"cursor-pointer":!Be&&!Se}),children:e.jsx("span",{className:l("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",{"translate-x-6":Be,"translate-x-1":!Be})})})]}),Y&&e.jsxs("div",{className:"relative",children:[e.jsxs("button",{ref:Ce,onClick:()=>{_e(e=>!e)},className:l("p-2.5 rounded-lg border transition-all duration-300 relative group",Ne?"bg-[#00C4B4]/10 border-[#00C4B4]/50 text-[#00C4B4]":"bg-[#181A20] border-[#2A2B32] text-white/50 hover:text-white"),title:Ne?"Notification Settings":"Enable Notifications",children:[e.jsx("svg",{className:l("w-5 h-5",{"animate-tada":Ne}),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),Ne&&e.jsxs("span",{className:"absolute -top-1 -right-1 flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-[#00C4B4] opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-[#00C4B4]"})]})]}),ke&&e.jsx(D,{poolType:"npt",subscriptionType:"user-stats",portalToken:Y,onClose:()=>_e(!1),onStatusChange:e=>ye(e),anchorRef:Ce})]}),e.jsx("button",{onClick:()=>He(),className:"px-5 py-2.5 rounded-lg font-medium text-sm bg-white text-black hover:bg-gray-200 transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:G,children:G?e.jsx("span",{className:"flex items-center gap-2",children:e.jsxs("svg",{className:"animate-spin h-3 w-3",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})})}),e.jsx("button",{onClick:()=>je("/pool-overview/npt"),className:"p-2.5 rounded-lg text-white/50 hover:text-white hover:bg-[#181A20] transition-all border border-transparent hover:border-[#2A2B32]",title:d.dashboard.poolOverview,children:e.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})})]})]})]})}),K&&e.jsx("div",{className:"mb-8 p-4 bg-red-900/20 border border-red-500/30 rounded-lg text-red-400",children:K}),e.jsxs("section",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:[e.jsxs("div",{className:"relative bg-[#181A20] rounded-2xl p-6 border border-[#2A2B32] hover:border-[#3A3B45] transition-colors group overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 p-6 opacity-10 group-hover:opacity-20 transition-opacity",children:e.jsx("svg",{className:"w-16 h-16 text-[#00C4B4]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-16 pointer-events-none opacity-20",children:e.jsx(j,{data:I(Ee?.analytics_hashrate_24h,24),color:"#00C4B4",tooltipLabel:"Hashrate",isHashrate:!0})}),e.jsxs("div",{className:"relative z-10 flex flex-col justify-between h-full",children:[e.jsx("h3",{className:"text-white/40 text-sm font-medium uppercase tracking-wider",children:d.dashboard.currentHashrate}),e.jsx("div",{className:"mt-2",children:e.jsxs("div",{className:"text-3xl font-bold text-white tracking-tight",children:[Oe.toFixed(2),e.jsx("span",{className:"text-lg text-white/40 font-medium ml-1.5",children:Ie})]})})]})]}),e.jsxs("div",{className:"relative bg-[#181A20] rounded-2xl p-6 border border-[#2A2B32] hover:border-[#3A3B45] transition-colors group overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 p-6 opacity-10 group-hover:opacity-20 transition-opacity",children:e.jsx("svg",{className:"w-16 h-16 text-[#CB9046]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})})}),e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-16 pointer-events-none opacity-20",children:e.jsx(j,{data:I(Ee?.analytics_shares_24h,24),color:"#CB9046",tooltipLabel:"Shares"})}),e.jsxs("div",{className:"relative z-10 flex flex-col justify-between h-full",children:[e.jsx("h3",{className:"text-white/40 text-sm font-medium uppercase tracking-wider",children:d.dashboard.sharesAccepted7d}),e.jsx("div",{className:"mt-2",children:e.jsx("div",{className:"text-3xl font-bold text-white tracking-tight",children:Ve.toLocaleStr
1ing()})})]})]}),e.jsxs("div",{className:"relative bg-[#181A20] rounded-2xl p-6 border border-[#2A2B32] hover:border-[#3A3B45] transition-colors overflow-hidden",children:[e.jsx("div",{className:"absolute -bottom-6 -right-6 opacity-[0.05] pointer-events-none transform -rotate-12",children:e.jsx("svg",{className:"w-32 h-32 text-[#BE63EA]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h3",{className:"text-white/40 text-sm font-medium uppercase tracking-wider",children:d.dashboard.pendingPayout}),0===parseFloat(Ue)?e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-green-500/10 rounded-md border border-green-500/20 shrink-0",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-green-500 rounded-full"}),e.jsx("span",{className:"text-xs font-medium text-green-400",children:d.dashboard.allPaid})]}):e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-yellow-500/10 rounded-md border border-yellow-500/20 shrink-0",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-yellow-500 rounded-full animate-pulse"}),e.jsx("span",{className:"text-xs font-medium text-yellow-400",children:d.dashboard.pending})]})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsxs("div",{className:"text-3xl font-bold text-white tracking-tight",children:[Ue,parseFloat(Ue)>0&&e.jsxs("span",{className:"text-lg text-white/40 font-medium ml-1",children:["/ ",Ge]})]}),e.jsx("span",{className:"text-sm text-white/40 font-medium",children:"NPT"})]}),parseFloat(Ue)>0&&e.jsx("div",{className:"mt-4 pt-4 border-t border-white/5",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-1 bg-white/5 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#BE63EA] rounded-full animate-pulse",style:{width:"60%"}})}),e.jsx("span",{className:"text-[10px] text-white/30 uppercase font-medium",children:d.dashboard.processing})]})})]})]}),e.jsxs("div",{className:"relative bg-[#181A20] rounded-2xl p-6 border border-[#2A2B32] hover:border-[#3A3B45] transition-colors overflow-hidden",children:[e.jsx("div",{className:"absolute -bottom-6 -right-6 opacity-[0.05] pointer-events-none transform -rotate-12",children:e.jsx("svg",{className:"w-32 h-32 text-[#6D64A9]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h3",{className:"text-white/40 text-sm font-medium uppercase tracking-wider",children:d.dashboard.totalPaidOut}),"0.00"!=Je?e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-green-500/10 rounded-md border border-green-500/20 shrink-0",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-green-500 rounded-full"}),e.jsx("span",{className:"text-xs font-medium text-green-400",children:d.dashboard.active})]}):e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-gray-500/10 rounded-md border border-gray-500/20 shrink-0",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full"}),e.jsx("span",{className:"text-xs font-medium text-gray-400",children:d.dashboard.noPayouts})]})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx("div",{className:"text-3xl font-bold text-white tracking-tight",children:Je}),e.jsx("span",{className:"text-sm text-white/40 font-medium",children:"NPT"})]}),Ee?.successful_payments&&Ee.successful_payments.length>0&&e.jsx("div",{className:"mt-4 pt-4 border-t border-white/5",children:e.jsxs("div",{className:"flex items-center gap-2 text-white/30 text-xs",children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsxs("span",{children:[Ee.successful_payments.length," ",d.dashboard.successfulTransactions,1!==Ee.successful_payments.length?"s":""]})]})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 mb-8",children:[e.jsxs("div",{className:"col-span-1 bg-[#181A20] rounded-xl p-6 border border-[#232b32]",children:[e.jsxs("div",{className:"text-center mb-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:d.dashboard.weeklyOverview}),e.jsxs("div",{className:"flex justify-center gap-2 mt-2",children:[e.jsx("button",{onClick:()=>we("shares"),className:"px-3 py-1 rounded-lg text-xs font-semibold transition "+("shares"===ge?"bg-[#23242b] text-white":"bg-transparent text-white/50 hover:bg-[#23242b]/60"),
1children:d.poolOverview.shares}),e.jsx("button",{onClick:()=>we("rewards"),className:"px-3 py-1 rounded-lg text-xs font-semibold transition "+("rewards"===ge?"bg-[#23242b] text-white":"bg-transparent text-white/50 hover:bg-[#23242b]/60"),children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v2H7a1 1 0 100 2h2v2a1 1 0 102 0v-2h2a1 1 0 100-2h-2V7z",clipRule:"evenodd"})}),d.dashboard.rewards]})})]})]}),e.jsx("div",{className:"h-54 flex items-center justify-center",children:Ee?e.jsx("div",{className:"flex flex-col items-center",children:e.jsx(i,{data:{labels:H(Ee,u,ge,R).data.map(e=>e.label),datasets:[{label:"shares"===ge?"Shares":"Rewards",data:H(Ee,u,ge,R).data.map(e=>e.value),backgroundColor:["#C798E8","#7B61FF","#4E3BFF","#C798E8","#7B61FF","#4E3BFF","#C798E8"],borderColor:"rgba(255, 255, 255, 0.1)",borderWidth:1}]},options:{...$,onClick:(e,t)=>{if(t.length>0){const e=t[0].index,s=0===t[0].datasetIndex?"shares":"rewards",a=H(Ee,u,s,R).data[e];J({...a,type:"shares"===s?"Shares":"Rewards"})}}},style:{width:"300px",height:"300px"}})}):e.jsx("span",{className:"text-white/50",children:d.common.noData})})]}),e.jsxs("div",{className:"col-span-3 grid grid-cols-2 lg:grid-cols-4 auto-rows-fr gap-4 h-full",children:[e.jsxs("div",{className:"relative bg-[#181A20] rounded-2xl p-5 border border-[#2A2B32] hover:border-[#BE63EA]/40 transition-all duration-300 overflow-hidden group h-full flex flex-col",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[#BE63EA]/5 via-transparent to-transparent pointer-events-none"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-[0.05] pointer-events-none",children:e.jsx("svg",{className:"w-full h-full text-[#BE63EA]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:.8,d:"M9 12l2 2 4-4M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})})}),e.jsxs("div",{className:"relative z-10 flex flex-col h-full",children:[e.jsx("h3",{className:"text-white/40 text-xs font-medium uppercase tracking-wider mb-3",children:d.dashboard.sharesAccepted7d}),e.jsx("div",{className:"text-3xl font-bold text-white tracking-tight mb-1",children:Ve.toLocaleString()}),Ee?.user_stats&&e.jsxs("div",{className:"flex items-center gap-1.5 mb-auto",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-red-400/80"}),e.jsxs("span",{className:"text-xs text-red-400/80",children:[Ee.user_stats.shares_rejected.toLocaleString()," ",d.dashboard.sharesRejected]})]}),e.jsx("div",{className:"mt-auto pt-4 border-t border-white/5",children:Ee?.user_stats&&(()=>{const t=Ve+Ee.user_stats.shares_rejected,s=t>0?Math.round(Ve/t*100):100;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-xs text-white/40 mb-1.5",children:[e.jsx("span",{children:"Acceptance Rate"}),e.jsxs("span",{className:"text-[#BE63EA]",children:[s,"%"]})]}),e.jsx("div",{className:"h-1 bg-white/5 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#BE63EA] to-[#7B61FF] rounded-full transition-all duration-700",style:{width:`${s}%`}})})]})})()})]})]}),e.jsxs("div",{className:"relative bg-[#181A20] rounded-2xl p-5 border border-[#2A2B32] hover:border-[#BE63EA]/40 transition-all duration-300 overflow-hidden group h-full flex flex-col",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[#00C4B4]/5 via-transparent to-transparent pointer-events-none"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-[0.05] pointer-events-none",children:e.jsx("svg",{className:"w-full h-full text-[#00C4B4]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:.8,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsxs("div",{className:"relative z-10 flex flex-col h-full",children:[e.jsx("h3",{className:"text-white/40 text-xs font-medium uppercase tracking-wider mb-3",children:d.dashboard.pendingPayout}),e.jsxs("div",{className:"text-3xl font-bold text-white tracking-tight mb-1",children:[parseFloat(Ue)>
10?parseFloat(Ue).toFixed(2):"0",e.jsx("span",{className:"text-base text-white/40 font-medium ml-1",children:"NPT"})]}),e.jsx("div",{className:"text-xs text-white/30 mb-auto",children:parseFloat(Ue)>0?`von ${Ge} NPT`:"Kein ausstehender Betrag"}),e.jsxs("div",{className:"mt-auto pt-4 border-t border-white/5",children:[parseFloat(Ue)>0&&parseFloat(Ge)>0&&e.jsx("div",{className:"mb-3",children:e.jsx("div",{className:"h-1 bg-white/5 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#00C4B4] to-[#BE63EA] rounded-full transition-all duration-700",style:{width:`${Math.min(100,parseFloat(Ue)/parseFloat(Ge)*100).toFixed(1)}%`}})})}),e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:"text-white/40",children:d.dashboard.totalPaidOut}),e.jsxs("span",{className:"text-[#00C4B4] font-medium",children:[Je," NPT"]})]})]})]})]}),e.jsxs("div",{className:"relative bg-[#181A20] rounded-2xl p-5 border border-[#2A2B32] hover:border-[#7B61FF]/40 transition-all duration-300 overflow-hidden group h-full flex flex-col",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[#7B61FF]/5 via-transparent to-transparent pointer-events-none"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-[0.05] pointer-events-none",children:e.jsx("svg",{className:"w-full h-full text-[#7B61FF]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:.8,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),e.jsxs("div",{className:"relative z-10 flex flex-col h-full",children:[e.jsx("h3",{className:"text-white/40 text-xs font-medium uppercase tracking-wider mb-3",children:d.dashboard.currentHashrate}),e.jsxs("div",{className:"text-3xl font-bold text-white tracking-tight mb-1",children:[Re.split(" ")[0],e.jsx("span",{className:"text-base text-white/40 font-medium ml-1",children:Re.split(" ")[1]})]}),e.jsx("div",{className:"text-xs text-white/30 mb-auto",children:"Live"}),e.jsx("div",{className:"mt-auto pt-4 border-t border-white/5 flex flex-col gap-2",children:[{label:"1h",value:L(Le).formatted,color:"#00C4B4"},{label:"24h",value:L(Te).formatted,color:"#CB9046"},{label:"168h",value:L(We).formatted,color:"#BE63EA"}].map(({label:t,value:s,color:a})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-white/30 text-xs w-7 shrink-0",children:t}),e.jsx("div",{className:"flex-1 h-0.5 bg-white/5 rounded-full",children:e.jsx("div",{className:"h-full rounded-full",style:{width:"100%",background:a,opacity:.4}})}),e.jsx("span",{className:"text-xs font-medium",style:{color:a},children:s})]},t))})]})]}),e.jsxs("div",{className:"relative bg-[#181A20] rounded-2xl p-5 border border-[#2A2B32] hover:border-[#10B981]/40 transition-all duration-300 overflow-hidden group h-full flex flex-col",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[#10B981]/5 via-transparent to-transparent pointer-events-none"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-[0.05] pointer-events-none",children:e.jsx("svg",{className:"w-full h-full text-[#10B981]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:.8,d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2"})})}),e.jsxs("div",{className:"relative z-10 flex flex-col h-full",children:[e.jsx("h3",{className:"text-white/40 text-xs font-medium uppercase tracking-wider mb-3",children:d.dashboard.workerStatistics}),Ee?.user_stats?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-1",children:[e.jsx("span",{className:"text-3xl font-bold text-white tracking-tight",children:Ee.user_stats.online_miners}),e.jsx("span",{className:"text-sm text-[#10B981]",children:d.dashboard.onlineWorkers})]}),e.jsxs("div",{className:"text-xs text-white/30 mb-auto",children:[Ee.user_stats.online_miners+Ee.user_stats.offline_miners," ",d.dashboard.workerStatistics," total"]}),e.jsxs("div",{className:"mt-auto pt-4 border-t border-white/5",children:[(()=>{const t=Ee.user_stats.online_miners+Ee.user_stats.offline_miners,s=t>0?Ee.user_stats.online_miners/t*100:0;return e.jsxs("div",{className:"mb-3",children:[e.jsxs("div",{className:"flex justify-between text-xs text-white/30 mb-1.5",children:[e.jsxs("span",{children:[d.dashboard.offlineWorkers,": ",Ee.user_stats.offline_miners]}),e.jsxs("span",{className:"text-[#10B981]",children:[Math.round(s),"% online"]})]}),e.jsx("div",{className:"h-1 bg-white/5 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#10B981] to-[#00C4B4] rounded-full transition-all duration-700",style:{width:`${s}%`}})})]})})(),e.jsxs("div",{className:"flex justify-between text-xs text-white/30",children:[e.jsxs("span",{children:[d.dashboard.active24h,": ",e.jsx("span",{className:"text-white/60",children:qe})]}),e.jsxs("span",{children:[d.dashboard.active168h,": ",e.jsx("span",{className:"text-white/60",children:Ke})]})]})]})]}):e.jsx("span",{className:"text-white/50",children:d.common.noData})]})]})]})]}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-1 gap-6 mb-8",children:e.jsxs("div",{className:"bg-[#181A20] rounded-xl p-6 border border-[#232b32]",children:[e.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 mb-6",children:[e.jsxs("div",{className:"flex gap-1 p-1 bg-[#1A1A1A] rounded-lg border border-[#2A2B32]",children:[e.jsx("button",{onClick:()=>$e(w,"hashrate"),className:"px-4 py-1.5 rounded-md font-medium text-xs transition-all duration-300 "+("hashrate"===g?"bg-[#2A2B32] text-white shadow-sm":"bg-transparent text-white/40 hover:text-white/70"),children:d.poolOverview.hashrate}),e.jsx("button",{onClick:()=>$e(w,"shares"),className:"px-4 py-1.5 rounded-md font-medium text-xs transition-all duration-300 "+("shares"===g?"bg-[#2A2B32] text-white shadow-sm":"bg-transparent text-white/40 hover:text-white/70"),children:d.poolOverview.shares}),e.jsx("button",{onClick:()=>$e(w,"block_rewards"),className:"px-4 py-1.5 rounded-md font-medium text-xs transition-all duration-300 "+("block_rewards"===g?"bg-[#2A2B32] text-white shadow-sm":"bg-transparent text-white/40 hover:text-white/70"),children:d.dashboard.blockRewards}
1)]}),e.jsx("div",{className:"flex items-center gap-2",children:dt?e.jsxs("select",{value:V.toString(),onChange:e=>U(Number(e.target.value)),className:"px-3 py-1.5 rounded-lg bg-[#1A1A1A] text-xs text-white/90 border border-gray-700 focus:outline-none focus:ring-2 focus:ring-[#BE63EA] appearance-none",children:[e.jsx("option",{value:"100",children:d.dashboard.last100Blocks}),e.jsx("option",{value:"250",children:d.dashboard.last250Blocks}),e.jsx("option",{value:"1000",children:d.dashboard.last1000Blocks}),e.jsx("option",{value:"999999",children:d.dashboard.allBlocks})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>$e(O,"Day"),className:"w-10 h-10 rounded-lg font-semibold text-sm transition "+("Day"===P?"bg-[#23242b] text-white":"bg-transparent text-white/50 hover:bg-[#23242b]/60"),disabled:dt,children:"D"}),e.jsx("button",{onClick:()=>$e(O,"Week"),className:"w-10 h-10 rounded-lg font-semibold text-sm transition "+("Week"===P?"bg-[#23242b] text-white":"bg-transparent text-white/50 hover:bg-[#23242b]/60"),disabled:dt,children:"W"})]})})]}),e.jsx("div",{className:"w-full h-[500px]",children:it})]})}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-1 gap-6 mb-8",children:e.jsxs("div",{className:"bg-[#181A20] rounded-xl p-6 border border-[#232b32]",children:[e.jsxs("div",{className:"flex flex-col gap-4 mb-6",children:[e.jsx("div",{className:"flex justify-between items-center",children:e.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:d.dashboard.yourWorkers})}),e.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[e.jsx("input",{type:"text",value:ce,onChange:e=>{he(e.target.value),X(1)},placeholder:d.dashboard.searchWorkers,className:"px-3 py-2 rounded-lg bg-[#23242b] text-white border border-[#2A2B32] focus:outline-none focus:ring-2 focus:ring-[#444] text-sm flex-1 min-w-0"}),e.jsxs("select",{value:oe,onChange:e=>{ne(e.target.value),X(1)},className:"px-3 py-2 rounded-lg bg-[#23242b] text-white border border-[#2A2B32] focus:outline-none focus:ring-2 focus:ring-[#444] text-sm",children:[e.jsx("option",{value:"name",children:d.dashboard.sortByName}),e.jsx("option",{value:"status",children:d.dashboard.sortByStatus}),e.jsx("option",{value:"hashrate",children:d.dashboard.sortByHashrate}),e.jsx("option",{value:"shares",children:d.dashboard.sortByShares}),e.jsx("option",{value:"last_seen",children:d.dashboard.sortByLastSeen})]}),e.jsx("button",{onClick:()=>de(e=>"asc"===e?"desc":"asc"),className:"px-3 py-2 rounded-lg bg-[#23242b] text-white text-sm font-semibold hover:bg-[#181A20]",children:"asc"===ie?"â":"â"})]})]}),Ye.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-white text-sm",children:[e.jsx("thead",{className:"bg-[#1F2128]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:d.dashboard.name}),e.jsx("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:d.dashboard.status}),e.jsx("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:d.poolOverview.hashrate}),e.jsxs("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:[d.poolOverview.shares," (24h)"]}),e.jsx("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:d.dashboard.lastSeen}),e.jsx("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:d.dashboard.actions})]})}),e.jsx("tbody",{children:Ye.map((t,s)=>{const a=0==t.estimated_hashrate?d.dashboard.offline:d.dashboard.online;return e.jsxs("tr",{className:"border-b border-[#2A2B32]/50 hover:bg-[#1F2128] transition-colors",children:[e.jsx("td",{className:"py-3 px-4 font-medium text-white",children:t.name||`Worker ${t.id}`}),e.jsx("td",{className:"py-3 px-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full "+(a===d.dashboard.online?"bg-green-500":"bg-red-500")}),e.jsx("span",{className:a===d.dashboard.online?"text-green-400":"text-red-400",children:a})]})}),e.jsx("td",{className:"py-3 px-4 text-white/80",children:L(t.estimated_hashrate||0).formatted}),e.jsx("td",{className:"py-3 px-4 text-white/80",children:(t.shares_count_24h||0).toLocaleStr
1ing()}),e.jsx("td",{className:"py-3 px-4 text-white/60",children:t.last_updated?new Date(t.last_updated).toLocaleString():"N/A"}),e.jsx("td",{className:"py-3 px-4",children:e.jsx("button",{onClick:()=>(e=>{const t=new Set(ue);t.add(e),pe(t);try{localStorage.setItem(`npt_deleted_workers_${c}`,JSON.stringify([...t])),ve("success","Worker Hidden","Worker has been hidden from the list")}catch(s){ve("error","Error","Failed to save worker deletion")}})(t.id),className:"text-red-400 hover:text-red-300 transition-colors",title:"Hide worker from list",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})})]},s)})})]})}),Qe>1&&e.jsxs("div",{className:"flex justify-between items-center mt-4",children:[e.jsx("button",{onClick:()=>X(e=>Math.max(e-1,1)),disabled:1===Z,className:"px-3 py-2 rounded-lg text-sm font-semibold "+(1===Z?"bg-gray-700 text-white/50 cursor-not-allowed":"bg-[#23242b] text-white hover:bg-[#181A20]"),children:d.common.previous}),e.jsxs("span",{className:"text-white text-sm",children:[d.common.page," ",Z," ",d.common.of," ",Qe]}),e.jsx("button",{onClick:()=>X(e=>Math.min(e+1,Qe)),disabled:Z===Qe,className:"px-3 py-2 rounded-lg text-sm font-semibold "+(Z===Qe?"bg-gray-700 text-white/50 cursor-not-allowed":"bg-[#23242b] text-white hover:bg-[#181A20]"),children:d.common.next})]})]}):e.jsx("div",{className:"h-48 flex items-center justify-center text-white/50 text-sm",children:d.common.noData})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-[#181A20] rounded-xl p-6 border border-[#232b32]",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:d.dashboard.pendingPayouts}),e.jsxs("select",{value:ee,onChange:e=>{te(Number(e.target.value)),ae(1)},className:"px-3 py-2 rounded-lg bg-[#23242b] text-white border border-[#2A2B32] focus:outline-none focus:ring-2 focus:ring-[#444] text-sm",children:[e.jsxs("option",{value:10,children:["10 ",d.dashboard.perPage]}),e.jsxs("option",{value:25,children:["25 ",d.dashboard.perPage]}),e.jsxs("option",{value:50,children:["50 ",d.dashboard.perPage]}),e.jsxs("option",{value:100,children:["100 ",d.dashboard.perPage]})]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-white text-sm",children:[e.jsx("thead",{className:"bg-[#1F2128]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:d.dashboard.jobId}),e.jsx("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:d.poolOverview.shares}),e.jsx("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:d.poolOverview.reward}),e.jsx("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:d.dashboard.yourAmount})]})}),e.jsx("tbody",{children:Xe.map((t,s)=>e.jsxs("tr",{className:"border-b border-[#2A2B32]/50 hover:bg-[#1F2128] transition-colors",children:[e.jsx("td",{className:"py-3 px-4 font-mono text-white/80",children:t.job_id}),e.jsx("td",{className:"py-3 px-4 text-white/80",children:t.shares_in_block.toLocaleString()}),e.jsx("td",{className:"py-3 px-4 font-medium text-[#BE63EA]",children:(()=>{const e=u?.recent_solutions_168h,s=e?.find(e=>e.job_id===t.job_id);if(s)return s.reward.toFixed(4)+" NPT";if(t.reward>0)return t.reward.toFixed(4)+" NPT";const a=e?.reduce((e,t)=>!e||t.job_id>e.job_id?t:e,null);return a?"~"+a.reward.toFixed(0)+" NPT":"â NPT"})()}),e.jsxs("td",{className:"py-3 px-4 font-bold text-white",children:[t.amount.toFixed(4)," NPT"]})]},s))})]})}),Ze>1&&e.jsxs("div",{className:"flex justify-between items-center mt-4",children:[e.jsx("button",{onClick:()=>ae(e=>Math.max(e-1,1)),disabled:1===se,className:"px-3 py-2 rounded-lg text-sm font-semibold "+(1===se?"bg-gray-700 text-white/50 cursor-not-allowed":"bg-[#23242b] text-white hover:bg-[#181A20]"),children:d.common.previous}),e.jsxs("span",{className:"text-white text-sm",children:[d.common.page," ",se," ",d.common.of," ",Ze]}),e.jsx("button",{onClick:()=>ae(e=>Math.min(e+1,Ze)),disabled:se===Ze,className:"px-3 py-2 rounded-lg text-sm font-semibold "+(se===Ze?"bg-gray-700 text-white/50 cursor-not-allowed":"bg-[#23242b] text-white hover:bg-[#181A20]"),children:d.common.next})]})]}),e.jsxs("div",{className:"bg-[#181A20] rounded-xl p-6 border border-[#232b32]",children:[e.jsx("div",{className:"flex justify-between items-center mb-6",children:e.jsx("h3",{className:"text-lg font-semibold text-white",children:d.dashboard.successfulPayouts})}),Ee&&Ee.successful_payments?.length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-white text-sm",children:[e.jsx("thead",{className:"bg-[#1F2128]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:d.dashboard.date}),e.jsxs("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:[d.dashboard.amount," (NPT)"]}),e.jsx("th",{className:"py-3 px-4 text-left font-medium text-white/50",children:d.dashboard.txId})]})}),e.jsx("tbody",{children:tt.map((t,s)=>e.jsxs("tr",{className:"border-b border-[#2A2B32]/50 hover:bg-[#1F2128] transition-colors",children:[e.jsx("td",{className:"py-3 px-4 text-white/70",children:new Date(t.created_at).toLocaleDateString()}),e.jsx("td",{className:"py-3 px-4 font-bold text-white",children:t.amount.toFixed(2)}),e.jsxs("td",{className:"py-3 px-4 text-white/40 font-mono text-xs",title:t.transaction_id,children:[t.transaction_id.slice(0,8),"...",t.transaction_id.slice(-8)]})]},s))})]})}):e.jsx("div",{className:"h-48 flex items-center justify-center text-white/50 text-sm",children:d.common.noData}),et>1&&e.jsxs("div",{className:"flex justify-between items-center mt-4",children:[e.jsx("button",{onClick:()=>le(e=>Math.max(e-1,1)),disabled:1===re,className:"px-3 py-2 rounded-lg text-sm font-semibold "+(1===re?"bg-gray-700 text-white/50 cursor-not-allowed":"bg-[#23242b] text-white hover:bg-[#181A20]"),children:d.common.previous}),e.jsxs("span",{className:"text-white text-sm",children:[d.common.page," ",re," ",d.common.of," ",et]}),e.jsx("button",{onClick:()=>le(e=>Math.min(e+1,et)),disabled:re===et,className:"px-3 py-2 rounded-lg text-sm font-semibold "+(re===et?"bg-gray-700 text-white/50 cursor-not-allowed":"bg-[#23242b] text-white hover:bg-[#181A20]"),children:d.common.next})]})]})]})]})]}),Me&&e.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/70 backdrop-blur-sm p-4",onClick:()=>{Se||De(!1)},children:e.jsxs("div",{className:"w-full max-w-md bg-[#181A20] rounded-2xl border border-[#2A2B32] shadow-2xl p-6",onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-full bg-[#00C4B4]/10 text-[#00C4B4]",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})})}),e.jsx("h3",{className:"text-lg font-semibold text-white",children:"Enable own wallet payouts?"})]}),e.jsx("p",{className:"text-sm text-white/70 leading-relaxed mb-3",children:"By enabling Own wallet, you confirm that this address is your own self-custody wallet and n
1ot an exchange deposit address."}),e.jsx("p",{className:"text-sm text-white/70 leading-relaxed mb-3",children:"Payouts to this address will be sent even when exchange deposits are disabled. If this is an exchange address and deposits are unavailable, your payout may be lost or not credited."}),e.jsx("p",{className:"text-sm font-medium text-[#E5A100] mb-6",children:"This change is permanent and cannot be undone."}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:()=>De(!1),disabled:Se,className:"px-5 py-2.5 rounded-xl text-sm font-semibold bg-[#1F2128] text-white/70 hover:text-white hover:bg-[#2A2B32] border border-[#2A2B32] transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"}),e.jsx("button",{type:"button",onClick:async()=>{const e=x?.portal_token||Y;if(!Be&&!Se&&e){Fe(!0);try{(await _(e)).wallet?(Ae(!0),ve("success","Own Wallet Enabled","Payouts will now be sent to your own wallet.")):ve("error","Update Failed","Could not enable your own wallet. Please try again.")}catch(t){const e=t instanceof Error?t.message:"Could not enable your own wallet.";ve("error","Update Failed",e)}finally{Fe(!1),De(!1)}}},disabled:Se,className:"px-5 py-2.5 rounded-xl text-sm font-semibold bg-[#00C4B4] text-[#0a0a0f] hover:bg-[#00A89A] transition-all disabled:opacity-60 disabled:cursor-not-allowed",children:Se?"Enablingâ¦":"Enable own wallet"})]})]})})]})},I=(e,t=24)=>e&&0!==e.length?e.slice(-t).map(e=>e.value??0):[];export{O 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.