PageSourceSearch

https://ridemtu.com/assets/nearbyStopsService-D1T8Cnfb.js

js ridemtu.com collected 2026-09-27 13:01:37 UTC 3,154 bytes, 1 lines download raw bytes

1import{j as o}from"./chunk-LFPYN7LY-BYCOceFh.js";import{B as y}from"./index-B19M7xEA.js";import{V as h}from"./time-DAo_j7jH.js";import{g as S,c as g,d as x,p}from"./MapControlContext-CaZ7lMlQ.js";function C({accessibilityText:t="Loading data...",size:e="medium"}){const i=e==="small"?64:128,r=e==="small"?17:35;return o.jsxs(y,{role:"status","aria-live":"polite",children:[o.jsx(h,{children:t}),o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.0",width:i,height:r,viewBox:"0 0 128 35",xmlSpace:"preserve","aria-hidden":!0,children:[o.jsxs("g",{children:[o.jsx("circle",{fill:"#787f8d",fillOpacity:1,cx:"17.5",cy:"17.5",r:"17.5"}),o.jsx("animate",{attributeName:"opacity",dur:"2700ms",begin:"0s",repeatCount:"indefinite",keyTimes:"0;0.167;0.5;0.668;1",values:"0.3;1;1;0.3;0.3"})]}),o.jsxs("g",{children:[o.jsx("circle",{fill:"#787f8d",fillOpacity:1,cx:"110.5",cy:"17.5",r:"17.5"}),o.jsx("animate",{attributeName:"opacity",dur:"2700ms",begin:"0s",repeatCount:"indefinite",keyTimes:"0;0.334;0.5;0.835;1",values:"0.3;0.3;1;1;0.3"})]}),o.jsxs("g",{children:[o.jsx("circle",{fill:"#787f8d",fillOpacity:1,cx:"64",cy:"17.5",r:"17.5"}),o.jsx("animate",{attributeName:"opacity",dur:"2700ms",begin:"0s",repeatCount:"indefinite",keyTimes:"0;0.167;0.334;0.668;0.835;1",values:"0.3;0.3;1;1;0.3;0.3"})]})]})]})}const v=1609.34,f=v*2,w=5;function b(t){return Math.min(30,Math.max(t*3,10))}async function A(t,e=5,i=f){const r=new URLSearchParams;r.set("lat",String(t.lat)),r.set("lon",String(t.lon)),r.set("distance",String(i));const s=await S(`stops/search?${r.toString()}`),n=(Array.isArray(s)?s:[]).map(a=>({id:a.id,name:a.name,lat:a.lat,lon:a.lon,stopCode:a.stopCode,rtpiNumber:a.rtpiNumber,distance:a.distance}));return n.sort((a,l)=>(a.distance??1/0)-(l.distance??1/0)),n.slice(0,e)}function R(t){var s,c,n,a,l;const e=(s=t.pattern)==null?void 0:s.id;if(e!=null&&String(e)!=="")return String(e);const i=((c=t.route)==null?void 0:c.id)??((a=(n=t.pattern)==null?void 0:n.route)==null?void 0:a.id)??"",r=((l=t.pattern)==null?void 0:l.direction)??"";return`fallback:${i}:${r}`}function m(t){var e;return t.route??((e=t.pattern)==null?void 0:e.route)??{id:"",displayOrder:0}}function j(t,e){const i=t.route.displayOrder??0,r=e.route.displayOrder??0;if(i!==r)return i-r;const s=p(t.pattern),c=p(e.pattern);return s.localeCompare(c,void 0,{sensitivity:"base"})}function N(t,e,i){const r=e.filter(n=>typeof n.secondsToArrival=="number"),s=new Map;for(const n of r){const a=m(n),l=String(a.id??"");if(i.size>0&&l&&!i.has(l))continue;const d=R(n),u=s.get(d);(!u||(n.secondsToArrival??1/0)<(u.secondsToArrival??1/0))&&s.set(d,n)}const c=[...s.values()].map(n=>({stop:t,pattern:n.pattern,route:m(n),schedulePrediction:n.schedulePrediction,secondsToArrival:n.secondsToArrival}));return c.sort(j),c}async function T(t){try{const[e,i]=await Promise.all([g(t.id),x(t.id)]),r=new Set(e.map(s=>String(s.id)).filter(Boolean));return N(t,i,r)}catch{return[]}}async function I(t,e=w){const i=b(e),r=await A(t,i,f);return r.length===0?[]:(await Promise.all(r.map(c=>T(c)))).flat().slice(0,Math.max(0,e))}export{C as D,A as a,I as f};

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.