!function(){"use strict";const e="row-evry-first-col",n="row-evry-last-col",t="more-than-one-row",o=[e,n,t],i=new WeakSet;let r=null,s=null;function c(e,n,t){const o=e.classList.contains(n);t&&!o?e.classList.add(n):!t&&o&&e.classList.remove(n)}function a(e){return Array.prototype.slice.call(e.querySelectorAll(":scope > .preco-card"))}function d(e){return null!==e.offsetParent||e.getClientRects().length>0}function u(){r=null,document.querySelectorAll(".preco-recommendations-layout-lay_3 .preco-recommendations__grid").forEach(function(r){!function(e){if(!i.has(e)){if(i.add(e),"ResizeObserver"in window){const n=new ResizeObserver(l);n.observe(e);const t=e.closest(".preco-recommendations");t&&t!==e&&n.observe(t)}"IntersectionObserver"in window&&new IntersectionObserver(function(e){e.some(function(e){return e.isIntersecting})&&l()}).observe(e)}}(r),function(i){if(i.classList.contains("preco-recommendations__grid--slider")||i.querySelector(":scope > .preco-slider__row"))return void function(e){a(e).forEach(function(e){o.forEach(function(n){c(e,n,!1)})})}(i);if(!d(i))return;const r=a(i).filter(d);if(!r.length)return;const s=[];let u=null;r.forEach(function(e){const n=e.offsetTop;(!u||Math.abs(n-u.top)>2)&&(u={top:n,items:[]},s.push(u)),u.items.push(e)}),s.forEach(function(o,i){o.items.forEach(function(r,s){c(r,e,0===s),c(r,n,s===o.items.length-1),c(r,t,i>0)})})}(r)})}function l(){null===r&&(r=window.requestAnimationFrame(u))}function f(){u(),"MutationObserver"in window&&new MutationObserver(l).observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),window.addEventListener("load",l),window.addEventListener("pageshow",l),document.addEventListener("visibilitychange",l),document.addEventListener("load",function(e){e.target&&"IMG"===e.target.tagName&&l()},!0),window.addEventListener("scroll",function(){clearTimeout(s),s=setTimeout(l,150)},{passive:!0}),document.fonts&&document.fonts.ready&&document.fonts.ready.then(l).catch(function(){})}window.precoUpdateGridRows=l,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",f):f()}();