PageSourceSearch

https://slugify.ai/build/assets/SellerThemeHistory-WSau12n0.js

js slugify.ai collected 2026-10-05 12:39:34 UTC 25,965 bytes, 96 lines download raw bytes

1import{u as ce,r as o,j as e,b as F,H as de,L as j}from"./app-DP13319Q.js";import{F as a,k as u,h as M,f as me,e as E,ap as P,l as xe,g as pe,ac as T,aq as L,ar as ue,as as he,P as fe,W as ge,at as ye,au as be,av as je,ah as we,aw as ve}from"./index-CtyZ6W6U.js";import{D as Ne}from"./DraggableMenu-Bk7Spryo.js";import{M as ke}from"./react-tooltip.min-DW3XhwOj.js";/* empty css            */import"./index-DQkUn08L.js";function Me(){const{auth:U,template:s,purchases:x}=ce().props,[m,w]=o.useState(!1),[v,N]=o.useState(!0),[k,I]=o.useState(x.current_page||1),[h,A]=o.useState(x.data),[p,S]=o.useState(x.current_page<x.last_page),[i,R]=o.useState(null),[$,H]=o.useState([]),[f,_]=o.useState("sales"),z=o.useCallback(t=>{try{return new URL(t),!0}catch{return!1}},[]),g=o.useCallback(t=>{var n;return(n=t.split("?")[0].split(".").pop())==null?void 0:n.toLowerCase()},[]),y=o.useCallback(t=>t?["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"].includes(t):!1,[]),B=o.useMemo(()=>s!=null&&s.image&&y(g(s.image))?e.jsx("style",{children:`
2                    .blur-bg {
3                        background: url('${s.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${s.image}') no-repeat center center;
4                        background-size: cover;
5                    }
6                `}):null,[s,g,y]);o.useEffect(()=>{(async()=>{try{const l=await F.get("/seller/earnings-summary");R(l.data.summary),H(l.data.monthly_earnings)}catch(l){console.error("Error fetching earnings summary:",l)}})()},[]);const V=o.useMemo(()=>{var C;if(!s)return null;const t=((C=s.image.split(".").pop())==null?void 0:C.toLowerCase())||"",n=`${s.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${s.image}`,Z=["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"],O=["ppt","pptx","pdf","xls","xlsx","doc","docx","pages","ai","psd","eps","ttf","dxf","xps","rar","zip","ods","odt","odp"],G=/(?:youtube(?:-nocookie)?\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/ ]{11})/i,J=/(?:https?:\/\/)?(?:www\.)?linkedin\.com\/(?:in|posts|company|feed|showcase|embed\/feed\/update\/urn:li:[^/]+:[^"&?/ ]+)/i,K=/^https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$/im,Q=/^(https?:\/\/)?(www\.)?fb\.watch\/[a-zA-Z0-9(\.\?)?]/,X=/^(https?:\/\/)?(www\.)?facebook\.com\/[a-zA-Z0-9(\.\?)?]/,ee=/<iframe.*?src=["'](.*?)["'].*?>.*?<\/iframe>/is,te=/<blockquote/,d=s.image.match(G),se=s.image.match(J),b=s.image.match(K),ae=s.image.match(Q),le=s.image.match(X),oe=s.image.match(ee)||te.test(s.image),ie=new Blob([s.image],{type:"text/html"}),re=URL.createObjectURL(ie);if(Z.includes(t))return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
7                        .blur-overlay {
8                            position: fixed;
9                            top: 0;
10                            left: 0;
11                            width: 100%;
12                            height: 100%;
13                            backdrop-filter: blur(20px);
14                            z-index: -1;
15                        }
16                    `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("img",{src:n,alt:"Background",className:"absolute inset-0 max-w-full max-h-full m-auto z-0 rounded-lg",onError:r=>console.error("Image failed to load",r)},`image-${s.image}`)]});if(O.includes(t))return e.jsx("iframe",{src:`https://docs.google.com/viewer?url=${n}&embedded=true`,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",loading:"lazy",allow:"autoplay; fullscreen",allowFullScreen:!0,sandbox:"allow-scripts allow-same-origin",title:"Document Viewer",scrolling:"yes"},`doc-${s.image}`);if(oe){const r=s.image.replace(/<(iframe|blockquote)([^>]*)\s(height|width|style)=["'][^"']*["']([^>]*)>/gi,'<$1$2$4 class="fixed top-0 left-0 w-full h-full" scrolling="yes">').replace(/class="([^"]*)"/g,'class="$1 absolute inset-0 m-auto"'),ne=/<(iframe|blockquote)[^>]*class="/i.test(r)?r:r.replace(/<(iframe|blockquote)/g,'<$1 scrolling="yes" class="absolute w-full h-full inset-0 m-auto"');return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
17                        .blur-overlay {
18                            position: fixed;
19                            top: 0;
20                            left: 0;
21                            width: 100%;
22                            height: 100%;
23                            backdrop-filter: blur(20px);
24                            z-index: -2;
25                        }
26                        .twitter-tweet {
27                            position: fixed;
28                            top: 0;
29                            left: 0;
30                            width: 100vw;
31                            height: 100vh;
32                            object-fit: cover;
33                            z-index: 0;
34                            border: none;
35                        }
36                    `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full object-cover",dangerouslySetInnerHTML:{__html:ne}},`iframe-${s.image}`)]})}if(d){const r=s.option==="autoplay"?"autoplay=1":s.option==="mute"?"autoplay=1&mute=1":"mute=1";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed top-0 left-0 w-full h-full z-[-2]",children:e.jsx("iframe",{loading:"lazy",src:`https://www.youtube.com/embed/${d[1]}?${r}&loop=1&playlist=${d[1]}&controls=0&showinfo=0&modestbranding=1&iv_load_policy=3`,className:"w-full h-full object-cover",frameBorder:"0",allow:"autoplay; fullscreen",allowFullScreen:!0},`youtube-1-${d[1]}`)}),e.jsx("style",{children:`
37                        .blur-overlay {
38                            position: fixed;
39                            top: 0;
40                            left: 0;
41                            width: 100%;
42                            height: 100%;
43                            backdrop-filter: blur(20px);
44                            z-index: -1;
45                        }
46                    `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{id:"bgVideo",loading:"lazy",className:"fixed top-0 left-0 w-full h-full object-cover",src:`https://www.youtube.com/embed/${d[1]}?${s.option}=1&mute=1&loop=1&playlist=${d[1]}`,title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture;
46 web-share",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0},`youtube-2-${d[1]}`)]})}if(se){let r=s.image;return r.includes("?compact=1")||(r+=(r.includes("?")?"&":"?")+"compact=1"),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black",children:e.jsx("iframe",{id:"bgVideo",src:r,className:"w-full h-full",frameBorder:"0",allowFullScreen:!0,title:"Embedded LinkedIn Post",scrolling:"yes"},`linkedin-${r}`)})}return b?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
47                        .blur-overlay {
48                            position: fixed;
49                            top: 0;
50                            left: 0;
51                            width: 100%;
52                            height: 100%;
53                            backdrop-filter: blur(20px);
54                            z-index: -1;
55                        }
56                    `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:`https://player.vimeo.com/video/${b[3]}?h=33160d1512&color=de0101`,className:"fixed top-0 left-0 w-full h-full object-cover",frameBorder:"0",allowFullScreen:!0},`vimeo-${b[3]}`)]}):ae||le&&!s.image.includes("groups")?e.jsx("div",{className:"fixed top-0 left-0 w-full h-full",children:e.jsx("div",{className:"fb-post","data-href":s.image,"data-width":"1400","data-show-text":"true"},`fb-${s.image}`)}):t==="mp4"?e.jsxs(e.Fragment,{children:[e.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"fixed top-0 left-0 w-full h-full object-cover z-[-3]",children:[e.jsx("source",{src:n,type:"video/mp4"}),"Your browser does not support the video tag."]},`video-bg-${s.image}`),e.jsx("style",{children:`
57                        .blur-overlay {
58                            position: fixed;
59                            top: 0;
60                            left: 0;
61                            width: 100%;
62                            height: 100%;
63                            backdrop-filter: blur(20px);
64                            z-index: -2;
65                        }
66                    `}),e.jsx("div",{className:"blur-overlay"}),e.jsxs("video",{id:"bgVideo",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"absolute inset-0 max-w-full max-h-full m-auto",controls:!0,children:[e.jsx("source",{src:n,type:"video/mp4"}),"Your browser does not support the video tag."]},`video-main-${s.image}`)]}):t==="glb"?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
67                        .blur-overlay {
68                            position: fixed;
69                            top: 0;
70                            left: 0;
71                            width: 100%;
72                            height: 100%;
73                            backdrop-filter: blur(20px);
74                            z-index: -1;
75                        }
76                    `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("model-viewer",{src:n,alt:"3D model",className:"fixed top-0 left-0 w-full h-full",ar:!0,"auto-rotate":!0,"camera-controls":!0,"shadow-intensity":"1"},`model-${s.image}`)]}):z(s.image)?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
77                        .blur-overlay {
78                            position: fixed;
79                            top: 0;
80                            left: 0;
81                            width: 100%;
82                            height: 100%;
83                            backdrop-filter: blur(20px);
84                            z-index: -1;
85                        }
86                    `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:s.image,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",allowFullScreen:!0,scrolling:"yes"},`iframe-url-${s.image}`)]}):e.jsx("iframe",{src:re,className:"fixed top-0 left-0 w-full h-full border-none",allow:"microphone *; camera *; autoplay *; fullscreen *; display-capture *;",sandbox:`allow-forms allow-modals allow-orientation-lock allow-pointer-lock 
87                        allow-popups allow-popups-to-escape-sandbox allow-presentation 
88                        allow-same-origin allow-scripts allow-top-navigation 
89                        allow-top-navigation-by-user-activation allow-downloads allow-storage-access-by-user-activation`,allowFullScreen:!0,loading:"lazy",name:"binauralMixerFrame",allowTransparency:"true",scrolling:"yes"},`html-${s.image}`)},[s,z]),Y=o.useCallback(t=>new Date(t).toLocaleDateString("en-US",{weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),[]),q=o.useCallback(t=>{switch(t){case"completed":return e.jsx(a,{icon:me,className:"text-green-500"});case"failed":return e.jsx(a,{icon:M,className:"text-red-500"});
89case"pending":return e.jsx(a,{icon:u,className:"text-yellow-500 animate-spin"});default:return e.jsx(a,{icon:u,className:"text-gray-500"})}},[]),D=o.useCallback(async()=>{if(!(!p||m)){w(!0);try{const t=k+1,l=await F.get("/seller/theme-history",{params:{page:t}});l.data.data&&l.data.data.length>0?(A(n=>[...n,...l.data.data]),I(t),S(l.data.current_page<l.data.last_page)):S(!1)}catch(t){console.error("Error loading more purchases:",t)}finally{w(!1)}}},[k,p,m]);o.useCallback(t=>{const l=typeof t=="string"?parseFloat(t):t;return isNaN(l)?"0.00":l.toFixed(2)},[]);const c=o.useCallback(t=>{const l=typeof t=="string"?parseFloat(t):t;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(isNaN(l)?0:l).replace("$","EZ$")},[]),W=o.useCallback(t=>{const l=new Date;return l.setMonth(t-1),l.toLocaleString("en-US",{month:"short"})},[]);return e.jsxs(e.Fragment,{children:[e.jsxs(de,{children:[e.jsx("title",{children:"Seller Theme History - Your Theme Sales and Earnings"}),e.jsx("meta",{name:"description",content:"View your theme sales history, earnings, and customer information"}),B,e.jsx("style",{children:`
90                    .react-tooltip {
91                        z-index: 99999 !important;
92                        opacity: 1 !important;
93                        font-size: 12px;
94                        padding: 4px 8px;
95                    }
96                `})]}),e.jsx(ke,{id:"history-tooltip"}),e.jsx(Ne,{auth:U}),e.jsxs("main",{className:`relative flex justify-end p-4 min-h-screen overflow-hidden ${s!=null&&s.image&&y(g(s.image))?"blur-bg":""}`,children:[e.jsx("div",{className:"absolute inset-0 z-0",children:V}),v&&e.jsxs("div",{className:"relative mt-4 mx-auto bottom-4 z-50 backdrop-blur-sm p-4 rounded-xl border border-white-700 overflow-y-auto shadow-2xl w-full max-w-7xl",children:[e.jsx("button",{onClick:()=>N(!1),className:"absolute top-2 right-2 w-8 h-8 bg-black rounded-full flex items-center justify-center z-50 hover:bg-gray-800 transition-colors focus:outline-none focus:ring-2 focus:ring-white","aria-label":"Close panel","data-tooltip-id":"history-tooltip","data-tooltip-content":"Close this panel",children:e.jsx(a,{icon:M,className:"text-white text-lg",style:{textShadow:"0.7px 0.7px 0 rgb(255,0,0), -0.7px -0.7px 0 rgb(0,255,255)"}})}),e.jsxs("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx(a,{icon:E,className:"text-yellow-400 text-2xl"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"Seller Theme History"})]}),e.jsxs(j,{href:"/themes",className:"flex items-center gap-2 bg-yellow-400 text-black font-bold py-2 px-4 rounded-md hover:bg-yellow-500 transition-colors","data-tooltip-id":"history-tooltip","data-tooltip-content":"Manage your themes and upload new ones",children:[e.jsx(a,{icon:P}),"Manage Themes"]})]}),i&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[e.jsx("div",{className:"bg-gray-900/50 rounded-lg p-4 border border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-400",children:"Total Sales"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:i.total_sales||0})]}),e.jsx(a,{icon:xe,className:"text-blue-400 text-xl"})]})}),e.jsx("div",{className:"bg-gray-900/50 rounded-lg p-4 border border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-400",children:"Total Revenue"}),e.jsx("p",{className:"text-2xl font-bold text-green-400",children:c(i.total_revenue||0)})]}),e.jsx(a,{icon:pe,className:"text-green-400 text-xl"})]})}),e.jsx("div",{className:"bg-gray-900/50 rounded-lg p-4 border border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-400",children:"Your Earnings"}),e.jsx("p",{className:"text-2xl font-bold text-yellow-400",children:c(i.total_earnings||0)})]}),e.jsx(a,{icon:T,className:"text-yellow-400 text-xl"})]})}),e.jsx("div",{className:"bg-gray-900/50 rounded-lg p-4 border border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-400",children:"Platform Commission"}),e.jsx("p",{className:"text-2xl font-bold text-red-400",children:c(i.total_commission||0)})]}),e.jsx(a,{icon:L,className:"text-red-400 text-xl"})]})})]}),e.jsx("div",{className:"border-b border-gray-700",children:e.jsxs("nav",{className:"-mb-px flex space-x-8",children:[e.jsx("button",{onClick:()=>_("sales"),className:`py-2 px-1 border-b-2 font-medium text-sm ${f==="sales"?"border-yellow-400 text-yellow-400":"border-transparent text-gray-400 hover:text-gray-300"}`,children:"Sales History"}),e.jsx("button",{onClick:()=>_("analytics"),className:`py-2 px-1 border-b-2 font-medium text-sm ${f==="analytics"?"border-yellow-400 text-yellow-400":"border-transparent text-gray-400 hover:text-gray-300"}`,children:"Monthly Analytics"})]})}),f==="sales"?e.jsx(e.Fragment,{children:m&&h.length===0?e.jsx("div",{className:"flex justify-center items-center h-64",children:e.jsx(a,{icon:u,className:"text-yellow-400 text-4xl animate-spin"})}):h.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(a,{icon:ue,className:"text-gray-400 text-5xl mb-4"}),e.jsx("h3",{className:"text-xl font-medium text-gray-300 mb-2",children:"No sales yet"}),e.jsx("p",{className:"text-gray-400 mb-6",children:"Your theme sales will appear here when customers purchase your themes"}),e.jsxs(j,{href:"/themes",className:"inline-flex items-center gap-2 bg-yellow-400 text-black font-bold py-2 px-6 rounded-md hover:bg-yellow-500 transition-colors","data-tooltip-id":"history-tooltip","data-tooltip-content":"Upload and manage your themes",children:[e.jsx(a,{icon:P}),"Upload Themes"]})]}):e.jsxs("div",{className:"overflow-x-auto",children:[e.jsxs("table",{className:"min-w-full divide-y divide-gray-700",children:[e.jsx("thead",{className:"bg-gray-900/50",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"The purchased theme details",children:"Theme"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Customer who purchased the theme",children:"Customer"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Link to the transaction invoice",children:"Invoice"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Total sale amount",children:"Sale Amount"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Your earnings after commission",children:"Your Earnings"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Platform commission",children:"Commission"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Payment method used",children:"Method"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Current status of the transaction",children:"Status"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-yellow-400 uppercase tracking-wider","data-tooltip-id":"history-tooltip","data-tooltip-content":"Date and time of the transaction",children:"Date"})]})}),e.jsx("tbody",{className:"bg-gray-800/50 divide-y divide-gray-700",children:h.map(t=>e.jsxs("tr",{className:"hover:bg-gray-700/50 transition-colors",children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.theme?e.jsxs("div",{className:"flex items-center",children:[e.jsx(a,{icon:he,className:"mr-2 text-purple-400"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-white",children:t.theme.title}),e.jsxs("div",{className:"text-xs text-gray-400",children:["ID: ",t.theme.unique_id]})]})]}):e.jsx("span",{className:"text-sm text-gray-400",children:"N/A"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.buyer?e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center text-sm text-white",children:[e.jsx(a,{icon:fe,className:"mr-2 text-blue-400"}
96),t.buyer.name]}),e.jsxs("div",{className:"flex items-center text-xs text-gray-400",children:[e.jsx(a,{icon:ge,className:"mr-2"}),t.buyer.email]})]}):e.jsx("span",{className:"text-sm text-gray-400",children:"N/A"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.invoice?e.jsxs(j,{href:`/theme-sell-invoice/${t.invoice.number}`,target:"_blank",className:"flex items-center text-sm text-blue-400 hover:text-blue-300 hover:underline","data-tooltip-id":"history-tooltip","data-tooltip-content":"View invoice details in a new tab",children:[e.jsx(a,{icon:ye,className:"mr-2"}),t.invoice.number]}):e.jsx("span",{className:"text-sm text-gray-400",children:"N/A"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"text-sm font-medium text-white",children:c(t.amount)})})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(a,{icon:T,className:"text-yellow-400 mr-2"}),e.jsx("span",{className:"text-sm font-medium text-yellow-400",children:c(t.seller_amount)})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(a,{icon:L,className:"text-red-400 mr-2"}),e.jsx("span",{className:"text-sm font-medium text-red-400",children:c(t.commission)})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:"text-sm text-gray-300 capitalize",children:t.payment_method})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center","data-tooltip-id":"history-tooltip","data-tooltip-content":`Transaction status: ${t.status}`,children:[q(t.status),e.jsx("span",{className:"ml-2 text-sm text-gray-300 capitalize",children:t.status})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(a,{icon:be,className:"text-blue-400 mr-2"}),e.jsx("span",{className:"text-sm text-gray-300",children:Y(t.processed_at)})]})})]},t.id))})]}),e.jsxs("div",{className:"mt-6 flex flex-col items-center space-y-4",children:[e.jsxs("button",{className:"flex items-center gap-2 bg-gray-700 text-white px-4 py-2 rounded-md hover:bg-gray-600 transition-colors",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),"data-tooltip-id":"history-tooltip","data-tooltip-content":"Scroll to the top of the page",children:[e.jsx(a,{icon:je}),"Back to Top"]}),p&&e.jsx("button",{onClick:D,disabled:m,className:"flex items-center gap-2 bg-yellow-400 text-black font-bold py-2 px-6 rounded-md hover:bg-yellow-500 transition-colors disabled:opacity-50","data-tooltip-id":"history-tooltip","data-tooltip-content":p?"Load the next page of sales history":"No more sales to load",children:m?e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:u,className:"animate-spin"}),"Loading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:we}),"Load More"]})})]})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gray-900/50 rounded-lg p-6 border border-gray-700",children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"Monthly Earnings Overview"}),$.length>0?e.jsx("div",{className:"space-y-4",children:$.map(t=>e.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-white font-medium",children:[W(t.month)," ",t.year]}),e.jsx("span",{className:"text-yellow-400 font-bold",children:c(t.monthly_earnings)})]}),e.jsxs("div",{className:"flex justify-between text-sm text-gray-400",children:[e.jsxs("span",{children:["Sales: ",t.monthly_sales]}),e.jsxs("span",{children:["Avg: ",c(t.monthly_earnings/(t.monthly_sales||1))," per sale"]})]})]},`${t.year}-${t.month}`))}):e.jsxs("div",{className:"text-center py-8 text-gray-400",children:[e.jsx(a,{icon:E,className:"text-4xl mb-4"}),e.jsx("p",{children:"No earnings data available yet"})]})]}),i&&e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.jsxs("div",{className:"bg-gray-900/50 rounded-lg p-6 border border-gray-700",children:[e.jsx("h4",{className:"text-md font-semibold text-white mb-3",children:"Performance Metrics"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-400",children:"Average per Sale:"}),e.jsx("span",{className:"text-white font-medium",children:c(i.average_earnings_per_sale)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-400",children:"Commission Rate:"}),e.jsxs("span",{className:"text-white font-medium",children:[i.total_revenue?(i.total_commission/i.total_revenue*100).toFixed(1):"0.0","%"]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-400",children:"Your Share:"}),e.jsxs("span",{className:"text-white font-medium",children:[i.total_revenue?(i.total_earnings/i.total_revenue*100).toFixed(1):"0.0","%"]})]})]})]})})]})]})]}),!v&&e.jsxs("button",{onClick:()=>N(!0),className:"fixed bottom-4 right-4 z-50 flex items-center gap-2 bg-yellow-400 text-black font-bold py-3 px-4 roun
96ded-full shadow-lg hover:bg-yellow-500 transition-colors","data-tooltip-id":"history-tooltip","data-tooltip-content":"Show sales history panel",children:[e.jsx(a,{icon:ve}),"Show History"]})]})]})}export{Me 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.