1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MapaTorre-B4-1bTM5.js","assets/react-vendor-pafHdoJx.js","assets/map-vendor-Dr8zbd0c.js","assets/map-vendor-Dgihpmma.css","assets/firebase-vendor-D3UzkAhn.js","assets/index-Db0fDLGN.js","assets/ui-vendor-DLXJn6s3.js","assets/index-i8_vqxvw.css","assets/station-D7qjEabm.js"])))=>i.map(i=>d[i]); 2import{b as A,d as D,_ as M}from"./index-Db0fDLGN.js";import{u as R,r as p,j as e}from"./react-vendor-pafHdoJx.js";import{u as $,r as d,p as h,S as V,c,h as m,b as C,d as v,e as z,f as n,T as N}from"./station-D7qjEabm.js";import{bD as w,z as E,l as _,a3 as B,a4 as L}from"./ui-vendor-DLXJn6s3.js";import"./firebase-vendor-D3UzkAhn.js";import"./map-vendor-Dr8zbd0c.js";const I=p.lazy(()=>M(()=>import("./MapaTorre-B4-1bTM5.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(a=>({default:a.MapaTorre}))),O=[{id:null,label:"Todas"},{id:"aberto",label:"Em aberto"},{id:"encerrado",label:"Encerradas"}];function P(a){return a?new Date(a).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",timeZone:"America/Sao_Paulo"}):"â"}function F(a){return a==null?"â":a>=1e6?`${(a/1e6).toLocaleString("pt-BR",{maximumFractionDigits:1})} mi`:a>=1e3?`${(a/1e3).toLocaleString("pt-BR",{maximumFractionDigits:0})} k`:a.toLocaleString("pt-BR",{maximumFractionDigits:0})}function Z(){const{t:a,mode:i}=$(),j=R(),[l,f]=p.useState(null),[x,k]=p.useState(30),[u,b]=p.useState("tabela"),{data:s,loading:S,error:y,refetch:T}=A(()=>D.ponteViagens({dias:x,situacao:l||void 0}),[x,l]),r=(s==null?void 0:s.itens)||[],o=s==null?void 0:s.resumo;return e.jsxs("div",{style:{display:"grid",gap:16},children:[e.jsxs("header",{style:{display:"flex",alignItems:"flex-end",justifyContent:"space-between",gap:14,flexWrap:"wrap"},children:[e.jsxs("div",{children:[e.jsx("div",{style:d(a,i),children:"Torre Agêntica · Livro"}),e.jsx("h1",{style:{margin:"6px 0 0",fontSize:h("lead",i),fontWeight:600,color:a.text},children:"Viagens manifestadas"})]}),e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[O.map(t=>e.jsx(g,{ativo:l===t.id,onClick:()=>f(t.id),children:t.label},String(t.id))),[7,30,90].map(t=>e.jsxs(g,{ativo:x===t,onClick:()=>k(t),children:[t,"d"]},t)),e.jsx("span",{style:{width:1,alignSelf:"stretch",background:a.border,margin:"0 4px"}}),e.jsxs(g,{ativo:u==="tabela",onClick:()=>b("tabela"),children:[e.jsx(w,{size:11,style:{verticalAlign:-1,marginRight:4}}),"tabela"]}),e.jsxs(g,{ativo:u==="mapa",onClick:()=>b("mapa"),children:[e.jsx(E,{size:11,style:{verticalAlign:-1,marginRight:4}}),"mapa"]})]})]}),o&&e.jsxs(V,{cols:10,children:[e.jsx("div",{style:{gridColumn:"span 2"},children:e.jsx(c,{titulo:"Manifestos",fonte:"MDF-e",children:e.jsx(m,{valor:o.manifestos??0,role:"value",rotulo:`${x} dias`})})}),e.jsx("div",{style:{gridColumn:"span 2"},children:e.jsx(c,{titulo:"Em aberto",estado:o.abertos?"atencao":"nominal",fonte:"MDF-e",children:e.jsx(m,{valor:o.abertos??0,role:"value",cor:o.abertos?a.warn:void 0,rotulo:"relógio dos 30 dias"})})}),e.jsx("div",{style:{gridColumn:"span 2"},children:e.jsx(c,{titulo:"Valor manifestado",fonte:"vCarga",children:e.jsx(m,{valor:F(o.valorTotal),unidade:"R$",role:"value"})})}),e.jsx("div",{style:{gridColumn:"span 2"},children:e.jsx(c,{titulo:"Com motorista no app",fonte:"DriverLinks",parcial:o.abertos&&o.comMotoristaVinculado<o.abertos?`${o.abertos-o.comMotoristaVinculado} sem vÃnculo`:null,children:e.jsx(m,{valor:`${o.comMotoristaVinculado??0}/${o.manifestos??0}`,role:"value",rotulo:"podem aparecer no mapa"})})}),e.jsx("div",{style:{gridColumn:"span 2"},children:e.jsx(c,{titulo:"Casados com o TMS",fonte:"despachos",parcial:o.manifestos&&o.comDespacho<o.manifestos?`${o.manifestos-o.comDespacho} sem par`:null,children:e.jsx(m,{valor:`${o.comDespacho??0}/${o.manifestos??0}`,role:"value",rotulo:"destrava km e custo"})})})]}),S&&!s&&e.jsx(C,{linhas:8,altura:34}),y&&e.jsx(v,{titulo:"O livro não carregou",detalhe:y,acao:e.jsx(z,{tom:"accent",onClick:T,children:"Tentar de novo"})}),!S&&!y&&!r.length&&e.jsx(v,{titulo:"Nenhum manifesto neste recorte",detalhe:"Amplie o perÃodo ou tire o filtro de situação."}),!!r.length&&u==="mapa"&&e.jsx(p.Suspense,{fallback:e.jsx(C,{linhas:4,altura:80}),children:e.jsx(I,{viagens:r})}),!!r.length&&u==="tabela"&&e.jsxs("div",{style:{overflowX:"auto"},className:"noc-scroll",children:[e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:h("micro",i),minWidth:940},children:[e.jsx("thead",{children:e.jsx("tr",{children:["Manifesto","Conjunto","Condutor","Rota","Carga","Km","TrÃade","Situação",""].map(t=>e.jsx("th",{style:{...d(a,i),textAlign:t==="Carga"||t==="Km"?"right":"left",padding:"9px 10px",borderBottom:`1px solid ${a.border}`},children:t},t))})}),e.jsx("tbody",{children:r.map(t=>e.jsxs("tr",{onClick:()=>j(`/ponte/viagem/${t.chave}`),style:{cursor:"pointer",borderBottom:`1px solid ${a.grid}`},children:[e.jsxs("td",{style:{padding:"10px",color:a.text,fontFamily:n},children:["#",t.numero||t.chave.slice(-6),e.jsx("div",{style:{...d(a,i),marginTop:3},children:P(t.emitidaEmMs)})]}),e.jsxs("td",{style:{padding:"10px",fontFamily:n,color:a.dim},children:[t.placa||"â",!!t.reboques.length&&e.jsxs("span",{style:{color:a.faint},children:[" + ",t.reboques.join(" + ")]})]}),e.jsx("td",{style:{padding:"10px",color:a.dim},children:t.condutor||"â"}),e.jsxs("td",{style:{padding:"10px",color:a.dim},children:[t.origem||"â"," ",e.jsx("span",{style:{color:a.faint},children:"â"})," ",t.destino||"â"]}
2),e.jsxs("td",{style:{padding:"10px",textAlign:"right",fontFamily:n,color:a.text,fontVariantNumeric:"tabular-nums"},children:[F(t.valorCarga),e.jsx("div",{style:{...d(a,i),marginTop:3},children:t.pesoKg?`${(t.pesoKg/1e3).toFixed(1)} t`:"â"})]}),e.jsx("td",{style:{padding:"10px",textAlign:"right",fontFamily:n,color:t.kmFiscal==null?a.faint:a.dim,fontVariantNumeric:"tabular-nums"},children:t.kmFiscal==null?"â":t.kmFiscal.toLocaleString("pt-BR")}),e.jsx("td",{style:{padding:"10px"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(N,{triade:t.triade,compacto:!0}),t.excecoes>0&&e.jsxs("span",{title:`${t.excecoes} exceção(ões) abertas`,style:{display:"inline-flex",alignItems:"center",gap:3,color:a.critical,fontFamily:n},children:[e.jsx(_,{size:11}),t.excecoes]})]})}),e.jsx("td",{style:{padding:"10px"},children:e.jsx("span",{style:{fontFamily:n,fontSize:h("micro",i),color:t.situacao==="aberto"?a.warn:a.nominal},children:t.situacao})}),e.jsx("td",{style:{padding:"10px",textAlign:"right"},children:e.jsx(B,{size:13,color:a.faint})})]},t.chave))})]}),(s==null?void 0:s.truncado)&&e.jsxs("div",{style:{...d(a,i),textAlign:"center",padding:14,display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:[e.jsx(L,{size:12})," mostrando ",r.length," de ",s.total," â refine o perÃodo"]})]})]})}function g({children:a,ativo:i,onClick:j}){const{t:l,mode:f}=$();return e.jsx("button",{onClick:j,style:{fontFamily:n,fontSize:h("micro",f),padding:"5px 10px",borderRadius:3,cursor:"pointer",background:i?`${l.accent}1F`:"transparent",border:`1px solid ${i?`${l.accent}66`:l.border}`,color:i?l.accent:l.dim},children:a})}export{Z 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.