1import{j as e,X as Se,Y as pe,Z as Me,_ as Fe,u as ne,c as T,C as Oe,T as Te,b as V,F as He,W as $e,$ as qe,e as Ee}from"./index-C76UdKOH.js";import{a as x}from"./react-vendor-cXbuqZRW.js";import{C as D,c as A,a as Ie,b as Be}from"./card-B4fUg5TQ.js";import{B as H}from"./button-FfUJb2if.js";import{D as Re,a as Ue,b as Ve,c as ze}from"./dialog-Dqu_vS0Q.js";import{D as z,a as _,b as K,c as m}from"./dropdown-menu-C-R8QbTz.js";import{M as _e}from"./MetricDrillDownDialog-BAUldKij.js";import{V as Ke,R as Ge}from"./VenueRecommendation-fH5NFIhN.js";import{C as G}from"./index-CcDA_uWf.js";import{T as je}from"./tag-B0LkLOu2.js";import{D as We}from"./dollar-sign-JSRIZ4vQ.js";import{M as Xe}from"./message-square-DlmH9yJZ.js";import{E as Ye}from"./external-link-DnDvmIuY.js";import"./recharts-BXzAbpuU.js";import"./index-CrE9fBJw.js";import"./index-CbQ_CgJ0.js";import"./index-Be4ufDUH.js";import"./index-D41aUpHp.js";import"./arrow-right-PSig_sgZ.js";import"./format--u02yofh.js";import"./separator-Bhnfolbk.js";const Ze=1e6,ie=a=>Math.round(a*Ze);function Je(){const[a,f]=x.useState(""),[h,F]=x.useState(""),[k,S]=x.useState(""),[d,$]=x.useState(null),[v,g]=x.useState(!1),[j,r]=x.useState(null),[N,y]=x.useState(null),C="px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",p="px-3 py-2 rounded-lg text-sm font-medium disabled:opacity-60",M=async()=>{if(a.trim()){g(!0),r(null),y(null);try{$(await Se(a.trim()))}catch{r("Eligibility check failed.")}finally{g(!1)}}},q=async()=>{if(a.trim()){g(!0),r(null);try{const i=await pe({domainName:a.trim(),registrar:(d==null?void 0:d.registrar)??void 0,buynowPriceMicro:h?ie(Number(h)):void 0,minbidPriceMicro:k?ie(Number(k)):void 0});r(i.ok?`Listed on ${i.venue}${i.listStatus?` (${i.listStatus})`:""}.`:`Not listed: ${i.message??"failed"}`)}catch(i){r(i instanceof Error?i.message:"Listing failed.")}finally{g(!1)}}},E=async()=>{if(a.trim()){if(!h){r("Buy Now price (whole USD) is required to list on Atom.");return}g(!0),r(null);try{const i=await pe({domainName:a.trim(),venue:"atom",buynowPriceMicro:ie(Number(h))});r(i.ok?`Listed on Atom${i.listStatus?` (${i.listStatus})`:""}.`:`Not listed: ${i.message??"failed"}`)}catch(i){r(i instanceof Error?i.message:"Atom listing failed.")}finally{g(!1)}}},I=async()=>{if(a.trim()){g(!0),r(null);try{const i=await Me(a.trim());r(i.ok?`Atom DNS verification: ${i.message}`:`DNS not verified: ${i.message}`)}catch(i){r(i instanceof Error?i.message:"Atom DNS verification failed.")}finally{g(!1)}}},W=async()=>{if(!a.trim()||!h){r("Domain and Buy Now price are required for a checkout link.");return}g(!0),r(null);try{const i=await Fe({name:a.trim(),buynowPrice:ie(Number(h))});y(i.url??i.transactionLinkId),r("Afternic checkout link created.")}catch(i){r(i instanceof Error?i.message:"Could not create checkout link.")}finally{g(!1)}};return e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-5 shadow-sm mb-6",children:[e.jsx("h3",{className:"font-semibold text-gray-900",children:"Marketplace listing (internal)"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1 mb-4",children:"List a domain on the marketplace matching its registrar (GoDaddy â Afternic Fast Transfer). Prices in USD; Afternic requires whole dollars (min offer $20)."}),e.jsxs("div",{className:"flex flex-wrap gap-2 items-end",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("label",{className:"text-xs text-gray-500 mb-1",children:"Domain"}),e.jsx("input",{className:C,value:a,onChange:i=>f(i.target.value),placeholder:"example.com"})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("label",{className:"text-xs text-gray-500 mb-1",children:"Buy Now ($)"}),e.jsx("input",{className:C,value:h,onChange:i=>F(i.target.value),inputMode:"decimal",placeholder:"5000"})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("label",{className:"text-xs text-gray-500 mb-1",children:"Min Offer ($)"}),e.jsx("input",{className:C,value:k,onChange:i=>S(i.target.value),inputMode:"decimal",placeholder:"20"})]}),e.jsx("button",{type:"button",onClick:M,disabled:v,className:`${p} bg-gray-100 hover:bg-gray-200 text-gray-800`,children:"Check eligibility"}),e.jsx("button",{type:"button",onClick:q,disabled:v||!(d!=null&&d.eligible),className:`${p} bg-blue-600 hover:bg-blue-700 text-white`,children:d!=null&&d.eligible?`List on ${d.venue}`:"List"}),e.jsx("button",{type:"button",onClick:E,disabled:v,className:`${p} bg-purple-600 hover:bg-purple-700 text-white`,children:"List on Atom"}),e.jsx("button",{type:"button",onClick:I,disabled:v,className:`${p} bg-gray-100 hover:bg-gray-200 text-gray-800`,children:"Verify DNS (Atom)"}),e.jsx("button",{type:"button",onClick:W,disabled:v,className:`${p} bg-gray-100 hover:bg-gray-200 text-gray-800`,children:"Afternic checkout link"})]}),d&&e.jsxs("div",{className:`mt-3 text-sm ${d.eligible?"text-gray-700":"text-orange-700"}`,children:["Registrar: ",e.jsx("span",{className:"font-medium",children:d.registrar??"unknown"})," · Venue:"," ",e.jsx("span",{className:"font-medium",children:d.venue}),d.fastTransfer&&e.jsx("span",{className:"ml-1 text-green-700 font-medium",children:"· Fast Transfer"}),e.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:d.reason})]}),j&&e.jsx("p",{className:"mt-3 text-sm text-gray-800",children:j}),N&&e.jsxs("p",{className:"mt-1 text-sm break-all",children:["Checkout link: ",e.jsx("span",{className:"font-mono text-blue-700",children:N})]})]})}const w={sedo:{channel:"Sedo",commissionPercent:10,flatFee:0,successFee:0},flippa:{channel:"Flippa",commissionPercent:10,flatFee:0,successFee:29},afternic:{channel:"Afternic",commissionPercent:15,flatFee:0,successFee:0},"direct-outreach":{channel:"Direct Outreach",commissionPercent:0,flatFee:0,successFee:0},parked:{channel:"Parked",commissionPercent:0,flatFee:0,successFee:0}},Qe=(a,f)=>{const h=a/365,F=h*f;
1return{renewalCost:a,daysHeld:f,dailyHoldingCost:h,totalHoldingCost:F}},Ne=(a,f,h,F,k)=>{const S=w[h.toLowerCase()]||w.sedo,d=a*S.commissionPercent/100,$=S.flatFee,v=S.successFee||0,g=d+$+v,j=Qe(F,k),r=f+j.totalHoldingCost,N=a-g,y=N-f,C=f>0?y/f*100:0,p=y-j.totalHoldingCost,M=r>0?p/r*100:0;return{listPrice:a,purchasePrice:f,commissionAmount:d,flatFeeAmount:$,successFeeAmount:v,totalSellCost:g,holdingCosts:j,totalCostOfOwnership:r,grossProfit:y,grossProfitMargin:C,operatingProfit:p,operatingMargin:M,netProceeds:N}},o=a=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(a),ae=a=>new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}).format(a/100);function ks(){var oe,de,me,xe,he,ge,ue;const{data:a}=ne(qe,[],{cacheKey:"forsale:listings"}),{data:f}=ne(Ee,[],{cacheKey:"forsale:portfolio"}),{data:h}=ne($e,[],{cacheKey:"forsale:venues"}),F=x.useMemo(()=>new Map(h.map(s=>[s.domainId,s])),[h]),[k,S]=x.useState(null),[d,$]=x.useState(new Set),[v,g]=x.useState(new Set),[j,r]=x.useState("ALL"),[N,y]=x.useState("ALL"),[C,p]=x.useState("ALL"),[M,q]=x.useState("ALL"),[E,I]=x.useState("ALL"),W=j==="ALL"?a:a.filter(s=>s.channel.toLowerCase()===j),i=new Map;W.forEach(s=>{const t=i.get(s.domainId)||[];i.set(s.domainId,[...t,s])});const R=f.filter(s=>i.has(s.id)).map(s=>{const t=i.get(s.id)||[],l=t[0],b=s.purchasePrice,c=Ne(l.listPrice,s.purchasePrice,l.channel,b,s.daysHeld),L=t.some(P=>{var u;return(u=P.offers)==null?void 0:u.some(B=>B.status==="pending")}),O=t.reduce((P,u)=>P+(u.views||0),0),U=t.reduce((P,u)=>P+(u.inquiries||0),0);return{domain:s,listings:t,primaryListing:l,metrics:c,hasPendingOffer:L,totalViews:O,totalInquiries:U}}),ye=s=>{const{hasPendingOffer:t,domain:l,metrics:b,totalInquiries:c}=s;return t?"critical":c>=5&&b.operatingMargin>500||l.daysHeld>60&&b.operatingMargin>300?"high":c>=3||l.daysHeld>30&&b.operatingMargin>0?"medium":b.operatingMargin>0?"low":"none"},be=s=>{const t=ye(s),l=d.has(s.domain.id);if(t==="none")return"";if(!l)switch(t){case"critical":return"ring-4 ring-red-400 shadow-xl shadow-red-200 animate-pulse";case"high":return"ring-4 ring-orange-400 shadow-xl shadow-orange-200";case"medium":return"ring-3 ring-yellow-400 shadow-lg shadow-yellow-200";case"low":return"ring-2 ring-green-400 shadow-md shadow-green-200";default:return""}switch(t){case"critical":return"ring-2 ring-red-300 shadow-md";case"high":return"ring-2 ring-orange-300 shadow-md";case"medium":return"ring-1 ring-yellow-300 shadow-sm";case"low":return"ring-1 ring-green-300";default:return""}},we=s=>{$(t=>new Set(t).add(s))},ve=s=>{g(t=>new Set(t).add(s))},[Ce,re]=x.useState(!1),[ke,Le]=x.useState("listings"),X=(s,t)=>{ve(s),Le(t),re(!0)},le=s=>s==="ALL"?a:a.filter(t=>t.channel.toLowerCase()===s),Y=s=>{const t=le(s),l=new Map;return t.forEach(c=>{const L=l.get(c.domainId)||[];l.set(c.domainId,[...L,c])}),f.filter(c=>l.has(c.id)).map(c=>{const L=l.get(c.id)||[],O=L[0],U=c.purchasePrice,P=Ne(O.listPrice,c.purchasePrice,O.channel,U,c.daysHeld),u=L.some(B=>{var fe;return(fe=B.offers)==null?void 0:fe.some(Ae=>Ae.status==="pending")});return{domain:c,listings:L,primaryListing:O,metrics:P,hasPendingOffer:u}})},Pe=Y(N),Z=le(N).length,De=Pe.length,J=Y(C).filter(s=>s.hasPendingOffer).length,Q=Y(M).reduce((s,t)=>s+t.primaryListing.listPrice,0),ee=Y(E).reduce((s,t)=>s+t.metrics.operatingProfit,0);W.length,R.filter(s=>s.hasPendingOffer).length,R.reduce((s,t)=>s+t.primaryListing.listPrice,0),R.reduce((s,t)=>s+t.metrics.operatingProfit,0);const ce=s=>{switch(s){case"listings":return Z>=10?"high":Z>=5?"medium":Z>=1?"low":"none";case"offers":return J>=3?"critical":J>=2?"high":J>=1?"medium":"none";case"revenue":return Q>=5e4?"high":Q>=3e4?"medium":Q>=1e4?"low":"none";case"profit":return ee>=3e4?"high":ee>=2e4?"medium":ee>=1e4?"low":"none";default:return"none"}},se=s=>{const t=ce(s),l=v.has(s);if(t==="none")return"";if(!l)switch(t){case"critical":return"ring-4 ring-red-400 shadow-xl shadow-red-200 animate-pulse";case"high":return"ring-4 ring-orange-400 shadow-xl shadow-orange-200";case"medium":return"ring-3 ring-yellow-400 shadow-lg shadow-yellow-200";case"low":return"ring-2 ring-green-400 shadow-md shadow-green-200";default:return""}switch(t){case"critical":return"ring-2 ring-red-300 shadow-md";case"high":return"ring-2 ring-orange-300 shadow-md";case"medium":return"ring-1 ring-yellow-300 shadow-sm";case"low":return"ring-1 ring-green-300";default:return""}},te=s=>{switch(ce(s)){case"critical":return"bg-gradient-to-br from-red-50 to-red-100";case"high":return"bg-gradient-to-br from-orange-50 to-orange-100";case"medium":return"bg-gradient-to-br from-yellow-50 to-yellow-100";case"low":return"bg-gradient-to-br from-green-50 to-green-100";default:return"bg-white"}},n=k?R.find(s=>s.domain.id===k):null;return e.jsxs("div",{className:"p-6 md:p-8 max-w-[1600px] mx-auto",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Domains For Sale"}),e.jsx("p",{className:"text-gray-500 mt-1",children:"Track listings, activity, and profit potential across all marketplaces"})]}),e.jsxs(z,{children:[e.jsx(_,{asChild:!0,children:e.jsxs(H,{variant:"outline",className:"gap-2",children:[j==="ALL"?"All Marketplaces":((oe=w[j])==null?void 0:oe.channel)||j,e.jsx(G,{className:"w-4 h-4"})]})}),e.jsxs(K,{align:"end",children:[e.jsx(m,{onClick:()=>r("ALL"),children:"All Marketplaces"}),e.jsx(m,{onClick:()=>r("sedo"),children:"Sedo"}),e.jsx(m,{onClick:()=>r("flippa"),children:"Flippa"}),e.jsx(m,{onClick:()=>r("afternic"),children:"Afternic"})]})]})]}),e.jsx(Je,{}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 mb-6",children:[e.jsx(D,{className:T("transition-all",se("listings"),te("listings")),children:e.jsxs(A,{className:"pt-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Active Listings"}),e.jsxs(z,{children:[e.jsx(_,{asChild:!0,onClick:s=>s.stopPropagation(),children:e.jsxs(H,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2",children:[e.jsx("span",{className:"text-xs",children:N==="ALL"?"All":((de=w[N])==null?void 0:de.channel.split(".")[0])||N}),e.jsx(G,{className:"w-3 h-3"})]})}),e.jsxs(K,{align:"end",children:[e.jsx(m,{onClick:()=>
1y("ALL"),children:"All Marketplaces"}),e.jsx(m,{onClick:()=>y("sedo"),children:"Sedo"}),e.jsx(m,{onClick:()=>y("flippa"),children:"Flippa"}),e.jsx(m,{onClick:()=>y("afternic"),children:"Afternic"})]})]})]}),e.jsx("div",{className:"cursor-pointer",onClick:()=>X("listings","listings"),children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-gray-900",children:Z}),e.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[De," unique domains"]})]}),e.jsx("div",{className:"w-12 h-12 bg-blue-50 rounded-lg flex items-center justify-center",children:e.jsx(je,{className:"w-6 h-6 text-blue-600"})})]})})]})}),e.jsx(D,{className:T("transition-all",se("offers"),te("offers")),children:e.jsxs(A,{className:"pt-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Pending Offers"}),e.jsxs(z,{children:[e.jsx(_,{asChild:!0,onClick:s=>s.stopPropagation(),children:e.jsxs(H,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2",children:[e.jsx("span",{className:"text-xs",children:C==="ALL"?"All":((me=w[C])==null?void 0:me.channel.split(".")[0])||C}),e.jsx(G,{className:"w-3 h-3"})]})}),e.jsxs(K,{align:"end",children:[e.jsx(m,{onClick:()=>p("ALL"),children:"All Marketplaces"}),e.jsx(m,{onClick:()=>p("sedo"),children:"Sedo"}),e.jsx(m,{onClick:()=>p("flippa"),children:"Flippa"}),e.jsx(m,{onClick:()=>p("afternic"),children:"Afternic"})]})]})]}),e.jsx("div",{className:"cursor-pointer",onClick:()=>X("offers","offers"),children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-orange-600",children:J}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Require action"})]}),e.jsx("div",{className:"w-12 h-12 bg-orange-50 rounded-lg flex items-center justify-center",children:e.jsx(Oe,{className:"w-6 h-6 text-orange-600"})})]})})]})}),e.jsx(D,{className:T("transition-all",se("revenue"),te("revenue")),children:e.jsxs(A,{className:"pt-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Potential Revenue"}),e.jsxs(z,{children:[e.jsx(_,{asChild:!0,onClick:s=>s.stopPropagation(),children:e.jsxs(H,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2",children:[e.jsx("span",{className:"text-xs",children:M==="ALL"?"All":((xe=w[M])==null?void 0:xe.channel.split(".")[0])||M}),e.jsx(G,{className:"w-3 h-3"})]})}),e.jsxs(K,{align:"end",children:[e.jsx(m,{onClick:()=>q("ALL"),children:"All Marketplaces"}),e.jsx(m,{onClick:()=>q("sedo"),children:"Sedo"}),e.jsx(m,{onClick:()=>q("flippa"),children:"Flippa"}),e.jsx(m,{onClick:()=>q("afternic"),children:"Afternic"})]})]})]}),e.jsx("div",{className:"cursor-pointer",onClick:()=>X("revenue","listings"),children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-gray-900",children:o(Q)}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"At list prices"})]}),e.jsx("div",{className:"w-12 h-12 bg-green-50 rounded-lg flex items-center justify-center",children:e.jsx(We,{className:"w-6 h-6 text-green-600"})})]})})]})}),e.jsx(D,{className:T("transition-all",se("profit"),te("profit")),children:e.jsxs(A,{className:"pt-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Potential Profit"}),e.jsxs(z,{children:[e.jsx(_,{asChild:!0,onClick:s=>s.stopPropagation(),children:e.jsxs(H,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2",children:[e.jsx("span",{className:"text-xs",children:E==="ALL"?"All":((he=w[E])==null?void 0:he.channel.split(".")[0])||E}),e.jsx(G,{className:"w-3 h-3"})]})}),e.jsxs(K,{align:"end",children:[e.jsx(m,{onClick:()=>I("ALL"),children:"All Marketplaces"}),e.jsx(m,{onClick:()=>I("sedo"),children:"Sedo"}),e.jsx(m,{onClick:()=>I("flippa"),children:"Flippa"}),e.jsx(m,{onClick:()=>I("afternic"),children:"Afternic"})]})]})]}),e.jsx("div",{className:"cursor-pointer",onClick:()=>X("profit","listings"),children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-green-600",children:o(ee)}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Operating profit"})]}),e.jsx("div",{className:"w-12 h-12 bg-green-50 rounded-lg flex items-center justify-center",children:e.jsx(Te,{className:"w-6 h-6 text-green-600"})})]})})]})})]}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4",children:R.map(s=>{const{domain:t,listings:l,primaryListing:b,metrics:c,hasPendingOffer:L,totalViews:O,totalInquiries:U}=s,P=be(s);return e.jsxs(D,{className:T("hover:shadow-lg transition-all cursor-pointer relative",P),onClick:()=>{S(t.id),we(t.id)},children:[L&&e.jsx("div",{className:"absolute -top-2 -right-2 z-10",children:e.jsx(V,{variant:"destructive",className:"shadow-md",children:"Offer Pending"})}),e.jsx(Ie,{className:"pb-3",children:e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"flex-1",children:[e.jsx(Be,{className:"text-xl font-bold text-blue-600",children:t.domainName}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx(V,{variant:"outline",className:"text-xs",children:t.category}),e.jsxs(V,{variant:"outline",className:"text-xs",children:["Score: ",t.acquisitionScore]})]})]})})}),e.jsxs(A,{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Listed on:"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:l.map(u=>{var B;return e.jsx(V,{variant:"secondary",className:"text-xs",children:((B=w[u.channel.toLowerCase()])==null?void 0:B.channel)||u.channel},u.id)})})]}),e.jsxs("div",{className:"border-t border-gray-100 pt-2 space-y-2",onClick:u=>u.stopPropagation(),children:[e.jsx(Ke,{result:F.get(t.id)}),e.jsx(Ge,{domainId:t.id,domainName:t.domainName})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1 text-gray-600",children:[e.jsx(He,{className:"w-4 h-4"}),e.jsx("span",{children:O})]}),e.jsxs("div",{className:"flex items-center gap-1 text-gray-600",children:[e.jsx(Xe,{className:"w-4 h-4"}),e.jsx("span",{children:U})]}),e.jsxs("div",{className:"flex items-center gap-1 text-gray-600",children:[e.jsx(je,{className:"w-4 h-4"}),e.jsxs("span",{children:[t.daysHeld,"d"]})]})]}),e.jsxs("div",{className:"pt-3 border-t space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:"List Price:"}),e.jsx("span",{className:"font-semibold",children:o(b.listPrice)})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:"Cost Basis:"}),e.jsx("span",{className:"font-semibold",children:o(c.totalCostOfOwnership)})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:"Operating Profit:"}),e.jsx("span",{className:T("font-bold",c.operatingProfit>0?"text-green-600":"text-red-600"),children:o(c.operatingProfit)})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:"Margin:"}),e.jsx("span",{className:T("font-bold",c.operatingMargin>0?"text-green-600":"text-red-600"),children:ae(c.operatingMargin)})]})]}),e.jsx(H,{className:"w-full mt-2",variant:"outline",size:"sm",children:"View Details"})]})]},t.id)})}),n&&e.jsx(Re,{open:!!k,onOpenChange:()=>S(null),children:e.jsxs(Ue,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsx(Ve,{children:e.jsx(ze,{className:"text-2xl font-bold text-blue-600",children:n.domain.domainName})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Domain Information"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500",children:"Category"}),e.jsx("p",{className:"font-medium",children:n.domain.category})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500",children:"Acquisition Score"}),e.jsxs("p",{className:"font-medium",children:[n.domain.acquisitionScore,"/100"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500",children:"Purchase Date"}),e.jsx("p",{className:"font-medium",children:n.domain.purchaseDate})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500",children:"Days Held"}),e.jsxs("p",{className:"font-medium",children:[n.domain.daysHeld," days"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500",children:"Renewal Date"}),e.jsx("p",{className:"font-medium",children:n.domain.renewalDate})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500",children:"Liquidity Class"}),e.jsx("p",{className:"font-medium capitalize",children:n.domain.liquidityClass})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Active Listings"}),e.jsx("div",{className:"space-y-3",children:n.listings.map(s=>{var t;return e.jsx(D,{children:e.jsxs(A,{className:"pt-4",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold",children:((t=w[s.channel.toLowerCase()])==null?void 0:t.channel)||s.channel}),e.jsxs("p",{className:"text-sm text-gray-500",children:["Listed ",new Date(s.listedAt).toLocaleDateString()]})]}),s.listingUrl&&e.jsx(H,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx("a",{href:s.listingUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsx(Ye,{className:"w-4 h-4"})})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500",children:"List Price"}),e.jsx("p",{className:"font-semibold",children:o(s.listPrice)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500",children:"Views"}),e.jsx("p",{className:"font-semibold",children:s.views||0})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500",children:"Inquiries"}),e.jsx("p",{className:"font-semibold",children:s.inquiries||0})]})]}),s.offers&&s.offers.length>0&&e.jsxs("div",{className:"mt-3 pt-3 border-t",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Offers"}),e.jsx("div",{className:"space-y-2",children:s.offers.map((l,b)=>e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:o(l.amount)}),e.jsx(V,{variant:l.status==="pending"||l.status==="accepted"?"default":"secondary",children:l.status})]},b))})]})]})},s.id)})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Cost & Profit Analysis"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(D,{className:"bg-gray-50",children:e.jsxs(A,{className:"pt-4",children:[e.jsx("p",{className:"font-medium mb-3",children:"Purchase & Holding Costs"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:"Purchase Price"}),e.jsx("span",{className:"font-medium",children:o(n.metrics.purchasePrice)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("span",{className:"text-gray-600",children:["Holding Costs (",n.domain.daysHeld," days)"]}),e.jsx("span",{className:"font-medium",children:o(n.metrics.holdingCosts.totalHoldingCost)})]}),e.jsxs("div",{className:"flex justify-between pt-2 border-t font-semibold",children:[e.jsx("span",{children:"Total Cost of Ownership"}),e.jsx("span",{children:o(n.metrics.totalCostOfOwnership)})]})]})]})}),e.jsx(D,{className:"bg-gray-50",children:e.jsxs(A,{className:"pt-4",children:[e.jsxs("p",{className:"font-medium mb-3",children:["Selling Costs (",(ge=w[n.primaryListing.channel.toLowerCase()])==null?void 0:ge.channel,")"]}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("span",{className:"text-gray-600",children:["Commission (",(ue=w[n.primaryListing.channel.toLowerCase()])==null?void 0:ue.commissionPercent,"%)"]}),e.jsx("span",{className:"font-medium",children:o(n.metrics.commissionAmount)})]}),n.metrics.flatFeeAmount>0&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:"Flat Fee"}),e.jsx("span",{className:"font-medium",children:o(n.metrics.flatFeeAmount)})]}),n.metrics.successFeeAmount>0&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:"Success Fee"}),e.jsx("span",{className:"font-medium",children:o(n.metrics.successFeeAmount)})]}),e.jsxs("div",{className:"flex justify-between pt-2 border-t font-semibold",children:[e.jsx("span",{children:"Total Selling Cost"}),e.jsx("span",{children:o(n.metrics.totalSellCost)})]})]})]})}),e.jsx(D,{className:"bg-green-50 border-green-200",children:e.jsxs(A,{className:"pt-4",children:[e.jsxs("p",{className:"font-medium mb-3",children:["Profit Analysis (at ",o(n.primaryListing.listPrice),")"]}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-700",children:"List Price"}),e.jsx("span",{className:"font-medium",children:o(n.metrics.listPrice)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-700",children:"- Selling Costs"}),e.jsxs("span",{className:"font-medium text-red-600",children:["-",o(n.metrics.totalSellCost)]})]}),e.jsxs("div",{className:"flex justify-between pt-2 border-t border-green-300",children:[e.jsx("span",{className:"text-gray-700",children:"Net Proceeds"}),e.jsx("span",{className:"font-medium",children:o(n.metrics.netProceeds)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-700",children:"- Purchase Price"}),e.jsxs("span",{className:"font-medium text-red-600",children:["-",o(n.metrics.purchasePrice)]})]}),e.jsxs("div",{className:"flex justify-between pt-2 border-t border-green-300 font-semibold",children:[e.jsx("span",{className:"text-gray-800",children:"Gross Profit"}),e.jsx("span",{className:"text-green-700",children:o(n.metrics.grossProfit)})]}),e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:"text-gray-600",children:"Gross Margin"}),e.jsx("span",{className:"text-green-700",children:ae(n.metrics.grossProfitMargin)})]}),e.jsxs("div",{className:"flex justify-between pt-2 mt-2",children:[e.jsx("span",{className:"text-gray-700",children:"- Holding Costs"}),e.jsxs("span",{className:"font-medium text-red-600",children:["-",o(n.metrics.holdingCosts.totalHoldingCost)]})]}),e.jsxs("div",{className:"flex justify-between pt-2 border-t border-green-300 font-bold text-base",children:[e.jsx("span",{className:"text-gray-900",children:"Operating Profit"}),e.jsx("span",{className:"text-green-700",children:o(n.metrics.operatingProfit)})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:"Operating Margin"}),e.jsx("span",{className:"text-green-700 font-semibold",children:ae(n.metrics.operatingMargin)})]})]})]})})]})]}),n.domain.notes&&e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Notes"}),e.jsx("p",{className:"text-sm text-gray-700",children:n.domain.notes})]})]})]})}),e.jsx(_e,{open:Ce,onOpenChange:re,metricType:ke,portfolioDomains:[],candidates:[],listings:a})]})}export{ks as DomainsForSale};
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.