1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[187],{8655:(e,t,a)=>{a.r(t),a.d(t,{default:()=>O});var n=a(96540),r=a(9992),l=a(49822),o=a(36681),i=a(10610),s=a(76396);const c=({text:e,highlight:t})=>n.createElement("span",null,((e,t)=>{const a=null==t?void 0:t.toLowerCase().split(/\s+/);return e.split(new RegExp(`(${a.join("|")})`,"gi")).map(((e,t)=>a.includes(e.toLowerCase())?n.createElement("b",{key:t},e):e))})(e,t));var d=a(10467),u=a(22254),p=a(78465),h=a(17169),m=a(17628),g=a(14714);const f=(e,t,a)=>{const n=(0,p.useCommerceApi)(),{getTokenWhenReady:r}=(0,g.n)(),{sitePrefs:l}=(0,m.f)(),o=l.LW_SearchSuggestions||3,i=a?s.O6:s.Cm,c=(0,u.I)({queryKey:[h.H.plpSearch,e],queryFn:(f=(0,d.A)((function*(){const{token:t}=yield r(),a=yield n.shopperSearch.getSearchSuggestions({parameters:{q:e,limit:o},headers:{authorization:`Bearer ${t}`}}),{productSuggestions:l}=a,s=(e=>{var t;return(null==e||null===(t=e.products)||void 0===t?void 0:t.map((({productId:e})=>e)))||[]})(l),c=yield n.shopperProducts.getProducts({headers:{authorization:`Bearer ${t}`},parameters:{ids:s}}),{data:d}=c,u=((e,t)=>(null==e?void 0:e.filter((e=>{const a=t.some((t=>{var a;return null==e||null===(a=e.c_LW_oisSellableIn)||void 0===a?void 0:a.includes(t)}));if(a){e.c_colorSelected=e.c_colorSelected?JSON.parse(e.c_colorSelected):null;const t=e.c_colorSelected?` ${e.c_colorSelected.displayValue}`:"";e.nameSearchResults=`${e.name}${t}`}return a})))||[])(d,i);return u})),function(){return f.apply(this,arguments)}),enabled:t});var f;return c};var v=a(12388),x=a(38040),y=a(96),b=a(45188);const E=(0,y.A)("div",{target:"enl329912"})("position:fixed;background-color:white;width:100%;height:100vh;@supports (height: 100dvh){height:100dvh;}bottom:0;left:0;right:0;top:0;@media (min-width: ",b.MQ.md,"px){padding-top:var(--lw-spacing-2000);}z-index:",s.RR.ModalWrapperSearch,";"),S=(0,y.A)("div",{target:"enl329911"})("z-index:",s.RR.ModalWrapperSearch,";height:80px;max-width:1920px;@media (min-width: ",b.MQ.md,"px){padding:0 110px;}margin:0 auto;"),w=(0,y.A)("button",{target:"enl329910"})("top:32px;position:relative;cursor:pointer;float:right;right:34px;-webkit-tap-highlight-color:transparent;@media (min-width: ",b.MQ.md,"px){right:0px;}"),_=(0,y.A)("form",{target:"enl32999"})({name:"1wisnmu",styles:"display:flex;align-items:center;margin:0 auto"}),A=(0,y.A)("div",{target:"enl32998"})({name:"8yohqa",styles:"padding:0 32px;width:100%;display:flex;justify-content:center"}),k=(0,y.A)("div",{target:"enl32997"})({name:"1f2bwno",styles:"width:100%;max-width:596px;position:relative;.chakra-form-control{margin:0px;}"}),C="54px",M=(0,y.A)("input",{target:"enl32996"})("width:100%;border-radius:0;-webkit-appearance:none;margin:0px;padding:16px 16px 12px 16px;border:none;border-bottom:0.5px solid #dadada;&:focus,&:hover{outline:none;border-bottom:0.5px solid #1a1919;&::placeholder{color:#1a1919;}}color:#313131;height:",C,";line-height:25.7399px;font-size:17.999px;font-weight:400;text-align:center;margin-bottom:-4px;&::placeholder{color:#757575;}@media (min-width: ",b.MQ.md,"px){margin-right:-46px;padding:16px 62px 12px 62px;}"),R=(0,y.A)("button",{target:"enl32995"})("position:absolute;top:calc(",C," + 5px);right:0;transform:translateY(-150%);width:46px;height:30px;font-size:12px;font-weight:500;padding:0;text-align:center;line-height:0;cursor:pointer;text-decoration:none;background-color:black;color:rgb(255, 255, 255);:disabled{background-color:#999;cursor:none;}display:none;@media (min-width: ",b.MQ.md,"px){display:block;}"),L=(0,y.A)("div",{target:"enl32994"})({name:"1ecl4d6",styles:"display:flex;margin:0 auto;justify-content:center;height:100%;overflow:auto"}),z=(0,y.A)("ul",{target:"enl32993"})({name:"11kpn8n",styles:"list-style:none;display:flex;flex-direction:column;width:100%"}),T=(0,y.A)("li",{target:"enl32992"})({name:"87uhjj",styles:"padding:24px 32px 0;text-align:center"}),D=(0,y.A)("a",{target:"enl32991"})({name:"au8s8q",styles:"font-size:14px;line-height:20px;color:#1a1919;:hover{text-decoration:underline;}&>span{font-weight:400;}"}),I=(0,y.A)(o.I,{target:"enl32990"})({name:"4zleql",styles:"display:block"});var U=a(29715),$=a(15209);const q=({ToogleSearchModal:e,DispatchSetSearch:t,searchQuery:a,isSaUserType:d,onCloseSearch:u})=>{var p;const h=(0,x.tz)(),{locale:m,buildUrl:g}=(0,r.A)(),y=n.useRef(location.pathname),b=n.useRef(null),[C,q]=n.useState(a),O=(0,i.d)({value:C}),W=s.gk.includes(m.id.toUpperCase()),K=(O||"").length>=(W?1:3),{data:P}=f(O,K,d)||{};n.useEffect((()=>{y.current!==location.pathname&&(e(),y.current=location.pathname)}),[location.pathname]);const Q=2e3,j=(0,i.d)({value:P,delay:Q})||[];((e,t,a)=>{const r=n.useRef(!0),{pushEvent:l}=(0,U.b)();n.useEffect((()=>
1{if(r.current)return void(r.current=!1);const n=setTimeout((()=>{const n={event:$.cP.VIEW_SEARCH_RESULTS,search_term:null==e?void 0:e.toLowerCase(),nb_results:t&&a?parseInt(t):0};l({actionType:$.cP.VIEW_SEARCH_RESULTS,payload:n})}),2e3);return()=>clearTimeout(n)}),[e,t,a])})((0,i.d)({value:C,delay:Q}),j?null==j||null===(p=j.length)||void 0===p?void 0:p.toString():"0",K);const H=W?m.id:void 0,B=(0,n.useRef)(null);return(0,n.useEffect)((()=>{if("undefined"==typeof document)return;const e=e=>{if("Tab"===e.key&&B.current){const t=B.current,a=v.e.getFirstFocusableElement(t);console.log(a);const n=a[0],r=a[a.length-1];if(!a.length)return;e.shiftKey&&document.activeElement===n?(e.preventDefault(),v.e.focusElement(r)):e.shiftKey||document.activeElement!==r||(e.preventDefault(),v.e.focusElement(n))}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),n.createElement("div",{ref:B},n.createElement(E,null,n.createElement(S,null,n.createElement(w,{type:"button","aria-label":h.formatMessage({id:"locale|global.close",defaultMessage:[{type:0,value:"Close"}]}),onClick:u,tabIndex:0,"data-rd-focus":!0,"data-testid":"close-search-button"},n.createElement(I,{size:o.y.s75,wrapperProps:{"aria-hidden":"true"}},n.createElement(l.bm,null)))),n.createElement(_,null,n.createElement(A,null,n.createElement(k,null,n.createElement(M,{ref:b,id:"plp-search-products",type:"text",name:"capds-form-search-input",placeholder:h.formatMessage({id:"search|search.search",defaultMessage:[{type:0,value:"Search"}]}),value:C,onChange:e=>{const a=e.target.value;q(a),t(a)},"aria-label":h.formatMessage({id:"search|search.ariainput",defaultMessage:[{type:0,value:"Search"}]}),autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",autoComplete:"off","aria-autocomplete":"list","data-testid":"search-field","data-hide-focus":!0,lang:H,tabIndex:0}),n.createElement(L,null,P&&P.length>0&&K&&n.createElement(z,null,null==P?void 0:P.map((e=>n.createElement(T,{key:null==e?void 0:e.id},n.createElement(D,{href:null==e?void 0:e.slugUrl},n.createElement(c,{text:null==e?void 0:e.nameSearchResults,highlight:C??""}))))))),n.createElement(R,{type:"submit",onClick:t=>{t.preventDefault(),K&&(location.href=`${g("/search")}?q=${C}`,e())},name:"capds-form-search-submit","aria-label":h.formatMessage({id:"search|search.submit",defaultMessage:[{type:0,value:"Enviar"}]}),disabled:!K,"data-testid":"search-ok-button",tabIndex:0,"data-rd-focus":!0},h.formatMessage({id:"search|search.ok",defaultMessage:[{type:0,value:"OK"}]})))))))},O=n.memo(q)},10610:(e,t,a)=>{a.d(t,{d:()=>r});var n=a(96540);function r({value:e,delay:t=500}){const[a,r]=(0,n.useState)(e);return(0,n.useEffect)((()=>{const a=setTimeout((()=>{r(e)}),t);return()=>{clearTimeout(a)}}),[e,t]),a}}}]);
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.