PageSourceSearch

https://royaltix.pro/assets/DashboardPage-5349407b.js

js royaltix.pro collected 2026-09-24 15:10:20 UTC 20,803 bytes, 1 lines download raw bytes

1import{c as X,r as t,j as e,L as S,J as K,K as V,M as J,N as q,O as U,P as W,q as N,B as H,Q as _,T as C,U as ae,V as O,W as L,Y as Z,Z as Y,C as I,t as $,_ as B,$ as G,a0 as T,x as te,a1 as se,a2 as re,a3 as oe,a4 as le,a5 as ie,n as ne,s as de,a6 as ce,v as me,w as he,a7 as Q,a8 as xe,a9 as pe,aa as ue,ab as fe,ac as ge,ad as ye,ae as ve,af as be,ag as we,a as je}from"./index-3729243f.js";import{u as Ne,a as De}from"./useDashboardData-7a9384bf.js";import{u as ke}from"./useOnlinePresenceMap-76ac43b7.js";const Ce=X("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),Me=X("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),Pe=(l,w,i,v)=>{const[p,r]=t.useState({});t.useEffect(()=>{const m=new Date().getFullYear(),s=JSON.parse(localStorage.getItem("royaltixMilestoneNotifications"))||{};s.year!==m?(localStorage.setItem("royaltixMilestoneNotifications",JSON.stringify({year:m,notified:{}})),r({})):r(s.notified||{})},[]),t.useEffect(()=>{const m=[{threshold:100,key:`profitMilestone100_${i}`,message:s=>`Congrats! You've surpassed ${s}100 in net profit for this period!`},{threshold:500,key:`profitMilestone500_${i}`,message:s=>`Awesome! Over ${s}500 net profit!`},{threshold:1e3,key:`profitMilestone1k_${i}`,message:s=>`Amazing! You've hit ${s}1,000 net profit!`},{threshold:5e3,key:`profitMilestone5k_${i}`,message:s=>`Incredible! Over ${s}5,000 net profit! You're crushing it!`},{threshold:1e4,key:`profitMilestone10k_${i}`,message:s=>`Wow! ${s}10,000 net profit! You're a financial wizard!`}];if(!w&&typeof l=="number"&&i){let s=!1;const u={...p};if(m.forEach(h=>{l>=h.threshold&&!u[h.key]&&(v({title:"🎉 Profit Milestone Reached! 🎉",description:h.message(i),className:"bg-gradient-to-r from-green-400 via-emerald-500 to-teal-600 border-emerald-500 text-white",duration:7e3}),u[h.key]=!0,s=!0)}),s){const h=new Date().getFullYear();localStorage.setItem("royaltixMilestoneNotifications",JSON.stringify({year:h,notified:u})),r(u)}}},[l,w,i,v,p])},Te=[{value:"thisMonth",label:"This Month"},{value:"lastMonth",label:"Last Month"},{value:"lastDay",label:"Yesterday"},{value:"last7days",label:"Last 7 Days"},{value:"last30days",label:"Last 30 Days"},{value:"yearToDate",label:"Year to Date"},{value:"allTime",label:"All Time"},{value:"customRange",label:"Custom Range"}],_e=({timeFilter:l,setTimeFilter:w,customStartDate:i,setCustomStartDate:v,customEndDate:p,setCustomEndDate:r,accountFilter:m,setAccountFilter:s,kdpAccounts:u,handleApplyFilters:h,handleResetFilters:D,isLoading:b})=>{const[n,j]=t.useState(l==="customRange"),[a,o]=t.useState(i),[g,k]=t.useState(p);t.useEffect(()=>{j(l==="customRange"),o(i),k(p)},[l,i,p]);const M=d=>{if(w(d),d!=="customRange"){const c=new Date;let y,x;switch(d){case"thisMonth":y=_(c),x=C(c);break;case"lastMonth":y=_(Z(c,1)),x=Y(Z(c,1));break;case"lastDay":y=O(L(c,1)),x=C(L(c,1));break;case"last7days":y=O(L(c,6)),x=C(c);break;case"last30days":y=O(L(c,29)),x=C(c);break;case"yearToDate":y=ae(c),x=C(c);break;case"allTime":y=new Date(1970,0,1),x=new Date(2100,0,1);break;default:y=_(c),x=C(c)}v(y),r(x),o(y),k(x)}else o(i||_(new Date)),k(p||Y(new Date))},P=()=>{n&&(v(a?O(a):_(new Date)),r(g?C(g):Y(new Date)));const d=n?a?O(a):_(new Date):void 0,c=n?g?C(g):Y(new Date):void 0;h(d,c)},E=()=>{D();const d=new Date;o(_(d)),k(C(d))};return e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-2 sm:gap-3 p-0",children:[e.jsxs("div",{className:"flex-grow grid grid-cols-1 md:grid-cols-2 gap-2 sm:gap-3",children:[e.jsxs("div",{children:[e.jsx(S,{htmlFor:"timeFilter",className:"text-[11px] font-medium text-[hsl(var(--royaltix-text-secondary))]",children:"Period"}),e.jsxs(K,{value:l,onValueChange:M,disabled:b,children:[e.jsx(V,{id:"timeFilter",className:"w-full h-9 rounded-lg px-3 bg-[hsl(var(--royaltix-input-bg))] border-[hsl(var(--royaltix-card-border))] focus:border-[hsl(var(--royaltix-primary))]",children:e.jsx(J,{placeholder:"Select period"})}),e.jsx(q,{children:Te.map(d=>e.jsx(U,{value:d.value,children:d.label},d.value))})]})]}),e.jsxs("div",{children:[e.jsx(S,{htmlFor:"accountFilter",className:"text-[11px] font-medium text-[hsl(var(--royaltix-text-secondary))]",children:"Accounts"}),e.jsxs(K,{value:m,onValueChange:s,disabled:b,children:[e.jsx(V,{id:"accountFilter",className:"w-full h-9 rounded-lg px-3 bg-[hsl(var(--royaltix-input-bg))] border-[hsl(var(--royaltix-card-border))] focus:border-[hsl(var(--royaltix-primary))]",children:e.jsx(J,{placeholder:"Select account"})}),e.jsxs(q,{children:[e.jsx(U,{value:"allAccounts",children:"All Accounts"}),u.map(d=>e.jsx(U,{value:d.id,children:d.name},d.id))]})]})]})]}),n&&e.jsxs("div",{className:"flex-grow grid grid-cols-1 md:grid-cols-2 gap-2 sm:gap-3 mt-2 sm:mt-0",children:[e.jsxs("div",{children:[e.jsx(S,{htmlFor:"customStartDate",className:"text-[11px] font-medium text-[hsl(var(--royaltix-text-secondary))]",children:"Start Date"}),e.jsx(W,{date:a,setDate:o,placeholder:"Start Date",className:"w-full"})]}),e.jsxs("div",{children:[e.jsx(S,{htmlFor:"customEndDate",className:"text-[11px] font-medium text-[hsl(var(--royaltix-text-secondary))]",children:"End Date"}),e.jsx(W,{date:g,setDate:k,placeholder:"End Date",className:"w-full"})]})]}),e.jsxs("div",{className:"flex items-end gap-2 mt-2 sm:mt-0",children:[e.jsx(N.div,{whileHover:{y:-2,scale:1.01},whileTap:{scale:.98},className:"flex-1 sm:flex-none",children:e.jsxs(H,{onClick:P,disabled:b,size:"sm",className:"w-full sm:w-auto bg-[hsl(var(--royaltix-accent))] hover:bg-[hsl(var(--royaltix-accent)_/_0.9)] text-white",children:[e.jsx(Ce,{className:"mr-2 h-4 w-4"})," Apply"]})}),e.jsx(N.div,{whileHover:{y:-2,scale:1.01},whileTap:{scale:.98},className:"flex-1 sm:flex-none",children:e.jsxs(H,{onClick:E,variant:"outline",disabled:b,size:"sm",className:"w-full sm:w-auto",children:[e.jsx(Me,{className:"mr-2 h-4 w-4"})," Reset"]})})]})]})},Ee=({timeFilter:l,setTimeFilter:w,customStartDate:i,setCustomStartDate:v,customEndDate:p,setCustomEndDate:r,accountFilter:m,setAccountFilter:s,kdpAccounts:u,handleApplyFilters:h,handleResetFilters:D,isLoading:b})=>e.jsx(N.div,{initial:{opacity:0,y:-20}
1,animate:{opacity:1,y:0},transition:{duration:.5},children:e.jsx(I,{className:"glassmorphic-card p-2.5 sm:p-3 shadow-lg",children:e.jsx(_e,{timeFilter:l,setTimeFilter:w,customStartDate:i,setCustomStartDate:v,customEndDate:p,setCustomEndDate:r,accountFilter:m,setAccountFilter:s,kdpAccounts:u,handleApplyFilters:h,handleResetFilters:D,isLoading:b})})}),Fe=l=>{switch(l){case 1:return"bg-gradient-to-r from-yellow-500/30 via-yellow-400/20 to-yellow-500/30 border-yellow-500 shadow-yellow-500/30";case 2:return"bg-gradient-to-r from-slate-500/30 via-slate-400/20 to-slate-500/30 border-slate-500 shadow-slate-500/30";case 3:return"bg-gradient-to-r from-orange-600/30 via-orange-500/20 to-orange-600/30 border-orange-500 shadow-orange-500/30";case 4:return"bg-gradient-to-r from-sky-600/30 via-sky-500/20 to-sky-600/30 border-sky-500 shadow-sky-500/30";case 5:return"bg-gradient-to-r from-emerald-600/30 via-emerald-500/20 to-emerald-600/30 border-emerald-500 shadow-emerald-500/30";default:return"bg-zinc-800/70 border-zinc-700"}};function Re({topPerformers:l,isLoading:w,displayCurrency:i="EUR",yesterdayTopPerformers:v=[],isLoadingYesterday:p=!1}){const[r,m]=t.useState("month");t.useState({});const[s,u]=t.useState(0),{isOnline:h}=ke(),D=r==="month"?"Leaderboard: Top KDP Performers (This Month)":"Leaderboard: Top KDP Performers (Yesterday)",b=5,n=r==="month"?l||[]:v||[],j=r==="month"?w:p;return t.useEffect(()=>{const a=()=>u(o=>o+1);return window.addEventListener("userDataChanged",a),()=>window.removeEventListener("userDataChanged",a)},[]),j?e.jsx(I,{className:"mt-6 border-purple-700 glassmorphic-card shadow-xl overflow-hidden transition-colors duration-200 hover:border-[hsl(var(--royaltix-accent))] hover:shadow-2xl",children:e.jsxs($,{className:"py-4",children:[e.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2 text-[hsl(var(--royaltix-text-primary))]",children:[e.jsx(B,{className:"h-5 w-5 text-purple-500"}),D]}),e.jsx("div",{className:"space-y-3",children:[...Array(b)].map((a,o)=>e.jsxs("div",{className:"flex items-center justify-between py-3 px-4 rounded-lg bg-zinc-900/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(G,{className:"h-8 w-8 rounded-full"}),e.jsx(G,{className:"h-5 w-36"})]}),e.jsx(G,{className:"h-6 w-24"})]},`skeleton-${o}`))})]})}):!n||n.length===0?e.jsx(I,{className:"mt-6 border-purple-700 glassmorphic-card shadow-xl overflow-hidden transition-colors duration-200 hover:border-[hsl(var(--royaltix-accent))] hover:shadow-2xl",children:e.jsxs($,{className:"py-8 text-center text-[hsl(var(--royaltix-text-muted))]",children:[e.jsx(B,{className:"mx-auto h-12 w-12 text-purple-500 mb-3"}),e.jsx("p",{className:"text-lg font-semibold text-[hsl(var(--royaltix-text-primary))]",children:"Leaderboard is Empty"}),e.jsx("p",{className:"text-sm",children:"No KDP performance data available for this timeframe yet."})]})}):e.jsx(I,{className:"mt-6 border-purple-700 glassmorphic-card shadow-2xl overflow-hidden transition-colors duration-200 hover:border-[hsl(var(--royaltix-accent))] hover:shadow-2xl",children:e.jsxs($,{className:"p-0",children:[e.jsx("div",{className:"bg-gradient-to-br from-purple-700 via-purple-600 to-indigo-600 p-2 sm:p-3 md:p-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-lg sm:text-xl md:text-2xl font-bold mb-0.5 sm:mb-1 flex items-center gap-2 text-white",children:[e.jsx(B,{className:"h-5 w-5 sm:h-6 sm:w-6"}),D]}),e.jsx("p",{className:"text-[11px] sm:text-sm text-purple-200/90",children:"Top 5 Rankings"})]}),e.jsxs("div",{className:"flex items-center gap-0.5 bg-white/10 rounded-full p-0.5 sm:p-1 shadow-inner",children:[e.jsx(N.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:()=>m("month"),"aria-pressed":r==="month",className:T("px-2 py-0.5 sm:px-2.5 sm:py-1 text-[10px] sm:text-xs rounded-full transition-all duration-200",r==="month"?"bg-white text-purple-700 shadow-sm":"text-white/80 hover:text-white hover:bg-white/10"),children:"This Month"}),e.jsx(N.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:()=>m("yesterday"),"aria-pressed":r==="yesterday",className:T("px-2 py-0.5 
1sm:px-2.5 sm:py-1 text-[10px] sm:text-xs rounded-full transition-all duration-200",r==="yesterday"?"bg-white text-purple-700 shadow-sm":"text-white/80 hover:text-white hover:bg-white/10"),children:"Yesterday"})]})]})}),e.jsx("div",{className:"p-3 sm:p-4",children:e.jsx(te,{mode:"wait",children:e.jsx(N.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.25},className:"space-y-1.5 sm:space-y-2",children:n.slice(0,b).map((a,o)=>e.jsxs(N.div,{initial:{opacity:0,scale:.9,y:10},animate:{opacity:1,scale:1,y:0},transition:{duration:.35,delay:o*.1,type:"spring",stiffness:100},className:T("flex items-center justify-between p-3 sm:p-4 border rounded-xl transition-all duration-300 ease-in-out hover:shadow-lg hover:scale-[1.02]",Fe(a.rank)),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative group",children:[e.jsxs(se,{className:T("h-8 w-8 sm:h-9 sm:w-9 ring-2 shadow transition-all duration-300",a.rank===1?"ring-[hsl(var(--royaltix-accent))] shadow-[0_0_24px_rgba(250,204,21,0.45)]":a.rank===2?"ring-slate-300 shadow-[0_0_18px_rgba(148,163,184,0.35)]":"ring-[hsl(var(--royaltix-card-border))]"),children:[e.jsx(re,{src:`https://avatar.vercel.sh/${encodeURIComponent(a.display_name||a.userId)}.png?size=64`,alt:a.display_name||"User"}),e.jsx(oe,{className:"bg-[hsl(var(--royaltix-input-bg))] text-[hsl(var(--royaltix-text-secondary))]",children:(a.display_name||"U").slice(0,1).toUpperCase()})]}),h(a.userId)&&e.jsx("span",{className:"absolute -bottom-1 -right-1 h-2.5 w-2.5 rounded-full bg-emerald-500 ring-2 ring-[hsl(var(--royaltix-card-bg))] shadow-[0_0_6px_rgba(16,185,129,0.8)] animate-pulse","aria-label":"Online",title:"Online"}),a.rank===1&&e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"absolute -top-4 -right-3 h-5 w-5 text-yellow-400 drop-shadow-[0_4px_12px_rgba(0,0,0,0.35)] rotate-[-12deg]"}),e.jsx("div",{className:"pointer-events-none absolute -top-5 -right-4 h-6 w-6 bg-yellow-300/30 blur-md rounded-full"})]}),a.rank===2&&e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"absolute -top-4 -right-3 h-5 w-5 text-slate-300 drop-shadow-[0_4px_12px_rgba(0,0,0,0.35)] rotate-[10deg]"}),e.jsx("div",{className:"pointer-events-none absolute -top-5 -right-4 h-6 w-6 bg-slate-300/25 blur-md rounded-full"})]}),a.rank===3&&e.jsxs(e.Fragment,{children:[e.jsx(N.span,{className:T("absolute -bottom-4 -left-3 text-[15px] select-none text-orange-300"),style:{rotate:-6,transformOrigin:"30% 60%"},"aria-label":"fox",title:"Fox",animate:{y:[0,-2,0],rotate:[-6,-3,-6]},transition:{duration:2.4,ease:"easeInOut",repeat:1/0},whileHover:{scale:1.12,rotate:[-6,-14,-2,-6],y:[0,-3,0],transition:{duration:.7}},whileTap:{scale:1.15,rotate:-2},children:"🦊"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-4 -left-4 h-7 w-7 blur-md rounded-full bg-orange-300/25"})]}),a.rank===4&&e.jsxs(e.Fragment,{children:[e.jsx(N.span,{className:T("absolute -bottom-4 -left-3 text-[15px] select-none text-sky-300"),style:{rotate:-6,transformOrigin:"30% 60%"},"aria-label":"dolphin",title:"Dolphin",animate:{y:[0,-2,0],rotate:[-6,-3,-6]},transition:{duration:2.4,ease:"easeInOut",repeat:1/0},whileHover:{scale:1.12,rotate:[-6,-14,-2,-6],y:[0,-3,0],transition:{duration:.7}},whileTap:{scale:1.15,rotate:-2},children:"🐬"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-4 -left-4 h-7 w-7 blur-md rounded-full bg-sky-300/25"})]}),a.rank===5&&e.jsxs(e.Fragment,{children:[e.jsx(N.span,{className:T("absolute -bottom-4 -left-3 text-[15px] select-none text-emerald-300"),style:{rotate:-6,transformOrigin:"30% 60%"},"aria-label":"donkey",title:"Donkey",animate:{y:[0,-2,0],rotate:[-6,-3,-6]},transition:{duration:2.4,ease:"easeInOut",repeat:1/0},whileHover:{scale:1.12,rotate:[-6,-14,-2,-6],y:[0,-3,0],transition:{duration:.7}},whileTap:{scale:1.15,rotate:-2},children:"🫏"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-4 -left-4 h-7 w-7 blur-md rounded-full bg-emerald-300/25"})]})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("p",{className:"font-bold text-md text-[hsl(var(--royaltix-text-primary))]",children:a.display_name}),e.jsxs("p",{className:T("text-xs",a.rank===1?"text-yellow-300":a.rank===2?"text-slate-300":a.rank===3?"text-orange-300":a.rank===4?"text-sky-300":a.rank===5?"text-emerald-300":"text-zinc-400"),children:["Rank #",a.rank]})]})]}),e.jsx("div",{className:"text-right",children:e.jsxs("p",{className:"font-extrabold text-xl sm:text-2xl text-green-400 tabular-nums",children:["#",a.rank]})})]},a.userId))},r)})})]})})}const Oe=()=>{const l=ne();return e.jsx(N.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:.5},children:e.jsxs(I,{className:"glassmorphic-card p-6 text-center shadow-xl",children:[e.jsxs(de,{children:[e.jsx(ce,{className:"mx-auto h-12 w-12 text-yellow-400 mb-4"}),e.jsx(me,{className:"text-xl text-[hsl(var(--royaltix-text-primary))]",children:"No Data Yet for Selected Period"})]}),e.jsxs($,{children:[e.jsx(he,{className:"text-[hsl(var(--royaltix-text-muted))] mt-2 mb-6",children:"It looks like there's no financial data logged for the period and account(s) you've selected. Start by adding some entries to see your dashboard populate!"}),e.jsxs("div",{className:"flex flex-col sm:flex-row justify-center gap-3",children:[e.jsxs(H,{onClick:()=>l("/kdp-entry"),className:"bg-[hsl(var(--royaltix-accent))] hover:bg-[hsl(var(--royaltix-accent)_/_0.9)] text-white",children:[e.jsx(Q,{className:"mr-2 h-4 w-4"})," Log KDP Entry"]}),e.jsxs(H,{onClick:()=>l("/other-expenses"),variant:"outline",className:"border-[hsl(var(--royaltix-card-border))] hover:border-[hsl(var(--royaltix-accent))] text-[hsl(var(--royaltix-text-secondary))] hover:text-[hsl(var(--royaltix-text-primary))]",children:[e.jsx(Q,{className:"mr-2 h-4 w-4"})," Log Other Expense"]})]})]})]})})},Ie=t.memo(Ee),ze=t.memo(xe),Ae=t.memo(pe),Se=t.memo(ue),Le=t.memo(fe),Ye=t.memo(ge),$e=t.memo(ye),He=t.memo(ve),Ue=t.memo(be),Be=t.memo(we),Ge=t.memo(Re),Ke=t.memo(Oe),Ve=({timeFilter:l,setTimeFilter:w,customStartDate:i,setCustomStartDate:v,customEndDate:p,setCustomEndDate:r,accountFilter:m,setAccountFilter:s,kdpAccounts:u,eurToUsdRate:h,handleApplyFilters:D,handleResetFilters:b,isLoading:n,isRefreshing:j,dashboardData:a,currencySymbol:o,displayCurrency:g,timeFilterDescription:k,userSettings:M,topPerformersData:P,isLoadingTopPerformers:E,yesterdayTopPerformersData:d,isLoadingYesterdayTopPerformers:c})=>{var z,R;const y=!n&&a.totalGrossIncome===0&&a.totalAdSpend===0&&a.totalOtherExpenses===0&&(((z=a.dailyChartData)==null?void 0:z.length)||0)===0&&(((R=a.monthlyChartData)==null?void 0:R.length)||0)===0,[x,F]=t.useState(0);return t.useEffect(()=>{try{if(typeof window>"u"||!window.matchMedia)return;const f=window.matchMedia("(min-width: 1024px)"),A=ee=>{ee.matches||F(0)};return f.matches||F(0),f.addEventListener?f.addEventListener("change",A):f.addListener(A),()=>{f.removeEventListener?f.removeEventListener("change",A):f.removeListener(A)}}catch{return}},[]),e.jsxs(e.Fragment,{children:[e.jsx(Ie,{timeFilter:l,setTimeFilter:w,customStartDate:i,setCustomStartDate:v,customEndDate:p,setCustomEndDate:r,accountFilter:m,setAccountFilter:s,kdpAccounts:u,handleApplyFilters:D,handleResetFilters:b,isLoading:n}),y?e.jsx(Ke,{}):e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[x===0?e.jsx(ze,{dashboardData:a,displayCurrency:g,currencySymbol:o,timeFilterDescription:k,isLoading:n,isRefreshing:j}):e.jsx(Le,{dashboardData:a,currencySymbol:o,isLoading:n,isRefreshing:j}),e.jsx("div",{className:"hidden lg:flex items-center justify-center gap-2",children:[0,1].map(f=>e.jsx("button",{type:"button","aria-label":f===0?"Page 1: Widgets":"Page 2: Details","aria-pressed":x===f,onClick:()=>F(f),className:"h-2.5 w-2.5 rounded-full border transition-all duration-200 "+(x===f?"bg-[hsl(var(--royaltix-accent))] border-[hsl(var(--royaltix-accent))] shadow-sm":"bg-transparent border-[hsl(var(--royaltix-card-border))] opacity-70 hover:opacity-100")},`top-page-${f}`))}),e.jsx("div",{className:x===1?"":"hidden",children:e.jsx(Ye,{dashboardData:a,currencySymbol:o,displayCurrency:g,eurToUsdRate:h,isLoading:n,isRefreshing:j,accountFilter:m,kdpAccounts:u})}),e.jsx(Ae,{dashboardData:a,displayCurrency:g,currencySymbol:o,isLoading:n,isRefreshing:j}),e.jsx(Se,{dashboardData:a,currencySymbol:o,isLoading:n,isRefreshing:j}),e.jsx($e,{dashboardData:a,displayCurrency:g,currencySymbol:o,isLoading:n}),e.jsx(He,{dashboardData:a,userSettings:M,isLoading:n,currencySymbol:o}),e.jsx(Ue,{upcomingRoyalties:a.upcomingRoyalties,currencySymbol:o,isLoading:n}),e.jsx(Be,{accountFilter:m,kdpAccounts:u,timeFilter:l,customStartDate:i,customEndDate:p,displayCurrency:g,eurToUsdRate:h}),e.jsx(Ge,{topPerformers:P,isLoading:E,currencySymbol:o,displayCurrency:g,yesterdayTopPerformers:d,isLoadingYesterday:c})]})]})},Je={initial:{opacity:0,y:20},in:{opacity:1,y:0},out:{opacity:0,y:-20}},qe={type:"tween",ease:"anticipate",duration:.4},We=()=>{const{toast:l}=je(),{timeFilter:w,setTimeFilter:i,accountFilter:v,setAccountFilter:p,displayCurrency:r,customStartDate:m,setCustomStartDate:s,customEndDate:u,setCustomEndDate:h,dashboardData:D,kdpAccounts:b,eurToUsdRate:n,isLoading:j,isRefreshing:a,handleApplyFilters:o,handleResetFilters:g,timeFilterDescription:k,fetchAndProcessDashboardData:M,fetchKdpAccounts:P,addXp:E,userSettings:d,updateProfitGoalInSettings:c,topPerformersData:y,isLoadingTopPerformers:x,yesterdayTopPerformersData:F,isLoadingYesterdayTopPerformers:z}=Ne(),R=t.useMemo(()=>r==="EUR"?"€":"$",[r]);Pe(D.totalNetProfit,j,R,l);const f=t.useCallback(()=>
1{M&&typeof M=="function"&&M(),P&&typeof P=="function"&&P()},[M,P]);return De(f,E),e.jsx(N.div,{initial:"initial",animate:"in",exit:"out",variants:Je,transition:qe,className:"flex flex-col gap-4 md:gap-6 pb-16 md:pb-6 focus:outline-none",tabIndex:-1,children:e.jsx(Ve,{timeFilter:w,setTimeFilter:i,customStartDate:m,setCustomStartDate:s,customEndDate:u,setCustomEndDate:h,accountFilter:v,setAccountFilter:p,kdpAccounts:b,eurToUsdRate:n,handleApplyFilters:o,handleResetFilters:g,isLoading:j,isRefreshing:a,dashboardData:D,currencySymbol:R,displayCurrency:r,timeFilterDescription:k,updateProfitGoalInSettings:c,userSettings:d,topPerformersData:y,isLoadingTopPerformers:x,yesterdayTopPerformersData:F,isLoadingYesterdayTopPerformers:z})})},ea=t.memo(We);export{ea 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.