1import{h as p,k as h,m as u,u as j,P as f,r as t,j as e}from"./index-WRxDeZXy.js";const b=p({method:"GET"}).middleware([h]).handler(u("8c5c6bf3c1b0c61b02d786c9dc24613784d9710f42bb880348c38a968e43374f")),N={sent:"تÙ
Ø§ÙØ¥Ø±Ø³Ø§Ù",claim_failed:"Ø§ÙØ·Ùب ØºÙØ± ØµØ§ÙØ",issue_failed:"ÙØ´Ù تسÙÙÙ
اÙÙÙØ¯ ÙÙÙ
ÙØµØ©",whatsapp_failed:"ÙØ´Ù إرسا٠اÙÙØ§ØªØ³Ø§Ø¨",rate_limited:"ØªØ¬Ø§ÙØ² Ø§ÙØØ¯ (Ù£/ساعة)",config_error:"إعداد ÙØ§Ùص"};function y(){const{session:a}=j(),x=f(),r=a?.kind==="admin"&&a.role==="admin",[d,i]=t.useState([]),[m,c]=t.useState(!0),[o,l]=t.useState(null),n=async()=>{c(!0),l(null);try{const s=await b();i(s.rows)}catch(s){l(s instanceof Error?s.message:"ÙØ´Ù Ø§ÙØªØÙ
ÙÙ")}finally{c(!1)}};return t.useEffect(()=>{r&&n()},[r]),r?e.jsxs("div",{className:"mx-auto max-w-6xl p-4 sm:p-6",dir:"rtl",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[e.jsx("button",{onClick:()=>x.history.back(),className:"rounded-md border border-border bg-card px-3 py-1.5 text-xs font-semibold hover:bg-muted",children:"â Ø±Ø¬Ùع"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h1",{className:"text-xl font-bold",children:"سج٠أÙÙØ§Ø¯ تسجÙ٠أÙÙÙØ§Ø¡ Ø§ÙØ£Ù
ÙØ±"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Ø§ÙØ±Ø³Ø§Ø¦Ù Ø§ÙØªÙ تبدأ ب٠NOZHA-REG عÙ٠رÙÙ
اÙÙØ§ØªØ³Ø§Ø¨ â Ø§ÙÙÙØ¯ ÙÙØ³Ù ØºÙØ± Ù
خزÙÙÙ."})]}),e.jsx("button",{onClick:()=>{n()},className:"rounded-md border border-border bg-card px-3 py-1.5 text-xs font-semibold hover:bg-muted",children:"ØªØØ¯ÙØ«"})]}),m?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Ø¬Ø§Ø±Ù Ø§ÙØªØÙ
ÙÙâ¦"}):o?e.jsx("div",{className:"text-sm text-destructive",children:o}):e.jsx("div",{className:"overflow-x-auto rounded-lg border border-border bg-card",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/40 text-right text-xs uppercase text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2",children:"رÙÙ
Ø§ÙØ·Ùب"}),e.jsx("th",{className:"px-3 py-2",children:"Ø§ÙØ±ÙÙ
"}),e.jsx("th",{className:"px-3 py-2",children:"اÙÙØªÙجة"}),e.jsx("th",{className:"px-3 py-2",children:"claim"}),e.jsx("th",{className:"px-3 py-2",children:"issue"}),e.jsx("th",{className:"px-3 py-2",children:"ÙØ§ØªØ³Ø§Ø¨"}),e.jsx("th",{className:"px-3 py-2",children:"ÙÙØª Ø§ÙØ¥Ø±Ø³Ø§Ù"}),e.jsx("th",{className:"px-3 py-2",children:"خطأ"})]})}),e.jsxs("tbody",{children:[d.map(s=>e.jsxs("tr",{className:"border-t border-border",children:[e.jsx("td",{className:"px-3 py-2 font-mono text-xs",dir:"ltr",children:s.request_id}),e.jsx("td",{className:"px-3 py-2 font-mono text-xs",dir:"ltr",children:s.phone}),e.jsx("td",{className:"px-3 py-2 text-xs",children:e.jsx("span",{className:s.outcome==="sent"?"text-primary font-semibold":"text-destructive font-semibold",children:N[s.outcome]??s.outcome})}),e.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:s.claim_status??"â"}),e.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:s.issue_status??"â"}),e.jsx("td",{className:"px-3 py-2 text-xs",children:s.whatsapp_ok?"â":"â"}),e.jsx("td",{className:"px-3 py-2 font-mono text-xs",dir:"ltr",children:new Date(s.sent_at??s.created_at).toLocaleString("ar-EG")}),e.jsx("td",{className:"px-3 py-2 text-xs text-muted-foreground",children:s.error??"â"})]},s.id)),d.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:8,className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"ÙØ§ ÙÙØ¬Ø¯ سج٠بعد."})})]})]})})]}):e.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"Admin access required."})}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.