PageSourceSearch

https://arcvelvet.com/assets/SurfaceArcSign-CvRg0oYL.js

js arcvelvet.com collected 2026-10-04 01:55:39 UTC 36,236 bytes, 2 lines download raw bytes

1import{j as e}from"./three-vendor-CwHCqgiE.js";import{a as r,a7 as ot,X as Re,bb as st,bc as at,T as de,aJ as lt,U as dt,L as je,C as ct,b3 as He,A as ut,ad as pt}from"./ui-vendor-DZKZzj9B.js";import{i as ke,d as $,bs as gt,F as ae,k as xe,bv as be,bw as Be,bx as Te,by as De,bz as $e,bA as Ee,bt as Oe,bq as mt}from"./index-BNIIfNKd.js";import{O as ye,w as le,G as ft,I as Me,a8 as Le}from"./firebase-vendor-C7BnWFiW.js";import"./react-vendor-D2XMRl9g.js";const t={bg:"#050505",card:"rgba(255,255,255,0.025)",border:"rgba(255,255,255,0.08)",accent:"#8C64FF",accentBorder:"rgba(140,100,255,0.30)",amber:"#F59E0B",amberSoft:"rgba(245,158,11,0.10)",amberBorder:"rgba(245,158,11,0.30)",green:"#22c55e",greenSoft:"rgba(34,197,94,0.10)",red:"#ef4444",redSoft:"rgba(239,68,68,0.10)",redBorder:"rgba(239,68,68,0.25)",white:"#EDEDED",text:"rgba(237,237,237,0.72)",textMuted:"rgba(237,237,237,0.42)",textFaint:"rgba(237,237,237,0.22)"},Pe=["Art","Real Estate","Spirits","Fashion","Other"],Xe=["image/jpeg","image/jpg","image/png","image/webp"],ht=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain"],_e=[...Xe,...ht],We=".jpg,.jpeg,.png,.webp,.pdf,.doc,.docx,.txt",Ne=50*1024*1024,Se=200,ve=2e3,W=240,N=5,xt=48;function q(l){const v=l.name||"",y=v.lastIndexOf(".");return y<0||y===v.length-1?"":v.slice(y+1).toLowerCase()}function bt(l){const v=l.match(/insufficient-signings:\s*need\s+(\d+)\s+subscription token\(s\)\s*\+\s*(\d+)\s+Stripe bundle token\(s\);\s*have\s+(\d+)\s+subscription\s*\+\s*(\d+)\s+Stripe bundle/i);return v?{needSub:parseInt(v[1],10),needBundle:parseInt(v[2],10),haveSub:parseInt(v[3],10),haveBundle:parseInt(v[4],10)}:null}function yt({children:l}){return e.jsxs("div",{style:{minHeight:"100vh",background:t.bg,color:t.white,fontFamily:"inherit"},children:[e.jsxs("header",{style:{padding:"20px 24px",borderBottom:`1px solid ${t.border}`,display:"flex",alignItems:"center",justifyContent:"space-between",maxWidth:1200,margin:"0 auto"},children:[e.jsx("a",{href:"/arc/welcome",style:{textDecoration:"none",display:"flex",alignItems:"center",gap:12},children:e.jsx(mt,{variant:"lockup",size:96})}),e.jsxs("a",{href:"/arc/welcome",style:{fontSize:11,fontWeight:700,letterSpacing:"0.10em",textTransform:"uppercase",color:t.textMuted,textDecoration:"none",display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx(ut,{size:12})," Vendor dashboard"]})]}),l]})}function G({children:l}){return e.jsx("section",{style:{maxWidth:720,margin:"0 auto",padding:"48px 24px 80px"},children:l})}function St(){return e.jsxs(G,{children:[e.jsxs("div",{style:{padding:"40px 28px",borderRadius:16,background:t.card,border:`1px solid ${t.border}`,textAlign:"center"},children:[e.jsx(je,{size:22,style:{color:t.accent,marginBottom:14,animation:"arc-spin 1.4s linear infinite"}}),e.jsx("div",{style:{fontSize:14,color:t.textMuted},children:"Loading your signing surface…"})]}),e.jsx("style",{children:"@keyframes arc-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"})]})}function vt({onSignIn:l}){return e.jsx(G,{children:e.jsxs("div",{style:{padding:"40px 28px",borderRadius:16,background:t.card,border:`1px solid ${t.border}`,textAlign:"center"},children:[e.jsx(He,{size:26,style:{color:t.accent,marginBottom:14}}),e.jsx("h1",{style:{fontSize:24,fontWeight:300,color:t.white,margin:"0 0 12px"},children:"Sign in to sign items"}),e.jsx("p",{style:{fontSize:13,color:t.text,lineHeight:1.7,maxWidth:440,margin:"0 auto 24px"},children:"/arc/sign is a vendor-only surface. Sign in with the account tied to your ARC subscription."}),e.jsx("button",{type:"button",onClick:l,style:{padding:"12px 28px",borderRadius:10,fontSize:13,fontWeight:700,background:"linear-gradient(135deg, #8C64FF, #5A3CDF)",color:"white",border:"none",cursor:"pointer",fontFamily:"inherit"},children:"Sign in"})]})})}function jt(){return e.jsx(G,{children:e.jsxs("div",{style:{padding:"32px 28px",borderRadius:16,background:t.amberSoft,border:`1px solid ${t.amberBorder}`},children:[e.jsx(de,{size:22,style:{color:t.amber,marginBottom:14}}),e.jsx("h1",{style:{fontSize:20,fontWeight:400,color:t.white,margin:"0 0 10px"},children:"No ARC vendor account"}),e.jsx("p",{style:{fontSize:13,color:t.text,lineHeight:1.65,marginBottom:20},children:"Subscribe or buy a bundle on /arc to start signing items."}),e.jsxs("a",{href:"/arc",style:{display:"inline-flex",alignItems:"center",gap:6,padding:"10px 22px",borderRadius:10,fontSize:12,fontWeight:700,background:"linear-gradient(135deg, #8C64FF, #5A3CDF)",color:"white",textDecoration:"none",fontFamily:"inherit"},children:["See ARC plans ",e.jsx(pt,{size:12})]})]})})}function kt({reason:l}){return e.jsx(G,{children:e.jsxs("div",{style:{padding:"32px 28px",borderRadius:16,background:t.amberSoft,border:`1px solid ${t.amberBorder}`},children:[e.jsx(de,{size:22,style:{color:t.amber,marginBottom:14}}),e.jsx("h1",{style:{fontSize:20,fontWeight:400,color:t.white,margin:"0 0 10px"},children:l==="inactive"?"Account not active":"No signings remaining"}),e.jsx("p",{style:{fontSize:13,color:t.text,lineHeight:1.65,marginBottom:20},children:l==="inactive"?"Your ARC account is not in an active state. Resolve it on your vendor dashboard before signing items.":"You're out of subscription quota and bundle credits. Buy a bundle or re-subscribe to keep signing."}),e.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap"},children:[e.jsx("a",{href:"/arc/welcome",style:{display:"inline-flex",alignItems:"center",gap:6,padding:"10px 22px",borderRadius:10,fontSize:12,fontWeight:700,background:"rgba(245,158,11,0.16)",border:`1px solid ${t.amberBorder}`,color:t.amber,textDecoration:"none",fontFamily:"inherit"},children:"Vendor dashboard"}),e.jsx("a",{href:"/arc#pricing",style:{display:"inline-flex",alignItems:"center",gap:6,padding:"10px 22px",borderRadius:10,fontSize:12,fontWeight:700,background:"rgba(140,100,255,0.16)",border:`1px solid ${t.accentBorder}`,color:t.accent,textDecoration:"none",fontFamily:"inherit"},children:"Buy a bundle / re-subscribe"})]})]})})}function wt({vendor:l,balance:v}){const[y,E]=r.useState(""),[k,J]=r.useState(""),[A,O]=r.useState(l.defaults?.itemType??""),[u,M]=r.useState(null),[F,L]=r.useState(null),[U,X]=r.useState(!1),[P,K]=r.useState(l.defaults?.creatorName??""),[R,B]=r.useState(l.defaults?.originLocation??""),[g,p]=r.useState(l.defaults?.materials??""),[x,T]=r.useState(""),[D,Z]=r.useState(""),[_,V]=r.useState(null),[m,w]=r.useState({kind:"idle"}),[j,Q]=r.useState([]),[ee,ce]=r.useState(null),[Y,Ve]=r.useState(""),[we,te]=r.useState(null),[ue,pe]=r.useState(!1),[ge,ne]=r.useState(null),[me,Ye]=r.useState(!1),[b,qe]=r.useState(null),[Ct,Ce]=r.useState(!1),[ie,Ge]=r.useState(!1),[Je,re]=r.useState(!1),ze=r.useRef(null),oe=r.useRef(null),fe=v.remainingSubscriptionSignings??0,Ie=v.remainingBundleSignings??0,Ke=fe<0?"Unlimited":fe.toLocaleStr
1ing(),Fe=n=>{if(L(null),!n){M(null);return}if(n.size>Ne){L(`File too large (${(n.size/1024/1024).toFixed(1)} MB). Max is 50 MB.`),M(null);return}const i=(n.type||"").toLowerCase(),d=q(n),c=i.length>0&&_e.includes(i),a=["jpg","jpeg","png","webp","pdf","doc","docx","txt"].includes(d);if(!c&&!a){L(`Unsupported file type "${i||d||"unknown"}". ARC currently accepts JPG, PNG, WebP, PDF, DOC, DOCX, and TXT. If you're uploading from an iPhone, your photo may be in HEIC format; converting to JPG in Photos or your camera settings will resolve this.`),M(null);return}M(n)},Ae=n=>{const i=(n.type||"").toLowerCase();if(Xe.includes(i))return!0;const d=q(n);return["jpg","jpeg","png","webp"].includes(d)},he=!!(u&&Ae(u)),Ze=!he,Qe=j.length>0&&!he,H=r.useMemo(()=>{if(!(y.trim().length>0&&y.length<=Se&&k.trim().length>0&&k.length<=ve&&Pe.includes(A)&&!F&&!_&&!ee)||!u||!Ae(u))return!1;if(j.length>0){for(const i of j)if(i.kind.trim().length===0)return!1}return!0},[y,k,A,F,_,j,ee,u]),et=r.useCallback(n=>{if(ce(null),!n||n.length===0)return;const i=[];let d=0,c=0;for(let a=0;a<n.length;a++){const o=n[a];if(o.size>Ne){d++;continue}const f=(o.type||"").toLowerCase(),S=q(o),h=f.length>0&&_e.includes(f),C=["jpg","jpeg","png","webp","pdf","doc","docx","txt"].includes(S);if(!h&&!C){c++;continue}i.push({file:o,kind:"",description:""})}Q(a=>{const o=N-a.length,f=i.slice(0,Math.max(0,o)),S=i.length-f.length;if(S>0||d>0||c>0){const h=[];S>0&&h.push(`max ${N} documents — ${S} not added`),d>0&&h.push(`${d} too large (50 MB max)`),c>0&&h.push(`${c} unsupported file type`),ce(h.join(" · "))}return[...a,...f]}),oe.current&&(oe.current.value="")},[]),tt=r.useCallback(n=>{const i=n.trim();if(i.length===0){V(null);return}if(i.length>256){V("Email too long.");return}const d=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i);V(d?null:"Enter a valid email address or leave blank.")},[]);r.useEffect(()=>{const n=Y.trim();if(!n){te(null),ne(null),pe(!1);return}pe(!0);const i=setTimeout(async()=>{try{const d=await ae.call("resolveArcLedgerId",{input:n}),c=xe(d);c?.valid&&c?.itemId?(ne(c.itemId),te(null)):(ne(null),te("Ledger ID not recognized. The signing will record the claim as unverified parent."))}catch{ne(null),te("Could not check Ledger ID. The signing will record the claim as unverified parent.")}finally{pe(!1)}},400);return()=>clearTimeout(i)},[Y]),r.useEffect(()=>{const n=x.trim();let i=null;if(n.length>0){const c=Number.parseFloat(n);if(Number.isFinite(c)&&c>=0)i=c;else return}const d=setTimeout(async()=>{Ce(!0);try{const c=await ae.call("previewTokenCost",{saleValueUsd:i}),a=xe(c);a&&qe(a)}catch{}finally{Ce(!1)}},300);return()=>clearTimeout(d)},[x]);const s=m.kind==="uploading"||m.kind==="signing",nt=r.useCallback(n=>{if(n.preventDefault(),!H||s||m.kind==="success")return;if(!ie){w({kind:"error",message:"Please acknowledge the signing statement before submitting."});return}const i=x.trim().length>0?Number.parseFloat(x):null;if(b?.formConfig.enforceReceiptRequirement&&i!==null&&Number.isFinite(i)&&i>b.formConfig.receiptRequiredAboveUsd&&!j.some(c=>c.kind.trim()==="receipt")){w({kind:"error",message:`A receipt deposit is required for sales above $${b.formConfig.receiptRequiredAboveUsd.toLocaleString()}. Set deposit kind to "receipt".`});return}w({kind:"idle"}),re(!0)},[H,s,m.kind,ie,x,b,j]),it=r.useCallback(async()=>{if(!$||!be){w({kind:"error",message:"Firebase not initialized. Refresh and try again."});return}const n=ke.getActiveUserId();if(!n){w({kind:"error",message:"Sign in expired. Refresh and sign in again."});return}const i=le(ft($,"arc_signed_items")).id;let d=null;if(u){w({kind:"uploading",detail:"source file"});const a=q(u)||((u.type||"").includes("jpeg")?"jpg":(u.type||"").includes("png")?"png":(u.type||"").includes("webp")?"webp":(u.type||"").includes("pdf")?"pdf":"bin"),o=`arc_signed/${n}/${i}/source.${a}`;try{const f=Me(be,o),S=await Be(u,{intent:"evidence"}),h=await Te(S.upload);await Le(f,h,{contentType:u.type||"application/octet-stream"}),d={extension:a,mimeType:(u.type||"application/octet-stream").toLowerCase(),sizeBytes:u.size}}catch(f){const S=De(f),h=await $e(u);Ee(S.code==="file/unreadable"?"file_unreadable":"storage_write",f?.message??"That file did not finish uploading.",{surface:"SurfaceArcSign.source",path:o,fileType:u.type,fileExt:a,fileSizeBytes:u.size,sourceKind:typeof File<"u"&&u instanceof File?"file":"prepared-blob",checkKind:"proven-bytes-full-read",evidenceUpload:!0,code:S.code,httpStatus:S.httpStatus,serverResponse:S.serverResponse,...h}),w({kind:"error",message:`File upload failed: ${f?.message??"unknown error"}`});return}}const c=[];for(let a=0;a<j.length;a++){const o=j[a];w({kind:"uploading",detail:`document ${a+1} of ${j.length}`});const f=q(o.file)||((o.file.type||"").includes("jpeg")?"jpg":(o.file.type||"").includes("png")?"png":(o.file.type||"").includes("webp")?"webp":(o.file.type||"").includes("pdf")?"pdf":(o.file.type||"").includes("msword")?"doc":(o.file.type||"").includes("wordprocessingml")?"docx":(o.file.type||"").includes("text/plain")?"txt":"bin"),S=`arc_signed/${n}/${i}/deposit-${a}.${f}`;try{const h=Me(be,S),C=await Be(o.file,{intent:"evidence"}),se=await Te(C.upload);await Le(h,se,{contentType:o.file.type||"application/octet-stream"}),c.push({kind:o.kind.trim(),extension:f,mimeType:(o.file.type||"application/octet-stream").toLowerCase(),sizeBytes:o.file.size,filename:o.file.name,description:o.description.trim().length>0?o.description.trim():null})}catch(h){const C=De(h),se=await $e(o.file);Ee(C.code==="file/unreadable"?"file_unreadable":"storage_write",h?.message??"That deposit did n
1ot finish uploading.",{surface:"SurfaceArcSign.deposit",path:S,depositIndex:a,depositKind:o.kind.trim()||null,fileType:o.file.type,fileExt:f,fileSizeBytes:o.file.size,sourceKind:typeof File<"u"&&o.file instanceof File?"file":"prepared-blob",checkKind:"proven-bytes-full-read",evidenceUpload:!0,code:C.code,httpStatus:C.httpStatus,serverResponse:C.serverResponse,...se}),w({kind:"error",message:`Deposit upload failed (document ${a+1}): ${h?.message??"unknown error"}`});return}}w({kind:"signing"});try{const a=x.trim().length>0?Number.parseFloat(x):null,o=b?.formConfig.acknowledgmentText??"",f={itemId:i,itemName:y.trim(),itemDescription:k.trim(),itemType:A,sourceFile:d,creatorName:P.trim()||null,originLocation:R.trim()||null,materials:g.trim()||null,saleValueUsd:a!==null&&Number.isFinite(a)?a:null,buyerEmail:D.trim().length>0?D.trim().toLowerCase():null,documentDeposits:c.length>0?c:null,linkedDepositId:ge??(Y.trim()||null),vendorAcknowledgment:{text:o,timestamp:new Date().toISOString()}};me&&ae.call("saveArcVendorDefaults",{creatorName:P.trim()||null,originLocation:R.trim()||null,materials:g.trim()||null,itemType:A||null}).catch(rt=>{console.warn("[ArcSign] saveArcVendorDefaults failed (non-blocking):",rt)});const S=await ae.call("signArcItem",f),h=xe(S),C=h?.itemId??i;w({kind:"success",itemId:C});try{sessionStorage.setItem("arc_last_signing",JSON.stringify({itemId:C,decrementedBuckets:h?.decrementedBuckets??{},postRemainingSub:h?.remainingSubscriptionSignings??0,postRemainingBundle:h?.remainingBundleSignings??0,timestamp:Date.now()}))}catch{}l.currentTierId==="pro_bono"||window.setTimeout(()=>{window.location.href=`/arc/welcome#signed=${encodeURIComponent(C)}`},800)}catch(a){const o=a?.message??"Signing failed";w({kind:"error",message:o})}},[y,k,A,u,P,R,g,x,D,j,Y,ge,me,b]);return e.jsxs(e.Fragment,{children:[e.jsxs(G,{children:[e.jsxs("div",{style:{marginBottom:28},children:[e.jsx("div",{style:{fontSize:10,fontWeight:800,letterSpacing:"0.22em",textTransform:"uppercase",color:t.textFaint,marginBottom:10},children:"ARC · Sign an item"}),e.jsx("h1",{style:{fontSize:30,fontWeight:300,color:t.white,margin:"0 0 8px",letterSpacing:"0.02em"},children:"Sign a new item"}),e.jsxs("p",{style:{fontSize:13,color:t.textMuted,margin:0},children:[Ke," subscription signing",fe===1?"":"s"," left · ",Ie.toLocaleString()," bundle credit",Ie===1?"":"s"]})]}),e.jsxs("form",{onSubmit:nt,style:{display:"flex",flexDirection:"column",gap:18},children:[e.jsx(z,{label:"Item name",required:!0,hint:`${y.length}/${Se}`,children:e.jsx("input",{type:"text",value:y,onChange:n=>E(n.target.value.slice(0,Se)),placeholder:"e.g. Sunset over Lake Erie, 2026",disabled:s,required:!0,style:I})}),e.jsx(z,{label:"Description",required:!0,hint:`${k.length}/${ve}`,children:e.jsx("textarea",{value:k,onChange:n=>J(n.target.value.slice(0,ve)),placeholder:"What is it? When and how was it made? Anything that helps a future buyer trust this record.",disabled:s,required:!0,rows:5,style:{...I,resize:"vertical",minHeight:110,fontFamily:"inherit"}})}),e.jsx(z,{label:"Item type",required:!0,children:e.jsxs("select",{value:A,onChange:n=>O(n.target.value),disabled:s,required:!0,style:{...I,appearance:"none",WebkitAppearance:"none",MozAppearance:"none",backgroundImage:`url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23EDEDED' stroke-width='1.5'><path d='M3 5l3 3 3-3' stroke-linecap='round' stroke-linejoin='round'/></svg>")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 12px center",backgroundSize:"12px 12px",paddingRight:36,cursor:s?"not-allowed":"pointer"},children:[e.jsx("option",{value:"",disabled:!0,style:Ue,children:"Select a category…"}),Pe.map(n=>e.jsx("option",{value:n,style:Ue,children:n},n))]})}),e.jsx(z,{label:"Source file (optional)",hint:"JPG · PNG · WebP · PDF · DOC · DOCX · TXT · 50 MB max",children:e.jsxs("div",{style:{padding:"14px 16px",borderRadius:12,background:t.card,border:`1px dashed ${t.border}`,display:"flex",flexDirection:"column",gap:10},children:[e.jsx("input",{ref:ze,type:"file",accept:We,onChange:n=>Fe(n.target.files?.[0]??null),disabled:s,style:{display:"none"}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[e.jsxs("button",{type:"button",onClick:()=>ze.current?.click(),disabled:s,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"8px 14px",borderRadius:10,fontSize:12,fontWeight:700,background:"rgba(140,100,255,0.16)",border:`1px solid ${t.accentBorder}`,color:t.accent,cursor:"pointer",fontFamily:"inherit"},children:[e.jsx(ot,{size:12})," Choose file"]}),e.jsx("div",{style:{fontSize:12,color:t.text,lineHeight:1.5,flex:1,minWidth:0},children:u?e.jsxs("span",{children:[e.jsx("strong",{style:{color:t.white,fontWeight:600},children:u.name})," ",e.jsxs("span",{style:{color:t.textMuted},children:["· ",(u.size/1024/1024).toFixed(2)," MB"]}),he&&e.jsx("span",{style:{color:t.green,marginLeft:6},children:"· will embed C2PA manifest"})]}):e.jsx("span",{style:{color:t.textMuted},children:"No file selected · the manifest is still cryptographically recorded."})}),u&&e.jsx("button",{type:"button",onClick:()=>Fe(null),disabled:s,style:{background:"none",border:"none",cursor:"pointer",color:t.textMuted,padding:4,fontFamily:"inherit"},"aria-label":"Remove file",children:e.jsx(Re,{size:14})})]}),F&&e.jsx("div",{style:{fontSize:11,color:t.red},children:F})]})}),e.jsxs(z,{label:"Buyer email (optional)",hint:"If provided, the buyer receives the signed file + certificate by email.",children:[e.jsx("input",{type:"email",value:D,onChange:n=>{const i=n.target.value.slice(0,256);Z(i),tt(i)},placeholder:"[email protected]",disabled:s,autoComplete:"off",style:I}),_&&e.jsx("div",{style:{fontSize:11,color:t.red,marginTop:4},children:_}
1),!_&&D.trim().length===0&&e.jsx("div",{style:{fontSize:10,color:t.textFaint,marginTop:4,lineHeight:1.55},children:"Leave blank if not selling to a specific recipient. You’ll still receive your own vendor confirmation by email."})]}),e.jsx(z,{label:"Supporting documents (optional)",hint:`${j.length}/${N}`,children:e.jsxs("div",{style:{padding:"14px 16px",borderRadius:12,background:t.card,border:`1px dashed ${t.border}`,display:"flex",flexDirection:"column",gap:12},children:[e.jsx("input",{ref:oe,type:"file",accept:We,multiple:!0,onChange:n=>et(n.target.files),disabled:s,style:{display:"none"}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[e.jsxs("button",{type:"button",onClick:()=>oe.current?.click(),disabled:s||j.length>=N,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"8px 14px",borderRadius:10,fontSize:12,fontWeight:700,background:"rgba(140,100,255,0.16)",border:`1px solid ${t.accentBorder}`,color:t.accent,cursor:s||j.length>=N?"not-allowed":"pointer",opacity:j.length>=N?.5:1,fontFamily:"inherit"},children:[e.jsx(st,{size:12})," Add documents"]}),e.jsxs("div",{style:{fontSize:11,color:t.textMuted,lineHeight:1.55},children:["Certificates of authenticity, appraisals, invoices, lab reports, provenance letters. JPG · PNG · WebP · PDF · DOC · DOCX · TXT · 50 MB each · up to ",N,"."]})]}),j.map((n,i)=>e.jsxs("div",{style:{padding:"10px 12px",borderRadius:10,background:"rgba(255,255,255,0.02)",border:`1px solid ${t.border}`,display:"flex",flexDirection:"column",gap:8},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(at,{size:12,style:{color:t.accent,flexShrink:0}}),e.jsx("span",{style:{fontSize:12,fontWeight:600,color:t.white,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:n.file.name}),e.jsxs("span",{style:{fontSize:10,color:t.textFaint,flexShrink:0},children:[(n.file.size/1024/1024).toFixed(2)," MB"]}),e.jsx("button",{type:"button",onClick:()=>{Q(d=>d.filter((c,a)=>a!==i)),ce(null)},disabled:s,style:{background:"none",border:"none",cursor:s?"not-allowed":"pointer",color:t.textMuted,padding:4,fontFamily:"inherit"},"aria-label":`Remove ${n.file.name}`,children:e.jsx(Re,{size:14})})]}),e.jsx("input",{type:"text",value:n.kind,onChange:d=>{const c=d.target.value.slice(0,xt);Q(a=>a.map((o,f)=>f===i?{...o,kind:c}:o))},placeholder:"Certificate of authenticity, appraisal, invoice…",disabled:s,required:!0,style:{...I,fontSize:12,padding:"8px 12px"},"aria-label":`Document ${i+1} kind`}),e.jsx("input",{type:"text",value:n.description,onChange:d=>{const c=d.target.value.slice(0,W);Q(a=>a.map((o,f)=>f===i?{...o,description:c}:o))},placeholder:"Short note (optional)",disabled:s,style:{...I,fontSize:12,padding:"8px 12px"},"aria-label":`Document ${i+1} description`})]},i)),ee&&e.jsx("div",{style:{fontSize:11,color:t.red},children:ee}),b&&x.trim().length>0&&(()=>{const n=Number.parseFloat(x);return!Number.isFinite(n)||n<=b.formConfig.receiptRequiredAboveUsd||j.some(d=>d.kind.trim()==="receipt")?null:e.jsxs("div",{style:{padding:"10px 12px",borderRadius:10,background:t.amberSoft,border:`1px solid ${t.amberBorder}`,display:"flex",alignItems:"flex-start",gap:8,fontSize:11,color:t.amber,lineHeight:1.55},children:[e.jsx(de,{size:12,style:{marginTop:2,flexShrink:0}}),e.jsxs("span",{children:["Sales over $",b.formConfig.receiptRequiredAboveUsd.toLocaleString()," require a receipt deposit. Set deposit kind to “receipt”."]})]})})(),Qe&&e.jsxs("div",{style:{padding:"10px 12px",borderRadius:10,background:t.amberSoft,border:`1px solid ${t.amberBorder}`,display:"flex",alignItems:"flex-start",gap:8,fontSize:11,color:t.amber,lineHeight:1.55},children:[e.jsx(de,{size:12,style:{marginTop:2,flexShrink:0}}),e.jsx("span",{children:"Supporting documents require an image source file — add the work’s image above."})]}),e.jsx("div",{style:{padding:"10px 12px",borderRadius:10,background:"rgba(140,100,255,0.04)",border:"1px solid rgba(140,100,255,0.12)",fontSize:10.5,color:t.textMuted,lineHeight:1.6},children:"ARC records a tamper-evident, dated record of the documents you provide. It does not verify how a work was made. Keeping genuine documentation of your craft is the creator’s responsibility — and it is what gives this record its strength."})]})}),e.jsxs("div",{children:[e.jsxs("button",{type:"button",onClick:()=>X(n=>!n),disabled:s,style:{display:"inline-flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",fontSize:12,fontWeight:700,color:t.textMuted,fontFamily:"inherit",padding:0,letterSpacing:"0.04em"},children:[U?e.jsx(lt,{size:12}):e.jsx(dt,{size:12}
1),"Additional details ",U?"":"(optional)"]}),U&&e.jsxs("div",{style:{marginTop:12,padding:"18px 20px",borderRadius:12,background:t.card,border:`1px solid ${t.border}`,display:"flex",flexDirection:"column",gap:14},children:[e.jsx(z,{label:"Creator / artist name (optional)",hint:`${P.length}/${W}`,children:e.jsx("input",{type:"text",value:P,onChange:n=>K(n.target.value.slice(0,W)),disabled:s,style:I})}),e.jsx(z,{label:"Origin / location (optional)",hint:`${R.length}/${W}`,children:e.jsx("input",{type:"text",value:R,onChange:n=>B(n.target.value.slice(0,W)),disabled:s,style:I})}),e.jsx(z,{label:"Materials / specifications (optional)",hint:`${g.length}/${W}`,children:e.jsx("input",{type:"text",value:g,onChange:n=>p(n.target.value.slice(0,W)),disabled:s,style:I})}),e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:10,fontSize:11,color:t.text,lineHeight:1.55,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:me,onChange:n=>Ye(n.target.checked),disabled:s,style:{marginTop:2,accentColor:t.accent}}),e.jsx("span",{children:"Remember these as defaults — creator name, origin, materials, and item type will prefill on your next signing. You can update them anytime."})]}),e.jsx(z,{label:"Sale value (USD, optional)",hint:"For transaction-tier reporting later",children:e.jsx("input",{type:"number",inputMode:"decimal",min:0,step:.01,value:x,onChange:n=>T(n.target.value),disabled:s,placeholder:"0.00",style:I})}),e.jsxs(z,{label:"Sale chain ID (optional)",children:[e.jsx("input",{type:"text",value:Y,onChange:n=>Ve(n.target.value.slice(0,64)),placeholder:"AV · XXXXXXX · YYYYYY",disabled:s,autoComplete:"off",style:I}),e.jsx("div",{style:{fontSize:10,color:t.textFaint,marginTop:4,lineHeight:1.55},children:"If you received a Ledger ID with a previous certificate and this signing extends the chain, paste it here. Accepts the full Ledger ID (AV · XXXXXXX · YYYYYY) or the raw item ID. Leave blank if this is an origin signing."}),ue&&e.jsx("div",{style:{fontSize:11,color:t.textFaint,marginTop:4},children:"Checking…"}),!ue&&ge&&e.jsx("div",{style:{fontSize:11,color:t.accent,marginTop:4},children:"Chain link recognized."}),!ue&&we&&e.jsx("div",{style:{fontSize:11,color:t.amber,marginTop:4},children:we})]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,marginTop:8},children:[Ze&&e.jsx("div",{style:{fontSize:11,color:t.amber,padding:"10px 14px",borderRadius:10,background:t.amberSoft,border:`1px solid ${t.amberBorder}`,lineHeight:1.55},children:"ARC signings require an image (JPG, PNG, or WebP) as the primary source. The image carries the C2PA cryptographic seal that records authenticity. Add an image as the source file to enable signing."}),b&&e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:10,padding:"14px 16px",borderRadius:12,background:"rgba(255,255,255,0.02)",border:`1px solid ${ie?t.accentBorder:t.border}`,cursor:s?"not-allowed":"pointer",transition:"border-color 160ms ease"},children:[e.jsx("input",{type:"checkbox",checked:ie,onChange:n=>Ge(n.target.checked),disabled:s,style:{marginTop:3,accentColor:t.accent,flexShrink:0}}),e.jsx("span",{style:{fontSize:12,lineHeight:1.65,color:t.white},children:b.formConfig.acknowledgmentText})]}),e.jsxs("button",{type:"submit",disabled:!H||s||m.kind==="success",style:{padding:"14px 28px",borderRadius:12,fontSize:14,fontWeight:700,letterSpacing:"0.02em",background:H&&!s&&m.kind!=="success"?"linear-gradient(135deg, #8C64FF, #5A3CDF)":"rgba(140,100,255,0.18)",color:H&&!s&&m.kind!=="success"?"white":"rgba(255,255,255,0.5)",border:"none",cursor:H&&!s&&m.kind!=="success"?"pointer":"not-allowed",fontFamily:"inherit",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8},children:[m.kind==="uploading"&&e.jsxs(e.Fragment,{children:[e.jsx(je,{size:14,style:{animation:"arc-spin 1.4s linear infinite"}})," Uploading ",m.detail??"file","…"]}),m.kind==="signing"&&e.jsxs(e.Fragment,{children:[e.jsx(je,{size:14,style:{animation:"arc-spin 1.4s linear infinite"}})," Signing…"]}),m.kind==="success"&&e.jsxs(e.Fragment,{children:[e.jsx(ct,{size:14})," Signed · redirecting"]}),(m.kind==="idle"||m.kind==="error")&&e.jsxs(e.Fragment,{children:[e.jsx(He,{size:14})," Sign this item"]})]}),m.kind==="error"&&(()=>{const n=bt(m.message);return n?e.jsxs("div",{style:{padding:"14px 16px",borderRadius:12,background:t.redSoft,border:`1px solid ${t.redBorder}`,lineHeight:1.55},children:[e.jsx("div",{style:{fontSize:13,fontWeight:700,color:t.white,marginBottom:8},children:"Insufficient signing balance"}),e.jsxs("div",{style:{fontSize:12,color:t.textMuted,lineHeight:1.65},children:["This signing needs ",n.needSub," subscription token",n.needSub===1?"":"s"," ","and ",n.needBundle," Stripe bundle token",n.needBundle===1?"":"s",". You have ",n.haveSub," subscription + ",n.haveBundle," Stripe bundle remaining."]}),e.jsx("div",{style:{marginTop:10},children:e.jsx("a",{href:"/arc",style:{fontSize:12,color:t.accent,textDecoration:"none",fontWeight:600},children:"Buy a bundle or subscribe on /arc →"})})]}):e.jsxs("div",{style:{padding:"12px 14px",borderRadius:10,background:t.redSoft,border:`1px solid ${t.redBorder}`,fontSize:12,color:"#fca5a5",lineHeight:1.55},children:["✗ ",m.message]})})(),m.kind==="success"&&(()=>{const n=l.currentTierId==="pro_bono",i=`${Oe}
1/verify?id=${m.itemId}&type=signature`;return e.jsx("div",{style:{padding:"16px",borderRadius:10,background:t.greenSoft,border:"1px solid rgba(34,197,94,0.25)",fontSize:12,color:"#86efac",lineHeight:1.6},children:n?e.jsxs(e.Fragment,{children:["✓ Signed. Your record is at"," ",e.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",style:{color:"#86efac",textDecoration:"underline",wordBreak:"break-all"},children:i}),e.jsx("br",{}),"Both you and the sponsoring lawyer will receive the evidentiary packet (cert + chain-to-origin) by email within ~30 seconds. Item id: ",e.jsx("code",{style:{color:"#86efac"},children:m.itemId})]}):e.jsxs(e.Fragment,{children:["✓ Item ",m.itemId," signed. Redirecting to dashboard…"]})})})()]}),e.jsx("div",{style:{fontSize:11,color:t.textFaint,marginTop:6,lineHeight:1.6},children:"One signing is decremented when you submit. Subscription quota is decremented before bundle credits. Pilot phase: manifests use the C2PA pilot test certificate; Adobe CAI displays an “issuer not recognized” notice. Cryptographic validity is unaffected."})]}),e.jsx("style",{children:"@keyframes arc-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"})]}),Je&&b&&e.jsx("div",{role:"dialog","aria-modal":"true",onClick:n=>{n.target===n.currentTarget&&!s&&re(!1)},style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(3,2,14,0.92)",backdropFilter:"blur(14px)",display:"flex",alignItems:"center",justifyContent:"center",padding:16,overflowY:"auto"},children:e.jsxs("div",{style:{maxWidth:520,width:"100%",padding:"28px 24px",borderRadius:16,background:"#0A0A14",border:`1px solid ${t.border}`,color:t.white,fontFamily:"inherit"},children:[e.jsx("div",{style:{fontSize:10,fontWeight:800,letterSpacing:"0.22em",textTransform:"uppercase",color:t.accent,marginBottom:16},children:"Confirm signing"}),e.jsx("div",{style:{fontSize:14,color:t.white,fontWeight:600,marginBottom:6},children:y.trim()||"Untitled item"}),x.trim().length>0&&Number.isFinite(Number.parseFloat(x))&&Number.parseFloat(x)>0&&e.jsxs("div",{style:{fontSize:12,color:t.textMuted,marginBottom:20},children:["Sale value: $",Number.parseFloat(x).toLocaleString()]}),!(x.trim().length>0&&Number.parseFloat(x)>0)&&e.jsx("div",{style:{marginBottom:20}}),e.jsxs("div",{style:{marginBottom:20,padding:"14px 16px",borderRadius:10,background:"rgba(140,100,255,0.06)",border:`1px solid ${t.accentBorder}`},children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.16em",textTransform:"uppercase",color:t.accent,marginBottom:10},children:"This signing will use"}),b.allocation.unlimited?e.jsx("div",{style:{fontSize:13,color:t.white,lineHeight:1.5},children:"0 tokens (unlimited subscription tier)"}):(()=>{const i=b.allocation.subscriptionFeeTokens,d=b.allocation.bundleFeeTokens,c=1+i+d;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{fontSize:14,color:t.white,fontWeight:600,lineHeight:1.5},children:[c," token",c===1?"":"s"]}),(i>0||d>0)&&e.jsxs("div",{style:{fontSize:11,color:t.textMuted,marginTop:8,lineHeight:1.6},children:["1 base token",i>0?` + ${i} subscription`:"",d>0?` + ${d} Stripe bundle`:""," for scaling at the"," ","$",b.allocation.tierMatched.minUsd.toLocaleString(),"–$",b.allocation.tierMatched.maxUsd.toLocaleString()," tier"]}),i===0&&d===0&&e.jsx("div",{style:{fontSize:11,color:t.textMuted,marginTop:8,lineHeight:1.6},children:"Base token only (no scaling fee at this sale value)"})]})})()]}),e.jsx("div",{style:{marginBottom:24,fontSize:12,color:t.textMuted,lineHeight:1.65,fontStyle:"italic"},children:b.formConfig.acknowledgmentText}),e.jsxs("div",{style:{display:"flex",gap:10},children:[e.jsx("button",{type:"button",onClick:()=>{s||re(!1)},disabled:s,style:{flex:1,padding:"12px 18px",borderRadius:10,background:"transparent",border:`1px solid ${t.border}`,color:t.text,fontSize:13,fontWeight:600,cursor:s?"not-allowed":"pointer",fontFamily:"inherit"},children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>{re(!1),it()},disabled:s,style:{flex:1,padding:"12px 18px",borderRadius:10,background:s?"rgba(140,100,255,0.18)":"linear-gradient(135deg, #8C64FF, #5A3CDF)",color:"white",border:"none",fontSize:13,fontWeight:700,cursor:s?"not-allowed":"pointer",fontFamily:"inherit"},children:s?"Signing…":"Confirm and sign"})]})]})})]})}function z({label:l,required:v,hint:y,children:E}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[e.jsxs("label",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:t.textMuted},children:[l,v&&e.jsx("span",{style:{color:t.accent,marginLeft:4},children:"*"})]}
1),y&&e.jsx("span",{style:{fontSize:10,color:t.textFaint},children:y})]}),E]})}const I={width:"100%",boxSizing:"border-box",padding:"12px 14px",borderRadius:10,background:t.card,border:`1px solid ${t.border}`,color:t.white,fontSize:13,fontFamily:"inherit",outline:"none"},Ue={background:"#0A0A14",color:t.white},Bt=()=>{const[l,v]=r.useState(()=>{const g=ke.getActiveUserId();return g?{uid:g}:null}),[y,E]=r.useState(!1),[k,J]=r.useState(null),[A,O]=r.useState(!1),[u,M]=r.useState(null),[F,L]=r.useState(null),[U,X]=r.useState(!1);r.useEffect(()=>{document.title="ARC by ArcVelvet — Sign an item";const g=(p,x)=>{let T=document.querySelector(`meta[property="${p}"]`);T||(T=document.createElement("meta"),T.setAttribute("property",p),document.head.appendChild(T)),T.content=x};return g("og:title","ARC by ArcVelvet — Sign an item"),g("og:url",`${Oe}/arc/sign`),()=>{document.title="ArcVelvet — The Social Economy"}},[]),r.useEffect(()=>{const g=ke.onAuthChanged(p=>{v(p?{uid:p.uid,email:p.email}:null),p&&E(!1)});return()=>{typeof g=="function"&&g()}},[]),r.useEffect(()=>{if(!l?.uid||!$){J(null),O(!1);return}const g=ye(le($,"arc_vendors",l.uid),p=>{O(!0),J(p.exists()?p.data():null)},p=>{console.error("[ArcSign] arc_vendors subscription error:",p),O(!0)});return()=>g()},[l?.uid]),r.useEffect(()=>{if(!l?.uid||!$){M(null);return}const g=ye(le($,"arc_signing_balance",l.uid),p=>{M(p.exists()?p.data():null)},p=>{console.error("[ArcSign] balance subscription error:",p)});return()=>g()},[l?.uid]),r.useEffect(()=>{if(!l?.uid||!$){L(null),X(!1);return}const g=ye(le($,"pro_bono_entitlements",l.uid),p=>{X(!0),L(p.exists()?p.data():null)},p=>{console.warn("[ArcSign] pro_bono_entitlements subscription error:",p),X(!0),L(null)});return()=>g()},[l?.uid]);const P=r.useCallback(()=>E(!0),[]),K=r.useCallback(()=>E(!1),[]),R=r.useMemo(()=>{if(!l)return{kind:"not-signed-in"};
1if(!A||!U)return{kind:"loading"};if(F&&F.status==="active"){const D=F.signingsUsed??0,Z=F.maxSigningsPerClient??0;if(D<Z){const _={accountStatus:"active",currentTierId:"pro_bono"},V={remainingSubscriptionSignings:Z-D,remainingBundleSignings:0};return{kind:"ready",vendor:_,balance:V}}return{kind:"zero-balance"}}if(!k)return{kind:"no-vendor"};const g=k.accountStatus,p=u?.remainingSubscriptionSignings??0;return(u?.remainingBundleSignings??0)>0||p>0||p===-1||g==="active"?{kind:"ready",vendor:k,balance:u??{}}:{kind:"zero-balance"}},[l,A,k,u,U,F]);let B;switch(R.kind){case"loading":B=e.jsx(St,{});break;case"not-signed-in":B=e.jsx(vt,{onSignIn:P});break;case"no-vendor":B=e.jsx(jt,{});break;case"zero-balance":B=e.jsx(kt,{reason:"zero-balance"});break;case"ready":B=e.jsx(wt,{vendor:R.vendor,balance:R.balance});break}return e.jsxs(yt,{children:[B,y&&e.jsx("div",{role:"dialog","aria-modal":"true",onClick:g=>{g.target===g.currentTarget&&K()},style:{position:"fixed",inset:0,zIndex:1e4,background:"rgba(3,2,14,0.92)",backdropFilter:"blur(14px)",display:"flex",alignItems:"center",justifyContent:"center",padding:16,overflowY:"auto"},children:e.jsx(gt,{onDismiss:K})})]})};export{Bt as SurfaceArcSign,Bt as default};
2//# sourceMappingURL=SurfaceArcSign-CvRg0oYL.js.map

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.