(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4648],{99376:function(e,t,n){"use strict";var r=n(35475);n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}})},40257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(44227)},44227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function i(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var l=[],c=!1,u=-1;function d(){c&&r&&(c=!1,r.length?l=r.concat(l):u=-1,l.length&&p())}function p(){if(!c){var e=o(d);c=!0;for(var t=l.length;t;){for(r=l,l=[];++u<t;)r&&r[u].run();u=-1,t=l.length}r=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}a.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||c||o(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=m,a.addListener=m,a.once=m,a.off=m,a.removeListener=m,a.removeAllListeners=m,a.emit=m,a.prependListener=m,a.prependOnceListener=m,a.listeners=function(e){return[]},a.binding=function(e){throw Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw Error("process.chdir is not supported")},a.umask=function(){return 0}}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var i=n[e]={exports:{}},s=!0;try{t[e](i,i.exports,r),s=!1}finally{s&&delete n[e]}return i.exports}r.ab="//";var a=r(229);e.exports=a}()},30631:function(e,t,n){"use strict";function r(){return typeof window>"u"}function a(e){r()||(Array.isArray(window.dataLayer)?window.dataLayer.push(e):console.log("window.dataLayer does not exist"),Array.isArray(window._mtm)?window._mtm.push(e):console.log("window._mtm does not exist"))}function i(){if(r()){console.warn("Cant initialize tag manager on server side");return}"function"!=typeof window._init_gtm?console.warn("Cant init GTM, please check if GTM script exists"):window._init_gtm(),"function"!=typeof window._init_mtm?console.warn("Cant init MTM, please check if MTM script exists"):window._init_mtm()}n.d(t,{AB:function(){return a},zK:function(){return i}})},82778:function(e,t,n){"use strict";n.d(t,{L:function(){return l},g:function(){return o}});var r=n(2265),a=n(30631);let i=null,s=e=>{i=e},o=()=>i,l=e=>{let{env:t}=e,n=(0,r.useRef)(!1);return n.current||(s(t),n.current=!0),(0,r.useEffect)(()=>{"production"===t.NODE_ENV&&(0,a.zK)()},[t.NODE_ENV]),null}},20660:function(e,t,n){"use strict";let r;n.d(t,{MJ:function(){return G}});var a=n(57437),i=n(2265),s=n(35563),o=n(75461),l=n(54365),c=n(80684),u=n(52074);let d=(0,u.g)("check-all","sc"),p=Object.freeze({wrapper:`${d}__wrapper`,link:`${d}__link`,icon:`${d}__icon`,iconGray:`${d}__icon--gray`}),h=({children:e,className:t,linkClassName:n,iconGrayBackground:r,Link:i,event:s,href:u,dataLayerPush:d})=>{let h=i??o.rU;return(0,a.jsx)("div",{className:(0,l.Z)(p.wrapper,t),onClick:()=>{s&&d(s)},children:(0,a.jsxs)(h,{className:(0,l.Z)(p.link,n),href:u,children:[e,(0,a.jsx)("span",{className:(0,l.Z)(p.icon,{[p.iconGray]:r}),children:(0,a.jsx)(c.IconFdsArrowUpRightSmallO,{size:24})})]})})};var m=n(85241),_=n(31620),f=n(77337),g=((r=g||{}).light="light",r.gray="gray",r);let v=e=>"kasko"===e||"osago"===e,y=(0,u.g)("best-offers-banner","sc"),b=Object.freeze({bestOffersBaner:y,wrapper:`${y}__wrapper`,wideWrapper:`${y}__wrapper--wide`,whiteWrapper:`${y}__wrapper--white`,content:`${y}__content`,header:`${y}__header`,title:`${y}__title`,subtitle:`${y}__subtitle`,icon:`${y}__icon`,iconBlack:`${y}__icon--black`,iconWhite:`${y}__icon--white`,image:`${y}__image`}),x=({title:e,image:t,url:n,description:r,backgroundColor:i,textColor:o,wide:u,theme:d,handleBannerDataLayerPush:p,className:h})=>{let m=d===g.gray,_={"--bg-base":(null==i?void 0:i.base)??(m?"var(--color-white)":"var(--color-gray-400)"),"--bg-hover":(null==i?void 0:i.hover)??"var(--color-gray-500)"};return(0,a.jsxs)("div",{className:(0,l.Z)(b.wrapper,h,{[b.wideWrapper]:u}),style:_,onClick:()=>{p(),window.open(n,"_blank")},children:[(0,a.jsxs)("div",{className:b.content,children:[(0,a.jsxs)("div",{className:b.header,children:[(0,a.jsx)(s.xv,{weight:"medium",size:"24",className:b.title,style:{color:o},children:e}),(0,a.jsx)("div",{className:(0,l.Z)(b.icon,{[b.iconBlack]:m&&!(null!=o&&o.includes("color-white")),[b.iconWhite]:m&&!!(null!=o&&o.includes("color-white"))}),children:(0,a.jsx)(c.IconFdsArrowUpRightSmallO,{size:32})})]}),r&&(0,a.jsx)(s.xv,{size:"16",style:{color:o},children:r})]}),(null==t?void 0:t.url)&&(0,a.jsx)("picture",{className:b.image,children:(0,a.jsx)("img",{src:t.url,width:t.width??150,height:t.height??"auto",alt:`Баннер ${e}`,loading:"lazy"})})]})},w=(0,u.g)("offer-card","sc"),$=Object.freeze({offerCard:w,wrapper:`${w}__wrapper`,whiteWrapper:`${w}__wrapper--white`,bankInfo:`${w}__bankInfo`,units:`${w}__units`,unitsColumn:`${w}__units--column`,unit:`${w}__unit`,unitRow:`${w}__unit--row`,unitTitleWrapper:`${w}__unitTitleWrapper`,unitTitle:`${w}__unitTitle`,tooltipIcon:`${w}__tooltipIcon`,unitValue:`${w}__unitValue`,bottomBlock:`${w}__bottomBlock`,tags:`${w}__tags`,tag:`${w}__tag`,button:`${w}__button`,buttonRounded:`${w}__button--rounded`,buttonAdditional:`${w}__button--additional`}),j=e=>{let t=e.split("₽");return t.map((e,n)=>(0,a.jsxs)(i.Fragment,{children:[e,n<t.length-1&&(0,a.jsx)(s.xv,{fontFamily:"primary",weight:"regular",children:"₽"})]},`${e}-${n}`))},k=({title:e,value:t,tooltip:n,textColor:r,unitsAsColumn:i,isTitleUnit:u})=>(0,a.jsxs)("div",{className:(0,l.Z)($.unit,{[$.unitRow]:i}),children:[(0,a.jsxs)("div",{className:$.unitTitleWrapper,children:[(0,a.jsx)(s.xv,{size:"14",className:$.unitTitle,children:e}),n&&(0,a.jsx)(o.u,{text:n,children:(0,a.jsx)(c.IconFdsQuestionCircleO,{className:$.tooltipIcon})})]}),(0,a.jsx)(s.xv,{weight:"medium",size:u?"18":i?"16":"24",className:$.unitValue,style:{color:r},children:e.includes("Рейтинг")?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.IconFdsStarF,{size:16,style:{color:"var(--color-orange-400)"}}),t]}):j(t)})]}),N=({tags:e,isGrayTheme:t})=>{let n=t?"secondary":"primary";return(0,a.jsx)("div",{className:$.tags,children:e.sort((e,t)=>e.order-t.order).map(e=>(0,a.jsx)(o.Vp,{className:$.tag,label:e.label,variant:e.variant?e.variant:n,rounded:!0},e.label))})},C=({companyName:e,name:t,url:n,logo:r,units:i,tags:s,additionalButton:c,unitsAsColumn:u,dataLayerPush:d,eventCategory:p,productType:h,theme:m,buttonClassName:f,eventValueByUnitTitle:v})=>{let y=m===g.gray,b=n=>{let r={event:"data-event",eventCategory:p,eventAction:`click_button_${(0,_.t)(n)}_${h}`,eventLabel:(0,_.t)(`${e}_${t}`)};if(v){let e=i.find(e=>e.title.toLowerCase()===v.toLowerCase());e&&(r.eventValue=(0,_.t)(e.value))}d(r)};return(0,a.jsxs)("div",{className:(0,l.Z)($.wrapper,{[$.whiteWrapper]:y}),children:[(0,a.jsxs)("div",{className:$.bankInfo,children:[r&&(0,a.jsx)("img",{src:r,width:56,height:56,alt:`${e} logo`}),(0,a.jsx)(k,{title:t,value:e,isTitleUnit:!0})]}),(0,a.jsx)("div",{className:(0,l.Z)($.units,{[$.unitsColumn]:u}),children:i.map(e=>(0,a.jsx)(k,{title:e.title,value:e.value,tooltip:e.tooltip,textColor:e.textColor,unitsAsColumn:u},`${e.title}-${e.value}`))}),(0,a.jsxs)("div",{className:$.bottomBlock,children:[s&&(0,a.jsx)(N,{tags:s,isGrayTheme:y}),c&&c.text.trim().length>0&&(0,a.jsx)(o.zx,{as:"a",className:(0,l.Z)($.button,$.buttonRounded,$.buttonAdditional),size:"xs",label:c.text,href:null==c?void 0:c.url,variant:y?"secondary":"white",onClick:()=>b(c.text)}),(0,a.jsx)(o.zx,{as:"a",className:(0,l.Z)($.button,f),size:"xs",label:"Подробнее",href:n,onClick:()=>b("podrobnee_o_kartochke_iz")})]})]})},T=(0,u.g)("offers-list","sc"),L=Object.freeze({offersList:T,wrapper:`${T}__wrapper`,sliderWrapper:`${T}__sliderWrapper`,offerItem:`${T}__offerItem`,compact:`${T}__offerItem--compact`,bannerItem:`${T}__bannerItem`}),A=({offers:e,banner:t,dataLayerPush:n,eventCategory:r,productType:i,theme:s,singleProduct:c})=>{let u=e.length<=2;return(0,a.jsxs)(o.iR,{options:{slidesPerView:"auto",spaceBetween:0,autoplay:{delay:3e3,disableOnInteraction:!1}},breakpoints:{xl:{autoplay:!1}},className:L.sliderWrapper,pagination:!0,children:[e.slice(0,3).map(e=>(0,a.jsx)(o.wI,{className:(0,l.Z)(L.offerItem,{[L.compact]:c}),children:(0,a.jsx)(C,{...e,dataLayerPush:n,eventCategory:r,productType:i,theme:s})},e.id)),t&&(0,a.jsx)(o.wI,{className:L.bannerItem,children:(0,a.jsx)(x,{...t,handleBannerDataLayerPush:()=>{n({event:"data-event",eventCategory:r,eventAction:"click_bnr_banner_top_predlozheniy",eventLabel:i})},wide:u,theme:s})})]},i)},z=(0,u.g)("osago-tab","sc"),P=Object.freeze({osagoTab:z,wrapper:`${z}__wrapper`,card:`${z}__card`,whiteCard:`${z}__card--white`,image:`${z}__image`,content:`${z}__content`,inputWrapper:`${z}__inputWrapper`,select:`${z}__select`,input:`${z}__input`,buttonLinkWrapper:`${z}__buttonLinkWrapper`,button:`${z}__button`,banner:`${z}__banner`}),O={kasko:{title:"Рассчет Каско за минуту",description:"Выберите лучшие условия для оформления полиса",backgroundColor:{base:"#f1f5ff",hover:"#a3ceec"}},osago:{title:"ОСАГО с экономией до 78%",description:"Предварительная цена после ввода номера ТС",backgroundColor:{base:"#f1f5ff",hover:"#a3ceec"}}},I=[{label:"Мотоцикл",value:"moto"},{label:"Автомобиль",value:"auto"}],W=Object.fromEntries(I.map(e=>[e.value,e])),B={auto:{mask:"a 000 aa 00",placeholder:"A 000 AA 00"},moto:{mask:"0000 aa 00",placeholder:"0000 AA 00"}},Z="АВЕКМНОРСТУХ",E=RegExp(`[${Z}]`,"i"),R=RegExp(`[^0-9${Z}]`,"gi"),U=({type:e,baseUrl:t,s3Assets:n,banner:r,dataLayerPush:c,eventCategory:u,theme:d})=>{let p="osago"===e,h=(0,f.xn)(t,"osago"),m=(0,f.xn)(h,"step-car"),v=(0,f.xn)(t,"kasko"),y=(0,f.xn)(v,"vehicle"),b=p?m:y,[w,$]=(0,i.useState)(""),[j,k]=(0,i.useState)("auto"),{mask:N,placeholder:C}=B[j],T=d===g.gray,L=`?${new URLSearchParams({type:p?j:"auto",license:w})}`,A=(0,f.xn)(b,L),z=r??{...O[e],url:p?h:v,image:n?{url:(0,f.xn)(n,`widgets/BestOffers/${p?"icon_osago":"icons_car"}.png`),width:204,height:160}:void 0},Z=W[j].label,U=(t,n)=>{c({event:"data-event",eventCategory:u,eventAction:t,eventLabel:n??e})};return(0,a.jsxs)("div",{className:P.wrapper,children:[(0,a.jsxs)("div",{className:(0,l.Z)(P.card,{[P.whiteCard]:T}),children:[n&&(0,a.jsx)("picture",{children:(0,a.jsx)("img",{src:`${n}/widgets/BestOffers/auto_bg.png`,alt:"Автомобиль",loading:"lazy",className:P.image})}),(0,a.jsxs)("div",{className:P.content,children:[(0,a.jsxs)(s.X6,{as:"h3",type:"h3",children:["Онлайн калькулятор ",p?"ОСАГО":"Каско"]}),(0,a.jsxs)("div",{className:P.inputWrapper,children:[p&&(0,a.jsx)(o.Ph,{options:I,value:W[j],label:"Тип транспорта",variant:T?"primary":"secondary",className:P.select,onChange:e=>{$(""),k(e.value),U(`selector_item_${(0,_.t)(e.label)}`)}}),(0,a.jsx)(o.An,{label:"Госномер",variant:T?"primary":"secondary",maskOpts:{mask:N,definitions:{a:E}},maskPlaceholder:C,value:w,className:P.input,onChange:(e,t)=>{$(t.replace(R,"").toUpperCase())},onClick:()=>U(`message_field_${(0,_.t)(Z)}`),onBlur:()=>U(`on_message_field_${(0,_.t)(Z)}`)}),(0,a.jsxs)(s.xv,{children:["У меня"," ",(0,a.jsx)(o.rU,{href:b,onClick:()=>{U("click_link_net_nomera",b)},children:"нет номера"})]})]}),(0,a.jsx)(o.zx,{as:"a",href:A,size:"s",className:P.button,onClick:()=>{U(`click_button_rasschitat_${(0,_.t)(Z)}`,A)},children:"Рассчитать"})]})]}),(0,a.jsx)("div",{className:P.banner,children:(0,a.jsx)(x,{...z,theme:d,handleBannerDataLayerPush:()=>{U("click_bnr_banner_top_predlozheniy")}})})]})},S=(0,u.g)("best-offers","sc"),V=Object.freeze({bestOffers:S,graySection:`${S}--gray`,singleProduct:`${S}--singleProduct`,title:`${S}__title`,singleProductTitle:`${S}__title--singleProduct`,chips:`${S}__chips`,warning:`${S}__warning`,allOffersLink:`${S}__allOffersLink`}),F={вклады:"вкладам",облигации:"облигациям",кредиты:"кредитам",займы:"займам","Кредитные карты":"кредитным картам",каско:"каско",осаго:"ОСАГО","дебетовые карты":"дебетовым картам",ипотека:"ипотеке",автокредиты:"автокредитам"},G=({tabs:e,baseUrl:t,s3Assets:n,eventCategory:r="best-offers",dataLayerPush:c,singleProduct:u=!1,theme:d=g.light,className:p})=>{let _=d===g.gray,f=e.map(e=>({url:e.productType,title:e.name})),[y,b]=(0,i.useState)(f[0].url),x=e.find(e=>e.productType===y)??e[0],w=(0,o._m)("xl"),$=F[x.name.toLowerCase()],j=$?`по ${$}`:x.name,k=v(null==x?void 0:x.productType)&&t?(0,a.jsx)(U,{type:x.productType,banner:x.banner,baseUrl:t,s3Assets:n,dataLayerPush:c,eventCategory:r,theme:d}):null;return(0,a.jsx)("section",{className:(0,l.Z)(V.bestOffers,p,{[V.singleProduct]:u,[V.graySection]:_}),children:(0,a.jsxs)(s.W2,{children:[(0,a.jsxs)(s.X6,{as:"h2",type:u?"h2":"display",className:(0,l.Z)(V.title,!u&&(w?"mb-8":"mb-6"),u&&(0,l.Z)("mb-0",V.singleProductTitle)),children:["Лучшие предложения ",u?j:"сегодня"]}),!u&&(0,a.jsx)(m.N,{items:f,maxNumberOfLines:2,activeChipId:y,variant:_?"white":"gray",className:V.chips,onClick:t=>{b(t);let n=e.find(e=>e.productType===t);c({event:"data-event",eventCategory:r,eventAction:"click_chip_top_predlozheniy_vybor",eventLabel:null==n?void 0:n.productType})}}),(0,a.jsxs)("div",{children:[k??(0,a.jsx)(A,{offers:x.offers,banner:x.banner,dataLayerPush:c,eventCategory:r,productType:x.productType,theme:d,singleProduct:u}),x.hasWarning&&(0,a.jsx)(s.xv,{as:"p",size:"16",className:V.warning,children:x.warningCustomText??"Оценивайте свои финансовые возможности и риски. Изучите все условия кредита (займа)"})]}),x.checkAllUrl&&(0,a.jsx)(h,{href:x.checkAllUrl,event:{event:"data-event",eventCategory:r,eventAction:"link",eventLabel:`Показать все предложения ${x.productType}`},dataLayerPush:c,iconGrayBackground:!_,className:V.allOffersLink,linkClassName:x.checkAllLinkClassName,children:"Показать все предложения"})]})})}}}]);