
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f142cc48-3e4a-5e10-b917-a0a01bd8f597")}catch(e){}}();
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2616],{68327:function(e,t,n){Promise.resolve().then(n.bind(n,61010)),Promise.resolve().then(n.bind(n,21074))},21074:function(e,t,n){"use strict";n.d(t,{Bonus:function(){return W}});var s=n(57437),a=n(2265),o=n(93532),i=n(90523),r=n(64238),l=n(78787),c=n(8404),d=n(27569),u=n(75803);let _=async e=>{let{page:t,productTypeId:n,sort:s}=e;return(await (0,u.t)({url:"/api/v1/bonuses/active?page=".concat(t,"&rowsPerPage=6&isShownLk=true").concat(n?"&productTypeId=".concat(n):"").concat("&sortDirection=".concat(s||"DESC")),options:{isMpScApi:!0}})).data||{}},p=async function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"DESC";return(null===(e=(await (0,u.t)({url:"/api/v1/bonuses/grouped?limit=6&isShownLk=true&sortDirection=".concat(t),options:{isMpScApi:!0}})).data)||void 0===e?void 0:e.filter(e=>Array.isArray(e.data)&&e.data.length>0))||[]},g=async e=>(await (0,u.t)({url:"/api/v1/bonuses/promocodes?page=0&rowsPerPage=10",options:{isMpScApi:!0},config:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({promotionId:e,isShownLk:!0})}})).data||{promocodes:[]};var m=n(34780),h=n(87148),x=n(86372),f=n(71817),B=n.n(f);let b=e=>{let{data:t,onClick:n,loading:a,loadingBtn:o}=e,i=(0,x.p6)(t.endDate);return(0,s.jsxs)("div",{className:(0,d.Z)(B().wrapper,{[B().loading]:a}),onClick:n,"data-sentry-component":"BonusCard","data-sentry-source-file":"BonusCard.tsx",children:[(0,s.jsx)("div",{className:B().imageWrapper,children:t.image&&(0,s.jsx)("img",{src:t.image.src,srcSet:"".concat(t.image.src,", ").concat(t.image.x2," 2x"),alt:"bg"})}),(0,s.jsx)("div",{className:B().chips,children:t.endDate&&(0,s.jsx)("label",{children:"до ".concat(i)})}),(0,s.jsxs)("div",{className:B().text,children:[(0,s.jsx)("div",{className:B().title,children:t.title}),t.importantConditions&&(0,s.jsx)("div",{className:B().description,children:t.importantConditions})]}),(0,s.jsx)(r.zx,{className:B().button,label:"Подробнее",size:"s",pending:a||o,"data-sentry-element":"Button","data-sentry-source-file":"BonusCard.tsx"})]})};var j=n(63726),S={src:"/service-main/_next/static/media/percent.c854cbab.svg",height:141,width:109,blurWidth:0,blurHeight:0},v=n(61445),y=n(83442),C=n(67343),M=n(48313),N=n(54346),w=n.n(N);let D=e=>{let[t,n]=(0,a.useState)(!1),i=(0,h.G)("lg");(0,a.useEffect)(()=>{n(!1)},[e.isOpen]);let l=e.data;if(!l)return null;let c=(0,x.p6)(l.endDate),u=Array(i?11:10).fill("");return(0,s.jsxs)("div",{className:w().body,onKeyDown:t=>{"Enter"===t.key&&e.onClose()},"data-sentry-component":"BonusDetailModalContent","data-sentry-source-file":"BonusDetailModal.tsx",children:[(0,s.jsx)("div",{className:w().imageWrapper,children:l.image&&(0,s.jsx)("img",{src:l.image.src,srcSet:"".concat(l.image.src,", ").concat(l.image.x2," 2x"),alt:"bg"})}),(0,s.jsx)("div",{className:w().chips,children:l.endDate&&(0,s.jsx)("label",{children:"до ".concat(c)})}),(0,s.jsx)("div",{className:w().title,children:l.title}),(0,s.jsx)("div",{className:w().info,dangerouslySetInnerHTML:{__html:l.importantConditions||""}}),l.rulesUrl&&(0,s.jsxs)("a",{className:w().file,href:"".concat(e.assetsUrl,"/mp-assets/").concat(l.rulesUrl),children:[(0,s.jsx)(o.IconPdf,{}),"Подробности акции.PDF"]}),l.code&&(0,s.jsxs)("div",{className:(0,d.Z)(w().promocode,{[w().copied]:t}),children:[(0,s.jsx)("div",{className:w().leftShape}),(0,s.jsx)("div",{className:w().dots,children:u.map((e,t)=>(0,s.jsx)("div",{},t))}),(0,s.jsxs)("div",{className:w().rightShape,children:[(0,s.jsx)("div",{className:w().code,children:l.code}),(0,s.jsxs)("div",{className:w().codeButton,onClick:()=>(n(!0),navigator.clipboard.writeText(l.code||""),!1),children:[t?(0,s.jsx)(o.IconFdsCheckCircleO,{}):(0,s.jsx)(o.IconFdsCopyO,{}),t?"Скопировано":"Скопировать промокод"]})]}),(0,s.jsx)(j.default,{src:S,alt:"%"})]}),(0,s.jsx)("div",{className:w().buttonActions,children:(0,s.jsx)(r.zx,{as:"a",href:M.LK,size:"m",className:w().button,label:"Зарегистрироваться на Финуслугах","data-sentry-element":"Button","data-sentry-source-file":"BonusDetailModal.tsx"})})]})},I=e=>{let t=(0,c.S)(),n=(0,h.G)("lg");return(0,s.jsxs)(v.h,{"data-sentry-element":"Portal","data-sentry-component":"BonusDetailModal","data-sentry-source-file":"BonusDetailModal.tsx",children:[!n&&(0,s.jsx)(y.d,{rowTitle:!0,titleAlign:"center",contentClassName:w().content,isOpen:e.isOpen,onClose:e.onClose,width:"628px",children:(0,s.jsx)(D,{...e,assetsUrl:t.NEXT_PUBLIC_S3_ASSETS})}),n&&(0,s.jsx)(C.j,{className:(0,d.Z)(w().mobilePopup),contentClassName:w().content,isOpen:e.isOpen,onClose:e.onClose,children:(0,s.jsx)(D,{...e,assetsUrl:t.NEXT_PUBLIC_S3_ASSETS})})]})},E=["App","Bonus","Enshurence","Finuslugi","fruit_box","Girl_calculate","Identification","Money_save","Money_transfer_2","Money","Signature","Success"],P=e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)},A=e=>{let t=(0,c.S)(),n=E.map(e=>({src:"".concat(t.NEXT_PUBLIC_S3_ASSETS,"/mp-assets/images/bonus/").concat(e,".png"),x2:"".concat(t.NEXT_PUBLIC_S3_ASSETS,"/mp-assets/images/bonus/").concat(e,"2.png")})),s=[],a=[];for(let t of e){s.length||s.push(...n);let e=P(t.title)%s.length,o=s[e];a.push({...t,image:o}),s.splice(e,1)}return a};var L=n(42840),T=n.n(L);let U="Акции и спецпредложения",k=e=>{let{isIncreaseSort:t,setIsIncreaseSort:n}=e;return(0,s.jsxs)("button",{type:"button",className:(0,d.Z)(T().sortButton),onClick:()=>n(!t),"data-sentry-component":"SortButton","data-sentry-source-file":"Bonus.tsx",children:[t?(0,s.jsx)(o.IconFdsSortDescendingO,{size:22}):(0,s.jsx)(o.IconFdsSortAscendingO,{size:22}),(0,s.jsx)("span",{children:"По дате"})]})},W=e=>{let{tagsData:t}=e,n=(0,h.G)("lg"),o=(0,c.S)(),[u,x]=(0,a.useState)(null),[f,B]=(0,a.useState)(t),[j,S]=(0,a.useState)([]),[v,y]=(0,a.useState)(!1),C=f.findIndex(e=>{let{id:t}=e;return t===u})||0,M=C>-1?C:0,N=j.length&&v?j:f,w=j.length&&v?S:B,D=N[M],E=(null==D?void 0:D.data)||[],[P,L]=(0,a.useState)(null),[W,O]=(0,a.useState)(!1),[z,F]=(0,a.useState)(!1),[R,K]=(0,a.useState)(null),G=A(E),Z=e=>()=>{K(e.id),g(e.id).then(t=>{var n;let{promocodes:s}=t,a=new Date,o=s.filter(e=>{let{appliesFrom:t,appliesTo:n}=e;return new Date(t)<=a&&a<=new Date(n)});L({...e,code:(null===(n=o[0])||void 0===n?void 0:n.code)||""})}).finally(()=>K(null))},H=e=>{j.length||(F(!0),p("ASC").then(e=>{S((null==e?void 0:e.map(e=>({...e,hasMore:e.data.length>=6,page:0})))||[]),F(!1)})),y(e)};return(0,s.jsxs)("main",{className:T().page,"data-sentry-component":"Bonus","data-sentry-source-file":"Bonus.tsx",children:[(0,s.jsxs)(i.W2,{"data-sentry-element":"Container","data-sentry-source-file":"Bonus.tsx",children:[(0,s.jsx)(r.Oo,{style:{padding:"16px 0"},items:[{href:"/",label:"Главная"},{label:U}],"data-sentry-element":"Breadcrumbs","data-sentry-source-file":"Bonus.tsx"}),(0,s.jsx)("h1",{className:T().title,children:U}),G.length>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:T().filters,children:[(0,s.jsxs)(i.W2,{className:T().chips,children:[n&&(0,s.jsx)(k,{isIncreaseSort:v,setIsIncreaseSort:H}),f.map((e,t)=>{let{id:n,name:a}=e;return(0,s.jsx)("div",{className:(0,d.Z)({[T().selected]:t===M}),onClick:()=>x(n||null),children:a},n||a)})]}),!n&&(0,s.jsx)(k,{isIncreaseSort:v,setIsIncreaseSort:H})]}),(0,s.jsx)("div",{className:T().grid,children:G.map((e,t)=>(0,s.jsx)(b,{data:e,onClick:Z(e),loading:z,loadingBtn:e.id===R},t))}),(null==D?void 0:D.hasMore)&&(0,s.jsx)("div",{className:T().pagination,children:(0,s.jsx)(r.zx,{label:"Показать еще",variant:"secondary",onClick:()=>{O(!0),_({page:D.page+1,productTypeId:u,sort:v?"ASC":"DESC"}).then(e=>{let t=e.promotions||[],n=e.pagination||{};w(e=>{let s=[...e],a={...D,data:[...D.data,...t],hasMore:D.page+2<(n.totalPages||0),page:D.page+1};return s[M]=a,s}),O(!1)})},pending:W})})]}):(0,s.jsx)(l.ErrorPageWidget,{title:"Сейчас нет активных акций — но вы не потеряете выгоду",subtitle:"Переходите к лучшим предложениям на маркетплейсе",buttonText:"Перейти",className:T().emptyListWidget}),(0,s.jsx)(m.j,{className:T().fullInfoLink,mainPageUrl:o.NEXT_PUBLIC_BASE_URL,href:"https://finuslugi.ru/disclosure?anchor=documents",target:"_self",text:"Завершенные акции","data-sentry-element":"CheckFullInfoLink","data-sentry-source-file":"Bonus.tsx"})]}),(0,s.jsx)(I,{data:P,isOpen:!!P,onClose:()=>L(null),"data-sentry-element":"BonusDetailModal","data-sentry-source-file":"Bonus.tsx"})]})}},63726:function(e,t,n){"use strict";n.d(t,{default:function(){return a.a}});var s=n(20717),a=n.n(s)},20717:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return l},getImageProps:function(){return r}});let s=n(43150),a=n(10249),o=n(92267),i=s._(n(46208));function r(e){let{props:t}=(0,a.getImgProps)(e,{defaultLoader:i.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let l=o.Image},75803:function(e,t,n){"use strict";n.d(t,{t:function(){return i}});var s=n(8404),a=n(64666);let o=(e,t)=>{let{isBFF:n,isMpScApi:s,isPageContent:a,isMpScRedirects:o}=t;return s?"".concat(e.NEXT_PUBLIC_BASE_URL,"/sc"):e.NEXT_PUBLIC_BASE_URL},i=async e=>{let{url:t,options:n={},config:i}=e,r=(0,s.S)(),l=o(r,n),c=((null==i?void 0:i.method)||"GET").toUpperCase();try{let e=performance.now(),n=await (0,a.Wg)(t,{baseURL:l,method:c,headers:{...null==i?void 0:i.headers},...i,next:{revalidate:Number(r.REVALIDATE_REQUEST_VALUE)||300}}),s=performance.now()-e;return console.warn("Запрос ".concat(l).concat(t," занял ").concat(s.toFixed(2)," ms")),{data:n,error:null}}catch(e){return console.error("Ошибка запроса","".concat(e,": ").concat(l).concat(t)),{data:null,error:e||"Unknown error"}}}},48313:function(e,t,n){"use strict";n.d(t,{C_:function(){return a},LK:function(){return s}});let s="https://lk.finuslugi.ru/registration/",a="https://assets.finuslugi.ru/mp-assets/docs/main-documents/regulation_review_procedure/regulation_review_procedure.pdf"},86372:function(e,t,n){"use strict";n.d(t,{p6:function(){return o}}),n(90523);var s=n(56447),a=n(37122);function o(e,t){let{format:n="dd.MM.yyyy"}=null!=t?t:{};try{let t="string"==typeof e?new Date(e):e;return(0,s.WU)(t,n,{locale:a.ru})}catch(t){return"string"==typeof e?e:e.toString()}}},42840:function(e){e.exports={title:"Bonus_title__burQb",page:"Bonus_page__mIpwn",filters:"Bonus_filters__dsGlw",chips:"Bonus_chips__47fDo",sortChip:"Bonus_sortChip__wHIwv",selected:"Bonus_selected__VqAVC",sort:"Bonus_sort__qfnJa",grid:"Bonus_grid__6hvY2",pagination:"Bonus_pagination__OZ1_9",emptyListWidget:"Bonus_emptyListWidget__4azBT",sortButton:"Bonus_sortButton__jmAcg",fullInfoLink:"Bonus_fullInfoLink___rFln"}},71817:function(e){e.exports={wrapper:"BonusCard_wrapper__maKLU",loading:"BonusCard_loading__jTpML",imageWrapper:"BonusCard_imageWrapper__5ASsX",text:"BonusCard_text__9G6R2",chips:"BonusCard_chips__KASKR",bgImg:"BonusCard_bgImg__FP__a",bgImgM:"BonusCard_bgImgM___cDSd",img:"BonusCard_img__gmTQV",imgM:"BonusCard_imgM__8nK9b",gradient:"BonusCard_gradient__yuPMG",title:"BonusCard_title__Hc0Uh",description:"BonusCard_description__0lWCI",button:"BonusCard_button__ndixu"}},54346:function(e){e.exports={content:"BonusDetailModal_content__ZK4uH",buttonActions:"BonusDetailModal_buttonActions__Uqy9m",button:"BonusDetailModal_button__dQ7ho",mobilePopup:"BonusDetailModal_mobilePopup__RMlmv",body:"BonusDetailModal_body__2Dx_j",imageWrapper:"BonusDetailModal_imageWrapper__z2Nv_",bgImg:"BonusDetailModal_bgImg__YBbTU",bgImgM:"BonusDetailModal_bgImgM__CEAmL",img:"BonusDetailModal_img__xqlRm",imgM:"BonusDetailModal_imgM__P7j9e",gradient:"BonusDetailModal_gradient__daMJE",chips:"BonusDetailModal_chips__K0LKN",title:"BonusDetailModal_title__W0pYn",info:"BonusDetailModal_info__AaeMF",file:"BonusDetailModal_file__bgsKu",promocode:"BonusDetailModal_promocode__vGFCJ",leftShape:"BonusDetailModal_leftShape__rJkgZ",dots:"BonusDetailModal_dots__0RRq8",rightShape:"BonusDetailModal_rightShape__ZEWcA",code:"BonusDetailModal_code__4u0IF",codeButton:"BonusDetailModal_codeButton__7CeEk",copied:"BonusDetailModal_copied__iyOtr"}},78787:function(e,t,n){"use strict";n.d(t,{ErrorPageWidget:function(){return c}});var s=n(57437),a=n(90523),o=n(64238),i=n(27569);let r=(0,n(46714).g)("error-page-widget","sc"),l=Object.freeze({errorPageWidget:"".concat(r),wrapper:"".concat(r,"__wrapper"),main:"".concat(r,"__main"),picture:"".concat(r,"__picture"),img:"".concat(r,"__img"),text:"".concat(r,"__text"),button:"".concat(r,"__button"),buttonMobile:"".concat(r,"__button-mobile")}),c=e=>{let{variant:t="404",showcaseUrl:n="https://finuslugi.ru",minioUrl:r="https://assets.finuslugi.ru/mp-assets",className:c,isHomePage:d,title:u,subtitle:_,buttonText:p}=e,g="404"===t,m=d?"Обновить":"На Главную",h=()=>{d?window.location.reload():window.open("".concat(n,"/"),"_self")};return(0,s.jsx)("div",{className:(0,i.Z)(l.errorPageWidget,c),children:(0,s.jsx)(a.W2,{children:(0,s.jsxs)("div",{className:l.wrapper,children:[(0,s.jsxs)("div",{className:l.main,children:[(0,s.jsxs)("div",{className:l.text,children:[(0,s.jsx)("h1",{dangerouslySetInnerHTML:{__html:null!=u?u:g?"Страница не найдена":"Сервис временно<br>недоступен"}}),(0,s.jsx)("p",{dangerouslySetInnerHTML:{__html:null!=_?_:g?"Похоже, ссылка устарела или содержит ошибку":"Мы уже исправляем проблему  – попробуйте зайти через несколько минут или обновить страницу "}})]}),(0,s.jsx)(o.zx,{className:l.button,label:null!=p?p:m,onClick:h,size:"s"})]}),(0,s.jsxs)("picture",{className:l.picture,children:[(0,s.jsx)("source",{srcSet:"".concat(r,"/widgets/ErrorPageWidget/cat_error_d.png"),media:"(min-width: 1024px)",width:696,height:452}),(0,s.jsx)("source",{srcSet:"".concat(r,"/widgets/ErrorPageWidget/cat_error_m.png"),media:"(max-width: 1023px)",width:311,height:200}),(0,s.jsx)("img",{src:"".concat(r,"/widgets/ErrorPageWidget/cat_error_m.png"),alt:"Что-то не работает",className:l.img,loading:"eager"})]}),(0,s.jsx)(o.zx,{className:l.buttonMobile,label:null!=p?p:m,onClick:h,size:"s"})]})})})}}},function(e){e.O(0,[218,3544,5501,207,4942,9864,6235,9138,6406,991,2971,3873,1744],function(){return e(e.s=68327)}),_N_E=e.O()}]);
//# debugId=f142cc48-3e4a-5e10-b917-a0a01bd8f597
