1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2832],{3185:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(26542),o=n(29793),a=n(17086);function l(){let[e,t,n]=(0,o.lT)([r.V8.Customer,r.V8.StoreCode,r.V8.MgStoreCode,r.V8.GroupId]);return{customerToken:e[r.V8.Customer],removeAuthCookies:()=>{let e=(0,r.I1)();for(let t in e)n(t,{domain:(0,r.R2)(t)})},setAuthCookies:e=>{let n=function(e){let t=(0,a.gK)()===a.aM.Production;return{[r.V8.Customer]:null==e?void 0:e.token,[r.V8.StoreCode]:null==e?void 0:e.store_code,[r.V8.MgStoreCode]:null==e?void 0:e.store_code,[r.V8.MemberSku]:null==e?void 0:e.sku,...t?{[r.V8.FusionProdToken]:null==e?void 0:e.fusion_token,[r.V8.FusionProdCustomerId]:null==e?void 0:e.fusion_userid}:{[r.V8.FusionDevToken]:null==e?void 0:e.fusion_token,[r.V8.FusionDevCustomerId]:null==e?void 0:e.fusion_userid}}}(e);for(let e in n)t(e,n[e]||"",{domain:(0,r.R2)(e)})}}}},29239:(e,t,n)=>{n.d(t,{M:()=>r});function r(e,t){var n,r;let o=null!=(n=null==t?void 0:t.delay)?n:50,a=null!=(r=null==t?void 0:t.timeout)?r:200,l=window;if(l.requestIdleCallback){let t=null,n=null;return t=window.setTimeout(()=>{var r,o;t=null,n=null!=(o=null==(r=l.requestIdleCallback)?void 0:r.call(l,e,{timeout:a}))?o:null},o),()=>{if(null!==t&&window.clearTimeout(t),null!==n){var e;null==(e=l.cancelIdleCallback)||e.call(l,n)}}}let i=window.setTimeout(e,o);return()=>window.clearTimeout(i)}},32832:(e,t,n)=>{n.r(t),n.d(t,{default:()=>M});var r=n(5740),o=n(76704),a=n(93204),l=n(71985),i=n(3185),c=n(39990),s=n(7707),u=n(83577),d=n(62866);function f(e){return e&&"object"==typeof e?e:{}}function g(e){return null==e?"":String(e).trim()}function _(e){if("boolean"==typeof e)return e;if("number"==typeof e)return 1===e;if("string"!=typeof e)return!1;let t=e.trim().toLowerCase();return"1"===t||"true"===t||"yes"===t}function h(e){if(null==e||""===e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}async function m(e){let{isGuest:t}=e,n=await (0,d.H)("".concat("/rest/V1/mpFreeShippingBar/".concat(t?"guest":"mine"),"/shippingbar"),{method:"GET",credentials:"include",headers:{Accept:"application/json","x-requested-with":"XMLHttpRequest"}});return(function(e){if(Array.isArray(e))return e;let t=f(e),n=t.data;if(Array.isArray(n))return n;let r=f(n);return[t.items,t.rules,t.shippingBars,t.shipping_bars,r.items,r.rules,r.shippingBars,r.shipping_bars,r.list].find(Array.isArray)||[]})(await n.json()).map(e=>{var t;let n=f(e),r=g(n.rule_id||n.id),o=g(n.first_message||n.message);if(!r||!o)return null;let a=function(e){let t=g(e);if(t)try{let e=window.location.origin,n=new URL(t,e);if("http:"===n.protocol||"https:"===n.protocol)return t}catch(e){}}(n.url_shippingbar||n.url),l=_(null!=(t=n.click_able)?t:n.clickable);return{rule_id:r,first_message:o,from_date:g(n.from_date),to_date:g(n.to_date),bar_background:g(n.bar_background),bar_opacity:function(e){let t=h(e);if(void 0!==t)return t>1?Math.min(t/100,1):Math.max(t,0)}(n.bar_opacity),font_size:h(n.font_size),bar_text_color:g(n.bar_text_color),bar_link_color:g(n.bar_link_color),url_shippingbar:a,click_able:!!(l&&a),open_new_page:_(n.open_new_page)}}).filter(e=>!!e).slice(0,10)}var p=n(34521),v=n(68015),b=n(29239);function y(e){let t=(null==e?void 0:e.trim().replace(" ","T"))||"";if(!t)return null;let n=new Date(t).getTime();return Number.isFinite(n)?n:null}function w(e){return"string"==typeof e&&e.trim()?e.trim():void 0}function k(e){let{html:t,className:n,isActive:a=!0,onOverflowChange:l,onCycleComplete:i}=e,c=(0,o.useRef)(null),s=(0,o.useRef)(null),u=(0,o.useRef)(l);u.current=l;let d=(0,o.useRef)(i);d.current=i;let[f,g]=(0,o.useState)(!1),[_,h]=(0,o.useState)(0);(0,o.useEffect)(()=>{if(!a){var e;g(!1),h(0),null==(e=u.current)||e.call(u,!1);return}let t=c.current,n=s.current;if(!t||!n)return;let r=()=>{var e;let r=t.clientWidth,o=n.scrollWidth,a=o>r+1;a?h(Math.max(8,(o+48)/60)):h(0),g(a),null==(e=u.current)||e.call(u,a)};r();let o=new ResizeObserver(r);return o.observe(t),o.observe(n),()=>o.disconnect()},[t,a]);let m=a&&f&&_>0;return(0,r.jsxs)("div",{ref:c,className:["mg-shipping-marquee relative w-full overflow-hidden",n].filter(
1Boolean).join(" "),children:[(0,r.jsx)("span",{ref:s,"aria-hidden":!0,className:"invisible pointer-events-none absolute left-0 top-0 inline-block whitespace-nowrap",dangerouslySetInnerHTML:{__html:t}}),f?(0,r.jsxs)("div",{className:m?"mg-shipping-marquee-inner inline-flex whitespace-nowrap":"inline-flex whitespace-nowrap",style:m?{animationDuration:"".concat(_,"s"),animationDelay:"".concat(1.2,"s")}:void 0,onAnimationIteration:()=>{var e;return null==(e=d.current)?void 0:e.call(d)},children:[(0,r.jsx)("span",{className:"inline-block pr-12",dangerouslySetInnerHTML:{__html:t}}),(0,r.jsx)("span",{"aria-hidden":!0,className:"inline-block pr-12",dangerouslySetInnerHTML:{__html:t}})]},"".concat(a?"1":"0","-").concat(f?"1":"0")):(0,r.jsx)("span",{className:"block truncate",dangerouslySetInnerHTML:{__html:t}})]})}function S(e){return"".concat("mg:shipping-bar:closed",":").concat(e||"")}function C(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}}function x(e){let{item:t,onClose:n,isActive:o,onOverflowChange:a,onCycleComplete:i}=e,c={backgroundColor:w(t.bar_background)||"#8fc31f",opacity:t.bar_opacity,fontSize:t.font_size?"".concat(t.font_size,"px"):void 0,color:(t.click_able&&t.url_shippingbar?w(t.bar_link_color):w(t.bar_text_color))||"#ffffff"},s=!!(t.click_able&&t.url_shippingbar),u=(0,r.jsx)(k,{html:t.first_message,className:"max-w-full",isActive:o,onOverflowChange:a,onCycleComplete:i});return(0,r.jsxs)("div",{className:"relative flex min-h-7 w-full items-center justify-center px-2.5 pr-10 py-1 text-center text-[12px] lg:text-[13px] leading-5",style:c,children:[s?(0,r.jsx)("a",{href:t.url_shippingbar,target:t.open_new_page?"_blank":void 0,rel:t.open_new_page?"noopener noreferrer":void 0,className:"min-w-0 max-w-full hover:underline",children:u}):(0,r.jsx)("div",{className:"min-w-0 max-w-full",children:u}),(0,r.jsx)("button",{type:"button",onClick:()=>n(t.rule_id),"aria-label":"Close notification",className:"absolute right-2 top-1/2 z-10 flex h-6 w-6 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full text-current opacity-80 transition-opacity hover:bg-black/10 hover:opacity-100",children:(0,r.jsx)(l.YO,{size:.65})})]})}function E(e){let{items:t,onClose:n}=e,[a,l]=(0,o.useState)(0),[i,c]=(0,o.useState)(!1),[s,u]=(0,o.useState)(null);(0,o.useEffect)(()=>
1{l(e=>e>=t.length?0:e)},[t.length]);let d=(0,o.useRef)(i);d.current=i;let f=(0,o.useRef)(null);(0,o.useEffect)(()=>(u(null),()=>{null!=f.current&&(window.clearTimeout(f.current),f.current=null)}),[a]),(0,o.useEffect)(()=>{let e=()=>c(document.hidden);return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]);let g=(0,o.useCallback)(()=>{l(e=>(e+1)%t.length)},[t.length]);(0,o.useEffect)(()=>{if(i||t.length<=1||!1!==s)return;let e=window.setTimeout(g,5e3);return()=>window.clearTimeout(e)},[a,s,i,t.length,g]);let _=(0,o.useCallback)(e=>{e!==a||t.length<=1||null==f.current&&(f.current=window.setTimeout(()=>{f.current=null,d.current||g()},500))},[a,t.length,g]);return(0,r.jsx)("div",{className:"relative w-full overflow-hidden",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-roledescription":t.length>1?"carousel":void 0,children:t.map((e,t)=>{let o=t===a;return(0,r.jsx)("div",{"aria-hidden":!o,className:"transition-[opacity,transform] duration-500 ease-out "+(o?"relative opacity-100 translate-y-0":"pointer-events-none absolute inset-0 opacity-0 -translate-y-full"),children:(0,r.jsx)(x,{item:e,onClose:n,isActive:o,onOverflowChange:e=>{t===a&&u(e)},onCycleComplete:()=>_(t)})},e.rule_id)})})}let I="--shipping-bar-h";function M(e){let{className:t}=e,{visibleShippingBar:n,isAtTop:l}=(0,p.mL)(),{closeBar:d,visible:f}=function(e){let t=(0,a.Ym)(),{storeCode:n}=(0,c.M)(),{customerToken:r}=(0,i.A)(),l=r?"mine":"guest",d=(0,s.J)(),[f,g]=(0,o.useState)([]),[_,h]=(0,o.useState)({}),[p,v]=(0,o.useState)(()=>Date.now());return(0,o.useEffect)(()=>{h(function(e){try{let t=window.localStorage.getItem(e);if(!t)return{};let n=JSON.parse(t),r=Date.now(),o={},a=!1;for(let[e,t]of Object.entries(n)){if("number"!=typeof t||r-t>=864e5){a=!0;continue}o[e]=t}return a&&C(e,o),o}catch(e){return{}}}(S(n)))},[n]),(0,o.useEffect)(()=>{e||g([])},[e]),(0,o.useEffect)(()=>{if(!e||!d||!n)return;let r=!1,o=(0,b.M)(()=>{let e=u.yk.shipping_bar.read(n,t,l);!r&&(null==e?void 0:e.length)&&g(e),m({isGuest:"guest"===l}).then(e=>{r||(g(e),u.yk.shipping_bar.write(n,t,l,e))}).catch(()=>{})},{delay:500,timeout:3e3});return()=>{r=!0,o()}},[l,e,d,t,n]),(0,o.useEffect)(()=>{if(!e||0===f.length)return;let t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=e.flatMap(e=>[y(e.from_date),y(e.to_date)]).filter(e=>"number"==typeof e&&e>t);return n.length?Math.min(...n):null}(f,p);if(!t)return;let n=Math.max(1e3,t-p),r=window.setTimeout(()=>v(Date.now()),n);return()=>window.clearTimeout(r)},[e,f,p]),{closeBar:(0,o.useCallback)(e=>{h(t=>{let r={...t,[e]:Date.now()};return C(S(n),r),r})},[n]),visible:(0,o.useMemo)(()=>f.filter(e=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=y(e.from_date),r=y(e.to_date);return(!n||!(t<n))&&(!r||!(t>r))})(e,p)&&!_[e.rule_id]),[_,f,p])}}(n),g=(0,o.useRef)(null),[_,h]=(0,o.useState)(!1),w=(0,o.useRef)(""),k=f.map(e=>"".concat(e.rule_id,":").concat(e.first_message)).join("|");(0,o.useEffect)(()=>{setTimeout(()=>{window.dispatchEvent(new Event("mg:header-height-invalidate"))},200)},[k]);let x=(0,o.useRef)(!1);return((0,o.useEffect)(()=>{let e=g.current;if(!e)return;let t=new ResizeObserver(e=>{var t,n,r;let[o]=e,a=null!=(r=null==(n=o.borderBoxSize)||null==(t=n[0])?void 0:t.blockSize)?r:o.contentRect.height;x.current=!0,document.documentElement.style.setProperty(I,"".concat(Math.round(a),"px"))});return t.observe(e),()=>{t.disconnect(),x.current&&(x.current=!1,document.documentElement.style.setProperty(I,"0px"))}},[f.length]),(0,o.useEffect)(()=>{n&&0!==f.length||(w.current="",h(!1),x.current=!1,document.documentElement.style.setProperty(I,"0px"))},[n,f.length]),(0,o.useEffect)(()=>{k&&w.current!==k&&(w.current=k,h(!0))},[k]),(0,o.useEffect)(()=>{l&&_&&h(!1)},[l,_]),n&&0!==f.length)?(0,r.jsx)("div",{ref:g,children:(0,r.jsx)(v.A,{isOpen:l||_,duration:200,isDisabledCloseAnimation:!1,isUnmountOnClose:!1,children:(0,r.jsx)("div",{className:"w-full print:hidden ".concat(t," "),children:(0,r.jsx)(E,{items:f,onClose:d})})})}):null}},39990:(e,t,n)=>{n.d(t,{M:()=>i});var r=n(76704),o=n(29793),a=n(26542),l=n(17086);let i=()=>{let[e,t,n]=(0,o.lT)([a.V8.MgStoreCode,a.V8.StoreCode]),i=String((null==e?void 0:e[a.V8.MgStoreCode])||(null==e?void 0:e[a.V8.StoreCode])||""),c=(0,r.useMemo)(()=>i||(0,l.mk)(),[i]),s=(0,r.useCallback)((e,n)=>{let r=String(e||"");t(a.V8.MgStoreCode,r,{domain:(0,a.R2)(a.V8.MgStoreCode),...n}),t(a.V8.StoreCode,r,{domain:(0,a.R2)(a.V8.StoreCode),...n})},[t]),u=(0,r.useCallback)(e=>{n(a.V8.MgStoreCode,{domain:(0,a.R2)(a.V8.MgStoreCode),...e}),n(a.V8.StoreCode,{domain:(0,a.R2)(a.V8.StoreCode),...e})},[n]);return(0,r.useEffect)(()=>{i||s(c)},[i,s,c]),{storeCode:c,setStoreCode:s,removeStoreCode:u}}},62866:(e,t,n)=>{n.d(t,{H:()=>r});async function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutMs:n=3e4,signal:r,...o}=t,a=new AbortController;if(r)if(r.aborted)try{a.abort(r.reason)}catch(e){a.abort()}else r.addEventListener("abort",()=>{try{a.abort(r.reason)}catch(e){a.abort()}},{once:!0});let l=setTimeout(()=>a.abort(),n);try{let t=await fetch(e,{...o,signal:a.signal});if(!t.ok){let n="";try{n=await t.text()}catch(e){}let r="string"==typeof e?e:e.toString();throw Error("HTTP error: ".concat(t.status," ").concat(t.statusText," | URL: ").concat(r).concat(n?" - "+n:""))}return t}catch(e){if((null==e?void 0:e.name)==="AbortError")throw Error("Request aborted due to timeout");throw e}finally{clearTimeout(l)}}},83577:(e,t,n)=>{n.d(t,{oi:()=>i,yk:()=>d});var r=n(17086);let o="mg_cache_";function a(e){let t=1e3*e.duration;return Date.now()-e.created_at>t}function l(e){return e.startsWith(o)?e:"".concat(o).concat(e)}function i(){try{let t=window.__CACHE_INVALIDATIONS__||{},n=window.__CACHE_INVALIDATION_CHECK_TIME__||0,r=parseInt(localStorage.getItem("__cache_last_check__")||"0"),l=Date.now();if(!("number"==typeof n&&n>r||l-r>6e4))return;console.log("Checking cache invalidations...",t);let i=0;for(let n=localStorage.length-1;n>=0;n--){let r=localStorage.key(n);if(r&&r.startsWith(o))try{let n=localStorage.getItem(r);if(n){var e;let o=JSON.parse(n),l="number"==typeof(null==o?void 0:o.created_at)&&"number"==typeof(null==o?void 0:o.duration)&&a(o),c=!!Object.keys(t).length&&(null==(e=o.tags)?void 0:e.some(e=>{let n=t[e];return"number"==typeof n&&o.created_at<n}));(l||c)&&(localStorage.removeItem(r),i++,console.log(l?"Cache expired: ".concat(r):"Cache invalidated: ".concat(r)))}}catch(e){localStorage.removeItem(r),i++}}i>0&&console.log("Cleaned ".concat(i," invalidated cache entries")),localStorage.setItem("__cache_last_check__",l.toString())}catch(e){console.warn("Error checking cache invalidations:",e)}}function c(e){try{let t=localStorage.getItem(e.key);if(t){let n=JSON.parse(t);if("number"!=typeof(null==n?void 0:n.created_at)||"number"!=typeof(null==n?void 0:n.duration)||a(n)||function(e){var t;let n=window.__CACHE_INVALIDATIONS__||{};return!!n&&0!==Object.keys(n).length&&((null==(t=e.tags)?void 0:t.some(t=>{let r=n[t];return"number"==typeof r&&e.created_at<r}))||!1)}(n))return localStorage.removeItem(e.key),null;return n.data}return null}catch(e){return console.warn("Error reading cache:",e),null}}function s(e,t){try{let n={data:e,created_at:Date.now(),duration:t.duration,tags:t.tags||[]};t.baseKey&&function(e){for(let t=localStorage.length-1;t>=0;t--){let n=localStorage.key(t);n.startsWith(e)&&localStorage.removeItem(n)}}(t.baseKey),localStorage.setItem(t.key,JSON.stringify(n))}catch(e){console.warn("Error setting cache:",e)}}function u(e,t){let n="";if((0,r.gK)()===r.aM.Development)try{var o;n=(null==(o=new URL((0,r.$_)()).hostname.split("."))?void 0:o.slice().join("_"))||""}catch(e){console.error("Error building cache key:",e)}let a="".concat(n?"-"+n:"").concat(t.storeCode?"-".concat(t.storeCode):"").concat(t.groupID?"-group_".concat(t.groupID,"-").concat(t.locale):"");return l("".concat(e).concat(a))}let d={header_nav:{write:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:21600;s(t,{key:u("header_nav-".concat(e),{locale:e}),tags:["header_nav",e],duration:n})},read:e=>c({key:u("header_nav-".concat(e),{locale:e}),tags:["header_nav",e],duration:21600}),remove:e=>{localStorage.removeItem(u("header_nav-".concat(e),{locale:e}))}},mg_global:{write:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:21600;s(t,{key:u("mg_global-".concat(e),{locale:e}),tags:["mg_global",e],duration:n})},read:e=>c({key:u("mg_global-".concat(e),{locale:e}),tags:["mg_global",e],duration:21600}),remove:e=>{localStorage.removeItem(u("mg_global-".concat(e),{locale:e}))}},shipping_bar:{write:(e,t,n,r)=>{s(r,{key:u("shipping_bar-".concat(n,"-").concat(t),{storeCode:e,locale:t}),tags:["shipping_bar","shipping_bar-".concat(e),"shipping_bar-".concat(n),t],duration:86400})},read:(e,t,n)=>c({key:u("shipping_bar-".concat(n,"-").concat(t),{storeCode:e,locale:t}),tags:["shipping_bar","shipping_bar-".concat(e),"shipping_bar-".concat(n),t],duration:86400})},all_categories:{write:(e,t)=>
1{s(t,{key:u("all_categories",{locale:e}),tags:[e],duration:3600,baseKey:l("all_categories")})},read:e=>c({key:u("all_categories",{locale:e}),tags:[e],duration:3600})},store_config:{write:(e,t,n)=>{s(n,{key:u("store_config",{storeCode:e,locale:t}),tags:["store_config","store_config-".concat(e),t],duration:3600,baseKey:l("store_config")})},read:(e,t)=>c({key:u("store_config",{storeCode:e,locale:t}),tags:["store_config","store_config-".concat(e),t],duration:3600})},search_config:{write:(e,t,n,r)=>{s(r,{key:u("search_config",{storeCode:e,locale:t,groupID:n}),tags:["search_config","search_config-".concat(e),t],duration:3600,baseKey:l("search_config")})},read:(e,t,n)=>c({key:u("search_config",{storeCode:e,locale:t,groupID:n}),tags:["search_config","search_config-".concat(e,"-").concat(n),t],duration:3600})},countries:{write:(e,t,n)=>{s(n,{key:u("countries",{locale:e,storeCode:t}),tags:["countries",e,t],duration:86400,baseKey:l("countries")})},read:(e,t)=>c({key:u("countries",{locale:e,storeCode:t}),tags:["countries",e,t],duration:86400})},product_config:{write:(e,t)=>{s(t,{key:u("product_config",{locale:e}),tags:["product_config",e],duration:86400,baseKey:l("product_config")})},read:e=>c({key:u("product_config",{locale:e}),tags:["product_config",e],duration:86400})},home_new_arrivals:{write:function(e,t,n,r,o){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:900;s(o,{key:u("home_new_arrivals-".concat(r),{storeCode:e,locale:t,groupID:n}),tags:["home_new_arrivals","home_new_arrivals-".concat(e),t],duration:a,baseKey:l("home_new_arrivals")})},read:function(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:900;return c({key:u("home_new_arrivals-".concat(r),{storeCode:e,locale:t,groupID:n}),tags:["home_new_arrivals","home_new_arrivals-".concat(e),t],duration:o})}}}}}]);
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.