"use strict";(self.webpackChunkuniplusshop=self.webpackChunkuniplusshop||[]).push([[592],{1157:(T,u,n)=>{n.d(u,{Q:()=>w});var e=n(4650),m=n(7316),P=n(4435),E=n(9246),i=n(334),O=n(3900),d=n(4004),c=n(5709),M=n(7907),C=n(2734),h=n(9566),v=n(9077),g=n(6895),b=n(9132),p=n(9818),D=n(7392);function B(s,a){if(1&s){const t=e.EpF();e.TgZ(0,"section",6),e.NdJ("click",function(){const _=e.CHM(t).$implicit,l=e.oxw();return e.KtG(l.goToBrand(_.id))}),e.qZA()}2&s&&e.Udp("background-image",a.$implicit.image)}let w=(()=>{class s extends P.h{constructor(t,r,o,_,l){super(null,null,_,r),this.platformId=t,this.router=r,this.imageService=o,this.brandService=_,this.settingsService=l,this.brands$=this.brandsWithImages$}ngAfterViewInit(){setTimeout(()=>{this.swiper=new i.ZP(".swiper-brands-carousel",{modules:[i.W_,i.pt,i.N1],direction:"horizontal",effect:"slide",grabCursor:!0,keyboard:!0,loop:!0,observer:!0,spaceBetween:16,speed:500,autoplay:{delay:6e3,disableOnInteraction:!1},breakpoints:{280:{slidesPerView:1},320:{slidesPerView:1},480:{slidesPerView:2},600:{slidesPerView:3},960:{slidesPerView:4},1280:{slidesPerView:5},1500:{slidesPerView:6}},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}})}),C.l.forceSlidesUpdate(this.platformId)}goToBrand(t){this.gotoByBrand(t)}get brandsWithImages$(){return this.settingsService.settings$().pipe((0,d.U)(t=>t.imageServerUrl),(0,O.w)(t=>this.brandService.getBrands$().pipe((0,d.U)(r=>this.convertImageToUrl(r,t)))))}convertImageToUrl(t,r){return t.map(o=>({...o,image:c.P.toBackgroundUrl(c.P.getUrl(r,o.image,M.h.SMALL))}))}}return s.\u0275fac=function(t){return new(t||s)(e.Y36(e.Lbi),e.Y36(E.q),e.Y36(h.A),e.Y36(m.c),e.Y36(v.g))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-brands-carousel"]],features:[e.qOj],decls:12,vars:3,consts:[["mat-button","","routerLink","/brands",1,"brands-button"],[1,"swiper-brands-carousel","swiper-container","h-100"],[1,"swiper-wrapper","h-100"],["class","swiper-slide",3,"background-image","click",4,"ngFor","ngForOf"],["mat-icon-button","",1,"swiper-button-prev","swipe-arrow"],["mat-icon-button","",1,"swiper-button-next","swipe-arrow"],[1,"swiper-slide",3,"click"]],template:function(t,r){1&t&&(e.TgZ(0,"a",0),e._uU(1,"Mostrar todas as marcas"),e.qZA(),e.TgZ(2,"div",1)(3,"div",2),e.YNc(4,B,1,2,"section",3),e.ALo(5,"async"),e.qZA(),e.TgZ(6,"button",4)(7,"mat-icon"),e._uU(8,"keyboard_arrow_left"),e.qZA()(),e.TgZ(9,"button",5)(10,"mat-icon"),e._uU(11,"keyboard_arrow_right"),e.qZA()()()),2&t&&(e.xp6(4),e.Q6J("ngForOf",e.lcZ(5,1,r.brands$)))},dependencies:[g.sg,b.rH,p.eB,p.Nr,D.Hw,g.Ov],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%;position:relative;background:rgba(0,0,0,.03);padding:16px;box-sizing:border-box;margin-top:30px;margin-bottom:20px}[_nghost-%COMP%] > *[_ngcontent-%COMP%]:not([hidden]) + *[_ngcontent-%COMP%]:not([hidden]){margin-top:10px}[_nghost-%COMP%]   .brands-button[_ngcontent-%COMP%]{display:flex;flex-grow:0;width:-moz-fit-content;width:fit-content}[_nghost-%COMP%]   .swiper-container[_ngcontent-%COMP%]{display:flex;width:100%;height:100%;padding:0 18px;box-sizing:border-box}[_nghost-%COMP%]   .swiper-container[_ngcontent-%COMP%]   .swiper-slide[_ngcontent-%COMP%]{display:flex;align-items:center;height:80px;background-repeat:no-repeat;background-position:center;background-size:contain}"],changeDetection:0}),s})()}}]);