(()=>{var r,e={143:(r,e,o)=>{const t=o(47186),n=o(55364),i=o(58188),{setCookie:a}=o(77798),{ADD_TO_CART_COOKIE:s}=o(42868),d={headers:{common:{"X-Requested-With":"XMLHttpRequest"}}};r.exports=r=>{const e=i(n({},d,r));return e.originalDoRequest=e.doRequest,e.doRequest=function(r){return this.originalDoRequest(r).catch((e=>{const o=null==e?void 0:e.response;if(o&&401===o.status&&o.data&&o.data.data.login){let e="";if(r.loginParams&&(e=`&${t.stringify(r.loginParams)}`),"/api/search/cart"===r.url){const{quantity:e,permalink:o,item_id:t}=(null==r?void 0:r.data)||{};e&&t&&a(s,{quantity:e,permalink:o,item_id:t})}window.location=`${o.data.data.login}${e}`}else{if(!o||301!==o.status||!o.data.location)throw e;window.location=o.data.location}}))},e}},21174:(r,e,o)=>{"use strict";o(74423),o(23792),o(18111),o(20116),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953);var t=o(143);const n=o.n(t)()({timeout:1e4,baseURL:"/api/search"}),i=r=>{n.post("/stats",{data:r})},a="UNKNOWN_VALUE",s="error_handler",d="js_error",c="script_catch",u={CORE:"core",CLIPS:"clips",SUPER:"super",ESHOP:"eshops",MODA:"moda",VIS:"vis",COMPATS:"compats",CBT:"cbt",BRAND_ADS:"brand_ads",PADS:"pads"},l={ERROR_BOUNDARY:"error_boundary",MIDDLEWARE:"middleware",TRY_CATCH:"try_catch",JS_ERROR:"js_error"};var _=o(5556);const h=r=>{var e,o;let{key:t="",listOfKey:n=[],defaultReturn:i}=r;const a=null==n?void 0:n.find((r=>(null==r?void 0:r.toLowerCase())===(null==t?void 0:t.toLowerCase())));return null!==(e=null!==(o=null==a?void 0:a.toLowerCase())&&void 0!==o?o:i)&&void 0!==e?e:null},f=r=>{var e,o,t,n,c;let{errorType:_,errorCatcher:f,key:m=null,errorMessage:p,errorStack:g,errorServiceName:v=a}=r;const R=(null===(e=window)||void 0===e?void 0:e.PAGE_TYPE)||a,O=(null===(o=window)||void 0===o?void 0:o.ERROR_COMPONENT_NAME)||a,y=null!==(t=h({key:null===(n=window)||void 0===n?void 0:n.VERTICAL_APP__NAME,listOfKey:Object.keys(u),defaultReturn:null===(c=u.CORE)||void 0===c?void 0:c.toLowerCase()}))&&void 0!==t?t:a,w=null!=m?m:`${s}.${d}`,E=h({key:f,listOfKey:Object.keys(l),defaultReturn:a});i({key:w,tags:{error_type:_,vertical_app:y,error_component_name:O,error_page_type:R,error_catcher:E,error_service_name:v},info:{error_component_name:O,error_message:p,error_stack:g},messageTitle:"Search-ErrorHandler - JsError"}),window.ERROR_BOUNDARY=void 0,window.ERROR_COMPONENT_NAME=void 0,window.VERTICAL_APP__NAME=void 0};f.protoType={key:_.string,errorType:_.string.isRequired,errorCatcher:_.string.isRequired,errorMessage:_.string.isRequired,errorStack:_.string,errorServiceName:_.string};const m={"Script error":"script_error","Uncaught ReferenceError":"uncaught_reference_error","Uncaught TypeError":"uncaught_type_error","Uncaught SyntaxError":"uncaught_syntax_error","Uncaught RangeError":"uncaught_range_error","Uncaught Error: Minified React error #425":"mismatch_error","Uncaught Error: Minified React error #418":"mismatch_error","Uncaught Error: Minified React error #423":"mismatch_error","Uncaught Error: Text content does not match server-rendered HTML.":"mismatch_error","Uncaught Error: Hydration failed because the initial UI does not match what was rendered on the server.":"mismatch_error","Uncaught Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.":"mismatch_error","Uncaught Error":"uncaught_error","Minified React error #418;":"minified_418","Minified React error #423;":"minified_423","Minified React error #425;":"minified_425","Unhandled Promise Rejection":"unhandled_promise_rejection","Cannot read properties of undefined":"undefined_destructuring"};const p=new Set;window.catchErrorBoundary=function(){i(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},window.addEventListener("error",(r=>{try{var e,o;const t=function(r){if(!r)return a;const e=Object.keys(m).find((e=>r.includes(e)));return e?m[e]:"generic"}(r.message),n=`${(null===(e=window)||void 0===e?void 0:e.ERROR_COMPONENT_NAME)||a}_${t}`;if(p.has(n))return;p.add(n),f({errorType:t,errorCatcher:(null===(o=window)||void 0===o?void 0:o.ERROR_BOUNDARY)||l.JS_ERROR,errorStack:r.error.stack,errorMessage:r.error.message})}catch(r){var t;console.error("Error sending error metric",r),f({key:`${s}.${c}`,errorType:"sending_error_metric",errorCatcher:(null===(t=window)||void 0===t?void 0:t.ERROR_BOUNDARY)||l.JS_ERROR,errorStack:r.stack,errorMessage:r.message})}}))},42868:r=>{r.exports={ADD_TO_CART_COOKIE:"ml_search-nordic_add-to-cart-post-login"}},53033:(r,e,o)=>{"use strict";o.d(e,{Sw:()=>t});o(74423),o(27495);const t=!("undefined"==typeof window||!window.document||!window.document.createElement);t&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&window.IntersectionObserverEntry.prototype},62953:(r,e,o)=>{"use strict";var t=o(44576),n=o(67400),i=o(79296),a=o(23792),s=o(66699),d=o(10687),c=o(78227)("iterator"),u=a.values,l=function(r,e){if(r){if(r[c]!==u)try{s(r,c,u)}catch(e){r[c]=u}if(d(r,e,!0),n[e])for(var o in a)if(r[o]!==a[o])try{s(r,o,a[o])}catch(e){r[o]=a[o]}}};for(var _ in n)l(t[_]&&t[_].prototype,_);l(i,"DOMTokenList")},77798:(r,e,o)=>{"use strict";o.r(e),o.d(e,{getCookie:()=>u,getListCookieByPrefix:()=>c,getPrimaryDomain:()=>a,isCookieMarked:()=>s,markWithCookie:()=>d,setCookie:()=>l});o(74423),o(72712),o(18111),o(20116),o(7588),o(18237),o(33110),o(84864),o(57465),o(27495);var t=o(55364),n=o.n(t),i=o(53033);const a=r=>r.split(".").reduce(((r,e)=>r&&""!==r?`${r}.${e}`:null!=e&&e.includes("mercadoli")?e:""),"")||r,s=r=>{if(i.Sw&&document&&document.cookie){const e=document.cookie.split(";").find((e=>e.split("=")[0].trim()===r));return e&&(e.indexOf("userhide")>0||e.indexOf("hidden")>0)||!1}return!1},d=(r,e)=>{if(i.Sw&&document&&document.cookie){const o=a(document.domain),t=e?`;max-age=${e}`:"";document.cookie=`${r}=userhide${t};domain=${o};path=/`}},c=(r,e)=>{const o={};return Object.keys(r).forEach((t=>{t.startsWith(e)&&(o[`${t}`]=r[`${t}`])})),o},u=r=>{if("undefined"==typeof window)return null;const e=RegExp(`(^|;\\s*)(${r})=([^;]*)`).exec(document.cookie);if(e)try{return{[r]:JSON.parse(e[3])}}catch(o){return{[r]:e[3]}}return null},l=function(r,e){let o,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"==typeof e){const t=u(r);o=JSON.stringify(t?n()(t[r],e):e)}else o=e;const i=Object.keys(t);let a="";i.length>0&&(a=i.reduce(((r,e)=>`${r};${e}=${t[e]}`),"")),document.cookie=`${r}=${o}${a}`}}},o={};function t(r){var n=o[r];if(void 0!==n)return n.exports;var i=o[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}t.m=e,r=[],t.O=(e,o,n,i)=>{if(!o){var a=1/0;for(u=0;u=i)&&Object.keys(t.O).every((r=>t.O[r](o[d])))?o.splice(d--,1):(s=!1,i0&&r[u-1][2]>i;u--)r[u]=r[u-1];r[u]=[o,n,i]},t.n=r=>{var e=r&&r.__esModule?()=>r.default:()=>r;return t.d(e,{a:e}),e},t.d=(r,e)=>{for(var o in e)t.o(e,o)&&!t.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:e[o]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(r){if("object"==typeof window)return window}}(),t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),t.r=r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},t.nmd=r=>(r.paths=[],r.children||(r.children=[]),r),(()=>{var r={8021:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var n,i,[a,s,d]=o,c=0;if(a.some((e=>0!==r[e]))){for(n in s)t.o(s,n)&&(t.m[n]=s[n]);if(d)var u=d(t)}for(e&&e(o);ct(21174)));n=t.O(n)})(); //# sourceMappingURL=errorhandler.26cf8d04.js.map