1(function(){var __pre=window.FQ_GOOGLE||{};function createRateLimiter(maxPerWindow,windowMs){let tokens=maxPerWindow;const queue=[];let last=Date.now();function refill(){const now=Date.now(),elapsed=now-last;last=now;const add=Math.floor(elapsed/windowMs*maxPerWindow);add>0&&(tokens=Math.min(maxPerWindow,tokens+add))}async function schedule(task){return new Promise((resolve,reject)=>{queue.push({task,resolve,reject}),process()})}function process(){for(refill();tokens>0&&queue.length;){tokens-=1;const{task,resolve,reject}=queue.shift();Promise.resolve().then(task).then(resolve).catch(reject).finally(()=>{setTimeout(process,Math.ceil(windowMs/maxPerWindow))})}}return{schedule}}const FQ_GOOGLE={apiKey:__pre.apiKey||"",language:__pre.language||window.Shopify&&(window.Shopify.locale||window.Shopify.routes&&window.Shopify.routes.root&&document.documentElement.lang)||"en",region:__pre.region||window.Shopify&&window.Shopify.country||"US",debug:!0,limiter:createRateLimiter(5,1e3),log(){if(this.debug)try{console.debug("[FQ][Google]",...arguments)}catch{}},buildParams(params){const defaulted=Object.assign({key:this.apiKey,language:this.language,region:this.region},params||{}),usp=new URLSearchParams;return Object.keys(defaulted).forEach(k=>{defaulted[k]!==void 0&&defaulted[k]!==null&&defaulted[k]!==""&&usp.append(k,defaulted[k])}),usp.toString()},async placesAutocomplete({input,sessionToken,locationBias,country}){if(!input||input.length<3)return[];const body={input,languageCode:this.language,sessionToken:sessionToken||this.uuid(),includedPrimaryTypes:["locality"],regionCode:this.region};country&&(body.includedRegionCodes=[String(country).toUpperCase()]);const run=async()=>{const res=await fetch("https://places.googleapis.com/v1/places:autocomplete",{method:"POST",headers:{"Content-Type":"application/json","X-Goog-Api-Key":this.apiKey,"X-Goog-FieldMask":"suggestions.placePrediction.text,suggestions.placePrediction.placeId,suggestions.placePrediction.structuredFormat.secondaryText"},body:JSON.stringify(body)});if(!res.ok)return this.log("Places v1 HTTP",res.status),[];const data=await res.json();return(Array.isArray(data.suggestions)?data.suggestions:[]).map(s=>{const pp=s.placePrediction||{},text=pp.text&&pp.text.text||"",secondary=pp.structuredFormat&&pp.structuredFormat.secondaryText&&pp.structuredFormat.secondaryText.text||"",parts=(text||"").split(",").map(p=>p.trim());let city=parts[0]||"",countryName=secondary||parts[parts.length-1]||"";return{description:countryName?`${city}, ${countryName}`:text,place_id:pp.placeId||"",terms:[{value:city},{value:countryName}]}})};return this.limiter.schedule(run)},async geocode({placeId,address}){const run=async()=>{if(window.google&&google.maps&&google.maps.Geocoder)return new Promise(resolve=>{const geocoder=new google.maps.Geocoder,req=placeId?{placeId}:{address};geocoder.geocode(req,(results,status)=>{if(status!==google.maps.GeocoderStatus.OK&&status!==google.maps.GeocoderStatus.ZERO_RESULTS)return this.log("Geocode status:",status),resolve({results:[]});resolve({results:results||[]})})});const params=placeId?{place_id:placeId}:{address},url=`https://maps.googleapis.com/maps/api/geocode/json?${this.buildParams(Object.assign({},params))}`,res=await fetch(url);return res.ok?await res.json():(this.log("Geocode HTTP",res.status),{results:[]})};return this.limiter.schedule(run)},extractComponents(geocodeResult){const out={city:"",postalCode:"",countryName:"",countryCode:""};if(!geocodeResult)return out;const comps=geocodeResult.address_components||[],get=type=>comps.find(c=>c.types&&c.types.includes(type)),locality=get("locality")||get("postal_town")||get("administrative_area_level_2"),country=get("country"),postal=get("postal_code");return locality&&(out.city=locality.long_name||locality.short_name||""),country&&(out.countryName=country.long_name||"",out.countryCode=country.short_name||""),postal&&(out.postalCode=postal.long_name||postal.short_name||""),out},async resolveComponents({placeId,address}){try{const geo=await this.geocode({placeId,address}),best=geo&&geo.results&&geo.results[0]||null,parsed=this.extractComponents(best);return Object.assign({rawResult:best},parsed)}catch{return{city:"",postalCode:"",countryName:"",countryCode:"",rawResult:null}}},uuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){const r=Math.random()*16|0;return(c==="x"?r:r&3|8).toString(16)})}};window.FQ_GOOGLE=FQ_GOOGLE})(); 2//# sourceMappingURL=/cdn/shop/t/77/assets/google-maps-config.js.map?v=41547494009212138311758890628
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.