1import { c as Component, h as html, M as ModalManager, m as Subscription, a as autobind } from './bundled-app.js'; 2 3function t(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}class GeolocationPopup extends Component{onAppInit(){this.canShow&&this.fetch();}render(){if(!this.state.target||!this.state.origin)return;let{target:t,origin:e}=this.state||{};return html` 4 <div class="geoloc"> 5 <img src="${window.cdnUrl}/${t.flag}" alt="${t.country} flag" class="geoloc__flag"> 6 <span role="status" class="geoloc__title h3">Switch to the ${t.shortname} Store</span> 7 <p class="geoloc__text">It looks like you are viewing our website for ${e.country}. Switch to our ${t.shortname} store.</p> 8 9 <div class="geoloc__actions"> 10 <a href="https://${t.domain}" class="cta cta--primary">Visit ${t.shortname} Site</a> 11 <button class="f-link f--u" close-modal>Continue Shopping</button> 12 </div> 13 </div> 14 `}async fetch(){let t=await fetch("/browsing_context_suggestions.json"),e=await t.json(),o=window.Shopify.country||"US",n=e.detected_values.country.handle,a=!1;"GB"!==o&&"GB"===n?(a=!0,this.setState({target:{flag:"flag-gb.png",shortname:"UK",country:"United Kingdom",domain:"hillhousehome.co.uk"},origin:{country:"United States"}})):"GB"===o&&"GB"!==n&&(a=!0,this.setState({target:{flag:"flag-us.png",shortname:"US",country:"United States",domain:"hillhousehome.com"},origin:{country:"United Kingdom"}})),a&&(this.modalManager.open("modal-geolocationPopup"),this.subscription.add(this.modalManager.stateChange$.subscribe({next:this.onModalChange})));}onModalChange(t){if(null===t){try{window.localStorage.setItem("seen_geoloc","true");}catch(t){console.error(t);}this.subscription.unsubscribe();}}constructor(...t){super(...t),this.state={target:null,origin:null},this.modalManager=ModalManager.getInstance(),this.canShow=window.localStorage?.getItem("seen_geoloc")!=="true",this.subscription=new Subscription;}}GeolocationPopup.selector="geolocation-popup",function(t,e,o,n){var a,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(s=(i<3?a(s):i>3?a(e,o,s):a(e,o))||s);i>3&&s&&Object.defineProperty(e,o,s);}([autobind,t("design:type",Function),t("design:paramtypes",["undefined"==typeof HTMLElement?Object:HTMLElement]),t("design:returntype",void 0)],GeolocationPopup.prototype,"onModalChange",null); 15 16export { GeolocationPopup };
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.