1var __IMPORT_META_ENV={};var __PROCESS_ENV={NODE_ENV:"production"}; 2import{f as c}from"/chunks/chunk-UHYO2KZZ.js";import"/chunks/chunk-VBBLHACL.js";import{b as a,c as u,d as g}from"/chunks/chunk-D5RLJOF2.js";import{A as m,B as A,c as k,e as S,g as C,j as y,v as j,x as w}from"/chunks/chunk-M2SDEZ4P.js";import{d as h,e as D,g as L}from"/chunks/chunk-AF56WCW5.js";var T=h(D());var e=h(L());function p({icon:r,label:n,value:b,sub:x,colorClass:v}){return(0,e.jsxs)("div",{className:"bg-card border border-border rounded-xl p-5 flex items-start gap-4",children:[(0,e.jsx)("div",{className:w("h-10 w-10 rounded-lg flex items-center justify-center shrink-0",v),children:(0,e.jsx)(r,{className:"h-5 w-5 text-white"})}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("p",{className:"text-xs text-muted-foreground mb-1",children:n}),(0,e.jsx)("p",{className:"text-xl font-bold text-foreground tabular-nums",children:b}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:x})]})]})}function P(){let{nodes:r,loading:n}=g(m.claims),{nodes:b,loading:x}=g(m.contractors),{nodes:v}=g(m.checklist),d=(0,T.useMemo)(()=>{if(n||!r.length)return null;let t=r.reduce((s,l)=>s+(u(l,"\u0627\u0644\u0645\u0628\u0644\u063A \u0627\u0644\u0645\u0637\u0627\u0644\u0628","/attributes/@amount")??0),0),o=r.filter(s=>{let l=a(s,"\u062D\u0627\u0644\u0629 \u0627\u0644\u0645\u0631\u0627\u062C\u0639\u0629","/attributes/@status02");return l==="\u0642\u064A\u062F \u0627\u0644\u0645\u0631\u0627\u062C\u0639\u0629"||l==="\u0645\u0633\u0648\u062F\u0629"}),i=r.filter(s=>a(s,"\u062D\u0627\u0644\u0629 \u0627\u0644\u0645\u0631\u0627\u062C\u0639\u0629","/attributes/@status02")==="\u0645\u0639\u062A\u0645\u062F"),f=r.filter(s=>a(s,"\u062D\u0627\u0644\u0629 \u0627\u0644\u0645\u0631\u0627\u062C\u0639\u0629","/attributes/@status02")==="\u0645\u0631\u0641\u0648\u0636"),N=r.filter(s=>a(s,"\u062D\u0627\u0644\u0629 \u0627\u0644\u0645\u0631\u0627\u062C\u0639\u0629","/attributes/@status02")==="\u0645\u062F\u0641\u0648\u0639");return{total:r.length,totalAmount:t,pending:o.length,pendingAmount:o.reduce((s,l)=>s+(u(l,"\u0627\u0644\u0645\u0628\u0644\u063A \u0627\u0644\u0645\u0637\u0627\u0644\u0628","/attributes/@amount")??0),0),approved:i.length,rejected:f.length,paid:N.length}},[r,n]);return(0,e.jsxs)("div",{className:"p-4 md:p-6 space-y-6 max-w-7xl mx-auto",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"\u0644\u0648\u062D\u0629 \u0627\u0644\u062A\u062D\u0643\u0645"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"\u0646\u0638\u0631\u0629 \u0639\u0627\u0645\u0629 \u0639\u0644\u0649 \u0645\u0633\u062A\u062E\u0644\u0635\u0627\u062A \u0645\u0642\u0627\u0648\u0644\u064A \u0627\u0644\u0628\u0627\u0637\u0646"})]}),n||x?(0,e.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:Array.from({length:4}).map((t,o)=>(0,e.jsx)("div",{className:"bg-card border border-border rounded-xl p-5 animate-pulse",children:(0,e.jsxs)("div",{className:"flex items-start gap-4",children:[(0,e.jsx)("div",{className:"h-10 w-10 rounded-lg bg-muted"}),(0,e.jsxs)("div",{className:"space-y-2 flex-1",children:[(0,e.jsx)("div",{className:"h-3 w-16 bg-muted rounded"}),(0,e.jsx)("div",{className:"h-6 w-24 bg-muted rounded"}),(0,e.jsx)("div",{className:"h-3 w-20 bg-muted rounded"})]})]})},o))}):d?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[(0,e.jsx)(p,{icon:y,label:"\u0625\u062C\u0645\u0627\u0644\u064A \u0627\u0644\u0645\u0633\u062A\u062E\u0644\u0635\u0627\u062A",value:String(d.total),sub:`${b.length} \u0645\u0642\u0627\u0648\u0644`,colorClass:"bg-primary"}),(0,e.jsx)(p,{icon:C,label:"\u0642\u064A\u062F \u0627\u0644\u0645\u0631\u0627\u062C\u0639\u0629",value:String(d.pending),sub:`${d.pendingAmount.toLocaleString("ar-SA")} \u0631.\u0633`,colorClass:"bg-amber-500"}),(0,e.jsx)(p,{icon:k,label:"\u0645\u0639\u062A\u0645\u062F\u0629",value:String(d.approved),sub:"\u062C\u0627\u0647\u0632\u0629 \u0644\u0644\u0635\u0631\u0641",colorClass:"bg-emerald-500"}),(0,e.jsx)(p,{icon:S,label:"\u0645\u0631\u0641\u0648\u0636\u0629",value:String(d.rejected),sub:"\u062A\u062D\u062A\u0627\u062C \u0625\u0639\u0627\u062F\u0629 \u062A\u0642\u062F\u064A\u0645",colorClass:"bg-red-500"})]}),(0,e.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,e.jsxs)("div",{className:"bg-card border border-border rounded-xl p-5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"\u0623\u062D\u062F\u062B \u0627\u0644\u0645\u0633\u062A\u062E\u0644\u0635\u0627\u062A"}),(0,e.jsx)(c,{to:"/claims",className:"text-xs text-primary hover:underline",children:"\u0639\u0631\u0636 \u0627\u0644\u0643\u0644"})]}),(0,e.jsx)("div",{className:"space-y-3",children:r.slice(0,5).map(t=>{let o=a(t,"\u062D\u0627\u0644\u0629 \u0627\u0644\u0645\u0631\u0627\u062C\u0639\u0629","/attributes/@status02")??"\u0645\u0633\u0648\u062F\u0629",i=u(t,"\u0627\u0644\u0645\u0628\u0644\u063A \u0627\u0644\u0645\u0637\u0627\u0644\u0628","/attributes/@amount")??0,f=a(t,"\u0627\u0644\u0645\u0642\u0627\u0648\u0644","/attributes/@contractor")??"",N=a(t,"\u0627\u0644\u0645\u0634\u0631\u0648\u0639","/attributes/@project")??"";return(0,e.jsxs)(c,{to:"/claims",className:"flex items-center justify-between py-2.5 px-3 rounded-lg hover:bg-muted/50 transition-colors group",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground truncate",children:t.fieldValues["/text"]}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground truncate",children:[f," \xB7 ",N]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3 mr-3 shrink-0",children:[(0,e.jsxs)("span",{className:"text-sm font-semibold tabular-nums text-foreground",children:[i.toLocaleStr
2ing("ar-SA")," \u0631.\u0633"]}),(0,e.jsx)("span",{className:w("inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium text-white",A[o]||"bg-slate-500"),children:o})]})]},t.id)})})]}),(0,e.jsxs)("div",{className:"bg-card border border-border rounded-xl p-5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"\u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0645\u0631\u0627\u062C\u0639\u0629"}),(0,e.jsx)(c,{to:"/review",className:"text-xs text-primary hover:underline",children:"\u0639\u0631\u0636 \u0627\u0644\u0643\u0644"})]}),(0,e.jsx)("div",{className:"space-y-2",children:v.slice(0,8).map(t=>{let o=a(t,"\u0627\u0644\u0641\u0626\u0629","/attributes/@cat02")??"",i=a(t,"\u0625\u0644\u0632\u0627\u0645\u064A","/attributes/@mandatory")==="\u0646\u0639\u0645";return(0,e.jsxs)("div",{className:"flex items-center gap-3 py-2 px-3 rounded-lg hover:bg-muted/50 transition-colors",children:[i?(0,e.jsx)(j,{className:"h-4 w-4 text-amber-500 shrink-0"}):(0,e.jsx)("div",{className:"h-4 w-4 rounded-full border-2 border-muted-foreground/30 shrink-0"}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("p",{className:"text-sm text-foreground truncate",children:t.fieldValues["/text"]}),(0,e.jsxs)("p",{className:"text-[10px] text-muted-foreground",children:[o,i?" \xB7 \u0625\u0644\u0632\u0627\u0645\u064A":""]})]})]},t.id)})})]})]})]}):(0,e.jsxs)("div",{className:"bg-card border border-border rounded-xl p-8 text-center",children:[(0,e.jsx)(y,{className:"h-12 w-12 text-muted-foreground mx-auto mb-3"}),(0,e.jsx)("p",{className:"text-muted-foreground",children:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0628\u064A\u0627\u0646\u0627\u062A \u0644\u0639\u0631\u0636\u0647\u0627 \u062D\u0627\u0644\u064A\u0627\u064B"})]})]})}export{P 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.