function preparedata(){ $(".smart-basket__price-common").each(function(){ $("#finalprice").val($(this).text()); }); if ($('.pric_new').is(':visible')){ $(".price_new_span").each(function(){ $("#finalprice").val($(this).text()); }); } } document.addEventListener("DOMContentLoaded", function() { var t, a, e, s = s || {}; s.scope = {}, s.findInternal = function(t, a, e) { t instanceof String && (t = String(t)); for (var s = t.length, r = 0; r < s; r++) { var n = t[r]; if (a.call(e, n, r, t)) return { i: r, v: n } } return { i: -1, v: void 0 } }, s.ASSUME_ES5 = !1, s.ASSUME_NO_NATIVE_MAP = !1, s.ASSUME_NO_NATIVE_SET = !1, s.SIMPLE_FROUND_POLYFILL = !1, s.defineProperty = s.ASSUME_ES5 || "function" == typeof Object.defineProperties ? Object.defineProperty : function(t, a, e) { t != Array.prototype && t != Object.prototype && (t[a] = e.value) }, s.getGlobal = function(t) { return "undefined" != typeof window && window === t ? t : "undefined" != typeof global && null != global ? global : t }, s.global = s.getGlobal(this), s.polyfill = function(t, a, e, r) { if (a) { for (e = s.global, t = t.split("."), r = 0; r < t.length - 1; r++) { var n = t[r]; n in e || (e[n] = {}), e = e[n] }(a = a(r = e[t = t[t.length - 1]])) != r && null != a && s.defineProperty(e, t, { configurable: !0, writable: !0, value: a }) } }, s.polyfill("Array.prototype.find", function(t) { return t || function(t, a) { return s.findInternal(this, t, a).v } }, "es6", "es3"), t = function(t) { var a = function(a, e, s) { var r = { invalid: [], getCaret: function() { try { var t = 0, e = a.get(0), s = document.selection, n = e.selectionStart; if (s && -1 === navigator.appVersion.indexOf("MSIE 10")) { var i = s.createRange(); i.moveStart("character", -r.val().length), t = i.text.length } else(n || "0" === n) && (t = n); return t } catch (t) {} }, setCaret: function(t) { try { if (a.is(":focus")) { var e = a.get(0); if (e.setSelectionRange) e.setSelectionRange(t, t); else { var s = e.createTextRange(); s.collapse(!0), s.moveEnd("character", t), s.moveStart("character", t), s.select() } } } catch (t) {} }, events: function() { a.on("keydown.mask", function(t) { a.data("mask-keycode", t.keyCode || t.which), a.data("mask-previus-value", a.val()), a.data("mask-previus-caret-pos", r.getCaret()), r.maskDigitPosMapOld = r.maskDigitPosMap }).on(t.jMaskGlobals.useInput ? "input.mask" : "keyup.mask", r.behaviour).on("paste.mask drop.mask", function() { setTimeout(function() { a.keydown().keyup() }, 100) }).on("change.mask", function() { a.data("changed", !0) }).on("blur.mask", function() { o === r.val() || a.data("changed") || a.trigger("change"), a.data("changed", !1) }).on("blur.mask", function() { o = r.val() }).on("focus.mask", function(a) { !0 === s.selectOnFocus && t(a.target).select() }).on("focusout.mask", function() { s.clearIfNotMatch && !n.test(r.val()) && r.val("") }) }, getRegexMask: function() { for (var t, a, s, r, n = [], o = 0; o < e.length; o++)(t = i.translation[e.charAt(o)]) ? (a = t.pattern.toString().replace(/.{1}$|^.{1}/g, ""), s = t.optional, (t = t.recursive) ? (n.push(e.charAt(o)), r = { digit: e.charAt(o), pattern: a }) : n.push(s || t ? a + "?" : a)) : n.push(e.charAt(o).replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")); return n = n.join(""), r && (n = n.replace(new RegExp("(" + r.digit + "(.*" + r.digit + ")?)"), "($1)?").replace(new RegExp(r.digit, "g"), r.pattern)), new RegExp(n) }, destroyEvents: function() { a.off("input keydown keyup paste drop blur focusout ".split(" ").join(".mask ")) }, val: function(t) { var e = a.is("input") ? "val" : "text"; return 0 < arguments.length ? (a[e]() !== t && a[e](t), e = a) : e = a[e](), e }, calculateCaretPosition: function(t) { var e = r.getMasked(), s = r.getCaret(); if (t !== e) { var n = a.data("mask-previus-caret-pos") || 0; e = e.length; var i, o = t.length, l = t = 0, c = 0, p = 0; for (i = s; i < e && r.maskDigitPosMap[i]; i++) l++; for (i = s - 1; 0 <= i && r.maskDigitPosMap[i]; i--) t++; for (i = s - 1; 0 <= i; i--) r.maskDigitPosMap[i] && c++; for (i = n - 1; 0 <= i; i--) r.maskDigitPosMapOld[i] && p++; s > o ? s = 10 * e : n >= s && n !== o ? r.maskDigitPosMapOld[s] || (n = s, s = s - (p - c) - t, r.maskDigitPosMap[s] && (s = n)) : s > n && (s = s + (c - p) + l) } return s }, behaviour: function(e) { e = e || window.event, r.invalid = []; var s = a.data("mask-keycode"); if (-1 === t.inArray(s, i.byPassKeys)) { s = r.getMasked(); var n = r.getCaret(), o = a.data("mask-previus-value") || ""; return setTimeout(function() { r.setCaret(r.calculateCaretPosition(o)) }, t.jMaskGlobals.keyStrokeCompensation), r.val(s), r.setCaret(n), r.callbacks(e) } }, getMasked: function(t, a) { var n, o = [], l = void 0 === a ? r.val() : a + "", c = 0, p = e.length, d = 0, u = l.length, m = 1, k = "push", b = -1, f = 0; if (a = [], s.reverse) { k = "unshift", m = -1; var v = 0; c = p - 1, d = u - 1; var _ = function() { return -1 < c && -1 < d } } else v = p - 1, _ = function() { return c < p && d < u }; for (; _();) { var h = e.charAt(c), g = l.charAt(d), y = i.translation[h]; y ? (g.match(y.pattern) ? (o[k](g), y.recursive && (-1 === b ? b = c : c === v && c !== b && (c = b - m), v === b && (c -= m)), c += m) : g === n ? (f--, n = void 0) : y.optional ? (c += m, d -= m) : y.fallback ? (o[k](y.fallback), c += m, d -= m) : r.invalid.push({ p: d, v: g, e: y.pattern }), d += m) : (t || o[k](h), g === h ? (a.push(d), d += m) : (n = h, a.push(d + f), f++), c += m) } return t = e.charAt(v), p !== u + 1 || i.translation[t] || o.push(t), o = o.join(""), r.mapMaskdigitPositions(o, a, u), o }, mapMaskdigitPositions: function(t, a, e) { for (t = s.reverse ? t.length - e : 0, r.maskDigitPosMap = {}, e = 0; e < a.length; e++) r.maskDigitPosMap[a[e] + t] = 1 }, callbacks: function(t) { var n = r.val(), i = n !== o, l = [n, t, a, s], c = function(t, a, e) { "function" == typeof s[t] && a && s[t].apply(this, e) }; c("onChange", !0 === i, l), c("onKeyPress", !0 === i, l), c("onComplete", n.length === e.length, l), c("onInvalid", 0 < r.invalid.length, [n, t, a, r.invalid, s]) } }; a = t(a); var n, i = this, o = r.val(); e = "function" == typeof e ? e(r.val(), void 0, a, s) : e, i.mask = e, i.options = s, i.remove = function() { var t = r.getCaret(); return i.options.placeholder && a.removeAttr("placeholder"), a.data("mask-maxlength") && a.removeAttr("maxlength"), r.destroyEvents(), r.val(i.getCleanVal()), r.setCaret(t), a }, i.getCleanVal = function() { return r.getMasked(!0) }, i.getMaskedVal = function(t) { return r.getMasked(!1, t) }, i.init = function(o) { if (o = o || !1, s = s || {}, i.clearIfNotMatch = t.jMaskGlobals.clearIfNotMatch, i.byPassKeys = t.jMaskGlobals.byPassKeys, i.translation = t.extend({}, t.jMaskGlobals.translation, s.translation), i = t.extend(!0, {}, i, s), n = r.getRegexMask(), o) r.events(), r.val(r.getMasked()); else { s.placeholder && a.attr("placeholder", s.placeholder), a.data("mask") && a.attr("autocomplete", "off"), o = 0; for (var l = !0; o < e.length; o++) { var c = i.translation[e.charAt(o)]; if (c && c.recursive) { l = !1; break } } l && a.attr("maxlength", e.length).data("mask-maxlength", !0), r.destroyEvents(), r.events(), o = r.getCaret(), r.val(r.getMasked()), r.setCaret(o) } }, i.init(!a.is("input")) }; t.maskWatchers = {}; var e = function() { var e = t(this), r = {}, n = e.attr("data-mask"); if (e.attr("data-mask-reverse") && (r.reverse = !0), e.attr("data-mask-clearifnotmatch") && (r.clearIfNotMatch = !0), "true" === e.attr("data-mask-selectonfocus") && (r.selectOnFocus = !0), s(e, n, r)) return e.data("mask", new a(this, n, r)) }, s = function(a, e, s) { s = s || {}; var r = t(a).data("mask"), n = JSON.stringify; a = t(a).val() || t(a).text(); try { return "function" == typeof e && (e = e(a)), "object" != typeof r || n(r.options) !== n(s) || r.mask !== e } catch (t) {} }, r = function(t) { var a = document.createElement("div"), e = (t = "on" + t) in a; return e || (a.setAttribute(t, "return;"), e = "function" == typeof a[t]), e }; t.fn.mask = function(e, r) { r = r || {}; var n = this.selector, i = t.jMaskGlobals, o = i.watchInterval; i = r.watchInputs || i.watchInputs; var l = function() { if (s(this, e, r)) return t(this).data("mask", new a(this, e, r)) }; return t(this).each(l), n && "" !== n && i && (clearInterval(t.maskWatchers[n]), t.maskWatchers[n] = setInterval(function() { t(document).find(n).each(l) }, o)), this }, t.fn.masked = function(t) { return this.data("mask").getMaskedVal(t) }, t.fn.unmask = function() { return clearInterval(t.maskWatchers[this.selector]), delete t.maskWatchers[this.selector], this.each(function() { var a = t(this).data("mask"); a && a.remove().removeData("mask") }) }, t.fn.cleanVal = function() { return this.data("mask").getCleanVal() }, t.applyDataMask = function(a) { ((a = a || t.jMaskGlobals.maskElements) instanceof t ? a : t(a)).filter(t.jMaskGlobals.dataMaskAttr).each(e) }, r = { maskElements: "input,td,span,div", dataMaskAttr: "*[data-mask]", dataMask: !0, watchInterval: 300, watchInputs: !0, keyStrokeCompensation: 10, useInput: !/Chrome\/[2-4][0-9]|SamsungBrowser/.test(window.navigator.userAgent) && r("input"), watchDataMask: !1, byPassKeys: [9, 16, 17, 18, 36, 37, 38, 39, 40, 91], translation: { 0: { pattern: /\d/ }, 9: { pattern: /\d/, optional: !0 }, "#": { pattern: /\d/, recursive: !0 }, A: { pattern: /[a-zA-Z0-9]/ }, S: { pattern: /[a-zA-Z]/ } } }, t.jMaskGlobals = t.jMaskGlobals || {}, (r = t.jMaskGlobals = t.extend(!0, {}, r, t.jMaskGlobals)).dataMask && t.applyDataMask(), setInterval(function() { t.jMaskGlobals.watchDataMask && t.applyDataMask() }, r.watchInterval) }, a = window.jQuery, e = window.Zepto, "function" == typeof define && define.amd ? define(["jquery"], t) : "object" == typeof exports && "undefined" == typeof Meteor ? module.exports = t(require("jquery")) : t(a || e) }), document.addEventListener("DOMContentLoaded", function() { var t, a, e; t = jQuery, a = { productElement: "product__element", buttonAddToBasket: "product__add-to-cart-button", countryCode: "+38", smartBasketCurrency: "AED", productQuantityWrapper: !1, productPrice: !1, productSize: !1, smartBasketMinArea: "header__basket-min", smartBasketMinIconPath: "img/shopping-basket-wight.svg", smartBasketMinText: !1, telIsRequired: !0, emailIsRequired: !1, nameIsRequired: !0, localStorageName: "basketItems", yaCounter: { counterID: "", targetID: "" } },a.smartBasketCurrency="AED", e = { getProducts: function() { return JSON.parse(localStorage.getItem(a.localStorageName)) }, setProducts: function(t) { let e = JSON.stringify(t, "", 4); return localStorage.setItem(a.localStorageName, e), !1 }, deleteProducts: function(a, s) { let r = t("