1import{a as W,r,j as e,L as p}from"./vendor-react-D5waYPD6.js";import{N as c}from"./NavBar-BZJWdKxh.js";import{u as O}from"./useAuthState-C4oX7zul.js";import{u as q,A as H}from"./index-report-BjF5et6_.js";import{d as J,A as d,e as $,R as G}from"./betaApplicationService-npm7NE1p.js";import{B as k}from"./beta-C21zutLi.js";import"./vendor-firebase-CSC97I-g.js";import"./vendor-EeD4EYTL.js";import"./vendor-leaflet-Bn-YmmU2.js";const w=[{id:"ack_unfinished",label:"I get it that this app isn't finished. Things will break. My job is to find that and tell Brian â not complain, report."},{id:"ack_file_one_real",label:"I'll file at least one real report in my first week. Not a test. Something I actually saw."},{id:"ack_facebook",label:"I can handle a Facebook group. I post, I read replies, I follow up â not just like and scroll."},{id:"ack_real_effort",label:"Putting in potholes is fun. Everything else â a sidewalk, a streetlight, a drainage ditch â is an extra minute every time. I'll put that minute in."},{id:"ack_public_map",label:"My reports are on a public map, tied to my handle (something like @reporter_0013). My real name stays private."},{id:"ack_help_public",label:"I'm here to help the public, not get a head start over them."}],U=[{id:"stx",label:"St. Croix"},{id:"stt",label:"St. Thomas"},{id:"stj",label:"St. John"},{id:"wti",label:"Water Island"}],S=[{id:"daily_problem",label:"What's a USVI infrastructure problem you see every day?",placeholder:"E.g. the pothole on Melvin Evans Hwy that's eaten two of my tires this year."},{id:"crash_reaction",label:"The app crashes mid-report. What do you do?",placeholder:"What would your next move actually be? A screenshot, a bug report, a note to yourself to try again later?"},{id:"why_you",label:"Why do you want in on this?",placeholder:"No wrong answer. A sentence or tw
1o â what drew you to this specifically?"}],v=40,_=2e3;function A(t){return t?(t.toMillis?new Date(t.toMillis()):new Date(t)).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):""}function E(t){switch(t?.status){case d.PENDING:return e.jsxs("section",{className:"rv-apply-status",children:[e.jsx("div",{className:"rv-apply-status-kicker",children:"Under review"}),e.jsxs("h2",{className:"rv-apply-status-title",children:["Submitted ",A(t.submitted_at),". Brian will take a look."]}),e.jsx("p",{children:"You'll see your access unlock here and in the app automatically once approved. Takes anywhere from minutes to a day â Brian reads every application himself."}),e.jsx("p",{className:"rv-apply-status-hint",children:"Already approved? Sign out and back in to refresh your token."}),e.jsxs("div",{className:"rv-apply-status-actions",children:[e.jsx(p,{to:"/map",className:"rv-btn rv-btn-primary rv-btn-block",children:"Browse the map while you wait"}),e.jsx("a",{className:"rv-btn rv-btn-ghost rv-btn-block",href:`mailto:${k}?subject=Report%20VI%20application`,children:"Email Brian"})]})]});case d.APPROVED:return e.jsxs("section",{className:"rv-apply-status is-approved",children:[e.jsx("div",{className:"rv-apply-status-kicker",children:"Approved"}),e.jsx("h2",{className:"rv-apply-status-title",children:"You're in."}),e.jsxs("p",{children:["Approved ",A(t.reviewed_at),". Your app may still be showing the old state â sign out and back in to refresh, or wait up to an hour for the token to refresh on its own."]}),e.jsxs("div",{className:"rv-apply-status-actions",children:[e.jsx(p,{to:"/report",className:"rv-btn rv-btn-primary rv-btn-block",children:"File a report"}),e.jsx(p,{to:"/guide",className:"rv-btn rv-btn-ghost rv-btn-block",children:"Full tester guide"})]})]});case d.REJECTED:{const l=t.reject_reason?G[t.reject_reason]||t.reject_reason:null;return e.jsxs("section",{className:"rv-apply-status is-rejected",children:[e.jsx("div",{className:"rv-apply-status-kicker",children:"Not approved"}),e.jsx("h2",{className:"rv-apply-status-title",children:"Your application wasn't approved this round."}),l?e.jsxs("p",{children:[e.jsx("strong",{children:"Reason:"})," ",l,t.reject_note?` â ${t.reject_note}`:null]}):null,e.jsx("p",{children:"You can still read the public map. Reach out to Brian directly if you want to discuss or re-apply."}),e.jsxs("div",{className:"rv-apply-status-actions",children:[e.jsx("a",{className:"rv-btn rv-btn-primary rv-btn-block",href:`mailto:${k}?subject=Report%20VI%20application%20-%20appeal`,children:"Email Brian"}),e.jsx(p,{to:"/map",className:"rv-btn rv-btn-ghost rv-btn-block",children:"Back to the map"})]})]})}default:return null}}function re(){const t=W(),{user:l,ready:C}=O(),{access:T}=q(),[i,j]=r.useState(void 0),[y,B]=r.useState(""),[b,I]=r.useState(""),[h,R]=r.useState({}),[o,L]=r.useState({}),[f,N]=r.useState(!1),[u,x]=r.useState(null);r.useEffect(()=>{if(!l||l.isAnonymous){j(null);return}return J(l.uid,a=>{j(a)})},[l]),r.useEffect(()=>{u&&i&&i.status===d.PENDING&&x(null)},[u,i]);const D=r.useMemo(()=>w.every(s=>h[s.id]===!0),[h]),M=r.useMemo(()=>S.every(s=>{const a=(o[s.id]||"").trim();return a.length>=v&&a.length<=_}),[o]),P=y.trim().length>=1&&["stx","stt","stj","wti"].includes(b),g=!f&&P&&D&&M;async function Y(s){if(s.preventDefault(),!!g){N(!0),x(null);try{await $({first_name:y.trim(),island:b,checklist:h,essays:{daily_problem:o.daily_problem||"",crash_reaction:o.crash_reaction||"",why_you:o.why_you||""}})}catch(a){const n=!a.body&&!a.status;x(n?"Couldn't reach our server. Most often a privacy extension, ad blocker, VPN, or in-app browser blocking the request. Try a different browser (Safari/Chrome direct, not inside Facebook/Instagram), turn off any ad blocker for report.vi, or email [email protected] and we'll add you manually.":a.body?.error||a.message||"Submission failed"),N(!1)}}}return C?!l||l.isAnonymous?e.jsxs("article",{className:"rv-screen",children:[e.jsx(c,{title:"Tester application",onBack:()=>t("/")}),e.jsx("div",{className:"rv-apply",children:e.jsxs("section",{className:"rv-apply-status",children:[e.jsx("h2",{className:"rv-apply-status-title",children:"Sign in first"}),e.jsx("p",{children:"The tester application is tied to your account. Sign in with email or phone, then come back to this page."}),e.jsx("div",{className:"rv-apply-status-actions",children:e.jsx("button",{type:"button",className:"rv-btn rv-btn-primary rv-btn-block",onClick:()=>t("/account"),children:"Go to Sign in"})})]})})]}):T===H.APPROVED&&i?.status!==d.REJECTED?e.jsxs("article",{className:"rv-screen",children:[e.jsx(c,{title:"Tester application",onBack:()=>t("/")}),e.jsx("div",{className:"rv-apply",children:i?E(i):e.jsxs("section",{className:"rv-apply-status is-approved",children:[e.jsx("div",{className:"rv-apply-status-kicker",children:"Approved"}),e.jsx("h2",{className:"rv-apply-status-title",children:"You're in."}),e.jsx("p",{children:"Your access was granted without a separate application â you signed up before screening started. Welcome aboard."}),e.jsxs("div",{className:"rv-apply-status-actions",children:[e.jsx(p,{to:"/report",className:"rv-btn rv-btn-primary rv-btn-block",children:"File a report"}),e.jsx(p,{to:"/guide",className:"rv-btn rv-btn-ghost rv-btn-block",children:"Tester guide"})]})]})})]}):i===void 0?e.jsxs("article",{className:"rv-screen",children:[e.jsx(c,{title:"Tester application",onBack:()=>t("/")}),e.jsx("div",{className:"rv-apply rv-loading",children:"Loading your applicationâ¦"})]}):i?e.jsxs("article",{className:"rv-screen",children:[e.jsx(c,{title:"Tester application",onBack:()=>t("/")}),e.jsx("div",{className:"rv-apply",children:E(i)})]}):e.jsxs("article",{className:"rv-screen",children:[e.jsx(c,{title:"Tester application",onBack:()=>t("/")}),e.jsxs("form",{className:"rv-apply",onSubmit:Y,noValidate:!0,children:[e.jsxs("header",{className:"rv-apply-hero",children:[e.jsx("div",{className:"rv-apply-kicker",children:"Closed beta · tester application"}),e.jsx("h1",{className:"rv-apply-title",children:"Why this, and who's Brian screening for"}),e.jsx("p",{className:"rv-apply-lede",children:"Report VI is an accountability tool, not a game. Testers do the unglamorous work of filing reports on the stuff nobody wants to photograph â ditches, sidewalks, broken streetlights â plus reporting bugs in the app itself. This screen is how Brian picks people who'll actually put that time in."})]}),e.jsxs("fieldset",{className:"rv-apply-section",children:[e.jsx("legend",{children:"First, the basics"}),e.jsxs("label",{className:"rv-apply-field",children:[e.jsxs("span",{className:"rv-apply-field-label",children:["First name ",e.jsx("em",{children:"(for Brian only â your public handle stays private)"})]}),e.jsx("input",{type:"text",autoComplete:"given-name",value:y,onChange:s=>B(s.target.value),maxLength:60,required:!0})]}),e.jsxs("label",{className:"rv-apply-field",children:[e.jsx("span",{className:"rv-apply-field-label",children:"Which island do you live on?"}),e.jsxs("select",{value:b,onChange:s=>I(s.target.value),required:!0,children:[e.jsx("option",{value:"",children:"Pick oneâ¦"}),U.map(s=>e.jsx("option",{value:s.id,children:s.label},s.id))]})]})]}),e.jsxs("fieldset",{className:"rv-apply-section",children:[e.jsx("legend",{children:"Check each box. Every one is required."}),e.jsx("p",{className:"rv-apply-hint",children:"These aren't legal boilerplate. They're the actual tester contract. If any one of these doesn't fit, don't check it â and Brian probably isn't who you want to tester-apply for right now."}),e.jsx("ul",{className:"rv-apply-checklist",children:w.map(s=>{const a=h[s.id]===!0;return e.jsx("li",{className:a?"is-checked":"",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a,onChange:n=>R(m=>({...m,[s.id]:n.target.checked}))}),e.jsx("span",{children:s.label})]})},s.id)})})]}),e.jsxs("fieldset",{className:"rv-apply-section",children:[e.jsx("legend",{children:"Three quick writes"}),e.jsxs("p",{className:"rv-apply-hint",children:["Each answer needs at least ",v,' characters. Real sentences â not "idk".']}),S.map(s=>{const a=o[s.id]||"",n=a.trim().length,m=n>0&&n<v;return e.jsxs("label",{className:"rv-apply-field",children:[e.jsx("span",{className:"rv-apply-field-label",children:s.label}),e.jsx("textarea",{rows:4,placeholder:s.placeholder,value:a,onChange:F=>L(V=>({...V,[s.id]:F.target.value})),maxLength:_}),e.jsxs("span",{className:`rv-apply-count ${m?"is-short":""}`,children:[n," / ",v,"+ chars",m?" · keep going":""]})]},s.id)})]}),u?e.jsx("p",{className:"rv-apply-error",role:"alert",children:u}):null,e.jsxs("div",{className:"rv-apply-submit",children:[e.jsx("button",{type:"submit",className:"rv-btn rv-btn-primary rv-btn-lg rv-btn-block",disabled:!g,children:f?"
1Submittingâ¦":"Submit for Brian to review"}),e.jsx("p",{className:"rv-apply-submit-hint",children:"Once you submit you can't edit. Brian sees exactly what you wrote."})]})]})]}):e.jsxs("article",{className:"rv-screen",children:[e.jsx(c,{title:"Tester application",onBack:()=>t("/")}),e.jsx("div",{className:"rv-apply rv-loading",children:"Loadingâ¦"})]})}export{re 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.