1import{_ as b,r as i,s as o,j as e,f as g,B as n,e as c}from"./index-BNGXKjJb.js";import{C as v}from"./card-ZW3TLzfr.js";import{B as N}from"./badge-LPC9Ul6S.js";import{A as y}from"./AdminBreadcrumb-BqP7LHYZ.js";import{A as w}from"./AdminLogoutButton-DcljFTE6.js";import{C as _}from"./CurrentAdminBadge-51qeLUMc.js";import{L as A}from"./LocalAdminBadge-CE0gUbS8.js";import{u as B}from"./use-track-page-view-BYVB15rE.js";import{U as C}from"./user-cog-B0Zvxoq3.js";import{H as L}from"./user-plus-Bsl3iv3n.js";import{A as S}from"./arrow-left-B5H9nXD_.js";import"./istiqlal-logo-CZ1FBBVd.js";import"./chevron-right-CUobk-nS.js";import"./log-out-DPgU9Hc4.js";import"./circle-user-DL2bX0Yh.js";import"./AdminDetailDialog-xH8ZMQqS.js";import"./dialog-MheTz5Oq.js";import"./index-DNCZTDFl.js";import"./index-B8oBx2Ss.js";import"./separator-ByEjBVQZ.js";import"./textarea-BewEExMt.js";import"./switch-DXtWRaAB.js";import"./index-Bnh4fyV8.js";import"./label-ehC12Xt8.js";import"./tabs-JU9uIBKY.js";import"./index-kGdD28uX.js";import"./select-KpDYqztM.js";import"./chevron-down-BgTFLdIt.js";import"./chevron-up-CgVvaPk9.js";import"./check-BK1ueZLH.js";import"./table-B0Spjpac.js";import"./log-in-DiYkRMBz.js";import"./activity-ugD8Xnim.js";import"./jspdf.es.min-EknYakOw.js";import"./statut-parti-D5fdyIPc.js";import"./upload-BRg732MU.js";import"./trash-2-Ciny9sdn.js";import"./pencil-CHaVxmEj.js";import"./shield-alert-B30HuGMg.js";import"./eye-off-CuYEG0qW.js";import"./eye-BhUYPKsz.js";import"./copy-FBmHn9jj.js";import"./key-round-CoO7LSXi.js";import"./file-down-CYhtNpdK.js";function ve(){const{tenant:u,bureauId:a}=b(),[l,d]=i.useState(!0),[r,p]=i.useState(null),[t,x]=i.useState(null),[m,f]=i.useState([]);return B("bureau",a),i.useEffect(()=>{(async()=>{d(!0);const{data:s}=await o.from("bureaux_de_vote").select("*").eq("id",a).maybeSingle();if(p(s),s!=null&&s.commune_id){const{data:j}=await o.from("communes").select("id, name, province_id").eq("id",s.commune_id).maybeSingle();x(j)}const{data:h}=await o.from("assesseurs").select("id, nom, code, statut_conformite, telephone, niveau").eq("bureau_id",a).is("deleted_at",null);f(h??[]),d(!1)})()},[a]),l?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx(g,{className:"w-8 h-8 animate-spin text-primary"})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"gradient-pi p-4 sticky top-0 z-30",children:e.jsxs("div",{className:"max-w-4xl mx-auto space-y-2",children:[e.jsx(y,{items:[...t?[{label:t.name,to:`/admin/province/${u}/commune/${t.id}`}]:[],{label:`Bureau ${r.bureau_number}`}]}),e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h1",{className:"text-xl font-bold text-primary-foreground truncate",children:["Bureau de vote ",r.bureau_number]}),e.jsxs("p",{className:"text-primary-foreground/70 text-xs",children:[r.lieu??"â"," · ",r.inscrits.toLocaleString("fr-FR")," inscrits"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{}),e.jsx(A,{niveau:"bureau",bureau_id:r.id,scopeLabel:`Bureau ${r.bureau_number}`}),e.jsx(n,{asChild:!0,size:"sm",variant:"secondary",children:e.jsxs(c,{to:"/admin/users",children:[e.jsx(C,{className:"w-4 h-4 mr-1"})," Admins"]})}),e.jsx(n,{asChild:!0,size:"sm",variant:"secondary",children:e.jsxs(c,{to:"/admin/audit",children:[e.jsx(L,{className:"w-4 h-4 mr-1"})," Audit"]})}),t&&e.jsx(n,{asChild:!0,size:"sm",variant:"secondary",children:e.jsxs(c,{to:`/admin/province/${u}/commune/${t.id}`,children:[e.jsx(S,{className:"w-4 h-4 mr-1"})," Commune"]})}),e.jsx(w,{})]})]})]})}),e.jsx("main",{className:"max-w-4xl mx-auto px-4 py-6 space-y-4",children:e.jsxs(v,{className:"p-4",children:[e.jsxs("h2",{className:"font-semibold mb-3",children:["Assesseurs (",m.length,")"]}),m.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Aucun assesseur affecté."}):e.jsx("ul",{className:"divide-y divide-border",children:m.map(s=>e.jsxs("li",{className:"py-2 flex items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:s.nom}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.code," · ",s.telephone??"â"]})]}),e.jsx(N,{variant:s.statut_conformite==="conforme"?"default":"outline",children:s.statut_conformite})]},s.id))})]})})]}):e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("p",{children:"Bureau introuvable."})})}export{ve 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.