(function(){/*!****************************************!*\ !*** ./js/shopify-app-proxy-client.js ***! \****************************************/class ShopifyAppProxyClient{constructor(baseUrl,isDev=!1){this.baseUrl=baseUrl.replace(/\/$/,""),this.isDev=isDev}async request(path,method="GET",body=null){let options={method,headers:{}};this.isDev&&(options.headers["ngrok-skip-browser-warning"]="true"),body!=null&&(body instanceof FormData?options.body=body:(options.body=JSON.stringify(body),options.headers["Content-Type"]="application/json"));const res=await fetch(`${this.baseUrl}${path}`,options);let data;try{data=await res.json()}catch{throw{type:"network",message:"Network error"}}if(!res.ok||data.ok===!1)throw{type:"api",status:data.status||res.status,message:data.message||"Unknown error",ok:!1,raw:data};return data}getGiftCardBalance(code){return this.request(`/giftcard/${encodeURIComponent(code)}/balance`)}getStoresStock(sku){return this.request(`/stock/${encodeURIComponent(sku)}/info`)}subscribeToLoyalty(data){return this.request("/loyalty/register","POST",data)}updateBindingUrl(data){return this.request("/customer/binding","POST",data)}getAllStores(){return this.request("/stores/info")}getCartDiscountCode(){return this.request("/cart/discount")}}window.ShopifyAppProxyClient=ShopifyAppProxyClient})(); //# sourceMappingURL=/cdn/shop/t/4/assets/shopify-app-proxy-client.js.map?v=75795115024861883721760448476