1import{V as j,r as s,j as e,a6 as C,ad as y,s as g,an as N}from"./index-CEqNdWMB.js";import{L as v}from"./label-MzaZtEZW.js";import{C as b,a as w,b as R,d as S,c as E}from"./card-CYkSJyY5.js";import{C as L}from"./ChildRosterView-BOP86a5x.js";import{B as P}from"./baby-C7JZZAHz.js";import{K as T}from"./key-round-PG2JVunb.js";import{L as _}from"./loader-circle-CSZF46_Z.js";import"./tabs-DG3YBuYE.js";import"./index-DjURd1vY.js";import"./index-NdaxtzIS.js";import"./select-B9ajeO-3.js";import"./index-BdQq_4o_.js";import"./index-BSd2hjwl.js";import"./form-layout-CimphA65.js";import"./chevron-up-C686eY-E.js";import"./check-CYl4c-Z5.js";import"./dropdown-menu-mJ5D-ewh.js";import"./circle-CzO3hopn.js";import"./table-DPXuLFXQ.js";import"./roster-Ch0pUPof.js";import"./search-Ct4PNFf0.js";import"./printer-BPUtF6sl.js";const D={invalid_pin:"That PIN is not correct.",too_many_attempts:"Too many attempts. Try again in 15 minutes.",not_found:"This roster link is not active."},te=()=>{const{token:d}=j(),[r,p]=s.useState(""),[i,m]=s.useState(!1),[l,a]=s.useState(null),[o,x]=s.useState(null),u=async n=>{n.preventDefault(),m(!0),a(null);try{const{data:t,error:h}=await g.functions.invoke("childcare-roster",{body:{action:"verify",token:d,pin:r}});if(h||t!=null&&t.error){const f=(t==null?void 0:t.error)??"not_found";a(D[f]??"Could not open the roster.");return}x(t)}catch{a("Could not open the roster.")}finally{m(!1)}},c=e.jsxs(N,{children:[e.jsx("title",{children:"Child Care Roster"}),e.jsx("meta",{name:"robots",content:"noindex, nofollow, noarchive"}),e.jsx("meta",{name:"googlebot",content:"noindex, nofollow, noarchive"})]});return o?e.jsxs(e.Fragment,{children:[c,e.jsxs("main",{className:"mx-auto max-w-5xl space-y-6 p-4 sm:p-8",children:[e.jsxs("header",{children:[e.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-semibold",children:[e.jsx(P,{className:"h-6 w-6 text-primary"}),"Child Care Roster"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:o.event.title})]}),e.jsx(L,{data:o})]})]}):e.jsxs(e.Fragment,{children:[c,e.jsx("main",{className:"flex min-h-screen items-center justify-center p-4",children:e.jsxs(b,{className:"w-full max-w-sm",children:[e.jsxs(w,{children:[e.jsxs(R,{className:"flex items-center gap-2",children:[e.jsx(T,{className:"h-5 w-5 text-primary"}),"Staff access"]}),e.jsx(S,{children:"Enter the PIN provided by your event manager."})]}),e.jsx(E,{children:e.jsxs("form",{onSubmit:u,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"pin",children:"PIN"}),e.jsx(C,{id:"pin",inputMode:"numeric",autoComplete:"off",autoFocus:!0,value:r,onChange:n=>p(n.target.value.replace(/\D/g,"").slice(0,12))})]}),l&&e.jsx("p",{className:"text-sm text-destructive",children:l}),e.jsxs(y,{type:"submit",className:"w-full",disabled:i||r.length<4,children:[i&&e.jsx(_,{className:"mr-2 h-4 w-4 animate-spin"}),"View roster"]})]})})]})})]})};export{te 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.