(window.webpackJsonpvtex_search_result_3_138_7=window.webpackJsonpvtex_search_result_3_138_7||[]).push([[16],{109:function(e,t,a){"use strict";a.r(t);var r=a(0),n=a.n(r),i=a(5),o=a.n(i),l=a(1),m=a(18),u=a.n(m),s=a(64),c=a.n(s),d=a(65),v=a.n(d),p=a(6),y=a.n(p),f=a(3),b=a(21),h=a.n(b),j=a(20),w=a(124);var O=function(e){return function(t){return n.a.createElement(w.a,{handleWidth:!0},(function(a){return n.a.createElement(e,Object(j.a)({},t,{width:a}))}))}},S=a(14),g=a.n(S),E=a(54),x=a(26),I=a.n(x),M=a(66),C=a.n(M),_=a(7);function k(e){var t,a,i=e.item,o=e.displayMode,l=e.position,m=e.listName,u=e.summary,s=e.CustomSummary,c=e.preferredSKU,d=I()().push,v=Object(_.useSearchPage)().searchQuery,p=Object(r.useMemo)((function(){return C.a.mapCatalogProductToProductSummary(i,c)}),[i,c]),y=Object(r.useCallback)((function(){var e,t;d({event:"productClick",product:p,query:null===(e=null==v?void 0:v.variables)||void 0===e?void 0:e.query,map:null===(t=null==v?void 0:v.variables)||void 0===t?void 0:t.map,position:l,list:m})}),[p,d,null===(t=null==v?void 0:v.variables)||void 0===t?void 0:t.map,null===(a=null==v?void 0:v.variables)||void 0===a?void 0:a.query,l,m]),b=Object.assign(Object.assign({},u),{product:p,displayMode:o,listName:m,actionOnClick:y,position:l});return s?n.a.createElement(s,b):n.a.createElement(f.ExtensionPoint,Object(j.a)({id:"product-summary"},b))}var N=Object(r.memo)(k),P=["galleryItem"];function R(e){var t=e.products,a=e.summary,r=e.displayMode,i=e.itemsPerRow,l=e.lazyRender,m=e.rowIndex,u=void 0===m?0:m,s=e.listName,c=e.customSummaryInterval,d=e.CustomSummary,v=e.preferredSKU,p=y()(P),f={flexBasis:"".concat(100/i,"%"),maxWidth:"".concat(100/i,"%")},b=Object(E.a)({lazyRender:l,offset:900}),h=b.hasBeenViewed,j=b.dummyElement;return h?n.a.createElement(n.a.Fragment,null,t.map((function(e,t){var l=u*i+t+1,m=!(!d||!c||l%c!=0);return n.a.createElement("div",{key:e.cacheId,style:f,className:o()(g()(p.galleryItem,[r,m?"custom":""]),"pa4")},n.a.createElement(N,{item:e,summary:a,displayMode:r,position:l,listName:s,CustomSummary:m?d:void 0,preferredSKU:v}))}))):j}var z=Object(r.memo)(R),K=a(79),U=a(25),q=a(52),F=a(53),W=["gallery"],B=c.a.ProductListProvider;t.default=O((function(e){var t,a=e.products,i=void 0===a?[]:a,m=e.mobileLayoutMode,s=void 0===m?"normal":m,c=e.maxItemsPerRow,d=void 0===c?{desktop:5,tablet:3,phone:2}:c,p=e.minItemWidth,b=void 0===p?240:p,j=e.width,w=e.summary,O=e.showingFacets,S=e.lazyItemsRemaining,g=e.customSummaryInterval,E=e.CustomSummary,x=e.preferredSKU,I=u()().isMobile,M=(Object(r.useContext)(U.a)||{}).trackingId,C=y()(W),_=Object(f.useRuntime)().getSettings,k=v()(d),N=Object(q.a)(),P=Object(F.a)(null!=N?N:[],{matchFt:!0}).trim(),R=M||P||"Search result",J=I?s:"normal",L=function(){var e=Math.floor(j/b);if(I){if("normal"===J)return 1;var t=e>=2?e:2;return k<=t?k:t}return k<=e?k:e}()||k,Q=Object(r.useMemo)((function(){return Object(l.splitEvery)(L,i)}),[L,i]),T=o()(C.gallery,"flex flex-row flex-wrap items-stretch bn ph1 na4",O?"pl9-l":"justify-center"),V=null===(t=_("vtex.store"))||void 0===t?void 0:t.enableSearchRenderingOptimization;return n.a.createElement(B,{listName:R},n.a.createElement("div",{className:T},Q.map((function(e,t){return n.a.createElement(z,{key:t,products:e,lazyRender:V&&t>=2,summary:w,displayMode:J,itemsPerRow:L,rowIndex:t,listName:R,customSummaryInterval:g,CustomSummary:E,preferredSKU:x})})),"number"==typeof S&&S>0&&n.a.createElement("div",{style:{width:"100%",height:300*Math.ceil(S/L)},className:"flex justify-center pt10"},n.a.createElement(h.a,null))),n.a.createElement(K.a,null))}))}}]);