/* ---------- The PNI list of a POP (#175, #172) ---------- Every network here answers three questions: how you reach it today (one chip), whether a PNI here is worth it (a value line from live routing) and whether you can get one (the order buttons, policy and lead time). Sorted by monthly value, filtered, grouped by type; groups with nothing to do (no PNI there, nothing you could order that moves 1 Gbps) stay folded. */ const PNI_GRP=['t1','t2','eye','cdn','paid'],pniGrpOf=n=>n.pol==='paid'?'paid':n.type; const pniGrpL=k=>k==='paid'?tr('ops.p_paid'):TYPE_L[k]; function pniValLine(n,c,v){ if(v.g<1)return `
`; const via=[v.t>=0.05?tr('pni_list.via_transit',{g:fmtG(v.t)}):'',v.ix>=0.05?tr('pni_list.via_ix',{g:fmtG(v.ix)}):'',v.p>=0.05?tr('pni_list.via_haul',{g:fmtG(v.p)}):'',v.u>=0.05?tr('pni_list.via_drop',{g:fmtG(v.u)}):''].filter(Boolean).join(' · '); const val=(v.val>0?'+':'')+tr('common.price_mo',{price:fmt$(Math.round(v.val))}); return ``;} function pniRow(c,n,pn,v,chk){let h=`${tr('pni_list.worth_rule')}
`; const shown=rows.filter(keep);if(!shown.length)return h+`${tr('pni_list.nothing_matches')}
`; let left=listN('pni'),tot=0; for(const g of PNI_GRP){const gr=shown.filter(r=>pniGrpOf(r.n)===g);if(!gr.length)continue; const w=gr.filter(r=>r.v&&r.v.worth).length,act=w||gr.some(r=>r.go),isOpen=f!=='all'||netFiltered()||(open[g]??act); h+=`