PageSourceSearch

https://www.underpriced.app/assets/AiToolsModal-DGizURTc.js

js underpriced.app collected 2026-10-01 16:26:37 UTC 33,292 bytes, 1 lines download raw bytes

1import{j as e,M as ye}from"./index-BYYBsydq.js";import"./vendor-react-_Neh0V1j.js";import{s as fe}from"./listingDraftsConfig-Bg40dg0Q.js";import{e as ce,r as we}from"./FlipperItemCard-BacmyQtz.js";import{aC as ke,aE as Se,a7 as Ae,V as Te,X as Pe,L as Re,i as F,J as Fe,k as ie,l as L,y as Le,a3 as xe,S as de,g as Ie,E as me}from"./vendor-lucide-tCdvH6wV.js";import"./api-CE_mADJ_.js";import"./analysisSemantics-CjN872Cn.js";import"./pricingMath-Butp0AXX.js";import"./platformUtils-Cue7k07j.js";import"./alignedDealOverview-DJFOxwDS.js";const oe=Object.freeze({LOW_FAKE_RISK:"low",LIKELY_AUTHENTIC:"low",MODERATE_FAKE_RISK:"moderate",CHECK_CAREFULLY:"moderate",HIGH_FAKE_RISK:"high",HIGH_RISK:"high",CANNOT_ASSESS:"unknown"}),$e=Object.freeze({low:Object.freeze({label:"Low fake risk for this kind of item",bannerClass:"bg-emerald-900/30 border-emerald-500/30",labelClass:"text-emerald-400"}),moderate:Object.freeze({label:"Moderate fake risk. Check it carefully",bannerClass:"bg-amber-900/30 border-amber-500/30",labelClass:"text-amber-400"}),high:Object.freeze({label:"High fake risk. Authenticate before you buy",bannerClass:"bg-red-900/30 border-red-500/30",labelClass:"text-red-400"}),unknown:Object.freeze({label:"Can't rate fake risk from the description",bannerClass:"bg-slate-800/50 border-slate-700/50",labelClass:"text-slate-400"})});function I(r){return String(r||"").trim().toUpperCase().replace(/[\s-]+/g,"_")}function Be(r={}){const i=I(r==null?void 0:r.categoryRisk)||I(r==null?void 0:r.verdict),s=oe[i]||oe[I(r==null?void 0:r.verdict)]||null,n=Math.round(Number(r==null?void 0:r.riskLevel)),x=Number.isFinite(n)&&n>=1?Math.min(10,n):null;if(!s&&x===null)return null;const p=s||(x<=3?"low":x<=6?"moderate":"high");return{tone:p,riskLevel:x,...$e[p]}}const f=(r,i)=>{if(!r||typeof r!="object")return null;const s=r[i];if(typeof s=="number"&&Number.isFinite(s))return s;const n=r[`${i}Price`];return typeof n=="number"&&Number.isFinite(n)?n:null},o=(r,i)=>{if(typeof r!="number"||!Number.isFinite(r))return"—";const s=Math.round(r*100)/100,n=Math.abs(s%1)>.009;return`${i}${s.toFixed(n?2:0)}`},Ue=(r,i="Completed sale")=>{if(!r)return i;const s=String(r).match(/^(\d{4})-(\d{2})-(\d{2})$/);if(s){const[,x,p,m]=s;return new Date(Date.UTC(Number(x),Number(p)-1,Number(m))).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"})}const n=new Date(r);return Number.isNaN(n.getTime())?i:n.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})},_e=(r,i)=>{const s=we(r),n=(r==null?void 0:r.priceIsUpperBound)===!0||(r==null?void 0:r.bestOfferAccepted)===!0,x=s===null?null:`${n?"up to ":""}${o(s,i)}`;return x?typeof(r==null?void 0:r.shippingCost)=="number"&&Number.isFinite(r.shippingCost)?r.shippingCost<=0?`Buyer paid ${x} total (free shipping)`:`Buyer paid ${x} total (${o(r.shippingCost,i)} shipping)`:`Buyer paid ${x} total`:typeof(r==null?void 0:r.shippingCost)=="number"&&Number.isFinite(r.shippingCost)?r.shippingCost<=0?"Free shipping":`Shipping ${o(r.shippingCost,i)}`:r!=null&&r.rawShippingText?`Shipping: ${r.rawShippingText}`:"Shipping basis unavailable"},Ee=r=>{switch(r){case"exactVerifiedSold":return{label:"Exact sold match",chipClass:"border-emerald-500/30 bg-emerald-500/10 text-emerald-300"};case"exactUnverifiedSold":return{label:"Exact sold match",chipClass:"border-emerald-500/30 bg-emerald-500/10 text-emerald-300"};case"nearVerifiedSold":return{label:"Close match sold",chipClass:"border-sky-500/30 bg-sky-500/10 text-sky-300"};case"nearUnverifiedSold":return{label:"Close match sold",chipClass:"border-sky-500/30 bg-sky-500/10 text-sky-300"};default:return{label:"Review item",chipClass:"border-slate-500/30 bg-slate-500/10 text-slate-300"}}},pe=r=>!r||typeof r!="object"?null:r.matchState==="local_model_mismatch"?"These results may be for a different model.":null,Ge=({aiModalOpen:r,setAiModalOpen:i,aiModalConfig:s,currencySymbol:n,ebayCustomQuery:x,setEbayCustomQuery:p,ebayCustomSearchLoading:m,handleCustomEbaySearch:v,showToast:u,onUpgradeClick:S})=>{var $;if(!r)return null;const he=fe(),d=(s==null?void 0:s.type)==="authenticity"?Be(s.content):null;return e.jsx(ye,{children:e.jsx("div",{className:"modal-fixed-overlay p-4",onClick:()=>i(!1),role:"dialog","aria-modal":"true","aria-labelledby":"ai-modal-title",children:e.jsxs("div",{className:"bg-slate-900 border border-slate-700 rounded-2xl w-full max-w-2xl max-h-[90vh] overflow-hidden flex flex-col shadow-2xl relative",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-slate-800 flex-shrink-0",children:[e.jsxs("h2",{id:"ai-modal-title",className:"text-xl font-bold text-white flex items-center gap-2",children:[s.type==="dive"&&e.jsx(ke,{className:"w-5 h-5 text-purple-400"}),s.type==="msg"&&e.jsx(Se,{className:"w-5 h-5 text-indigo-400"}),s.type==="flipstrategy"&&e.jsx(Ae,{className:"w-5 h-5 text-indigo-400"}),s.type==="ebaycomps"&&e.jsx(Te,{className:"w-5 h-5 text-amber-400"}),s.title]}),e.jsx("button",{onClick:()=>i(!1),className:"p-2 hover:bg-slate-800 rounded-lg transition-colors","aria-label":"Close AI modal",children:e.jsx(Pe,{className:"w-5 h-5 text-slate-400"})})]}),e.jsx("div",{className:"p-5 flex-1 overflow-y-auto",children:s.loading?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(Re,{className:"w-10 h-10 text-indigo-500 animate-spin mb
1-4"}),e.jsx("p",{className:"text-slate-400",children:"Analyzing with AI..."}),e.jsx("p",{className:"text-slate-500 text-sm mt-1",children:"This may take a few seconds"})]}):s.error?e.jsxs("div",{className:"bg-red-900/30 border border-red-500/50 rounded-xl p-4 text-red-300",children:[e.jsx(F,{className:"w-5 h-5 inline-block mr-2"}),s.error]}):(($=s.content)==null?void 0:$.enabled)===!1?e.jsxs("div",{className:"text-center py-8 text-slate-400",children:[e.jsx("div",{className:"text-4xl mb-4",children:"🚧"}),e.jsx("p",{children:s.content.message})]}):s.type==="authenticity"&&s.content?e.jsxs("div",{className:"space-y-4",children:[d&&e.jsxs("div",{className:`rounded-xl p-4 border text-center ${d.bannerClass}`,"data-testid":"authenticity-risk-banner",children:[e.jsx("div",{className:`text-lg font-bold leading-snug ${d.labelClass}`,children:d.label}),d.riskLevel!==null&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-2","aria-label":`Fake risk ${d.riskLevel} out of 10`,children:[e.jsx("span",{className:"text-sm text-slate-400",children:"Fake Risk:"}),e.jsx("div",{className:"flex gap-0.5","aria-hidden":"true",children:[...Array(10)].map((t,l)=>e.jsx("div",{className:`w-3 h-3 rounded-sm ${l<d.riskLevel?d.riskLevel<=3?"bg-emerald-500":d.riskLevel<=6?"bg-amber-500":"bg-red-500":"bg-slate-700"}`},l))}),e.jsxs("span",{className:"text-sm font-bold text-slate-300",children:[d.riskLevel,"/10"]})]})]}),s.content.authPoints&&s.content.authPoints.length>0&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsxs("h4",{className:"text-sm font-bold text-emerald-400 uppercase mb-3 flex items-center gap-2",children:[e.jsx(Fe,{className:"w-4 h-4"})," How to Verify Authenticity"]}),e.jsx("ul",{className:"space-y-2",children:s.content.authPoints.map((t,l)=>e.jsxs("li",{className:"text-slate-300 text-sm flex items-start gap-2",children:[e.jsx("span",{className:"w-5 h-5 bg-emerald-500/20 rounded-full flex items-center justify-center text-emerald-400 text-xs font-bold flex-shrink-0 mt-0.5",children:l+1}),t]},l))})]}),s.content.redFlags&&s.content.redFlags.length>0&&e.jsxs("div",{className:"bg-red-900/20 rounded-xl p-4 border border-red-500/30",children:[e.jsx("h4",{className:"text-sm font-bold text-red-400 uppercase mb-2",children:"⚠️ Fake Warning Signs"}),e.jsx("ul",{className:"space-y-1",children:s.content.redFlags.map((t,l)=>e.jsxs("li",{className:"text-red-300/80 text-sm flex items-start gap-2",children:[e.jsx("span",{className:"text-red-500 mt-0.5",children:"•"})," ",t]},l))})]}),s.content.quickTip&&e.jsxs("div",{className:"bg-amber-900/20 rounded-xl p-4 border border-amber-500/30",children:[e.jsx("h4",{className:"text-sm font-bold text-amber-400 uppercase mb-2",children:"💡 Quick Tip"}),e.jsx("p",{className:"text-amber-200/80 text-sm",children:s.content.quickTip})]})]}):s.type==="dive"&&s.content?e.jsxs("div",{className:"space-y-4",children:[s.content.overview&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-purple-400 uppercase mb-2",children:"Overview"}),e.jsx("p",{className:"text-slate-300 text-sm leading-relaxed",children:s.content.overview})]}),s.content.identification&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-purple-400 uppercase mb-2",children:"Identification"}),e.jsx("p",{className:"text-slate-300 text-sm leading-relaxed",children:s.content.identification})]}),s.content.priceAnalysis&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-purple-400 uppercase mb-2",children:"Price Analysis"}),e.jsx("p",{className:"text-slate-300 text-sm leading-relaxed",children:s.content.priceAnalysis})]}),s.content.conditionAssessment&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-purple-400 uppercase mb-2",children:"Condition Assessment"}),e.jsx("p",{className:"text-slate-300 text-sm leading-relaxed",children:s.content.conditionAssessment})]}),s.content.valueAnalysis&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-purple-400 uppercase mb-2",children:"Value Analysis"}),e.jsx("p",{className:"text-slate-300 text-sm leading-relaxed",children:s.content.valueAnalysis})]}),s.content.verdict&&e.jsxs("div",{className:"bg-purple-900/30 rounded-xl p-4 border border-purple-500/30",children:[e.jsx("h4",{className:"text-sm font-bold text-purple-400 uppercase mb-2",children:"Expert Verdict"}),e.jsx("p",{className:"text-purple-200 text-sm leading-relaxed",children:s.content.verdict})]}),s.content.redFlags&&s.content.redFlags.length>0&&e.jsxs("div",{className:"bg-red-900/20 rounded-xl p-4 border border-red-500/30",children:[e.jsx("h4",{className:"text-sm font-bold text-red-400 uppercase mb-2",children:"⚠️ Red Flags"}),e.jsx("ul",{className:"space-y-1",children:s.content.redFlags.map((t,l)=>e.jsxs("li",{className:"text-red-300/80 text-sm flex items-start gap-2",children:[e.jsx("span",{className:"text-red-500 mt-0.5",children:"•"})," ",t]},l))})]})]}):s.type==="msg"&&s.content?e.jsxs("div",{className:"space-y-4",children:[s.content.strategy&&e.jsxs("div",{className:"bg-indigo-900/30 rounded-xl p-4 border border-indigo-500/30",children:[e.jsx("h4",{className:"text-sm font-bold text-indigo-400 uppercase mb-2",children:"Strategy"}),e.jsx("p",{className:"text-indigo-200 text-sm leading-relaxed",children:s.content.strategy})]}),s.content.leveragePoints&&s.content.leveragePoints.length>0&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-indigo-400 uppercase mb-2",children:"Leverage Points"}),e.jsx("ul",{className:"space-y-2",children:s.content.leveragePoints.map((t,l)=>e.jsxs("li",{className:"text-slate-300 text-sm flex items-start gap-2",children:[e.jsxs("span",{className:"text-indigo-400 font-bold",children:[l+1,"."]})," ",t]},l))})]}),s.content.inspectionChecklist&&s.content.inspectionChecklist.length>0&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-indigo-400 uppercase mb-2",children:"Inspection Checklist"}),e.jsx("ul",{className:"space-y-2",children:s.content.inspectionChecklist.map((t,l)=>e.jsxs("li",{className:"text-slate-300 text-sm flex items-start gap-2",children:[e.jsx(ie,{className:"w-4 h-4 text-indigo-400 flex-shrink-0 mt-0.5"})," ",t]},l))})]}),s.content.valueAssessment&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-indigo-400 uppercase mb-2",children:"Value Assessment"}),e.jsx("p",{className:"text-slate-300 text-sm leading-relaxed",children:s.content.valueAssessment})]}),s.content.targetPrice&&e.jsxs("div",{className:"bg-purple-900/30 rounded-xl p-4 border border-purple-500/30 text-center",children:[e.jsx("p",{className:"text-sm text-purple-400 mb-1",children:"Target Price"}),e.jsxs("p",{className:"text-3xl font-bold text-purple-300",children:[n,s.content.targetPrice]}),s.content.targetReasoning&&e.jsx("p",{className:"text-slate-400 text-xs mt-2",children:s.content.targetReasoning})]}),s.content.messages&&s.content.messages.length>0&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-indigo-400 uppercase mb-3",children:"Ready-to-Use Messages"}),e.jsx("div",{className:"space-y-3",children:s.content.messages.map((t,l)=>e.jsxs("div",{className:"bg-slate-900/50 rounded-lg p-3 border border-slate-700",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs font-semibold text-indigo-400 uppercase",children:t.label}),e.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(t.text).then(()=>u("Copied!")).catch(()=>u("Copy failed","error"))},className:"px-2 py-1 bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-medium rounded flex items-center gap-1",children:[e.jsx(L,{className:"w-3 h-3"})," Copy"]})]}),e.jsx("p",{className:"text-slate-300 text-sm",children:t.text})]},l))})]}
1),s.content.tips&&s.content.tips.length>0&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-indigo-400 uppercase mb-3",children:"Quick Tips"}),e.jsx("div",{className:"space-y-3",children:s.content.tips.map((t,l)=>e.jsxs("div",{className:"bg-slate-900/50 rounded-lg p-3 border border-slate-700",children:[e.jsx("span",{className:"text-xs font-semibold text-indigo-400 uppercase block mb-1",children:t.label}),e.jsx("p",{className:"text-slate-300 text-sm",children:t.text})]},l))})]})]}):s.type==="flipstrategy"&&s.content?e.jsxs("div",{className:"space-y-4",children:[s.content.sellChannels&&s.content.sellChannels.length>0&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-indigo-400 uppercase mb-3",children:"Best Platforms to Sell"}),e.jsx("div",{className:"space-y-3",children:s.content.sellChannels.map((t,l)=>e.jsxs("div",{className:"bg-slate-900/50 rounded-lg p-3 border border-slate-700",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"w-6 h-6 bg-purple-600/30 rounded-full flex items-center justify-center text-xs font-bold text-purple-300",children:["#",t.rank||l+1]}),e.jsx("span",{className:"font-semibold text-white",children:t.platform})]}),e.jsxs("span",{className:"text-indigo-400 font-bold",children:[n,t.expectedPrice]})]}),e.jsx("p",{className:"text-slate-400 text-sm mb-1",children:t.reasoning}),(t.fees||t.timeToSell)&&e.jsxs("div",{className:"flex gap-3 text-xs text-slate-500",children:[t.fees&&e.jsxs("span",{children:["Fees: ",t.fees]}),t.timeToSell&&e.jsxs("span",{children:["• ",t.timeToSell]})]})]},l))})]}),s.content.pricing&&e.jsxs("div",{className:"bg-purple-900/30 rounded-xl p-4 border border-purple-500/30",children:[e.jsx("h4",{className:"text-sm font-bold text-purple-400 uppercase mb-3",children:"Pricing Strategy"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-3",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"List At"}),e.jsxs("p",{className:"text-xl font-bold text-white",children:[n,s.content.pricing.listPrice]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Min Accept"}),e.jsxs("p",{className:"text-xl font-bold text-amber-400",children:[n,s.content.pricing.minimumAccept]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Expected"}),e.jsxs("p",{className:"text-xl font-bold text-indigo-400",children:[n,s.content.pricing.expectedFinal]})]})]}),s.content.pricing.reasoning&&e.jsx("p",{className:"text-slate-300 text-sm",children:s.content.pricing.reasoning})]}),s.content.listing&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-indigo-400 uppercase mb-3",children:"Ready-to-Use Listing"}),s.content.listing.title&&e.jsxs("div",{className:"mb-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs font-semibold text-slate-400 uppercase",children:"Title"}),e.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(s.content.listing.title).then(()=>u("Title copied!")).catch(()=>u("Copy failed","error"))},className:"px-2 py-1 bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-medium rounded flex items-center gap-1",children:[e.jsx(L,{className:"w-3 h-3"})," Copy"]})]}),e.jsx("p",{className:"text-white font-medium bg-slate-900/50 rounded-lg p-2 text-sm",children:s.content.listing.title})]}),s.content.listing.description&&e.jsxs("div",{className:"mb-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs font-semibold text-slate-400 uppercase",children:"Description"}),e.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(s.content.listing.description).then(()=>u("Description copied!")).catch(()=>u("Copy failed","error"))},className:"px-2 py-1 bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-medium rounded flex items-center gap-1",children:[e.jsx(L,{className:"w-3 h-3"})," Copy"]})]}),e.jsx("p",{className:"text-slate-300 bg-slate-900/50 rounded-lg p-3 text-sm whitespace-pre-wrap",children:s.content.listing.description})]}),s.content.listing.tags&&s.content.listing.tags.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-semibold text-slate-400 uppercase block mb-2",children:"Keywords/Tags"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.content.listing.tags.map((t,l)=>e.jsx("span",{className:"px-2 py-1 bg-slate-700/50 text-slate-300 rounded text-xs",children:t},l))})]})]}
1),s.content.photoTips&&s.content.photoTips.length>0&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-indigo-400 uppercase mb-2",children:"Photo Tips"}),e.jsx("ul",{className:"space-y-1.5",children:s.content.photoTips.map((t,l)=>e.jsxs("li",{className:"text-slate-300 text-sm flex items-start gap-2",children:[e.jsx(Le,{className:"w-4 h-4 text-purple-500 flex-shrink-0 mt-0.5"})," ",t]},l))})]}),s.content.quickTips&&s.content.quickTips.length>0&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-indigo-400 uppercase mb-2",children:"Quick Tips"}),e.jsx("ul",{className:"space-y-1.5",children:s.content.quickTips.map((t,l)=>e.jsxs("li",{className:"text-slate-300 text-sm flex items-start gap-2",children:[e.jsx(ie,{className:"w-4 h-4 text-purple-500 flex-shrink-0 mt-0.5"})," ",t]},l))})]}),s.content.warnings&&s.content.warnings.length>0&&e.jsxs("div",{className:"bg-amber-900/20 rounded-xl p-4 border border-amber-500/30",children:[e.jsx("h4",{className:"text-sm font-bold text-amber-400 uppercase mb-2",children:"⚠️ Watch Out For"}),e.jsx("ul",{className:"space-y-1",children:s.content.warnings.map((t,l)=>e.jsxs("li",{className:"text-amber-300/80 text-sm flex items-start gap-2",children:[e.jsx("span",{className:"text-amber-500 mt-0.5",children:"•"})," ",t]},l))})]})]}):s.type==="ebaycomps"&&s.content?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Refine your search for better results:"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:x,onChange:t=>p(t.target.value),placeholder:"Enter custom search terms...",className:"flex-1 bg-slate-800 border border-slate-600 rounded-lg px-3 py-2 text-sm text-white placeholder-slate-500 outline-none focus:border-amber-500",onKeyDown:t=>t.key==="Enter"&&v(),disabled:m}),e.jsx("button",{onClick:v,disabled:m||!x.trim(),className:"bg-amber-600 hover:bg-amber-500 disabled:bg-slate-700 disabled:text-slate-500 text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors flex items-center gap-2",children:m?e.jsx(xe,{className:"w-4 h-4 animate-spin"}):e.jsx(de,{className:"w-4 h-4"})})]})]}),(()=>{var z,K,O,H,Q,q,Y,W,G,J,X,Z,C,M,ee,se,te,re;const t=((z=s.content)==null?void 0:z.dataType)==="sold"?(K=s.content)==null?void 0:K.ebayCompsEvidence:null,l=he&&!!t,j=(t==null?void 0:t.identityStale)===!0,B=l&&!j&&Array.isArray(t==null?void 0:t.exactVerifiedSold)?t.exactVerifiedSold:[],be=l&&!j?Array.isArray(t==null?void 0:t.unverifiedItems)?t.unverifiedItems:Array.isArray(t==null?void 0:t.exactUnverifiedSold)?t.exactUnverifiedSold:[]:[],h=[...B,...be],N=l&&!j?Array.isArray(t==null?void 0:t.nearItems)?t.nearItems:[...Array.isArray(t==null?void 0:t.nearVerifiedSold)?t.nearVerifiedSold:[],...Array.isArray(t==null?void 0:t.nearUnverifiedSold)?t.nearUnverifiedSold:[]]:[],U=l&&!j?t==null?void 0:t.strictPriceStats:null,b=f(U,"median")>0?U:null,y=l&&!j&&!b?ce(h):null,ue=l&&Object.prototype.hasOwnProperty.call(t,"familyReferenceEligible"),w=l&&!j&&!b?ue?t.familyReferenceEligible===!0?t.familyReferenceStats:null:ce(N):null,_=!b&&Number((y==null?void 0:y.sampleSize)||0)<3&&Number((w==null?void 0:w.sampleSize)||0)>=3,E=_?null:y,D=!b&&(_||!y)?w:null,g=b||E||D,A=b?"exact":E?"exact_review":D?"close":null,V=l&&!!g,T=l?!!(t!=null&&t.valuationEligible)&&!!b&&B.length>0:!1,je=l&&h.length>0,Ne=l&&N.length>0;if(l&&(je||Ne)){const c=T?"Sold Price Summary":A==="close"?"Close-Match Sold Price Summary":"Reference Sold Price Summary",k=pe(t),le=((O=t==null?void 0:t.compsAudit)==null?void 0:O.normalizedPrimaryQuery)||((H=s.content)==null?void 0:H.searchQuery)||"",ae=P=>!Array.isArray(P)||P.length===0?null:e.jsx("div",{className:"space-y-3",children:P.slice(0,8).map((a,ge)=>{const ne=Ee(a==null?void 0:a.tier),R=(a==null?void 0:a.soldDate)||(a==null?void 0:a.soldDateRaw),ve=R?`Sold ${Ue(R)}`:"Completed sale";return e.jsxs("a",{href:a==null?void 0:a.itemUrl,target:"_blank",rel:"noopener noreferrer",className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50 flex gap-4 items-center hover:border-amber-500/30 transition-colors group",children:[(a==null?void 0:a.imageUrl)&&e.jsx("img",{src:a.imageUrl,alt:a.title||"Comparable item",className:"w-16 h-16 object-cover rounded-lg flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap mb-1",children:[e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-semibold ${ne.chipClass}`,children:ne.label}),e.jsx("span",{className:`text-[10px] ${R?"text-emerald-400":"text-slate-400"}`,children:ve})]}),e.jsx("p",{className:"text-white font-medium text-sm line-clamp-3 group-hover:text-amber-300 transition-colors",children:a==null?void 0:a.title}),e.jsxs("p",{className:"text-slate-500 text-xs",children:[(a==null?void 0:a.condition)||"
1Unknown"," • ",_e(a,n)]})]}),e.jsxs("div",{className:"text-right flex-shrink-0",children:[e.jsx("span",{className:"text-amber-400 font-bold text-lg",children:o(a==null?void 0:a.price,n)}),e.jsx(me,{className:"w-3 h-3 text-slate-500 ml-1 inline"})]})]},(a==null?void 0:a.id)||`${(a==null?void 0:a.tier)||"row"}-${ge}`)})});return e.jsxs("div",{className:"space-y-3",children:[k&&e.jsxs("div",{className:"bg-amber-500/8 border border-amber-500/30 rounded-xl p-4 text-amber-300 text-sm leading-relaxed",children:[e.jsx(F,{className:"w-4 h-4 inline-block mr-2 align-text-bottom"}),k]}),V&&e.jsxs("div",{className:`rounded-xl p-4 border ${T?"bg-cyan-500/[0.06] border-cyan-500/20":"bg-amber-500/[0.06] border-amber-500/25"}`,children:[e.jsx("h4",{className:`mb-3 text-sm font-bold uppercase ${T?"text-cyan-300":"text-amber-300"}`,children:c}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-center sm:grid-cols-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Low"}),e.jsx("p",{className:"break-words text-sm font-bold leading-tight text-slate-300 min-[360px]:text-base sm:text-lg",children:o(f(g,"low"),n)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Median"}),e.jsx("p",{className:"break-words text-sm font-bold leading-tight text-amber-300 min-[360px]:text-base sm:text-lg",children:o(f(g,"median"),n)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Average"}),e.jsx("p",{className:"break-words text-sm font-bold leading-tight text-amber-400 min-[360px]:text-base sm:text-lg",children:o(f(g,"average"),n)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"High"}),e.jsx("p",{className:"break-words text-sm font-bold leading-tight text-indigo-400 min-[360px]:text-base sm:text-lg",children:o(f(g,"high"),n)})]})]}),e.jsxs("p",{className:"text-xs text-slate-500 mt-2 text-center",children:["Based on ",g.sampleSize||(A==="close"?N.length:h.length)," ",A==="close"?"close-match":"exact"," sold items",le?` · Query: ${le}`:""]})]}),h.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-xs sm:text-sm font-bold text-emerald-300 uppercase",children:"Exact Sold Matches"}),ae(h)]}),N.length>0&&e.jsxs("details",{className:"group",open:h.length===0,children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-500/50 [&::-webkit-details-marker]:hidden",children:[e.jsx("h4",{className:"text-xs sm:text-sm font-bold text-sky-300 uppercase",children:"Close Matches"}),e.jsx("span",{className:"flex items-center text-sky-400",children:e.jsx(Ie,{className:"h-3.5 w-3.5 transition-transform duration-200 group-open:rotate-180","aria-hidden":"true"})})]}),e.jsx("div",{className:"mt-3 space-y-3",children:ae(N)})]}),!V&&(h.length>0||N.length>0)&&e.jsx("div",{className:"bg-slate-800/60 rounded-xl p-4 border border-slate-700/50 text-sm text-slate-300",children:"These matches do not include usable prices. Open the rows to compare the model, variant, condition, included items, and shipping."})]})}if(l){const c=pe(t);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center py-8 text-slate-400",children:[e.jsx("div",{className:"text-4xl mb-4",children:"📊"}),e.jsx("p",{children:"No verified sold comps found for this item."})]}),c&&e.jsxs("div",{className:"bg-amber-500/8 border border-amber-500/30 rounded-xl p-4 text-amber-300 text-sm leading-relaxed",children:[e.jsx(F,{className:"w-4 h-4 inline-block mr-2 align-text-bottom"}),c]})]})}return s.content.found&&s.content.items&&s.content.items.length>0?e.jsxs("div",{className:"space-y-3",children:[s.content.priceStats&&e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:[e.jsx("h4",{className:"text-sm font-bold text-amber-400 uppercase mb-3",children:"Price Summary"}),e.jsxs("div",{className:"grid grid-cols-4 gap-3 text-center",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Low"}),e.jsxs("p",{className:"text-lg font-bold text-slate-300",children:[n,s.content.priceStats.low]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Median"}),e.jsxs("p",{className:"text-lg font-bold text-amber-300",children:[n,s.content.priceStats.median]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Average"}),e.jsxs("p",{className:"text-lg font-bold text-amber-400",children:[n,s.content.priceStats.average]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"High"}),e.jsxs("p",{className:"text-lg font-bold text-indigo-400",children:[n,s.content.priceStats.high]})]})]}),e.jsxs("p",{className:"text-xs text-slate-500 mt-2 text-center",children:["Based on ",s.content.priceStats.sampleSize," ",((Q=s.content)==null?void 0:Q.dataType)==="sold"?"sold":"listed"," items",(q=s.content)!=null&&q.searchQuery?` · Query: ${s.content.searchQuery}`:""]})]}),e.jsx("h4",{className:"text-xs sm:text-sm font-bold text-amber-400 uppercase",children:((Y=s.content)==null?void 0:Y.dataType)==="sold"?"Archived eBay Sold Data":"eBay Listed Comps"}),e.jsxs("p",{className:"text-xs text-slate-500 -mt-2",children:["Based on ",((W=s.content.priceStats)==null?void 0:W.sampleSize)||((G=s.content.items)==null?void 0:G.length)||0," ",((J=s.content)==null?void 0:J.dataType)==="sold"?"sold":"listed"," items",(((Z=(X=s.content)==null?void 0:X.priceStats)==null?void 0:Z.sampleSize)||((M=(C=s.content)==null?void 0:C.items)==null?void 0:M.length)||0)<3&&e.jsx("span",{className:"text-amber-400 ml-1",children:"(low sample — treat with caution)"})]}),s.content.items.slice(0,8).map((c,k)=>e.jsxs("a",{href:c.itemUrl,target:"_blank",rel:"noopener noreferrer",className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50 flex gap-4 items-center hover:border-amber-500/30 transition-colors group",children:[c.imageUrl&&e.jsx("img",{src:c.imageUrl,alt:c.title||"Comparable item",className:"w-16 h-16 object-cover rounded-lg flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-white font-medium text-sm truncate group-hover:text-amber-300 transition-colors",children:c.title}),e.jsxs("p",{className:"text-slate-500 text-xs",children:[c.condition," • ",c.listingType]}),c.seller&&e.jsxs("p",{className:"text-slate-600 text-xs",children:["Seller: ",c.seller]})]}),e.jsxs("div",{className:"text-right flex-shrink-0",children:[e.jsxs("span",{className:"text-amber-400 font-bold text-lg",children:[n,c.price]}),e.jsx(me,{className:"w-3 h-3 text-slate-500 ml-1 inline"})]})]},k)),((ee=s.content)==null?void 0:ee.dataType)!=="sold"&&s.content.note&&e.jsx("p",{className:"text-xs text-slate-500 text-center",children:s.content.note}),((se=s.content)==null?void 0:se.tierLimited)&&e.jsxs("div",{className:"mt-3 p-2.5 rounded-lg bg-amber-500/[0.08] border border-amber-500/15 flex items-center justify-between",children:[e.jsxs("p",{className:"text-xs text-slate-400",children:["Upgrade for ",e.jsx("span",{className:"text-amber-300 font-medium",children:"sold prices"})," and higher accuracy"]}),e.jsx("button",{onClick:()=>{i(!1),S==null||S()},className:"shrink-0 ml-3 px-3 py-1 rounded-full bg-amber-500/20 text-amber-300 text-[11px] font-medium hover:bg-amber-500/30 transition-colors",children:"Upgrade"})]}),((te=s.content)==null?void 0:te.fallback)&&!((re=s.content)!=null&&re.tierLimited)&&e.jsx("p",{className:"mt-2 text-[10px] text-slate-500 italic text-center",children:"Sold data temporarily unavailable — showing current listings."})]}):s.content.enabled===!1?e.jsxs("div",{className:"text-center py-8 text-slate-400",children:[e.jsx("div",{className:"text-4xl mb-4",children:"🔜"}),e.jsx("p",{children:s.content.message||"eBay integration coming soon!"})]}):e.jsxs("div",{className:"text-center py-8 text-slate-400",children:[e.jsx("div",{className:"text-4xl mb-4",children:"📊"}),e.jsx("p",{children:s.content.message||"No eBay listings found for this item."}),s.content.searchQuery&&e.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:['Searched: "',s.content.searchQuery,'"']}),e.jsxs("div",{className:"mt-6 pt-4 border-t border-slate-700",children:[e.jsx("p",{className:"text-xs text-slate-500 mb-3",children:"Try a custom search:"}),e.jsxs("div",{className:"flex gap-2 max-w-sm mx-auto",children:[e.jsx("input",{type:"text",value:x,onChange:c=>p(c.target.value),placeholder:"Enter search terms...",className:"flex-1 bg-slate-800 border border-slate-600 rounded-lg px-3 py-2 text-sm text-white placeholder-slate-500 outline-none focus:border-amber-500",onKeyDown:c=>c.key==="Enter"&&v(),disabled:m}),e.jsx("button",{onClick:v,disabled:m||!x.trim(),className:"bg-amber-600 hover:bg-amber-500 disabled:bg-slate-700 disabled:text-slate-500 text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors flex items-center gap-2",children:m?e.jsx(xe,{className:"w-4 h-4 animate-spin"}):e.jsx(de,{className:"w-4 h-4"})})]})]})]})})()]}):e.jsx("div",{className:"text-center py-8 text-slate-400",children:e.jsx("p",{children:"No content available"})})})]})})})};export{Ge 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.