1import{u as E,r as o,b as S,j as e,H as R,L as C}from"./app-DP13319Q.js";import{F as a,a as z,f as Y,ar as V,aR as H,j as h,k as u,aF as U,ai as B,az as I,P as G,au as O,av as Z,ah as Q}from"./index-CtyZ6W6U.js";import{D as W}from"./DraggableMenu-Bk7Spryo.js";import{M as f}from"./react-tooltip.min-DW3XhwOj.js";/* empty css */import"./index-DQkUn08L.js";function oe(){const{auth:T,template:q,transfers:n}=E().props,[i,r]=o.useState(!1),[_,J]=o.useState(!0),[g,A]=o.useState(n.current_page||1),[d,y]=o.useState(n.data),[p,j]=o.useState(n.current_page<n.last_page),[l,b]=o.useState(null),[M,x]=o.useState(!1),[w,N]=o.useState(null),[m,v]=o.useState(null),P=o.useCallback(t=>new Date(t).toLocaleDateString("en-US",{weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),[]),D=o.useCallback(async()=>{if(!(!p||i)){r(!0);try{const t=g+1,s=await S.get("/pending-transfers",{params:{page:t}});s.data.data&&s.data.data.length>0?(y(c=>[...c,...s.data.data]),A(t),j(s.data.current_page<s.data.last_page)):j(!1)}catch(t){console.error("Error loading more transfers:",t)}finally{r(!1)}}},[g,p,i]),k=o.useCallback(async(t,s)=>{b({id:t,action:s}),x(!0)},[]),F=o.useCallback(async()=>{if(!l)return;const{id:t,action:s}=l;try{r(!0),x(!1),(await S.post("/seller/transfers/respond",{transfer_id:t,action:s})).data.success&&(y(L=>L.filter($=>$.id!==t)),v(`Transfer ${s}ed successfully!`),setTimeout(()=>v(null),5e3))}catch(c){console.error(`Error ${s}ing transfer:`,c),N(`Failed to ${s} transfer. Please try again.`),setTimeout(()=>N(null),5e3)}finally{r(!1),b(null)}},[l]);return e.jsxs(e.Fragment,{children:[e.jsxs(R,{children:[e.jsx("title",{children:"Pending Domain Transfers - Your Pending Handle Transactions"}),e.jsx("meta",{name:"description",content:"View and manage your pending domain transfers"}),e.jsx("style",{children:` 2 .react-tooltip { 3 z-index: 99999 !important; 4 opacity: 1 !important; 5 font-size: 12px; 6 padding: 4px 8px; 7 } 8 `})]}),e.jsx(f,{id:"action-tooltip"}),e.jsx(f,{id:"form-tooltip"}),e.jsx(f,{id:"modal-tooltip"}),w&&e.jsxs("div",{className:"fixed top-20 right-4 bg-red-600 text-white px-4 py-2 rounded-md shadow-lg z-100 flex items-center toast-slide-in",children:[e.jsx(a,{icon:z,className:"mr-2"}),w]}),m&&e.jsxs("div",{className:"fixed top-20 right-4 bg-green-600 text-white px-4 py-2 rounded-md shadow-lg z-100 flex items-center toast-slide-in",children:[e.jsx(a,{icon:Y,className:"mr-2"}),m,m.includes("Invoice")&&e.jsx(a,{icon:V,className:"ml-2"})]}),e.jsx(W,{auth:T}),e.jsxs("main",{className:"relative flex justify-end p-4 min-h-screen overflow-hidden",children:[_&&e.jsx("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-6xl",children: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:H,className:"text-yellow-400 text-2xl"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"Pending Domain Transfers"})]}),e.jsxs(C,{href:"/marketplace",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":"action-tooltip","data-tooltip-content":"Go to the marketplace to buy or sell domains",children:[e.jsx(a,{icon:h}),"Marketplace"]})]}),i&&d.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"})}):d.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(a,{icon:U,className:"text-gray-400 text-5xl mb-4"}),e.jsx("h3",{className:"text-xl font-medium text-gray-300 mb-2",children:"No pending transfers"}),e.jsx("p",{className:"text-gray-400 mb-6",children:"Your pending domain transfers will appear here"}),e.jsxs(C,{href:"/marketplace",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":"action-tooltip","data-tooltip-content":"Visit the Marketplace",children:[e.jsx(a,{icon:h}),"Visit Marketplace"]})]}):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":"form-tooltip","data-tooltip-content":"Accept or reject the transfer offer",children:"Actions"}),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":"form-tooltip","data-tooltip-content":"The domain or handle being transferred",children:"Domain/Handle"}),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":"form-tooltip","data-tooltip-content":"Your role in this transaction (Seller or Buyer)",children:"Role"}),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":"form-tooltip","data-tooltip-content":"The agreed price for the transfer",children:"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":"form-tooltip","data-tooltip-content":"The other user involved in this transfer",children:"Other Party"}),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":"form-tooltip","data-tooltip-content":"The current status of the transfer",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":"form-tooltip","data-tooltip-content":"The date and time this offer expires",children:"Expires"})]})}),e.jsx("tbody",{className:"bg-gray-800/50 divide-y divide-gray-700",children:d.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.can_respond?e.jsxs("div",{className:"flex space-x-2",children:[e.jsx("button",{onClick:()=>k(t.id,"accept"),disabled:i,className:"px-3 py-1 bg-green-500 text-white text-sm rounded hover:bg-green-600 disabled:opacity-50","data-tooltip-id":"action-tooltip","data-tooltip-content":"Accept this transfer offer",children:"Accept"}),e.jsx("button",{onClick:()=>k(t.id,"reject"),disabled:i,className:"px-3 py-1 bg-red-500 text-white text-sm rounded hover:bg-red-600 disabled:opacity-50","data-tooltip-id":"action-tooltip","data-tooltip-content":"Reject this transfer offer",children:"Reject"})]}):e.jsx("span",{className:"text-sm text-gray-400","data-tooltip-id":"form-tooltip","data-tooltip-content":"Awaiting response from the other party",children:"Waiting for seller"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(a,{icon:t.domain.type==="custom"?B:h,className:`mr-2 ${t.domain.type==="custom"?"text-blue-400":"text-green-400"}`}),e.jsx("a",{href:t.domain.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-white hover:underline","data-tooltip-id":"action-tooltip","data-tooltip-content":"View the domain/handle",children:t.domain.url})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:`px-2 py-1 text-xs rounded-full ${t.is_seller?"bg-purple-500 text-white":"bg-blue-500 text-white"}`,"data-tooltip-id":"form-tooltip","data-tooltip-content":`You are the ${t.is_seller?"Seller":"Buyer"}`,children:t.is_seller?"Seller":"Buyer"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(a,{icon:I,className:"text-yellow-400 mr-2"}),e.jsxs("span",{className:"text-sm font-medium text-white",children:["EZ$",t.amount.toLocaleStr
8ing("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})]}),t.is_seller&&e.jsxs("span",{className:"ml-2 text-xs text-gray-300","data-tooltip-id":"form-tooltip","data-tooltip-content":"Your earnings after commission",children:["(You get: EZ$",t.seller_amount.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),")"]})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.other_party?e.jsxs("div",{className:"flex items-center","data-tooltip-id":"form-tooltip","data-tooltip-content":t.other_party.email,children:[e.jsx(a,{icon:G,className:"text-gray-400 mr-2"}),e.jsx("span",{className:"text-sm text-gray-300",children:t.other_party.email})]}):e.jsx("span",{className:"text-sm text-gray-400",children:"Unknown"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:"text-sm text-yellow-400 capitalize",children:t.status})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center","data-tooltip-id":"form-tooltip","data-tooltip-content":`Offer expires at: ${t.expires_at}`,children:[e.jsx(a,{icon:O,className:"text-blue-400 mr-2"}),e.jsx("span",{className:"text-sm text-gray-300",children:P(t.expires_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":"action-tooltip","data-tooltip-content":"Scroll to the top of the page",children:[e.jsx(a,{icon:Z}),"Back to Top"]}),p&&e.jsx("button",{onClick:D,disabled:i,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":"action-tooltip","data-tooltip-content":"Load more pending transfers",children:i?e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:u,className:"animate-spin"}),"Loading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:Q}),"Load More"]})})]})]})]})}),M&&l&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"backdrop-blur-sm rounded-lg max-w-md w-full p-6 border border-gray-700",children:[e.jsxs("h3",{className:"text-xl font-bold text-white mb-4",children:["Confirm ",l.action==="accept"?"Acceptance":"Rejection"]}),e.jsx("p",{className:"text-gray-300 mb-6",children:l.action==="accept"?"Are you sure you want to accept this transfer and sell your domain?":"Are you sure you want to reject this transfer? You will receive 10% of the amount as compensation."}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:()=>x(!1),className:"px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 transition-colors","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Cancel and close this dialog",children:"Cancel"}),e.jsx("button",{onClick:F,disabled:i,className:`px-4 py-2 rounded transition-colors ${l.action==="accept"?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"} disabled:opacity-50`,"data-tooltip-id":"modal-tooltip","data-tooltip-content":`Finalize your decision to ${l.action}`,children:i?e.jsxs("span",{className:"flex items-center",children:[e.jsx(a,{icon:u,className:"animate-spin mr-2"}),"Processing..."]}):`Confirm ${l.action==="accept"?"Accept":"Reject"}`})]})]})})]})]})}export{oe 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.