PageSourceSearch

https://starplace.net/assets/sellers-BuFKRDg8.js

js starplace.net collected 2026-10-02 02:03:31 UTC 10,243 bytes, 1 lines download raw bytes

1import{r as f,k as w,p as _,j as e,ak as v,B as m,ai as k,a5 as C,aX as T,aY as D,y as P,t as b,q as N}from"./index-t0Mu2_aA.js";import{C as S}from"./card-CPRZ8kHu.js";import{B as d}from"./badge-2FpYajiv.js";import{T as q,a as A,b as u,c as R}from"./tabs-xBwsCaQU.js";import{T as B}from"./textarea-Dw_U_RCb.js";import{M as $}from"./message-square-C3ZNE1F1.js";import{E as g}from"./external-link-DPDSPUjC.js";function E({score:r}){return r==null?e.jsx(d,{variant:"outline",children:"no score"}):r>=60?e.jsxs(d,{variant:"destructive",children:["risk ",r]}):r>=30?e.jsxs(d,{className:"bg-warning text-background",children:["risk ",r]}):e.jsxs(d,{variant:"outline",children:["risk ",r]})}function F({app:r,expanded:o,onToggle:h,onDecide:j}){const[n,l]=f.useState(null),[c,p]=f.useState(""),{data:a}=_({enabled:o,queryKey:["admin-app-detail",r.id],queryFn:()=>N("admin.applicationDetail",{id:r.id})});function t(i){if(i!=="approve"&&!c.trim())return b.error("Provide a reason");j(i,c.trim()||void 0),l(null),p("")}const x=a?.acceptances??[],s=a?.application??r;return e.jsxs(S,{className:"p-4 w-full max-w-full overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[e.jsxs("button",{type:"button",className:"flex-1 text-left min-w-0",onClick:h,"aria-expanded":o,children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"font-display text-lg break-words min-w-0",children:s.full_name}),e.jsx(E,{score:s.risk_score}),e.jsx(d,{variant:"outline",children:s.status}),s.pep_declared&&e.jsx(d,{variant:"destructive",children:"PEP"}),s.status==="approved"&&!s.license_paid_at&&e.jsx(d,{className:"bg-warning text-background",children:"license fee pending"}),s.status==="pending"&&!s.license_paid_at&&e.jsx(d,{variant:"outline",className:"border-warning text-warning",children:"awaiting license payment"}),s.license_refunded_at&&e.jsx(d,{variant:"outline",children:"fee refunded"})]}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground min-w-0",children:[e.jsxs("span",{className:"font-mono break-all",children:["@",s.rsi_handle]}),s.discord&&e.jsxs("span",{className:"break-all",children:["Discord: ",e.jsx("span",{className:"text-foreground",children:s.discord})]}),e.jsxs("span",{children:[s.city??"",s.state?`/${s.state}`:""," ",s.country]}),e.jsx("span",{children:v(s.created_at)})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 shrink-0",children:[s.status==="pending"||s.status==="needs_more_info"?e.jsxs(e.Fragment,{children:[e.jsxs(m,{size:"sm",onClick:()=>t("approve"),className:"flex-1 md:flex-none",disabled:!s.license_paid_at,title:s.license_paid_at?void 0:"Applicant has not paid the license fee yet",children:[e.jsx(k,{className:"mr-1 h-3 w-3"}),"Approve"]}),e.jsxs(m,{size:"sm",variant:"outline",onClick:()=>l("needs_more_info"),className:"flex-1 md:flex-none",children:[e.jsx($,{className:"mr-1 h-3 w-3"}),"Needs info"]}),e.jsxs(m,{size:"sm",variant:"destructive",onClick:()=>l("reject"),className:"flex-1 md:flex-none",children:[e.jsx(C,{className:"mr-1 h-3 w-3"}),"Reject"]})]}):null,e.jsx(m,{size:"icon",variant:"ghost",onClick:h,"aria-label":"Toggle detail",children:o?e.jsx(T,{className:"h-4 w-4"}):e.jsx(D,{className:"h-4 w-4"})})]})]}),s.status==="revoked"&&e.jsxs("div",{className:"mt-2 rounded bg-destructive/10 p-2 text-xs text-destructive",children:["Revoked ",s.revoked_at?v(s.revoked_at):"",s.revoke_reason?` — ${s.revoke_reason}`:""," ·"," ",s.reinstate_allowed?`eligible for the $${((s.reinstate_fine_cents??5e3)/100).toFixed(0)} reinstatement fine`:"reinstatement NOT allowed (final)"]}),s.rejection_reason&&e.jsxs("p",{className:`mt-2 rounded p-2 text-xs ${s.status==="needs_more_info"?"bg-hud/10 text-hud":"bg-destructive/10 text-destructive"}`,children:[s.status==="needs_more_info"?"Pending applicant info: ":"",s.rejection_reason]}),o&&e.jsxs("div",{className:"mt-4 grid gap-4 border-t border-border/40 pt-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1 text-xs",children:[e.jsx("div",{className:"mb-1 font-mono uppercase tracking-widest text-muted-foreground",children:"Identity"}),e.jsxs("div",{children:["Type: ",s.seller_type??"—"]}),e.jsxs("div",{children:["DOB: ",s.date_of_birth??"—"]}
1),e.jsxs("div",{children:["Nationality: ",s.nationality??"—"]}),e.jsxs("div",{children:["Tax ID: ",s.tax_id??"—"]}),s.seller_type==="business"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:["Business: ",s.business_name??"—"]}),e.jsxs("div",{children:["Business tax ID: ",s.business_tax_id??"—"]})]})]}),e.jsxs("div",{className:"space-y-1 text-xs",children:[e.jsx("div",{className:"mb-1 font-mono uppercase tracking-widest text-muted-foreground",children:"Address"}),e.jsx("div",{children:s.street??"—"}),e.jsxs("div",{children:[s.city??"—",s.state?`, ${s.state}`:""]}),e.jsx("div",{children:s.postal_code??"—"}),e.jsx("div",{children:s.country??"—"})]}),e.jsxs("div",{className:"space-y-1 text-xs md:col-span-2",children:[e.jsx("div",{className:"mb-1 font-mono uppercase tracking-widest text-muted-foreground",children:"KYC documents"}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[s.id_document_url&&e.jsxs("a",{href:s.id_document_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-sm text-hud hover:underline",children:[e.jsx(g,{className:"h-3 w-3"}),"ID document"]}),s.selfie_url&&e.jsxs("a",{href:s.selfie_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-sm text-hud hover:underline",children:[e.jsx(g,{className:"h-3 w-3"}),"Selfie"]}),s.address_proof_url&&e.jsxs("a",{href:s.address_proof_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-sm text-hud hover:underline",children:[e.jsx(g,{className:"h-3 w-3"}),"Proof of address"]}),!s.id_document_url&&!s.selfie_url&&!s.address_proof_url&&e.jsx("span",{className:"text-muted-foreground",children:"none uploaded (legacy application)"})]})]}),e.jsxs("div",{className:"space-y-1 text-xs md:col-span-2",children:[e.jsx("div",{className:"mb-1 font-mono uppercase tracking-widest text-muted-foreground",children:"Payout"}),e.jsxs("div",{children:["PayPal: ",s.paypal_account_email??"—"]}),e.jsxs("div",{children:["Phone: ",s.phone??"—"]}),e.jsxs("div",{children:["Device fingerprint: ",s.device_fingerprint??"—"]})]}),e.jsxs("div",{className:"text-xs md:col-span-2",children:[e.jsx("div",{className:"mb-1 font-mono uppercase tracking-widest text-muted-foreground",children:"Legal acceptances"}),x.length===0?e.jsx("p",{className:"text-muted-foreground",children:"No acceptances recorded."}):e.jsx("div",{className:"overflow-x-auto -mx-4 md:mx-0",children:e.jsxs("table",{className:"w-full border-collapse text-xs min-w-[480px]",children:[e.jsx("thead",{className:"text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"border-b border-border/40 py-1 px-2 text-left",children:"Document"}),e.jsx("th",{className:"border-b border-border/40 py-1 px-2 text-left",children:"Version"}),e.jsx("th",{className:"border-b border-border/40 py-1 px-2 text-left",children:"When"}),e.jsx("th",{className:"border-b border-border/40 py-1 px-2 text-left",children:"IP"})]})}),e.jsx("tbody",{children:x.map((i,y)=>e.jsxs("tr",{children:[e.jsx("td",{className:"border-b border-border/20 py-1 px-2",children:i.doc_type}),e.jsx("td",{className:"border-b border-border/20 py-1 px-2 font-mono",children:i.version}),e.jsx("td",{className:"border-b border-border/20 py-1 px-2",children:v(i.accepted_at)}),e.jsx("td",{className:"border-b border-border/20 py-1 px-2 font-mono break-all",children:i.ip??"—"})]},y))})]})})]}),s.notes&&e.jsxs("div",{className:"text-xs md:col-span-2",children:[e.jsx("div",{className:"mb-1 font-mono uppercase tracking-widest text-muted-foreground",children:"Notes (from applicant)"}),e.jsx("p",{className:"text-foreground",children:s.notes})]})]}),n&&e.jsxs("div",{className:"mt-4 space-y-2 border-t border-border/60 pt-4",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:n==="needs_more_info"?"Describe what extra information or document the applicant should provide:":"Reason for rejection:"}),e.jsx(B,{rows:3,value:c,onChange:i=>p(i.target.value),placeholder:n==="needs_more_info"?"e.g. The proof of address is older than 3 months — please upload a re
1cent one.":"Reason"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(m,{variant:n==="needs_more_info"?"default":"destructive",onClick:()=>t(n),children:n==="needs_more_info"?"Send needs-info notice":"Confirm rejection"}),e.jsx(m,{variant:"ghost",onClick:()=>{l(null),p("")},children:"Cancel"})]})]})]})}function V(){const[r,o]=f.useState("pending"),[h,j]=f.useState(null),n=w(),{data:l=[],isLoading:c}=_({queryKey:["admin-applications",r],queryFn:()=>N("admin.applications",{status:r})});async function p(a,t,x){try{await P("admin.sellerDecision",{id:a,decision:t,reason:x});const s=t==="approve"?"approved":t==="reject"?"rejected":"info requested";b.success(`Application ${s}`),n.invalidateQueries({queryKey:["admin-applications"]}),n.invalidateQueries({queryKey:["admin-app-detail"]})}catch(s){b.error(s.message)}}return e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-3xl",children:"Sellers"}),e.jsxs(q,{value:r,onValueChange:a=>o(a),className:"mt-6",children:[e.jsxs(A,{children:[e.jsx(u,{value:"pending",children:"Pending"}),e.jsx(u,{value:"needs_more_info",children:"Needs info"}),e.jsx(u,{value:"approved",children:"Approved"}),e.jsx(u,{value:"rejected",children:"Rejected"}),e.jsx(u,{value:"revoked",children:"Revoked"})]}),e.jsxs(R,{value:r,className:"mt-4 space-y-4",children:[c&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}),!c&&l.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Nothing here."}),r==="pending"&&l.length>0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"Sorted by risk score (highest first). The badge color indicates approximate exposure."}),l.map(a=>e.jsx(F,{app:a,expanded:h===a.id,onToggle:()=>j(t=>t===a.id?null:a.id),onDecide:(t,x)=>p(a.id,t,x)},a.id))]})]})]})}export{V as component};

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.