"use strict";(self.webpackChunkceet_carroya_frontend_portal=self.webpackChunkceet_carroya_frontend_portal||[]).push([[6544],{91389:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CyChevronDown=void 0;var l=n(a(24002)),i=a(50718);t.CyChevronDown=function(e){var t=e.size,a=void 0===t?48:t,n=e.color,c=void 0===n?i.EColors.info50:n;return l.default.createElement("svg",{fill:c,width:a,height:a,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},l.default.createElement("path",{fill:c,fillRule:"evenodd",clipRule:"evenodd",d:"M20.5304 7.46973C20.2375 7.1768 19.7627 7.17675 19.4697 7.46961L11.9982 14.9395L4.53024 7.47403C4.2373 7.18118 3.76243 7.18126 3.46958 7.4742C3.17674 7.76714 3.17682 8.24202 3.46976 8.53486L11.468 16.5304C11.7609 16.8232 12.2356 16.8232 12.5285 16.5304L20.5303 8.53039C20.8232 8.23753 20.8232 7.76265 20.5304 7.46973Z"}))},t.default=t.CyChevronDown},90393:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CyChevronUp=void 0;var l=n(a(24002)),i=a(50718);t.CyChevronUp=function(e){var t=e.size,a=void 0===t?48:t,n=e.color,c=void 0===n?i.EColors.info50:n;return l.default.createElement("svg",{fill:c,width:a,height:a,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},l.default.createElement("path",{fill:c,fillRule:"evenodd",clipRule:"evenodd",d:"M3.46961 16.5303C3.76247 16.8232 4.23734 16.8232 4.53027 16.5304L12.0018 9.06051L19.4698 16.526C19.7627 16.8188 20.2376 16.8187 20.5304 16.5258C20.8233 16.2329 20.8232 15.758 20.5302 15.4651L12.532 7.46958C12.2391 7.1768 11.7644 7.17681 11.4715 7.46961L3.46973 15.4696C3.1768 15.7625 3.17675 16.2373 3.46961 16.5303Z"}))},t.default=t.CyChevronUp},52492:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CySearch=void 0;var l=n(a(24002)),i=a(50718);t.CySearch=function(e){var t=e.size,a=void 0===t?48:t,n=e.color,c=void 0===n?i.EColors.info50:n;return l.default.createElement("svg",{fill:c,width:a,height:a,viewBox:"0 0 24 25",xmlns:"http://www.w3.org/2000/svg"},l.default.createElement("path",{fill:c,fillRule:"evenodd",clipRule:"evenodd",d:"M3.11853 3.14026C5.27657 0.98222 8.77543 0.98222 10.9335 3.14026C13.0714 5.27819 13.0913 8.7321 10.9932 10.8945C10.9712 10.9121 10.9499 10.931 10.9296 10.9514C10.9092 10.9718 10.8903 10.993 10.8727 11.015C8.71027 13.113 5.25644 13.0931 3.11853 10.9552C0.960491 8.79716 0.960491 5.29829 3.11853 3.14026ZM11.4358 12.5183C8.6766 14.748 4.62252 14.5805 2.05787 12.0159C-0.685956 9.27203 -0.685956 4.82342 2.05787 2.0796C4.80169 -0.664227 9.25031 -0.664227 11.9941 2.0796C14.5588 4.64429 14.7263 8.69844 12.4964 11.4576L17.2803 16.2414C17.5732 16.5343 17.5732 17.0092 17.2803 17.3021C16.9874 17.595 16.5125 17.595 16.2196 17.3021L11.4358 12.5183Z"}))},t.default=t.CySearch},13520:function(e,t,a){a(24002);t.A=a.p+"static/media/cy_chevron.0b5ce5e77f17ce16a80ebe5c4e95d1a5.svg"},67086:function(e,t,a){a(24002);t.A=a.p+"static/media/cy_icon_todosVehiculos.e0f0d6d3499676d0f446635201cd2997.svg"},17769:function(e,t,a){var n=a(24002),l=a.n(n),i=a(36764);t.A=e=>{let{tabs:t,statistics:a,changetab:c}=e;const{setTealium:o}=(0,i.A)(),[r,s]=(0,n.useState)(0),[m,d]=(0,n.useState)(0),[u,h]=(0,n.useState)({left:!1,right:!1}),[p,v]=(0,n.useState)(0),f=(0,n.useRef)(null),g=(0,n.useCallback)((e=>{e&&(d(e.offsetLeft),s(e.clientWidth))}),[]),_=(0,n.useCallback)((e=>{a&&o({type:"link",structure:{tealium_event:"link",event_name:"click",click:a+t[e].name.replace(/\s/g,"_").toLowerCase()}}),v(e),c(e)}),[c,o,a,t]),y=(0,n.useMemo)((()=>t.map(((e,t)=>{const a=t===p,n=e.disabled;return l().createElement("span",{key:`tab_key_${t}`,ref:e=>a&&g(e),className:`cy-tabs__item ${a?"cy-tabs__item_active":""} ${n?"cy-tabs__item_disabled":""}`,onClick:()=>!n&&_(t)},e.name)}))),[p,_,t,g]),E=e=>{const t=e.getBoundingClientRect(),a=e.children[0].getBoundingClientRect();h({left:Math.abs(t.left-a.left)>2,right:t.right-a.right<-1})};return(0,n.useEffect)((()=>{f.current&&E(f.current)}),[t]),l().createElement("div",{className:`cy-tabs__wrapper ${u.right?"cy-tabs__wrapper_overpass-right":""} ${u.left?"cy-tabs__wrapper_overpass-left":""}`},l().createElement("div",{className:"cy-tabs__container",ref:f,onScroll:e=>{E(e.currentTarget)}},l().createElement("div",{className:"cy-tabs__content"},y,l().createElement("div",{className:"cy-tabs__active-line",style:{width:r,transform:`translateX(${m}px)`}}))))}},28848:function(e,t,a){var n=a(24002),l=a.n(n);t.A=e=>{let{children:t,classSafeArea:a}=e;return l().createElement("div",{className:"safeArea "+(a||"")},l().createElement("div",{className:"children"},t))}},91318:function(e,t,a){a.d(t,{L:function(){return n}});const n={cidpaquete:507,user:{imgSrc:`${a(21855).cA.public.assets}/images/Thumb_adviser.webp`,userData:{name:"Nikolas Tuta Garay",description:"Asesor CarroYa"}}}},24629:function(e,t,a){a.r(t),a.d(t,{default:function(){return V}});var n=a(24002),l=a.n(n),i=a(9647),c=a(21855),o=a(28848),r=a(70907),s=a(34056),m=a(36764),d=a(2284);var u=()=>{const[{width:e}]=(0,d.A)(),{setTealium:t}=(0,m.A)(),a=(0,s.useHistory)(),u=(0,n.useMemo)((()=>{const t=e<=768;return l().createElement("img",{src:`${c.cA.public.assets}/images/logos/banks/${t?"logo-aval-white_movil":"logo-aval-white"}.webp`,alt:"Financiación para vehículos en Colombia con banco de bogotá, av villas, occidente o popular",height:t?102:100,width:t?334:135})}),[e<=768]);return l().createElement("div",{className:"banksBarArea"},l().createElement(o.A,null,l().createElement("div",{id:"mainContainer"},l().createElement("div",{id:"logosContainer"},u),l().createElement("div",{id:"contentContainer"},l().createElement("h2",null,l().createElement("span",null,"¡Súbete al vehículo que más te gusta!."),"Revisa TASAS, PRECIOS y BENEFICIOS",l().createElement("br",null),"exclusivos que te acercan a lo que más quieres. ")),l().createElement(i.CyButton,{onClick:()=>{t({type:"link",structure:{tealium_event:"link",event_name:"click",click:"home-bloque_bancos-simula_tu_credito"}}),setTimeout((()=>{a.push(`${r.D.SimulateCredit.general}`)}),1)},id:"contentButton"},"Solicita tu crédito"))))},h=a(29885),p=a(39467);const v=e=>{let{idDivPromotionalZone:t,isBackground:a,title:i,content:c}=e;const{adSpacePrepared:r}=(0,n.useContext)(p.Bn),[s]=(0,d.A)(),m=(0,n.useCallback)((()=>{r({adUnits:t})}),[s.device,r]);return(0,n.useEffect)((()=>{m()}),[m]),l().createElement("div",{className:"promotionalZone "+(a?"backgroundPromotionalZone":"")},l().createElement(o.A,null,l().createElement("div",{className:"promotionalZoneContainer"},l().createElement(l().Fragment,null,l().createElement("h1",null,i),c&&l().createElement("span",{className:"description"},c),l().createElement("div",{className:"imagesContainer"},l().createElement("div",{className:"principalContainer"},l().createElement("div",{className:"cardImage",id:t[0].divId})),l().createElement("div",{className:"secondaryContainer"},l().createElement("div",{className:"cardImage",id:t[1].divId}),l().createElement("div",{className:"multipleCards"},l().createElement("div",{className:"cardImage",id:t[2].divId}),l().createElement("div",{className:"cardImage",id:t[3].divId}))))))))};v.defaultProps={isBackground:!0,title:"Promociones especiales",content:null};var f=v,g=a(68594),_=a(6652),y=a(67086),E=a(89103),b=a(13520),S=a(33506),C=a.n(S),w=a(10282),N=a(57657),A=a(91389),I=a.n(A),k=a(90393),R=a.n(k),O=a(41321),L=a.n(O),P=a(52492),D=a.n(P);var T=e=>{let{className:t,titleSelect:a,cancelName:i,placeholder:c,placeholderImg:o,extendList:r,animationOpen:s,animationClose:m,objectData:d,firstItem:u,label:h,placeholderSearch:p,errorMessageSearch:v="Oops! En el momento no hay coincidencias, pero encontramos estas opciones para ti",itemsHighlight:f,hasSearch:g,titleHighlight:_,itemDefault:y,disabled:E,onSelected:b}=e;const S=(0,n.useMemo)((()=>Array.isArray(d)?d.map(((e,t)=>(e.highlight=t<(f??0),e))):d),[d]),[C,w]=(0,n.useState)(),[N,A]=(0,n.useState)(!1),[k,O]=(0,n.useState)([]),[P,T]=(0,n.useState)(S),[B,$]=(0,n.useState)(null),[x,M]=(0,n.useState)(!1),q=(0,n.useRef)(null),F=(0,n.useRef)(""),j=(0,n.useRef)(!1);let H=!1;(0,n.useEffect)((()=>{u&&U(u)}),[u]),(0,n.useEffect)((()=>{if(y){const e=JSON.parse(y);Z(e,d.findIndex((t=>t.id===e.id)))}else Z(C,-999);T(d);const e=document.querySelector(".search");e&&(e.value="")}),[d]),(0,n.useEffect)((()=>{const e=[];let t=!1,a=!1;P&&Object.keys(P).map((n=>{const i=z(P[n],"highlight");i&&(a=!0);const c=!i&&!t&&a;c&&(t=!0);const o=z(P[n],"id"),r=z(P[n],"type"),s={id:o,logo:z(P[n],"logo"),name:z(P[n],h||"name"),count:z(P[n],"count")?J(z(P[n],"count")):"",type:r},m=l().createElement("li",{onClick:()=>Z(s,n),key:String(n),className:["cy-vehicle-options-selector__list-content-item",B?.id===s.id?"cy-vehicle-options-selector__list-content-item--selected":"",i?"cy-vehicle-options-selector__list-content-item--highlight":"",c?"cy-vehicle-options-selector__list-content-item--normal":""].filter(Boolean).join(" ")},i?l().createElement(l().Fragment,null,l().createElement("div",{className:"cy-vehicle-options-selector__list-content-item-line-red"}),l().createElement("div",{className:"cy-vehicle-options-selector__list-content-item-line-red",style:{marginRight:"0.45vw"}})):null,s.logo?l().createElement("div",{className:"cy-vehicle-options-selector__list-content-item-image"},l().createElement("img",{src:s.logo,className:"imagelist",alt:"Logo tipo vehículo"})):null,l().createElement("h3",{className:"cy-vehicle-options-selector__list-content-item-name"},F.current.length>0&&l().createElement("b",null,s.name?.substring(0,F.current.length)),s.name?.substring(F.current.length,s.name.length)),s.count?l().createElement("h3",{className:"count"},s.count):null);return e.push(m)})),O(e)}),[P,B]),(0,n.useEffect)((()=>{function e(e){q.current&&!q.current.contains(e.target)&&W()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[q]);const U=e=>{if(!e||"string"!=typeof e)return;const t=(e=JSON.parse(e)).logo?z(e,"logo"):"",a=z(e,h||"name"),n=z(e,"count")?J(z(e,"count")):null;w({logo:t,name:a,count:n,id:-999})},z=(e,t)=>t?e[t]:null,J=e=>new Intl.NumberFormat("de-DE").format(e),Z=(e,t)=>{$(e),e&&b(e),W()},W=()=>{j.current=!1;const e=t.split(" ")[0],a=document.querySelector(`.${e}.cy-vehicle-options-selector.cy-vehicle-options-selector--on`);if(window.innerWidth<=768&&m){window.document.querySelector("body").classList.remove("no_scroll");const e=document.querySelector(".cy-vehicle-options-selector__content-list");e&&a&&(e.classList.add("animate__animated",m),e.addEventListener("animationend",(()=>{e.className=e.className.replace(/\banimate__.*?\b/g,""),a.classList.remove("cy-vehicle-options-selector--on")})))}else a&&a.classList.remove("cy-vehicle-options-selector--on");M(!1)};const G=(0,n.useMemo)((()=>B?o?l().createElement("img",{className:"cy-vehicle-options-selector__select-placeholder-img",src:B.logo,alt:"Imagen del tipo de vehículo seleccionado",height:38,width:38}):l().createElement("h3",{className:"cy-vehicle-options-selector__select-placeholder-text"},B.name):l().createElement("h3",{className:"cy-vehicle-options-selector__select-placeholder-text"},c)),[o,B]);return l().createElement("div",{className:`cy-vehicle-options-selector ${t}`,ref:q},l().createElement("div",{className:("cy-vehicle-options-selector__container "+(g?"hasSearch":"")).trim(),"aria-disabled":E},l().createElement("div",{className:("cy-vehicle-options-selector__select "+(E?"cy-vehicle-options-selector__select--disabled":"")).trim(),onClick:e=>{(e=>{const a=t.split(" ")[0];if(!E)if(M(!0),j.current)W();else{j.current=!0;const t=e.target.closest(`.${a}.cy-vehicle-options-selector`);if(t&&t.classList.add("cy-vehicle-options-selector--on"),H){const e=document.querySelector(".contentItems");e&&(e.scrollTop=0),H=!1}if(window.innerWidth<=768&&s){window.document.querySelector("body").classList.add("no_scroll");const t=e.target.closest(".cy-vehicle-options-selector__content-list");t&&(t.classList.add("animate__animated",s),t.addEventListener("animationend",(()=>{t.className=t.className.replace(/\banimate__.*?\b/g,"")})))}}})(e)}},G,l().createElement("div",{className:"cy-vehicle-options-selector__select-arrow"},x?l().createElement(R(),{size:14,color:"#546E7A"}):l().createElement(I(),{size:14,color:E?"#ABB6BB":"#546E7A"}))),x&&l().createElement(l().Fragment,null,l().createElement("div",{className:"cy-vehicle-options-selector__background-mobile",onClick:()=>{W()}}),l().createElement("div",{className:"cy-vehicle-options-selector__content-list",style:{width:(r?100*r:300)+"%"}},l().createElement("div",{className:"cy-vehicle-options-selector__header-mobile"},l().createElement("div",{className:"cy-vehicle-options-selector__header-mobile-title"},a),l().createElement("div",{className:"cy-vehicle-options-selector__header-mobile-cancel",onClick:()=>{W()}},l().createElement(L(),{size:22,color:"#546E7A"}))),g?l().createElement("div",{className:"cy-vehicle-options-selector__filter"},l().createElement("div",{className:"cy-vehicle-options-selector__filter-container"},l().createElement("div",{className:""+(N?"cy-vehicle-options-selector__filter-error":"")},l().createElement("div",{className:"cy-vehicle-options-selector__filter-container-paddingFilter"},l().createElement("input",{type:"text",className:""+(N?"cy-vehicle-options-selector__filter-container-search--error":"cy-vehicle-options-selector__filter-container-search"),placeholder:p,onChange:e=>{F.current=e.target.value.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})),(e=>{let t=[];const a=e.toLowerCase();t=d.filter(((e,t)=>z(e,h||"name").toLowerCase().startsWith(a))),T(t),0===t.length?A(!0):A(!1)})(F.current)}}),l().createElement(D(),{size:28,color:""+(N?"#FCB09A":"#BECDD3")})),N?l().createElement("div",null,l().createElement("div",{className:"cy-vehicle-options-selector__filter-container-error-message"},l().createElement("h5",null,v))):null))):null,l().createElement("div",{className:`${C?"cy-vehicle-options-selector__first-item":"nonFirstItem"} ${g?"selected":""}`.trim()},l().createElement("div",{className:`cy-vehicle-options-selector__first-item-item ${g?"count":""} ${B?.id===C?.id?"cy-vehicle-options-selector__list-content-item--selected":""}`.trim(),onClick:()=>{Z(C,-999)}},C&&C.logo?l().createElement("div",{className:"cy-vehicle-options-selector__first-item-content-image"},l().createElement("img",{className:"cy-vehicle-options-selector__first-item-content-image-list",src:C.logo,alt:"imageList"})," "):null,l().createElement("h3",null,C?C.name:""),C&&C.count?l().createElement("h3",{className:"count"},C?C.count:""):null)),l().createElement("div",{className:"cy-vehicle-options-selector__list"},l().createElement("div",{className:"cy-vehicle-options-selector__list-content-items"},P&&P.length>0&&f?l().createElement("div",{className:"cy-vehicle-options-selector__list-content-items-titleHighlight"},l().createElement("h3",null,_)):null,l().createElement("ul",null,k)))))))};var B=e=>{let{className:t,titleSelect:a,disabled:n,extendList:i,placeholderImg:c,placeholder:o,animationOpen:r,animationClose:s,hasSearch:m,itemsHighlight:d,titleHighlight:u,placeholderSearch:h,objectData:p,firstItem:v,label:f,itemDefault:g,onSelected:_}=e;return l().createElement(T,{className:t,titleSelect:a,disabled:n,extendList:i,placeholderImg:c,placeholder:o,animationOpen:r,animationClose:s,hasSearch:m,itemsHighlight:d,titleHighlight:u,placeholderSearch:h,objectData:p,firstItem:v,label:f,itemDefault:g,onSelected:_})};var $=e=>{let{className:t,titleSelect:a,placeholderImg:n,animationOpen:i,animationClose:c,objectData:o,firstItem:r,label:s,itemDefault:m,onSelected:d,extendList:u}=e;return l().createElement(T,{className:t,titleSelect:a,extendList:u,placeholderImg:n,animationOpen:i,animationClose:c,objectData:o,firstItem:r,label:s,itemDefault:m,onSelected:d})};let x=[];var M=()=>{const e=(0,n.useState)('{"id": -999,"name": "Todos los tipos de vehículos", "logo": "all"}'),t=(0,n.useState)('{"id": -999,"name": "Todas las marcas", "logo": "","count":0 }'),a=(0,n.useState)('{"id": -999,"name": "Todas las líneas", "logo": "","count": 0 }'),i=(0,s.useHistory)(),{adSpacePrepared:d}=(0,n.useContext)(p.Bn),[u,h]=(0,n.useState)(t[0]),[v,f]=(0,n.useState)(!0),[g,S]=(0,n.useState)(null),[A,I]=(0,n.useState)(e[0]),[k,R]=(0,n.useState)(t[0]),[O,L]=(0,n.useState)(a[0]),[P,D]=(0,n.useState)(0),[T,M]=(0,n.useState)(a[0]),[q,F]=(0,n.useState)(!0),[j,H]=(0,n.useState)("0"),[U,z]=(0,n.useState)(t[0]),[J,Z]=(0,n.useState)(a[0]),{setTealium:W}=(0,m.A)();let G,V={id:0,name:N.WD.tI,logo:y.A,type:"VehicleType"};function X(e){const n=x.find((t=>t.name===e.name));R(t[0]),L(a[0]),I(n??{...e,_name:e.name})}function Y(e){let t=0;return e.forEach((e=>{t+=e.count})),t}V=JSON.stringify(V),(0,n.useEffect)((()=>{!async function(){const t="/find-vehicle-by-category-brand-wsearch/allCategories",a=c.cA.url_habilitadora+t;await C().get(a).then((t=>{200===t.status&&(t.data?(x=ee(t.data.map((e=>({...e,name:e.label,_name:e.name,type:"VehicleType"})))),G=x.find((e=>1===e.id))):(x={},G={}),S(l().createElement($,{className:"vehicle selectContainer",titleSelect:"Seleccionar tipo de vehículo",extendList:2.4,placeholderImg:!0,animationOpen:"animate__fadeInUp",animationClose:"animate__fadeOutDown",objectData:0===x.length?e[0]:x,firstItem:V,itemDefault:JSON.stringify(G),onSelected:X})))}))}()}),[]),(0,n.useEffect)((()=>{d({adUnits:[{divId:"starOneHome"}]})}),[]),(0,n.useEffect)((()=>{!function(){const t=JSON.parse(e[0]),a=!Array.isArray(A),n=A.id!==t.id;return a&&n}()?f(!0):function(){const e=c.cA.url_habilitadora+`/find-vehicle-by-category-brand-wsearch/filter?category=${K()}`;A.id&&C().get(e).then((e=>{if(e.data&&e.data.length>0){const t=e.data.map((e=>({...e,type:"VehicleBrand"})));h(t),f(!1),D(Y(e.data))}else f(!0)}))}()}),[A.id,e[0].id]),(0,n.useEffect)((()=>{!function(){const a=JSON.parse(e[0]),n=JSON.parse(t[0]),l=!Array.isArray(A),i=A.id!==a.id,c=!Array.isArray(k),o=k.id!==n.id;return l&&i&&c&&o}()?F(!0):function(){const e=c.cA.url_habilitadora+`/find-vehicle-by-category-brand-wsearch/filter?category=${K()}&brand=${k.name}`;A.id&&k.name&&C().get(e).then((e=>{if(e.data&&e.data.length>0){const t=e.data.map((e=>({...e,type:"VehicleLine"})));M(t),F(!1),H(Y(e.data))}else F(!0)}))}()}),[k.id,A.id,t[0].id,e[0].id]),(0,n.useEffect)((()=>{let e={id:-999,name:N.WD.Ye,logo:"",count:P};e=JSON.stringify(e),z(e)}),[P]),(0,n.useEffect)((()=>{let e={id:0,name:N.WD.V1,logo:"",count:j};e=JSON.stringify(e),Z(e)}),[j]);const Q=()=>{let e=!1;return window.document.querySelectorAll(".highlight").forEach((t=>{t.querySelector("h3")&&t.querySelector("h3").innerText===k.name&&(e=!0)})),e};function K(){return 1===A.id?N.WD.G$:A._name}const ee=e=>(e.forEach((e=>{delete e.count,w.A.forEach((t=>{e.name===t.type&&(e.logo=t.logo)}))})),e);return l().createElement(l().Fragment,null,l().createElement("div",{className:"relative"},l().createElement("div",{id:"starOneHome"}),l().createElement(o.A,null,l().createElement("div",{className:"searchContainer"},l().createElement("div",{className:"containerSearch show"},g,l().createElement("div",{className:"contentLine"},l().createElement("div",{className:"line"})),l().createElement(B,{className:"brands selectContainer",titleSelect:"seleccionar marca",cancelName:N.Sf.Z,disabled:v,extendList:1.83,placeholderImg:!1,placeholder:"Todas las marcas",animationOpen:"animate__fadeInUp",animationClose:"animate__fadeOutDown",label:"name",hasSearch:!0,itemsHighlight:3,titleHighlight:"MARCAS CON MÁS OFERTAS",placeholderSearch:"Busca la marca de tu elección",objectData:0===u.length||-999===A.id?t[0]:u,firstItem:U,onSelected:function(e){L(a[0]),R(e)}}),l().createElement("div",{className:"contentLine"},l().createElement("div",{className:"line line2"})),l().createElement(B,{className:"lines selectContainer",titleSelect:"seleccionar LÍNEA",cancelName:N.Sf.Z,disabled:q,extendList:1.4,placeholderImg:!1,placeholder:"Todas las líneas",animationOpen:"animate__fadeInUp",animationClose:"animate__fadeOutDown",label:"name",hasSearch:!0,itemsHighlight:0,placeholderSearch:"Busca la línea de tu elección",objectData:-999===A.id?a[0]:T,firstItem:J,onSelected:function(e){L(e)}}),l().createElement("button",{className:"primary",onClick:function(){const e=k.name?k.name:"todas_las_marcas",t=O.name?O.name:"todas_las_lineas",a=`"CD5":"${A.name?A.name:"todos_los_tipos_de_vehiculos"}","CD6":"${e}","CD22":"${t}","CD42":"${Q()}"`;W((0,_.ex)(_._q,"-boton_buscar",a));let n="";if(A.id>>>0===parseFloat(A.id)){const e=K();n=e?n+"/"+(0,E.AU)(e,"-"):n}k.id>>>0===parseFloat(k.id)&&(n=k.name?n+"/"+(0,E.AU)(k.name,"-"):n),O.id>>>0===parseFloat(O.id)&&(n=O.name?n+"/"+(0,E.AU)(O.name,"-"):n),setTimeout((()=>{i.push(n||r.D.search.general)}),1)}},l().createElement("h3",null,"Buscar"),l().createElement("img",{src:b.A,className:"arrow",alt:">"})))))))},q=a(31357),F=a(13276),j=a(13925),H=a(2508),U=a(5744),z=a(17769);var J=(0,H.connect)((e=>{let{specialOffers:t}=e;return{recommended:t.recommended,releases:t.releases,page:t.page}}),(e=>({addNewSpecialOffersRecommended:t=>e((0,q.VP)(t)),addNewSpecialOffersRelease:t=>e((0,q.Xq)(t)),changePageSpecialOffers:(t,a)=>e((0,q.yd)(t,a))})))((e=>{let{addNewSpecialOffersRecommended:t,addNewSpecialOffersRelease:a,page:i,changePageSpecialOffers:d}=e;const[u,h]=(0,n.useState)({recommendedRetries:0,releasesRetries:0}),[v,f]=(0,n.useState)(!0),[g,y]=(0,n.useState)(i),[b,S]=(0,n.useState)(0),{setTealium:w}=(0,m.A)(),N=(0,s.useHistory)(),{adSpacePrepared:A}=(0,n.useContext)(p.Bn),I=()=>{B(!0),C().get(`${c.cA.url_habilitadora}/find-latest-releases/?page=${i.releases}`).then((e=>{const t=e.data.aggUltimosLanzamientos;8===t.length?(a(t),D(t,1)):d("releases",!0)})).catch((e=>{console.error("special offers release cars",e)})).finally(B)},k=()=>{B(!0),C().get(`${c.cA.url_habilitadora}/find-recommended-cars/?page=${i.recommended}`).then((e=>{const a=[...P(e.data.megaRecommendedCars,!0),...P(e.data.superRecommendedCars)];8===a.length?(t(a),D(a.slice(),0)):d("recommended",!0)})).catch((e=>{console.error("special offers recommended cars",e)})).finally(B)},R=[{name:"Recomendados",data:[],disabled:!1,publish:{position:0,id:(0,E.e0)(_.GP+"-recomendados-publicidad")},fn:k},{name:"Últimos lanzamientos",data:[],disabled:!1,publish:{position:0,id:(0,E.e0)(_.GP+"-nuevos_lanzamientos-publicidad")},fn:I}],[O,L]=(0,n.useState)(R),P=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.map((e=>({...e,megaRecommended:t})))};(0,n.useEffect)((()=>()=>{d("recommended"),d("releases")}),[]),(0,n.useEffect)((()=>{(v||g.recommended!==i.recommended)&&u.recommendedRetries<2&&(h((e=>({...e,recommendedRetries:e.recommendedRetries+1}))),y((e=>({...e,recommended:i.recommended}))),k()),g.releases!==i.releases&&u.releasesRetries<1&&(h((e=>({...e,releasesRetries:e.releasesRetries+1}))),y((e=>({...e,releases:i.releases1}))),I()),v&&f(!1)}),[i]);const D=(e,t)=>{const a=[...O];a[t].data=((e,t)=>{const a=R[t].publish,n={onlyImage:!0,id:a.id};return e.splice(a.position,0,n),e})(e,t),L((()=>a)),T(a[t].publish.id)},T=e=>{A({adUnits:[{divId:e}]})},B=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];L((t=>t.map((t=>({...t,disabled:e})))))};return l().createElement("div",{className:"specialOffers",id:"recommended_id"},l().createElement(o.A,null,l().createElement("h1",{className:"specialOffers__title"},"OFERTAS ESPECIALES"),l().createElement(z.A,{tabs:O,changetab:e=>{S(e),0===O[e].data.length?O[e].fn():setTimeout((()=>T(O[e].publish.id)),100)},statistics:_.GP+"-tab-"}),l().createElement(j.A,{id:(0,E.AU)(O[b].name,void 0),type:"cards",variableWidth:!0,slidesToShow:{browser:2,tablet:1,mobile:1},slidesToScroll:{browser:2,tablet:1,mobile:1}},O[b].data&&O[b].data.length>0&&(0,U.lp)(O[b].data).map(((e,t)=>e.onlyImage?l().createElement("div",{className:"specialOffers__publicitySpace",key:t},l().createElement("div",{id:e.id})):l().createElement(F.A,{key:t,vehicle:e,stadistics:_.GP+"-"+(0,E.AU)(O[b].name,void 0),transactionalLog:"/analytics/statistics_special_offers_"})))),l().createElement("div",{className:"link",onClick:()=>(w({type:"link",structure:{tealium_event:"link",event_name:"click",click:"home-bloque_ofertas_especiales-enlace_ver_todas"}}),void setTimeout((()=>{N.push(r.D.search.general)}),1))},l().createElement("h3",null,"Ver Todos"),l().createElement("div",{className:"icon icon-cy_icon_chevron_right"}))))}));const Z=(0,n.lazy)((()=>a.e(9817).then(a.bind(a,59817)))),W=(0,n.lazy)((()=>a.e(9686).then(a.bind(a,99686)))),G=(0,n.lazy)((()=>a.e(5001).then(a.bind(a,25001))));var V=()=>l().createElement("div",null,l().createElement(h.Helmet,null,l().createElement("script",{type:"application/ld+json"},JSON.stringify({"@context":"https://schema.org/ ","@type":"WebSite",name:"CarroYa.com Colombia",url:"https://www.carroya.com/ ",potentialAction:{"@type":"SearchAction",target:"https://www.carroya.com/vehiculos?page=1&wkeyword= {search_term_string}","query-input":"required name=search_term_string"}}))),l().createElement(g.o1,null,l().createElement(p.Fu,null,l().createElement(M,null),l().createElement(u,null),l().createElement(f,{idDivPromotionalZone:[{divId:"homeBlockPromoFirstImage"},{divId:"homeBlockPromoSecondImage"},{divId:"homeBlockPromoThirdImage"},{divId:"homeBlockPromoFourthImage"}]}),l().createElement(J,null),l().createElement(G,null),l().createElement(Z,null))),l().createElement(W,null))},68594:function(e,t,a){a.d(t,{o1:function(){return P},eQ:function(){return D}});var n=a(24002),l=a.n(n),i=a(87945),c=a(33506),o=a.n(c);const r={nameStorage:"clientId",idAnalitycs:"G-3N1T1RRSJS",userAgentBOT:"X_BOT",restName:"x-client-id"};var s=a.p+"static/media/loader.12534cc1.gif",m=a.p+"static/media/loader_3x.4de7a2cd.gif",d=a.p+"static/media/loader_2x.d66a0712.gif",u=JSON.parse('{"global":{"post":[{"relativePath":"feedback/save","container":{"path":".feedbackContainer .feedbackContent","position":0},"wholeScreen":false,"applyRelative":true}]},"/":{"get":[{"relativePath":"find-recommended-cars","container":{"path":"#recommended_id .containerCarousel","position":0},"wholeScreen":false,"applyRelative":true},{"relativePath":"find-latest-releases","container":{"path":"#recommended_id .containerCarousel","position":0},"wholeScreen":false,"applyRelative":true},{"relativePath":"find-news/the-new","container":{"path":".newsContainer .containerCarousel","position":0},"applyRelative":true},{"relativePath":"find-news/for-buyers","container":{"path":".newsContainer .containerCarousel","position":0},"applyRelative":true},{"relativePath":"find-news/for-drivers","container":{"path":".newsContainer .containerCarousel","position":0},"applyRelative":true},{"relativePath":"find-news/the-most-read","container":{"path":".newsContainer .containerCarousel","position":0},"applyRelative":true},{"relativePath":"find-vehicle-by-category-brand-wsearch","container":{"path":".searchContainer .primary","position":0},"wholeScreen":false}]},"/buscar":"/","/:param1?/:param2?/:param3?/:param4?/:param5?/:param6?/:param7?":{"post":[{"relativePath":"find-filters","container":{"path":"body","position":0},"wholeScreen":true,"hideInMobile":true}]},"/buscar/:param1?/:param2?/:param3?/:param4?/:param5?/:param6?/:param7?":"/:param1?/:param2?/:param3?/:param4?/:param5?/:param6?/:param7?","/vehiculos":"/:param1?/:param2?/:param3?/:param4?/:param5?/:param6?/:param7?","/simulaTuCredito":{"post":[{"relativePath":"save-credit-request","container":{"path":"#simulationResultBtn","position":0},"applyRelative":true,"wholeScreen":false,"hideInMobile":false}]},"/vehiculo/:status/:brand/:model/:modelRange/:location/:vehicleId":"/detalle/:status/:brand/:model/:modelRange/:location/:vehicleId","/detalle/:status/:brand/:model/:modelRange/:location/:vehicleId":{"post":[{"relativePath":"save-contact-form","container":{"path":".contactSellerContainer .contactContent","position":0},"applyRelative":false,"wholeScreen":false,"hideInMobile":false},{"relativePath":"save-complaint","container":{"path":".formReportContainer","position":0},"applyRelative":false,"wholeScreen":false,"hideInMobile":false}]}}'),h=a(16518),p=a(18036),v=a.n(p);let f;const{idAnalitycs:g,nameStorage:_,userAgentBOT:y}=r,E=(e,t)=>{const a=Math.ceil(e),n=Math.floor(t);return Math.floor(Math.random()*(n-a)+a)};var b=()=>[async()=>{const e=sessionStorage.getItem(_);if(e&&(f=e),!f)try{f=await new Promise((e=>{if(window.navigator.userAgent!==y){const t=window.setTimeout((()=>{const t=`999${E(1e6,9999999)}.${E(1e9,9999999999)}`;e(t)}),2e3);window.gtag("get",g,"client_id",(a=>{window.clearTimeout(t),e(a)}))}else e("")})),sessionStorage.setItem(_,f)}catch(e){console.debug("Error obteniendo el metodo clientIdGtag",e)}return f}],S=a(2284),C=a(34056);const w=(0,n.createContext)(void 0),{Provider:N,Consumer:A}=w;let I="";const k=u,R=()=>l().createElement("loader-component",{visible:!0,"url-image":I,"is-image":!0}),O=()=>l().createElement("loader-component",{visible:!0,"url-image":h.A,type:"fullScreen"});let L=!1;const P=e=>{let{children:t}=e;const a=(0,C.useRouteMatch)(),[c]=(0,S.A)(),[u]=b();I=!0===c.isRetina?"mobile"===c.device||"tablet"===c.device?d:m:"mobile"===c.device||"tablet"===c.device?s:"browser"===c.device?d:m;const h=(0,n.useCallback)((e=>{const t="string"==typeof k[a.path]?k[k[a.path]]:k[a.path];let n=null;if(t&&t[e.method]||k.global[e.method]){const a=k.global[e.method];n=(t&&t[e.method]?t[e.method]:[]).concat(a||[]).filter((t=>e.url.includes(t.relativePath)))}return n&&n.length?n[0]:null}),[a.path]),p=(0,n.useCallback)((e=>!0!==e.hideInMobile||"mobile"!==c.device),[c.device]),f=(0,n.useCallback)((e=>{const t=h(e.config);if(t){document.querySelectorAll(t.container.path).forEach((e=>{p(t)&&e.querySelector("#loading").remove()}))}}),[p,h]),g=(0,n.useCallback)((async()=>o().interceptors.request.use((async e=>{if(!e.url.includes(".json")){const t=await u();t&&(e.headers[r.restName]=t)}const t=i.A.getToken();t&&e.url.includes("/auth")&&(e.headers.Authorization=`Bearer ${t}`);const a=h(e);if(a){document.querySelectorAll(a.container.path).forEach((e=>{a.applyRelative&&(e.style.position="relative");const t=e.appendChild(document.createElement("div"));t.id="loading",p(a)&&v().render(a.wholeScreen?l().createElement(O,null):l().createElement(R,null),t)}))}return e}),(function(e){return Promise.reject(e)}))),[u,p,h]),_=(0,n.useCallback)((()=>o().interceptors.response.use((e=>(f(e),e)),(function(e){return f(e),Promise.reject(e)}))),[f]);return(0,n.useLayoutEffect)((()=>{L||(L=!0,g(),_())}),[_,g,p,f,h]),l().createElement(N,{value:void 0},t)};function D(e){return function(t){return l().createElement(P,null,l().createElement(e,t))}}}}]);