(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[119],{9119:function(e,t,o){Promise.resolve().then(o.bind(o,2778)),Promise.resolve().then(o.bind(o,1251))},1251:function(e,t,o){"use strict";o.r(t),o.d(t,{PravilaOsago:function(){return I}});var n=o(7437),i=o(2265),l=o(684),r=o(5563),s=o(5461),a=o(4365),c=o(4887);let d=e=>{let{children:t,id:o="portal-root"}=e,[l,r]=(0,i.useState)(null);return(0,i.useEffect)(()=>{var e,t,n;let i=null===(e=document)||void 0===e?void 0:e.getElementById(o);if(i)r(i);else{let e=null===(t=document)||void 0===t?void 0:t.createElement("div");return null===(n=document)||void 0===n||n.body.appendChild(e),r(e),()=>{var t;null===(t=document)||void 0===t||t.body.removeChild(e)}}},[]),(0,n.jsx)(n.Fragment,{children:l&&(0,c.createPortal)(t,l)})};var u=o(8582),p=o.n(u);let _=e=>{let{onClose:t,onToucheMove:o,isOpen:l,delay:r=300}=e,s=(0,i.useRef)(null),c=(0,i.useCallback)(()=>{t&&(s.current=setTimeout(()=>{t()},r))},[r,t]),d=(0,i.useCallback)(e=>{"Escape"===e.key&&c()},[c]);return(0,i.useEffect)(()=>(l&&window.addEventListener("keydown",d),()=>{s.current&&clearTimeout(s.current),window.removeEventListener("keydown",d)}),[l,d]),(0,n.jsx)("div",{className:(0,a.Z)(p().overlay,{[p().open]:l,[p().close]:!l}),onTouchStart:o,onClick:c})};var m=o(3582),v=o.n(m);let h=e=>{let{footer:t,isSmallPopup:o=!1,footerClassName:i}=e;return(0,n.jsx)("div",{className:(0,a.Z)(v().footer,o&&v().footerWithoutShadow,i),children:"function"==typeof t?t():t})},b=e=>{let t=(0,i.useRef)(null),o=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{if(o.current===e)return;o.current=e;let n=t.current,i=window.innerWidth-document.documentElement.clientWidth;e&&i&&!document.body.style.top&&(window.prevScrollPosition=window.scrollY||window.pageYOffset),e&&i&&(document.documentElement.style.setProperty("overflow-y","scroll"),document.body.classList.toggle("scroll-disable-windows",!0),document.body.style.setProperty("width","calc(100vw - ".concat(i,"px)")),document.body.style.setProperty("top","-".concat(window.prevScrollPosition,"px"))),e&&!i&&(document.body.style.setProperty("overflow","hidden"),document.body.style.setProperty("height","100vw")),e&&n&&n.setAttribute("data-portal","");let l=document.querySelectorAll("[data-portal]").length>1;return e||l||(document.body.classList.toggle("scroll-disable-windows",!1),document.body.style.removeProperty("overflow"),document.body.style.removeProperty("height"),document.body.style.removeProperty("width"),document.body.style.removeProperty("top")),e||l||void 0===window.prevScrollPosition||(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0),!e&&n&&n.removeAttribute("data-portal"),()=>{document.body.classList.toggle("scroll-disable-windows",!1),document.body.style.removeProperty("overflow"),document.body.style.removeProperty("height"),void 0!==window.prevScrollPosition&&(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0)}},[e]),t},w=e=>{let{opened:t}=e,[o,n]=(0,i.useState)(!1),l=(0,i.useRef)(null),r=(0,i.useRef)(!1);return(0,i.useEffect)(()=>(t&&!r.current?(r.current=!0,n(!0)):!t&&r.current&&(l.current=setTimeout(()=>{r.current=!1,n(!1)},300)),()=>{l.current&&clearTimeout(l.current)}),[t]),{mounted:o}};var f=o(6565),y=o.n(f);let x=e=>{let{children:t,footer:o,isOpen:l,isSmallPopup:r,onClose:s,hasCloseButton:c=!0,full:d,touchDistance:u=100,withDisabledScroll:p=!0,contentClassName:m,className:v,title:w,closeButton:f,footerClassName:x}=e,[P,g]=(0,i.useState)(!1),[j,T]=(0,i.useState)(!1),[C,N]=(0,i.useState)(!0),[S,O]=(0,i.useState)("120%"),k=(0,i.useRef)(null),E=(0,i.useRef)(0),M=(0,i.useRef)(!1),L=e=>{var t,o,n;let i=null===(t=k.current)||void 0===t?void 0:t.offsetTop,l=null===(o=k.current)||void 0===o?void 0:o.offsetHeight;if(M.current=!0,N(!1),i&&l){let t=(null==e?void 0:null===(n=e.touches[0])||void 0===n?void 0:n.clientY)-i,o=0;t>=0&&t<=l+30&&(o=t),t>l+30&&(o=l+30),O("".concat(o,"px")),E.current=o}},I=()=>{M.current&&(E.current>u&&s?null==s||s():O("0"),N(!0),M.current=!1),window.removeEventListener("touchmove",L),window.removeEventListener("touchend",I)};return(0,i.useEffect)(()=>{l&&setTimeout(()=>{g(!0),T(!0),O("0")},100),!l&&j&&(O("120%"),g(!1),T(!1))},[j,l]),b(l&&p),(0,n.jsxs)("div",{"data-portal":!0,className:(0,a.Z)(y().mobilePopup,j&&y().mobilePopupOpen,v),children:[(0,n.jsx)(_,{onClose:()=>{l&&(null==s||s())},onToucheMove:()=>{l&&(g(!1),window.addEventListener("touchmove",L),window.addEventListener("touchend",I))},isOpen:l,delay:0}),(0,n.jsxs)("div",{className:(0,a.Z)(y().content,d&&y().contentFull,C&&y().contentTransition,C&&P&&y().contentTransitionOpen),ref:k,style:{transform:"translateY(".concat(S,")")},children:[(0,n.jsx)("div",{className:y().contentLine}),(0,n.jsxs)("div",{className:(0,a.Z)(y().contentContainer,r&&y().smallContentContainer,{[y().min]:!w&&!c},m),children:[!!w&&(0,n.jsx)("div",{className:y().title,children:w}),c?(0,n.jsx)("div",{className:y().closeContainer,children:c?f?"function"==typeof f?f():f:(0,n.jsx)("button",{onClick:s,className:y().closeButton,children:(0,n.jsx)("img",{src:"https://assets.finuslugi.ru/mp-assets/images/sc/close_gray.svg",alt:"close",loading:"lazy"})}):null}):null,t]}),o&&(0,n.jsx)(h,{footerClassName:x,isSmallPopup:r,footer:o})]})]})},P=e=>{let{children:t,isSmallPopup:o=!1,isOpen:i=!1,...l}=e,{mounted:r}=w({opened:i});return r?(0,n.jsx)(x,{isSmallPopup:o,isOpen:i,...l,children:t}):null};P.displayName="UiMobilePopup";var g=o(9045),j=o.n(g);let T=e=>{let{tabs:t,activeTab:o,setActiveTab:i}=e;return(0,n.jsxs)("div",{className:j().tabs,children:[(0,n.jsx)("div",{className:j().tabsTitle,children:"Оглавление"}),t.map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>i(e.anchor),className:(0,a.Z)(j().tab,{[j().selected]:e.anchor===o}),children:(0,n.jsx)("div",{className:j().tabTitle,children:e.title})},e.anchor))]})};var C=o(1321),N=o.n(C);let S=e=>{let{openPopup:t}=e;return(0,n.jsxs)("div",{className:N().titleWrapper,onClick:t,children:[(0,n.jsx)("p",{className:N().title,children:"Навигатор"}),(0,n.jsx)(l.IconFdsChevronDownO,{className:N().iconMobile})]})};var O=o(7147),k=o.n(O);let E=e=>{let{tabs:t,activeTab:o,setActiveTab:l}=e,[r,s]=(0,i.useState)(!1),c=(0,i.useRef)(null),u=()=>s(!1),p=e=>{if(c.current=e,l(e),r)u();else{let t=document.getElementById(e);if(!t)return;let o=t.getBoundingClientRect().top+window.scrollY-104;window.scroll({top:o,behavior:"smooth"})}};return(0,i.useEffect)(()=>{if(!r&&c.current){let e=c.current;c.current=null;let t=document.getElementById(e);if(!t)return;let o=t.getBoundingClientRect().top+window.scrollY-104;window.scroll({top:o,behavior:"smooth"})}},[r]),(0,i.useEffect)(()=>{let e=()=>{if(c.current)return;let e=null,o=1/0;t.forEach(t=>{let n=document.getElementById(t.anchor);if(!n)return;let i=Math.abs(n.getBoundingClientRect().top-50);i<o&&(o=i,e=t)}),e&&l(e.anchor)};return window.addEventListener("scroll",e,{passive:!0}),e(),()=>window.removeEventListener("scroll",e)},[t,l]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("aside",{className:k().stickySidebar,children:(0,n.jsxs)("div",{className:k().container,children:[(0,n.jsx)(S,{}),(0,n.jsx)(T,{tabs:t,activeTab:o,setActiveTab:p})]})}),(0,n.jsxs)("div",{className:(0,a.Z)(k().container,k().mobile),children:[(0,n.jsx)(S,{openPopup:()=>s(!0)}),(0,n.jsx)(d,{children:(0,n.jsx)(P,{className:k().popup,contentClassName:k().popupContent,isOpen:r,onClose:u,title:"Навигатор",children:(0,n.jsx)(T,{tabs:t,activeTab:o,setActiveTab:p})})})]})]})};var M=o(4439),L=o.n(M);let I=e=>{let{title:t,dateFrom:o,description:a,file:c,contentBlocks:d}=e,u=[{href:"/",label:"Главная"},{href:"/kasko",label:"Правила страхования"},{label:t}],p=d.map(e=>{let{anchor:t,title:o,chapterTitle:i}=e;return{anchor:"#".concat(t),title:(0,n.jsxs)("p",{className:L().sidebarTab,children:[(0,n.jsx)("span",{className:L().sidebarChapterTitle,children:i})," ",o]})}}),[_,m]=(0,i.useState)(p[0].anchor);return(0,n.jsx)("div",{className:L().page,children:(0,n.jsxs)(r.W2,{children:[(0,n.jsx)(s.Oo,{ellipsis:!0,items:u,style:{padding:"16px 0"}}),(0,n.jsx)(r.X6,{type:"h1",className:L().title,children:t}),(0,n.jsxs)("div",{className:L().main,children:[(0,n.jsx)(E,{tabs:p,activeTab:_,setActiveTab:m}),(0,n.jsx)("div",{className:L().contentWrapper,children:(0,n.jsxs)("div",{className:L().content,children:[(0,n.jsxs)("div",{className:L().topInfo,children:[(0,n.jsx)("p",{className:L().chapterTitle,children:o}),(0,n.jsxs)(s.rU,{href:c.href,className:L().downloadLink,children:[(0,n.jsx)(l.IconFdsArrowBarToDownO,{size:20,className:L().downloadIcon}),"Скачать текст правил"]})]}),(0,n.jsx)("p",{className:L().description,children:a}),d.map(e=>{let{chapterTitle:t,anchor:o,title:i,content:l}=e;return(0,n.jsxs)("div",{id:"#".concat(o),className:L().chapter,children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:L().chapterTitle,children:t}),(0,n.jsx)(r.X6,{type:"h3",className:L().chapterName,children:i})]}),(0,n.jsx)("div",{className:L().htmlContent,dangerouslySetInnerHTML:{__html:l}})]},e.anchor)})]})})]})]})})}},8582:function(e){e.exports={overlay:"ClickOutside_overlay__YQi9L",open:"ClickOutside_open__bmtsz",fade:"ClickOutside_fade__io1xj",close:"ClickOutside_close__AC078","fade-out":"ClickOutside_fade-out__wJ_pJ"}},6565:function(e){e.exports={mobilePopup:"MobilePopup_mobilePopup__NCFCK",content:"MobilePopup_content__B5iF0",contentFull:"MobilePopup_contentFull__DBrvo",contentLine:"MobilePopup_contentLine__eykLy",contentContainer:"MobilePopup_contentContainer___ZbOq",min:"MobilePopup_min__D0Hml",contentTransition:"MobilePopup_contentTransition__7_kGL",contentTransitionOpen:"MobilePopup_contentTransitionOpen__GDGpr",title:"MobilePopup_title__IEYZk",closeContainer:"MobilePopup_closeContainer__HSRUL",closeButton:"MobilePopup_closeButton__Bse_M",smallContentContainer:"MobilePopup_smallContentContainer__8jHeS"}},3582:function(e){e.exports={footer:"MobileModalFooter_footer__5dRCK",footerWithoutShadow:"MobileModalFooter_footerWithoutShadow__zHKVO"}},7147:function(e){e.exports={stickySidebar:"Sidebar_stickySidebar__QwWK6",container:"Sidebar_container__ZTvMM",mobile:"Sidebar_mobile__XPUGZ",popup:"Sidebar_popup__hf388",popupContent:"Sidebar_popupContent__PKit3"}},9045:function(e){e.exports={tabs:"SidebarTabsList_tabs__i1aUQ",tabsTitle:"SidebarTabsList_tabsTitle__Qxj8T",tab:"SidebarTabsList_tab__eOJP5",tabTitle:"SidebarTabsList_tabTitle__pOtGy",selected:"SidebarTabsList_selected___S5i3"}},1321:function(e){e.exports={title:"SidebarTopTitle_title__ffNw_",titleWrapper:"SidebarTopTitle_titleWrapper__IROTJ",iconMobile:"SidebarTopTitle_iconMobile__IQkGf"}},4439:function(e){e.exports={title:"PravilaOsago_title__bfKES",page:"PravilaOsago_page__1jDx0",sidebarTab:"PravilaOsago_sidebarTab__XqNM_",sidebarChapterTitle:"PravilaOsago_sidebarChapterTitle__QXMoU",main:"PravilaOsago_main__FXhk2",contentWrapper:"PravilaOsago_contentWrapper__iml3e",content:"PravilaOsago_content__mmaAJ",topInfo:"PravilaOsago_topInfo__evmik",downloadLink:"PravilaOsago_downloadLink__xVD39",downloadIcon:"PravilaOsago_downloadIcon__zHmKO",description:"PravilaOsago_description__dduWD",chapter:"PravilaOsago_chapter__peDLj",chapterTitle:"PravilaOsago_chapterTitle___1C_y",chapterName:"PravilaOsago_chapterName__quUPQ",htmlContent:"PravilaOsago_htmlContent__I5pEU"}},631:function(e,t,o){"use strict";function n(){return typeof window>"u"}function i(e){n()||(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 l(){if(n()){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()}o.d(t,{AB:function(){return i},zK:function(){return l}})},2778:function(e,t,o){"use strict";o.d(t,{L:function(){return a},g:function(){return s}});var n=o(2265),i=o(631);let l=null,r=e=>{l=e},s=()=>l,a=e=>{let{env:t}=e,o=(0,n.useRef)(!1);return o.current||(r(t),o.current=!0),(0,n.useEffect)(()=>{"production"===t.NODE_ENV&&(0,i.zK)()},[t.NODE_ENV]),null}}}]);