PageSourceSearch

https://portal.commoninterest.com/assets/requests.upload-Dw6bfrbG.js

js commoninterest.com collected 2026-10-01 23:52:32 UTC 8,189 bytes, 1 lines download raw bytes

1import{r,j as e,M as B,B as i,q as b,F as q,d0 as Q,d1 as D,E as $,bJ as G}from"./elements-5kxJS_4j.js";import{x as H,A as W,aZ as I,W as y,L as Y}from"./index-CtCeyryw.js";import{u as Z}from"./useLogo-ARqS3TaL.js";import"./grids-DGmfp9GI.js";import"./startOfDay-AazlW55I.js";const xe={showPropertySelector:!1,showAi:!1,full:!0,hideSidebar:!0},J="Upload ARC Documents",O="image/*",V="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,image/*",X=25*1024*1024,K="Total file size exceeds 25 MB limit.",ee="Open camera",se="Browse photos",te="Browse files",ae=u=>u===1?"1 file selected":`${u} files selected`,re="Continue to request",ne="Retry",le="Rescan QR from desktop",oe="Retry login",ie="You can now return to the ARC Form to complete your submission",de="Uploading selected files...";function he(){const u=Z(),j=H(),[_]=W(),d=_.get("session"),N=r.useRef(null),w=r.useRef(null),R=r.useRef(null),[m,E]=r.useState([]),[f,C]=r.useState(!1),[A,p]=r.useState(null),[o,n]=r.useState("validating"),[F,k]=r.useState(!1),S=I(s=>s.setFlagOverrides),T=I(s=>s.clearFlagOverrides),x=r.useCallback(async()=>{var s;if(!d){n("missing");return}n("validating"),p(null);try{await y.getArcRequestDraft(d),n("ready")}catch(t){const a=(s=t==null?void 0:t.response)==null?void 0:s.status;n(a===401||a===403?"unauthorized":a===404?"expired":"invalid")}},[d]);r.useEffect(()=>(S(["redesign-v3","redesign-v3-phase-2"]),()=>T()),[S,T]),r.useEffect(()=>{x()},[x]);const z=async s=>{var t;if(!d||o!=="ready"||s.length===0)return!1;p(null),C(!0);try{const l=((await y.listArcRequestDraftAttachments(d)).attachments??[]).reduce((g,v)=>g+(v.fileSize??0),0),P=s.reduce((g,v)=>g+v.size,0);return l+P>X?(p(K),!1):(await y.uploadArcRequestDraftAttachments(d,{files:G(s)}),!0)}catch(a){const l=(t=a==null?void 0:a.response)==null?void 0:t.status;return l===401||l===403?n("unauthorized"):l===404?n("expired"):l===void 0?n("invalid"):p("Upload failed. Please try again."),!1}finally{C(!1)}},h=(s,t)=>{const a=s.target.files;a!=null&&a.length&&(E([...m,...Array.from(a)]),s.target.value="")},M=s=>{E(t=>t.filter((a,l)=>l!==s))},U=async()=>{await z(m)&&(window.close(),window.setTimeout(()=>{window.closed||k(!0)},150))},L=()=>o==="missing"?e.jsxs("div",{"data-qa":"v3-requests-upload-session-missing","data-feature":"v3-requests-upload-session-missing",className:"mb-4 rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-900",children:[e.jsx("p",{className:"font-medium",children:"Missing upload session."}),e.jsx("p",{className:"mt-1",children:"This page must be opened from the QR code in the desktop ARC form."}),e.jsx(i,{"data-qa":"v3-requests-upload-rescan-qr",type:"button",variant:"primaryOutline",size:"sm",className:"mt-3",onClick:()=>j("/community/new-request"),children:le})]}):o==="expired"||o==="invalid"?e.jsxs("div",{"data-qa":"v3-requests-upload-session-invalid","data-feature":"v3-requests-upload-session-invalid",className:"mb-4 rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-900",children:[e.jsx("p",{className:"font-medium",children:"This upload session is no longer available."}),e.jsx("p",{className:"mt-1",children:"Please rescan the QR code from the desktop ARC request form to start a new mobile upload session."}),e.jsx(i,{"data-qa":"v3-requests-upload-retry-session",type:"button",variant:"primaryOutline",size:"sm",className:"mt-3",onClick:x,children:ne})]}):o==="unauthorized"?e.jsxs("div",{"data-qa":"v3-requests-upload-session-unauthorized","data-feature":"v3-requests-upload-session-unauthorized",className:"mb-4 rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-900",children:[e.jsx("p",{className:"font-medium",children:"You are not authorized for this draft upload session."}),e.jsx("p",{className:"mt-1",children:"Please sign in again and rescan the desktop QR code."}),e.jsx(i,{"data-qa":"v3-requests-upload-sign-in",type:"button",variant:"primaryOutline",size:"sm",className:"mt-3",onClick:()=>j("/login"),children:oe})]}):null,c=o==="ready"&&!f;return e.jsxs("div",{"data-qa":"v3-requests-upload-page","data-feature":"v3-requests-upload-page",className:"flex flex-col min-h-screen w-full max-w-md mx-auto px-4 py-6 sm:py-10",children:[e.jsx(B,{open:F,onClose:()=>{},dataQa:"v3-requests-upload-return-message-modal","data-feature":"v3-requests-upload-return-message-modal",title:"",hideCloseButton:!0,textAlign:"left",children:e.jsx("p",{className:"text-base text-base-header",children:ie})}),L(),e.jsxs("div",{className:"-mt-10 flex flex-1 flex-col justify-center gap-3",children:[e.jsx("input",{"data-qa":"v3-requests-upload-camera-in
1put",ref:N,type:"file",accept:O,capture:"environment",className:"sr-only","aria-hidden":!0,tabIndex:-1,disabled:!c,onChange:s=>h(s)}),e.jsx("input",{"data-qa":"v3-requests-upload-photos-input",ref:w,type:"file",accept:O,multiple:!0,className:"sr-only","aria-hidden":!0,tabIndex:-1,disabled:!c,onChange:s=>h(s)}),e.jsx("input",{"data-qa":"v3-requests-upload-files-input",ref:R,type:"file",accept:V,multiple:!0,className:"sr-only","aria-hidden":!0,tabIndex:-1,disabled:!c,onChange:s=>h(s)}),u&&e.jsx("div",{className:"mb-3 flex justify-center",children:e.jsx(Y,{to:"/dashboard","data-qa":"v3-requests-upload-logo-link",children:e.jsx("img",{src:u,alt:"logo",className:"h-16 w-auto"})})}),e.jsx("h1",{className:"text-xl font-semibold text-base-header text-center mb-5",children:J}),e.jsx("p",{className:"text-sm text-base-header/70 text-center mb-2",children:"Max 25 MB total attachments."}),o==="validating"&&e.jsx("p",{className:"text-sm text-base-header/70 text-center mb-2",children:"Validating upload session..."}),e.jsx(i,{"data-qa":"v3-requests-upload-open-camera","data-feature":"v3-requests-upload-open-camera",type:"button",variant:"primary",size:"lg",startIcon:e.jsx(q,{icon:Q,className:"text-xl"}),className:b("w-full !justify-center gap-3 h-14 sm:h-16 rounded-xl text-base font-semibold","[&>.grow]:grow-0 shadow-sm border-0"),disabled:!c,onClick:()=>{var s;return(s=N.current)==null?void 0:s.click()},children:ee}),e.jsx(i,{"data-qa":"v3-requests-upload-browse-photos","data-feature":"v3-requests-upload-browse-photos",type:"button",variant:"primaryOutline",size:"lg",startIcon:e.jsx(q,{icon:D,className:"text-xl"}),className:b("w-full !justify-center [&>.grow]:grow-0 gap-3 h-14 sm:h-16 rounded-xl text-base font-semibold"),disabled:!c,onClick:()=>{var s;return(s=w.current)==null?void 0:s.click()},children:se}),e.jsx(i,{"data-qa":"v3-requests-upload-browse-files","data-feature":"v3-requests-upload-browse-files",type:"button",variant:"primaryOutline",size:"lg",startIcon:e.jsx(q,{icon:$,className:"text-xl"}),className:b("w-full !justify-center [&>.grow]:grow-0 gap-3 h-14 sm:h-16 rounded-xl text-base font-semibold"),disabled:!c,onClick:()=>{var s;return(s=R.current)==null?void 0:s.click()},children:te}),A&&e.jsx("p",{className:"text-sm text-red-700 text-center",children:A})]}),m.length>0&&e.jsxs("div",{"data-qa":"v3-requests-upload-selected-files-panel","data-feature":"v3-requests-upload-selected-files-panel",className:"mt-8 pt-6 border-t border-primary bg-primary/5 rounded-lg p-4 flex flex-col gap-3",children:[e.jsx("p",{className:"text-sm font-medium text-base-header",children:ae(m.length)}),e.jsx("ul",{className:"flex flex-col gap-1 max-h-32 overflow-y-auto","data-qa":"v3-requests-upload-file-list",children:m.map((s,t)=>e.jsxs("li",{"data-qa":`v3-requests-upload-file-${t}`,className:"flex items-center justify-between gap-2 text-sm text-base-header/90 truncate",children:[e.jsx("span",{className:"truncate min-w-0",children:s.name}),e.jsx("button",{"data-qa":`v3-requests-upload-remove-file-${t}`,type:"button",onClick:()=>M(t),className:"shrink-0 text-base-header/60 hover:text-base-header underline",children:"Remove"})]},`${s.name}-${t}`))}),f&&e.jsx("p",{className:"text-sm text-base-header/70 text-center",children:de}),e.jsx(i,{"data-qa":"v3-requests-upload-continue","data-feature":"v3-requests-upload-continue",type:"button",variant:"primary",size:"md",className:"mt-2 w-full !justify-center [&>.grow]:grow-0 rounded-xl",disabled:f,onClick:()=>void U(),children:re})]})]})}export{he as Component,xe as handle};

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.