PageSourceSearch

https://rival-new.lovable.app/assets/mission-submit._id-DfVH7T-f.js

js rival-new.lovable.app collected 2026-10-03 05:37:57 UTC 6,834 bytes, 1 lines download raw bytes

1import{ad as O,a as P,r,j as e,T as j,L as F,I as S,F as N}from"./index-B906m9HQ.js";const c="color-mix(in oklab, var(--blue) 14%, var(--border))",h="0 6px 20px color-mix(in oklab, var(--blue) 6%, transparent), 0 1px 2px rgba(15,23,41,0.04)";function Y(){const{mission:t}=O.useLoaderData(),n=P(),[o,p]=r.useState(""),[u,R]=r.useState(""),[m,w]=r.useState(""),[g,C]=r.useState(""),[f,B]=r.useState(""),[l,b]=r.useState(!0),[y,z]=r.useState(""),[D,W]=r.useState(""),v=G(t.successLooksLike),[L,T]=r.useState(()=>v.map(()=>!1)),[q,H]=r.useState(!1),d=o.trim().length>5&&m.trim()&&g.trim()&&f.trim()&&(l?y.trim().length>5:u.trim().length>5);function U(i){i.preventDefault(),d&&(H(!0),setTimeout(()=>n({to:"/missions/$id",params:{id:t.id}}),1400))}return q?e.jsxs("div",{style:{minHeight:"100vh",background:"color-mix(in oklab, var(--blue) 5%, #fff)"},children:[e.jsx(j,{}),e.jsxs("div",{style:{maxWidth:520,margin:"80px auto",padding:40,textAlign:"center",background:"#fff",borderRadius:16,boxShadow:h},children:[e.jsx("div",{style:{fontSize:48,marginBottom:12},children:"🚀"}),e.jsx("h1",{style:{fontSize:22,fontWeight:800,marginBottom:8},children:"Submitted!"}),e.jsxs("p",{style:{color:"var(--text-3)"},children:[t.postedBy," will review your build in the Review Room."]})]})]}):e.jsxs("div",{style:{minHeight:"100vh",background:"color-mix(in oklab, var(--blue) 5%, #fff)"},children:[e.jsx(j,{}),e.jsxs("div",{style:{maxWidth:720,margin:"0 auto",padding:"32px 32px 64px"},children:[e.jsx(F,{to:"/missions/$id",params:{id:t.id},style:{color:"var(--text-3)",fontSize:13,textDecoration:"none",display:"inline-flex",alignItems:"center",gap:6,marginBottom:12},children:"← Back to build request"}),e.jsx("h1",{style:{fontSize:26,fontWeight:800,letterSpacing:"-0.02em",marginBottom:6},children:"Submit your build"}),e.jsxs("p",{style:{color:"var(--text-3)",marginBottom:24,fontSize:14},children:["Package what you shipped so ",e.jsx("strong",{style:{color:"var(--text)"},children:t.postedBy})," can compare it side-by-side with other submissions."]}),e.jsxs("form",{onSubmit:U,style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(a,{label:"Live demo URL",required:!0,hint:"Where can the requester click through it right now?",children:e.jsx("input",{type:"url",value:o,onChange:i=>p(i.target.value),placeholder:"https://your-tool.example.com",required:!0,style:s})}),e.jsxs(_,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:10},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:14,fontWeight:700},children:"Can the requester test it with their own input?"}),e.jsx("div",{style:{fontSize:12.5,color:"var(--text-3)"},children:"Recommended. Submissions that support this rank higher in review."})]}),e.jsxs("div",{style:{display:"inline-flex",background:"#f4f5f7",borderRadius:8,padding:3},children:[e.jsx(k,{active:l,onClick:()=>b(!0),children:"Yes"}),e.jsx(k,{active:!l,onClick:()=>b(!1),children:"Demo-only"})]})]}),l?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,marginTop:10},children:[e.jsx(a,{label:"Test endpoint (POST URL)",required:!0,inline:!0,children:e.jsx("input",{type:"url",value:y,onChange:i=>z(i.target.value),placeholder:"https://your-tool.example.com/api/run",style:s})}),e.jsx(a,{label:"Input format hint",inline:!0,hint:"Optional. e.g. 'raw diff text' or 'a GitHub PR URL'",children:e.jsx("input",{type:"text",value:D,onChange:i=>W(i.target.value),placeholder:"What should they paste?",style:s})})]}):e.jsxs("div",{style:{padding:12,borderRadius:8,background:"rgba(217,119,6,0.08)",color:"#b45309",fontSize:12.5,marginTop:10},children:[e.jsx(S.Eye,{size:12})," Demo-only submissions are flagged in the Review Room and typically score lower. Consider a video walkthrough below."]})]}),e.jsx(a,{label:l?"Demo video (optional)":"Demo video",required:!l,hint:"60-sec Loom or mp4 URL walking through your tool",children:e.jsx("input",{type:"url",value:u,onChange:i=>R(i.target.value),placeholder:"https://loom.com/share/…",style:s})}),e.jsx(a,{label:"Three bullets",hint:"What it does · How it's different · What's next",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsx("input",{type:"text",maxLength:80,value:m,onChange:i=>w(i.target.value),placeholder:"What it does",style:s,required:!0}),e.jsx("input",{type:"text",maxLength:80,value:g,onChange:i=>C(i.target.value),placeholder:"How it's different",style:s,required:!0}),e.jsx("input",{type:"text",maxLength:80,value:f,onChange:i=>B(i.target.value),placeholder:"What's next",style:s,required:!0})]})}),e.jsx(a,{label:"Success criteria",hint:`Self-attest which of ${t.postedBy}'s criteria your build meets.`,children:e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:v.map((i,x)=>e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",ga
1p:10,cursor:"pointer",padding:"10px 12px",borderRadius:8,background:"#fafbfd",border:`1px solid ${c}`},children:[e.jsx("input",{type:"checkbox",checked:L[x],onChange:I=>T($=>$.map((E,A)=>A===x?I.target.checked:E)),style:{marginTop:3}}),e.jsx("span",{style:{fontSize:13.5,color:"var(--text-2)"},children:i})]},x))})}),e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:8},children:e.jsxs("button",{type:"submit",disabled:!d,style:{padding:"12px 20px",borderRadius:10,border:0,background:d?"var(--blue)":"#e5e7eb",color:d?"#fff":"var(--text-3)",fontSize:14,fontWeight:700,cursor:d?"pointer":"not-allowed",display:"inline-flex",alignItems:"center",gap:8},children:[e.jsx(S.Rocket,{size:13})," Submit build"]})})]})]}),e.jsx(N,{})]})}const s={width:"100%",padding:"10px 12px",borderRadius:8,border:`1px solid ${c}`,fontSize:14,background:"#fff"};function a({label:t,required:n,hint:o,inline:p,children:u}){return e.jsxs("div",{style:p?{}:{background:"#fff",padding:"14px 16px",borderRadius:12,border:`1px solid ${c}`,boxShadow:h},children:[e.jsxs("label",{style:{display:"block",fontSize:13,fontWeight:600,marginBottom:4},children:[t," ",n&&e.jsx("span",{style:{color:"#b91c1c"},children:"*"})]}),o&&e.jsx("div",{style:{fontSize:12,color:"var(--text-3)",marginBottom:8},children:o}),u]})}function _({children:t}){return e.jsx("div",{style:{background:"#fff",padding:"14px 16px",borderRadius:12,border:`1px solid ${c}`,boxShadow:h},children:t})}function k({active:t,onClick:n,children:o}){return e.jsx("button",{type:"button",onClick:n,style:{padding:"5px 10px",borderRadius:6,border:0,cursor:"pointer",background:t?"#fff":"transparent",color:t?"var(--text)":"var(--text-3)",fontSize:12.5,fontWeight:600,boxShadow:t?"0 1px 2px rgba(0,0,0,0.06)":"none"},children:o})}function G(t){const n=t.split(new RegExp("(?<=[.!?])\\s+")).map(o=>o.trim()).filter(Boolean);return n.length>0?n.slice(0,4):[t]}export{Y 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.