{
  "version": 3,
  "sources": ["/cdn/shop/t/1102/assets/cookies-GWP.js?enable_js_minification=1"],
  "sourcesContent": ["// cookie functions\nfunction setCookie(name, value, days) {\n    let expires = '';\n    if (days) {\n        let date = new Date();\n        date.setTime(date.getTime() + (days*24*60*60*1000));\n        expires = \"; expires=\" + date.toUTCString();\n    }\n    document.cookie = name + \"=\" + (value || \"\")  + expires + \"; path=/\";\n}\n\nfunction getCookie(name) {\n    const nameEQ = name + \"=\";\n    const ca = document.cookie.split(';');\n    for (let i=0; i < ca.length; i++) {\n        let c = ca[i];\n        while (c.charAt(0)==' ') c = c.substring(1,c.length);\n        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);\n    }\n    return null;\n}\n\nfunction deleteCookie(name) {\n    document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';\n}\n\n/// Get theme setting values ////\nconst breakUrl = window.location.href.slice(window.location.href.indexOf('/') + 1).split('/');\nlet countryIso = $('body').data('country-iso');\n\nif (breakUrl[3] === 'checkouts') {\n    const [html] = document.getElementsByTagName(\"html\")\n    const checkoutLang = html.getAttribute(\"lang\");\n    if (checkoutLang == 'en-GB') {\n        countryIso = 'GB'\n    } else {\n        countryIso = 'US'\n    }\n}\n\nconst activeCodlessGWP = (countryIso == 'GB') ? \"false\" : \"false\";\nconst codlessGWP = (countryIso == 'GB') ? \"40549029675196\" : \"\";\nconst codlessThresh = (countryIso == 'GB') ? \"25\" : \"\";\nconst codlessChildProduct = (countryIso == 'GB') ? \"false\": \"false\";\nconst codlessChildProduct1 = (countryIso == 'GB') ? \"\" : \"\";\nconst codlessChildProductVariant1 = (countryIso == 'GB') ? \"\" : \"\";\nconst codlessChildProduct2 = (countryIso == 'GB') ? \"\" : \"\";\nconst codlessChildProductVariant2 = (countryIso == 'GB') ? \"\" : \"\";\nconst codlessChildProduct3 = (countryIso == 'GB') ? \"\" : \"\";\nconst codlessChildProductVariant3 = (countryIso == 'GB') ? \"\" : \"\";\nconst codlessChildProduct4 = (countryIso == 'GB') ? \"\" : \"\";\nconst codlessChildProductVariant4 = (countryIso == 'GB') ? \"\" : \"\";\nconst codlessChildProduct5 = (countryIso == 'GB') ? \"\" : \"\";\nconst codlessChildProductVariant5 = (countryIso == 'GB') ? \"\" : \"\";\n\nconst enableGWPAutoBuyXGetYGwp = (countryIso == 'GB') ? \"true\" : \"false\";\nconst autoBuyXGetYGwp = (countryIso == 'GB') ? \"\" : \"\";\nconst autoBuyXGetYGwpHandle = (countryIso == 'GB') ? \"\" : \"\";\nconst autoBuyXGetYGwpPurchaseProduct = (countryIso == 'GB') ? \"\" : \"\";\n\nconst freeGiftIds = getCookie('setting_updates');\nconst makeCookiesString = `${activeCodlessGWP}${codlessGWP}${codlessThresh}${codlessChildProduct}${codlessChildProduct1}${codlessChildProductVariant1}${codlessChildProduct2}${codlessChildProductVariant2}${codlessChildProduct3}${codlessChildProductVariant3}${codlessChildProduct4}${codlessChildProductVariant4}${codlessChildProduct5}${codlessChildProductVariant5}${enableGWPAutoBuyXGetYGwp}${autoBuyXGetYGwp}${autoBuyXGetYGwpHandle}${autoBuyXGetYGwpPurchaseProduct}`;\n// if free sample / GWP settings change, empty the cart\n\nif (freeGiftIds !== makeCookiesString) {\n    setCookie('setting_updates', makeCookiesString, 14);\n\n    var updates_obj = {};\n    /// get and remove free product from cart ///\n    $.ajax({\n        url: '/cart.js',\n        dataType: 'json',\n        async: false,\n        type: 'get',\n        success: function(new_cart) {\n            $.each( new_cart.items, function( key, value ) {\n                if (value.price == 0 && value.product_type != \"Sample Product\") {\n                    updates_obj[value.id] = 0;\n                }\n            });\n        }\n    });\n\n    $.ajax({\n        url: '/cart/update.js',\n        dataType: 'json',\n        async: false,\n        type: 'post',\n        data: {updates: updates_obj},\n        success: function(updatedCartObject) {\n            // updateGWP(updatedCartObject, true, true, undefined , true);\n\n            /// if any chnages in cookies redirection on checkout page ///\n            if (breakUrl[3] == 'checkouts') {\n                setTimeout(function() {\n                    window.location.re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