PageSourceSearch

https://reyhee.com/cdn/shop/t/7/assets/pickup-availability.js?v=40321155394539970731694021688

js reyhee.com collected 2026-10-08 21:29:22 UTC 4,398 bytes, 2 lines download raw bytes

1customElements.get("pickup-availability")||customElements.define("pickup-availability",class extends HTMLElement{constructor(){super(),this.hasAttribute("available")&&(this.errorHtml=this.querySelector("template").content.firstElementChild.cloneNode(!0),this.variantId=this.dataset.variantId,this.fetchAvailability(this.variantId))}fecthPositionAndAvailability(variantId,sectionInnerHTML){this.renderPreview(sectionInnerHTML)}fetchAvailability(variantId){const variantSectionUrl=`${this.dataset.baseUrl}variants/${variantId}/?section_id=pickup-availability`;fetch(variantSectionUrl).then(response=>response.text()).then(text=>{const sectionInnerHTML=new DOMParser().parseFromString(text,"text/html").querySelector(".shopify-section");this.fecthPositionAndAvailability(variantId,sectionInnerHTML)}).catch(e=>{this.renderError()})}renderError(){this.innerHTML="",this.errorHtml&&this.appendChild(this.errorHtml)}successCurrentLocation(position,sectionInnerHTML){this.customerLat=position.coords.latitude,this.customerLong=position.coords.longitude,this.getCLosestLocation(sectionInnerHTML)}errorCurrentLocation(sectionInnerHTML){this.renderPreview(sectionInnerHTML)}distance(lat1,lon1,lat2,lon2,unit){const radlat1=Math.PI*lat1/180,radlat2=Math.PI*lat2/180,theta=lon1-lon2,radtheta=Math.PI*theta/180;let dist=Math.sin(radlat1)*Math.sin(radlat2)+Math.cos(radlat1)*Math.cos(radlat2)*Math.cos(radtheta);return dist>1&&(dist=1),dist=Math.acos(dist),dist=dist*180/Math.PI,dist=dist*60*1.1515,unit=="K"&&(dist=dist*1.609344),unit=="N"&&(dist=dist*.8684),dist}getCLosestLocation(sectionInnerHTML){const poslat=this.customerLat,poslng=this.customerLong;let closestDistance,closestStore;this.availableLocations.forEach(store=>{const distance=this.distance(poslat,poslng,store.location.address.latitude,store.location.address.longitude,"K");closestDistance&&distance<closestDistance&&(closestDistance=distance,closestStore=store),closestDistance||(closestDistance=distance,closestStore=store)}),this.closestStore=closestStore,this.renderPreview(sectionInnerHTML)}renderPreview(sectionInnerHTML){const drawer=document.querySelector("pickup-availability-drawer");if(drawer&&drawer.remove(),!sectionInnerHTML.querySelector("pickup-availability-preview")){this.innerHTML="",this.removeAttribute("available");return}if(this.closestStore){const pickUpTime=this.closestStore.pick_up_time.replace("Usually ready in","Ready in about");sectionInnerHTML.querySelector(".pickup-availability-info .caption-large .pickup-store-name").textContent=this.closestStore.location.name,sectionInnerHTML.querySelector(".pickup-availability-info .caption").textContent=pickUpTime}this.innerHTML=sectionInnerHTML.querySelector("pickup-availability-preview").outerHTML,this.setAttribute("available","");const colorSwatch=sectionInnerHTML.querySelector(".color-swatch");colorSwatch&&hideUnavailableColors(colorSwatch),document.body.appendChild(sectionInnerHTML.querySelector("pickup-availability-drawer")),this.querySelector("button").addEventListener("click",evt=>{document.querySelector("pickup-availability-drawer").show(evt.target)})}}),customElements.get("pickup-availability-drawer")||customElements.define("pickup-availability-drawer",class extends HTMLElement{constructor(){super(),this.onBodyClick=this.handleBodyClick.bind(this),this.querySelector("button").addEventListener("click",()=>{this.hide()}),this.addEventListener("keyup",e=>{e.code.toUpperCase()==="ESCAPE"&&this.hide()})}handleBodyClick(evt){const target=evt.target;target!=this&&!target.closest("pickup-availability-drawer")&&target.id!="ShowPickupAvailabilityDrawer"&&this.hide()}hide(){this.removeAttribute("open"),document.body.classList.remove("pickup-availability-drawer"),document.body.removeEventListener("click",this.onBodyClick);const scrollY=document.body.style.top;document.body.classList.remove("overflow-hidden"),document.body.style.top="",window.scrollTo(0,parseInt(scrollY||"0")*-1),removeTrapFocus(this.focusElement)}show(focusElement){this.focusElement=focusElement,this.setAttribute("open",""),document.body.classList.add("pickup-availability-drawer"),document.body.addEventListener("click",this.onBodyClick);const scrollY=window.scrollY;document.body.classList.add("overflow-hidden"),document.body.style.top=`-${scrollY}px`,trapFocus(this)}});
2//# sourceMappingURL=/cdn/shop/t/7/assets/pickup-availability.js.map?v=40321155394539970731694021688

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.