1import{a as m,p as E,u as j,ag as P,V as F,e as H,r as T,bk as $,aj as S,ai as B,j as i,P as L,c as a}from"./index.af7661b9.js";import{T as w}from"./TableHaderData.a316efb1.js";import{H as O}from"./index.esm.018ece09.js";const J=()=>{const{language:p}=m(E),d=j(),{districts:y,municipalities:b,provinces:x}=m(P),{ambulanceContent:f}=m(F),{t:D}=H(),g=[];for(const c of f)g.includes(c==null?void 0:c.province)||g.push(c==null?void 0:c.province);const N=c=>{if(y){const l=y.find(r=>r.id===c);if(l)return p==="en"?l.title:l.title_ne}return""},v=c=>{const l=(x==null?void 0:x.length)>0&&(x==null?void 0:x.find(r=>r.id===c));return l?p==="en"?l==null?void 0:l.title:l==null?void 0:l.title_ne:""},k=c=>{if(b){const l=b.find(r=>r.id===c);if(l)return p==="en"?l.title:l.title_ne}return""};T.exports.useEffect(()=>{d($({})),d(S({})),d(B({}))},[]);const _=(c,l=",",r=` 2`,h="")=>{if(!c||c.length<=0)return;let e="";return c.forEach(n=>{for(let s=0;s<n.length;s++)e+=n[s],s===n.length-1?e+=r:e+=l;e+=r}),e},A=c=>{const l=[],r=[];r.push("Districts"),w[0].subHeader.forEach(e=>{r.push(e.headerData)}),l.push(r),f.forEach(e=>{if(c===e.province.id){const n=[];n.push(e.district.title),n.push(e.id),n.push(e.municipality.title),n.push(e.municipality.title),n.push(e.vehicle),n.push(e.driver),n.push(e.contact),n.push(e.alt_contact),n.push(e.condition.replaceAll(",",",")),l.push(n)}});const h=l.length>0&&_(l);if(h){let e=new Blob([h],{type:"text/csv;charset=utf-8"}),n=URL.createObjectURL(e),s=document.createElement("a");s.href=n,s.download="test.csv",document.body.appendChild(s),s.click()}};return i("div",{children:i(L,{children:i("div",{className:"container flex flex-col gap-y-9",children:g.map((c,l)=>{var h;const r=[];for(const e of f)(e==null?void 0:e.province)===c&&!r.includes(e==null?void 0:e.district)&&r.push(e==null?void 0:e.district);return a("div",{children:[a("div",{className:"flex items-center justify-between mb-2 pt-10 pb-4",children:[i("h1",{className:"text-greenOne font-bold text-xl",children:`${c?v(c):p==="en"?"Province N/A":"\u092A\u094D\u0930\u0926\u0947\u0936 \u0928\u092D\u090F\u0915\u093E"}- ${r.length} ${p==="en"?"District":"\u091C\u093F\u0932\u094D\u0932\u093E"}`}),a("div",{className:"flex items-center text-greenTwo font-bold text-base cursor-pointer ",onClick:()=>A(c),children:[i("p",{className:"font-base font-semibold hidden md:flex",children:D("Download")}),i(O,{className:"w-5 h-5"})]})]}),i("div",{className:"flex flex-col overflow-x-auto",children:a("table",{className:"w-auto bg-[#F4F4F4] overflow-x-scroll",children:[(h=w)==null?void 0:h.map((e,n)=>{var s;return e.headerData==="Districts"?a("tr",{className:"bg-[#BECA74]",children:[i("th",{className:"text-white text-left px-[9px] py-[6px] w-[300px]",children:p==="en"?e.headerData:e.headerData_nepali}),i("tr",{children:(s=w)==null?void 0:s.map(t=>{var o;return(o=t==null?void 0:t.subHeader)==null?void 0:o.map((u,C)=>i("th",{className:"text-white text-left px-[9px] py-[6px] w-[300px] ",children:p==="en"?u==null?void 0:u.headerData:u==null?void 0:u.headerData_nepali},C))})})]},n):null}),r.map((e,n)=>{const s=f.filter(t=>{var o;return((o=t==null?void 0:t.district)==null?void 0:o.id)===e});return a("tr",{style:{borderBottom:"3px solid white"},children:[i("td",{className:"text-black px-[9px] py-[6px] text-left align-top w-[300px]",children:N(e)}),s.map((t,o)=>a("tr",{children:[i("td",{className:"text-black px-[9px] py-[6px] text-left align-top w-[300px]",children:o+1}),i("td",{className:"text-black px-[9px] py-[6px] text-left align-top w-[300px]",children:t!=null&&t.municipality?k(t.municipality):"---"}),i("td",{className:"text-black px-[9px] py-[6px] text-left align-top w-[300px]",children:t!=null&&t.ownership?p==="en"?t.ownership:t.ownership_ne:"---"}),i("td",{className:"text-black px-[9px] py-[6px] text-left align-top w-[300px] whitespace-nowrap",children:t!=null&&t.vehicle?p==="en"?t.vehicle:t.vehicle_ne:"---"}),i("td",{className:"text-black px-[9px] py-[6px] text-left align-top w-[300px]",children:t!=null&&t.driver?p==="en"?t.driver:t.driver_ne:"---"}),i("td",{className:"text-black px-[9px] py-[6px] text-left align-top w-[300px]",children:t.contact?t.contact:"---"}),i("td",{className:"text-black px-[9px] py-[6px] text-left align-top w-[300px]",children:t.alt_contact?t.alt_contact:"---"}),i("td",{className:"text-black px-[9px] py-[6px] text-left align-top w-[300px]",children:t!=null&&t.condition?p==="en"?t.condition:t.condition_ne:"---"})]},`${l}-${o}
2`))]},n)})]})},l)]},l)})})})})};export{J 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.