File size: 63,825 Bytes
77a0d68 5f34152 9daf5b5 5f34152 9daf5b5 5f34152 9daf5b5 5f34152 9daf5b5 5f34152 9daf5b5 5f34152 9daf5b5 5f34152 77a0d68 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | <!doctype html>
<html lang="pt">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Metro da importação · ramais</title>
<!-- Metro do processo de importação (Mapa Enc). Gerado por metro/construir_metro.py a partir do registo de eventos.
Desenho isométrico no estilo do mapa dos agentes do portal (kernel isométrico e vocabulário de brilho da skill
iso-glow, MIT, April Zhu / Tolga Cohce). Cada estação é um passo do fluxo, pela ordem desenhada; cada carruagem é
uma encomenda, que anda de estação em estação nas datas reais. Andar para trás = passo fora da ordem desenhada. -->
<style>
:root { --panel:#0b0e13; --body:#121720; --deck:#161c26; --line:#4d5869; --detail:#283040; --recess:#0d1117;
--ink:#8b95a6; --ink-hi:#dfe4ec; --glass:#0f141c;
--accent:#ffb347; --accent-hi:#ffdca6; --accent-dim:rgba(255,179,71,.22);
--verde:#5fd38d; --amarelo:#f2c94c; --vermelho:#f0645a; --cinza:#5d6676; }
html, body { margin:0; height:100%; background:var(--panel); color:var(--ink-hi);
font-family:"Segoe UI", system-ui, sans-serif; overflow:hidden; }
#mundo { width:calc(100% - 350px); height:100%; display:block; } /* a coluna da direita fica para as mensagens */
#mundo * { vector-effect:non-scaling-stroke; }
.face { fill:var(--body); stroke:var(--line); stroke-width:1; stroke-linejoin:round; }
.face.top { fill:var(--deck); }
.face.chao { fill:#0e1218; stroke:var(--detail); }
.face.cais { fill:#1a212c; stroke:var(--line); }
.detail { fill:none; stroke:var(--detail); stroke-width:1; }
.win { fill:var(--glass); stroke:var(--detail); stroke-width:.8; transition:fill .5s, stroke .5s; }
.win.hot { fill:var(--accent); stroke:var(--accent-hi); }
.halo { fill:var(--accent); opacity:0; transition:opacity .6s; pointer-events:none; }
.halo.hot { opacity:.45; }
.carril { fill:none; stroke:var(--line); stroke-width:1.3; }
.travessa { stroke:var(--detail); stroke-width:1.6; }
.seta-linha { fill:var(--line); }
.pegada { fill-opacity:.12; stroke-width:2; stroke-dasharray:6 5; transition:fill .6s, stroke .6s; }
.nome { font-size:27px; font-weight:600; fill:var(--ink-hi); text-anchor:middle; paint-order:stroke;
stroke:var(--panel); stroke-width:7px; }
.conta { font:700 30px Consolas, monospace; text-anchor:middle; paint-order:stroke; stroke:var(--panel); stroke-width:7px; }
.dias { font-size:19px; fill:var(--ink); text-anchor:middle; paint-order:stroke; stroke:var(--panel); stroke-width:6px; }
.num { font:700 15px Consolas, monospace; fill:var(--ink); }
.estacao { cursor:pointer; }
.estacao:hover .face { stroke:var(--ink-hi); }
.pod { stroke:#0b0e13; stroke-width:.7; }
.pod.top { filter:brightness(1.25); }
.pod-tras { stroke:var(--vermelho); stroke-width:1.6; }
.pod-dias { font:700 19px Consolas, monospace; text-anchor:middle; paint-order:stroke; stroke:#0b0e13; stroke-width:4px; pointer-events:none; }
.centro { font:600 34px "Segoe UI", sans-serif; fill:#2c3443; text-anchor:middle; letter-spacing:3px; }
.centro.data { font:700 64px Consolas, monospace; fill:#3a4456; letter-spacing:2px; }
.topo { position:absolute; left:12px; top:10px; display:flex; flex-direction:column; gap:7px; max-width:62%; }
.hud { display:flex; gap:8px; flex-wrap:wrap; }
.chip { background:rgba(18,23,32,.92); border:1px solid var(--detail); border-radius:8px; padding:5px 11px;
font-size:12.5px; color:var(--ink); }
.chip b { color:var(--ink-hi); font-size:14px; }
.chip.data b { color:var(--accent-hi); font-size:16px; font-family:Consolas, monospace; }
.chip.alerta b { color:#ffb3ab; }
.feed { position:absolute; right:12px; top:12px; width:330px; display:flex; flex-direction:column; gap:6px; font-size:12px; }
.evento { background:rgba(18,23,32,.92); border:1px solid var(--detail); border-left:3px solid var(--line);
border-radius:6px; padding:5px 8px; color:var(--ink-hi); animation:entra .4s ease; }
.evento.tras { border-left-color:var(--vermelho); }
.evento span { color:var(--ink); }
@keyframes entra { from { opacity:0; transform:translateX(24px) } to { opacity:1; transform:none } }
.legenda { position:absolute; right:12px; bottom:104px; width:330px; box-sizing:border-box; background:rgba(18,23,32,.92); border:1px solid var(--detail);
border-radius:8px; padding:7px 10px; font-size:11.5px; color:var(--ink); line-height:1.7; }
.legenda i { display:inline-block; width:10px; height:10px; border-radius:50%; margin:0 4px 0 2px; vertical-align:-1px; }
.legenda .neg { cursor:pointer; margin-right:8px; white-space:nowrap; user-select:none; }
.legenda .neg.off { opacity:.35; text-decoration:line-through; }
.controlo { position:absolute; left:12px; right:12px; bottom:12px; display:flex; gap:8px; align-items:center;
background:rgba(18,23,32,.92); border:1px solid var(--detail); border-radius:10px; padding:7px 12px; }
.controlo button { background:var(--deck); color:var(--ink-hi); border:1px solid var(--line); border-radius:6px;
padding:4px 10px; cursor:pointer; font-size:13px; }
.controlo button.sel { background:var(--accent); color:#151007; border-color:var(--accent-hi); }
.controlo input[type=range] { flex:1; accent-color:var(--accent); }
.controlo .rot { font-size:12px; color:var(--ink); white-space:nowrap; }
.painel { position:absolute; right:12px; top:12px; bottom:64px; width:460px; max-width:calc(100% - 24px); overflow:auto;
background:rgba(13,17,24,.97); border:1px solid var(--line); border-radius:10px; padding:12px 14px; z-index:5;
font-size:12.5px; color:var(--ink-hi); box-shadow:0 8px 30px rgba(0,0,0,.5); }
.painel[hidden] { display:none; }
.painel h3 { margin:0 0 2px; font-size:17px; }
.painel .sub { color:var(--ink); font-size:12px; margin:2px 0 10px; line-height:1.5; }
.painel .fechar { position:absolute; right:10px; top:8px; background:none; border:1px solid var(--detail); color:var(--ink);
border-radius:6px; cursor:pointer; font-size:14px; padding:1px 8px; }
.painel table { border-collapse:collapse; width:100%; }
.painel th { text-align:left; color:var(--ink); font-weight:600; border-bottom:1px solid var(--detail); padding:4px 5px; position:sticky; top:-12px; background:#0d1118; }
.painel td { border-bottom:1px solid #1a202a; padding:4px 5px; vertical-align:top; }
.painel td.n { text-align:right; font-family:Consolas, monospace; }
.painel i.bola { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:5px; }
.ajuda { position:absolute; right:12px; bottom:64px; font-size:11px; color:#4a5363; text-align:right; line-height:1.5; }
.credito { color:#3d4555; text-decoration:none; }
.credito:hover { color:var(--ink); }
.fase { stroke-width:2; stroke-dasharray:10 8; }
.fase-nome { font:700 40px "Segoe UI", sans-serif; letter-spacing:6px; opacity:.55; }
.atalho { fill:none; stroke:var(--line); stroke-width:1.2; stroke-dasharray:4 6; }
</style>
</head>
<body>
<svg id="mundo" role="img" aria-label="Linha de metro isométrica com os passos da importação. Cada carruagem é uma encomenda que anda de passo em passo nas datas reais.">
<defs>
<filter id="bloom" filterUnits="userSpaceOnUse" x="-3000" y="-3000" width="9000" height="9000"><feGaussianBlur stdDeviation="14"/></filter>
<filter id="glow" filterUnits="userSpaceOnUse" x="-3000" y="-3000" width="9000" height="9000">
<feGaussianBlur stdDeviation="3" result="b"/><feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge>
</filter>
</defs>
<g id="chao"></g>
<g id="linha"></g>
<g id="centro"></g>
<g id="cena"></g>
<g id="rotulos"></g>
</svg>
<div class="topo">
<div class="hud">
<div class="chip data">Data <b id="h-data">–</b></div>
<div class="chip" title="Encomendas que já começaram e ainda não deram entrada em armazém">Em curso <b id="h-curso">–</b></div>
<div class="chip" title="Encomendas que já deram entrada em armazém">No armazém <b id="h-arm">–</b></div>
<div class="chip alerta" title="Encomendas em curso sem nenhum passo novo há mais de 60 dias">Paradas > 60 dias <b id="h-paradas">–</b></div>
<div class="chip alerta" title="Movimentos para trás na linha: passos feitos fora da ordem do fluxo desenhado (ex.: sinal antes dos artworks confirmados)">Fora de ordem <b id="h-tras">–</b></div>
</div>
</div>
<div class="feed" id="feed"></div>
<div class="painel" id="painel" hidden></div>
<div class="legenda" id="legenda"></div>
<div class="ajuda">Clique numa estação para ver as encomendas que lá estão · Espaço = play/pausa · ← → = 1 semana<br>
<span id="gerado"></span> · <a class="credito" href="https://iso-glow.vercel.app" target="_blank" rel="noopener">estilo ISO-GLOW ↗</a></div>
<div class="controlo">
<button id="b-play" title="Play / pausa (espaço)">▶</button>
<button id="b-inicio" title="Voltar ao início">⏮</button>
<span class="rot">Velocidade</span>
<button class="vel" data-v="2">½×</button><button class="vel sel" data-v="4">1×</button>
<button class="vel" data-v="10">2×</button><button class="vel" data-v="25">5×</button>
<input type="range" id="tempo" min="0" max="100" step="1" value="0" aria-label="Data">
<span class="rot" id="t-fim">–</span>
<button id="b-hoje" title="Saltar para hoje (onde está cada encomenda agora)">Hoje</button>
<button id="b-dias" class="sel" title="Mostrar/esconder em cada carruagem há quantos dias está parada na estação">Dias parada</button>
</div>
<script>
"use strict";
const DADOS = {"estacoes":[{"k":"criada","nome":"Encomenda criada","curto":"Criada no AS400"},{"k":"art_env","nome":"Artworks enviados","curto":"Artworks enviados"},{"k":"art_conf","nome":"Artworks confirmados","curto":"Artworks confirmados"},{"k":"man_env","nome":"Manuais enviados","curto":"Manuais enviados"},{"k":"man_conf","nome":"Manuais confirmados","curto":"Manuais confirmados"},{"k":"sinal","nome":"Sinal 30% pago","curto":"Sinal 30%"},{"k":"carta","nome":"Carta de crédito","curto":"Carta de crédito"},{"k":"pronta","nome":"Mercadoria pronta","curto":"Mercadoria pronta"},{"k":"embarque","nome":"Embarque","curto":"Embarque"},{"k":"transito","nome":"Em trânsito","curto":"Em trânsito"},{"k":"pag_final","nome":"Pagamento final (70% / 100%, contra B/L)","curto":"Pagamento final"},{"k":"chegada","nome":"Chegada a Leixões","curto":"Chegada"},{"k":"armazem","nome":"Entrada em armazém","curto":"Armazém"}],"encomendas":[{"id":"03-011308","neg":"Tiago","forn":"YSP International","estado":"Confirmada","pi":"YP250616M"},{"id":"03-011338","neg":"Tiago","forn":"Uni-Power","estado":"KNK Trading","pi":"MAD2508"},{"id":"03-011460","neg":"Luís","forn":"Winner","estado":"KNK Trading","pi":"2025WIN1022"},{"id":"03-011524","neg":"Luís","forn":"Topwe","estado":"Confirmada","pi":"TL2511-2"},{"id":"03-011525","neg":"Tiago","forn":"Baoding Derun","estado":"Confirmada","pi":"DR20251216"},{"id":"03-011534","neg":"Tiago","forn":"Tripo","estado":"Confirmada","pi":"S26002-0107 S26017-0326"},{"id":"03-011561","neg":"Luís","forn":"Xinlei","estado":"Confirmada","pi":"26XL062"},{"id":"03-011601","neg":"Luís","forn":"Brace","estado":"Confirmada","pi":"2026BLS03027"},{"id":"03-011609","neg":"Luís","forn":"Jingtai","estado":"Confirmada","pi":"26JT-03-013"},{"id":"03-011612","neg":"Tiago","forn":"Tiya International","estado":"Confirmada","pi":"2651T0850"},{"id":"03-011614","neg":"Tiago","forn":"YSP International","estado":"Confirmada","pi":"YP260310M"},{"id":"03-011615","neg":"Luís","forn":"GD Tools","estado":"Confirmada","pi":"GF-1447-26"},{"id":"03-011622","neg":"Francisca","forn":"Xinruida","estado":"Confirmada","pi":"XRD2607415"},{"id":"03-011631","neg":"Luís","forn":"Siqiang","estado":"Confirmada","pi":"JOAO20260313"},{"id":"03-011644","neg":"Luís","forn":"Haofeng","estado":"Confirmada","pi":"TZHFLYY20260424"},{"id":"03-011647","neg":"Luís","forn":"Steed Machinery","estado":"Confirmada","pi":"202604pm-3B"},{"id":"03-011649","neg":"Luís","forn":"A&A Power","estado":"Confirmada","pi":"AA26-050101"},{"id":"03-011650","neg":"Luís","forn":"Oukai","estado":"Confirmada","pi":"JS251127"},{"id":"03-011651","neg":"Luís","forn":"Lusiqi","estado":"Confirmada","pi":"H251210"},{"id":"03-011652","neg":"Luís","forn":"Ka Protection","estado":"KNK Trading","pi":"KA20260506"},{"id":"03-011657","neg":"Luís","forn":"Winner","estado":"KNK Trading","pi":"2026WIN0513"},{"id":"03-011659","neg":"Luís","forn":"Homewell","estado":"KNK Trading","pi":"26EC0508"},{"id":"03-011660","neg":"Luís","forn":"Winner","estado":"KNK Trading","pi":"2026WIN0513"},{"id":"03-011661","neg":"Luís","forn":"Hong-Long","estado":"Confirmada","pi":"SCK032611"},{"id":"03-011662","neg":"Luís","forn":"Deshuo","estado":"Confirmada","pi":"DSS202605014"},{"id":"03-011664","neg":"Luís","forn":"Datang","estado":"KNK Trading","pi":"T20260512-5"},{"id":"03-011665","neg":"Luís","forn":"Xunuo","estado":"KNK Trading","pi":"250312"},{"id":"03-011666","neg":"Luís","forn":"Topwe","estado":"Confirmada","pi":"TL2511-2"},{"id":"03-011670","neg":"Luís","forn":"Folit","estado":"Confirmada","pi":"FH-HO202605280102"},{"id":"03-011671","neg":"Luís","forn":"Topair","estado":"Confirmada","pi":"TA20260122"},{"id":"03-011672","neg":"Luís","forn":"Homewell","estado":"KNK Trading","pi":"26EC0529"},{"id":"03-011679","neg":"Luís","forn":"Huiduo","estado":"Confirmada","pi":"HD2026060401"},{"id":"03-011680","neg":"Luís","forn":"Right Industry","estado":"Confirmada","pi":"27149 27147"},{"id":"03-011682","neg":"Luís","forn":"Meiqi","estado":"Confirmada","pi":"26MQET2601"},{"id":"03-011684","neg":"Luís","forn":"Sanneng","estado":"Confirmada","pi":"SNW26844"},{"id":"03-011687","neg":"Francisco","forn":"Geostar","estado":"Confirmada","pi":"GT-20260309-A034"},{"id":"03-011689","neg":"Luís","forn":"Ningbo Boyi","estado":"Confirmada","pi":"SA26193"},{"id":"03-011691","neg":"Luís","forn":"Unison","estado":"Confirmada","pi":"BD26-1212"},{"id":"03-011692","neg":"Francisco","forn":"Shandong CNMC","estado":"Confirmada","pi":"HTWXC20260511"},{"id":"03-011693","neg":"Luís","forn":"Anlu","estado":"Confirmada","pi":"XS2026052601"},{"id":"03-011697","neg":"Luís","forn":"Kysontec","estado":"Confirmada","pi":"KY-3401-26"},{"id":"03-011698","neg":"Francisco","forn":"KNK","estado":"Confirmada","pi":"2615402"},{"id":"03-011699","neg":"Francisco","forn":"Huiduo","estado":"Confirmada","pi":"YH2026032401"},{"id":"03-011700","neg":"Luís","forn":"Diligence","estado":"Confirmada","pi":"T123-2026001"},{"id":"03-011702","neg":"Francisca","forn":"Wenzhou Kaixun","estado":"Confirmada","pi":"AF2507009"},{"id":"03-011703","neg":"Luís","forn":"Sky-Eternity","estado":"Confirmada","pi":"T260069"},{"id":"03-011705","neg":"Larissa","forn":"KNK","estado":"Confirmada","pi":"2615405"},{"id":"03-011706","neg":"Larissa","forn":"Yaofeng","estado":"KNK Trading","pi":"XFMA2602"},{"id":"03-011707","neg":"Larissa","forn":"Judin","estado":"Confirmada","pi":"L2606016"},{"id":"03-011708","neg":"Larissa","forn":"Lilong","estado":"Confirmada","pi":"LPT202607"},{"id":"03-011709","neg":"Larissa","forn":"Sure Grand","estado":"Confirmada","pi":"260716"},{"id":"03-011710","neg":"Luís","forn":"Hangtao","estado":"Confirmada","pi":"26TT0630M&M"},{"id":"03-011711","neg":"Larissa","forn":"Kingson","estado":"Confirmada","pi":"KS-W260717"},{"id":"03-011712","neg":"Larissa","forn":"Yongsheng","estado":"Confirmada","pi":"JHYS20260720"},{"id":"03-011713","neg":"Luís","forn":"Winner","estado":"Confirmada","pi":"2026WIN0709"},{"id":"03-011714","neg":"Luís","forn":"Sichuan Machinery","estado":"Confirmada","pi":"5726CH0017"},{"id":"03-011715","neg":"Luís","forn":"Jinteng","estado":"Confirmada","pi":"R26PM002"},{"id":"03-011716","neg":"Luís","forn":"KNK","estado":"Confirmada","pi":"2615404"},{"id":"03-011717","neg":"Luís","forn":"PMD","estado":"Confirmada","pi":"S525226"},{"id":"03-011718","neg":"Luís","forn":"A&A Power","estado":"Confirmada","pi":"AA26-072501"},{"id":"03-011719","neg":"Luís","forn":"AllFly","estado":"Confirmada","pi":"AF260642MD"},{"id":"03-011720","neg":"Luís","forn":"KIRA","estado":"Confirmada","pi":"HC26927226"},{"id":"03-011722","neg":"Luís","forn":"Dalong","estado":"Confirmada","pi":"20260728"},{"id":"03-011723","neg":"Luís","forn":"Xunuo","estado":"KNK Trading","pi":"XN-260305"},{"id":"03-011724","neg":"Luís","forn":"Sansup","estado":"KNK Trading","pi":"SY2026073001"},{"id":"03-011725","neg":"Francisca","forn":"Huiduo","estado":"KNK Trading","pi":"FL2026103001A"},{"id":"03-011728","neg":"Luís","forn":"Ruitay","estado":"Confirmada","pi":"RT-20260801"},{"id":"03-011729","neg":"Luís","forn":"White Shark","estado":"KNK Trading","pi":"MADER15"},{"id":"03-011730","neg":"Luís","forn":"Haofeng","estado":"Confirmada","pi":"TZHFHFF20260424A TZHFHFF20260805A"},{"id":"03-011733","neg":"Luís","forn":"Brightever","estado":"KNK Trading","pi":"323-260807-394"},{"id":"03-011734","neg":"Larissa","forn":"Greatbull","estado":"Confirmada","pi":"HNJ260806"},{"id":"03-011736","neg":"Luís","forn":"Hong-Long","estado":"Confirmada","pi":"SCK032615"},{"id":"03-011737","neg":"Larissa","forn":"YSP","estado":"Confirmada","pi":"YP260810M"},{"id":"03-011738","neg":"Luís","forn":"Xinhaishengtang","estado":"Confirmada","pi":"JRC-260807"},{"id":"03-011739","neg":"Luís","forn":"Jinteng","estado":"Confirmada","pi":"R26PM003"},{"id":"03-011740","neg":"Luís","forn":"Kysontec","estado":"Confirmada","pi":"KY-3402-26"},{"id":"03-011741","neg":"Larissa","forn":"Feida","estado":"KNK Trading","pi":"FD-CTY26-01"},{"id":"03-011742","neg":"Larissa","forn":"Homewell","estado":"KNK Trading","pi":"26EC0817"},{"id":"03-011743","neg":"Luís","forn":"A&A Power","estado":"Confirmada","pi":"AA26-081102"},{"id":"03-011744","neg":"Luís","forn":"Jian de City","estado":"Confirmada","pi":"202608002"},{"id":"03-011745","neg":"Luís","forn":"Winner","estado":"KNK Trading","pi":"2026WIN0822"},{"id":"03-011746","neg":"Larissa","forn":"Wantong","estado":"Confirmada","pi":"WT-268AH066"},{"id":"03-011747","neg":"Larissa","forn":"Fly-Dragon","estado":"KNK Trading","pi":"FD20260820"},{"id":"03-011748","neg":"Luís","forn":"Haofeng","estado":"Confirmada","pi":"TZHFHHF20260822"},{"id":"03-011749","neg":"Luís","forn":"Ruitong","estado":"Confirmada","pi":"P260804"},{"id":"03-011750","neg":"Luís","forn":"Homewell","estado":"KNK Trading","pi":"26EC0825"},{"id":"03-011751","neg":"Luís","forn":"Flavic","estado":"Confirmada","pi":"26YCXMMA002"},{"id":"03-011752","neg":"Luís","forn":"Taizhou KA","estado":"KNK Trading","pi":"KA20260828"},{"id":"03-011754","neg":"Luís","forn":"Prowell","estado":"Confirmada","pi":"26A1760827001"},{"id":"03-011755","neg":"Luís","forn":"JiuLong","estado":"KNK Trading","pi":"30673"},{"id":"03-011756","neg":"Luís","forn":"Xunuo","estado":"KNK Trading","pi":"XN-260307"},{"id":"03-011758","neg":"Larissa","forn":"Vico","estado":"Confirmada","pi":"WK20260907"},{"id":"03-011759","neg":"Larissa","forn":"Vico","estado":"Confirmada","pi":"WK20260908"},{"id":"03-011760","neg":"Larissa","forn":"Vico","estado":"Confirmada","pi":"WK20260910"},{"id":"03-011761","neg":"Larissa","forn":"Grand Import","estado":"KNK Trading","pi":"2026090801"},{"id":"03-011762","neg":"Larissa","forn":"Huiduo","estado":"KNK Trading","pi":"WL202609801A"},{"id":"03-011763","neg":"Luís","forn":"Lusiqi","estado":"Confirmada","pi":"H251210"},{"id":"03-011764","neg":"Larissa","forn":"A&A Power","estado":"Confirmada","pi":"AA26-090501"},{"id":"03-011765","neg":"Larissa","forn":"A&A Power","estado":"Confirmada","pi":"AA26-090502"},{"id":"03-011766","neg":"Luís","forn":"Hong-Long","estado":"Confirmada","pi":"SCK032611"},{"id":"03-011767","neg":"Luís","forn":"Winner","estado":"KNK Trading","pi":"2026WIN0908"},{"id":"03-011768","neg":"Larissa","forn":"Lansor","estado":"KNK Trading","pi":"20260904"},{"id":"03-011770","neg":"Larissa","forn":"Bada","estado":"Confirmada","pi":"26BDC09323E"},{"id":"03-011771","neg":"Larissa","forn":"Hong-Long","estado":"Confirmada","pi":"SCK032615-2"},{"id":"03-011772","neg":"Larissa","forn":"Hong-Long","estado":"Confirmada","pi":"SCK032616"},{"id":"03-011773","neg":"Larissa","forn":"Grepo","estado":"Confirmada","pi":"MD260705"},{"id":"03-011774","neg":"Larissa","forn":"Kaixun","estado":"Confirmada","pi":"AF2609-Madeira"},{"id":"03-011777","neg":"Luís","forn":"Anlu","estado":"Confirmada","pi":"XS2026091501"},{"id":"03-011778","neg":"Larissa","forn":"Staxx","estado":"Confirmada","pi":"PI20261579"},{"id":"03-011780","neg":"Luís","forn":"Lawn and Garden","estado":"Confirmada","pi":"26HS093PT02S"},{"id":"03-011781","neg":"Sílvia","forn":"Homewell","estado":"KNK Trading","pi":"26EC0922"},{"id":"03-011782","neg":"Sílvia","forn":"Huiduo","estado":"KNK Trading","pi":"YL20260901A"},{"id":"03-011783","neg":"Larissa","forn":"Lida","estado":"Confirmada","pi":"2303-2609035"},{"id":"03-011784","neg":"Francisca","forn":"Jingtai","estado":"Confirmada","pi":"26JT-06-017"},{"id":"03-011785","neg":"Luís","forn":"Kingson","estado":"Confirmada","pi":"KS-W260727"},{"id":"03-011787","neg":"Larissa","forn":"Ouye","estado":"Confirmada","pi":"OYC0332603"},{"id":"03-011788","neg":"Sílvia","forn":"Homewell","estado":"KNK Trading","pi":"26EC0928"},{"id":"03-011789","neg":"Larissa","forn":"E-Shine","estado":"Confirmada","pi":"E20260925"},{"id":"03-011790","neg":"Larissa","forn":"Jingtai","estado":"Confirmada","pi":"PI26JT-09-004"},{"id":"03-011791","neg":"Luís","forn":"Hao Li","estado":"Confirmada","pi":"HLMA260801"},{"id":"03-011792","neg":"Luís","forn":"GTL Tools","estado":"Confirmada","pi":"2026PR528PT"},{"id":"03-011793","neg":"Sílvia","forn":"Tiya International","estado":"Confirmada","pi":"2651T3038"},{"id":"03-011794","neg":"Sílvia","forn":"Xunuo","estado":"KNK Trading","pi":"XN-260309"},{"id":"03-011795","neg":"Sílvia","forn":"Kysontec","estado":"Confirmada","pi":"KY-3403-26"},{"id":"03-011796","neg":"Larissa","forn":"Hongmei","estado":"Confirmada","pi":"HMPI202609039"},{"id":"03-011797","neg":"Larissa","forn":"Xunuo","estado":"KNK Trading","pi":"XN-260308"},{"id":"03-011798","neg":"Sílvia","forn":"Xunuo","estado":"KNK Trading","pi":"XN-260310"},{"id":"03-011799","neg":"Sílvia","forn":"Taizhou Huanyang","estado":"Confirmada","pi":"26HY571"},{"id":"03-011800","neg":"Sílvia","forn":"B.M.T. Tools","estado":"KNK Trading","pi":"A260910"},{"id":"03-011801","neg":"Larissa","forn":"Homewell","estado":"KNK Trading","pi":"26EC1009"},{"id":"03-011802","neg":"Larissa","forn":"Datang","estado":"KNK Trading","pi":"261010-150"},{"id":"03-011804","neg":"Sílvia","forn":"Homewell","estado":"KNK Trading","pi":"26EC1013"},{"id":"03-011805","neg":"Sílvia","forn":"Yuyao Road of Dragon","estado":"KNK Trading","pi":"LZLB261008"},{"id":"03-011806","neg":"Sílvia","forn":"Jian de City","estado":"Confirmada","pi":"202610003"},{"id":"03-011807","neg":"Larissa","forn":"Uni-Power","estado":"KNK Trading","pi":"UP3015"},{"id":"03-011808","neg":"Sílvia","forn":"Xi'an Haitu","estado":"Confirmada","pi":"HTI-260902-ADMR09"},{"id":"03-011809","neg":"Larissa","forn":"Sansup","estado":"KNK Trading","pi":"TC2026101301"},{"id":"03-011810","neg":"Larissa","forn":"Haomai","estado":"Confirmada","pi":"HM261013"},{"id":"03-011812","neg":"Larissa","forn":"Jinfeng","estado":"Confirmada","pi":"26KF147-01"},{"id":"03-011813","neg":"Sílvia","forn":"Runda","estado":"KNK Trading","pi":"RDY044-19"},{"id":"03-011814","neg":"Larissa","forn":"Kingxxel","estado":"Confirmada","pi":"20261014"},{"id":"03-011815","neg":"Larissa","forn":"Gaoyou","estado":"Confirmada","pi":"XS-26-0902"},{"id":"03-011816","neg":"Larissa","forn":"Jinlin","estado":"KNK Trading","pi":"JL261014"},{"id":"03-011817","neg":"Larissa","forn":"Xunuo","estado":"KNK Trading","pi":"XN-260311"},{"id":"03-011818","neg":"Larissa","forn":"Jeworld","estado":"KNK Trading","pi":"JW26LZ053"},{"id":"03-011819","neg":"Larissa","forn":"Datang","estado":"KNK Trading","pi":"T261013-3"},{"id":"03-011820","neg":"Sílvia","forn":"Haofeng","estado":"Confirmada","pi":"TZHFHHF20261015"},{"id":"03-011821","neg":"Larissa","forn":"Hong-Long","estado":"Confirmada","pi":"SCK032617"},{"id":"03-011823","neg":"Larissa","forn":"Lohuis","estado":"Confirmada","pi":"LHS2609039-HL"},{"id":"03-011824","neg":"Larissa","forn":"Lansi","estado":"Confirmada","pi":"26LS1016L"},{"id":"03-011825","neg":"Larissa","forn":"Xingchun","estado":"Confirmada","pi":"PI-26PT 01-3"},{"id":"03-011826","neg":"Larissa","forn":"Inall","estado":"Confirmada","pi":"MADER20261014001"},{"id":"03-011827","neg":"Larissa","forn":"Greatbull","estado":"Confirmada","pi":"HNJ261020"},{"id":"03-011828","neg":"Larissa","forn":"Shanghai Mandarin","estado":"Confirmada","pi":"SHM00266148"},{"id":"03-011829","neg":"Larissa","forn":"Hongmei","estado":"Confirmada","pi":"HMPI202610040"},{"id":"03-011830","neg":"Larissa","forn":"Steed","estado":"Confirmada","pi":"202610PM-4"},{"id":"03-011831","neg":"Sílvia","forn":"Right Industry","estado":"Confirmada","pi":"28035"},{"id":"03-011832","neg":"Larissa","forn":"Hong-Long","estado":"Confirmada","pi":"SCK032619"},{"id":"03-011833","neg":"Larissa","forn":"Lightning","estado":"Confirmada","pi":"LT261015-GB-1B"},{"id":"03-011834","neg":"Larissa","forn":"Walk-Long","estado":"Confirmada","pi":"Mad20261009"},{"id":"03-011835","neg":"Sílvia","forn":"Zhuiji Chichen","estado":"KNK Trading","pi":"XL2601014"},{"id":"03-011836","neg":"Larissa","forn":"Passionpower","estado":"Confirmada","pi":"26PC1023M&M"},{"id":"03-011837","neg":"Sílvia","forn":"Hongou","estado":"KNK Trading","pi":"MF20261020W01"},{"id":"03-011838","neg":"Larissa","forn":"Hangtao","estado":"Confirmada","pi":"26TT1020M&M"},{"id":"03-011839","neg":"Sílvia","forn":"Haichang","estado":"KNK Trading","pi":"HCSY260317"},{"id":"03-011840","neg":"Larissa","forn":"Winner","estado":"Confirmada","pi":"2026WIN1023"},{"id":"03-011841","neg":"Luís","forn":"Folit","estado":"Confirmada","pi":"FH-HO202605280102"},{"id":"03-011842","neg":"Sílvia","forn":"Homewell","estado":"KNK Trading","pi":"26EC1028"},{"id":"03-011843","neg":"Larissa","forn":"Hong-Long","estado":"Confirmada","pi":"SCK032620"},{"id":"03-011844","neg":"Larissa","forn":"Lilong","estado":"Confirmada","pi":"LPT202610"},{"id":"03-011845","neg":"Sílvia","forn":"Sansup","estado":"KNK Trading","pi":"SBG2026102801"},{"id":"03-011846","neg":"Sílvia","forn":"Judin","estado":"Confirmada","pi":"L2610016"},{"id":"03-011847","neg":"Larissa","forn":"Xinhaishengtang","estado":"Confirmada","pi":"JRC-261028"},{"id":"03-011848","neg":"Sílvia","forn":"Jian de City","estado":"Confirmada","pi":"202610004"},{"id":"03-011849","neg":"Larissa","forn":"Winner","estado":"Confirmada","pi":"2026WIN1101"},{"id":"03-011850","neg":"Larissa","forn":"Homewell","estado":"KNK Trading","pi":"26EC1102"},{"id":"03-011851","neg":"Larissa","forn":"Lansor","estado":"KNK Trading","pi":"20261102"},{"id":"03-011852","neg":"Larissa","forn":"KNK","estado":"Confirmada","pi":"2615406"},{"id":"03-011853","neg":"Larissa","forn":"Haofeng","estado":"Confirmada","pi":"TZHFHHF20261031"},{"id":"03-011854","neg":"Larissa","forn":"Sure Grand","estado":"Confirmada","pi":"261030"},{"id":"03-011855","neg":"Larissa","forn":"Vertak","estado":"KNK Trading","pi":"VK262741C"},{"id":"03-011857","neg":"Larissa","forn":"Ouye","estado":"Confirmada","pi":"OYC0332604"},{"id":"03-011858","neg":"Larissa","forn":"PMD","estado":"Confirmada","pi":"28-OCTOBER-2026"},{"id":"03-011859","neg":"Larissa","forn":"Staxx","estado":"Confirmada","pi":"PI20262006"},{"id":"03-011860","neg":"Larissa","forn":"Kaifeng","estado":"Confirmada","pi":"KFA261022"},{"id":"03-011861","neg":"Larissa","forn":"Nano-Metre","estado":"KNK Trading","pi":"2026-4767-Maderia-001-NM"},{"id":"03-011862","neg":"Larissa","forn":"Haofeng","estado":"Confirmada","pi":"TZHFHHF20261029"},{"id":"03-011863","neg":"Sílvia","forn":"Cixi Bojie Metal","estado":"Confirmada","pi":"RD261029"},{"id":"03-011865","neg":"Larissa","forn":"Fly-Dragon","estado":"KNK Trading","pi":"FD20261105"},{"id":"03-011867","neg":"Larissa","forn":"ABC Tools","estado":"Confirmada","pi":"C-202610JM"},{"id":"03-011868","neg":"Larissa","forn":"Tripo","estado":"Confirmada","pi":"S26057-1102"},{"id":"03-011869","neg":"Larissa","forn":"Zhiyi","estado":"Confirmada","pi":"ZY-20190125-A183"},{"id":"03-011870","neg":"Sílvia","forn":"Zhejiang Chaoyu Tools","estado":"KNK Trading","pi":"2026CY595"},{"id":"03-011871","neg":"Sílvia","forn":"Xiang Yang","estado":"KNK Trading","pi":"XY-261105"},{"id":"03-011872","neg":"Larissa","forn":"Runta","estado":"Confirmada","pi":"RT20260929"},{"id":"03-011873","neg":"Larissa","forn":"Winner","estado":"KNK Trading","pi":"2026WIN1105"},{"id":"03-011874","neg":"Larissa","forn":"Yayang","estado":"KNK Trading","pi":"YYG261110"},{"id":"03-011875","neg":"Larissa","forn":"Peach Blossom","estado":"KNK Trading","pi":"THYLY1106"},{"id":"03-011876","neg":"Larissa","forn":"Homewell","estado":"Confirmada","pi":"26EC1103"},{"id":"03-011877","neg":"Larissa","forn":"Newhero","estado":"KNK Trading","pi":"26NH111001"},{"id":"03-011878","neg":"Sílvia","forn":"Siqiang","estado":"Confirmada","pi":"JOAO20261102"}],"eventos":[[0,0,0],[13,0,1],[30,1,0],[128,2,0],[140,1,1],[140,2,1],[142,1,5],[142,2,5],[170,26,5],[180,3,0],[181,4,0],[203,5,0],[204,4,1],[208,5,1],[210,26,1],[217,3,1],[217,27,1],[229,6,0],[230,3,2],[230,27,2],[231,4,3],[240,18,5],[240,96,5],[253,26,3],[259,26,4],[260,26,2],[268,7,0],[272,6,1],[273,8,0],[273,9,0],[274,10,0],[274,11,0],[275,4,5],[279,5,2],[279,41,3],[282,12,0],[286,9,3],[288,13,0],[293,6,2],[293,10,1],[293,41,4],[293,44,1],[294,9,4],[294,17,1],[294,35,1],[295,6,3],[295,41,5],[300,45,3],[308,12,3],[309,9,5],[310,14,0],[313,15,0],[314,15,1],[315,8,1],[315,13,1],[315,16,0],[316,8,5],[316,17,5],[316,29,5],[320,11,1],[320,16,1],[320,17,0],[321,18,0],[321,43,1],[322,12,1],[322,16,3],[322,19,0],[323,14,3],[323,20,0],[328,12,2],[328,16,2],[328,45,1],[329,21,0],[329,22,0],[329,43,2],[330,19,5],[330,20,5],[330,21,5],[330,22,5],[330,23,0],[330,24,0],[330,25,0],[331,8,2],[331,16,4],[331,26,0],[331,27,0],[334,19,1],[334,20,1],[334,21,1],[334,22,1],[334,24,1],[334,25,1],[336,7,1],[336,14,5],[336,16,5],[337,7,2],[337,13,3],[337,24,3],[337,42,1],[338,12,4],[338,19,3],[338,20,3],[338,22,3],[338,43,3],[341,8,3],[342,41,1],[343,7,3],[343,19,2],[343,20,4],[343,22,4],[343,24,4],[343,41,2],[343,43,4],[344,12,5],[344,19,4],[344,28,0],[344,35,3],[344,43,5],[345,28,1],[345,29,1],[345,29,0],[345,166,1],[348,23,3],[348,99,3],[349,13,2],[349,18,1],[349,23,1],[349,30,0],[349,96,1],[349,99,1],[350,13,5],[350,23,5],[350,24,5],[350,25,5],[350,28,5],[350,35,2],[350,35,4],[350,35,5],[350,99,5],[350,166,5],[352,7,4],[352,31,0],[352,32,0],[356,29,3],[356,33,0],[358,4,4],[358,13,4],[358,20,2],[358,22,2],[358,24,2],[358,25,2],[358,34,0],[358,45,4],[359,7,5],[359,28,3],[359,30,1],[359,31,1],[359,33,5],[359,42,5],[359,166,3],[362,4,2],[362,17,3],[362,28,2],[362,42,3],[362,166,2],[363,23,2],[363,31,2],[363,33,1],[363,99,2],[364,23,4],[364,35,0],[364,99,4],[365,33,3],[366,30,5],[366,31,3],[366,32,3],[366,36,1],[366,45,5],[369,32,1],[370,0,7],[370,36,0],[371,14,1],[372,28,4],[372,31,4],[372,31,5],[372,37,0],[372,38,5],[372,166,4],[373,33,2],[373,38,0],[373,39,0],[373,109,1],[376,29,2],[376,37,1],[376,39,1],[378,44,3],[379,42,2],[379,109,3],[380,6,4],[380,29,4],[380,33,4],[380,42,4],[383,40,0],[384,32,4],[384,36,3],[384,37,3],[384,113,1],[385,38,1],[386,41,0],[386,42,0],[386,43,0],[386,44,0],[386,45,0],[390,32,2],[390,40,1],[391,46,0],[392,44,2],[392,47,0],[392,48,0],[392,49,0],[393,46,1],[393,46,5],[393,50,0],[394,46,3],[394,51,0],[394,52,0],[397,46,2],[397,47,1],[397,49,1],[397,50,1],[397,51,1],[397,53,0],[399,51,2],[399,52,1],[399,54,0],[400,55,0],[400,56,0],[401,8,4],[401,52,2],[401,57,0],[401,58,0],[404,33,7],[404,59,0],[404,60,0],[405,38,2],[405,61,0],[405,62,0],[405,63,0],[406,57,1],[407,46,4],[407,55,1],[407,64,0],[408,37,5],[408,49,5],[408,50,5],[408,51,5],[408,52,5],[408,59,1],[408,61,1],[408,63,5],[408,65,0],[410,23,7],[411,16,7],[411,54,1],[412,50,2],[412,57,2],[412,59,2],[412,60,1],[412,60,2],[412,62,1],[412,63,1],[412,66,0],[412,67,0],[413,33,8],[413,68,0],[415,69,0],[415,70,0],[415,71,0],[418,54,2],[419,11,2],[419,34,1],[419,48,1],[419,53,1],[419,64,1],[419,69,1],[419,72,0],[419,73,0],[420,70,1],[421,59,5],[421,63,2],[421,67,5],[421,68,1],[421,69,5],[421,113,5],[422,51,3],[422,55,2],[425,11,7],[425,30,2],[425,47,2],[425,58,1],[425,67,1],[425,71,1],[425,74,0],[426,51,4],[426,57,3],[426,59,3],[426,66,1],[426,72,1],[426,73,1],[426,75,0],[426,76,0],[426,77,0],[426,109,4],[426,113,3],[427,61,2],[427,78,0],[428,79,0],[429,15,3],[429,39,3],[429,40,3],[429,55,5],[429,57,5],[429,63,3],[429,74,1],[429,75,3],[429,113,2],[431,23,8],[431,23,9],[432,14,4],[432,15,4],[432,59,4],[432,61,3],[432,76,1],[432,77,1],[432,78,1],[432,80,1],[432,80,0],[432,81,0],[432,82,0],[432,113,4],[433,15,2],[433,70,3],[433,83,0],[433,84,0],[434,18,7],[434,29,7],[434,43,8],[434,53,3],[434,75,1],[434,85,0],[435,16,8],[435,16,9],[435,61,4],[435,119,1],[436,15,5],[436,21,2],[436,34,3],[436,36,4],[436,48,2],[436,54,5],[436,61,5],[436,62,2],[436,68,5],[436,70,2],[436,70,4],[436,71,5],[436,72,2],[436,80,2],[436,82,1],[436,86,0],[436,87,0],[438,27,7],[439,36,2],[439,43,9],[440,39,4],[440,44,4],[440,63,4],[440,114,1],[441,38,3],[441,57,4],[441,62,3],[442,40,2],[443,36,5],[443,39,5],[443,40,4],[443,44,5],[443,58,5],[443,60,5],[443,66,5],[443,70,5],[443,73,5],[443,76,5],[443,77,5],[443,80,5],[443,82,5],[443,85,5],[443,87,5],[443,88,0],[444,14,7],[445,1,8],[445,1,9],[445,7,8],[445,7,9],[445,24,8],[445,24,9],[445,31,8],[445,31,9],[446,78,3],[446,89,0],[446,90,0],[447,12,8],[447,71,3],[447,91,0],[447,92,0],[447,93,0],[447,94,0],[447,95,0],[447,96,0],[447,97,0],[447,98,0],[447,99,0],[447,119,3],[448,40,5],[448,62,4],[448,68,3],[448,74,3],[448,78,5],[448,89,5],[448,90,5],[448,94,5],[448,95,5],[448,97,5],[448,98,5],[448,100,0],[448,101,0],[449,19,8],[449,56,3],[450,74,2],[450,79,3],[450,83,3],[450,102,0],[451,18,8],[451,18,9],[453,4,8],[453,4,9],[453,19,9],[453,56,1],[453,103,0],[453,104,0],[453,105,0],[453,106,0],[454,53,2],[454,64,2],[454,66,2],[454,67,2],[454,73,2],[454,78,4],[454,79,1],[454,82,3],[454,84,1],[454,86,3],[454,87,1],[454,87,3],[454,89,1],[454,94,1],[454,100,1],[454,109,2],[455,68,4],[455,74,4],[455,75,4],[455,86,1],[456,75,5],[456,107,0],[456,108,0],[456,114,2],[456,120,1],[457,94,3],[457,109,5],[457,120,3],[460,9,7],[460,11,8],[460,95,3],[460,109,0],[461,34,2],[461,34,6],[461,71,2],[461,76,2],[461,77,2],[461,79,2],[461,85,1],[461,87,2],[461,89,2],[461,90,1],[461,91,1],[461,91,3],[461,92,1],[461,92,3],[461,94,2],[461,95,1],[461,97,3],[461,98,3],[461,100,2],[461,101,1],[461,103,1],[461,106,1],[462,14,8],[462,20,8],[462,20,9],[462,26,8],[462,26,9],[462,27,8],[462,27,9],[462,32,8],[462,32,9],[462,41,8],[462,41,9],[462,84,3],[462,97,1],[462,98,1],[462,99,8],[462,99,9],[462,103,3],[462,106,3],[462,110,0],[463,53,4],[463,53,5],[463,83,5],[463,97,2],[463,98,2],[463,111,0],[463,112,0],[463,114,5],[463,119,2],[464,28,8],[464,28,9],[464,40,7],[464,50,8],[464,50,9],[464,71,4],[464,82,4],[464,86,4],[464,87,4],[464,94,4],[464,95,4],[464,97,4],[464,98,4],[464,108,3],[464,113,0],[467,56,2],[467,56,4],[467,81,1],[467,83,1],[467,85,2],[467,95,2],[467,102,1],[467,103,4],[467,108,1],[467,110,1],[467,111,1],[467,114,0],[467,115,0],[467,120,4],[468,88,3],[468,102,3],[468,104,3],[468,116,0],[468,117,0],[468,118,0],[468,119,0],[468,120,0],[469,88,1],[469,121,0],[469,122,0],[469,141,1],[470,38,8],[470,38,9],[470,100,5],[470,101,5],[470,103,5],[470,104,5],[470,110,5],[470,111,5],[470,115,5],[470,125,5],[471,45,7],[471,105,1],[471,107,3],[475,13,8],[475,13,9],[475,107,1],[475,111,2],[475,116,1],[475,117,1],[475,121,1],[475,122,1],[475,123,0],[475,124,0],[475,125,1],[475,125,0],[476,107,5],[476,117,5],[476,119,4],[476,121,5],[476,124,5],[477,17,2],[477,17,4],[477,35,8],[477,35,9],[477,126,0],[477,127,0],[477,128,0],[478,84,2],[478,111,3],[478,120,2],[478,121,3],[478,129,0],[478,130,0],[478,141,2],[480,9,8],[480,9,9],[481,68,8],[481,68,9],[481,131,0],[481,132,0],[481,133,0],[482,117,3],[482,134,0],[482,135,0],[483,111,4],[483,115,3],[483,136,0],[483,137,0],[483,138,0],[483,139,0],[483,140,0],[483,141,3],[483,141,0],[483,142,0],[483,143,0],[484,29,8],[484,29,9],[484,73,7],[484,110,2],[484,121,2],[484,124,1],[484,125,2],[484,128,1],[484,129,1],[484,130,1],[484,144,0],[484,145,0],[484,146,0],[485,11,10],[485,79,4],[485,91,4],[485,92,4],[485,106,4],[485,107,4],[485,108,4],[485,116,5],[485,119,5],[485,120,5],[485,122,5],[485,126,5],[485,128,5],[485,129,5],[485,130,5],[485,131,5],[485,132,5],[485,134,5],[485,139,5],[485,141,4],[485,142,5],[485,143,5],[485,147,0],[485,148,0],[485,149,0],[488,73,8],[488,84,4],[488,114,3],[488,150,0],[488,151,0],[489,46,7],[489,51,7],[489,82,2],[489,101,2],[489,130,2],[489,131,1],[489,132,1],[489,139,1],[489,142,1],[489,143,1],[489,144,1],[489,145,1],[489,152,0],[489,153,0],[489,154,0],[489,158,1],[490,112,3],[490,114,4],[490,121,4],[490,123,3],[490,124,3],[490,133,3],[490,139,3],[490,142,3],[490,147,3],[490,154,1],[490,155,1],[490,155,0],[490,156,0],[490,157,0],[491,39,8],[491,84,5],[491,105,3],[491,141,5],[491,147,1],[491,147,5],[491,148,1],[491,156,3],[491,158,0],[491,159,0],[491,160,0],[492,112,4],[492,127,3],[492,135,3],[492,161,0],[492,162,0],[492,163,0],[492,164,0],[495,15,7],[495,134,1],[495,149,1],[495,155,2],[495,156,1],[496,162,1],[496,165,0],[496,166,0],[497,33,11],[497,40,8],[497,81,2],[497,83,2],[497,88,4],[497,108,2],[497,116,2],[497,123,1],[497,129,2],[497,133,1],[497,134,2],[497,140,1],[497,142,2],[497,144,2],[497,149,2],[497,149,3],[497,150,1],[497,150,3],[497,155,3],[497,156,2],[497,158,2],[497,159,1],[497,160,1],[497,162,2],[497,167,0],[497,168,0],[498,91,5],[498,92,5],[498,106,5],[498,108,5],[498,136,5],[498,144,5],[498,145,5],[498,158,5],[498,160,5],[498,162,5],[498,164,5],[499,33,12],[499,86,2],[499,148,2],[499,169,0],[499,170,0],[499,171,0],[499,172,0],[499,173,0],[500,8,8],[500,110,7],[501,15,8],[502,104,1],[502,126,1],[502,128,2],[502,140,2],[502,142,4],[502,150,2],[502,155,4],[502,174,0],[502,175,0],[502,176,0],[503,44,7],[503,51,8],[503,75,2],[503,91,2],[503,92,2],[503,133,2],[503,133,4],[503,135,4],[503,146,1],[503,147,2],[503,154,3],[503,164,1],[503,167,1],[503,168,3],[503,177,0],[503,178,0],[503,179,0],[504,88,2],[504,102,2],[504,152,1],[504,180,0],[504,181,0],[504,182,0],[504,183,0],[505,12,11],[505,17,7],[505,60,7],[505,65,5],[505,88,5],[505,123,5],[505,154,5],[505,155,5],[505,157,5],[505,167,5],[505,168,5],[505,169,5],[505,170,5],[505,175,5],[505,176,5],[505,180,5],[505,184,0],[505,194,5],[506,185,0],[506,186,0],[506,187,0],[506,188,0],[506,189,0],[506,190,0],[506,191,0],[507,49,7],[509,0,8],[509,6,8],[509,11,11],[509,12,12],[509,34,4],[509,42,8],[509,45,8],[509,46,8],[509,48,8],[509,52,8],[509,54,8],[509,57,8],[509,58,2],[509,70,8],[509,71,8],[509,83,4],[509,96,8],[509,103,7],[509,114,8],[509,146,3],[509,147,4],[509,150,4],[509,166,8],[509,168,4],[509,192,0],[509,193,0],[510,36,7],[510,59,7],[510,83,7],[510,113,7],[510,123,2],[510,168,1],[510,168,2],[510,194,0],[510,195,0],[510,196,0],[510,197,0],[510,198,0],[510,199,0],[511,200,0],[514,13,11],[516,11,12],[516,18,11],[518,17,8]],"inicio":"2025-06-18","dias":519,"gerado":"19/11/2026 05:40","ignoradas":[]};
// ---------------------------------------------------------------- kernel isométrico (iso-glow, como no mapa dos agentes)
const C = Math.cos(Math.PI / 6), S = Math.sin(Math.PI / 6);
const P = (x, y, z) => [(x - y) * C, (x + y) * S - z];
const plane = (O, U, V) => { const o = P(...O), u = P(...U), v = P(...V);
return `matrix(${u[0]} ${u[1]} ${v[0]} ${v[1]} ${o[0]} ${o[1]})`; };
const TOP = (x, y, z) => plane([x, y, z], [1, 0, 0], [0, 1, 0]);
const FRONT = (x, y, z) => plane([x, y, z], [1, 0, 0], [0, 0, -1]);
const SIDE = (x, y, z) => plane([x, y, z], [0, -1, 0], [0, 0, -1]);
const f1 = n => n.toFixed(1);
const pts = l => l.map(p => P(...p).map(f1).join(",")).join(" ");
const poly = (l, cls, extra = "") => `<polygon class="${cls}" points="${pts(l)}" ${extra}/>`;
function caixa(x, y, z, w, d, h, cls = "") {
return poly([[x, y + d, z], [x + w, y + d, z], [x + w, y + d, z + h], [x, y + d, z + h]], "face " + cls)
+ poly([[x + w, y, z], [x + w, y + d, z], [x + w, y + d, z + h], [x + w, y, z + h]], "face " + cls)
+ poly([[x, y, z + h], [x + w, y, z + h], [x + w, y + d, z + h], [x, y + d, z + h]], "face top " + cls);
}
const esc = t => String(t ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
const caminho = l => "M" + l.map(p => { const q = P(...p); return f1(q[0]) + " " + f1(q[1]); }).join(" L");
if (!DADOS) { document.body.innerHTML = "<p style='padding:20px'>Sem dados. Gere esta página com metro/construir_metro.py.</p>"; throw new Error("sem dados"); }
// ---------------------------------------------------------------- dados
const EST = DADOS.estacoes, N = EST.length, ENC = DADOS.encomendas, EVT = DADOS.eventos, DIAS = DADOS.dias;
const ARM = EST.findIndex(e => e.k === "armazem");
const D0 = new Date(DADOS.inicio + "T00:00:00");
const dataDe = d => { const x = new Date(D0.getTime() + d * 86400000); return x.toLocaleDateString("pt-PT"); };
const NEG = [...new Set(ENC.map(e => e.neg))].sort((a, b) => ENC.filter(e => e.neg === b).length - ENC.filter(e => e.neg === a).length);
const PALETA = ["#4ea1ff", "#ffb347", "#5fd38d", "#c792ea", "#f0645a", "#2ec4c4", "#f2c94c", "#9aa5b8", "#ff7eb6", "#b5e48c"];
const COR = {}; NEG.forEach((n, i) => COR[n] = PALETA[i % PALETA.length]);
const visivel = {}; NEG.forEach(n => visivel[n] = true);
document.getElementById("gerado").textContent = "Dados de " + dataDe(0) + " a " + dataDe(DIAS) + " · gerado a " + DADOS.gerado;
// ---------------------------------------------------------------- planta: linha com ramais paralelos e fases
// Coordenadas no chão (x, y). Fase 1 (Interno MADER) ao longo de x, com os ramais Artworks e Manuais lado a lado
// que se juntam no Sinal; fase 2 (Fornecedor) desce ao longo de y; fase 3 (Transporte e armazém) volta ao longo de -x.
const R2 = Math.SQRT1_2;
// as posições escrevem-se em coordenadas do ecrã (sx para a direita, sy para baixo) e passam para o chão isométrico
const W = (sx, sy) => [(sx + sy) * R2, (sy - sx) * R2];
const CIMA = W(0, -1), BAIXO = W(0, 1), ESQ = W(-1, 0);
const est_ = (sx, sy, q, bx, by) => ({ pos: W(sx, sy), q, b: W(bx, by) });
const LINHA2 = 1020; // altura da segunda linha (fase 3, volta da direita para a esquerda)
const PLANTA = { // pos = estação; q = para onde cresce a fila; b = onde fica o edifício (desvio em relação à estação)
criada: est_(0, 0, CIMA, -170, 60),
art_env: est_(330, -340, CIMA, 0, 110),
art_conf: est_(660, -340, CIMA, 0, 110),
man_env: est_(330, 340, BAIXO, 0, -110),
man_conf: est_(660, 340, BAIXO, 0, -110),
sinal: est_(1050, 0, CIMA, 0, 140),
carta: est_(1200, 520, W(1, 0), -130, 0),
pronta: est_(1600, 0, CIMA, 0, 140),
embarque: est_(1600, LINHA2, BAIXO, 0, -150),
transito: est_(1240, LINHA2, BAIXO, 0, -150),
pag_final: est_(880, LINHA2, BAIXO, 0, -150),
chegada: est_(520, LINHA2, BAIXO, 0, -150),
armazem: est_(160, LINHA2, BAIXO, 0, -150),
};
const LIGA = [["criada", "art_env"], ["art_env", "art_conf"], ["art_conf", "sinal"],
["criada", "man_env"], ["man_env", "man_conf"], ["man_conf", "sinal"],
["sinal", "pronta"], ["sinal", "carta"], ["carta", "pronta"], ["pronta", "embarque"],
["embarque", "transito"], ["transito", "pag_final"], ["pag_final", "chegada"], ["chegada", "armazem"]];
const ATALHO = [["art_env", "man_env"], ["art_conf", "man_conf"]]; // passagens entre ramais (tracejado)
const FASES = [ // retângulos no ecrã: sx0, sy0, sx1, sy1
{ nome: "INTERNO MADER", cor: "#4ea1ff", r: [-330, -720, 1330, 690] },
{ nome: "FORNECEDOR", cor: "#ffb347", r: [1330, -720, 1880, 690] },
{ nome: "TRANSPORTE E ARMAZÉM", cor: "#5fd38d", r: [-330, 710, 1880, 1380] },
];
const IDX = {}; EST.forEach((e, i) => IDX[e.k] = i);
const POS = EST.map(e => PLANTA[e.k].pos), TAM = 84;
const gChao = document.getElementById("chao"), gLinha = document.getElementById("linha"), gCena = document.getElementById("cena"),
gRot = document.getElementById("rotulos"), gCentro = document.getElementById("centro");
// grafo da linha (para o caminho das carruagens) e ordem desenhada (para saber o que é "fora de ordem")
const VIZ = EST.map(() => []);
for (const [a, b] of LIGA.concat(ATALHO)) { VIZ[IDX[a]].push(IDX[b]); VIZ[IDX[b]].push(IDX[a]); }
const rota = (a, b) => { // caminho mais curto pela linha (BFS)
const ant = new Array(N).fill(-1), vist = new Array(N).fill(false), fila_ = [a]; vist[a] = true;
while (fila_.length) { const u = fila_.shift(); if (u === b) break;
for (const v of VIZ[u]) if (!vist[v]) { vist[v] = true; ant[v] = u; fila_.push(v); } }
const l = [b]; while (l[0] !== a && ant[l[0]] >= 0) l.unshift(ant[l[0]]); return l;
};
const DEPOIS = EST.map(() => new Set()); // estações que, no fluxo desenhado, vêm depois de cada uma
{ const seg = EST.map(() => []); for (const [a, b] of LIGA) seg[IDX[a]].push(IDX[b]);
for (let k = 0; k < N; k++) { const pilha = [...seg[k]]; while (pilha.length) { const v = pilha.pop();
if (!DEPOIS[k].has(v)) { DEPOIS[k].add(v); pilha.push(...seg[v]); } } } }
// chão e zonas das fases
const ret = ([a, b, c, d], z = 0) => [W(a, b), W(c, b), W(c, d), W(a, d)].map(([x, y]) => [x, y, z]);
const HORIZ = (sx, sy) => { const [x, y] = W(sx, sy); return plane([x, y, 0], [R2, -R2, 0], [R2, R2, 0]); };
gChao.innerHTML = poly(ret([-380, -780, 1930, 1440]), "face top chao")
+ FASES.map(f => poly(ret(f.r), "fase", `style="fill:${f.cor};fill-opacity:.05;stroke:${f.cor};stroke-opacity:.4"`)).join("")
+ FASES.map(f => `<g transform="${HORIZ(f.r[0] + 30, f.nome !== "INTERNO MADER" ? f.r[1] + 60 : f.r[3] - 25)}"><text class="fase-nome" fill="${f.cor}">${f.nome}</text></g>`).join("");
// carris: dois carris e travessas em cada troço; setas no sentido do fluxo
function troco(a, b, cls) {
const [x0, y0] = a, [x1, y1] = b, L = Math.hypot(x1 - x0, y1 - y0), ux = (x1 - x0) / L, uy = (y1 - y0) / L, nx = -uy, ny = ux;
let s = "";
if (cls !== "atalho") {
for (let t = 0; t <= L; t += 16) { const p0 = P(x0 + ux * t + nx * 13, y0 + uy * t + ny * 13, 0), p1 = P(x0 + ux * t - nx * 13, y0 + uy * t - ny * 13, 0);
s += `<line class="travessa" x1="${f1(p0[0])}" y1="${f1(p0[1])}" x2="${f1(p1[0])}" y2="${f1(p1[1])}"/>`; }
for (const o of [7, -7]) s += `<path class="carril" d="${caminho([[x0 + nx * o, y0 + ny * o, 0], [x1 + nx * o, y1 + ny * o, 0]])}"/>`;
const mx = (x0 + x1) / 2, my = (y0 + y1) / 2, c = (s_, u) => [mx + ux * s_ + nx * u, my + uy * s_ + ny * u, 1];
s += poly([c(10, 0), c(-7, 7), c(-7, -7)], "seta-linha");
} else s += `<path class="atalho" d="${caminho([[x0, y0, 0], [x1, y1, 0]])}"/>`;
return s;
}
gLinha.innerHTML = ATALHO.map(([a, b]) => troco(PLANTA[a].pos, PLANTA[b].pos, "atalho")).join("")
+ LIGA.map(([a, b]) => troco(PLANTA[a].pos, PLANTA[b].pos)).join("");
{ const [x, y] = P(...W(560, 1290), 0);
gCentro.innerHTML = `<text class="centro data" id="centro-data" x="${f1(x)}" y="${f1(y)}">–</text>`; }
// estações: edifício baixo ao lado da linha, com janelas que acendem quando chega uma encomenda
const ALT = [], BASE = [];
function estacaoSvg(k, x, y) {
const w = TAM, d = TAM, h = 44 + (k % 3) * 10;
let fr = `<rect class="detail" x="6" y="4" width="${w - 12}" height="16" rx="2"/><text class="num" x="${w / 2}" y="17" text-anchor="middle">${String(k + 1).padStart(2, "0")}</text>`;
for (let u = 8; u < w - 12; u += 20) fr += `<rect class="win j-${k}" x="${u}" y="26" width="14" height="${h - 34}" rx="1.5"/>`;
let ld = "";
for (let u = 8; u < d - 12; u += 20) ld += `<rect class="win j-${k}" x="${u}" y="12" width="14" height="${h - 20}" rx="1.5"/>`;
ALT[k] = h;
return caixa(x, y, 0, w, d, h) + `<g transform="${FRONT(x, y + d, h)}">${fr}</g><g transform="${SIDE(x + w, y + d, h)}">${ld}</g>`
+ `<g transform="${TOP(x, y, h)}"><rect class="detail" x="6" y="6" width="${w - 12}" height="${d - 12}" rx="2"/></g>`;
}
const NOS = []; // nós da cena (edifícios e carruagens) com a profundidade
for (let k = 0; k < N; k++) {
const pl = PLANTA[EST[k].k], cx = pl.pos[0] + pl.b[0], cy = pl.pos[1] + pl.b[1], x = cx - TAM / 2, y = cy - TAM / 2;
BASE[k] = [cx, cy];
const [hx, hy] = P(cx, cy, 0), g = document.createElementNS("http://www.w3.org/2000/svg", "g");
const corpo = estacaoSvg(k, x, y);
g.setAttribute("class", "estacao"); g.dataset.k = k;
g.innerHTML = `<title>${esc(EST[k].nome)}</title>`
+ poly([[x - 12, y - 12, 1], [x + TAM + 12, y - 12, 1], [x + TAM + 12, y + TAM + 12, 1], [x - 12, y + TAM + 12, 1]], "pegada", `id="peg-${k}"`)
+ `<ellipse class="halo" id="halo-${k}" cx="${f1(hx)}" cy="${f1(hy - ALT[k] / 2)}" rx="${TAM * 1.1}" ry="${ALT[k] * .9 + 24}" filter="url(#bloom)"/>`
+ corpo;
gCena.appendChild(g);
NOS.push({ el: g, prof: cx + cy + TAM / 2 });
}
const ROT_BAIXO = k => PLANTA[EST[k].k].q === CIMA, ROT_Y = [], ROT_X = [];
let rot = "";
for (let k = 0; k < N; k++) {
const [cx, cy] = BASE[k], [lx] = P(cx, cy, 0), [, ty] = P(cx - TAM / 2, cy - TAM / 2, ALT[k]);
// fila para cima: o rótulo vai por baixo do edifício, para não ficar por cima das carruagens
// ramais (artworks e manuais): rótulo à direita do edifício; fila para cima: por baixo; resto: por cima
const lado = /^(art|man)_/.test(EST[k].k), esq = EST[k].k === "carta"; // carta: rótulo à esquerda
const yc = lado || esq ? P(cx, cy, ALT[k] / 2)[1] + 40 : ROT_BAIXO(k) ? P(cx + TAM / 2, cy + TAM / 2, 0)[1] + 118 : ty - 14;
const xc = lado ? P(cx + TAM / 2, cy - TAM / 2, 0)[0] + 22 : esq ? P(cx - TAM / 2, cy + TAM / 2, 0)[0] - 22 : lx,
al = lado ? ` style="text-anchor:start"` : esq ? ` style="text-anchor:end"` : "";
ROT_Y[k] = yc; ROT_X[k] = lado ? xc + 150 : esq ? xc - 150 : lx;
rot += `<text class="conta" id="conta-${k}" x="${f1(xc)}" y="${f1(yc - 60)}"${al}>0</text>`
+ `<text class="nome" x="${f1(xc)}" y="${f1(yc - 26)}"${al}>${esc(EST[k].curto)}</text>`
+ `<text class="dias" id="dias-${k}" x="${f1(xc)}" y="${f1(yc)}"${al}></text>`;
}
gRot.innerHTML = rot;
gRot.style.pointerEvents = "none";
// ---------------------------------------------------------------- carruagens (uma por encomenda)
const PW = 15, PH = 11, COLS = 6, PASSO_FILA = 36;
function lugar(k, j) { // j-ésimo lugar na fila da estação k, do lado de fora da linha
const pl = PLANTA[EST[k].k], q = pl.q, t = [-q[1], q[0]];
const lin = Math.floor(j / COLS), col = j % COLS, bx = pl.pos[0] + q[0] * 48, by = pl.pos[1] + q[1] * 48;
return [bx + t[0] * (col - (COLS - 1) / 2) * PASSO_FILA + q[0] * lin * PASSO_FILA,
by + t[1] * (col - (COLS - 1) / 2) * PASSO_FILA + q[1] * lin * PASSO_FILA];
}
(function enquadrar() {
const l = [];
for (let k = 0; k < N; k++) {
const [cx, cy] = BASE[k];
for (const [dx, dy] of [[-1, -1], [1, -1], [1, 1], [-1, 1]]) l.push(P(cx + dx * TAM / 2, cy + dy * TAM / 2, 0));
l.push(P(cx - TAM / 2, cy - TAM / 2, ALT[k] + 110));
l.push([ROT_X[k] - 150, ROT_Y[k] - 90], [ROT_X[k] + 150, ROT_Y[k] + 10]);
for (const j of [0, COLS - 1, COLS * 5, COLS * 6 - 1]) l.push(P(...lugar(k, j), 30));
}
const xs = l.map(p => p[0]), ys = l.map(p => p[1]);
const x0 = Math.min(...xs) - 30, y0 = Math.min(...ys) - 110, x1 = Math.max(...xs) + 30, y1 = Math.max(...ys) + 150;
const svg = document.getElementById("mundo");
svg.setAttribute("viewBox", `${f1(x0)} ${f1(y0)} ${f1(x1 - x0)} ${f1(y1 - y0)}`);
svg.setAttribute("preserveAspectRatio", "xMidYMid meet");
})();
function escurece(hex, f) {
const n = parseInt(hex.slice(1), 16), c = s => Math.round(((n >> s) & 255) * f);
return `rgb(${c(16)},${c(8)},${c(0)})`;
}
const TONS = {};
function podSvg(x, y, cor, tras) {
const h = PW / 2, b = [[x - h, y - h, 2], [x + h, y - h, 2], [x + h, y + h, 2], [x - h, y + h, 2]], t = b.map(([a, c]) => [a, c, 2 + PH]);
const cl = "pod" + (tras ? " pod-tras" : ""), tn = TONS[cor] || (TONS[cor] = [escurece(cor, .72), escurece(cor, .55)]);
return poly([b[3], b[2], t[2], t[3]], cl, `fill="${tn[0]}"`)
+ poly([b[1], b[2], t[2], t[1]], cl, `fill="${tn[1]}"`)
+ poly(t, cl, `fill="${cor}"`);
}
// estado de cada encomenda
const pod = ENC.map((e, i) => ({ i, est: -1, desde: 0, x: 0, y: 0, pronto: false, viagem: null, tras: false, vistas: new Set(), el: null }));
const fila = Array.from({ length: N }, () => []);
let dia = 0, iEvt = 0, aTocar = false, vel = 4, ultimoT = null, foraOrdem = 0, verDias = true;
const VEL_PX = 0.9; // velocidade das carruagens na linha (unidades por ms)
function sair(p) { if (p.est >= 0) { const f = fila[p.est], j = f.indexOf(p.i); if (j >= 0) f.splice(j, 1); } }
function aplicar(e, animar) { // e = [dia, encomenda, estação]
const p = pod[e[1]], de = p.est, para = e[2];
if (de === para) return;
// fora de ordem: a encomenda já passou por uma estação que, no fluxo desenhado, vem depois desta
const tras = de >= 0 && [...p.vistas].some(v => DEPOIS[para].has(v));
if (tras) foraOrdem++;
sair(p);
p.est = para; p.desde = e[0]; p.tras = tras; p.vistas.add(para);
fila[para].push(p.i);
if (animar && de >= 0 && visivel[ENC[p.i].neg]) {
const r = rota(de, para), pts = [[p.x, p.y], ...r.map(k => POS[k])];
let L = 0; const cum = [0]; for (let j = 1; j < pts.length; j++) { L += Math.hypot(pts[j][0] - pts[j - 1][0], pts[j][1] - pts[j - 1][1]); cum.push(L); }
p.viagem = { pts, cum, L, t0: performance.now(), dur: Math.min(2600, 500 + L / VEL_PX) };
feed(p, de, para, e[0], tras);
} else { p.viagem = null; p.pronto = false; }
if (animar && visivel[ENC[p.i].neg]) acende(para);
}
function irPara(d) {
for (const p of pod) { p.est = -1; p.viagem = null; p.pronto = false; p.tras = false; p.vistas = new Set(); }
fila.forEach(f => f.length = 0);
foraOrdem = 0; iEvt = 0;
while (iEvt < EVT.length && EVT[iEvt][0] <= d) aplicar(EVT[iEvt++], false);
dia = d;
document.getElementById("feed").innerHTML = "";
}
// ---------------------------------------------------------------- desenho
const halosT = {};
function acende(k) {
document.getElementById("halo-" + k).classList.add("hot");
document.querySelectorAll(".j-" + k).forEach(w => w.classList.add("hot"));
clearTimeout(halosT[k]);
halosT[k] = setTimeout(() => { document.getElementById("halo-" + k).classList.remove("hot");
document.querySelectorAll(".j-" + k).forEach(w => w.classList.remove("hot")); }, 700);
}
const mediana = l => { if (!l.length) return null; const s = [...l].sort((a, b) => a - b), m = s.length >> 1; return s.length % 2 ? s[m] : (s[m - 1] + s[m]) / 2; };
function posViagem(p, agora, alvo) { // segue os troços da rota e no fim entra no lugar da fila
const v = p.viagem, q0 = Math.min(1, (agora - v.t0) / v.dur), q = q0 < .5 ? 2 * q0 * q0 : 1 - (-2 * q0 + 2) ** 2 / 2;
if (q > .92) { const r = (q - .92) / .08, e = v.pts[v.pts.length - 1]; return [e[0] + (alvo[0] - e[0]) * r, e[1] + (alvo[1] - e[1]) * r]; }
const s = v.L * q / .92;
let j = 1; while (j < v.cum.length - 1 && v.cum[j] < s) j++;
const a = v.pts[j - 1], b = v.pts[j], seg = (v.cum[j] - v.cum[j - 1]) || 1, r = Math.min(1, (s - v.cum[j - 1]) / seg);
return [a[0] + (b[0] - a[0]) * r, a[1] + (b[1] - a[1]) * r];
}
function noPod(p) {
if (!p.el) { p.el = document.createElementNS("http://www.w3.org/2000/svg", "g"); p.el.setAttribute("class", "carruagem"); }
return p.el;
}
let ordemAnterior = "";
function desenhar(agora) {
const vis = [];
for (let k = 0; k < N; k++) {
let j = 0;
for (const i of fila[k]) {
const p = pod[i]; if (!visivel[ENC[i].neg]) continue;
const [lx, ly] = lugar(k, j++);
if (p.viagem) {
if (agora - p.viagem.t0 >= p.viagem.dur) { p.viagem = null; p.x = lx; p.y = ly; }
else [p.x, p.y] = posViagem(p, agora, [lx, ly]);
} else if (!p.pronto) { p.x = lx; p.y = ly; p.pronto = true; }
else { p.x += (lx - p.x) * .25; p.y += (ly - p.y) * .25; }
vis.push(p);
}
}
for (const p of vis) {
let s = podSvg(p.x, p.y, COR[ENC[p.i].neg], p.tras && (p.viagem || dia - p.desde < 30));
if (verDias && !p.viagem && p.est !== ARM) {
const d = Math.floor(dia - p.desde), [tx, ty] = P(p.x, p.y, 2 + PH + 5);
const c = d <= 14 ? "var(--verde)" : d <= 45 ? "var(--amarelo)" : "var(--vermelho)";
s += `<text class="pod-dias" x="${f1(tx)}" y="${f1(ty)}" fill="${c}">${d}</text>`;
}
const el = noPod(p); el.innerHTML = s; el.dataset.prof = p.x + p.y;
}
// edifícios e carruagens por profundidade (x + y): o que está mais à frente fica por cima
const nos = NOS.concat(vis.map(p => ({ el: p.el, prof: p.x + p.y }))).sort((a, b) => a.prof - b.prof);
const chave = nos.map(n => n.el.dataset.k ?? "p").join("") + vis.map(p => p.i).join(",");
const atual = new Set(nos.map(n => n.el));
for (const c of [...gCena.children]) if (!atual.has(c)) c.remove();
if (chave !== ordemAnterior || vis.some(p => p.viagem)) { for (const n of nos) gCena.appendChild(n.el); ordemAnterior = chave; }
let curso = 0, arm = 0, paradas = 0;
for (let k = 0; k < N; k++) {
const l = fila[k].filter(i => visivel[ENC[i].neg]), md = mediana(l.map(i => dia - pod[i].desde));
document.getElementById("conta-" + k).textContent = l.length;
const cor = !l.length ? "var(--cinza)" : k === ARM ? "var(--verde)" : md <= 14 ? "var(--verde)" : md <= 45 ? "var(--amarelo)" : "var(--vermelho)";
document.getElementById("conta-" + k).style.fill = cor;
const pg = document.getElementById("peg-" + k); pg.style.fill = cor; pg.style.stroke = cor;
document.getElementById("dias-" + k).textContent = l.length && k !== ARM ? "há " + Math.round(md) + " dias (mediana)" : "";
if (k === ARM) arm += l.length; else { curso += l.length; paradas += l.filter(i => dia - pod[i].desde > 60).length; }
}
document.getElementById("h-curso").textContent = curso;
document.getElementById("h-arm").textContent = arm;
document.getElementById("h-paradas").textContent = paradas;
document.getElementById("h-tras").textContent = foraOrdem;
document.getElementById("h-data").textContent = dataDe(Math.floor(dia));
document.getElementById("centro-data").textContent = dataDe(Math.floor(dia));
document.getElementById("tempo").value = Math.floor(dia);
}
function feed(p, de, para, d, tras) {
const e = ENC[p.i], f = document.getElementById("feed");
const div = document.createElement("div");
div.className = "evento" + (tras ? " tras" : "");
div.innerHTML = `<b>${esc(e.id)}</b> <span>· ${esc(e.neg)}${e.forn ? " · " + esc(e.forn) : ""}</span><br>`
+ `${esc(EST[de].curto)} → ${esc(EST[para].curto)} <span>· ${dataDe(d)}${tras ? " · fora de ordem" : ""}</span>`;
f.prepend(div);
while (f.children.length > 6) f.lastChild.remove();
}
// ---------------------------------------------------------------- relógio
function ciclo(t) {
if (aTocar) {
if (ultimoT !== null) {
dia = Math.min(DIAS, dia + vel * (t - ultimoT) / 1000);
while (iEvt < EVT.length && EVT[iEvt][0] <= dia) aplicar(EVT[iEvt++], true);
if (dia >= DIAS) { aTocar = false; botaoPlay(); }
}
ultimoT = t;
} else ultimoT = null;
desenhar(t);
requestAnimationFrame(ciclo);
}
function botaoPlay() { document.getElementById("b-play").textContent = aTocar ? "❚❚" : "▶"; }
document.getElementById("b-play").onclick = () => { if (dia >= DIAS) irPara(0); aTocar = !aTocar; botaoPlay(); };
document.getElementById("b-inicio").onclick = () => { irPara(0); };
document.getElementById("b-hoje").onclick = () => { aTocar = false; botaoPlay(); irPara(DIAS); };
document.querySelectorAll(".vel").forEach(b => b.onclick = () => {
vel = +b.dataset.v; document.querySelectorAll(".vel").forEach(x => x.classList.toggle("sel", x === b)); });
document.getElementById("b-dias").onclick = ev => { verDias = !verDias; ev.currentTarget.classList.toggle("sel", verDias); };
const tempo = document.getElementById("tempo");
tempo.max = DIAS; document.getElementById("t-fim").textContent = dataDe(DIAS);
tempo.oninput = () => irPara(+tempo.value);
document.addEventListener("keydown", ev => {
if (ev.target.tagName === "INPUT" && ev.target.type !== "range") return;
if (ev.key === " ") { ev.preventDefault(); document.getElementById("b-play").click(); }
else if (ev.key === "ArrowRight") { ev.preventDefault(); irPara(Math.min(DIAS, Math.floor(dia) + 7)); }
else if (ev.key === "ArrowLeft") { ev.preventDefault(); irPara(Math.max(0, Math.floor(dia) - 7)); }
else if (ev.key === "Escape") document.getElementById("painel").hidden = true;
});
// ---------------------------------------------------------------- legenda (clique num negociador para o esconder)
function legenda() {
const n = {}; ENC.forEach(e => n[e.neg] = (n[e.neg] || 0) + 1);
document.getElementById("legenda").innerHTML = "<b style='color:var(--ink-hi)'>Cor da carruagem = negociador</b> (clique para mostrar/esconder)<br>"
+ NEG.map(k => `<span class="neg${visivel[k] ? "" : " off"}" data-n="${esc(k)}"><i style="background:${COR[k]}"></i>${esc(k)} (${n[k]})</span>`).join("")
+ "<br><b style='color:var(--ink-hi)'>Cor da estação</b> = há quanto tempo lá estão (mediana): "
+ "<i style='background:var(--verde)'></i>≤ 14 dias <i style='background:var(--amarelo)'></i>15–45 <i style='background:var(--vermelho)'></i>> 45"
+ "<br>Número em cima da carruagem = dias parada nessa estação (mesmas cores).<br>Contorno vermelho = fora de ordem (já tinha passado por um passo posterior). Tracejado entre ramais = passagem de Artworks para Manuais.";
document.querySelectorAll(".legenda .neg").forEach(s => s.onclick = () => { visivel[s.dataset.n] = !visivel[s.dataset.n]; legenda(); });
}
legenda();
// ---------------------------------------------------------------- painel da estação
document.getElementById("mundo").addEventListener("click", ev => {
const g = ev.target.closest(".estacao"); if (!g) return;
abrirEstacao(+g.dataset.k);
});
function abrirEstacao(k) {
const l = fila[k].filter(i => visivel[ENC[i].neg]).map(i => ({ e: ENC[i], p: pod[i], d: Math.floor(dia - pod[i].desde) }))
.sort((a, b) => b.d - a.d);
const pn = document.getElementById("painel");
pn.innerHTML = `<button class="fechar" onclick="document.getElementById('painel').hidden=true">✕</button>`
+ `<h3>${String(k + 1).padStart(2, "0")} · ${esc(EST[k].nome)}</h3>`
+ `<div class="sub">${l.length} encomendas aqui a ${dataDe(Math.floor(dia))}, da que está há mais tempo para a mais recente.`
+ (k === ARM ? "" : " É o último passo registado de cada uma: a encomenda espera aqui pelo passo seguinte.") + `</div>`
+ (l.length ? `<table><tr><th>Encomenda</th><th>Negociador</th><th>Fornecedor</th><th>Desde</th><th>Dias</th></tr>`
+ l.map(o => `<tr><td>${esc(o.e.id)}${o.p.tras ? " ↩" : ""}</td><td><i class="bola" style="background:${COR[o.e.neg]}"></i>${esc(o.e.neg)}</td>`
+ `<td>${esc(o.e.forn)}</td><td>${dataDe(o.p.desde)}</td><td class="n">${o.d}</td></tr>`).join("") + `</table>`
: `<p class="sub">Nenhuma encomenda nesta estação nesta data.</p>`);
pn.hidden = false;
}
irPara(0);
requestAnimationFrame(ciclo);
</script>
</body>
</html>
|