PageSourceSearch

https://www.vietri.com/cdn/shop/t/318/assets/map.js?v=113321260895345124881788750172

js vietri.com collected 2026-10-03 20:45:17 UTC 2,308 bytes, 8 lines download raw bytes

1import{loadScript,loadCSS}from"@archetype-themes/utils/resource-loader";const MAPBOX_VERSION="2.15.0",MAPBOX_BASE_URL=`https://api.mapbox.com/mapbox-gl-js/v${MAPBOX_VERSION}`,DEFAULT_ZOOM=9,DEFAULT_LATITUDE=0,DEFAULT_LONGITUDE=0;class MapboxMap extends HTMLElement{static#mapboxPromise=null;#map=null;constructor(){super(),this.attachShadow({mode:"open"})}async connectedCallback(){this.render(),this.initializeMap().catch(error=>{console.error("Error initializing Mapbox map:",error)})}disconnectedCallback(){this.#map&&(this.#map.remove(),this.#map=null)}async initializeMap(){await MapboxMap.loadMapboxResources(),await this.createMap()}static async loadMapboxResources(){MapboxMap.#mapboxPromise||(MapboxMap.#mapboxPromise=Promise.all([loadScript(`${MAPBOX_BASE_URL}/mapbox-gl.js`,"mapboxgl"),loadCSS(`${MAPBOX_BASE_URL}/mapbox-gl.css`)])),await MapboxMap.#mapboxPromise}render(){this.shadowRoot.innerHTML=`
2      <style>
3        :host { display: block; width: 100%; height: 100%; }
4        #map { position: absolute; width: 100%; height: 100%; }
5      </style>
6      <div id="map"></div>
7    `}async createMap(){const{accessToken,address,zoom}=this;if(!accessToken||accessToken.trim()==="")throw new Error("Mapbox access token is required");mapboxgl.accessToken=accessToken;const geocodingUrl=`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURIComponent(address)}.json?access_token=${accessToken}`,data=await(await fetch(geocodingUrl)).json();if(!data.features||data.features.length===0)throw new Error("Unable to geocode the address");const[longitude,latitude]=data.features[0].center;return new Promise((resolve,reject)=>{this.#map=new mapboxgl.Map({container:this.shadowRoot.getElementById("map"),style:"mapbox://styles/mapbox/streets-v12",center:[longitude,latitude],zoom,interactive:!1,attributionControl:!1}),this.#map.on("load",resolve),this.#map.on("error",e=>{console.error("Mapbox GL JS error:",e),reject(new Error("Failed to initialize Mapbox map"))})})}get accessToken(){return this.getAttribute("access-token")}get address(){return this.getAttribute("address")}get zoom(){return parseInt(this.getAttribute("zoom")||DEFAULT_ZOOM.toString(),10)}}customElements.define("mapbox-map",MapboxMap);
8//# sourceMappingURL=/cdn/shop/t/318/assets/map.js.map?v=113321260895345124881788750172

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.