1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[67694],{31655:(e,t,l)=>{l.r(t),l.d(t,{FacetNavigation:()=>ea,FacetNavigationContext:()=>en});var r=l(37876),n=l(9920),a=l(63030),i=l(70146),s=l(68071);let o={borderRadius:1,border:{xs:"none",md:"1px solid ".concat(s.T.grays[200])},"&:before":{content:"none"}};var d=l(199),c=l(44462),u=l(89348),x=l(54915),p=l(38186),h=l(24510),m=l(80135),v=l(63453),g=l(55751),f=l(72147),j=l(42993),A=l(35003);let y=e=>{var t;let{node:l}=e;return(0,r.jsx)(g.A,{children:(0,r.jsx)(i.x_,{shallow:"true",href:null==(t=l.seo)?void 0:t.href,children:(0,r.jsx)(A.A,{color:e=>e.palette.grey[900],fontSize:16,sx:{"&:hover":{color:"primary.main"}},children:l.name+(l.count?" ("+l.count+")":"")})})})},b=e=>{let{categoryId:t}=e,{categories:l,isLoading:n,currentCategory:a,parentCategory:s}=(0,d.w)(t),{Labels:g}=(0,c.B2)("ProductFilter");return n?(0,r.jsx)(f.A,{}):(0,r.jsxs)(j.A,{gap:1,id:"category-navigation-back-link-section",children:[(null==s?void 0:s.href)?(0,r.jsx)(i.x_,{href:null==s?void 0:s.href,children:(0,r.jsxs)(j.A,{direction:"row",gap:1,children:[(0,r.jsx)(x.A,{sx:{color:e=>e.palette.grey[700]}}),(0,r.jsx)(A.A,{fontWeight:600,fontSize:16,color:e=>e.palette.grey[700],children:g.BackTo.t()+" "+(null==s?void 0:s.label)})]})}):null,(null==l?void 0:l.length)>0?(0,r.jsxs)(h.A,{defaultExpanded:!0,elevation:0,disableGutters:!0,sx:o,children:[(0,r.jsx)(v.A,{expandIcon:(0,r.jsx)(p.A,{color:"primary"}),children:(0,r.jsx)(A.A,{variant:"h5",sx:{fontWeight:u.A.BOLD},children:null==a?void 0:a.label})}),(0,r.jsx)(m.A,{children:(0,r.jsx)(j.A,{gap:1,children:null==l?void 0:l.map((e,t)=>(0,r.jsx)(y,{node:e},e.id+"_".concat(t)))})})]}):null]})};var C=l(8733);let k={width:["auto","auto","100%"]},w={mb:1,mr:1};var L=l(64266),P=l(71918),S=l(14232);let B=e=>{let{entry:t}=e,{selectedFacet:l,onFacetSelectChange:n}=(0,S.useContext)(en),a=(0,S.useCallback)(e=>n(e,t),[t,n]);return t.image?(0,r.jsx)(C.r,{"aria-label":t.label,image:t.image,onClick:a,size:"large",selected:void 0!==l?l.indexOf(t.value)>-1:void 0,"data-testid":"product-filter-".concat(t.value.toLowerCase(),"-swatch"),id:"product-filter-".concat(t.value.toLowerCase(),"-swatch"),sx:w}):(0,r.jsx)(P.A,{sx:k,control:(0,r.jsx)(L.A,{checked:void 0!==l?l.indexOf(t.value)>-1:void 0,onChange:a}),label:"".concat(t.label," (").concat(t.count,")")})};var F=l(8170),M=l(45696),R=l(47296),W=l(65754),I=l(53668);let D=(e,t)=>{if(null===e||null===t)return!0;if(null!==e&&null!==t){try{if(e<=t)return!0}catch(e){}return!1}},E={min:0,max:1},T=(e,t,l)=>(Math.log10(e)-t)/l,q=(e,t,l)=>Math.round(Math.pow(10,e*(l+t))),O=()=>{let{onPriceRangeChange:e,maxPriceAll:t,isUpdating:l}=(0,S.useContext)(en),{settings:n}=(0,R.t0)(),[a,i]=(0,S.useState)(t),[s,o]=(0,S.useState)(E.min),[d,u]=(0,S.useState)([0,1]),x=(0,c.B2)("ProductFilter"),p=(0,S.useMemo)(()=>Math.log10(.1),[]),h=(0,S.useMemo)(()=>
1Math.log10(t)-p,[t,p]);(0,S.useEffect)(()=>{l||(o(E.min),i(t),u([0,1]))},[l,t]);let m=(0,S.useCallback)(e=>t=>{let l=null===t?null:t<E[e]?E[e]:t;"min"===e?(o(l),l&&u([T(l,p,h),d[1]])):(i(l),l&&u([d[0],T(l,p,h)]))},[h,p,d]),v=(0,S.useCallback)((e,l)=>{if(l[0]>=0)if(0===l[0]&&p<0)o(0);else{let e=q(l[0],p,h);e<0?o(0):o(e)}l[1]>=0&&(1===l[1]?i(t):i(q(l[1],p,h))),u(l)},[h,t,p]),f=(0,S.useMemo)(()=>!D(s,a),[a,s]),A=(0,S.useMemo)(()=>null===a||!D(s,a)||l,[l,a,s]),y=(0,S.useCallback)(()=>{null!==a&&e({minPrice:null!=s?s:E.min,maxPrice:a})},[s,a,e]);return(0,r.jsxs)(j.A,{spacing:1,children:[(0,r.jsx)(j.A,{sx:{px:2},children:(0,r.jsx)(I.Ay,{value:d,min:E.min,max:E.max,step:.01,onChange:v,disableSwap:!0})}),(0,r.jsxs)(j.A,{spacing:1,direction:"row",children:[(0,r.jsx)(M.Q,{value:s,min:E.min,precision:2,placeholder:x.Labels.minPrice.t(),onChange:m("min"),prefix:null==n?void 0:n.currencySymbol,error:f,max:t,maxLength:12,"data-testid":"productFilter-min-price-range-picker-quantity",id:"productFilter-min-price-range-picker-quantity"}),(0,r.jsx)(M.Q,{value:a,min:E.max,precision:2,placeholder:x.Labels.maxPrice.t(),onChange:m("max"),prefix:null==n?void 0:n.currencySymbol,error:f,max:t,maxLength:12,"data-testid":"productFilter-max-price-range-picker-quantity",id:"productFilter-max-price-range-picker-quantity"})]}),(0,r.jsx)(g.A,{children:(0,r.jsx)(W.A,{"data-testid":"productFilter_price_facet",id:"productFilter_price_facet",disabled:A,variant:"contained",onClick:y,children:x.Actions.Filter.t()})})]})};var N=l(63356);let _=()=>{let{filteredParams:e,onPriceRangeChange:t}=(0,S.useContext)(en),{minPrice:l=-1,maxPrice:n=-1}=e,a=(0,S.useCallback)(()=>t({minPrice:null,maxPrice:null}),[t]);return l>-1&&n>-1?(0,r.jsx)(N.A,{size:"medium",label:(0,r.jsx)(F.k,{min:l,max:n}),onClick:a,onDelete:a,"data-testid":"product-filter-formatted-price-chip",id:"product-filter-formatted-price-chip"}):(0,r.jsx)(O,{})},z=e=>{let{entry:t}=e,{onFacetSelectChange:l,selectedFacet:n}=(0,S.useContext)(en),a=null==n?void 0:n.includes(t.value),i=(0,S.useCallback)(e=>l(e,t),[t,l]);return(0,r.jsxs)(A.A,{component:"a",onClick:i,sx:{fontSize:16,lineHeight:1.6,color:"text.primary",cursor:"pointer",textDecoration:"none",fontWeight:a?"bold":"normal","&:hover":{color:"primary.main",textDecoration:"underline"}},"data-testid":"parent-category-".concat(t.value),children:[t.label,!!t.count&&" (".concat(t.count,")")]})};var V=l(93411),Y=l(12634),H=l(55871),G=l(7579);let Q=S.memo(()=>{let e=(0,c.B2)("ProductFilter"),{facets:t,facetToEdit:l,setFacetToEdit:n,searchTerm:a}=(0,S.useContext)(en),{isDesktop:i}=(0,Y.Y)(),{Labels:s}=(0,c.B2)("ProductFilter"),[d,x]=(0,S.useState)({}),g=e=>{x(t=>({...t,[e]:!t[e]}))},[f,y]=(0,S.useState)(()=>t.reduce((e,l,r)=>({...e,[l.value]:!!i&&("price_min"===t[0].value?r<4:r<3)}),{})),b=(0,S.useCallback)(e=>(l,r)=>{i?y(t=>({...t,[e]:r})):n(t.find(t=>t.value===e)||null)},[t,i,n]),C=t.find(e=>e.value.startsWith(V.Sw)),k=t.filter(e=>e.value.startsWith(V.Sw)),w=t.find(e=>e.value.startsWith(V.Vx)),L=t.filter(e=>!e.value.startsWith(V.Sw)&&!e.value.startsWith(V.Vx)),P=!!C&&!!a&&i;if(l){var F,M,R;return(0,r.jsxs)(j.A,{sx:{mt:{xs:-3,md:-7},px:{xs:1.5,md:0},py:{xs:3,md:0},width:1,backgroundColor:"background.paper"},gap:1,children:[(0,r.jsxs)(j.A,{direction:"row",gap:.5,sx:{alignItems:"center",cursor:"pointer"},onClick:()=>n(null),children:[(0,r.jsx)(H.A,{color:"primary"}),(0,r.jsx)(A.A,{variant:"h5",sx:{fontWeight:u.A.BOLD},children:l.value.startsWith(V.Vx)?e.Labels.price.t():null!=(R=null==(F=l.extendedData)?void 0:F.fname)?R:l.name})]}),l.value.startsWith(V.Vx)?(0,r.jsx)(_,{}):(0,r.jsx)(j.A,{alignItems:"flex-start",children:(0,r.jsx)(j.A,{direction:"column",sx:{ml:1},children:null==(M=l.entry)?void 0:M.map(e=>(0,r.jsx)(B,{entry:e},e.value))})})]})}return(0,r.jsxs)(j.A,{gap:1,children:[P&&(0,r.jsxs)(S.Fragment,{children:[(0,r.jsxs)(h.A,{expanded:f[V.Sw],onChange:b(V.Sw),sx:o,elevation:0,disableGutters:!0,children:[(0,r.jsx)(v.A,{expandIcon:i?(0,r.jsx)(p.A,{color:"primary"}):(0,r.jsx)(H.A,{}),children:(0,r.jsx)(A.A,{variant:"h5",sx:{fontWeight:u.A.BOLD},children:s.productsInCategory.t()})}),(0,r.jsx)(m.A,{children:(0,r.jsx)(j.A,{gap:.5,children:k.map(e=>e.entry.map(e=>(0,r.jsx)(z,{entry:e},e.value)))})})]}),(0,r.jsx)(G.A,{sx:{display:{xs:"initial",md:"none"}}})]}),w&&(0,r.jsxs)(S.Fragment,{children:[(0,r.jsxs)(h.A,{expanded:f[w.value],onChange:b(w.value),sx:o,elevation:0,disableGutters:!0,children:[(0,r.jsx)(v.A,{expandIcon:i?(0,r.jsx)(p.A,{color:"primary"}):(0,r.jsx)(H.A,{}),children:(0,r.jsx)(A.A,{variant:"h5",sx:{fontWeight:u.A.BOLD},children:e.Labels.price.t()})}),(0,r.jsx)(m.A,{children:(0,r.jsx)(_,{})})]}),(0,r.jsx)(G.A,{sx:{display:{xs:"initial",md:"none"}}})]}),L.map(t=>{var l,n,a;let s=d[t.value]||!1;return(0,r.jsxs)(S.Fragment,{children:[(0,r.jsxs)(h.A,{expanded:f[t.value],onChange:b(t.value),sx:o,elevation:0,disableGutters:!0,children:[(0,r.jsx)(v.A,{expandIcon:i?(0,r.jsx)(p.A,{color:"primary"}):(0,r.jsx)(H.A,{}),children:(0,r.jsx)(A.A,{variant:"h5",sx:{fontWeight:u.A.BOLD},children:null!=(a=null==(l=t.extendedData)?void 0:l.fname)?a:t.name})}),(0,r.jsx)(m.A,{children:(0,r.jsx)(j.A,{children:t.entry.length>15&&!s?(0,r.jsxs)(r.Fragment,{children:[t.entry.slice(0,15).map(e=>(0,r.jsx)(B,{entry:e},e.value)),(0,r.jsx)(W.A,{variant:"text",onClick:()=>g(t.value),children:e.Labels.seeAll.t()+" ("+(t.entry.length-15)+")"})]}):(0,r.jsxs)(r.Fragment,{children:[null==(n=t.entry)?void 0:n.map(e=>(0,r.jsx)(B,{entry:e},e.value)),t.entry.length>15?(0,r.jsx)(W.A,{variant:"text",onClick:()=>g(t.value),children:e.Labels.seeLess.t()}):null]})})})]}),(0,r.jsx)(G.A,{sx:{display:{xs:"initial",md:"none"}}})]},t.value)})]})}),Z={px:{md:1},'&[role="button"]:hover':{cursor:{md:"pointer"}}};var U=l(66703),K=l(6995);let X=()=>{let e=(0,c.B2)("ProductFilter"),t=(0,U.A)(),l=(0,K.A)(t.breakpoints.down("md")),[n,a]=(0,S.useState)(()=>""),{facets:i,filteredParams:s}=(0,S.useContext)(en),{minPrice:d=-1,maxPrice:u=-1}=s,x=(0,S.useCallback)(e=>(t,r)=>{l&&a(r?e:"")},[l]);return 0===i.length&&d>-1&&u>-1?(0,r.jsxs)(h.A,{"data-testid":"productFilter-facet-price",id:"productFilter-facet-price",defaultExpanded:!l,expanded:!l||"price"===n,onChange:x("price"),sx:o,elevation:0,
1children:[(0,r.jsx)(v.A,{sx:Z,expandIcon:(0,r.jsx)(p.A,{color:"primary"}),children:e.Labels.price.t()}),(0,r.jsx)(m.A,{children:(0,r.jsx)(_,{})})]}):null};var J=l(93462),$=l(65368),ee=l(43463),et=l.n(ee),el=l(42723),er=l.n(el);let en=(0,S.createContext)({}),ea=e=>{let{id:t}=e,{total:l,hideFacets:i}=(0,S.useContext)($.x),s=(0,J.r)(t),{Labels:o}=(0,c.B2)("ProductFilter"),{available:d,loading:u,filteredParams:x,facets:p,facetFilters:h,validCategoriesData:m,onFacetDelete:v,onFacetSelectChange:g,selectedFacet:f}=s,{searchTerm:A}=x,y=(0,S.useMemo)(()=>!!p.length||!et()(h)||d&&!A,[p,h,d,A]),{selectedCategories:C}=(0,S.useMemo)(()=>{let e=m.map(e=>e.entry).flat(),t=f.filter(e=>e.startsWith("validCategories.levl")).map(t=>e.find(e=>e.value===t)).filter(Boolean);return{allValidCategories:e,selectedCategories:t}},[f,m]),k=(0,S.useMemo)(()=>i?p.filter(e=>["Brand","Tuotemerkki","listPrice.min"].includes(e.name)):p,[p,i]);(0,S.useEffect)(()=>{if(f.length>0){let e={dataLayer:{frosmo:{viewItemList:{filters:f.map(e=>{let[t,l]=e.split(":");return{key:t,value:l}}).reduce((e,t)=>(e[t.key]=t.value,e),{})}}}};er().dataLayer(e)}},[f]);let w=(0,S.useMemo)(()=>({...s,facets:k,total:l}),[p,s.facetToEdit,s.isUpdating]);return u?(0,r.jsx)(n.Z,{}):d||A||m.length?(0,r.jsxs)(en.Provider,{value:w,children:[A?null:(0,r.jsx)(j.A,{display:{xs:"none",md:"flex"},"data-testid":"category-navigation-section",children:(0,r.jsx)(b,{categoryId:t})}),(0,r.jsx)(a.B,{title:y?o.filterBy.t():o.noFilters.t(),mobileBreakpoint:"md",scrollable:!0,"data-testid":"facet-navigation-sidebar",children:(0,r.jsxs)(j.A,{gap:1,sx:{px:{xs:1.5,md:0},borderTopLeftRadius:{xs:"32px",md:0},borderTopRightRadius:{xs:"32px",md:0}},children:[(0,r.jsx)(X,{}),(0,r.jsx)(Q,{})]})})]}):null}},45696:(e,t,l)=>{l.d(t,{Q:()=>f});var r=l(37876);let n={alignItems:"center",alignSelf:"stretch",color:"text.secondary","&.MuiButtonBase-root":{padding:1},"&:first-of-type":{ml:-1.8,borderRight:"1px solid",borderRightColor:"text.disabled",borderTopRightRadius:0,borderBottomRightRadius:0},"&:last-of-type":{mr:-1.8,borderLeft:"1px solid",borderLeftColor:"text.disabled",borderTopLeftRadius:0,borderBottomLeftRadius:0}};var a=l(9920),i=l(44462),s=l(77016);let o=e=>{let{input:t,thousandSeparator:l,decimalSeparator:r}=e;return"number"!=typeof t||isNaN(t)?"string"==typeof t?(e=>{let{string:t,thousandSeparator:l,decimalSeparator:r}=e,n=parseFloat(t.replaceAll(l,"").replaceAll(r,"."));return isNaN(n)?null:n})({string:t,thousandSeparator:l,decimalSeparator:r}):null:t};var d=l(28710);let c=e=>{let{value:t,precision:l,decimalSeparator:r,thousandSeparator:n,min:a,max:i}=e;return(e=>{let{string:t,precision:l,decimalSeparator:r,thousandSeparator:n,min:a,max:i}=e,[s,o]=t.split(r),c=null==o?void 0:o.substring(0,l).trim(),u=(e=>{let{string:t,thousandSeparator:l}=e;return t.replace(/\B(?=(\d{3})+(?!\d))/g,l)})({string:t.length>0?(e=>{let{string:t,min:l,max:r,after:n}=e,a=r&&n&&(0,d.Cv)(r,0)===r?r-1:r;return Math.max(Math.min((0,d.Cv)(t,0),null!=a?a:Number.MAX_VALUE),null!=l?l:5e-324).toString()})({string:s.replaceAll(n,""),after:c,min:a,max:i}):t,thousandSeparator:n,decimalSeparator:r});return void 0===o||u.includes(r)?u:"".concat(u).concat(l>0?r:"").concat(c)})({string:(e=>{let{string:t}=e;return t.replace(/[^0-9\.,]/g,"")})({string:(null==t?void 0:t.toString())||""}),precision:l,decimalSeparator:r,thousandSeparator:n,min:a,max:i})};var u=l(31578),x=l(54219),p=l(55751),h=l(65754),m=l(39467),v=l(1912),g=l(14232);let f=e=>{let{onChange:t,loading:l=!1,precision:d=0,decimalSeparator:f=".",thousandSeparator:j=",",showControls:A=!1,value:y,min:b=0,max:C,prefix:k,sx:w,disallowEmptyOnBlur:L,customValidator:P,maxLength:S,...B}=e,F=(0,i.B2)("Common"),[M,R]=(0,g.useState)(()=>c({value:y,precision:d,decimalSeparator:f,thousandSeparator:j,min:b,max:C})),[W,I]=(0,g.useState)(()=>o({input:y,decimalSeparator:f,thousandSeparator:j})),[D,E]=(0,g.useState)(()=>o({input:y,decimalSeparator:f,thousandSeparator:j})),{disabled:T}=B,q=e=>{let t=c({value:e,precision:d,decimalSeparator:f,thousandSeparator:j,min:b,max:C});
1R(t),I(o({input:t,decimalSeparator:f,thousandSeparator:j}))},O=e=>()=>q(((null!=W?W:0)+e).toString()),N=(0,g.useRef)(null);return(0,g.useEffect)(()=>{t&&D!==W&&(t(W),E(W),N.current&&P&&(P(W)?N.current.setCustomValidity(""):N.current.setCustomValidity("error")))},[t,W,D,P]),(0,g.useEffect)(()=>{let e=o({input:y,decimalSeparator:f,thousandSeparator:j});I(e),E(e),R(c({value:y,precision:d,decimalSeparator:f,thousandSeparator:j,min:b,max:C}))},[f,C,b,d,j,y]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.A,{sx:{display:l?void 0:"none"},children:(0,r.jsx)(a.Z,{})}),(0,r.jsx)(v.A,{sx:(0,s.V)([A?{input:{textAlign:"center",px:1}}:{},{display:l?"none":void 0},w]),...B,value:null!=M?M:"",type:B.type||"text",onChange:e=>{q(e.target.value)},inputProps:{"aria-label":F.quantity.t({n:null!=M?M:""}),maxLength:null!=S?S:null},inputRef:N,onBlur:e=>{if(L&&""===e.target.value.trim()){var t;q((null!=(t=null!=b?b:M)?t:"").toString())}1!==d||o({input:e.target.value.trim(),decimalSeparator:f,thousandSeparator:j})||q("0.1")},disabled:T,InputProps:{startAdornment:A?(0,r.jsx)(h.A,{disabled:T,"aria-label":F.decrement.t(),onClick:O(-1),sx:n,"data-testid":"button-quantity-down",children:(0,r.jsx)(x.A,{})}):k&&(0,r.jsx)(m.A,{position:"start",children:k}),endAdornment:A&&(0,r.jsx)(h.A,{disabled:T,onClick:O(1),sx:n,"aria-label":F.increment.t(),"data-testid":"button-quantity-up",children:(0,r.jsx)(u.A,{})})},"data-testid":"input-quantity"})]})}},63030:(e,t,l)=>{l.d(t,{B:()=>w});var r=l(37876),n=l(65412);let a={justifyContent:"space-between",alignItems:"center",position:{xs:"sticky",md:"static"},flexDirection:"row",backgroundColor:"background.default",color:"text.primary",border:"none",borderTopLeftRadius:"32px",borderTopRightRadius:"32px",pl:{xs:3,md:0},pr:{xs:1.5,md:0},py:{xs:3,md:0},zIndex:{md:1}};var i=l(31655),s=l(44462),o=l(89348),d=l(41681),c=l(10600),u=l(65754),x=l(71733),p=l(42993),h=l(35003),m=l(14232);let v=e=>{let{title:t,isMobile:l,toggleOpen:v,children:g}=e,f=(0,s.B2)("ProductFilter"),{onDeleteAll:j}=(0,m.useContext)(i.FacetNavigationContext),[A,y]=(0,m.useState)();return(0,m.useEffect)(()=>{var e;return y(null==(e=document)?void 0:e.getElementById("sidebar-content")),()=>{y(void 0)}},[]),(0,r.jsxs)(p.A,{gap:1,sx:{overflowY:{xs:"auto",md:"visible"}},id:"sidebar-content",children:[(0,r.jsx)(n.Z,{disabled:!l,target:A,children:(0,r.jsxs)(c.A,{component:"div",sx:a,children:[(0,r.jsx)(h.A,{variant:"h4",sx:{fontWeight:o.A.SEMIBOLD},children:t}),l?(0,r.jsxs)(p.A,{direction:"row",children:[(0,r.jsx)(u.A,{variant:"text",onClick:j,sx:{color:"text.primary"},children:f.Actions.ClearAll.t()}),(0,r.jsx)(x.A,{onClick:v,sx:{width:40,height:40,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},color:"secondary",children:(0,r.jsx)(d.A,{})})]}):null]})}),g]})};var g=l(92762),f=l(94370),j=l(12634),A=l(65368),y=l(78518),b=l(24074),C=l(55751),k=l(94683);let w=e=>{let{title:t,href:l,scrollable:n=!1,children:a}=e,{isUpdating:o,setFacetToEdit:d,facetToEdit:c,total:x}=(0,m.useContext)(i.FacetNavigationContext),{topOfMainContentElem:w}=(0,m.useContext)(A.x),L=(0,s.B2)("ProductFilter"),[P,S]=(0,m.useState)(!1),{isDesktop:B}=(0,j.Y)(),F=(0,m.useCallback)(()=>{B||S(!P)},[P,B]),M=(0,m.useCallback)(()=>{w&&w.scrollIntoView({block:"start",behavior:"smooth"})},[w]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(C.A,{sx:{display:{xs:"block",md:"none"}},children:[(0,r.jsx)(g.A,{hideBorder:!0,hideOnDesktop:!0,sx:{py:0,px:0,background:"transparent",justifyContent:"center"},children:(0,r.jsxs)(u.A,{variant:"contained",onClick:F,sx:{minWidth:144,height:44,px:2.5,py:1,mb:2,borderRadius:"6px"},children:[(0,r.jsx)(h.A,{children:t}),(0,r.jsx)(y.A,{})]})}),(0,r.jsxs)(k.Ay,{anchor:"bottom",open:P,PaperProps:{sx:{...(0,f.W)(!0),borderTopLeftRadius:32,borderTopRightRadius:32,pt:1,justifyContent:"space-between"}},onClose:()=>S(!1),children:[(0,r.jsx)(v,{children:a,href:l,isMobile:!0,title:t,toggleOpen:F}),(0,r.jsxs)(p.A,{direction:"row",justifyContent:"center",sx:{width:1,mt:2,mb:3,mx:3},gap:2,children:[c?(0,r.jsx)(b.A,{onClick:()=>d(null),loading:o,variant:"contained",color:"secondary",size:"large",children:L.Actions.FilterMore.t()}):null,(0,r.jsx)(b.A,{onClick:()=>{S(!1),M()},loading:o,variant:"contained",size:"large",children:L.Actions.showFound.t({count:x||0})})]})]})]}),(0,r.jsx)(C.A,{sx:{display:{xs:"none",md:"block"}},children:(0,r.jsx)(v,{children:a,href:l,isMobile:!1,scrollable:n,title:t,toggleOpen:F})})]})}},65412:(e,t,l)=>{l.d(t,{N:()=>u,Z:()=>c});var r=l(37876),n=l(12634),a=l(63481),i=l(38505),s=l(75039),o=l(40677),d=l(14232);let c=e=>{let{children:t,disabled:l=!1,target:r}=e,n=(0,o.A)({disableHysteresis:!0,threshold:0,target:r});return d.cloneElement(t,{elevation:!l&&n?2:0})},u=e=>{let{children:t,variant:l,invertCondition:o=!1,thresholdOffset:c=0,thresholdOffsetUp:u=0,thresholdOffsetTop:x=0,thresholdOffsetMobileUp:p,thresholdOffsetMobileTop:h,hideOn:m="all",onTrigger:v,...g}=e,{isMobile:f,isDesktop:j}=(0,n.Y)(),[A,y]=(0,d.useState)(0),[b,C]=(0,d.useState)(!1),k=(0,d.useRef)(0),w=f&&null!=p?p:u,L=f&&null!=h?h:x;(0,d.useEffect)(()=>{y(window.scrollY),window.scrollY>(null!=h?h:x)&&C(!0)},[]),(0,d.useEffect)(()=>{let e=()=>{let e=window.scrollY;e>A?t(e):l(e),y(e)},t=e=>{k.current=0,e>c&&r()&&(C(!0),null==v||v(!0))},l=e=>{k.current+=A-e,(k.current>=w&&0!==w||e<=L)&&r()&&(C(!1),null==v||v(!1))},r=()=>"all"===m||"desktop"===m&&j||"mobile"===m&&f;return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[A,c,L,w,v,m,j,f]);let P=(0,d.useMemo)(()=>{let e=o?!b:b;return"desktop"===m&&j||"mobile"===m&&f?e:"all"===m&&e},[m,o,j,f,b]);switch(l){case"collapse":return(0,r.jsx)(a.A,{...g,in:!P,children:t});case"slide":return(0,r.jsx)(s.A,{...g,in:!P,children:t});default:return(0,r.jsx)(i.A,{...g,in:!P,children:t})}}},92762:(e,t,l)=>{l.d(t,{A:()=>a});var r=l(37876),n=l(42993);let a=e=>{let{children:t,hideBorder:l=!1,hideOnDesktop:a=!1,sx:i}=e;return(0,r.jsx)(n.A,{direction:"row",sx:{position:"fixed",bottom:0,left:0,height:"fit-content",width:"100%",zIndex:e
1=>e.zIndex.appBar,px:4,py:2,display:{md:a?"none":void 0},borderTop:e=>{var t,r;return l?"none":"1px solid ".concat(null==(r=e.palette.support)||null==(t=r.pink)?void 0:t.main)},background:e=>{var t,l;return"linear-gradient(180deg, ".concat(null==(l=e.palette.support)||null==(t=l.pink)?void 0:t.light," 0%, ").concat(e.palette.background.default," 51.56%), ").concat(e.palette.background.default)},...i},children:t})}},93462:(e,t,l)=>{l.d(t,{r:()=>L});var r=l(88545),n=l(93804),a=l(98832),i=l(44462),s=l(47296),o=l(93411),d=l(28645),c=l(7871),u=l(8622),x=l(61857),p=l(66033),h=l(71268),m=l(5410),v=l(20824),g=l(90839),f=l(62668),j=l(71303),A=l(14232),y=l(39312),b=l(42723),C=l.n(b),k=l(91535),w=l(75656);let L=function(e){var t,l,b,L,P;let S=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{settings:B}=(0,s.t0)(),F=(0,a.Ok)(),{storeId:M,defaultCatalogId:R,defaultCurrency:W,langId:I}=(0,u.K)(B,F),[D,E]=(0,A.useState)(!1),{query:T,locale:q,defaultLocale:O}=F,N=(0,A.useMemo)(()=>(0,m.W)(T),[T.offset,T.facetLimit,T.minPrice,T.maxPrice,T.facet,T.orderBy,T.searchTerm,T.contractId]),_=(0,A.useMemo)(()=>(0,h.k)(N),[N]),z=(0,A.useMemo)(()=>T.facet?Array.isArray(T.facet)?T.facet:[T.facet]:[],[T.facet]);(0,A.useEffect)(()=>{C().dataLayer(d.AS),C().dataLayer({dataLayer:{event:"Algolia active facets",algoliaInsights:{filters:z}}})},[z]);let V=(0,i.B2)("Routes"),Y=(0,p.p)(T.path,B.storeToken),{profileName:H,categoryId:G}=(0,A.useMemo)(()=>Y.endsWith(V.Search.route.t())||Y.endsWith(V.SellerListing.route.t())?{profileName:"HCL_V2_findProductsBySearchTermWithPrice",categoryId:""}:{profileName:"HCL_V2_findProductsByCategoryWithPriceRange",categoryId:String(e)},[V,e,Y]),Q=(0,A.useRef)(!1),Z=null!=(P=new y.A().get("abTestSegment"))?P:"marqo",{fallback:U}=(0,k.iX)(),{data:K,error:X,isLoading:J}=(0,w.Ay)(M&&F.isReady&&!S?[(0,v.Q)({...N,storeId:M,categoryId:G,catalogId:R,profileName:H,langId:I,currency:W,abTestSegment:Z}),r.D1]:null,async e=>{let[t]=e;return(0,n.Wx)(!0)({...(0,v.f)(t),userToken:(0,x.RH)()})},{use:[g.l]}),$=(0,A.useMemo)(()=>{var e;return K||null==(e=Object.entries(U).find(e=>{let[t]=e;return t.includes(r.D1)}))?void 0:e[1]},[U,K]),ee=null!=K?K:$,et=(0,A.useMemo)(()=>{var e,t;return null!=(t=null==(e=(0,c.z)(ee))?void 0:e.filter(e=>"CategoryNavigation"!==e.value&&!e.value.startsWith("validCategories")&&"categoryPageIds"!==e.value).map(f.q))?t:[]},[ee]),el=(0,A.useMemo)(()=>{var e,t;return null!=(t=null==(e=(0,c.z)(ee))?void 0:e.filter(e=>e.value.startsWith("validCategories")).map(f.q))?t:[]},[ee]),[er,en]=(0,A.useState)(null),ea=(0,A.useCallback)(async e=>{let{minPrice:t,maxPrice:l}=e,{minPrice:r,maxPrice:n,limit:a,...i}=N,s=F.cleanPath;(null!==t||null!==l)&&Object.assign(i,{minPrice:t,maxPrice:l}),E(!0),await F.push({pathname:s,query:i},void 0,{shallow:!0}),E(!1)},[N,F]),ei=(0,A.useCallback)(async(e,t)=>{let{facet:l,limit:r,...n}=N,a=F.cleanPath,i=z.indexOf(t.value),s=[...z];i>-1?s.splice(i,1):s.push(t.value);let o={dataLayer:{event:"Algolia facet click",algoliaInsights:{filters:[t.value]}}};C().dataLayer(d.AS),C().dataLayer(o),s.length>0&&Object.assign(n,{facet:s,offset:0}),E(!0),await F.push({pathname:a,query:n},void 0,{shallow:!0}),E(!1)},[N,F,z]),es=(0,A.useCallback)(e=>async()=>{let{facetLimit:t=[],limit:l,...r}=N,n=e+o.Kc,a=Array.isArray(t)?[...t]:[t],i=a.indexOf(n);i>-1?a.splice(i,1):a.push(n),a.length>0&&Object.assign(r,{facetLimit:a}),E(!0),await F.push({pathname:F.cleanPath,query:r},void 0,{shallow:!0}),E(!1)},[N,F.cleanPath]),eo=(0,A.useCallback)(()=>{let{minPrice:e,maxPrice:t,facet:l,path:r,...n}=T,a=F.cleanPath;F.push({pathname:a,query:n},void 0,{shallow:!0})},[T,F]),ed=(0,A.useCallback)(e=>()=>{let{facet:t,limit:l,...r}=N,n=F.cleanPath,a=[];if(e.startsWith("validCategories")&&t){var i,s;let l=Number(null==(s=e.split(":"))||null==(i=s[0])?void 0:i.at(-1));a.push(...(Array.isArray(t)?t:[t]).filter(e=>{var t,r;return!(e.startsWith("validCategories")&&Number(null==(r=e.split(":"))||null==(t=r[0])?void 0:t.at(-1))>=l)}))}else{let t=z.indexOf(e);a.push(...z),t>-1&&a.splice(t,1)}a.length>0&&Object.assign(r,{facet:a}),F.push({pathname:n,query:r},void 0,{shallow:!0})},[N,F.cleanPath,z]),ec=(0,A.useMemo)(()=>{var e;return null==ee||null==(e=ee.metaData)?void 0:e.minPrice},[null==ee||null==(t=ee.metaData)?void 0:t.minPrice]),eu=(0,A.useMemo)(()=>{var e;return null==ee||null==(e=ee.metaData)?void 0:e.maxPrice},[null==ee||null==(l=ee.metaData)?void 0:l.maxPrice]);return(0,A.useEffect)(()=>{en(null)},[F.query.searchTerm]),(0,A.useEffect)(()=>{Q.current=!0},[]),{available:!!(null==ee||null==(b=ee.facets)?void 0:b.length)||!(0,j.isEmpty)(_),facets:et,parentCategoryFacets:null==ee||null==(L=ee.parentCategoryFacets)?void 0:L.map(e=>({label:e,value:"parentCategories.name:".concat(e),count:0,extendedData:{},frequency:"",fullPath:"",fullPathCategoryIds:"",image:"",name:"",shortDe
1scription:"",term:""})),loading:J&&!ee,error:X,filteredParams:N,facetFilters:_,selectedFacet:z,locale:q,defaultLocale:O,onPriceRangeChange:ea,onFacetSelectChange:ei,toggleFacetLimit:es,minPriceAll:ec,maxPriceAll:eu,isUpdating:D||J,facetToEdit:er,setFacetToEdit:en,onDeleteAll:eo,onFacetDelete:ed,validCategoriesData:el}}},94370:(e,t,l)=>{l.d(t,{B:()=>r,W:()=>n});let r=()=>({textDecoration:"underline",cursor:"pointer "}),n=e=>({width:e?"100%":"60%",borderTopLeftRadius:"32px",borderTopRightRadius:"32px",height:"90%",overflow:"scroll",margin:"auto","&::-webkit-scrollbar":{display:"none"}})}}]);
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.