1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2468],{22648:function(e,t,o){"use strict";o.d(t,{F:function(){return r}});var r=o(9377).Nb},62943:function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return buyLook}});var r=o(90849),l=o(90832),n=o(9377).M$,i=o(26884),a=o(27378),s=o(22648),u=o(71401),{api:{storeId:c}}=o.n(u)(),d=["".concat(c,".vteximg.com.br")],v="".concat(c,".vtexassets.com"),normalizeUrlImages=e=>{var t=e;return d.forEach(e=>{var o;t=null===(o=t)||void 0===o?void 0:o.replace(e,v)}),t},p=o(43377),m=o(73441),b=o.n(m),y=o(19849),f=o(67889),h=o(62766),j=o(85923),g=o(82804),k=o.n(g),x=o(88401),O=o(24246);function ownKeys(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,r)}return o}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach(function(t){(0,r.Z)(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}var _=a.memo(e=>{var{product:t,setLookProducts:o,lookProducts:r,index:l,still:n=!0}=e,i=(0,a.useCallback)(e=>{changeSize(null==t?void 0:t.productId,e.itemId)},[t]),changeSize=(e,t)=>{o(o=>o.map(o=>o.productId===e?_objectSpread(_objectSpread({},o),{},{seletedItem:t}):o))},s=(0,a.useMemo)(()=>{var e;return null===(e=t.items.filter(e=>e.itemId===(null==t?void 0:t.seletedItem)))||void 0===e?void 0:e[0]},[r]);return(0,O.jsx)("div",{className:k().shelfBuyLookContent,children:(0,O.jsx)(x.Z,{variant:"look-pdp",handleSelectItem:i,handleSelectProduct:e=>{o(t=>t.map(t=>t.productId===e.productId?_objectSpread(_objectSpread({},t),{},{selected:!t.selected}):t))},selectedItem:s,position:l,product:t,still:n,creative:"compre-look-pdp"})})}),P=a.memo(e=>{var{title:t,subTitle:o,lookProducts:r,setLookProducts:l,addToCart:n,textBuyButton:i,total:s,textPrice:u,still:c=!0}=e,d=(0,p.d)(),v=(0,a.useMemo)(()=>(null==r?void 0:r.length)<=2?"small":"regular",[r]);return(0,O.jsxs)("div",{className:b().buyLookContent,"data-buy-look-size":v,children:[(0,O.jsx)(y.Z,{text:t,variant:"title04"}),(0,O.jsx)(y.Z,{text:o,variant:"subtitle02",color:"var(--color-neutral-500)"}),(0,O.jsxs)("div",{className:b().buyLookBase,children:[(0,O.jsx)(j.Z,{size:null==r?void 0:r.length,showArrow:!d&&(null==r?void 0:r.length)>3,itemsPerPage:d?1.2:"small"===v?2:3,stepper:{isActive:!1},arrowPosition:"top",children:null==r?void 0:r.map((e,t)=>(0,O.jsx)("div",{children:(0,O.jsx)(_,{product:e,setLookProducts:l,lookProducts:r,index:t,still:c})},t+e.productId))}),d?(0,O.jsx)("div",{className:b().buyLookBtnAddToCart,children:(0,O.jsx)(h.Z,{variant:"primary",onClick:n,size:"large",disabled:0===s,children:(0,O.jsx)(y.Z,{text:"".concat(i," ").concat((0,f.T4)(s))})})}):(0,O.jsxs)("div",{className:b().buyLookBtnAddToCart,children:[(0,O.jsx)(y.Z,{text:u,variant:"subtitle01"}),(0,O.jsx)(y.Z,{text:(0,f.T4)(s),variant:"title03"}),(0,O.jsx)(h.Z,{variant:"primary",onClick:n,disabled:0===s,children:(0,O.jsx)(y.Z,{text:i})})]})]})]})}),w=o(79616),L=o(97818),C=o(42791),S=o(19376),I=o(82566),Z=o.n(I),E=o(14123),A=o(79635),B=o(67882);function buyLook_ownKeys(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,r)}return o}function buyLook_objectSpread(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?buyLook_ownKeys(Object(o),!0).forEach(function(t){(0,r.Z)(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):buyLook_ownKeys(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}var buyLook=e=>{var{title:t,subTitle:o,textPrice:r,textBuyButton:u,isActive:c,device:d,initialDate:v,finalDate:m,still:b=!0}=e,f=(0,i.al)(),j=(0,p.d)(),{isOpened:g,toggle:k}=(0,L.O)({interaction:{componentName:"alert-not-size-buy-look-pdp"}}),{0:x,1:_}=(0,a.useState)(),I=(0,a.useMemo)(()=>{var e;return null==f?void 0:null===(e=f.data)||void 0===e?void 0:e.product},[f]),M=(0,a.useMemo)(()=>{var e,t;return null!==(e=null==I?void 0:null===(t=I.isVariantOf)||void 0===t?void 0:t.productGroupID)&&void 0!==e?e:null},[I]),[N,{data:D}]=(0,l.t)(n,{productId:M}),z=(0,a.useMemo)(()=>{var e;return null!==(e=null==D?void 0:D.getSimilarsListOfProducts)&&void 0!==e?e:[]},[D]),T=(0,a.useMemo)(()=>null==x?void 0:x.filter(e=>e.selected),[x]),K=(0,a.useMemo)(()=>{var e=0;return null==T||T.forEach(t=>{var o,r,l,n;e+=null===(o=t.items)||void 0===o?void 0:null===(r=o[0])||void 0===r?void 0:null===(l=r.sellers)||void 0===l?void 0:null===(n=l[0])||void 0===n?void 0:n.commertialOffer.spotPrice}),e},[T]),U=(0,a.useMemo)(()=>({sort:"",facets:[{map:"ft",query:""}],query:"sku.id:".concat(I.id),count:1,page:[1],skipFilter:!0}),[I]),[q,{data:F}]=(0,l.t)(s.F,buyLook_objectSpread({},U));(0,a.useEffect)(()=>{var e;null!=M&&M.length&&null!=I&&null!==(e=I.id)&&void 0!==e&&e.length&&c&&(q(U),N({productId:M}))},[M,I,c]);var X=(0,a.useMemo)(()=>{var e,t,o;return null==F?void 0:null===(e=F.getListOfProducts)||void 0===e?void 0:null===(t=e.search)||void 0===t?void 0:null===(o=t.products)||void 0===o?void 0:o[0]},[F]);return((0,a.useEffect)(()=>
1{if(!(null!=x&&x.length)){if(X){var e=null==z?void 0:z.filter(e=>{var t=e.items.filter(e=>{var t;return(null===(t=e.sellers)||void 0===t?void 0:t[0].commertialOffer.AvailableQuantity)>0});return null==t?void 0:t.length});if(null!=e&&e.length){var t=[];t.push(X),t.push(...(null==e?void 0:e.filter(e=>null!=e))||[]);var o=t.map(e=>(e.items.forEach(e=>{e.images.forEach(e=>{e.imageUrl=normalizeUrlImages(e.imageUrl)})}),e.selected=!0,e));_(o),o&&o.length>1&&window.dispatchEvent(new CustomEvent("@hrg:showAnchorBuyLook"))}}else _([])}},[z,X]),!I||!(null!=x&&x.length)||(null==x?void 0:x.length)<=1||(0,w.T)({device:d,isActive:c,initialDate:v,finalDate:m},j))?(0,O.jsx)(a.Fragment,{}):(0,O.jsx)(B.Z,{type:"promotion",promotion:{componentName:"compre-look-pdp",creative:"compre-look-pdp"},children:(0,O.jsxs)("section",{id:"buy-look-pdp",children:[(0,O.jsx)(P,{addToCart:()=>{if(null!=T&&T.length){var e=T.filter(e=>{var t;return null===(t=e.seletedItem)||void 0===t?void 0:t.length}).flatMap(e=>{var t=e.items.find(t=>t.itemId===e.seletedItem);return t?[buyLook_objectSpread(buyLook_objectSpread({},t),{},{product:e})]:[]});null!=e&&e.length?((0,A.Ro)("pdp-buy-look"),(0,E.X)(e)):k()}},device:d,isActive:c,lookProducts:x,setLookProducts:_,subTitle:o,textBuyButton:u,textPrice:r,title:t,total:K,still:b}),(0,O.jsxs)(C.Z,{isOpened:g,toggle:k,children:[(0,O.jsx)(S.Z,{toggle:k,title:"Nenhum tamanho selecionado!"}),(0,O.jsxs)("div",{className:Z().modalAlert,children:[(0,O.jsx)(y.Z,{text:'Escolha o tamanho desejado e clique em "Compre look completo" para adicionar \xe0 sacola.',variant:"subtitle01",color:"var(--color-neutral-500)"}),(0,O.jsx)(h.Z,{variant:"primary",onClick:k,children:(0,O.jsx)(y.Z,{text:"Entendi",variant:"subtitle01"})})]})]})]})})}},82804:function(e){e.exports={shelfBuyLookContent:"styles_shelfBuyLookContent__4EX2n"}},73441:function(e){e.exports={buyLookContent:"styles_buyLookContent__zR_72",buyLookBase:"styles_buyLookBase__l_qPM",buyLookBtnAddToCart:"styles_buyLookBtnAddToCart__yXHUG"}},82566:function(e){e.exports={modalAlert:"styles_modalAlert__3v031"}}}]);
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.