PageSourceSearch

https://canoetribe.com/wp-content/plugins/tbx-plugin/blox/route/script.js?ver=1790633312

js canoetribe.com collected 2026-09-29 00:54:54 UTC 12,077 bytes, 1 lines download raw bytes

1"use strict";const TB_ROUTE_FALLBACK_STYLE="mapbox://styles/mapbox/outdoors-v12",TB_ROUTE_STOP_ZOOM=9.5,TB_ROUTE_ELEVATION_FLOOR=300,TB_ROUTE_PITCH=46,TB_ROUTE_DASH_STEPS=[[0,4,3],[.5,4,2.5],[1,4,2],[1.5,4,1.5],[2,4,1],[2.5,4,.5],[3,4,0]],TB_ROUTE_DASH_INTERVAL=70;tb.onRootElementReady(h=>{const E=()=>h.classList.contains("is-mobile-width"),be=s=>{var se;let a=[];try{a=JSON.parse(s.dataset.stops||"[]")}catch{return}if(!a.length)return;let q=[];try{q=JSON.parse(s.dataset.tracks||"[]")}catch{q=[]}const L=s.closest(".tb-route"),p=s.querySelector("[data-route-map]"),y=s.querySelector("[data-route-strip]"),g=s.querySelector("[data-route-panels]"),H=Array.from(s.querySelectorAll("[data-route-thumb]")),f=Array.from(s.querySelectorAll("[data-route-panel]")),R=Array.from(s.querySelectorAll("[data-route-pill]")),he=Array.from(s.querySelectorAll("[data-route-next]"));typeof tbCarousel!="undefined"&&(L==null||L.querySelectorAll(".tb-carousel-container").forEach(e=>tbCarousel.init(e)));const P=getComputedStyle(s).getPropertyValue("--tb-button-color").trim()||getComputedStyle(s).getPropertyValue("--tb-primary-color").trim()||"#3E6255",W=Array.from((se=L==null?void 0:L.querySelectorAll("[data-route-variant]"))!=null?se:[]),x=[],I=[];let k=0,c=0,M=!1,i=null;const u=e=>{var t;return!((t=a[e].excluded)!=null&&t.includes(k))},F=()=>a.findIndex((e,t)=>u(t)),v=(e,t)=>{for(let n=1;n<=a.length;n++){const o=(e+t*n+a.length*n)%a.length;if(u(o))return o}return e},Z=e=>{if(a[e].kind==="optional")return a[e].badge;let t=0;for(let n=0;n<=e;n++)a[n].kind!=="optional"&&u(n)&&t++;return String(t)},A=()=>a.filter((e,t)=>e.kind!=="optional"&&u(t)),V=()=>{const e=q[k];if(!e||e.coords.length<2)return null;const t=a.map((d,m)=>d.kind!=="optional"&&u(m)?m:-1).filter(d=>d>=0);if(!t.length)return e.coords;const n=e.indices[t[0]],o=e.indices[t[t.length-1]],r=typeof n=="number"?n:0,l=typeof o=="number"?o:e.coords.length-1;return r<l?e.coords.slice(r,l+1):e.coords},J=e=>{i==null||i.easeTo({center:[a[c].lng,a[c].lat],zoom:Math.max(i.getZoom(),9.5),pitch:i.getTerrain()?46:0,duration:e})};let N=!1,G=0,K=0;const ye=e=>{const t=f[e];if(!g||!t||!E())return;N=!0,window.clearTimeout(G),G=window.setTimeout(()=>{N=!1},500);const n=g.getBoundingClientRect(),o=t.getBoundingClientRect(),r=parseFloat(getComputedStyle(g).scrollPaddingInlineStart)||0;g.scrollTo({left:g.scrollLeft+(o.left-n.left)-r,behavior:"smooth"})},ve=e=>{const t=R[e];if(!y||!t)return;const n=parseFloat(getComputedStyle(y).paddingLeft)||0,o=E()?Math.max(0,t.offsetLeft-n):t.offsetLeft+t.offsetWidth/2-y.clientWidth/2;y.scrollTo({left:o,behavior:"smooth"})},b=(e,t=!1,n=!0)=>{const o=(e+a.length)%a.length;c=u(o)?o:v(o,1),M=M||t,H.forEach(r=>{r.hidden=Number(r.dataset.routeThumb)!==c}),f.forEach((r,l)=>{r.hidden=!u(l)||!E()&&l!==c,r.classList.toggle("is-active",l===c)}),R.forEach((r,l)=>{r.classList.toggle("is-active",l===c),r.setAttribute("aria-pressed",l===c?"true":"false")}),x.forEach((r,l)=>{r.classList.toggle("is-active",l===c)}),n&&M?J(650):n&&(i==null||i.easeTo({center:[a[c].lng,a[c].lat],duration:650})),ve(c),ye(c)};R.forEach((e,t)=>e.addEventListener("click",()=>b(t,!0)));const Y=e=>{var o;const t=(e+a.length)%a.length;b(u(t)?t:v(t,1),!0);const n=(o=f[t])==null?void 0:o.querySelector(".tb-popup");n&&typeof tbPopup!="undefined"&&tbPopup.swapPopup(n)};f.forEach((e,t)=>{var n,o;(n=e.querySelector("[data-route-popup-prev]"))==null||n.addEventListener("click",()=>Y(v(t,-1))),(o=e.querySelector("[data-route-popup-next]"))==null||o.addEventListener("click",()=>Y(v(t,1)))}),H.forEach(e=>{e.addEventListener("click",()=>{var n,o;const t=Number(e.dataset.routeThumb);(o=(n=f[t])==null?void 0:n.querySelector(".tb-popup-trigger"))==null||o.click()})}),g==null||g.addEventListener("scroll",()=>{!E()||N||(window.clearTimeout(K),K=window.setTimeout(()=>{const e=g.getBoundingClientRect();let t=0,n=1/0;f.forEach((o,r)=>{if(!u(r))return;const l=o.getBoundingClientRect(),d=Math.abs(l.left-e.left);d<n&&(n=d,t=r)}),t!==c&&b(t,!0)},90))},{passive:!0}),h.addEventListener("tb-width-changed",()=>b(c)),he.forEach(e=>e.addEventListener("click",()=>b(v(c,1),!0)));const $=()=>{W.forEach((e,t)=>{e.classList.toggle("is-active",t===k),e.setAttribute("aria-pressed",t===k?"true":"false")}),R.forEach((e,t)=>{const n=u(t);e.hidden=!n;const o=e.querySelector("[data-route-badge]");o&&(o.textContent=Z(t));const r=e.previousElementSibling;r!=null&&r.classList.contains("tb-route__strip-arrow")&&(r.hidden=!n||F()===t)}
1),H.forEach(e=>{e.hidden=Number(e.dataset.routeThumb)!==c}),f.forEach((e,t)=>{const n=e.querySelectorAll("[data-route-popup-location]"),o=a[v(t,-1)],r=a[v(t,1)];n[0]&&o&&(n[0].textContent=o.location),n[1]&&r&&(n[1].textContent=r.location)})},Te=e=>{var t;k=e,$(),M=!1,b(F(),!1,!i),i&&(oe(),(t=i.getSource("tb-route"))==null||t.setData(X()),ee(),ie())};if(W.forEach((e,t)=>e.addEventListener("click",()=>Te(t))),$(),b(F()),!p||typeof mapboxgl=="undefined"||!(tbMapbox!=null&&tbMapbox.token))return;mapboxgl.accessToken=tbMapbox.token,i=new mapboxgl.Map({container:p,style:s.dataset.mapStyle||TB_ROUTE_FALLBACK_STYLE,center:[a[0].lng,a[0].lat],zoom:6,cooperativeGestures:!0}),i.addControl(new mapboxgl.NavigationControl,"top-right"),i.dragRotate.disable(),i.touchZoomRotate.disableRotation();let Q=()=>{};const Ee=()=>{if(i.hasImage("tb-route-arrow"))return;const e=22,t=document.createElement("canvas");t.width=e,t.height=e;const n=t.getContext("2d");n&&(n.strokeStyle=P,n.lineWidth=2.6,n.lineCap="round",n.lineJoin="round",n.beginPath(),n.moveTo(7,5),n.lineTo(15,11),n.lineTo(7,17),n.stroke(),i.addImage("tb-route-arrow",{width:e,height:e,data:n.getImageData(0,0,e,e).data}))},X=()=>{var e;return{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:(e=V())!=null?e:A().length>1?A().map(t=>[t.lng,t.lat]):[]}}},Le=async()=>{const e=A().map(r=>[r.lng,r.lat]);if(e.length<2||!(tbMapbox!=null&&tbMapbox.token))return null;const t=[];for(let r=0;r<e.length-1;r+=24)t.push(e.slice(r,r+25));const o=(await Promise.all(t.map(async r=>{var m,T,B,C;const d="https://api.mapbox.com/directions/v5/mapbox/driving/"+r.map(S=>S.join(",")).join(";")+"?geometries=geojson&overview=simplified&access_token="+tbMapbox.token;try{const w=await(await fetch(d)).json();return(C=(B=(T=(m=w==null?void 0:w.routes)==null?void 0:m[0])==null?void 0:T.geometry)==null?void 0:B.coordinates)!=null?C:r}catch{return r}}))).flatMap((r,l)=>l===0?r:r.slice(1));return{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:o}}},ee=()=>{s.dataset.lineStyle!=="roads"||V()||Le().then(e=>{e&&i.getSource("tb-route")&&i.getSource("tb-route").setData(e)})},U=["any",["==",["get","worldview"],"all"],["in","US",["get","worldview"]]],te=()=>{var e,t;return(t=(e=i.getStyle())==null?void 0:e.name)!=null?t:""},ne=()=>/blind/i.test(te()),Se=()=>{var t;if(!ne())return;i.addSource("tb-countries",{type:"vector",url:"mapbox://mapbox.country-boundaries-v1"});const e=(t=i.getStyle().layers.find(n=>n.type==="symbol"))==null?void 0:t.id;i.addLayer({id:"tb-country-fill",type:"fill",source:"tb-countries","source-layer":"country_boundaries",filter:U,paint:{"fill-color":P,"fill-opacity":0}},e),i.addLayer({id:"tb-country-line",type:"line",source:"tb-countries","source-layer":"country_boundaries",filter:["all",["==",["get","iso_3166_1"],""],U],paint:{"line-color":P,"line-width":1.4,"line-opacity":.45}},e),i.once("idle",()=>{var d,m,T;const n=(d=A()[0])!=null?d:a[0];if(!n||!i.getLayer("tb-country-fill"))return;const r=(T=(m=i.queryRenderedFeatures(i.project([n.lng,n.lat]),{layers:["tb-country-fill"]})[0])==null?void 0:m.properties)==null?void 0:T.iso_3166_1;if(!r)return;const l=["all",["==",["get","iso_3166_1"],r],U];i.setFilter("tb-country-fill",l),i.setFilter("tb-country-line",l),i.setPaintProperty("tb-country-fill","fill-opacity",.18)})},we=()=>{!/3d/i.test(te())||E()||(i.getSource("tb-terrain")||i.addSource("tb-terrain",{type:"raster-dem",url:"mapbox://mapbox.mapbox-terrain-dem-v1",tileSize:512,maxzoom:14}),i.setTerrain({source:"tb-terrain",exaggeration:2}),i.addLayer({id:"tb-sky",type:"sky",paint:{"sky-type":"atmosphere","sky-atmosphere-sun-intensity":4,"sky-atmosphere-color":"#cfe3e2","sky-atmosphere-halo-color":"#f4f1e8"}}),i.setPitch(46),ne()&&i.setFog({range:[.5,8],color:"#eae6da","horizon-blend":.35,"high-color":"#bcd8dd","space-color":"#d4e2e4","star-intensity":0}))},_e=()=>{i.getTerrain()&&(H.forEach(e=>{e.hidden=Number(e.dataset.routeThumb)!==c}),f.forEach((e,t)=>{const n=e.querySelector("[data-route-elevation]");if(!n||n.dataset.filled)return;const o=i.queryTerrainElevation([a[t].lng,a[t].lat],{exaggerated:!1});
1o===null||o<300||(n.dataset.filled="1",n.innerHTML=`<i class="icon fa-solid fa-mountain fa-fw" aria-hidden="true"></i><span>${Math.round(o).toLocaleString(document.documentElement.lang||"en")} m</span>`)}))},xe=()=>{i.addSource("tb-route",{type:"geojson",data:X()}),i.addLayer({id:"tb-route-line",type:"line",source:"tb-route",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":P,"line-width":3.4,"line-opacity":.95,...ke()?{"line-dasharray":[1.6,1.8]}:{}}}),i.addLayer({id:"tb-route-arrows",type:"symbol",source:"tb-route",layout:{"symbol-placement":"line","symbol-spacing":70,"icon-image":"tb-route-arrow","icon-size":.85,"icon-rotation-alignment":"map","icon-allow-overlap":!0,"icon-ignore-placement":!0}})},ke=()=>s.dataset.lineStyle==="dashed"||s.dataset.lineStyle==="animated",Me=()=>{const e=window.matchMedia("(prefers-reduced-motion: reduce)");if(s.dataset.lineStyle!=="animated"||e.matches)return()=>{};let t=0,n=0;const o=()=>{t=(t+1)%TB_ROUTE_DASH_STEPS.length,i.getLayer("tb-route-line")&&i.setPaintProperty("tb-route-line","line-dasharray",TB_ROUTE_DASH_STEPS[t])},r=new IntersectionObserver(l=>{const d=l.some(m=>m.isIntersecting);window.clearInterval(n),d&&(n=window.setInterval(o,TB_ROUTE_DASH_INTERVAL))});return r.observe(p),()=>{window.clearInterval(n),r.disconnect()}},oe=()=>{var e;I.forEach(t=>t.remove()),I.length=0,x.length=0,a.forEach((t,n)=>{if(!u(n)){x.push(document.createElement("button"));return}const o=document.createElement("button");o.type="button",o.className="tb-route__marker tb-route__marker--"+t.kind,t.icon?o.innerHTML=t.icon:o.textContent=Z(n),o.setAttribute("aria-label",t.location),o.addEventListener("click",r=>{r.stopPropagation(),b(n,!0)}),I.push(new mapboxgl.Marker({element:o,anchor:"center"}).setLngLat([t.lng,t.lat]).addTo(i)),x.push(o)}),(e=x[c])==null||e.classList.add("is-active")},re=()=>{var S,w,le,ce,de,ue;const e=(S=p==null?void 0:p.clientWidth)!=null?S:0,t=(w=p==null?void 0:p.clientHeight)!=null?w:0,n=(ce=(le=f[0])==null?void 0:le.parentElement)==null?void 0:ce.getBoundingClientRect(),o=s.getBoundingClientRect(),r=(de=y==null?void 0:y.offsetHeight)!=null?de:0,l=E()?{top:54,right:46,bottom:((ue=n==null?void 0:n.height)!=null?ue:0)+r+12,left:46}:{top:60,right:80,bottom:r+16,left:n?n.right-o.left+24:440},d=(me,pe,He)=>{const ge=He*.8,z=me+pe,fe=z>ge&&z>0?ge/z:1;return[Math.round(me*fe),Math.round(pe*fe)]},[m,T]=d(l.left,l.right,e),[B,C]=d(l.top,l.bottom,t);return{top:B,right:T,bottom:C,left:m}},ie=()=>{var n;const e=a.filter((o,r)=>u(r));if(!e.length)return;const t=new mapboxgl.LngLatBounds;e.forEach(o=>t.extend([o.lng,o.lat])),(n=V())==null||n.forEach(o=>t.extend(o)),i.setPadding(re()),i.fitBounds(t,{maxZoom:8.5,duration:0,pitch:i.getTerrain()?46:0})},O=()=>{i.resize(),i.setPadding(re()),M?J(0):ie()};i.on("load",()=>{Ee(),we(),Se(),xe(),oe(),ee(),Q=Me(),requestAnimationFrame(O),O()}),i.on("idle",_e),tb.onElementResized(p,()=>O());const ae=()=>O();return h.addEventListener("tb-width-changed",ae),()=>{h.removeEventListener("tb-width-changed",ae),Q(),i.remove()}},D=new WeakSet,_=[],j=()=>{h.querySelectorAll("[data-route]").forEach(s=>{if(D.has(s))return;D.add(s);const a=be(s);a&&_.push({root:s,destroy:a})});for(let s=_.length-1;s>=0;s--)_[s].root.isConnected||(_[s].destroy(),_.splice(s,1))};if(j(),h.classList.contains("editor-styles-wrapper")){let s=0;new MutationObserver(()=>{window.clearTimeout(s),s=window.setTimeout(j,120)}).observe(h,{childList:!0,subtree:!0})}});

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.