PageSourceSearch

https://trains.fyi/_next/static/chunks/pages/cities-dc95de94bae31910.js?dpl=dpl_5vQSvZVhuinF4HqkBsmkPs3cGsp5

js trains.fyi collected 2026-09-24 09:54:29 UTC 5,895 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5621],{16973:(e,i,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/cities",function(){return a(75632)}])},75632:(e,i,a)=>{"use strict";a.r(i),a.d(i,{default:()=>p});var t=a(37876),s=a(14232),n=a(73478),r=a(78240);let l=({city:e})=>{let{trains:i}=(0,r.nC)(),a=(0,s.useMemo)(()=>i&&i.trains?i.trains.filter(i=>.5>Math.abs(i.lat-e.lat)&&.5>Math.abs(i.lng-e.lng)):[],[i,e]);return(0,t.jsx)("a",{href:`/${e.slug}/`,className:"block group relative rounded-lg overflow-hidden bg-white shadow-md hover:shadow-lg focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2",children:(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)("h3",{className:"text-xl font-medium text-gray-900",children:e.name}),(0,t.jsxs)("p",{className:"mt-1 text-sm text-gray-500",children:[e.state,", ",e.country]}),(0,t.jsxs)("p",{className:"mt-1 text-sm text-gray-500",children:[a.length," ",1===a.length?"train":"trains"," nearby"]})]})})};var c=a(49915),o=a(85392),d=a(74),g=a(93408),h=a(99904),m=a(72641);let u={"United States":"\uD83C\uDDFA\uD83C\uDDF8",Canada:"\uD83C\uDDE8\uD83C\uDDE6",Mexico:"\uD83C\uDDF2\uD83C\uDDFD",Australia:"\uD83C\uDDE6\uD83C\uDDFA","New Zealand":"\uD83C\uDDF3\uD83C\uDDFF",Malaysia:"\uD83C\uDDF2\uD83C\uDDFE",Finland:"\uD83C\uDDEB\uD83C\uDDEE",Netherlands:"\uD83C\uDDF3\uD83C\uDDF1",Norway:"\uD83C\uDDF3\uD83C\uDDF4",Sweden:"\uD83C\uDDF8\uD83C\uDDEA",Denmark:"\uD83C\uDDE9\uD83C\uDDF0",Belgium:"\uD83C\uDDE7\uD83C\uDDEA",Luxembourg:"\uD83C\uDDF1\uD83C\uDDFA",Slovenia:"\uD83C\uDDF8\uD83C\uDDEE",Montenegro:"\uD83C\uDDF2\uD83C\uDDEA",Georgia:"\uD83C\uDDEC\uD83C\uDDEA",Armenia:"\uD83C\uDDE6\uD83C\uDDF2",Chile:"\uD83C\uDDE8\uD83C\uDDF1",Colombia:"\uD83C\uDDE8\uD83C\uDDF4",Venezuela:"\uD83C\uDDFB\uD83C\uDDEA",Peru:"\uD83C\uDDF5\uD83C\uDDEA",Ecuador:"\uD83C\uDDEA\uD83C\uDDE8",Bolivia:"\uD83C\uDDE7\uD83C\uDDF4",Uruguay:"\uD83C\uDDFA\uD83C\uDDFE",Paraguay:"\uD83C\uDDF5\uD83C\uDDFE",France:"\uD83C\uDDEB\uD83C\uDDF7",India:"\uD83C\uDDEE\uD83C\uDDF3",Spain:"\uD83C\uDDEA\uD83C\uDDF8","United Kingdom":"\uD83C\uDDEC\uD83C\uDDE7",Argentina:"\uD83C\uDDE6\uD83C\uDDF7",Egypt:"\uD83C\uDDEA\uD83C\uDDEC",Poland:"\uD83C\uDDF5\uD83C\uDDF1",Latvia:"\uD83C\uDDF1\uD83C\uDDFB",Bulgaria:"\uD83C\uDDE7\uD83C\uDDEC",Italy:"\uD83C\uDDEE\uD83C\uDDF9",Croatia:"\uD83C\uDDED\uD83C\uDDF7",Romania:"\uD83C\uDDF7\uD83C\uDDF4",Ukraine:"\uD83C\uDDFA\uD83C\uDDE6",Israel:"\uD83C\uDDEE\uD83C\uDDF1",Switzerland:"\uD83C\uDDE8\uD83C\uDDED",Estonia:"\uD83C\uDDEA\uD83C\uDDEA","Hong Kong":"\uD83C\uDDED\uD83C\uDDF0",Taiwan:"\uD83C\uDDF9\uD83C\uDDFC",Japan:"\uD83C\uDDEF\uD83C\uDDF5","Costa Rica":"\uD83C\uDDE8\uD83C\uDDF7","Puerto Rico":"\uD83C\uDDF5\uD83C\uDDF7","Dominican Republic":"\uD83C\uDDE9\uD83C\uDDF4",Nigeria:"\uD83C\uDDF3\uD83C\uDDEC",Tunisia:"\uD83C\uDDF9\uD83C\uDDF3",Senegal:"\uD83C\uDDF8\uD83C\uDDF3",Kenya:"\uD83C\uDDF0\uD83C\uDDEA","South Africa":"\uD83C\uDDFF\uD83C\uDDE6","Saudi Arabia":"\uD83C\uDDF8\uD83C\uDDE6"};var x=a(73865);function p(){let{t:e}=(0,x.B)(),i=(0,s.useRef)({}),a=m.i.getAllCountries(),r=(0,s.useMemo)(()=>{let e={};return a.forEach(i=>{var a;let t,s=h.L.getCitiesByCountry(i.slug);e[i.name]={highlighted:s.filter(e=>e.highlighted),nonHighlighted:s.filter(e=>!e.highlighted),slug:i.slug,flag:(a=i.name,(t=function(e){if(!e||"string"!=typeof e)return"";let i=e.trim();if(2!==i.length)return"";let a=[...i.toUpperCase()].map(e=>127397+e.charCodeAt(0));try{return String.fromCodePoint(...a)}catch(e){return""}}(i.slug))||(a&&u[a]?u[a]:""))}}),Object.entries(e).sort(([e],[i])=>"United States"===e?-1:"United States"===i?1:"Canada"===e?-1:"Canada"===i?1:e.localeCompare(i)).reduce((e,[i,a])=>(e[i]=a,e),{})},[a]),p=[{name:e("cities"),href:"/cities",current:!0}];return(0,t.jsxs)("div",{className:"bg-white",children:[(0,t.jsx)(g.A,{title:"Cities | trains.fyi",description:"Explore real-time train information for cities across North America.",canonical:"/cities/",image:"/social.png",type:"website"}),(0,t.jsx)(d.A,{}),(0,t.jsxs)("main",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:[(0,t.jsx)("div",{className:"py-4",children:(0,t.jsx)(c.A,{pages:p})}),(0,t.jsxs)("div",{className:"my-8",children:[(0,t.jsx)("div",{className:"text-5xl text-black font-bold mb-4",children:e("cities")}),(0,t.jsx)("div",{className:"text-xl text-gray-500",children:e("citiesSubtitle")}),(0,t.jsx)("div",{className:"mt-8",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-3",children:Object.entries(r).map(([a,s])=>(0,t.jsxs)("button",{onClick:()=>{i.current[a]?.scrollIntoView({behavior:"smooth"})},className:"inline-flex items-center gap-2 rounded-full border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 hover:border-gray-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",title:e("citiesJumpTo").replace("{name}",a),children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:s.flag}),(0,t.jsx)("span",{children:e("citiesJumpTo").replace("{name}",a)})]},s.slug))})})]}),(0,t.jsx)("div",{className:"py-4",children:Object.entries(r).map(([e,a])=>(0,t.jsxs)("div",{className:"mb-16",ref:a=>i.current[e]=a,children:[(0,t.jsxs)("h2",{className:"text-3xl font-bold text-gray-900 my-10 flex items-center gap-3",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:a.flag}),(0,t.jsx)("span",{children:e})]}),a.highlighted.length>0&&(0,t.jsx)("div",{className:"grid gap-10 sm:grid-cols-2 lg:grid-cols-3 mb-8",children:a.highlighted.map(e=>(0,t.jsx)(n.A,{city:e},e.slug))}),a.nonHighlighted.length>0&&(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-3 lg:grid-cols-4",children:a.nonHighlighted.map(e=>(0,t.jsx)(l,{city:e},e.slug))})]},a.slug))})]}),(0,t.jsx)(o.A,{})]})}}},e=>{e.O(0,[6701,1805,3927,2325,3990,8447,5392,5465,636,6593,8792],()=>e(e.s=16973)),_N_E=e.O()}]);

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.