1import{S as d,T as c,A as r,c as p}from"./D2IC83re.js";import{u as f}from"./BehcviJw.js";try{(function(){var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="abcd628b-92e4-44aa-86bc-243a46806d75",t._sentryDebugIdIdentifier="sentry-dbid-abcd628b-92e4-44aa-86bc-243a46806d75")})()}catch{}function y(){const t=e=>{const o=e.target?.closest("[data-code]");if(!o||!(o.classList.contains("coupon-apply-btn")||o.hasAttribute("data-code")))return;e.preventDefault();const s=o.getAttribute("data-code")||"",a=o.getAttribute("data-redirect")||"";s&&l(s,a)};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t)}}function i(t){if(!t)return"";const e=["https://front.test.tastycoffee.ru/","https://shop.tastycoffee.ru/"];for(const o of e)if(t.startsWith(o))return t.substring(o.length-1);return t}function l(t,e){const o=d(),{applyCoupon:s,handleCouponApplyResult:a}=f();if(o.form.coupon_code===t){if(e){const n=i(e);sessionStorage.setItem("coupon_toast_message","ÐÑомокод Ñже пÑименен"),sessionStorage.setItem("coupon_toast_type","info"),c(n)}else r().$toast.info("ÐÑомокод Ñже пÑименен");return}s(t).then(a).then(n=>{if(n.applied)if(e){const u=i(e);sessionStorage.setItem("coupon_toast_message","ÐÑомокод ÑÑпеÑно пÑименен"),sessionStorage.setItem("coupon_toast_type","success"),c(u)}else r().$toast.success("ÐÑомокод ÑÑпеÑно пÑименен");else r().$toast.error(n.errorMessage)}
1).catch(p)}export{y as a};
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.