@redneckz/wildless-cms-uni-blocks 0.14.528 → 0.14.529

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";let t;const l=e=>(...l)=>t[e](...l),n=l("useState"),a=l("useEffect"),i=l("useCallback"),r=l("useMemo"),s=l("useRef");const o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,l){const{children:n,...a}=t||{},i=l?.slots?.default,r=n||i&&i();return e(Object.assign(a,r&&{children:r}),l)}return t.inheritAttrs=!1,t},h=e=>e,u=(...e)=>e.map((e=>g(e)?p(e):e)).flatMap((e=>e)).filter(Boolean).join(" "),p=e=>Object.entries(e).filter(((e=h)=>([,t])=>e(t))()).map(((e=h)=>([t])=>e(t))()),g=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),x={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},f=d((({className:e,version:t="primary",isTheme:l=!0,defaultPadding:n="p-xl",padding:a,block:i,tag:r="section",role:s,children:c,style:d})=>{const m=t&&l;return o(r,{className:u("@container font-sans",m?"group":"",x[t],a||n,e),...m?{"data-ver":t}:{},...i?.anchor?{id:i.anchor}:{},role:s,style:d,children:c})})),b=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:y(t)}))),y=(e=3)=>N(100,e).map((e=>Math.floor(e))).map(v),v=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),N=(e,t)=>[e].concat(t>0?N(e/1.618,t-1):[]),w={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},k=d((({className:e="",headingType:t="h3",as:l="h3",title:n,children:a})=>o(l,{role:"heading",className:u("font-sans m-0",w[t],e),children:n||a}))),S=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),C={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},T=d((({className:e,version:t="",headlineVersion:l="XL",title:n,description:a,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=C[l],p={marginTop:h.descriptionStyle};return c(f,{className:u(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[n?o(k,{className:u("whitespace-pre-wrap",i),...h?.title,as:r||h?.title.as,title:n}):null,a?o(S,{size:h.descriptionSize,font:h.descriptionWeight,align:i,...p,children:a}):null]})})),I=({blockClassName:e,block:t,render:l})=>l({blockClassName:e,block:t}),B=[];function P(e,t,{className:l,...n}={}){const{key:a,blockDecorator:i=I,blocksRegistry:r={},ancestors:s=B}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return i({blockClassName:u(e.style?.length?e.style:"col-span-12",l),block:e,ancestors:s,render:({block:l,blockClassName:i})=>{const{content:r}=l;return d?o(d,{className:i,block:e,options:t,...r,...n},a):null}},a)}const M=[],R=(e,{key:t,ancestors:l=M,slotName:n=null,extraProps:a,renderProps:i=P,...r})=>{const s=a?(e,t)=>P(e,t,a):i;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...l||M,[r.parent,n]]:l},a)))};function V({block:e,options:t,children:l,extraProps:n,renderProps:a}){return l||(e&&t?R(e.blocks,{...t,parent:e,extraProps:n,renderProps:a}):null)}function z(){return z._impl()}z._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),z.setup=e=>{z._impl=e};const D=["CDN","BASE_PATH"],_=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const l=e._[t]||e[t];return D.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(l):l}}),A=e=>Boolean(e?.includes(":")),$=(e,t)=>Boolean(e&&!A(e)&&(!t||"_self"===t)),j=e=>Boolean(e?.startsWith("#")),L=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),O=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),E=(e,t)=>Boolean(t&&e&&e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var F=Object.freeze({__proto__:null,isURL:A,isLocalURL:$,isHash:j,withoutQuery:L,joinPath:O,hasPrefix:E});const U="/api/",W=`${U}v1/storage`,H=e=>(t,l)=>{if([!t,A(t),j(t),[_.CDN,U].some((e=>E(t,e)))].some(Boolean))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${W}/${t}/attachment`;const n=t?.startsWith("/");return O(E(t,l)?"":l,n?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},K={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},q=d((({className:e="",imageClassName:t="",name:l="",alt:n=`Иконка ${l}`,title:a=n,iconVersion:i="color",width:r,height:s})=>{const d=z(),m="normal"===i?`${l}.svg`:`sprites.svg#${l}`,h=H(d)(O(_.CDN,"/icons/",m));return"normal"===i?o("img",{className:e,src:h,alt:n,title:a,"aria-hidden":"true",width:r,height:s,style:X(e,s)}):o(G,{className:e,children:c("svg",{className:u(Y(r),K[i],"white"===i?"invert":"",t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,n?o("desc",{children:n}):null,o("use",{href:h,xlinkHref:h})]})})})),X=(e,t)=>{return e?.includes("h-")?{}:{height:(l=t,l&&!/\D/.test(l)?`${t}px`:t),width:"auto"};var l},Y=e=>e?"":"w-full h-full",G=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),Q=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function J(e=""){try{const[,...t]=new URL(e).pathname.split("/");return`/${t.filter(Boolean).join("/")}`}catch(e){return""}}const Z=e=>t=>{const l=t?.startsWith("/wcms-resources")?"":J(Q.SITE_URL);return t&&!A(t)?H(e)(t,l):t},ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:l=""})=>{const n=z();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:l,media:a},i)=>o("source",{srcSet:Z(n)(e),type:ne(l),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${i}_${e}`))):null,t?.src?le({...t,src:Z(n)(t.src)},l):null]})})),le=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),ne=e=>e?`image/${String(e)}`:void 0,ae=d((({className:e="",image:t,imageClassName:l="",...n})=>t?.src||t?.icon?t.icon?o(q,{className:e,imageClassName:l,iconVersion:t?.iconVersion,name:t.icon,...n}):o(te,{className:e,imageClassName:l,image:t}):null)),ie={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},re="bg-main-divider text-main-disabled",se={primary:re,secondary:re,white:re,link:"",transparent:"",gray:re,"":""},oe="text-center font-sans select-none",ce={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},de=({className:e,rounded:t,version:l})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",l?ie[l]:"",t?"rounded-full":"rounded-md",e].join(" ");const me=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const l=this.subjectsStateMap[e];return l&&t(l),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}},he=()=>({open:(e,t={})=>me.fire("dialog",{type:"open",dialog:e,...t}),close:()=>me.fire("dialog",{type:"close"}),closeAll:()=>me.fire("dialog",{type:"close",all:!0})}),ue=e=>ue._impl(e);function pe(){const e=J(Q.SITE_URL),t=z(),{closeAll:l}=he();return e=>{const l=H(t)(e.href);return{...e,href:l,"aria-label":e.text,onClick:ue(n({...e,href:l}))}};function n({href:n,target:a,onClick:i}){return r=>{i&&i(r);const s=!E(n,e||"/");n&&!s&&$(n,a)&&(l(),r?.preventDefault(),t.push(((e,t="")=>e.replace(t,"")||"/")(n,e)))}}}ue._impl=e=>e,ue.setup=e=>{ue._impl=e};const ge=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},xe=d((e=>{const{text:t,aboveText:l,appendLeft:n,appendRight:a,version:i="primary"}=e,r=be(e)?"hidden lg:block":"";return c("div",{className:u(fe(e),"flex gap-xs"),children:[n?o("div",{className:u(r,ce[i]),children:n}):null,be(e)?c("div",{className:"whitespace-pre",children:[l?o("div",{className:"text-xs font-light text-left",children:l}):null,o("div",{className:"text-left "+(l?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:u(r,ce[i]),children:a}):null]})})),fe=e=>{const{version:t,aboveText:l,rounded:n}=e;if("link"===t)return"";const a=""+(l?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",be(e)?a:"h-12 w-12 m-auto",n?"rounded-full":"")},be=({text:e,aboveText:t,appendLeft:l})=>Boolean(e||t||!l),ye=({className:e,rounded:t,version:l})=>["inline-block",oe,l?se[l]:"",t?"rounded-full":"rounded-md",e].join(" "),ve=d((({disabled:e,children:t,method:l="LINK",href:n,...a})=>{const r=(({method:e,href:t})=>i((l=>{if("POST"!==e||!t)return;l.preventDefault(),l.stopPropagation();const{origin:n,pathname:a,searchParams:i}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[n,a].join(""));for(const[e,t]of i.entries()){const l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name",e),l.setAttribute("value",t),r.appendChild(l)}document.body.appendChild(r),r.submit()}),[]))({method:l,href:n}),s=pe()({onClick:r,href:n,...a}),c=t??o(xe,{...s});return o(e?we:Ne,{...s,children:c})})),Ne=d((({className:e="",href:t,rel:l,target:n,ariaLabel:a,version:i,rounded:r,onClick:s,type:c,data:d,children:m})=>o("a",{className:de({className:e,version:i,rounded:r}),href:t,rel:l,target:n,"aria-label":a,role:t?"link":"button",onClick:s,type:c,...ge(d),children:m}))),we=d((({className:e,ariaLabel:t,version:l,rounded:n,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ye({className:e,rounded:n,version:l}),children:a})));function ke({version:e,handleClick:t,text:l="Вернуться назад",alwaysVisible:n=!1}){if(!l)return null;const a="primary"===e?"white":"black",i="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(n?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),i),onClick:t,children:o(ae,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:a}})}),o(ve,{version:"link",className:"group-data-secondary:text-white",text:l,ariaLabel:l,onClick:t,type:"button"})]})}const Se={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ce=d((({className:e,version:t="primary",defaultPadding:l,padding:n="",title:a,insetTitle:r,buttons:s,leftImage:o,rightImage:d,imageAlign:m,isImageAlwaysOnRight:h=!1,isImageSecondary:p=!1,backwardButton:g,children:x,...f})=>{const b=z(),y=i((()=>{b.back()}),[]),v=f.options?.page?.common?.backwardButton;return c("div",{className:Ie(n,l,e),children:[g?ke({version:t,handleClick:y,text:v}):null,Te(a),c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",o?"self-start @xl:w-auto":""),children:[Ve(o,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl",d?"@xl:grid-cols-2 auto-cols-fr":"",o?"":"grow","h-full","auto-rows-[max-content_1fr]","items-center md:items-stretch"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[r,x]}),Re(V({...f,extraProps:{className:"@container-normal"}})),Ve(d,{className:u("@xl:justify-self-end @xl:col-start-2",s?Be(h):"",Pe(h),ze(p)),imageAlign:m}),Me(s)]})]})]})})),Te=e=>e?o("div",{className:"relative h-full",children:e}):null,Ie=(e="",t="",l="")=>u("relative flex flex-col gap-3xl overflow-hidden",e||t,l),Be=e=>e?"row-span-2":"@xl:row-span-2",Pe=e=>e?"col-start-2 self-center":"",Me=e=>e?o("div",{className:"self-end",children:e}):null,Re=e=>e&&e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Ve=(e,{className:t,imageAlign:l})=>e?o("div",{className:u("shrink-1/2 justify-self-center",l&&Se[l],t),children:e}):null,ze=e=>e?"hidden @xl:block":"",De=(e=[])=>e.reduce(((e,t)=>e+t),0),_e=(e=[])=>e?.length?De(e)/e.length:0,Ae=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ae,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,$e=d((e=>{const{__html:t="",richVersion:l="",itemSize:n="list-m",isDotted:a=!0}=e,i=a?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(l,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",i),dangerouslySetInnerHTML:{__html:t}})}):null})),je=(e,t)=>e?o(S,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Le=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Oe=(e,t)=>e?o(Le,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ee=(e,t)=>["label"in e?Oe(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:je(e.description,t)},String(t)):null,"__html"in e?o($e,{...e},`rte-${t}`):null],Fe=d((({className:e,benefitsVersion:t,...l})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in l?Ae(l.icon,t):null,o("div",{children:Ee(l)})]}))),Ue=e=>Math.max(e?.label?.length||0,e?.description?.length||0,e?.__html?.length||0),We=e=>{return((t=e.map(Ue))?.length?Math.sqrt(Math.abs(_e(t.map((e=>e**2)))-_e(t)**2)):0)>16;var t},He=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),Ke=e=>!e.some(He),qe=d((({className:e,benefitsVersion:t="normal",benefits:l})=>l?.length?o("div",{className:u("flex gap-x-m gap-y-s",We(l)||Ke(l)?"flex-col":"flex-wrap",e),role:"list",children:l.map(((e,l)=>o(Fe,{benefitsVersion:t,...e},String(l))))}):null)),Xe=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Ee)}):null)),Ye=d((({isTabularBenefits:e,...t})=>o(e?Xe:qe,{...t}))),Ge=e=>Boolean(e?.src||e?.icon),Qe=(e,{className:t,buttonClassName:l,isVertical:n}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",n?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m",t),role:"group",children:e.map(Je(l))}):null,Je=(e="")=>(t,l)=>{const{text:n,icon:a,iconRight:i,version:r,...s}=t||{},c=Ze(a,r),d=Ze(i,r);return n||a?.icon?o(ve,{className:u("basis-full @lg:basis-auto",e),appendLeft:et({...a,iconVersion:c}),appendRight:et({...i,iconVersion:d}),version:r,text:n,...s},l?String(l):""):null},Ze=(e,t="secondary")=>{const l="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:l},et=e=>Ge(e)?o(ae,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,tt=(e=0,{fixed:t}={})=>(l=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(l)||0),lt=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(nt)}):null)),nt=({label:e,amount:t,unit:l},n)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Le,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[tt(2)(t)," ",l||"₽"]}):null]},String(n)),at=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(it)}):null)),it=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Le,{size:"text-m",font:"font-light",children:e})},String(t)),rt={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},st=d((({className:e,padding:t,defaultPadding:l,title:n,description:a,headlineVersion:i="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:h,__html:u,isFullWidthTitle:p,priceList:g=[],tags:x=[],buttons:f,image:b,imageOptions:{imageAlign:y="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1}={},backwardButton:k,children:S,...C})=>{const I=b?.src?o(ae,{image:b}):null,B=o(T,{title:n,description:a,headlineVersion:i,align:r,isEmbedded:!0}),P=h?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Ce,{className:e,padding:t,defaultPadding:l,...p?{title:B}:{insetTitle:B},...ot(I,v),isImageSecondary:w,imageAlign:y,isImageAlwaysOnRight:N,buttons:Qe(f),backwardButton:k,...C,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Ye,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,u?o($e,{__html:u,isDotted:m,itemSize:rt[i]}):null,S,g?.length?o(lt,{priceList:g}):null,ct(x)]})})})),ot=(e,t)=>t?{rightImage:e}:{leftImage:e},ct=e=>e?.length?o(at,{tags:e}):null,dt=e=>Boolean(e&&Array.isArray(e)),mt=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),ht=(e,t)=>{return l=e,Boolean(mt(l)&&"string"==typeof l.$ref)?t.ref(e):mt(e)?t.record(e):dt(e)?t.array(e):t.scalar?t.scalar(e):e;var l},ut=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(pt,e),pt=(e,t)=>e&&t?mt(e)?e[t]:dt(e)?e[parseInt(t,10)]:e:e,gt=(e,t)=>ht(e,{ref:({$ref:e,...l})=>gt(e?ut(t(e),e):l,t),record:e=>Object.entries(e).map((([e,l])=>({[e]:gt(l,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>gt(e,t)))}),xt=(e,t,l=[])=>{ht(e,{ref:e=>t(e.$ref,l),record:e=>{for(const n in e)xt(e[n],t,[...l,n])},array:e=>{for(let n=0;n<e.length;n++)xt(e[n],t,[...l,n])}})};async function ft(e,t){try{return e?await bt(e,t):null}catch(e){console.error(e)}return null}const bt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),yt=e=>[...new Set(e)],vt={},Nt=["/portal-resources"],wt=(e,t)=>gt(e,(e=>t?.[e])),kt=(e,t)=>{const l=(e=>{const t=[];return xt(e,(e=>t.push(e))),t})(e),[i,r]=n({});return a((()=>{l.length&&(async e=>Object.fromEntries((await Promise.allSettled(yt(e).filter((e=>!Nt.some((t=>e.startsWith(t))))).map((async e=>[e,vt[e]||=await bt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(l).then(r)}),[l.join()]),l.length?wt(e,{...t,...i}):e};function St(e,t={}){const l=d((t=>{const l=kt((({block:e,options:t,className:l,defaultPadding:n,padding:a,isTheme:i,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...l})}));return Object.assign(l,t),l}const Ct=St((({className:e,padding:t,...l})=>o(f,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:o(st,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...l})})),{childrenTypes:["UnitBlock"]}),Tt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},l=r((()=>It(0,t?.length)),[t]),n=t?.[l];return n?o(Ct,{suppressHydrationWarning:!0,...n,...e}):o(f,{...e,children:o(b,{})})})),It=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Bt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const l=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${n}-${l}`:`${l}.${n}.${a}`}},Pt=e=>e?.replace(/[^+\d]/g,"");const Mt=e=>e?{phone:Pt(e)}:{},Rt=e=>e?{birthday:Bt(e)}:{},Vt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),zt=(e,t=!0)=>({[t?"email":"mail"]:e}),Dt=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Pt(e)}:{},_t=({aspectsAttributes:e,aspects:t,ev:l})=>{for(const{aspectName:n,params:a}of e)t[n??""]?.(l,a)},At="rshb-query-params";function $t(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(At)||"";return e&&globalThis.sessionStorage?.setItem(At,e),e}function jt(e){if(!e)throw new Error("Value should be fulfilled");return e}const Lt=e=>t=>{const[,l]=jt(e.find((([e])=>e(t))));return l(t)},Ot=e=>Lt(e.map((([e,t])=>[e,()=>t])));Ot.if=e=>new Et(void 0,e);class Et{parent;predicate;unit;get entry(){return[jt(this.predicate),jt(this.unit)]}constructor(e,t,l){this.parent=e,this.predicate=t,this.unit=l}if(e){return new Et(this,e)}then(e){return new Et(this.parent,this.predicate,e)}else(e){return Lt([...Ft(this),[()=>!0,e]])}}const Ft=e=>[...e?.parent?Ft(e.parent):[],e.entry],Ut=e=>{const t=e.target?.closest("a");if(A(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const l=(e=>{const t=$t();if(!A(e)||!t)return e;const l=new URL(e);for(const[e,n]of new URLSearchParams(t))l.searchParams.set(e,n);return l.toString()})(t?.href)||t?.href;if(l){Wt(t?.target)?.(l)}}},Wt=Ot([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]);function Ht(){return Ht._impl()}Ht._impl=()=>({forwardQuery:Ut}),Ht.setup=e=>{Ht._impl=e};const Kt=(e,{resetOnSubmit:t,onSubmit:l}={})=>{const[a,r]=n(e),[o,c]=n(!1),[d,m]=n({}),u=s({}),p=i(((e,t)=>{const{parse:l=h,format:n=h}=t||{};return u.current||(u.current={}),u.current[e]||=t=>{r((n=>({...n,[e]:l(t)}))),m((t=>({...t,[e]:!0})))},{value:n(a[e]),isDirty:o||d[e],onChange:u.current[e]}}),[a,o,d]),g=i((e=>{r(e),m(e)}),[]),x=i((()=>{r(e),c(!1),m({})}),[e]),f=i((e=>{e.preventDefault(),t?x():c(!0),l&&l(a,e)}),[l,a]);return[a,{isDirty:o||Object.values(d).some(Boolean),field:p,update:g,reset:x,onSubmit:f}]},qt=d((e=>{const{className:t,title:l,children:n,...a}=e;return o(f,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[l?o(k,{headingType:"h3",title:l,className:"@xl:text-center"}):null,n]})})}));function Xt({disabled:e,onClick:t}){return l=>{!e&&t&&t(l)}}const Yt={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active"},Gt={primary:u("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},Qt=d((({children:e,...t})=>{const l=e=>({...e,onClick:ue(Xt(e))}),{className:n,version:a="primary",active:i,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=l(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",i?"text-white bg-primary-active":"",r?"bg-main-gray text-main-disabled cursor-not-allowed":"",i||r?"":u(Yt[a],Gt[a]),c?"rounded-md":"",n),type:s,role:d,onClick:m,children:e})})),Jt=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(q,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Zt=d((({className:e,head:t,children:l,onClose:n,onClick:a})=>{const{close:r}=he(),s=i((()=>{r(),n&&n()}),[n]);return c("div",{onClick:a,className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Jt,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:l})]})})),el=d((function({responseType:e}){const t="OK"===e,l=t?"ResponseOKIcon":"ResponseFailIcon",{close:n}=he(),a=i((()=>{n()}),[]);return o(Zt,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto ",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ae,{image:{icon:l,iconVersion:"normal"},width:"136",height:"136"}),o(T,{className:"w-full",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",description:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Qt,{type:"button",onClick:a,children:"Хорошо"})]})})})),tl=e=>t=>l=>e(l)?[]:[t],ll=e=>o("div",{className:"h-6",children:e?o(Le,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),nl=d((({className:e,viewBox:t,fill:l="none",width:n,height:a,paths:i,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:l,width:n,height:a,children:i.map((({d:e,fill:t,...l},n)=>{const a={...r,...l};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},n)}))}))),al="appearance-none w-5 h-5 border-solid flex-none",il=[{d:"M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],rl=d((({className:e,value:t,text:l,disabled:n,isRadio:a,onChange:r})=>{const s=i((e=>{n||(e.preventDefault(),r&&r(!t))}),[r,n,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(nl,{paths:il,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",ol(n)),onClick:s,children:[o("div",{className:u(al,"m-0",a?"rounded-full border-2":dl(t),!n&&t?"border-primary-main":"border-gray",n?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:cl(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(n)}),t?d:null,sl(l)]})})})),sl=e=>e?o("div",{className:"ml-s",children:o(Le,{size:"text-l",font:"font-light",children:e})}):null,ol=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",cl=(e=!1)=>e?"radio":"checkbox",dl=(e=!1)=>u("rounded border",e?"bg-primary-main":""),ml=d((({className:e,text:t,value:l,key:n,disabled:a,error:i,onChange:r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(rl,{text:t,value:l,disabled:a,onChange:r},n),ll(i)]})));function hl(e=!1){const[t,l]=n(e),a=i((()=>l(!0)),[]),r=i((()=>l(!1)),[]),s=i((()=>l((e=>!e))),[]);return[t,{setValue:l,setTrue:a,setFalse:r,toggle:s}]}const ul=e=>e?o(Le,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,pl="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",gl=d((({key:e,className:t="",id:l,name:n,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:x,onFocus:f,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1})=>{const w=s(null),k=i((e=>{x&&x(e.target?.value||"")}),[x]);a((()=>{v&&w.current?.focus()}),[v,w]);const S="w-full border rounded-md text-primary-text outline-none p-m",C=g?"pr-3xl":"",T=xl(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[ul(d),N?o("textarea",{className:u("block resize-y min-h-24",S,T),id:u("textarea",l),name:n||l,placeholder:m,value:h,onChange:k,onFocus:f,onBlur:b},e):o("input",{type:r,className:u("h-14",S,C,T),ref:w,id:l,name:n||l,placeholder:m,value:h,onChange:k,onFocus:f,onBlur:b,pattern:y},e)]}),g]})})),xl=e=>e?pl:"border-error",fl=e=>e?.text||e?.key||"";function bl(e,t,l,n){a((()=>{if(e&&l)return e.addEventListener(t,l,n),()=>{e.removeEventListener(t,l,n)}}),[e,t,l])}function yl(e){const t=s(null),l=i((l=>{t&&t.current&&l.target instanceof Node&&!t.current.contains(l.target)&&e()}),[e]);return bl(globalThis.document,"click",l),t}const vl=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Nl=d((({popupRef:e,options:t,value:l,query:n,onChange:a,iconVersion:i})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:vl(t,n).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===l?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:fl(e)}),o(q,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:u("absolute right-4 pt-3xs",e.key===l?.key?"":"hidden")})]},e.key)))}):null));function wl({isOpen:e,options:t,value:l,query:n,onChange:r,onClose:c,iconVersion:d}){const m={open:(e,t)=>me.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>me.fire("popup",{type:"update",popup:e,...t}),close:()=>me.fire("popup",{type:"close"})},h=i((()=>{m.close(),c&&c()}),[c]),u=i((e=>{h(),r&&r(e)}),[h,r]),p=s(null),g=yl(h);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:i,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(Nl,{popupRef:g,options:t,value:l,query:n,onChange:u,iconVersion:d}),{top:i+window.scrollY+c,left:r,width:s})}),[e,t,l,n,u]),p}const kl=d((({className:e,label:t,options:l=[],value:a,valid:r=!0,isBorder:s=!0,placeholder:d="",isSearch:m=!1,iconVersion:h="black",onChange:p,disabled:g})=>{const[x,{setFalse:f,setTrue:b}]=hl(),[y,v]=n(""),N=g||0===l.length,w=x&&!N,k=i((()=>{v(""),f()}),[]),S=wl({isOpen:x,options:l,value:a,query:y,onChange:p,onClose:k,iconVersion:h});return c("div",{className:u("space-y-xs",e),children:[ul(t),c("div",{className:u("relative",w?"z-20":"z-10"),ref:S,children:[c("div",{className:u("h-14 [&>*]:p-m pr-8 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Cl(s,r,N)),onClick:w?k:b,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:fl(a)||d}),Sl(w,h)]}),m&&w?o("div",{className:u("absolute top-0 w-full z-20"),children:o(gl,{type:"text",autoFocus:!0,value:y,onChange:v})}):null]})]})})),Sl=(e,t)=>o(q,{className:u("absolute right-3 flex self-center",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Cl=(e,t,l)=>u(e?"border rounded-md ":"",e&&!l?"hover:border-primary-hover":"",l?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Tl=()=>{},Il=({today:e,firstDayOfWeek:t,totalDays:l,currentMonth:n,currentYear:a,min:i,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const h=[];for(let c=0;c<7;c++)if(0===m&&c<t)h.push(o("td",{},`empty-${c}`));else if(d>l)h.push(o("td",{},`empty-${c}`));else{const t=new Date(a,n,d),l=Bl(t,e),c=Pl(t,i,r);h.push(o("td",{children:o("div",{className:Ml(l,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:h},`row-${m}`))}return c},Bl=(e,t)=>t&&e.toDateString()===t.toDateString(),Pl=(e,t,l)=>t&&e.getTime()<t.getTime()||l&&e.getTime()>l.getTime(),Ml=(e,t)=>u("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),Rl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Vl=d((({today:e,currentMonth:t,currentYear:l,min:n,max:a,onDateSelect:s=Tl})=>{const d=i((e=>s(e)),[]),{firstDayOfWeek:m,totalDays:h}=r((()=>({firstDayOfWeek:new Date(l,t,1).getDay()-1,totalDays:new Date(l,t+1,0).getDate()})),[l,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Rl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Il({firstDayOfWeek:m,today:e,totalDays:h,currentYear:l,currentMonth:t,min:n,max:a,onDateClick:d})})]})})),zl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],Dl=zl.map((e=>({key:e}))),_l=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),Al={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},$l={className:"min-w-32",iconVersion:"black",isBorder:!1},jl=d((({className:e="",label:t="",value:l,valid:a=!0,minDate:r,maxDate:s,onChange:d})=>{const[m,{setValue:h}]=hl(!1),[p,g]=n(l?.getMonth()||(new Date).getMonth()),[x,f]=n(l?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:b,handleNextMonth:y,handleSelectMonth:v,handleSelectYear:N,monthsOptions:w,yearsOptions:k,handleChangeVisibleCalendar:S,ref:C}=(({onShowCalendar:e,showCalendar:t,selectedMonth:l,onMonthSelect:n,onYearSelect:a,selectedYear:r})=>{const s=yl(i((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:i((()=>e(!t)),[t]),handleNextMonth:i((()=>{l+1<=11?n(l+1):(n(0),a(r+1))}),[l]),handlePrevMonth:i((()=>{l-1>=0?n(l-1):(n(11),a(r-1))}),[l]),handleSelectMonth:i((({key:e})=>n(zl.indexOf(e))),[]),handleSelectYear:i((({key:e})=>a(Number(e))),[]),monthsOptions:Dl,yearsOptions:_l,ref:s}})({onYearSelect:f,onMonthSelect:g,onShowCalendar:h,selectedYear:x,selectedMonth:p,showCalendar:m});return c("div",{className:u("space-y-xs",e),ref:C,children:[ul(t),c("div",{className:"relative",children:[Ll(S,l,a),m?c("div",{className:"absolute bg-white z-20 select-none",children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:b,children:o(q,{...Al,className:"-rotate-90 cursor-pointer"})}),o(kl,{onChange:v,value:{key:zl[p]},options:w,...$l}),o(kl,{onChange:N,value:{key:String(x)},options:k,...$l}),o("div",{className:"my-auto",onClick:y,children:o(q,{...Al,className:"rotate-90 cursor-pointer"})})]}),o(Vl,{today:l,currentMonth:p,currentYear:x,onDateSelect:d,min:r,max:s})]}):null]})]})})),Ll=(e,t,l)=>c("div",{onClick:e,className:u("flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",l?"border-gray":"border-error"),children:[o(S,{children:t&&Bt(t)}),o(q,{...Al,name:"CalendarIcon"})]}),Ol=d((({className:e,label:t,error:l,...n})=>c("div",{className:u("shrink-0 w-full",e),children:[o(jl,{label:t&&n?.errors?`${t}*`:t,valid:Boolean(!l),...n}),ll(l)]}))),El=d((({className:e,label:t,value:l="",placeholder:n,error:a,onChange:i,onBlur:r,isTextarea:s,type:d,...m})=>c("div",{className:u("shrink-0 w-full",e),children:[o(gl,{type:d||"text","aria-label":t,label:t&&m?.errors?`${t}*`:t,valid:Boolean(!a),value:l,onChange:i,onBlur:r,isTextarea:s,placeholder:m?.errors&&!t?`${n}*`:n}),ll(a)]}))),Fl=e=>"_"===e,Ul=e=>/\d/.test(e),Wl=e=>Fl(e)||Ul(e),Hl=[..."+7 (___) ___-__-__"],Kl=Hl.findIndex(Fl),ql=Hl.map(((e,t)=>Wl(e)?Hl.slice(0,t).filter(Wl).length:-1));const Xl=d((({children:e,onChange:t,...l})=>{const n=i((e=>t&&t(function(e){const t=e.replace(/\D/g,""),l=Hl.map(((e,l)=>Ul(e)?e:t.charAt(ql[l])||e)),n=ql.indexOf(t.length-1)+1;return(n?l.slice(0,Math.max(Kl,n)):l).join("")}(e))),[t]),a=i((e=>{"+7 ("===e&&(t&&t(""))}),[]);return o(gl,{...l,onChange:n,onFocus:e=>n(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Yl=d((({className:e,label:t,value:l,error:n,onChange:a,onBlur:i,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Xl,{"aria-label":t,label:r?.errors?`${t}*`:t,valid:Boolean(!n),value:l,onChange:a,onBlur:i,placeholder:"+7 (___) ___-__-__"}),ll(n)]}))),Gl=d((({className:e="",label:t,error:l,...n})=>c("div",{className:e,children:[o(kl,{...n,valid:!l,label:n?.errors?`${t}*`:t}),ll(l)]}))),Ql="Некорректно заполненное поле",Jl=tl((e=>null!=e&&""!==e))(Ql),Zl=tl((e=>e?.key&&""!==e?.key))(Ql),en=tl((e=>"string"==typeof e&&e.length>1))(Ql),tn=tl((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Ql),ln=(nn=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,tl((e=>"string"==typeof e&&nn.test(e))))(Ql);var nn;const an=tl((e=>"boolean"==typeof e&&e))("Согласие обязательно"),rn={typeForm:Jl,surname:en,name:en,region:Zl,addressBranch:Zl,phone:ln,secondaryPhone:ln,birthday:Jl,email:Jl,fullName:en,inn:tn,partnerComments:Jl,collectionCount:Jl,comment:Jl,acquiringType:Zl,feedbackType:Zl,feedbackMethod:Zl,serviceType:Zl,serviceDirection:Zl,consentDataProcessing:an,annualRevenue:Jl},sn=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>"required"in e&&e.required)));return Object.fromEntries(t.map((e=>[e,rn?.[e]])))},on=(e,t)=>{const{value:l,isDirty:n}=e,a=n?t(l):[];return{...e,errors:a,error:a[0]}},cn=(e,t,l=!1)=>l?on(e,t):e,dn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],mn=d((({field:e,input:t})=>o(Gl,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:dn,...cn(e("acquiringType"),rn.acquiringType,t?.required)}))),hn=(e="")=>Boolean("trade"===e||"all"===e),un=e=>null!=e,pn=new Map,gn=e=>Boolean(e?.every((e=>Array.isArray(e)?gn(e):!e||"string"==typeof e))),xn=e=>gn(e)?e.toString():"";function fn(e,t,{fallback:l,cache:i}={}){const s=r((()=>bn(e)),[e]),[o,c]=n(void 0),[d,m]=n(void 0);a((()=>{if(!s.some(un))return;let e=!1;const l=(t,l)=>{e||(c(t),m(l))};return(async()=>{try{l(await((e,t=pn)=>l=>{const n=xn(l),a=t.get(n);if(n&&un(a))return a;const i=e(...l);return n&&un(i)&&t.set(n,Promise.resolve(i)),i})(t,i)(s))}catch(e){l(void 0,e)}})(),()=>{e=!0}}),[t,i,s]);const h=l&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&l[s[0]];return{data:!o&&h?h:o,error:d,mutate:()=>Promise.resolve(void 0)}}function bn(e){return Array.isArray(e)?e:e instanceof Function?bn(e()):[e]}const yn=[];const vn=async e=>await ft(e,{method:"GET"})||yn;function Nn(){const{data:e}=fn("/api/v1/branchesByRegions",bt);return Array.isArray(e)?e:[]}const wn=d((({field:e,input:t,isPremium:l=!1})=>{const n=e("region"),i=n?.value?.key,r=n?.value?.text,s=l?Nn()?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=fn(e?`/api/v1/branches?regionCode=${e}`:null,vn);return t||yn}(i)?.filter((e=>e?.address));return a((()=>{""!==n?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[n?.value]),o(Gl,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...cn(e("addressBranch"),rn.addressBranch,t?.required),isSearch:!0})})),kn=(e,{normalize:t,format:l})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=n(!1),m=i((e=>{d(!0),r&&r(e)}),[]),h=i((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!l?a:l(a),onFocus:m,onBlur:h}},Sn=(e,t,l)=>Math.max(t,Math.min(e,l));function Cn(e){const t=(e||"").replace(/\D/g,""),l=parseInt(t,10);return Number.isNaN(l)?0:l}function Tn({list:e=[],min:t,max:l,step:n,value:a=e[0]||t,disabled:i,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(l-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||i?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:l,step:n,value:s,disabled:i,onChange:t=>{const l=Cn(t.target?.value),n=e.length?e[l]:l;r&&r(n||0)}})})]})}const In=1,Bn=100,Pn=d((e=>{const{className:t,title:l,items:n=[],list:a=[],min:r=(a.length?0:In),max:s=(a.length?a.length-1:Bn),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=kn(e,{normalize:(e=0)=>a.length?Mn(a)(e):Sn(e,r,s),format:tt()}),x=i((e=>{p&&p(Cn(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[l?o(Le,{size:"text-m",font:"font-light",color:"text-primary-text",children:l}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",pl,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:x,...g}),Tn({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),Rn(n)]})})),Mn=e=>t=>e.reduce(((e,l)=>Math.abs(l-t)<Math.abs(e-t)?l:e)),Rn=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Le,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),Vn=["От 1 000 ₽","До 1 000 000 000 ₽"],zn=d((({field:e})=>o(Pn,{title:"Сумма, ₽",items:Vn,min:1e3,max:1e9,...e("amount")}))),Dn=d((({field:e,input:t})=>o(El,{className:"col-span-2",...cn(e("comment"),rn.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),_n=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],An=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],$n=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],jn=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Ln=d((({field:e})=>o(Gl,{label:"Способ получения ответа",options:jn,...on(e("feedbackMethod"),rn.feedbackMethod)}))),On=d((({field:e})=>{const t=e("feedbackType");return a((()=>{"FEEDBACK"===t?.value?.key&&e("serviceDirection")?.onChange?.(An[0])}),[t?.value]),o(Gl,{label:"Тема",placeholder:"Выберите тему",options:$n,...on(t,rn.feedbackType)})})),En=d((({field:e})=>o(ml,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Fn=d((({value:e=!1,text:t,type:l="checkbox",onChange:n})=>c("div",{role:l,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>n&&n(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Le,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Un=d((({field:e})=>hn(e("acquiringType")?.value?.key)?o(Fn,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),Wn=d((({field:e})=>{const t=e("secondaryPhone");return o(Yl,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?on(t,rn.secondaryPhone):t})})),Hn=d((({field:e})=>hn(e("acquiringType")?.value?.key)?o(Fn,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null));function Kn(){const{data:e}=fn("/api/v1/regions",bt);return Array.isArray(e)?e:[]}const qn=d((({field:e,input:t})=>{const l=Kn();return o(Gl,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>l?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[l]),...cn(e("region"),rn.region,t?.required)})})),Xn=d((({field:e,input:t})=>{const l=Nn(),n=r((()=>l?.map((({region:e})=>({key:e,text:e})))),[l]);return o(Gl,{label:"Регион",placeholder:"Выберите регион",options:n,...cn(e("region"),rn.region,t?.required)})})),Yn=d((({field:e})=>o(Gl,{label:"Направление обслуживания",placeholder:"Выберите направление",options:An,...on(e("serviceDirection"),rn.serviceDirection)}))),Gn=["От 1 мес","До 15 лет"],Qn=d((({field:e})=>o(Pn,{title:"Срок, месяцев",items:Gn,min:1,max:180,...e("term")}))),Jn=d((({field:e})=>o(Gl,{label:"Тип обслуживания",options:_n,...on(e("serviceType"),rn.serviceType)}))),Zn=d((({name:e,text:t,value:l,checked:n,onChange:a,className:i})=>o("div",{className:i,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(pl,al,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:l,name:e,checked:n,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(Le,{color:"text-primary-text",children:t}):null]})}))),ea=["currencyControl","documentOperations","conversionTransactions","otherIssues"],ta=d((({field:e})=>{const{value:t,onChange:l}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),c("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:[o(Zn,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:l}),o(Zn,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:l}),o(Zn,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:l}),o(Zn,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:l})]})})),la=(e,t)=>(l,n)=>{const{required:a,...i}=l,r="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,s={surname:o(El,{label:"Фамилия",...cn(e("surname"),rn.surname,a)}),name:o(El,{label:"Имя",...cn(e("name"),rn.name,a),...i}),middleName:o(El,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),phone:o(Yl,{label:"Телефон",...cn(e("phone"),rn.phone,a)}),email:o(El,{label:"Электронная почта",...cn(e("email"),rn.email,a)}),fullName:o(El,{label:"ФИО",...cn(e("fullName"),rn.fullName,a),...i}),inn:o(El,{label:"ИНН",type:"number",...cn(e("inn"),rn.inn,a)}),comment:o(Dn,{field:e,input:l}),region:r?o(Xn,{field:e}):o(qn,{field:e,input:l}),addressBranch:o(wn,{field:e,input:l,isPremium:r}),birthday:o(Ol,{label:"Дата рождения",...cn(e("birthday"),rn.birthday,a)}),isClient:o(En,{field:e}),consentToReceiveMaterials:o(ml,{...e("consentToReceiveMaterials"),text:"Согласен на получение информационных и аналитических материалов по электронной почте"}),partnerComments:o(El,{...cn(e("partnerComments"),rn.partnerComments,a),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i}),collectionCount:o(El,{label:"Количество объектов инкассации",type:"number",...cn(e("collectionCount"),rn.collectionCount,a)}),acquiringType:o(mn,{field:e,input:l}),onlineCheckout:o(Un,{field:e}),posTerminal:o(Hn,{field:e}),serviceType:o(Jn,{field:e}),term:o(Qn,{field:e}),amount:o(zn,{field:e}),annualRevenue:o(El,{label:"Годовая выручка, ₽",...cn(e("annualRevenue"),rn.annualRevenue,a)}),vedTypes:o(ta,{field:e}),feedbackType:o(On,{field:e}),feedbackMethod:o(Ln,{field:e}),serviceDirection:o(Yn,{field:e}),bankEmpolee:o(El,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}),applicationDate:o(El,{label:"Дата и время обращения в Банк",...e("applicationDate")}),secondaryPhone:o(Wn,{field:e})};return function({input:e,field:t}){const{condition:l}=e,{value:n}=t(l?.name||"");return!l||l?.values?.find((e=>e===(n?.key??n)))}({input:l,field:e})?o("div",{children:s[l?.name]},String(n)):null};const na=e=>{const{acquiringType:t,onlineCheckout:l,posTerminal:n,amount:a,term:i,annualRevenue:r,serviceType:s,feedbackType:o,vedTypes:c,region:d,...m}=e,h=t||r?(e=>{const{acquiringType:t,onlineCheckout:l=!1,posTerminal:n=!1,term:a,amount:i,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${hn(t?.key)?`/Онлайн касса=${l}/POS-терминал=${n}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${i}/Срок=${a}/Выручка=${r}`})(e):null,u={...m,...ia(c),...aa(d),...h?{partnerComments:h}:{},...s?{typeForm:s}:{},...o?{typeForm:o}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},aa=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},ia=e=>e?{vedTypes:Object.fromEntries(ea.map((t=>[t,t===e])))}:{},ra={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:dn[0],serviceType:_n[0],feedbackType:$n[0],feedbackMethod:jn[0],serviceDirection:An[0],vedTypes:ea[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1},sa=(e,t="")=>{const l=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||ra[e.name]])));return l?.serviceType&&"PREMIUMSERVICE"===t&&(l.serviceType=_n[1]),{...l,typeForm:{key:t,text:""}}},oa=d((({text:e,link:t})=>c(S,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Le,{children:e}):null,t?o(ve,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Le,{children:t.text})}):null]}))),ca=(e,t)=>o(Qt,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),da=(e,t,l)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(rl,{...e}),o(oa,{link:t})]}),ll(on(e,an).error)]}):o(oa,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),ca(l)]}),ma={send:async function(e,t=!1){const{typeForm:l,region:n,phone:a="",email:i,birthday:r,inn:s,fullName:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:h,serviceDirection:u,...p}=e,g=t&&"Юридическое лицо / ИП"!==u,x=g?"/api/v1/lead":"/api/v1/sendcorporatelead",f={typeForm:l,...Vt(n,g),...zt(i,g),...Mt(a),...g?Rt(r):{inn:s,fullName:o},..."FEEDBACK"===l?{}:{addressBranch:c,bankEmpolee:m,applicationDate:h,...Dt(d)},...p};try{const e=await fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(f)});return e?.ok?await e.json():null}catch(e){return null}}},ha=d((({className:e,title:t,typeForm:l="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...x})=>{const f=r?.flatMap((e=>e?.inputs))||[],b=sa(f,l),[y,v]=n(""),N=i((async(e,t)=>{const l=xa(f,e),n=(a=sn(l),e=>e&&Object.entries(a).flatMap((([t,l])=>l(e[t])))||[]);var a;if(n(e)?.length)return"Fail";const i=na({...e,...h}),r=await ma.send(i,"lead"===m)?"OK":"Fail";if(v(r),r){(e=>{const{open:t,close:l}=he();return{open:(l={})=>t(o(el,{...e}),l),close:l}})({responseType:r}).open()}if("OK"===r&&g){const e=Ht();_t({aspectsAttributes:g,aspects:e,ev:t})}return r}),[]),[,{field:w,onSubmit:S,reset:C}]=Kt(b,{onSubmit:N}),T=ga(f)?.name;return a((()=>{"OK"===y&&(v(""),C())}),[y]),c(qt,{className:u("container space-y-m",e),title:t,...x,children:[c("form",{onSubmit:S,children:[r.map(((e,t)=>c("div",{className:u(pa(e.columns),"grid gap-x-m"),children:[ua(e.title),(e?.inputs||[])?.map(la(w,l))]},`section-${t}`))),da(T?w("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(k,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"8 (800) 200-78-70",children:[o(ae,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ae,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),ua=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Le,{size:"text-h6",children:e})}):null,pa=e=>2===e?"@xl:grid-cols-2":"",ga=e=>e?.find((e=>"consentDataProcessing"===e?.name)),xa=(e,t)=>e.filter((e=>e)).filter((e=>!e?.condition||e?.condition.values.find((l=>{const n=t?.[e?.condition?.name??""];return"secondaryPhone"===e.name?Boolean(t.secondaryPhone):l===(n?.key??n)})))),fa=()=>{const[e,t]=n(false);return a((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),l=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",l),e?.matches&&t(Boolean(e.matches)),()=>{e?.removeEventListener("change",l)}}),[]),e},ba=d((({title:e,description:t})=>{const l=fa();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ae,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(T,{title:e,description:t,headlineVersion:l?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),ya=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",va=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Na(e,{sensitivity:t,rootRef:l}={}){const n=s(null),i=r((()=>({threshold:wa(t),root:l?.current})),[t,l?.current]);return a((()=>{if(!n.current)return;const t=new IntersectionObserver(e,i);return t.observe(n.current),()=>{t.disconnect()}}),[e,i]),n}function wa(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,l)=>Math.min(l/t)),1).concat(1)}const ka=d((({className:e,style:t,idx:l,activeIndex:n,observerOptions:a,children:r,onIntersection:s})=>{const c=Na(i((e=>{e.length&&s&&s(l||0,e[e.length-1])}),[s,l]),a);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(l===n),ref:c,role:"listitem",children:r})})),Sa=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Ca=d((({className:e,itemClassName:t,containerRef:l,activeIndex:n,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:x})=>{const f={sensitivity:1,rootRef:l},b=s([]),y=i(((e,t)=>{const l=[...b.current||[]];l[e]=t,b.current=l,g&&g(l),x&&x(Ia(l))}),[g,x]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,k={...w?Ta(c,v):{},...N?va(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:k,ref:l,role:"list",children:(S=(e,l)=>o(ka,{className:u(m,a?Sa[a-1]:"",N?"h-full":"",t),style:w?Ta(c/4):{},activeIndex:n,idx:l,observerOptions:f,onIntersection:y,children:e},String(l)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),Ta=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Ia=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Ba={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Pa={"horizontal-list":"w-6","vertical-list":"h-6"},Ma=d((({className:e="",containerRef:t,activeIndex:l,dotCount:n=0,listType:a="horizontal-list",version:i})=>n?o("div",{className:u("flex gap-xs",Ba[a],i?"group":"",e),"data-ver":i,children:Array.from({length:n}).fill(null).map(((e,n)=>o("div",{className:`cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white ${n===l?Pa[a]:"w-2 h-2 opacity-30"}`,role:"button","aria-hidden":!0,onClick:()=>(e=>{e!==l&&t?.current&&t.current.children[e]?.scrollIntoView({behavior:"smooth",block:"nearest"})})(n)},String(n))))}):null)),Ra=d((({className:e,disabled:t,...l})=>o(ve,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e||""),disabled:t,...l,children:o(ae,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),Va=d((e=>o(Ra,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),za=d((e=>o(Ra,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Da="absolute top-[calc(50%-24px)] z-40",_a="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Aa=d((({className:e,scroll:t,hasBlur:l,arrowsPadded:n})=>{const{canScrollLeft:a,canScrollRight:i,scrollLeft:r,scrollRight:s}=t;return c("div",{className:u(e),children:[l?$a(t):null,a?o(Va,{className:u(Da,n?"left-1":"left-0"),onClick:r}):null,i?o(za,{className:u(Da,n?"right-1":"right-0"),onClick:s}):null]})})),$a=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(_a,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(_a,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),ja=e=>e,La=(e=ja)=>t=>t.reduceRight(((t,l)=>e(t)>e(l)?t:l)),Oa=La(),Ea=(e=ja)=>La((t=>-e(t))),Fa=Ea(),Ua=e=>t=>e.scrollWidth/t,Wa=e=>(t,l)=>{e.scrollBy({left:l*Ua(e)(t),behavior:"smooth"})},Ha=({itemCount:e,onVisibleIndicesChange:t})=>{const l=s(null),[a,r]=n([]),o=i((e=>{r((t=>{return(l=t)===(n=e)||Boolean(l&&n&&l?.length===n?.length&&l.every(((e,t)=>e===n[t])))?t:e;var l,n})),t&&t(e)}),[e]),[c,d]=a.length?[Ea()(a),La()(a)]:[-1,-1],m=c>0,h=d<e-1,u=i((()=>{var t;l.current&&(m?Wa(l.current)(e,-1):(t=l.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{l.current&&(h?Wa(l.current)(e,1):l.current.scrollTo({left:0,behavior:"smooth"}))}),[e,h]),g=i(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{l?.current&&l.current.children[e]?.scrollIntoView(t)}),[l]);return[l,{scrollLeft:u,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:h,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Ka=d((({className:e,version:t,gap:l=14,padding:n=16,visibleItemCount:a=1,listType:i="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:x})=>{const f=Array.isArray(g)?g.length:0,[b,y]=Ha({itemCount:f,onVisibleIndicesChange:x}),[v]=y.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===i?"relative h-full":""),children:[o(Ca,{containerRef:b,activeIndex:v,visibleItemCount:a,gap:l,padding:n,listType:i,snapAlign:r,minHeight:s,onVisibleIndicesChange:y.handleVisibleIndicesChange,children:g}),o(Aa,{className:u(!d&&"hidden lg:block"),scroll:y,hasBlur:m,arrowsPadded:h}),o(Ma,{className:u(!p&&"lg:hidden"),containerRef:b,activeIndex:v,dotCount:f,listType:i,version:t})]})})),qa=({blocksToRender:e,...t})=>o(Ka,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:R(e,{...t.options,parent:t.block,renderProps:(e,t,l)=>o("div",{className:u("relative min-w-80",ya(!0)),children:P(e,t)},String(l))})}),Xa=e=>e%2!=0,Ya=d((({textNode:e,iconNode:t,tag:l,onClick:n,justifyContent:a="between",className:i,role:r,...s})=>c(l,{tag:l,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",i),onClick:n,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Ga=d((({className:e="",label:t,icon:l,dataTheme:n="pc",disabled:a=!1,onClick:i})=>o(Ya,{tag:"button",onClick:i,disabled:a,"data-theme":n,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Le,{size:"text-h4",children:t}),iconNode:l?o(ae,{image:{icon:l,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Qa=({isUnfolded:e,onToggle:t})=>o(Ga,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Ja=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:l=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=n(l),d=i((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),h=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[h,m]}:{className:e,role:"group",children:[m,h]})}));const Za=d((({className:e="",isUnfolded:t,children:l})=>{const n=s(null),i=function(e,t){const l=s(null);return a((()=>{const t=l?.current;if(!t)return;const n=new ResizeObserver((l=>{e(t,l[0])}));return n.observe(t),()=>{n.disconnect()}}),[e,...t]),l}((e=>{n.current&&(n.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:n,className:`transition-max-h duration-300 overflow-hidden ${n.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:i,children:l})})})),ei=["ArrowDownIcon","ArrowUpIcon"],ti="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",li=({topItemsCount:e=0,label:t="",block:l,blocksToRender:n=[],...a})=>{const[i,r]=e>0?[n.slice(0,e),n.slice(e)]:[n,[]];return c("div",{className:u("space-y-2xs",n.length?"":"hidden"),children:[c("div",{className:u(ti),children:[R(i,{...a.options,parent:l}),Xa(i.length)?o(Tt,{className:"col-span-6",...a}):null]}),o(Ja,{renderFoldableSection:({isUnfolded:e})=>c(Za,{className:u(ti),isUnfolded:e,children:[R(r,{...a.options,parent:l}),Xa(r.length)?o(Tt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:l,onToggle:n})=>o(Ga,{className:u(e<1?"hidden":""),disabled:!r?.length,label:t,icon:ei[Number(l)],dataTheme:a.options?.page?.colorPalette,onClick:n})})]})},ni=d((({blocksSection:e,blocksToRender:t=[],notFound:l,...n})=>{switch(e?.view){case"grid":return c("div",{children:[ai(l,t),li({...e,...n,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[ai(l,t),qa({...n,blocksToRender:t})]});default:return null}})),ai=(e,t)=>e&&!t.length?o(ba,{...e}):null,ii=e=>t=>t.reduce(((t,l,n)=>t.length?t.concat({...e,key:`sep-${n}`},l):[l]),[]),ri=d((({value:e,onChange:t,items:l=[],multiple:n})=>l.map((l=>o(Fn,{text:l?.title,value:[e].flatMap((e=>e)).includes(l.value),onChange:()=>(l=>{if(!t)return;const a=e?.includes(l);t(n?a?(e||[]).filter((e=>e!==l)):[...e||[],l]:a?[]:[l])})(l.value),type:n?"checkbox":"radio"},l.value))))),si=d((({children:e,filtrationSchema:t,resetButton:l,field:n,reset:a})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,ii(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(oi(n)).filter(Boolean))]}),l?o("div",{children:o(Qt,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:l?.text})}):null]}))),oi=e=>([t,l])=>{const n=l?.type;return"array"===n?ci(t,e)(l):null},ci=(e,t)=>l=>{const n=l?.items?.enum?.map(((e,t)=>({value:e,title:l?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[l?.title?o("div",{className:"mb-m",children:o(Le,{size:"text-m",font:"font-medium",color:"text-primary-text",children:l.title})}):null,o(ri,{items:n,multiple:!l?.single,...t(e)})]},e)};function di(e,...t){return e.map(((e,l)=>[e,...t.map((e=>e[l]))]))}const mi=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,hi=(e,t)=>Object.entries(e).map((([l,n])=>"number"==typeof n?Array.isArray(t[l])?((e,t)=>l=>mi(t[e])||mi(l[e])||l[e]?.includes(t[e]))(l,e):((e,t)=>l=>mi(t[e])||mi(l[e])||ui(t[e])<=ui(l[e]))(l,e):"object"==typeof n&&"min"in n&&"max"in n?((e,t)=>l=>mi(t[e])||mi(l[e])||ui(t[e]?.min)>=ui(l[e]?.min)&&ui(t[e]?.min)<=ui(l[e]?.max))(l,e):Array.isArray(n)?((e,t)=>l=>mi(t[e])||mi(l[e])||t[e]?.every((t=>l[e]?.includes(t))))(l,e):((e,t)=>l=>mi(t[e])||mi(l[e])||t[e]===l[e])(l,e))).every((e=>e(t))),ui=e=>Number(e||0),pi=(e,{block:t,page:l,normalize:n=h})=>{const a=t?.blocks||[],[i,{field:s,reset:o,update:c}]=Kt(e),d=r((()=>di(a,a.map((e=>wt(e.content,l?.fallback))))),[a,l?.fallback]),m=i===e?a:((e,t)=>(l=h)=>e?.filter((([,e])=>hi(t,l(e)||{}))).map((([e])=>e)))(d,i)(n);return[i,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},gi={},xi={},fi=St((({className:e,filtrationSchema:t=gi,consumerField:l={},resetButton:n,...a})=>{const[,{blocksToRender:i},{field:r,reset:s}]=pi(xi,{block:a.block,page:a.options?.page}),d=o(kl,{className:"w-64",label:l?.title,options:bi(l),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>bi(l).find((t=>t.key===e))||{key:""}})});return c(f,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(si,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Qt,{type:"reset",className:"mt-lg w-64",onClick:s,version:n?.version,children:n?.text})})]})}),o(ni,{blocksToRender:i,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),bi=e=>di(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),yi=(e=!1)=>e?"text-left":"text-center",vi={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Ni=d((({className:e,defaultIconSize:t=44,iconBgVersion:l="primary",size:n,icon:a,...i})=>{const r=String(n?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",vi[l],e),children:o(q,{...i,width:"54%",height:"54%",name:a})}):null})),wi=d((({className:e="",title:t,benefitList:l,...n})=>{const a=fa();return c(f,{className:e,defaultPadding:"p-6xl",...n,children:[t?o(k,{headingType:"h3",as:"h2",className:yi(a),title:t}):null,l?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:l.map(ki)}):null]})})),ki=({label:e,description:t,__html:l,icon:n,isDotted:a=!1,iconBgVersion:i},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[n?.icon?o(Ni,{className:"shrink-0",iconBgVersion:i,...n}):null,n?.src?o(ae,{className:"shrink-0",image:n}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(k,{headingType:"h6",children:e}),o(Le,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),l?o($e,{__html:l,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),Si=e=>({icon:t,title:l,description:n},a)=>c("div",{className:u("flex flex-col gap-1","items-center",n||l?"":"justify-center"),children:[l?o(Le,{size:"text-h6",font:"font-normal",align:e,children:l}):null,t?o(ae,{image:t,height:"180",className:"w-auto mx-auto"}):null,n?o(Le,{size:"text-h6",font:"font-normal",align:e,children:n}):null]},String(a)),Ci=(e,t,l)=>o("div",{className:`grid gap-2xs ${Ti(t)}`,children:e.map(Si(l))}),Ti=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},Ii=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:l="",columnsCount:n="4",subtitle:a,title:i,...r})=>c(f,{className:u("space-y-3xl",l),defaultPadding:"p-6xl",...r,children:[o(T,{defaultPadding:"",title:i,description:a,headlineVersion:"M"}),e?.length?Ci(e,n,t):null]}))),Bi={start:"justify-start",center:"justify-center",end:"justify-end"},Pi=d((({buttons:e,className:t="",align:l,...n})=>{const a=l?u("flex",Bi[l]):"";return o(f,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...n,children:Qe(e)})})),Mi=d((({className:e,title:t,children:l,...n})=>c(f,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...n,children:[t?o(k,{className:"text-center",title:t}):null,l]}))),Ri="flex flex-col justify-between @4xl:flex-row",Vi="gap-x-s gap-y-7 @xl:gap-y-4xl",zi="gap-7 @xl:gap-y-4xl",Di="flex flex-col lg:max-w-80 gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0",_i="flex flex-col gap-y-xl",Ai=d((({className:e,title:t,value:l,fractionDigits:n,fixed:a,prefix:i,postfix:r,color:s="text-secondary-text"})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Le,{size:"text-l",font:"font-light",color:s,children:t}):null,o("div",l?{children:o(Le,{size:"text-h3",children:[i,tt(n,{fixed:a})(l),r].filter(Boolean).join(" ")})}:{children:o(Le,{size:"text-h3",children:"-"})})]}))),$i=(e,t)=>e?o(S,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,ji=d((({rate:e=0,title:t="Ставка",unit:l,fractionDigits:n=2,depositeName:a,isShowDepositeName:i,color:r="text-secondary-text"})=>c("div",{children:[o(Le,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:tt(n,{fixed:!0})(e)}),l?o("span",{className:"text-7xl mt-5",children:l}):null]}),a&&i?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Li=d((({title:e="Ставка",isUnavailableByTerm:t=!1})=>c("div",{className:"space-y-s min-w-96",children:[o(Le,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(q,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:t?c(S,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",o("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):o(S,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),Oi=({title:e="Ставка",rate:t=0,unit:l="%",fractionDigits:n=2,isUnknownRateShown:a=!0,color:i="text-secondary-text",children:r,...s})=>a&&0===t?o(Li,{title:e,...s}):c("div",{className:"flex flex-col",children:[o("div",{className:"hidden @xl:block min-w-96",children:o(ji,{title:e,rate:t,unit:l,fractionDigits:n,color:i,...s})}),o(Ai,{className:"@xl:hidden",title:e,value:t,postfix:l,fractionDigits:n,fixed:!0,color:i,...s}),r]}),Ei=({isShowItems:e=!0,step:t=1e3,postfix:l="₽",...n})=>o(Pn,{items:e?[`От ${tt(1)(n.min||0)} ${l}`,`До ${tt(1)(n.max||0)} ${l}`]:[],step:t,...n}),Fi={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Ui={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Wi=(e,t)=>{const{travelExpenseValue:l,restExpenseValue:n}=e,[a,i]=((e,t,l)=>{const{maxBonus:n=5e3,prefMonthsNum:a=Fi.prefMonthsNum,prefTravelBonusRate:i=Fi.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(i*t)+Math.round(r*l),n);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*l),n)*(12-a)]})(t||Ui,l,n);return{...t,...e,monthBonus:a,yearBonus:i}},Hi=St((({className:e="",title:t,calcSource:l,buttons:n,footnote:a,...i})=>{const[r,{field:s}]=Kt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:x}=Wi(r,l);return o(Mi,{className:e,title:t,...i,children:c("section",{className:u(Ri,Vi,e),children:[c("div",{className:Di,children:[Ei({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Ei({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Oi({title:"Баллов за месяц",rate:g,fractionDigits:0,isUnknownRateShown:!1,unit:"",color:"text-primary-text"}):null}),c("div",{className:_i,children:[x>=0?o(Ai,{title:"Баллов за год",value:x,color:"text-primary-text"}):null,Qe(n,{isVertical:!0}),$i(a)]})]})})})),Ki=Math.round(29.5),qi=(e,t=0)=>e?.sum?e.sum:t,Xi=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Yi=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Gi={horizontal:"gap-5xl",vertical:"flex-col gap-s"},Qi=d((({items:e,checkedItem:t,className:l,onChange:n,disabled:a=!1,orientation:i="horizontal"})=>o("div",{className:u(`flex ${Gi[i]}`,l),role:"radiogroup",children:e?.map((({id:e,text:l})=>o(rl,{isRadio:!0,text:l,value:t===e,onChange:()=>n&&n(e),disabled:a},String(e))))}))),Ji=({items:e,title:t,mobileTitle:l=t,orientation:n="horizontal",value:a,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",children:o(Le,{color:"text-secondary-text",font:"font-light",children:t})}):null,l?o("div",{className:"@5xl:hidden",children:o(Le,{color:"text-secondary-text",font:"font-light",children:l})}):null,o(Qi,{orientation:n,items:e,checkedItem:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),Zi=e=>Ji({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),er=" (c капитализацией)",tr=({income:e,finalSum:t,postfix:l="₽",buttons:n=[],footnotes:a=[],isCapitalization:i=!1})=>c("div",{className:_i,children:[o(Ai,{title:`Доход в конце срока${i?er:""}`,value:e,postfix:l,prefix:"+"}),o(Ai,{title:`Сумма в конце срока${i?er:""}`,value:t,postfix:l}),Qe(n,{isVertical:!0}),a?.map($i)]}),lr=([e,t],l,n=[])=>l&&l[e]&&l[t]?{[e]:l[e],[t]:l[t]}:nr([e,t],n),nr=([e,t],l=[])=>({[e]:l.length?Fa(l.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:l.length?Oa(l.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),ar=(e,[t,l],n)=>e>=n[t]&&e<=n[l],ir={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const rr={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},sr=(e,t)=>{const{daysValue:l,moneyValue:n,isPartialWithdrawal:a,isReplenished:i,isMonthlyInterestPayment:r}=e,s=i||a,o=l<90||l>730,c=function(e){const t=e?.rateType?ir[e?.rateType]:"",{data:l}=fn(t?`/api/v1/depositrates/${t}`:null,bt);return Array.isArray(l)?l:[]}(t);if(l<=30)return{...rr,...e,isDisabledOperatingDeposit:o,isUnavailableByTerm:!0};const d=c?.find((e=>r===e.isMonthlyInterestPayment&&or(s,e)&&ar(n,["minSum","maxSum"],e)&&ar(l,["minDays","maxDays"],e)))||rr,{rate:m}=d,h=cr(m,e),u=n+h,p=c||[rr];return{...d,...nr(["minSum","maxSum"],p),...nr(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:h,finalSum:u}},or=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,cr=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,daysValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a/30)-n):Math.round(n*e*a/365/100)},dr=St((({className:e="",title:t,buttons:l,footnote:n,bottomFootnote:a,isShowDepositeName:i,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=Kt({moneyValue:qi(r,1e5),daysValue:Xi(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=sr(m,s),{income:g,finalSum:x,rate:f,isUnavailableByTerm:b,depositeName:y}=p;return o(Mi,{className:e,title:t,...d,children:c("section",{className:u(Ri,Vi,e),children:[c("div",{className:Di,children:[Ei({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(v={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(Pn,{items:[`От ${Yi(v.min||0)}`,`До ${Yi(v.max||0)}`],step:1,...v})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[mr(p,h),Zi({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),Oi({rate:f,depositeName:y,isShowDepositeName:i,isUnavailableByTerm:b}),tr({income:g,finalSum:x,buttons:l,footnotes:[n,a]})]})});var v})),mr=(e,t)=>c("div",{className:"space-y-s",children:[o(Le,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(rl,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(rl,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),hr=e=>ur([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e),ur=(e,t)=>{if(!t?.length)return;const l=t?.reduce(((t,l)=>e[0](l.rate,t[0].rate)?[l]:l.rate===t[0].rate?[...t,l]:t),[t[0]]);return l.length>1?l.reduce(((t,l)=>e[1](l,t)?l:t),l[0]):l[0]},pr=({min:e=0,max:t=0,availableMonths:l,...n})=>o(Pn,{items:[`От ${gr(e)}`,`До ${gr(t)}`],step:1,...l?.length?{list:l}:{min:e,max:t},...n}),gr=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,xr=e=>Ji({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),fr=({field:e,defParams:t,calcParams:l,map:n,monthsValue:a="maxMonths"})=>{Object.entries(n).forEach((([l,n])=>{e?.(l)?.onChange?.(t?.[n])})),e?.("monthsValue")?.onChange?.(Sn(t?.[a],l.minMonths,l.maxMonths))},br=(e,t)=>{const{isAnnuity:l,moneyValue:n,monthsValue:a,moneyExtra:i}=t;if(0===e)return 0;if(l){const t=e/1200;return i?(n+i)*(t+t/(Math.pow(1+t,a)-1)):n*(t+t/(Math.pow(1+t,a)-1))}return Math.round(n/a)+n*(e/1200)},yr={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},vr=e=>Nr({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Nr({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Nr({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Nr({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Nr=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],wr=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=t?.rateRows||[yr],r=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>vr({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:s,maxSum:o}=lr(["minSum","maxSum"],r,i),{minMonths:c,maxMonths:d}=lr(["minMonths","maxMonths"],r,i),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a})=>e?.find((e=>vr({row:e,userInputParams:t,paramsViewSettings:l})&&ar(n,["minSum","maxSum"],e)&&ar(a,["minMonths","maxMonths"],e)))||yr)({rateRows:i,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a}),{rate:h}=m,u=br(h,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:n,monthsValue:a,monthlyPayment:u}},kr=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Sr={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Cr=St((({className:e,title:t,calcSource:l,buttons:n,footnote:i,paramsViewSettings:r,defaultParams:s,...d})=>{const m=(h=l?.rateRows,ur([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],h));var h;const[p,{field:g}]=Kt({moneyValue:qi(s,2e5),monthsValue:Xi(s,Ki),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)}),x=wr(p,l,r),f=xr({title:"Тип платежа",orientation:"vertical",...g("isAnnuity")}),{onChange:b}=g("moneyValue"),{onChange:y}=g("monthsValue");return a((()=>{b&&b(Sn(p.moneyValue,x.minSum,x.maxSum))}),[x.minSum,x.maxSum]),a((()=>{y&&y(Sn(p.monthsValue,x.minMonths,x.maxMonths))}),[x.minMonths,x.maxMonths]),a((()=>{!kr(s)&&m&&fr({field:g,defParams:m,calcParams:x,map:Sr,monthsValue:"minMonths"})}),[l,s]),o(Mi,{className:e,title:t,...d,children:c("section",{className:u(Ri,zi,e),children:[c("div",{className:Di,children:[Ei({title:"Сумма кредита, ₽",step:500,min:x.minSum,max:x.maxSum,...g("moneyValue"),value:x.moneyValue}),pr({title:"Срок кредита, месяцев",min:x.minMonths,max:x.maxMonths,...g("monthsValue"),value:x.monthsValue}),Tr({...x,...r},g),o("div",{className:"sm:hidden",children:f})]}),c("div",{className:u(_i,"@4xl:w-1/2"),children:[o(Ai,{title:"Ежемесячный платёж",value:x.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:f}),Qe(n,{isVertical:!0}),$i(i)]})]})})})),Tr=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(rl,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(rl,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(rl,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(rl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Ir=(e="rub")=>"rub"!==e,Br=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let l=1;for(;l<t.length;){const[e,n]=t[l-1],[a,i]=t[l];n>=a?t.splice(l-1,2,[e,Math.max(n,i)]):l++}return t},Pr={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Mr=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=t?.[0]?zr(t[0].minMonths,t[0].maxMonths):0,r=!l?.isShowMonthlyInterestPayment,s=!l?.isShowRemoteRegistration,o=!l?.isShowReplenish,c=!l?.isShowWithdrawn,d=t?.find((t=>Vr({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o})&&Vr({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c})&&Vr({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r})&&Vr({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s})&&ar(n,["minSum","maxSum"],t)&&ar(a||i,["minMonths","maxMonths"],t)))||Pr,{rate:m}=d,h=Rr(m,e),u=n+h,p=t||[Pr];return{...d,...nr(["minSum","maxSum"],p),...nr(["minMonths","maxMonths"],p),availableMonths:Br(p.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,l=1)=>Array.from({length:Math.abs(t-e)/l+1},((n,a)=>t>=e?e+a*l:e-a*l)))(e,t))),...e,defaultMonth:i,income:h,finalSum:u}},Rr=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,monthsValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a)-n):Math.round(n*e*30*a/365/100)},Vr=({row:e,userInputParams:t,paramKey:l,isExclude:n})=>n||t[l]===e[l],zr=(e,t)=>e+Math.round((t-e)/2),Dr=(e,t)=>{const l="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?Ji({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:l}):null,e.isShowWithdrawn?Ji({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:l}):null]}),o("div",{className:"border-b border-main-divider w-full"}),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?Zi({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(n={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Ji({...n,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]})]});var n},_r={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},Ar={text:"₽",key:"rub"},$r=St((({className:e,title:t,calcSource:l,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=l??{},p=h?.map((e=>e.currency))??[Ar],[g,{field:x}]=Kt({moneyValue:qi(d,2e4),monthsValue:Xi(d),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),currency:Ar}),f=x?.("currency")?.value,{onChange:b}=x("monthsValue"),{onChange:y}=x("moneyValue"),v=Er(h,f),[N,w]=n(hr(h?.[0]?.rates)),k=Mr(g,Er(h,f),s),S=()=>{fr({field:x,defParams:N,calcParams:k,monthsValue:"minMonths",map:_r})},{defaultMonth:C,rate:T,income:I,finalSum:B,type:P=""}=k;a((()=>{w(hr(v))}),[f,h]),a((()=>{!g.monthsValue&&b&&b(C)}),[C]),a((()=>{y&&y(Sn(g.moneyValue,k.minSum,k.maxSum))}),[k.minSum,k.maxSum,v]),a((()=>{!kr(d)&&N&&S()}),[N,d]),a((()=>{y?.(Sn(g.moneyValue,k.minSum,k.maxSum)),Ir(f?.key)&&(x?.("isReplenish")?.onChange?.(!1),x?.("isWithdrawn")?.onChange?.(!1))}),[f]),a((()=>{!kr(d)&&N&&S()}),[d,v,N]);const M=T===N?.rate;return o(Mi,{className:e,title:t,...m,children:c("section",{className:u(Ri,Vi,e),children:[c("div",{className:Di,children:[c("div",{className:"flex gap-m",children:[Ei({className:"w-full",title:`Сумма, ${f?.text}`,min:k.minSum,max:k.maxSum,...x("moneyValue"),value:k.moneyValue,postfix:f?.text,step:jr(f?.key)}),h&&h?.length>1?o(Gl,{className:"w-20",label:"Валюта",options:p,...x("currency")}):null]}),pr({title:"Срок, месяцев",min:k.minMonths,max:k.maxMonths,availableMonths:k.availableMonths,...x("monthsValue"),value:k.monthsValue}),Dr({...k,...s},x)]}),Oi({rate:T,children:Or(S,M)}),tr({income:I,finalSum:B,buttons:[...i,Lr(l?.buttons,P)],footnotes:[r],postfix:f?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),jr=(e="")=>Ir(e)?100:1e3,Lr=(e=[],t="")=>{const{type:l,...n}=e.find((e=>e.type===t))??{};return n},Or=(e,t=!1)=>t?null:o(Qt,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Er=(e,t)=>{const{rates:l}=e?.find((e=>e?.currency.key===t?.key))??{};return l??e?.[0]?.rates},Fr=e=>Ur({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Ur({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Ur=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],Wr={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Hr=(e,t,l)=>{const{moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}=e,s=t?.rateRows||[Wr],o=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>Fr({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:c,maxSum:d}=lr(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=lr(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>Fr({row:e,userInputParams:t,paramsViewSettings:l})&&ar(n+r,["minSum","maxSum"],e)&&ar(i,["minSumOld","maxSumOld"],e)&&ar(r,["minSumExtra","maxSumExtra"],e)&&ar(a,["minMonths","maxMonths"],e)))||Wr)({rateRows:s,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}),{rate:p}=u,g=br(p,e),x=e.oldMonthlyPayment-g;return{...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r,monthlyPayment:g,benefit:x}},Kr=St((({className:e="",title:t,calcSource:l,buttons:n,footnote:a,paramsViewSettings:i,...r})=>{const[s,{field:d}]=Kt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=Hr(s,l,i),h=xr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Mi,{className:e,title:t,...r,children:c("section",{className:u(Ri,zi,e),children:[c("div",{className:Di,children:[Ei({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),Ei({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),pr({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),qr({...m,...i},d),m.isExtraMoney?Ei({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(_i,"@4xl:w-1/2"),children:[o(Ai,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(Ai,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),Qe(n,{isVertical:!0}),$i(a)]})]})})})),qr=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(rl,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(rl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(rl,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Xr=d((e=>{const{onChange:t,min:l,max:n,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=kn(e,{normalize:(e=a)=>l&&n?String(Sn(Number(Yr(e)),l,n)):Yr(e),format:tt(r)}),d=i((e=>t&&t(Yr(e))),[t]);return o(gl,{onChange:d,...s,...c})})),Yr=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Gr=d((e=>o(Xr,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Le,{size:"text-xl",font:"font-light",children:"₽"})})}))),Qr={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Jr={amount:1500},Zr=d((({className:e="",title:t="Укажите сумму перевода",label:l="Сумма перевода",button:i,formType:r="private",...s})=>{const[{amount:d},{field:m}]=Kt(Jr),[h,p]=n(!1);return a((()=>{p(d<=0)}),[d]),c(f,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(k,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Qr[r],children:[o(Gr,{valid:!h,label:l,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),i?.text?o(Qt,{className:"w-full mt-lg",type:"submit",disabled:h,children:i.text}):null]})]})})),es=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(q,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(S,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),ts="relative h-full",ls={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},ns=({noCardBorder:e,cardSize:t="normal",...l})=>{const{blocks:n}=l.block||{},a=n?.some(rs);return V({...l,renderProps:(l,n,i)=>c("div",{className:as(l,{someCardsHighlighted:a}),children:[P(l,n,{className:is(l,{someCardsHighlighted:a,showBorder:!e,cardSize:t}),blockIndex:i}),rs(l)?es({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},as=(e,{someCardsHighlighted:t})=>u(ts,t&&(rs(e)?"pt-3xl":"pt-3xl sm:pt-16")),is=(e,{someCardsHighlighted:t,showBorder:l,cardSize:n="normal"})=>u(ts,"min-w-80",ls[n],t&&(rs(e)?"pt-3xl sm:pt-16":"pt-3xl"),ya(l),l&&"h-full"),rs=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,ss=St((({className:e,visibleItemCount:t=1,noCardBorder:l,arrowsPadded:n=!0,isGap:a=!0,cardSize:i="normal",...r})=>o(f,{className:u(e),defaultPadding:"p-6xl",...r,children:o(Ka,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:n,hasBlur:!0,children:ns({noCardBorder:l,cardSize:i,...r})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),os="z-10 border border-solid w-full h-full",cs=u(os,"absolute hidden @xl:block border-transparent"),ds=d((({className:e,title:t,description:l,button:n,...a})=>o(f,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:u(cs,"top-9 right-12 bg-green-dark")}),o("div",{className:u(cs,"top-6 right-8 bg-green")}),o("div",{className:u(cs,"top-3 right-4 bg-green-light")}),c("div",{className:u(os,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(T,{title:t,description:l,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Qe([n],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),ms={black:"bg-black",white:"bg-white"},hs=d((({className:e="",title:t,description:l,image:n,price:a,button:i,colors:r=[],align:s="text-left",padding:d,...m})=>o(f,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Ce,{className:"h-full",padding:d,title:o(T,{title:t,description:l,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:n?.src?o(ae,{className:"flex justify-center align-center mb-xl",image:n}):null,buttons:Qe([i],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Le,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(us)]}):null,a?c(Le,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),us=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${ms[e]}`},String(t)),ps=d((({icon:e,...t})=>{const l=pe(),{text:n,href:a,target:i,onClick:r}=l(t);return n?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,target:i,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ae,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:n}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:n})]})})}):null})),gs=d((({className:e,additionalDescription:t,description:l,links:n,title:a,...i})=>o(f,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...i,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(T,{isEmbedded:!0,title:a,description:l,as:"h1",align:"text-left",headlineVersion:"XL"}),o(T,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),n?.length?xs(n):null]})}))),xs=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(ps,{...e},String(t))))}),fs=(e,t)=>e?.map((({aspectName:e,params:l})=>({aspectName:e,params:"mindboxEvent"===e?{...l,eventJson:t}:l}))),bs=d((({className:e="",href:t,target:l,onClick:n,data:a,children:i})=>{const r=pe()({href:t,target:l,onClick:n});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...ge(a),children:i})})),ys=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],vs=d((({className:e="",media:t,showButtonText:l,stretched:a,version:i="white",children:r})=>{if(!t?.length)return null;const[s,d]=n(),m=t?.map((e=>{const{href:t,icon:n,text:a}=e,{iconMapped:r}=(e=>ys.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Ge(n)?n:r,c=l?{text:a}:{text:""};return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:"color"},version:e?.version??i}})),h=u("border border-solid hover:border-transparent group-data-primary:border-main-divider border-main-divider group-data-gray:border-green group/media",l&&s?"":"basis-auto",Ns(a));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),children:[o("div",{className:"flex gap-xs",children:Qe(m,{className:ws(s??!1,a??!1,l),buttonClassName:h})}),r?o(Le,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Ns=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",ws=(e,t,l=!1)=>u(e||t?"basis-full":"",!t||l&&e?"":"flex-nowrap"),ks=d((({className:e,padding:t,description:l,additionalDescription:n,href:a,icon:i,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:g,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:b=true,isImageSecondary:y=!1}={},data:v,...N})=>o(f,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(bs,{href:a,target:m,className:"h-full",data:fs(v),children:c(Ce,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(T,{title:h,description:l,headlineVersion:"XS",isEmbedded:!0,align:p}),...ot(Ge(i)?o(ae,{image:i}):null,x),buttons:d.length?o(vs,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(Ye,{benefits:g}),s?o($e,{__html:s,isDotted:r,itemSize:"list-s"}):null,Ss(n,p)]})})}))),Ss=(e,t)=>e?o(S,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Cs=(e,t)=>{const{title:l,description:n,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[l?o("div",{className:"opacity-80",children:o(Le,{size:"text-m",color:"text-secondary-text",children:l})}):null,n?o("div",{className:"mt-2xs",children:o(Le,{size:"text-xl",color:"text-primary-text",children:n})}):null,a?.length?o("div",{className:"text-primary-main",children:Qe(a)}):null]},String(t))},Ts=d((({className:e="",title:t,align:l="text-center",icon:i,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const g=d.map(Cs),[x,b]=s>0?[g.slice(0,s),g.slice(s)]:[g,[]],[y,v]=n(!1);return a((()=>me.subscribe("fold",(e=>{void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(f,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[Ge(i)?o("div",{className:"self-center",children:o(ae,{image:i})}):null,t?o(k,{className:u("pt-xs",l),headingType:"h5",title:t}):null,r?.text?o(ve,{className:"w-full mt-m mb-lg",...r}):null,b.length?o(Ja,{renderFoldableSection:()=>c("div",{children:[x,o(Za,{isUnfolded:y,children:b})]}),renderFoldButton:d.length>=s?Is(y,m?.parent,h):null}):o("div",{children:x})]})})),Is=(e,t,l)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==t&&me.fire("fold",{type:"fold",isUnfolded:!e,parent:t})},type:"button",...e?ge(l):{},children:[o("div",{children:e?"Скрыть":"Подробнее о тарифе"}),o(q,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Bs=d((({className:e,contacts:t,info:l,version:n="secondary",...a})=>c(f,{className:u("flex",e),defaultPadding:"p-6xl",version:n,...a,children:[l?.length?Ps(l):null,t?.length?Ps(t):null]}))),Ps=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>Ms({column:e,i:t})))}),Ms=({column:e,i:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:l,button:n},a)=>c("div",{children:[o(T,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),l?o("div",{className:"mt-xs opacity-80",children:o(S,{size:"text-m",font:"font-light",children:l})}):null,n?.text?o(ve,{className:"mt-xl",...n}):null]},String(a))))},`col-${String(t)}`):null,Rs=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Vs=(e,t)=>Array.from({length:t-e+1},((t,l)=>e+l)),zs=1e9,Ds={sum:{min:1e4,max:zs},period:3},_s=St((({className:e,filtrationSchema:t={},resetButton:l,sumInput:n,periodInput:a,...i})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=pi(Ds,{block:i.block,page:i.options?.page,normalize:e=>({...e,period:As(e)})}),h=s.map((([,e])=>e?.paramsSource?.rateRows)),p=$s(h);return c(f,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(si,{filtrationSchema:t,resetButton:l,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Gr,{label:n?.title,min:500,max:zs,...d("sum",{parse:e=>({min:Number(e),max:zs}),format:({min:e})=>String(e)})}),o(Pn,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(ni,{blocksToRender:r,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),As=e=>yt((e?.paramsSource?.rateRows||[]).filter(Rs).flatMap((e=>Vs(e.minMonths,e.maxMonths)))),$s=e=>yt(e.flatMap((e=>e||[])).filter(Rs).flatMap((e=>Vs(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],js=[{key:"10"},{key:"50"},{key:"100"}],Ls=({itemCount:e,onItemCountChange:t})=>{const l=i((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(kl,{className:"min-w-20",onChange:l,value:{key:String(e)},options:js,iconVersion:"black"})]})},Os="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",Es=(e,t)=>{const{currentPage:l,onPageChange:n,totalPages:a}=e,i=t+1;return i===l?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:i},String(t)):1!==i&&i!==a&&((e,t,l)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,l)=>t<=2&&e<=t+2||t>=l-1&&e>=l-3)(e,t,l))(i,l,a)?o("div",{onClick:()=>n(i),className:Os,"aria-label":`Страница ${i}`,children:i},String(t)):null},Fs={width:"24",height:"24"},Us=({currentPage:e,onPageChange:t,totalPages:l})=>{const n=r((()=>Array.from({length:l}).fill({currentPage:e,onPageChange:t,totalPages:l})),[l,e]),a=i((()=>{e>1&&t(e-1)}),[e]),s=i((()=>{e<l&&t(e+1)}),[e,l]),d=i((()=>t(1)),[]),m=i((()=>t(l)),[l]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:a,children:o(q,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Ws(1===e),...Fs})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Os,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,n.map(Es),e<l-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<l?o("div",{onClick:m,className:Os,"aria-label":`Страница ${l}`,children:l}):null]}),o("div",{onClick:s,children:o(q,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Ws(e===l),...Fs})})]})},Ws=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Hs=({currentPage:e,onPageChange:t,totalPages:l,itemCount:n,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Us,{currentPage:e,onPageChange:t,totalPages:l}),n&&a?o(Ls,{itemCount:n,onItemCountChange:a}):null]}),Ks=d((({className:e,value:t,autoFocus:l,onChange:n,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{n&&n(e.target?.value||"")}),[n]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ae,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",pl),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:l,onChange:s,onFocus:a})]})})),qs=d((({field:e,onClearFilter:t,filtrationState:l})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Ks,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(jl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:l.endDate,...e("startDate")}),o(jl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:l.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(Qt,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Xs=({title:e,timestamp:t,publicId:l})=>{const n=pe(),{href:a}=n({href:`/api/v1/depository/${l}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[null,c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Le,{size:"text-m","font-weight":"font-light",children:Bt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},l)},Ys="/api/v1/depository",Gs={startDate:void 0,endDate:void 0,query:""},Qs=St((({className:e,...t})=>{const[l,a]=n(0),[r,s]=n(10),[d,{field:m,reset:h}]=Kt(Gs),{totalPages:p=0,items:g=[]}=(({size:e,page:t,query:l,startDate:n,endDate:a})=>{const i=n?Bt(n,!0):"",r=a?Bt(a,!0):"",s=new URLSearchParams(Ys);s.set("page",String(t)),s.set("size",String(e)),s.set("query",l),s.set("timestampStart",i),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=fn(Ys+o,bt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:l,...d}),x=i((e=>a(e-1)),[]),b=i((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(f,{className:u(e,"container p-6xl"),...t,children:[o(qs,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Le,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Le,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),g.length?g.map((e=>o(Xs,{...e},String(e.publicId)))):o(ba,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Hs,{currentPage:l+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:b})]})]})})),Js=e=>"Image"===e?.contentType&&e?.image?o(ae,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Zs=d((({className:e="",title:t,description:l,error:n,button:a,...i})=>c(f,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...i,children:[o("div",{className:"flex justify-center",children:Js(n)}),o(T,{title:t,description:l,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ve,{version:a?.version,text:a?.text,...a}):null]}))),eo="location";function to(e="Москва"){const[t,l]=((e,t,l)=>{const[r,s]=n(l||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,i((l=>e.fire(t,l)),[e,t])]})(me,"location",no()??{name:e}),r=i((e=>{ao(e),l(e)}),[]),{data:s}=fn(lo()?null:"/api/v1/region",bt);return a((()=>{s&&!lo()&&l(s)}),[s]),[t??{name:e},r]}const lo=()=>Boolean(globalThis.localStorage?.getItem(eo)),no=()=>{try{const e=globalThis.localStorage?.getItem(eo);return e&&JSON.parse(e)}catch(e){return null}},ao=e=>{try{globalThis.localStorage?.setItem(eo,JSON.stringify(e))}catch(e){}};var io;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(io||(io={}));const ro=new Intl.NumberFormat("ru",{style:"currency",currency:io.RUB}),so=e=>e?ro.format(e):"",oo="text-m font-light text-secondary-text ",co=`${oo} text-left`,mo=`${oo} pl-5xl text-center`,ho=`${oo} pl-5xl text-right`,uo={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},po=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:co,children:o(Le,{size:"text-m",children:"Валюта"})}),o("th",{className:mo,children:o(Le,{size:"text-m",children:"Купить"})}),o("th",{className:ho,children:o(Le,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(go)})]}))),go=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ae,{image:{icon:uo[t]},width:"24",height:"24"}):null,o(Le,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Le,{size:"text-h6",children:so(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Le,{size:"text-h6",children:so(e?.buyExchangeRate)})})]},t)},xo={icon:"GpsIcon"},fo=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Ni,{...xo,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(S,{size:"text-l",color:"text-primary-main",children:t}):null,o(S,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),bo=(e,t,l)=>{const n=Number(yo(e))*Math.pow(t,l?-1:1);return Number.isInteger(n)?n:((e,t=2)=>{const l=10**t;return Math.round(parseFloat(String(e))*l)/l})(n)},yo=e=>e.replace(/[^\d.,]/g,"").replace(",","."),vo=e=>Ot([[e=>e.value!==io.RUB&&e.oppositeValue!==io.RUB,()=>e.handleConvert(e.value,io.RUB)],[e=>e.value===io.RUB&&e.oppositeValue===io.RUB,()=>e.handleConvert(e.value,io.USD)],[e=>e.value===io.RUB&&e.oppositeValue===io.RUB,()=>e.handleConvert(e.value,io.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function No(e){const{placeholder:t,rates:l,selected:n,value:a,setValue:i,setSelected:r}=e,s=l.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:n,text:n};return c("div",{className:"relative flex",children:[o(gl,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:i}),s.length?o(kl,{isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const wo=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:l,button:a})=>{const[r,s]=n({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||io.RUB,selectBuy:l?.[0]?.currency?.currency||io.USD}),d=i((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&l?c("div",{className:"grid gap-m",children:[No({placeholder:"Хочу продать",rates:l,selected:r.selectSell,setSelected:ko(r,d,l),value:r.inputSell,setValue:e=>Co(d,l)(e,r.selectSell,r.selectBuy)}),No({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:So(r,d,t),value:r.inputBuy,setValue:e=>To(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(ve,{text:a.text,version:a?.version,...a}):null]})})),ko=(e,t,l)=>n=>{t({selectSell:n}),vo({value:n,oppositeValue:e.selectBuy,handleConvert:(n=e.selectSell,a=e.selectBuy)=>{Co(t,l)(e.inputSell,n,a)}})},So=(e,t,l)=>n=>{t({selectBuy:n}),vo({value:n,oppositeValue:e.selectSell,handleConvert:(n=e.selectBuy,a=e.selectSell)=>To(t,l)(e.inputBuy,n,a)})},Co=(e,t)=>(l,n,a)=>{e({inputSell:yo(l),selectBuy:a});const i=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===n))?.buyExchangeRate;i&&e({inputBuy:String(bo(l,i,n===io.RUB)||"")})},To=(e,t)=>(l,n,a)=>{e({inputBuy:yo(l),selectSell:a});const i=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===n))?.saleExchangeRate;i&&e({inputSell:String(bo(l,i,n===io.RUB)||"")})};const Io=d((({className:e="",title:t="Курсы обмена валют",button:l,...n})=>{const[a]=to(),i=function(e){const t=e?.code||"000",{data:l}=fn(`/api/v1/exchangerates?regionCode=${t}`,bt);return l||{}}(a),r=Bo(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:io.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:io.RUB}}),o(f,{className:u("box-border min-h-80",e),...n,children:o(Ce,{className:"h-full",title:o(k,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[r?o(po,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(fo,{address:i?.address})]}),o(wo,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:l})]})})})})),Bo=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Po=d((({className:e="",items:t})=>{const l=pe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Mo(l))})})),Mo=e=>({dataFooter:t,...l},n)=>{const{text:a,href:i,target:r,onClick:s}=e(l);return a?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:i,target:r||"_self",onClick:s,...ge(t),children:a||null})},String(n)):null},Ro=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),Vo=["all","footer"],zo=d((({className:e,navigationItems:t})=>{const l=pe();return o("div",{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2",e),children:t?.filter(Ro(Vo)).map(l).map(Do)})})),Do=(e,t)=>{const{text:l,items:n=[],href:a,target:i="_self",onClick:r,dataFooter:s}=e,d=n.filter(Ro(Vo));return c("div",{role:"menuitem",className:"flex flex-col gap-s w-full @md:w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:i,onClick:r,...ge(s),children:l}),d?o(Po,{items:d}):null]},String(t))},_o=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Ao)}):null)),Ao=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Le,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map($o)})]},String(t)),$o=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:jo(e.type,e.text)}),o(S,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),jo=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Lo(t)}`,children:o(Le,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(S,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Lo=e=>e.replaceAll(/\D/g,""),Oo=d((({className:e="",index:t,text:l,...n})=>{const a=pe(),{href:i,target:r,onClick:s}=a(n);return o("a",{className:u("text-secondary-text",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),Eo=d((({className:e="",title:t,links:l})=>o("div",{className:e,children:l?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Le,{size:"text-l",font:"font-normal",children:t})}),l.map(((e,t)=>o(Oo,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Fo="w-full lg:w-52",Uo={width:"40",height:"45"},Wo={"bg-white":"color",transparent:"white"},Ho={"bg-white":"text-primary-main",transparent:"text-white"},Ko=(e,t,l)=>o(ae,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Wo[e]},className:Ho[e],width:l?.width,height:l?.height}),qo={"bg-white":"text-primary-text",transparent:"text-white"},Xo=d((({className:e,href:t="/",logo:l,children:n,targetBlank:a,bgColor:i="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:l?.href??t,target:a?"_blank":"_self","aria-label":l?.title??"Россельхозбанк",...ge(s),children:[Ko(i,l?.image,Uo),r?n??o("div",{className:"ml-s",children:o(Le,{font:"font-medium",color:qo[i],size:"",children:l?.title??"Россельхозбанк"})}):null]})));function Yo(e,t,l=300){a((()=>{const t=globalThis.setTimeout(e,l);return()=>{globalThis.clearTimeout(t)}}),t)}const Go=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:l,s1Matches:n,s2Matches:a}=function(e,t){const l=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),n=Array.from({length:e.length}),a=Array.from({length:t.length});let i=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-l),o=Math.min(r+l,t.length-1);for(let l=s;l<=o;l++)n[r]||a[l]||e[r]!==t[l]||(i++,n[r]=!0,a[l]=!0)}return{m:i,s1Matches:n,s2Matches:a}}(e,t);if(0===l)return 0;const i=function(e,t,{s1Matches:l,s2Matches:n}){let a=0;for(let i=0,r=0;i<e.length;i++){if(!l[i])continue;let s=r;for(;s<t.length;s++)if(n[s]){r=s+1;break}e[i]!==t[s]&&a++}return a}(e,t,{s1Matches:n,s2Matches:a}),r=(l/e.length+l/t.length+(l-i/2)/l)/3,s=r>.7?.1*function(e,t){let l=0;for(;e[l]===t[l]&&l<4;)l++;return l}(e,t):0;return r+s*(1-r)};const Qo=(e,t)=>(l,n)=>{for(const[a,i]of n)l.set(a,e(l.get(a)||t,i));return l},Jo=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Zo=e=>t=>e.map((([e,l])=>[Go(t)(e),l])).filter((([e])=>e>=.8)).map((([e,t])=>tc(t,e))).reduce(Qo(Math.max,0),new Map),ec=e=>t=>{return di(t,t.map((({title:e})=>e)).map((e=>t=>{const l=Jo(t||"");return l.length?De(e.map((e=>Oa(l.map(Go(e)))))):0})(e))).sort((n=([,e])=>e,l=(e,t)=>n(e)-n(t),(e,t)=>-l(e,t))).map((([e])=>e));var l,n},tc=(e,t)=>new Map(e.map((e=>[e,t]))),lc=({basePathList:e,initialQuery:t=""})=>{const[l,i]=n(t||"");a((()=>{null!=t&&i(t)}),[t]);const{data:r}=fn(e?.length?e:null,nc),[s,o]=n(null);return Yo((()=>{r&&o(r.map((e=>t=>{const{corpus:l,dictionary:n}=t||{};if(!(e&&l?.length&&n&&Object.keys(n).length))return[];const a=Jo(e);if(!a.length)return[];const i=Object.entries(n),r=[...a.map(Zo(i)).reduce(Qo(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>l[e]));return ec(a)(r)})(l)))}),[r,l]),[s,{value:l,onChange:i}]},nc=async(...e)=>(await Promise.allSettled(e.map((e=>ft(O(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),ac=d((({initialQuery:e,navigationItems:t})=>{const l=r((()=>t?.map((e=>e.href||"/"))),[t]),[n,a]=lc({basePathList:l,initialQuery:e}),i=r((()=>ic(t)(n)),[t,n]);return o(Zt,{head:o(Ks,{autoFocus:!0,...a}),children:o(zo,{navigationItems:i})})})),ic=e=>t=>e?.length&&t?.length?di(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:O("/",t)})))}))):[],rc=(e={})=>{const{open:t,close:l}=he();return{open:(l={},n={})=>t(o(ac,{...e,...l}),n),close:l}},sc=d((({className:e,search:t,...l})=>{const[a,r]=n(""),s=i((()=>r("")),[]),d=rc(l),m=i((e=>{r(e),oc(e)&&d.open({initialQuery:e},{onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(Ks,{value:a,placeholder:t?.placeholder,onChange:m}),o(Jt,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),oc=e=>e&&e.length>=3,cc=(e,t)=>{const{logo:l}=e??{},{dataHeader:n,dataFooter:a,...i}=l??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(Xo,{className:Fo,logo:i,data:a}),o(sc,{className:"grow",navigationItems:t,...e})]})},dc=d((({className:e="",index:t,...l})=>{const n=pe(),{href:a,target:i,text:r,onClick:s}=n(l);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:a,target:i,onClick:s,children:r||`Документ ${t}`})})),mc=d((({className:e="",links:t,license:l})=>c("div",{className:u("@container space-y-lg",e),children:[l?o("div",{children:o(Le,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${l}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(dc,{index:t,...e},String(t))))}):null]}))),hc=St((({className:e,footer:t,...l})=>{const{navigationItems:n}=l.options?.page?.navigation??{},a=l.options?.page?.common??{},{documents:i,relatedEnterprises:r,contacts:s,mediaLinks:d=[],horizontalNavigationTitle:m,feedbackButton:h,license:p,otherLinks:g=[]}=t??{};return c(f,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...l,children:[cc(a,n),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(zo,{navigationItems:n}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(Fo,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(_o,{items:s}),h?o(ve,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(vs,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),g.map(((e,t)=>o(ve,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Eo,{title:m,links:r}),o(mc,{links:i,license:p})]})})),uc=d((({className:e="",title:t,description:l,calendar:n,...a})=>c(f,{className:u("space-y-m",e),defaultPadding:"p-6xl",...a,children:[o(T,{title:t,description:l,headlineVersion:"M",isEmbedded:!0}),n?pc(n):null]}))),pc=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),l=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return c("div",{className:"w-full flex flex-col justify-center gap-s",children:[o("div",{className:"flex w-full text-h6 text-center",children:l.map((e=>gc(e,t)))}),o("div",{className:"flex gap-s w-full",children:l.map(((e,t)=>c("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[o("div",{className:"flex gap-s",children:xc(e)}),c("div",{className:"text-s",children:[o(Le,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(Le,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},gc=(e,t)=>e.month?.map(((e,l)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${l}`))),xc=e=>e.month?.map((e=>e.image?.src?o("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:o(ae,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),fc=St((({className:e,title:t,button:l,regionSource:a,data:i,...r})=>{const[s,d]=n({key:""}),m=a?.regions??[],h=de({className:"text-white",version:l?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,g=l?.text?l.text:"Перейти";return o(f,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(k,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Gl,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(ve,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:fs(i,s?.key),children:g})}):null]})})}));function bc(e=[]){const t=z(),l=Array.from(e.entries()).filter((([,e])=>yc(t)(e)));return l.find((([,e])=>yc(t,!0)(e)))??l[l.length-1]??[]}const yc=(e,t=!1)=>({href:l})=>{if(!l)return!1;const n=L(vc(e)(l));return t?n===L(l):n.startsWith(L(l))},vc=e=>t=>{const l=J(Q.SITE_URL);return A(t)?e.href:O(l,e.pathname)},Nc=d((({className:e="",items:t,activeItem:l,ariaLabel:n})=>{const[r,{setFalse:d,toggle:m}]=hl(!1),h=yl(d),p=s(null),g=i((({isOpened:e,buttonRef:t,menuRef:l})=>{if(e&&t.current&&l.current){const e=l.current.getBoundingClientRect(),n=t.current.getBoundingClientRect(),a=globalThis.innerWidth-e.width;e.right>=globalThis.innerWidth?l.current.style.left=`${a}px`:n.left>e.left&&(a>n.left?l.current.style.left="":l.current.style.left=`${a}px`)}}),[r]);return bl(globalThis,"resize",(()=>g({isOpened:r,buttonRef:h,menuRef:p}))),a((()=>{g({isOpened:r,buttonRef:h,menuRef:p})}),[r]),c("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:h,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":n,onClick:m,children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),o("div",{ref:p,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",r?"":"hidden"),"aria-hidden":!r,children:t?.map(((e,t)=>o(wc,{isActive:e===l,...e},e?.text??String(t))))})]})})),wc=d((({isActive:e,...t})=>{const l=pe(),{text:n,href:a,target:i,onClick:r}=l(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",e?"text-primary-main":""),href:a,target:i,onClick:r,role:"menuitem",...ge(t?.data),children:n})})),kc={default:"w-6 h-6",large:"w-12 h-12"},Sc=d((({className:e,isRounded:t,buttonSize:l="default",isGrayBg:n=!1,disabled:a,ariaLabel:i,image:r,data:s,onClick:c,version:d})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",n?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":n&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${kc[l]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:a,"aria-label":i,onClick:c,...ge(s),children:o(ae,{image:r,className:u("h-full",t?"bg-main-divider/20 rounded-full":""),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Cc=e=>globalThis[e],Tc=(e,t)=>{const l=document.getElementById(t);if(l){const t=Cc(e);return t?Promise.resolve(t):new Promise((t=>{l.addEventListener("load",(()=>{t(Cc(e))}))}))}return new Promise(((l,n)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{l(Cc(e))})),a.addEventListener("error",(e=>{n(e)})),document.head.appendChild(a)}))};const Ic="chatbot",Bc="text-page__btn-chat",Pc={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},Mc=d((({chat:e="personal",iconVersion:t,className:l,ariaLabel:n="Чат",version:i})=>{const r=(e=>{a((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=Pc[e??""];return l=>{if(t)if("personal"!==e)Tc(Ic,t);else{const e=l.target;e?.classList.contains(Bc)||e?.classList.add(Bc),document.getElementById("webchat-js-container:webchat_rshb")||Tc(Ic,t)}}})(e);return o(Sc,{className:l,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:n,onClick:r,buttonSize:"large",isGrayBg:!0,version:i})})),Rc=d((({className:e="",active:t,dataItemName:l,children:n,data:a,...i})=>{const r=pe(),{href:s,target:d,text:m,onClick:h}=r(i);return c("a",{className:u("relative inline-block bg-transparent text-center no-underline",e),href:s,target:d,"data-item-name":l,onClick:h,...ge(a),children:[o("span",{className:Vc(t),children:m||n}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),Vc=(e=!1)=>u("font-sans text-l lg:font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),zc=d((({observerOptions:e,onVisibilityChange:t,children:l,className:n,...a})=>{const r=Na(i((e=>{if(!e.length||!t)return;const l=e[e.length-1];t(l.isIntersecting)}),[t]),e);return o("span",{ref:r,className:n,role:"menuitem",children:o(Rc,{...a,children:l})})})),Dc={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},_c=d((({version:e,text:t,mobileText:l,...n})=>{const a=fa()?l:t;return a?o(ve,{className:u("py-s px-lg font-light whitespace-nowrap",Dc["transparent"===e?"transparent":"default"]),...n,children:a}):null})),Ac=d((({subItems:e=[],version:t,internetBankButton:l,dropdownMenuAriaLabel:a,chatBotAriaLabel:i})=>{const d="transparent"===t?"white":"black",[,m]=bc(e),[h,u]=n(e.length),p=e.slice(h),g=s(null),x={rootRef:g},f=r((()=>e.map(((e,t)=>e=>{u(e?$c(t):jc(t))}))),[e]);return c("nav",{className:"mt-s flex gap-s items-center justify-between",children:[o("div",{ref:g,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg",role:"menu",children:e.map(((e,t)=>o(zc,{className:h-1<t?"invisible":"",active:e===m,observerOptions:x,onVisibilityChange:f[t],data:e.dataHeader,...e},String(t))))}),p.length?o(Nc,{items:p,activeItem:m,ariaLabel:a}):null,_.CHAT_BOT?o(Mc,{version:t,iconVersion:d,chat:_.CHAT_BOT,ariaLabel:i}):null,o(_c,{version:t,...l})]})})),$c=e=>t=>Math.max(t,e+1),jc=e=>t=>Math.min(t,e),Lc=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Le,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(Oc,{...e},String(t))))})]}):null,Oc=d((({icon:e,...t})=>{const l=pe(),{text:n,target:a,href:i,onClick:r}=l(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ae,{image:e}):null,n?o("a",{className:"hover:text-primary-hover",href:i,target:a,onClick:r,children:o(Le,{size:"text-l",font:"font-light",color:"text-primary-text",children:n})}):null]})})),Ec=(e,t)=>l=>l.name?o(bs,{href:`/branches/${l.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(l),data:fs(e,l.name),children:o(Le,{size:"text-l",font:"font-light",children:l.name})},String(l.id)):null,Fc=d((({className:e,searchTerm:t,onSearch:l})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(pl,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>l(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),Uc=d((({foreignOffices:e,branches:t})=>{const[l,a]=to(t?.default),r=pe(),{href:s}=r({href:`/branches/${l.slug}`}),[d,m]=n(""),h=Hc(Kn()).sort(((e,t)=>e.name.localeCompare(t.name))),u=((e,t)=>{const l=new Map;for(const n of e){const e=t(n),a=l.get(e)||[];l.set(e,[...a,n])}return l})(h,Wc),{close:p}=he(),g=i((e=>{a(e),p()}),[]);return c(Zt,{className:"pb-20",head:c("div",{children:[o(Le,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),l?o("div",{className:"mb-s",children:c(S,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(bs,{href:s,className:"inline mx-2xs text-primary-main",children:l.name})]})}):null,o(Fc,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:h.filter((({name:e})=>e&&Go(e.toLowerCase())(d.toLowerCase())>=.8)).map(Ec(t?.dataSelect,g))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(u.entries()).map((x=g,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Le,{size:"text-h6",children:e})}),t.map(Ec(f,x))]},e)))}),Lc(e)]});var x,f})),Wc=e=>e.name?.charAt(0)||"",Hc=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Kc=d((({className:e="",active:t,flat:l,children:n,data:a,...i})=>{const r=pe(),{href:s,target:c,text:d,onClick:m}=r(i);return o("a",{className:u(qc(t,l),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":d,...ge(a),children:o("span",{suppressHydrationWarning:!0,className:Xc(t,l),children:d||n})})})),qc=(e=!1,t=!1)=>u("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",t?"":"px-m py-xs"),Xc=(e=!1,t=!1)=>u("font-sans text-s font-light",e?"text-primary-main":u(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Yc=d((({className:e,version:t,...l})=>{const n="transparent"===t?"white":"black",[a]=to(l?.branches?.default),r=rc(l),s=(e=>{const{open:t,close:l}=he();return{open:(l={})=>t(o(Uc,{...e}),l),close:l}})(l),d=i((()=>r.open()),[r]),m=i((()=>s.open()),[s]);return c("div",{className:u("flex items-center ml-5 md:max-w-[300px] xl:max-w-full gap-lg",e),role:"navigation",children:[l?.branches?.visible?o(Kc,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:a?.name,data:fs(l?.branches?.dataClick,a?.name??""),onClick:m}):null,l?.officesAtms?.href?o(Kc,{className:"whitespace-nowrap",flat:!0,...l.officesAtms}):null,o(Sc,{image:{icon:"LoupeIcon",iconVersion:n},ariaLabel:l?.search?.ariaLabel??"Поиск",onClick:d,data:l?.search?.data})]})})),Gc=d((({observerOptions:e,onVisibilityChange:t,children:l,className:n,...a})=>{const r=Na(i((e=>{if(!e.length||!t)return;const l=e[e.length-1];t(l.isIntersecting)}),[t]),e);return o("span",{ref:r,className:n,role:"menuitem",children:o(Kc,{...a,children:l})})})),Qc=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:l,version:a,headerData:i,search:d,bgColor:m,logo:h})=>{const[u,p]=n(e.length),g=e.slice(u),x=s(null),f={rootRef:x},b=r((()=>e.map(((e,t)=>e=>{p(e?Jc(t):Zc(t))}))),[e]),{dataFooter:y,dataHeader:v,...N}=h??{};return c("div",{className:"flex items-center justify-between",children:[o(Xo,{className:"mr-3xl",bgColor:m,logo:N,data:v}),o("div",{ref:x,className:"overflow-hidden min-w-[160px] pb-xs mt-xs",role:"menu",children:e.map(((e,l)=>o(Gc,{className:u-1<l?"invisible":"",active:e===t,observerOptions:f,onVisibilityChange:b[l],data:e.dataHeader,...e},String(l))))}),g.length?o(Nc,{className:"mx-xs",items:g,activeItem:t,ariaLabel:l}):null,o(Yc,{version:a,className:"ml-auto",search:d,navigationItems:e,...i})]})})),Jc=e=>t=>Math.max(t,e+1),Zc=e=>t=>Math.min(t,e),ed={"bg-white":"primary",transparent:"transparent"},td=["all","header"],ld=St((({className:e,bgColor:t="bg-white",logo:l={},version:n=ed[t],portal:a,header:i={},...r})=>{const{common:s,navigation:d}=ad(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=bc(m),{internetBankButton:g}=a||{},x=l.image?.icon||l.image?.src||l?.title?l:h;return o(f,{tag:"header",className:u("pt-m px-20",p?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:n,...r,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(Qc,{activeTopItem:p,navigationItems:m?.filter(Ro(td)),version:n,headerData:{...i,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",nd(n))}),p?.items?.length&&o(Ac,{subItems:p?.items?.filter(Ro(td)),version:n,internetBankButton:g})]})})})),nd=e=>"transparent"===e?"opacity-30":"",ad=e=>({navigation:e?.navigation??{},common:e?.common??{}}),id=(e=!1)=>e?{}:{padding:"p-0"},rd={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},sd=St((({className:e="",padding:t="p-0",gap:l="XS",isInnerPadding:n=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r,...s})=>o(f,{className:u("relative","grid grid-cols-12",rd[l],e),padding:t,version:a,isTheme:i,...s,children:V({...s,extraProps:{...id(n),className:ya(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),od=d((e=>{const{className:t,align:l,image:n,...a}=e,i=l?u("flex",Bi[l]):"";return o(f,{className:u(i,t),defaultPadding:"p-0",...a,children:o(ae,{image:n})})})),cd=(e,t=0)=>{const{itemCount:l,visibleItemCount:a}=e,[r,s]=n(t),o=i((()=>s((e=>Math.min(e+1,l-1)))),[l]),c=i((()=>s((e=>Math.max(e-1,0)))),[l]),d=a?l>a&&r<l-a:r<l-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]};function dd({dec:e,inc:t,canDec:l,canInc:n,btnClass:a,className:i=""}){return l||n?c("div",{children:[l?o(Ra,{className:u("absolute z-40",a[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!l}):null,n?o(Ra,{className:u("absolute z-40 rotate-180",a[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!n}):null]}):null}const md=d((({className:e="",cards:t=[],button:l})=>{const[a,r]=n(0),s=i((e=>r(e)),[]),d=t.length,[m,h]=cd({itemCount:d,visibleItemCount:2}),{canDec:u,canInc:p}=h,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden",children:[d?hd({activeIndex:m,cards:t,selectedCardIndex:a,onClick:s}):null,dd({...h,btnClass:["left-12","right-12"],className:"top-16"}),u?o("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,p?o("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),o(ve,{className:"w-60 text-center",version:"primary",...l,href:g})]})}));function hd({activeIndex:e,cards:t,selectedCardIndex:l,onClick:n}){const a=460*e,i=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${a}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${i}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:l,onClick:n}){return c("button",{type:"button",onClick:n,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(l?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?o(ae,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,c("div",{className:"flex gap-s",children:[e?.sum?ud("страховая сумма",e.sum):null,e?.fee?ud("страховой взнос",e.fee):null]}),pd(l)]},String(t))}({slide:e,i:t,isActive:Boolean(t===l),onClick:()=>n(t)})))})})}function ud(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(Le,{size:"text-h6",children:[tt(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(Le,{size:"text-l",color:"text-secondary-text",children:e})})]})}function pd(e){return e?o(ae,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const gd=d((({className:e="",title:t,insuranceTabs:l=[],button:a,...r})=>{const[s,d]=n(0),m=i((e=>d(e)),[]);return c(f,{className:u("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?o(k,{className:"text-center",title:t,headingType:"h3"}):null,l?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:l.map(((e,t)=>function({title:e,i:t,isActive:l,onClick:n}){return o("button",{type:"button",onClick:n,"aria-label":e,className:"box-border px-m py-s text-m font-light "+(l?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>m(t)})))}):null,o("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:xd({insuranceTabs:l,button:a})})]})})),xd=({insuranceTabs:e,button:t})=>{const l=e?.map((e=>e.cards));return l?.length?l.map(((e,l)=>o(md,{button:t,cards:e},String(l)))):null};const fd={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},bd={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},yd=d((e=>{const{className:t="",__html:l,isDotted:n,investmentZeroColumn:a,investmentColumns:i,...r}=e,s=i?[...i]:[];return a&&s.unshift(a),o(f,{className:t,defaultPadding:"p-4xl",...r,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[ii(o("div",{className:"w-px h-4 bg-gray"}))(s.map(vd)),o("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),o("div",{className:"border-t border-gray -mt-xs mx-3xl"}),o("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(kd)})]}):null,l?o("div",{className:"max-w-2xl font-light text-base",children:o($e,{__html:l,isDotted:n,itemSize:"list-s"})}):null]})})})),vd=(e,t,l)=>{const n=1===t,a=t===l.length-1;return o("div",{className:`${Nd(n,a,e.cells)}`,children:e.cells?.length?o("div",{className:"w-full "+(a?"border-4 border-green-more-dark p-1.5 min-w-72":""),children:e.cells.reverse().map(wd)}):null},`column_${t}`)},Nd=(e,t,l=[])=>[l.length?"flex-1":"flex-0",!l.length||e||t?"":"pl-s",l.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),wd=(e,t)=>{const l=e.cellSize||"XS",n=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${bd[l]} ${fd[n]} ${"XS"===l?"px-s":"px-5xl"}`,children:o(Le,{align:"text-center",children:e.text})},`cell_${t}`):null},kd=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52",children:e.title},`title_${t}`):null,Sd=["байт","Кб","Мб","Гб","Тб","Пб"],Cd=d((({icon:e,text:t,href:l,target:n,fileFormat:a,data:i,fileSize:r})=>{const s=r&&a?",":"",d=r??"",m=a?String(a):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:l,target:n,...ge(i),children:[e,t?c(Le,{size:"text-l",font:"font-light",children:[t," ",Td(d,m),o(Le,{color:"text-secondary-text",children:l&&`${d+s+m}`})]}):null]})})),Td=(e,t)=>e||t?o("span",{children:", "}):"",Id=(e,t)=>(l,n)=>{const a=H(e)("Attachment"===l?.docType?l?.attachment?.src:l?.href),i="Attachment"===l?.docType?((e,t=2)=>{if(0===e)return"";const l=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,l)).toFixed(t))} ${Sd[l]}`})(l?.attachment?.fileSize||0):l?.fileSize,r="Attachment"===l?.docType?Pd(a):l?.fileFormat;return c("div",{role:"listitem",children:[o(Cd,{text:l?.text,target:l?.target,href:a,fileFormat:r,fileSize:i,icon:Bd(t),data:l?.data}),o($e,{__html:l?.__html})]},String(n))},Bd=e=>e?o(ae,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,Pd=e=>{if(!e)return"";const t=e.lastIndexOf("."),l=new RegExp(/\/(.*)/),n=-1!==t?e.substring(t+1):"";return n.includes("/")?n.replace(l,""):n},Md=d((({href:e,__html:t,target:l})=>{const{close:n}=he(),a=z(),r=H(a)(e),s=i((()=>{n()}),[]);return c(Zt,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o($e,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ve,{text:"Я согласен",version:"primary",target:l,href:r,onClick:s}),o(Qt,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Rd=d((({text:e,href:t,target:l,__html:n})=>{if(!e&&!n)return null;const a=(e=>{const{open:t,close:l}=he();return{open:(l={})=>t(o(Md,{...e}),l),close:l}})({__html:n,href:t,target:l}),r=i((()=>a.open()),[a]);return o("button",{className:"text-primary-main",onClick:r,children:e})})),Vd={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},zd=St((({className:e="",title:t,description:l,align:n="text-center",documents:a,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=z();return c(f,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(T,{title:t,description:l,align:n,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Vd[r]),role:"list",children:a.map(Dd(d,i))}):null]})})),Dd=(e,t)=>(l,n)=>{const a=l?.docType;return""===a?null:"reportSource"in l&&l?.reportSource?.__html?_d(l,n):Id(e,t)(l,n)},_d=(e,t)=>{const l={text:e.text,target:e.target,__html:e.reportSource?.__html};return e.reportSource?.__html&&e.text?c("div",{role:"listitem",children:[o(Rd,{...l,href:Ad(e)?e?.href:e?.attachment?.src}),o($e,{__html:e?.__html})]},String(t)):null},Ad=e=>"href"in e,$d=St((({className:e,padding:t,align:l="text-left",buttons:n=[],description:a,image:i,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...g})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",b=i?.src?o(ae,{className:"hidden lg:block",image:i}):null;return o(f,{className:u("min-h-80",e),padding:"p-0",version:p,...g,children:c(Ce,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(k,{headingType:s,title:h,className:u("whitespace-pre-wrap",l)}),rightImage:b,buttons:Qe(n,{className:"flex-wrap"}),children:[a?o(Le,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o($e,{__html:r,itemSize:"list-m"}):null,o(Le,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ae,{className:"w-fit",image:d})}):null,i?.src?o(ae,{className:"lg:hidden",image:i}):null]})]})})})),jd=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Ld=(e=[],t={})=>e.filter((({content:e={}})=>hi(t,e))).length,Od=(e,t)=>e===t;const Ed=(Fd=function(...e){return(t,l)=>e.some((e=>e(t,l)))}(Od,((e=Od)=>(t,l)=>t===l||Boolean(t&&l&&t.length===l.length&&t.every(((t,n)=>e(t,l[n])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,l])=>Fd(l,t[e])))));var Fd;const Ud=[],Wd={},Hd={primary:"bg-white/30",secondary:"bg-main-divider"},Kd={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},qd=d((({count:e,version:t="secondary"})=>{const l=fa(),n=l?"bg-main-divider":Hd[t],a=Kd[t][l?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",n),role:"status",children:o(Le,{size:"text-xs",color:a,children:e})})})),Xd=({text:e,description:t,icon:l,isActive:n,type:a})=>{const i=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(n);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,role:"tab",children:[l?o(ae,{className:u("h-6 w-6 min-w-6 min-h-6",i.icon),image:{...l,iconVersion:l?.iconVersion??i.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===a?i.text:i.oldText,children:e}),o("div",{className:"animated"===a?i.desc:i.oldDesc,children:t})]})]})},Yd={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Gd={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Qd={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Jd={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Zd=d((({tag:e="div",item:t={},isActive:l=!1,type:n="default",onClick:a})=>{const i=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(i,{className:u("h-12","block flex-1","cursor-pointer",Yd[n],l?Jd[n]:Qd[n]),role:"tablist",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",l?Gd[n]:"text-secondary-text hover:text-primary-main"),children:[Xd({text:r,description:s,icon:d,isActive:l,type:n}),Number.isInteger(m)?o("div",{className:"ml-xs",children:o(qd,{count:m,version:jd(l,n)})}):null]})})})),em=d((e=>o(e?.item?.href?tm:lm,{...e}))),tm=d((e=>{const t=pe(),l=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:n,...a}=t({...e.item,onClick:l});return o(Zd,{...e,tag:"a",item:a,onClick:n})})),lm=d((({item:e={},onClick:t,...l})=>{const n=i((()=>{t&&t(e)}),[t,e]);return o(Zd,{item:e,onClick:n,...l})})),nm=(e,t,l)=>(n,a)=>o(em,{isActive:n===e,onClick:t,type:l,item:n},String(a)),am=d((({className:e,tabsType:t="default",items:l=[],activeItem:n,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel",children:l.map(nm(n,a,t))}))),im={categories:[],extraOptions:[],propertyType:[],stage:[]},rm=St((({className:e,hotFilters:t,filtrationSchema:l={},resetButton:n,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=pi(im,{block:a.block,page:a.options?.page}),g=i(((e=im)=>p(e)),[]),x=(({hotFilters:e=Ud,filtrationState:t=Wd,blocks:l=Ud,onFiltrationStateChange:n})=>{const a=r((()=>Math.max(0,e.findIndex((e=>Ed(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Ld(l,t.filter),version:jd(t===e[a])})))),[e,l,a]),o=i((t=>{n(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:g});return c(f,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(am,{...x}),o(si,{filtrationSchema:l,resetButton:n,field:m,reset:h}),o(ni,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),sm=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),om=d((({children:e})=>sm?e:null)),cm=d((({color:e="text-primary-main",position:t="absolute"})=>o("div",{className:u("flex justify-center items-center h-full w-full backdrop-blur-sm z-50",t),children:o("div",{className:u("inline-block h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),dm="/icons/MapMarkerClusterIcon.svg",mm="/icons/MapMarkerClusterYellowIcon.svg";function hm({yandexMaps:e,map:t,points:l,isLoad:n}){if(n||!l?.length)return;t.geoObjects.removeAll();const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),i=um("offices",e,a);if(l.length&&l.every((e=>"type"in e))){const n=um("workplaces",e,a),r=pm(l.filter((e=>"workplaces"===e.type)),"workplaces",e),s=pm(l.filter((e=>"offices"===e.type)),"offices",e);i.add(s),n.add(r),t.geoObjects.add(n),t.geoObjects.add(i)}else{const n=pm(l,"offices",e);i.add(n),t.geoObjects.add(i)}t.setBounds(e.util.bounds.fromPoints(l.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const um=(e,t,l)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?dm:mm,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:l,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),pm=(e,t,l)=>e.map((({coords:e,content:n})=>new l.Placemark(e,{balloonContentHeader:n?.header,balloonContentBody:n?.body,balloonContentFooter:n?.footer,hintContent:n?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?dm:mm,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),gm={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},xm={...gm,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},fm=(e,t,l)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(xm).join(" ")} ${l}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(q,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),bm=()=>function(e,t,l=!0){const[i,r]=n(void 0);return a((()=>{let n=!0;return Tc(e,t).then((e=>{n&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(n=!1,l){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,l]),i}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${_.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),ym={...gm,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},vm=d((({yandexMaps:e,direction:t="in"})=>{const l="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const l=e.current.getZoom(),n="in"===t?l+1:l-1;e.current.setZoom(n,{checkZoomRange:!0})},className:`${Object.values(ym).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(q,{name:l,width:"20",height:"16"})})})),Nm=[55.753995,37.614069],wm=d((({points:e,className:t="",zoom:l=5,isLoad:n})=>{const i=s(null),r=bm();if(a((()=>{i.current?(hm({yandexMaps:r,map:i.current,points:e,isLoad:n}),i.current.setCenter(km(e))):r?.ready((()=>{i.current||(i.current=new r.Map("map",{center:km(e),zoom:l,controls:[],suppressMapOpenBlock:!0})),hm({yandexMaps:r,map:i.current,points:e,isLoad:n})}))}),[r,e,l,n]),!r)return null;const d="z-10";return c("div",{id:"map",className:u("relative","w-full",t),children:[n?o(cm,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",d),children:[o(vm,{yandexMaps:i}),o(vm,{yandexMaps:i,direction:"out"})]}),fm(i,r,u("right-2 top-80",d))]})})),km=e=>{const t=[Cm(Sm(e,0)),Cm(Sm(e,1))];return t.every((e=>e))?t:Nm},Sm=(e,t)=>e.map((e=>e.coords?.[t])),Cm=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Tm=({__html:e,list:t})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o($e,{__html:e})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ae,{image:e.image}):null,e?.text?o(Le,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Im={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Bm="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Pm=(e,{field:t,reset:l},n)=>{const a=n?5:6,i=(e||[]).map((e=>o(rl,{text:Im[e],...t(e)},e))),[r,s]=a>0?[i.slice(0,a),i.slice(a)]:[i,[]];return o("div",{children:e?.length?o("div",{children:o(Ja,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Bm,children:r}),o(Za,{className:Bm,isUnfolded:e,children:s})]}),renderFoldButton:Mm(l,n)})}):null})},Mm=(e,t)=>({isUnfolded:l,onToggle:n})=>c("div",{className:"flex space-x-lg",children:[t?o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(q,{name:["ArrowDownIcon","ArrowUpIcon"][Number(l)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(l)],onClick:n}):null,o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Rm()})]}),Rm=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(q,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Vm=()=>{},zm=()=>[],Dm=e=>"all"===e?"block":"hidden",_m=d((({className:e,data:t=[],isLoad:l,remoteWorkplaces:a=[],renderCard:i=Vm,renderRemoteWorkplaceCard:s=Vm,filterItems:d=zm,getBalloon:m=Vm,getBalloonRemoteWorkplaces:h=Vm,initFilterState:p={},descriptionData:g,title:x})=>{const f=x?.includes("Офис"),[b,{field:y,reset:v}]=Kt(p),[N,w,k,S]=r((()=>{const e=d(t,b),l=d(a,b),n=[...e.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:m(e)}))),...l.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:h({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[e,n,l,e.length+l?.length]}),[t,a,b]),[C,T]=n("all");return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Am(x,S),g?Tm(g):null,f&&$m(t,C,T),o("div",{className:u("pb-3xl",Dm(C)),children:Pm(Object.keys(p),{field:y,reset:v},f)})]}),o("div",{className:"h-[600px]",children:o(om,{children:o(wm,{points:w,isLoad:l,className:"h-full"})})})]}),c(om,{children:[N.map(i),k.map(s)]})]})})),Am=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(k,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Le,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),$m=(e,t,l)=>{const n=jd("all"===t),a=jd("business"===t),i=(e,t,n)=>(e.currentTarget===e.target&&"business"===t&&n.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription)),l(t),n);return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(Qt,{"data-id":"all",onClick:t=>i(t,"all",e),version:n,children:"Для физических лиц"}),o(Qt,{"data-id":"business",onClick:t=>i(t,"business",e),version:a,children:"Для юридических лиц"})]})},jm={yellow:{border:"border-yellow-light",text:"text-yellow"},green:{border:"border-green-more-light",text:"text-green-dark"},gray:{border:"border-gray",text:"text-secondary-text"},red:{border:"border-error/30",text:"text-error"}},Lm=d((({className:e,children:t,color:l="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",jm[l].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ae,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Le,{size:"text-m",color:jm[l].text,children:t})]}))),Om=d((({value:e,subText:t,children:l,isPhone:n,...a})=>{const i=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[i.length,l,t].every((e=>!e))?null:Em({textItems:i,subText:t,children:l,isPhone:n,...a})})),Em=({label:e,labelSize:t="text-m",textItems:l,subColor:n,subText:a,className:i,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",i),children:[e?o(Le,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Fm(l,s),a?o(Le,{color:n,size:"text-m",children:a}):null]}),Fm=(e,t)=>e.filter(Boolean).map(((e,l)=>o(Le,{size:"text-l",children:t?o("a",{href:`tel:${Um(e)}`,children:e.trim()}):e.trim()},String(l)))),Um=e=>e.replace(/\D/g,""),Wm=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),Hm=["ArrowDownIcon","ArrowUpIcon"],Km=["Подробнее","Скрыть"],qm=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:Km[Number(e)]}),o(q,{className:"text-primary-text",name:Hm[Number(e)],width:"16",height:"16"})]}),Xm=({location:e,address:t,billAcceptorType:l,terminalType:n,billAcceptorEnable:a,atmCode:i="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Qm(n)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===l?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Le,{size:"text-h4",children:Qm(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(q,{name:"GeolocationIcon",width:"24",height:"24"}),o(Le,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Lm,{color:"green",children:Qm(s)})})]}),o("div",{className:"hidden sm:block",children:o(Wm,{className:"flex-wrap",children:m?.map(Gm)})}),o(Ja,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Za,{isUnfolded:e,children:o(Wm,{className:"flex-wrap",children:m?.map(Gm)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>qm({isUnfolded:e,onToggle:t})})]},String(d))},Ym=({address:e="",terminalType:t,atmCode:l=""})=>({header:`${Qm(t)} №${l}`,body:e.toUpperCase()}),Gm=(e,t)=>o(Om,{...e},String(t)),Qm=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Jm=[];const Zm=async e=>{const t=await ft(e,{method:"GET"});return Array.isArray(t)?t:Jm},eh={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},th={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},lh=d((({descriptionData:e,className:t})=>{const[l]=to(),n=l?.code??"000",{data:a,isLoad:i}=function(e){const{data:t,error:l}=fn(`/api/v1/atms?regionCode=${e}`,Zm);return{data:t||Jm,isLoad:!t&&!l}}(n);return o(_m,{className:t,filterItems:nh,data:a,isLoad:i,initFilterState:eh,renderCard:Xm,getBalloon:Ym,title:`Банкоматы филиала ${l?.name}`,descriptionData:e})})),nh=(e,t)=>{const l=Object.keys(t).filter((e=>t[e])),n=l.filter((e=>e.startsWith("terminalType"))),a=l.filter((e=>!n.includes(e)));return e.filter((e=>{const t=a.every((t=>th[t](e))),l=!n.length||n.some((t=>th[t](e)));return t&&l}))},ah=e=>{const t=rh(e);return o(Om,{label:"Режим работы",value:t,className:"max-w-none"})},ih=({workTime:e="",lunchHour:t="",daysOff:l=""},n=!1)=>e?[`${n?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",l?`не работает: ${l}`:""].filter(Boolean).join("; "):"",rh=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),l=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[ih({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:l?"":n}),ih({workTime:l?.workTime,lunchHour:l?.lunchHour,daysOff:n},!0)].filter(Boolean)},sh=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],oh=e=>sh.map((([t,l,n])=>({key:t,title:n,short:l,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),ch=e=>{if(!e)return null;const t=dh(e);return c(Wm,{className:"border-none",children:[o(Om,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(mh)})}),o(Om,{label:"Режим работы",className:"max-w-none",children:o(Le,{children:e})})]})},dh=e=>{const t=sh.map((([,e])=>({short:e,status:!0}))),l=e.split("/")??[],n=l[l.length-1]?.toLowerCase();return n?.includes("выходной")?t.map((e=>({...e,status:!n?.includes(e.short.toLowerCase())}))):t},mh=({short:e,status:t},l)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Le,{size:"text-xs",children:e})},String(l)),hh=({currency:e,buyExchangeRate:t,saleExchangeRate:l},n)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Om,{label:"Валюта",value:e.currency}):null,t?o(Om,{label:"Купить",value:String(t)}):null,l?o(Om,{label:"Продать",value:String(l)}):null]},String(n)),uh=(new Date).getDay(),ph=e=>{const[t]=e?.slice(uh-1)??[];if(!t)return null;const{lunchHour:l,status:n,workTime:a,hasLunch:i}=t;return n?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(Lm,{color:"green",children:a}):null,l&&i?o(Lm,{color:"yellow",children:`перерыв: ${l}`}):null]}):o(Lm,{color:"red",children:"Выходной"})},gh=({lunchHour:e,hasLunch:t=!1,status:l=!1})=>l?e&&t?`Перерыв ${e}`:e:"Не работает",xh=({title:e,status:t,workTime:l,lunchHour:n,hasLunch:a},i)=>o(Om,{label:e,value:t&&l?l:"",subText:gh({lunchHour:n,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(i)),fh=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,bh=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,yh=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,vh=({name:e,address:t,phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},h)=>{if(!d)return null;const u=oh(d);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Le,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(q,{name:"GeolocationIcon",width:"24",height:"24"}),o(Le,{size:"text-l",children:t})]}):null]}),ph(u)]}),o("div",{className:"hidden sm:block",children:Nh({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Ja,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Za,{isUnfolded:e,children:Nh({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>qm({isUnfolded:e,onToggle:t})})]},String(h))},Nh=({phone:e,fax:t,phoneBusiness:l,phoneNatural:n,phoneCallCentre:a,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const d=oh(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Wm,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Om,{label:"Факс",value:t,isPhone:!0}),o(Om,{label:"Телефон филиала",value:e,isPhone:!0}),o(Om,{label:"Для обращений юридических лиц",value:l,isPhone:!0}),o(Om,{label:"Обслуживание физических лиц",value:n,isPhone:!0}),o(Om,{label:"Для консультаций по валютному контролю",value:i,isPhone:!0}),o(Om,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(Wm,{children:o(Om,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(xh)})})}):c(Wm,{children:[o(Om,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(mh)})}),ah(d)]}),r?.businessScheduleVisibleTag?ch(r?.businessScheduleDescription):null,s?.currencies?.length?o(Wm,{className:"flex-wrap",children:s?.currencies?.map(hh)}):null]})},wh=({name:e="",address:t="",workSchedule:l})=>{const n=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const i=`${t} ${(e=>{const t=oh(e),l=e?rh(t):"",n=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?fh(l):yh(l,n):bh(l):null})(l)}`;return{header:n,body:i}},kh=({address:e,workScheduleDescription:t},l)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Le,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(q,{name:"GeolocationIcon",width:"24",height:"24"}),o(Le,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:Sh({workScheduleDescription:t})}),o(Ja,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Za,{isUnfolded:e,children:Sh({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>qm({isUnfolded:e,onToggle:t})})]},String(l)):null,Sh=({workScheduleDescription:e})=>c("div",{children:[c(Wm,{className:"flex",children:[o(Om,{label:"Операции для физических лиц",children:o(Le,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Om,{label:"Операции для физических лиц",children:o(Le,{children:"Оформление и обслуживание банковских карт"})}),o(Om,{label:"Операции для физических лиц",children:o(Le,{children:"Инвестиционное и накопительное страхование"})}),o(Om,{label:"Операции для физических лиц",children:o(Le,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Om,{label:"Режим работы",className:"max-w-none",children:o(Le,{children:e})})]}),Ch=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Th={branches:[],remoteWorkplaces:[]};const Ih=async e=>await ft(e,{method:"GET"})||Th,Bh={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Ph={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)},Mh=d((({className:e})=>{const[t]=to(),l=t?.code??"000",{data:n,isLoad:a}=function(e){const{data:t,error:l}=fn(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${e}`,Ih);return{data:t||Th,isLoad:!t&&!l}}(l);return o(_m,{className:e,filterItems:Rh,data:n?.branches,isLoad:a,remoteWorkplaces:n?.remoteWorkplaces,initFilterState:Bh,renderCard:vh,renderRemoteWorkplaceCard:kh,getBalloon:wh,getBalloonRemoteWorkplaces:Ch,title:`Офисы филиала ${t?.name}`})})),Rh=(e,t)=>{const l=Object.keys(t).filter((e=>t[e]));return e.filter((e=>l.every((t=>Ph[t](e)))))},Vh=d((({data:e,className:t,...l})=>{const n=e?.dataType??"offices";return o(f,{version:"transparent",className:u(t),defaultPadding:"p-0",...l,children:"offices"===n?o(Mh,{}):o(lh,{descriptionData:e})})})),zh=d((({className:e,title:t,description:l="Блок в разработке...",...n})=>c(f,{className:u("box-border",e),...n,children:[o(T,{className:"max-w-[600px]",title:t,description:l,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(b,{})]}))),Dh="hidden sm:flex absolute z-40 top-10",_h=St((({className:e="",padding:t,slides:l=[],...a})=>{const[i,r]=n(0),[s,d]=Ha({itemCount:l?.length||0});return c(f,{className:u("box-border overflow-hidden",e),defaultPadding:"pt-6xl",padding:t,...a,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*i}%)`},role:"list",children:l.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(st,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...a})},String(t))))}),c("div",{className:"relative pr-xs mt-m -mb-m flex gap-xs box-border",children:[o(Ca,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:l.map(Ah({activeSlideIndex:i,onClick:r}))}),d.canScrollLeft?o(Va,{className:u("left-6",Dh),onClick:d.scrollLeft}):null,d.canScrollRight?o(za,{className:u("right-6",Dh),onClick:d.scrollRight}):null]})]})})),Ah=({activeSlideIndex:e,onClick:t})=>({nav:l},n)=>{const a=n===e,i=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(n),"aria-label":l?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",i),children:[o("div",{className:r,children:l?.title}),o("div",{className:s,children:l?.description})]},String(n))},$h=d((({address:e,email:t,telephone:l,button:n,className:a="",__html:i,icon:r,title:s,version:d="primary",...m})=>c(f,{className:u("box-border text-left space-y-s",a),version:d,...m,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Ge(r)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ae,{image:r})}):null,s?o(k,{headingType:"h3",as:"h3",title:s}):null]}),c("div",{className:"w-full space-y-m",children:[i?jh(i):null,Lh({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Lh({label:"Телефон(факс)",data:l,iconName:"PhoneIcon"}),Lh({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),n?.text?Qe([n]):null]})]}))),jh=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o($e,{__html:e,itemSize:"list-s"})}),Lh=({label:e,data:t,iconName:l,dataColor:n=""})=>t?c("div",{className:"flex gap-s",children:[o(q,{iconVersion:"black",name:l,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Le,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Le,{size:"text-xl",color:n,children:t})]})]}):null,Oh=d((e=>{const{__html:t,richVersion:l="",...n}=e;return o(f,{defaultPadding:"p-0",...n,children:o($e,{__html:t,richVersion:l})})})),Eh=d((({label:e,labelIconBgVersion:t,icon:l,onToggle:n,labelIcon:a})=>o(Ya,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:n,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(Le,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:l?o(q,{name:l,iconVersion:"color",width:"24",height:"24"}):null}))),Fh=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Uh=(e=!1)=>e?"MinusIcon":"PlusIcon",Wh=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",Hh=St((({className:e="",isExpanded:t,isFoldButtonOnTop:l=!0,label:n="Развернуть",labelIcon:a,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=fa();return o(f,{className:u("w-full","border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(Ja,{isFoldButtonOnTop:l,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(Za,{className:u("gap-lg",Fh(m)),isUnfolded:e,children:V({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Kh({foldButtonVersion:r,label:n,labelIcon:a,labelIconBgVersion:i,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Kh=({foldButtonVersion:e,label:t,labelIcon:l,labelIconBgVersion:n,isUnfolded:a,onToggle:i,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?Wh(e):Uh(e))(a,r);return"accordion"===e?o(Eh,{label:s,labelIcon:l,labelIconBgVersion:n,icon:c,onToggle:i}):o(Ga,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},qh=d((({className:e=""})=>{const[t,l]=n("option2"),a=i((e=>l(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Zn,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(Zn,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),Xh=d((({data:e,fieldLabel:t,fieldValue:l,selected:n,placeholder:a="",setSelected:i,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[l||t],text:e?.[t]}))),c=s.find((e=>e.key===n));return o(kl,{options:s,label:r,placeholder:a||n,onChange:e=>i(e.key),value:c})})),Yh=d((({regions:e=[],selectedRegion:t,onSelectedRegion:l,branches:n=[],selectedBranch:a,onSelectedBranch:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Xh,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:l,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Xh,{data:n,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Gh=["От 1 дня","До 365 дней"],Qh=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Le,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Pn,{min:1,max:365,value:e,items:Gh,onChange:t})]}))),Jh=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:l,safeBoxCases:n=[],selectedBoxSize:a,onSelectedBoxSize:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Xh,{data:e,fieldLabel:"volume",selected:t,setSelected:l,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Xh,{data:n,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Zh=d((({regions:e,selectedRegion:t,branches:l,selectedBranch:n,days:a,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:h})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Yh,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:l,selectedBranch:n,onSelectedBranch:eu(m)}),o(Qh,{days:a,setDays:e=>m({days:e})}),o(Jh,{caseVolumes:d,selectedCaseVolume:i,onSelectedCaseVolume:tu(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Le,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(qh,{}),o(ve,{text:"Офисы на карте",version:"primary",onClick:h,className:"order-6"})]})]}))),eu=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},tu=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},lu=d((({days:e,tariffs:t=[]})=>{const l=au(e,t),n="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[nu("Аренда за",e),nu("Цена",l+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(S,{size:"text-s",font:"font-light",color:"text-secondary-text",children:n})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ae,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(S,{size:"text-s",font:"font-light",color:"text-white",children:n})})]})]})})),nu=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Le,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),au=(e,t)=>{const l=iu(e);return e*(t?.find((e=>e.tariffType===String(l)))?.tariffValue||0)},iu=e=>{let t=1;switch(!0){case e>30&&e<=90:t=2;break;case e>90&&e<=180:t=3;break;case e>180&&e<=365:t=4}return t},ru=(e,t)=>e.find((e=>e.branchCode===t)),su=d((e=>{const{regions:t,data:l,branches:n,onChange:i,onClick:r}=e;a((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[l.selectedRegion,i]);const s=ru(n,l.selectedBranch),d=ou(s?.safeBoxCaseVolumes),m=cu(s?.safeBoxCaseVolumes,l.selectedCaseVolume)?.safeBoxCases,h=du(m,l.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Zh,{...l,regions:t,onClick:r,branches:n,caseVolumes:d,safeBoxCases:m,onChange:i}),o(lu,{days:l.days,tariffs:h})]})})),ou=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],cu=(e,t)=>e?.find((e=>e.volume===t)),du=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,mu=[];const hu=async e=>await ft(e,{method:"GET"})||mu,uu=d((({title:e,footnote:t,className:l="",...a})=>{const[r,s]=n(!1),d=i((()=>s((e=>!e))),[]),[m,h]=n({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),u=Kn(),p=pu(m.selectedRegion,u),g=function(e){const{data:t}=fn(e?`/api/v1/safeboxes?regionCode=${e}`:null,hu);return t||mu}(p),x=i((e=>h((t=>({...t,...e})))),[h]),b=(y=ru(g,m.selectedBranch)||g,Array.isArray(y)?y.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):y?.gpsLatitude&&y?.gpsLongitude?[{coords:[y.gpsLatitude,y.gpsLongitude]}]:[]);var y;return c(f,{className:l,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(k,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(su,{regions:u,branches:g,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(S,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&r?o(wm,{points:b,className:"h-[640px]"}):null]})})),pu=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,gu=e=>e<4?"w-72":"w-52",xu={description:"text-white/80 text-l font-light group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconText:"text-white group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconBackground:"bg-white/30 group-data-primary:bg-main-divider",iconConnector:"bg-white group-data-primary:bg-secondary-light",dot:"bg-white/80 group-data-primary:bg-secondary-text"},fu=d((({buttons:e,className:t="",description:l,showLines:n=!0,size:a="normal",steps:i=[],stepVersion:r="gray",title:s,version:d="primary",...m})=>{const h=i.length,p=h>3,g=xu,x=(e=>e?"":"opacity-0")(n),b=fa(),y=h<4?"px-24":"px-16",v=h<4?"px-28":"px-20";return c(f,{className:u("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:d,...m,children:[o(T,{headlineVersion:"S",title:s,description:l,isEmbedded:!0,className:"w-full",align:yi(b)}),i?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:u("flex items-center","normal"===a?y:v),children:ii(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",x)}))(i.map(bu(g,a,r)))}),o("div",{className:u("flex justify-between",p?"gap-x-s":"gap-x-20"),children:i.map((N={styleMap:g,version:d},(e,t,l)=>{const{styleMap:n,version:a}=N,{label:i,description:r,button:s,isDotted:d}=e;return c("div",{className:u("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",gu(l.length)),children:[c("div",{className:"space-y-xs",children:[i?o(Le,{size:"text-h6",align:"text-center",children:i}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[r?o("div",{className:n.description,children:r}):null,o($e,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ve,{className:"box-border py-s w-full max-w-60 mt-auto",version:a,...s,children:s?.text}):null]},String(t))}))})]}):null,Qe(e)]});var N})),bu=(e,t,l)=>({icon:n},a)=>{const i="secondary"===l?"white":"color";return o(f,{defaultPadding:"",className:`${yu(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:l,children:Ge(n)?o(ae,{image:{...n,iconVersion:n?.iconVersion||i},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===l?e.iconText:(r=l,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:a+1})},String(a));var r},yu=e=>"normal"===e?"h-24 w-24":"h-16 w-16",vu=d((()=>o("div",{className:"hidden",role:"none"}))),Nu="hidden sm:flex absolute z-40",wu={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},ku=d((({className:e,items:t=[],activeItem:l,onChange:n,tabsType:i="default"})=>{const[r,s]=Ha({itemCount:t?.length||0});return a((()=>Su(r.current,t,l)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Ca,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:wu[i].item,gap:wu[i].gap,children:t.map(nm(l,n,i))}),s.canScrollLeft?o(Va,{className:u("left-6",Nu,wu[i].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(za,{className:u("right-6",Nu,wu[i].buttonTop),onClick:s.scrollRight}):null]})})),Su=(e,t,l)=>{const n=t.findIndex((e=>e===l));e&&n>0&&e.scrollTo({left:e?.children[n]?.offsetLeft,behavior:"smooth"})},Cu={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},Tu=({className:e="",tabsType:t="animated",...l})=>t?o("div",{className:u(Cu[t].wrapper,e),children:o(ku,{className:Cu[t].component,tabsType:t,...l})}):null,Iu=St((({className:e="",tabs:t=[],block:l,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=Bu(l??{}),p=z(),g=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?l?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:b}=p,[y,v]=n(Ru(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[y],w=x.findIndex((e=>Boolean(e.selected)));a((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[b,w,h]);const k=Mu(x[y],y),S=i((e=>{const t=x.indexOf(e),l=x[t];v(t),"group"===l.type&&((e,t)=>{const l=new URLSearchParams(p.query);e.text?l.set(h,e?.tabName??String(t)):l.delete(h),p.replace(`${p.pathname}?${l}`,"",{scroll:!1})})(e,t)}),[x]);return c(f,{className:u({"sticky top-1 z-20":d&&g},e),defaultPadding:"p-0",block:l,...m,children:[Tu({className:u({"pb-1":Boolean(l?.slots)&&"default"===r,"sticky top-1 z-20":d&&!g}),items:Pu(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(l?.slots??{}).map((([e,t])=>R(t,{...m?.options,slotName:k,parent:l,extraProps:{className:e===k?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Mu)?.filter(Boolean)||[]}),Bu=({__id:e,anchor:t})=>t??e??"tabs",Pu=(e,t)=>t?.length?t:e,Mu=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Ru=(e,t)=>t?Number(t):e.reduce(((e,t,l)=>t.selected?l:e),0),Vu={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},zu=d((({children:e,activeIndex:t,columnWidth:l,version:n="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Vu[n],style:{transform:`translateX(-${t*l}px)`},children:e})}))),Du=d((({className:e="",isOpen:t,onClick:l})=>o(ve,{className:e,appendRight:o(ae,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:l}))),_u={Buttons:({buttons:e})=>Qe(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ae,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o($e,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Le,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Le,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:l,pdfUrl:n,isOpen:a})=>e?o(Du,{isOpen:a,onClick:()=>{t({tableSource:l,pdfUrl:n})}}):null},Au=d((({cell:e,fieldIdx:t,rowIdx:l,cellIdx:i,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=n(!0);a((()=>{i===o&&s||m(!0)}),[s,o]);return $u({cell:e,cellProps:{rowIdx:l,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),$u=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:l,...n}=e;if(!l||!(l in _u))return null;return o(_u[l],{...t,...n})},ju=d((({cells:e,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(Au,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),Lu=(e,t)=>140*De(e.slice(0,t).map((e=>e?.cols?.length??1))),Ou=(e,t)=>e?.length>0?o("div",{className:u("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Le,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Eu=d((({rows:e})=>{const t=e?.[0]?.length??0,[l,n]=cd({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((a=l,(e,t)=>{if(!e?.length)return null;const[l,...n]=e,i=u("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[l?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Le,{size:"text-xl",font:"font-light",children:l.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${Lu(n,a)}px)`},children:n?.map(((e,t)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Le,{size:"text-xl",children:e.data}):null,e?.cols?Ou(e.cols,a):null]},`row${t}`)))})})]},String(t))})),dd({...n,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var a})),Fu=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,l)=>{const n=`activeTabIdx:${e}-tableIdx:${l}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(Le,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(Eu,{rows:t.rowsData})})})]},n)}))}))),Uu=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Wu=d((({currencies:e,linkToPDF:t,activeTabIndex:l,setActiveTabIndex:n})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",t===l?"bg-primary-main":""),onClick:()=>n(t),children:o(Le,{size:"text-xl",font:"font-light",color:Uu(t===l),children:e||t+1})},e)))}):null,t?o(ve,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(q,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Hu=St((({tableSource:e,pdfUrl:t,onClick:l})=>{const a=e?.tableData,[r,s]=n(0),d=i((e=>s(e)),[]),m=a?.[r]?.items??[],h=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(Wu,{currencies:h,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Fu,{activeTabIndex:r,items:m}),o(Du,{className:"mt-xl",onClick:l,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Le,{size:"text-h6",children:"Данных нет"}),o(Du,{onClick:l,isOpen:!0})]})})),Ku=d((({children:e,tableInner:t,onHideContentClick:l})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Hu,{...t,onClick:l})}):null]}))),qu=d((({row:{header:e,data:t},activeIndex:l,rowIdx:a,...r})=>{const[s,d]=n(void 0),m=i((e=>d(e)),[]),[h,p]=n(void 0),g=i((e=>p(e)),[]);return c(Ku,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ae,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Le,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(zu,{activeIndex:l,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(ju,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),Xu=d((({children:e,controls:t})=>{const{isScrollAvailable:l}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,dd({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),l?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Yu=d((({className:e="",title:t,description:l,rowHeaders:n,tariffsColumns:a,hiddenRowsNum:i=0,...r})=>{const s=a?.map((({data:e})=>e))||[],d=n?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,p]=cd({itemCount:m,visibleItemCount:2}),g=(d||[]).map(((e,t)=>o(qu,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[x,b]=i>0?[g.slice(0,-i),g.slice(-i)]:[g,[]];return c(f,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(T,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:i>0?o(Ja,{renderFoldableSection:({isUnfolded:e})=>c(Xu,{controls:p,children:[x,o(Za,{isUnfolded:e,children:b})]}),renderFoldButton:Qa}):o(Xu,{controls:p,children:g})})]})})),Gu=d((({className:e="",title:t,description:l,iconVersion:n,__html:a,...i})=>c(f,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...i,children:["small"===n?Qu():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Le,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,l?Ju(l):null,a?o($e,{__html:a}):null]})]}))),Qu=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),Ju=e=>o(S,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Zu=d((({prefix:e,unit:t,suffix:l})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Le,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,l?o("div",{className:"gradient-color-text",children:o(Le,{size:"text-h2",children:l})}):null]}))),ep=d((e=>{const{prefix:t,unit:l,suffix:n,...a}=e;return o(f,{defaultPadding:"p-0",...a,children:o(Zu,{prefix:t,unit:l,suffix:n})})})),tp=St((({className:e="",padding:t="p-0",gap:l="",isInnerPadding:n=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...c})=>{const d=z();return o(f,{className:u("relative flex flex-col",rd[l],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Z(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:i,...c,children:V({...c,extraProps:{className:u("w-full",ya(r)),...id(n)}})})}),{childrenTypes:[]}),lp=e=>(e=>{const t="col-span-",l=e?.split(/\s+/).find((e=>e.startsWith(t)));return l?parseInt(l.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",np=d((({className:e,title:t,url:l,previewImg:n,...a})=>{const i=z();return c(f,{className:e,defaultPadding:lp(e),...a,children:[o(T,{title:t,headlineVersion:"M"}),l?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:H(i)(n?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:H(i)(l)})}):null]})})),ap={AdTile:Tt,ApplicationForm:ha,BankAccountFiltration:fi,BenefitsBlock:wi,BonusBenefitsBlock:Ii,ButtonsBlock:Pi,CalculatorBonus:Hi,CalculatorBusinessDeposit:dr,CalculatorCredit:Cr,CalculatorDeposit:$r,CalculatorRefinancing:Kr,CardTransfer:Zr,Carousel:ss,CarouselCard:ds,CarouselCatalogCard:hs,CarouselLinks:gs,CarouselRecommendationCard:ks,CarouselTariffsCard:Ts,ContactsBlock:Bs,DepositFiltration:_s,Depository:Qs,ErrorBlock:Zs,ExchangeRateTile:Io,Footer:hc,GracePeriod:uc,GrantSupport:fc,Header:ld,Headline:T,HorizontalLayout:sd,ImgBlock:od,InsuranceAmountBlock:gd,InvestmentInfo:yd,LinkDocs:zd,MobileAppTile:$d,MortgageFiltration:rm,OfficesAtmsMap:Vh,Placeholder:zh,ProductBlock:Ct,ProductGallery:_h,RepresentativeOfficeInfo:$h,RichTextBlock:Oh,RollupItem:Hh,SafeDepositRental:uu,StepsBlock:fu,StickyBottomMenu:vu,TabsLayout:Iu,TariffsTable:Yu,TextBlock:Gu,UnitBlock:ep,VerticalLayout:tp,Video:np},ip=ue((()=>{a((()=>{$t()}),[]);const e=Ht();bl(globalThis,"click",(e=>t=>{const l=t.target?.closest("[data-aspects]");try{const n=JSON.parse(l?.dataset?.aspects??"[]");_t({aspectsAttributes:n,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),rp="cookie",sp=d((({__html:e})=>{const[t,{setTrue:l,setFalse:n}]=hl();Yo((()=>{globalThis.localStorage?.getItem(rp)||l()}),[],3e3);const a=i((()=>{globalThis.localStorage?.setItem(rp,"true"),n()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o($e,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Jt,{className:"bg-main-gray rounded-md w-11 h-11",onClose:a})})]})}):null}));function op(e){throw new Error(e)}const cp=({onCloseAll:e,onClose:t}={})=>{const[l,{push:r,pop:s,clear:o}]=function(e=[]){const[t,l]=n(e),a=i((e=>l((t=>[...t,e]))),[]),r=i((()=>l((e=>e.slice(0,-1)))),[]),s=i((e=>l((t=>t.filter((t=>t!==e))))),[]),o=i((()=>l([])),[]);return[t,{setList:l,push:a,pop:r,remove:s,clear:o}]}(),c=i((()=>{e&&e(l),o()}),[l,e]),d=i((()=>{t&&t(l[l.length-1]),s()}),[l,t]);return a((()=>me.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:op(e)}}))),[c,d]),l},dp=d((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),l=cp({onCloseAll:e,onClose:t}),{close:n}=he(),r=i((({key:e})=>{"Escape"===e&&n()}),[]);return bl(globalThis.document,"keydown",r),a((()=>{l.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[l]),l.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:l.map((({dialog:e,id:t},n)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",n===l.length-1?"":"hidden"),children:e},String(t||n))))}):null})),mp=d((()=>{const[e,t]=n(null),l=i((()=>{t(null)}),[]);a((()=>me.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":l();break;default:op(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&l()}),[l]);return bl(globalThis.document,"keydown",r),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),hp="header",up="footer",pp="sticky-footer",gp={},xp=d((({className:e,data:t=gp,blocksRegistry:l,blockDecorator:n})=>{const{slots:a,blocks:i,fallback:r,...s}=t,d=kt(s,r);ip();const m={key:"",page:{slots:a,blocks:i,fallback:r,...d},blocksRegistry:l,blockDecorator:n,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:R(a?.header,{...m,slotName:hp})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[V({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),R(a?.footer,{...m,slotName:up})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(a?.["sticky-footer"],{...m,slotName:pp})}):null,o(dp,{}),o(mp,{}),o(sp,{__html:d?.cookieContent?.__html})]})}));Object.assign(xp,{childrenTypes:[],slots:()=>[hp,up,pp]});e.Blocks=ap,e.ContentPage=xp,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),l=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await l.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.handlerDecorator=ue,e.joinList=ii,e.packageVersion="0.14.527",e.projectSettings=_,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=F,e.useRouter=z,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";let t;const l=e=>(...l)=>t[e](...l),n=l("useState"),a=l("useEffect"),i=l("useCallback"),r=l("useMemo"),s=l("useRef");const o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,l){const{children:n,...a}=t||{},i=l?.slots?.default,r=n||i&&i();return e(Object.assign(a,r&&{children:r}),l)}return t.inheritAttrs=!1,t},h=e=>e,u=(...e)=>e.map((e=>g(e)?p(e):e)).flatMap((e=>e)).filter(Boolean).join(" "),p=e=>Object.entries(e).filter(((e=h)=>([,t])=>e(t))()).map(((e=h)=>([t])=>e(t))()),g=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),x={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},f=d((({className:e,version:t="primary",isTheme:l=!0,defaultPadding:n="p-xl",padding:a,block:i,tag:r="section",role:s,children:c,style:d})=>{const m=t&&l;return o(r,{className:u("@container font-sans",m?"group":"",x[t],a||n,e),...m?{"data-ver":t}:{},...i?.anchor?{id:i.anchor}:{},role:s,style:d,children:c})})),b=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:y(t)}))),y=(e=3)=>N(100,e).map((e=>Math.floor(e))).map(v),v=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),N=(e,t)=>[e].concat(t>0?N(e/1.618,t-1):[]),w={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},k=d((({className:e="",headingType:t="h3",as:l="h3",title:n,children:a})=>o(l,{role:"heading",className:u("font-sans m-0",w[t],e),children:n||a}))),S=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),C={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},T=d((({className:e,version:t="",headlineVersion:l="XL",title:n,description:a,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=C[l],p={marginTop:h.descriptionStyle};return c(f,{className:u(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[n?o(k,{className:u("whitespace-pre-wrap",i),...h?.title,as:r||h?.title.as,title:n}):null,a?o(S,{size:h.descriptionSize,font:h.descriptionWeight,align:i,...p,children:a}):null]})})),I=({blockClassName:e,block:t,render:l})=>l({blockClassName:e,block:t}),B=[];function P(e,t,{className:l,...n}={}){const{key:a,blockDecorator:i=I,blocksRegistry:r={},ancestors:s=B}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return i({blockClassName:u(e.style?.length?e.style:"col-span-12",l),block:e,ancestors:s,render:({block:l,blockClassName:i})=>{const{content:r}=l;return d?o(d,{className:i,block:e,options:t,...r,...n},a):null}},a)}const M=[],R=(e,{key:t,ancestors:l=M,slotName:n=null,extraProps:a,renderProps:i=P,...r})=>{const s=a?(e,t)=>P(e,t,a):i;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...l||M,[r.parent,n]]:l},a)))};function V({block:e,options:t,children:l,extraProps:n,renderProps:a}){return l||(e&&t?R(e.blocks,{...t,parent:e,extraProps:n,renderProps:a}):null)}function z(){return z._impl()}z._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),z.setup=e=>{z._impl=e};const D=["CDN","BASE_PATH"],_=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const l=e._[t]||e[t];return D.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(l):l}}),A=e=>Boolean(e?.includes(":")),$=(e,t)=>Boolean(e&&!A(e)&&(!t||"_self"===t)),j=e=>Boolean(e?.startsWith("#")),L=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),O=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),E=(e,t)=>Boolean(t&&e&&e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var F=Object.freeze({__proto__:null,isURL:A,isLocalURL:$,isHash:j,withoutQuery:L,joinPath:O,hasPrefix:E});const U="/api/",W=`${U}v1/storage`,H=e=>(t,l)=>{if([!t,A(t),j(t),[_.CDN,U].some((e=>E(t,e)))].some(Boolean))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${W}/${t}/attachment`;const n=t?.startsWith("/");return O(E(t,l)?"":l,n?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},K={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},q=d((({className:e="",imageClassName:t="",name:l="",alt:n=`Иконка ${l}`,title:a=n,iconVersion:i="color",width:r,height:s})=>{const d=z(),m="normal"===i?`${l}.svg`:`sprites.svg#${l}`,h=H(d)(O(_.CDN,"/icons/",m));return"normal"===i?o("img",{className:e,src:h,alt:n,title:a,"aria-hidden":"true",width:r,height:s,style:X(e,s)}):o(G,{className:e,children:c("svg",{className:u(Y(r),K[i],"white"===i?"invert":"",t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,n?o("desc",{children:n}):null,o("use",{href:h,xlinkHref:h})]})})})),X=(e,t)=>{return e?.includes("h-")?{}:{height:(l=t,l&&!/\D/.test(l)?`${t}px`:t),width:"auto"};var l},Y=e=>e?"":"w-full h-full",G=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),Q=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function J(e=""){try{const[,...t]=new URL(e).pathname.split("/");return`/${t.filter(Boolean).join("/")}`}catch(e){return""}}const Z=e=>t=>{const l=t?.startsWith("/wcms-resources")?"":J(Q.SITE_URL);return t&&!A(t)?H(e)(t,l):t},ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:l=""})=>{const n=z();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:l,media:a},i)=>o("source",{srcSet:Z(n)(e),type:ne(l),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${i}_${e}`))):null,t?.src?le({...t,src:Z(n)(t.src)},l):null]})})),le=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),ne=e=>e?`image/${String(e)}`:void 0,ae=d((({className:e="",image:t,imageClassName:l="",...n})=>t?.src||t?.icon?t.icon?o(q,{className:e,imageClassName:l,iconVersion:t?.iconVersion,name:t.icon,...n}):o(te,{className:e,imageClassName:l,image:t}):null)),ie={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},re="bg-main-divider text-main-disabled",se={primary:re,secondary:re,white:re,link:"",transparent:"",gray:re,"":""},oe="text-center font-sans select-none",ce={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},de=({className:e,rounded:t,version:l})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",l?ie[l]:"",t?"rounded-full":"rounded-md",e].join(" ");const me=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const l=this.subjectsStateMap[e];return l&&t(l),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}},he=()=>({open:(e,t={})=>me.fire("dialog",{type:"open",dialog:e,...t}),close:()=>me.fire("dialog",{type:"close"}),closeAll:()=>me.fire("dialog",{type:"close",all:!0})}),ue=e=>ue._impl(e);function pe(){const e=J(Q.SITE_URL),t=z(),{closeAll:l}=he();return e=>{const l=H(t)(e.href);return{...e,href:l,"aria-label":e.text,onClick:ue(n({...e,href:l}))}};function n({href:n,target:a,onClick:i}){return r=>{i&&i(r);const s=!E(n,e||"/");n&&!s&&$(n,a)&&(l(),r?.preventDefault(),t.push(((e,t="")=>e.replace(t,"")||"/")(n,e)))}}}ue._impl=e=>e,ue.setup=e=>{ue._impl=e};const ge=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},xe=d((e=>{const{text:t,aboveText:l,appendLeft:n,appendRight:a,version:i="primary"}=e,r=be(e)?"hidden lg:block":"";return c("div",{className:u(fe(e),"flex gap-xs"),children:[n?o("div",{className:u(r,ce[i]),children:n}):null,be(e)?c("div",{className:"whitespace-pre",children:[l?o("div",{className:"text-xs font-light text-left",children:l}):null,o("div",{className:"text-left "+(l?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:u(r,ce[i]),children:a}):null]})})),fe=e=>{const{version:t,aboveText:l,rounded:n}=e;if("link"===t)return"";const a=""+(l?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",be(e)?a:"h-12 w-12 m-auto",n?"rounded-full":"")},be=({text:e,aboveText:t,appendLeft:l})=>Boolean(e||t||!l),ye=({className:e,rounded:t,version:l})=>["inline-block",oe,l?se[l]:"",t?"rounded-full":"rounded-md",e].join(" "),ve=d((({disabled:e,children:t,method:l="LINK",href:n,...a})=>{const r=(({method:e,href:t})=>i((l=>{if("POST"!==e||!t)return;l.preventDefault(),l.stopPropagation();const{origin:n,pathname:a,searchParams:i}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[n,a].join(""));for(const[e,t]of i.entries()){const l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name",e),l.setAttribute("value",t),r.appendChild(l)}document.body.appendChild(r),r.submit()}),[]))({method:l,href:n}),s=pe()({onClick:r,href:n,...a}),c=t??o(xe,{...s});return o(e?we:Ne,{...s,children:c})})),Ne=d((({className:e="",href:t,rel:l,target:n,ariaLabel:a,version:i,rounded:r,onClick:s,type:c,data:d,children:m})=>o("a",{className:de({className:e,version:i,rounded:r}),href:t,rel:l,target:n,"aria-label":a,role:t?"link":"button",onClick:s,type:c,...ge(d),children:m}))),we=d((({className:e,ariaLabel:t,version:l,rounded:n,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ye({className:e,rounded:n,version:l}),children:a})));function ke({version:e,handleClick:t,text:l="Вернуться назад",alwaysVisible:n=!1}){if(!l)return null;const a="primary"===e?"white":"black",i="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(n?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),i),onClick:t,children:o(ae,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:a}})}),o(ve,{version:"link",className:"group-data-secondary:text-white",text:l,ariaLabel:l,onClick:t,type:"button"})]})}const Se={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ce=d((({className:e,version:t="primary",defaultPadding:l,padding:n="",title:a,insetTitle:r,buttons:s,leftImage:o,rightImage:d,imageAlign:m,isImageAlwaysOnRight:h=!1,isImageSecondary:p=!1,backwardButton:g,children:x,...f})=>{const b=z(),y=i((()=>{b.back()}),[]),v=f.options?.page?.common?.backwardButton;return c("div",{className:Ie(n,l,e),children:[g?ke({version:t,handleClick:y,text:v}):null,Te(a),c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",o?"self-start @xl:w-auto":""),children:[Ve(o,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl",d?"@xl:grid-cols-2 auto-cols-fr":"",o?"":"grow","h-full","auto-rows-[max-content_1fr]","items-center md:items-stretch"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[r,x]}),Re(V({...f,extraProps:{className:"@container-normal"}})),Ve(d,{className:u("@xl:justify-self-end @xl:col-start-2",s?Be(h):"",Pe(h),ze(p)),imageAlign:m}),Me(s)]})]})]})})),Te=e=>e?o("div",{className:"relative h-full",children:e}):null,Ie=(e="",t="",l="")=>u("relative flex flex-col gap-3xl overflow-hidden",e||t,l),Be=e=>e?"row-span-2":"@xl:row-span-2",Pe=e=>e?"col-start-2 self-center":"",Me=e=>e?o("div",{className:"self-end",children:e}):null,Re=e=>e&&e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Ve=(e,{className:t,imageAlign:l})=>e?o("div",{className:u("shrink-1/2 justify-self-center",l&&Se[l],t),children:e}):null,ze=e=>e?"hidden @xl:block":"",De=(e=[])=>e.reduce(((e,t)=>e+t),0),_e=(e=[])=>e?.length?De(e)/e.length:0,Ae=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ae,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,$e=d((e=>{const{__html:t="",richVersion:l="",itemSize:n="list-m",isDotted:a=!0}=e,i=a?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(l,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",i),dangerouslySetInnerHTML:{__html:t}})}):null})),je=(e,t)=>e?o(S,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Le=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Oe=(e,t)=>e?o(Le,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ee=(e,t)=>["label"in e?Oe(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:je(e.description,t)},String(t)):null,"__html"in e?o($e,{...e},`rte-${t}`):null],Fe=d((({className:e,benefitsVersion:t,...l})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in l?Ae(l.icon,t):null,o("div",{children:Ee(l)})]}))),Ue=e=>Math.max(e?.label?.length||0,e?.description?.length||0,e?.__html?.length||0),We=e=>{return((t=e.map(Ue))?.length?Math.sqrt(Math.abs(_e(t.map((e=>e**2)))-_e(t)**2)):0)>16;var t},He=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),Ke=e=>!e.some(He),qe=d((({className:e,benefitsVersion:t="normal",benefits:l})=>l?.length?o("div",{className:u("flex gap-x-m gap-y-s",We(l)||Ke(l)?"flex-col":"flex-wrap",e),role:"list",children:l.map(((e,l)=>o(Fe,{benefitsVersion:t,...e},String(l))))}):null)),Xe=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Ee)}):null)),Ye=d((({isTabularBenefits:e,...t})=>o(e?Xe:qe,{...t}))),Ge=e=>Boolean(e?.src||e?.icon),Qe=(e,{className:t,buttonClassName:l,isVertical:n}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",n?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m",t),role:"group",children:e.map(Je(l))}):null,Je=(e="")=>(t,l)=>{const{text:n,icon:a,iconRight:i,version:r,...s}=t||{},c=Ze(a,r),d=Ze(i,r);return n||a?.icon?o(ve,{className:u("basis-full @lg:basis-auto",e),appendLeft:et({...a,iconVersion:c}),appendRight:et({...i,iconVersion:d}),version:r,text:n,...s},l?String(l):""):null},Ze=(e,t="secondary")=>{const l="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:l},et=e=>Ge(e)?o(ae,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,tt=(e=0,{fixed:t}={})=>(l=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(l)||0),lt=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(nt)}):null)),nt=({label:e,amount:t,unit:l},n)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Le,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[tt(2)(t)," ",l||"₽"]}):null]},String(n)),at=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(it)}):null)),it=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Le,{size:"text-m",font:"font-light",children:e})},String(t)),rt={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},st=d((({className:e,padding:t,defaultPadding:l,title:n,description:a,headlineVersion:i="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:h,__html:u,isFullWidthTitle:p,priceList:g=[],tags:x=[],buttons:f,image:b,imageOptions:{imageAlign:y="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1}={},backwardButton:k,children:S,...C})=>{const I=b?.src?o(ae,{image:b}):null,B=o(T,{title:n,description:a,headlineVersion:i,align:r,isEmbedded:!0}),P=h?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Ce,{className:e,padding:t,defaultPadding:l,...p?{title:B}:{insetTitle:B},...ot(I,v),isImageSecondary:w,imageAlign:y,isImageAlwaysOnRight:N,buttons:Qe(f),backwardButton:k,...C,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Ye,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,u?o($e,{__html:u,isDotted:m,itemSize:rt[i]}):null,S,g?.length?o(lt,{priceList:g}):null,ct(x)]})})})),ot=(e,t)=>t?{rightImage:e}:{leftImage:e},ct=e=>e?.length?o(at,{tags:e}):null,dt=e=>Boolean(e&&Array.isArray(e)),mt=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),ht=(e,t)=>{return l=e,Boolean(mt(l)&&"string"==typeof l.$ref)?t.ref(e):mt(e)?t.record(e):dt(e)?t.array(e):t.scalar?t.scalar(e):e;var l},ut=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(pt,e),pt=(e,t)=>e&&t?mt(e)?e[t]:dt(e)?e[parseInt(t,10)]:e:e,gt=(e,t)=>ht(e,{ref:({$ref:e,...l})=>gt(e?ut(t(e),e):l,t),record:e=>Object.entries(e).map((([e,l])=>({[e]:gt(l,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>gt(e,t)))}),xt=(e,t,l=[])=>{ht(e,{ref:e=>t(e.$ref,l),record:e=>{for(const n in e)xt(e[n],t,[...l,n])},array:e=>{for(let n=0;n<e.length;n++)xt(e[n],t,[...l,n])}})};async function ft(e,t){try{return e?await bt(e,t):null}catch(e){console.error(e)}return null}const bt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),yt=e=>[...new Set(e)],vt={},Nt=["/portal-resources"],wt=(e,t)=>gt(e,(e=>t?.[e])),kt=(e,t)=>{const l=(e=>{const t=[];return xt(e,(e=>t.push(e))),t})(e),[i,r]=n({});return a((()=>{l.length&&(async e=>Object.fromEntries((await Promise.allSettled(yt(e).filter((e=>!Nt.some((t=>e.startsWith(t))))).map((async e=>[e,vt[e]||=await bt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(l).then(r)}),[l.join()]),l.length?wt(e,{...t,...i}):e};function St(e,t={}){const l=d((t=>{const l=kt((({block:e,options:t,className:l,defaultPadding:n,padding:a,isTheme:i,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...l})}));return Object.assign(l,t),l}const Ct=St((({className:e,padding:t,...l})=>o(f,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:o(st,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...l})})),{childrenTypes:["UnitBlock"]}),Tt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},l=r((()=>It(0,t?.length)),[t]),n=t?.[l];return n?o(Ct,{suppressHydrationWarning:!0,...n,...e}):o(f,{...e,children:o(b,{})})})),It=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Bt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const l=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${n}-${l}`:`${l}.${n}.${a}`}},Pt=e=>e?.replace(/[^+\d]/g,"");const Mt=e=>e?{phone:Pt(e)}:{},Rt=e=>e?{birthday:Bt(e)}:{},Vt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),zt=(e,t=!0)=>({[t?"email":"mail"]:e}),Dt=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Pt(e)}:{},_t=({aspectsAttributes:e,aspects:t,ev:l})=>{for(const{aspectName:n,params:a}of e)t[n??""]?.(l,a)},At="rshb-query-params";function $t(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(At)||"";return e&&globalThis.sessionStorage?.setItem(At,e),e}function jt(e){if(!e)throw new Error("Value should be fulfilled");return e}const Lt=e=>t=>{const[,l]=jt(e.find((([e])=>e(t))));return l(t)},Ot=e=>Lt(e.map((([e,t])=>[e,()=>t])));Ot.if=e=>new Et(void 0,e);class Et{parent;predicate;unit;get entry(){return[jt(this.predicate),jt(this.unit)]}constructor(e,t,l){this.parent=e,this.predicate=t,this.unit=l}if(e){return new Et(this,e)}then(e){return new Et(this.parent,this.predicate,e)}else(e){return Lt([...Ft(this),[()=>!0,e]])}}const Ft=e=>[...e?.parent?Ft(e.parent):[],e.entry],Ut=e=>{const t=e.target?.closest("a");if(A(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const l=(e=>{const t=$t();if(!A(e)||!t)return e;const l=new URL(e);for(const[e,n]of new URLSearchParams(t))l.searchParams.set(e,n);return l.toString()})(t?.href)||t?.href;if(l){Wt(t?.target)?.(l)}}},Wt=Ot([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]);function Ht(){return Ht._impl()}Ht._impl=()=>({forwardQuery:Ut}),Ht.setup=e=>{Ht._impl=e};const Kt=(e,{resetOnSubmit:t,onSubmit:l}={})=>{const[a,r]=n(e),[o,c]=n(!1),[d,m]=n({}),u=s({}),p=i(((e,t)=>{const{parse:l=h,format:n=h}=t||{};return u.current||(u.current={}),u.current[e]||=t=>{r((n=>({...n,[e]:l(t)}))),m((t=>({...t,[e]:!0})))},{value:n(a[e]),isDirty:o||d[e],onChange:u.current[e]}}),[a,o,d]),g=i((e=>{r(e),m(e)}),[]),x=i((()=>{r(e),c(!1),m({})}),[e]),f=i((e=>{e.preventDefault(),t?x():c(!0),l&&l(a,e)}),[l,a]);return[a,{isDirty:o||Object.values(d).some(Boolean),field:p,update:g,reset:x,onSubmit:f}]},qt=d((e=>{const{className:t,title:l,children:n,...a}=e;return o(f,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[l?o(k,{headingType:"h3",title:l,className:"@xl:text-center"}):null,n]})})}));function Xt({disabled:e,onClick:t}){return l=>{!e&&t&&t(l)}}const Yt={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active"},Gt={primary:u("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},Qt=d((({children:e,...t})=>{const l=e=>({...e,onClick:ue(Xt(e))}),{className:n,version:a="primary",active:i,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=l(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",i?"text-white bg-primary-active":"",r?"bg-main-gray text-main-disabled cursor-not-allowed":"",i||r?"":u(Yt[a],Gt[a]),c?"rounded-md":"",n),type:s,role:d,onClick:m,children:e})})),Jt=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(q,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Zt=d((({className:e,head:t,children:l,onClose:n,onClick:a})=>{const{close:r}=he(),s=i((()=>{r(),n&&n()}),[n]);return c("div",{onClick:a,className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Jt,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:l})]})})),el=d((function({responseType:e}){const t="OK"===e,l=t?"ResponseOKIcon":"ResponseFailIcon",{close:n}=he(),a=i((()=>{n()}),[]);return o(Zt,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto ",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ae,{image:{icon:l,iconVersion:"normal"},width:"136",height:"136"}),o(T,{className:"w-full",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",description:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Qt,{type:"button",onClick:a,children:"Хорошо"})]})})})),tl=e=>t=>l=>e(l)?[]:[t],ll=e=>o("div",{className:"h-6",children:e?o(Le,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),nl=d((({className:e,viewBox:t,fill:l="none",width:n,height:a,paths:i,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:l,width:n,height:a,children:i.map((({d:e,fill:t,...l},n)=>{const a={...r,...l};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},n)}))}))),al="appearance-none w-5 h-5 border-solid flex-none",il=[{d:"M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],rl=d((({className:e,value:t,text:l,disabled:n,isRadio:a,onChange:r})=>{const s=i((e=>{n||(e.preventDefault(),r&&r(!t))}),[r,n,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(nl,{paths:il,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",ol(n)),onClick:s,children:[o("div",{className:u(al,"m-0",a?"rounded-full border-2":dl(t),!n&&t?"border-primary-main":"border-gray",n?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:cl(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(n)}),t?d:null,sl(l)]})})})),sl=e=>e?o("div",{className:"ml-s",children:o(Le,{size:"text-l",font:"font-light",children:e})}):null,ol=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",cl=(e=!1)=>e?"radio":"checkbox",dl=(e=!1)=>u("rounded border",e?"bg-primary-main":""),ml=d((({className:e,text:t,value:l,key:n,disabled:a,error:i,onChange:r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(rl,{text:t,value:l,disabled:a,onChange:r},n),ll(i)]})));function hl(e=!1){const[t,l]=n(e),a=i((()=>l(!0)),[]),r=i((()=>l(!1)),[]),s=i((()=>l((e=>!e))),[]);return[t,{setValue:l,setTrue:a,setFalse:r,toggle:s}]}const ul=e=>e?o(Le,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,pl="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",gl=d((({key:e,className:t="",id:l,name:n,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:x,onFocus:f,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1})=>{const w=s(null),k=i((e=>{x&&x(e.target?.value||"")}),[x]);a((()=>{v&&w.current?.focus()}),[v,w]);const S="w-full border rounded-md text-primary-text outline-none p-m",C=g?"pr-3xl":"",T=xl(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[ul(d),N?o("textarea",{className:u("block resize-y min-h-24",S,T),id:u("textarea",l),name:n||l,placeholder:m,value:h,onChange:k,onFocus:f,onBlur:b},e):o("input",{type:r,className:u("h-14",S,C,T),ref:w,id:l,name:n||l,placeholder:m,value:h,onChange:k,onFocus:f,onBlur:b,pattern:y},e)]}),g]})})),xl=e=>e?pl:"border-error",fl=e=>e?.text||e?.key||"";function bl(e,t,l,n){a((()=>{if(e&&l)return e.addEventListener(t,l,n),()=>{e.removeEventListener(t,l,n)}}),[e,t,l])}function yl(e){const t=s(null),l=i((l=>{t&&t.current&&l.target instanceof Node&&!t.current.contains(l.target)&&e()}),[e]);return bl(globalThis.document,"click",l),t}const vl=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Nl=d((({popupRef:e,options:t,value:l,query:n,onChange:a,iconVersion:i})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:vl(t,n).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===l?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:fl(e)}),o(q,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:u("absolute right-4 pt-3xs",e.key===l?.key?"":"hidden")})]},e.key)))}):null));function wl({isOpen:e,options:t,value:l,query:n,onChange:r,onClose:c,iconVersion:d}){const m={open:(e,t)=>me.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>me.fire("popup",{type:"update",popup:e,...t}),close:()=>me.fire("popup",{type:"close"})},h=i((()=>{m.close(),c&&c()}),[c]),u=i((e=>{h(),r&&r(e)}),[h,r]),p=s(null),g=yl(h);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:i,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(Nl,{popupRef:g,options:t,value:l,query:n,onChange:u,iconVersion:d}),{top:i+window.scrollY+c,left:r,width:s})}),[e,t,l,n,u]),p}const kl=d((({className:e,label:t,options:l=[],value:a,valid:r=!0,isBorder:s=!0,placeholder:d="",isSearch:m=!1,iconVersion:h="black",onChange:p,disabled:g})=>{const[x,{setFalse:f,setTrue:b}]=hl(),[y,v]=n(""),N=g||0===l.length,w=x&&!N,k=i((()=>{v(""),f()}),[]),S=wl({isOpen:x,options:l,value:a,query:y,onChange:p,onClose:k,iconVersion:h});return c("div",{className:u("space-y-xs",e),children:[ul(t),c("div",{className:u("relative",w?"z-20":"z-10"),ref:S,children:[c("div",{className:u("h-14 [&>*]:p-m pr-8 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Cl(s,r,N)),onClick:w?k:b,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:fl(a)||d}),Sl(w,h)]}),m&&w?o("div",{className:u("absolute top-0 w-full z-20"),children:o(gl,{type:"text",autoFocus:!0,value:y,onChange:v})}):null]})]})})),Sl=(e,t)=>o(q,{className:u("absolute right-3 flex self-center",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Cl=(e,t,l)=>u(e?"border rounded-md ":"",e&&!l?"hover:border-primary-hover":"",l?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Tl=()=>{},Il=({today:e,firstDayOfWeek:t,totalDays:l,currentMonth:n,currentYear:a,min:i,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const h=[];for(let c=0;c<7;c++)if(0===m&&c<t)h.push(o("td",{},`empty-${c}`));else if(d>l)h.push(o("td",{},`empty-${c}`));else{const t=new Date(a,n,d),l=Bl(t,e),c=Pl(t,i,r);h.push(o("td",{children:o("div",{className:Ml(l,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:h},`row-${m}`))}return c},Bl=(e,t)=>t&&e.toDateString()===t.toDateString(),Pl=(e,t,l)=>t&&e.getTime()<t.getTime()||l&&e.getTime()>l.getTime(),Ml=(e,t)=>u("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),Rl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Vl=d((({today:e,currentMonth:t,currentYear:l,min:n,max:a,onDateSelect:s=Tl})=>{const d=i((e=>s(e)),[]),{firstDayOfWeek:m,totalDays:h}=r((()=>({firstDayOfWeek:new Date(l,t,1).getDay()-1,totalDays:new Date(l,t+1,0).getDate()})),[l,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Rl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Il({firstDayOfWeek:m,today:e,totalDays:h,currentYear:l,currentMonth:t,min:n,max:a,onDateClick:d})})]})})),zl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],Dl=zl.map((e=>({key:e}))),_l=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),Al={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},$l={className:"min-w-32",iconVersion:"black",isBorder:!1},jl=d((({className:e="",label:t="",value:l,valid:a=!0,minDate:r,maxDate:s,onChange:d})=>{const[m,{setValue:h}]=hl(!1),[p,g]=n(l?.getMonth()||(new Date).getMonth()),[x,f]=n(l?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:b,handleNextMonth:y,handleSelectMonth:v,handleSelectYear:N,monthsOptions:w,yearsOptions:k,handleChangeVisibleCalendar:S,ref:C}=(({onShowCalendar:e,showCalendar:t,selectedMonth:l,onMonthSelect:n,onYearSelect:a,selectedYear:r})=>{const s=yl(i((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:i((()=>e(!t)),[t]),handleNextMonth:i((()=>{l+1<=11?n(l+1):(n(0),a(r+1))}),[l]),handlePrevMonth:i((()=>{l-1>=0?n(l-1):(n(11),a(r-1))}),[l]),handleSelectMonth:i((({key:e})=>n(zl.indexOf(e))),[]),handleSelectYear:i((({key:e})=>a(Number(e))),[]),monthsOptions:Dl,yearsOptions:_l,ref:s}})({onYearSelect:f,onMonthSelect:g,onShowCalendar:h,selectedYear:x,selectedMonth:p,showCalendar:m});return c("div",{className:u("space-y-xs",e),ref:C,children:[ul(t),c("div",{className:"relative",children:[Ll(S,l,a),m?c("div",{className:"absolute bg-white z-20 select-none",children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:b,children:o(q,{...Al,className:"-rotate-90 cursor-pointer"})}),o(kl,{onChange:v,value:{key:zl[p]},options:w,...$l}),o(kl,{onChange:N,value:{key:String(x)},options:k,...$l}),o("div",{className:"my-auto",onClick:y,children:o(q,{...Al,className:"rotate-90 cursor-pointer"})})]}),o(Vl,{today:l,currentMonth:p,currentYear:x,onDateSelect:d,min:r,max:s})]}):null]})]})})),Ll=(e,t,l)=>c("div",{onClick:e,className:u("flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",l?"border-gray":"border-error"),children:[o(S,{children:t&&Bt(t)}),o(q,{...Al,name:"CalendarIcon"})]}),Ol=d((({className:e,label:t,error:l,...n})=>c("div",{className:u("shrink-0 w-full",e),children:[o(jl,{label:t&&n?.errors?`${t}*`:t,valid:Boolean(!l),...n}),ll(l)]}))),El=d((({className:e,label:t,value:l="",placeholder:n,error:a,onChange:i,onBlur:r,isTextarea:s,type:d,...m})=>c("div",{className:u("shrink-0 w-full",e),children:[o(gl,{type:d||"text","aria-label":t,label:t&&m?.errors?`${t}*`:t,valid:Boolean(!a),value:l,onChange:i,onBlur:r,isTextarea:s,placeholder:m?.errors&&!t?`${n}*`:n}),ll(a)]}))),Fl=e=>"_"===e,Ul=e=>/\d/.test(e),Wl=e=>Fl(e)||Ul(e),Hl=[..."+7 (___) ___-__-__"],Kl=Hl.findIndex(Fl),ql=Hl.map(((e,t)=>Wl(e)?Hl.slice(0,t).filter(Wl).length:-1));const Xl=d((({children:e,onChange:t,...l})=>{const n=i((e=>t&&t(function(e){const t=e.replace(/\D/g,""),l=Hl.map(((e,l)=>Ul(e)?e:t.charAt(ql[l])||e)),n=ql.indexOf(t.length-1)+1;return(n?l.slice(0,Math.max(Kl,n)):l).join("")}(e))),[t]),a=i((e=>{"+7 ("===e&&(t&&t(""))}),[]);return o(gl,{...l,onChange:n,onFocus:e=>n(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Yl=d((({className:e,label:t,value:l,error:n,onChange:a,onBlur:i,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Xl,{"aria-label":t,label:r?.errors?`${t}*`:t,valid:Boolean(!n),value:l,onChange:a,onBlur:i,placeholder:"+7 (___) ___-__-__"}),ll(n)]}))),Gl=d((({className:e="",label:t,error:l,...n})=>c("div",{className:e,children:[o(kl,{...n,valid:!l,label:n?.errors?`${t}*`:t}),ll(l)]}))),Ql="Некорректно заполненное поле",Jl=tl((e=>null!=e&&""!==e))(Ql),Zl=tl((e=>e?.key&&""!==e?.key))(Ql),en=tl((e=>"string"==typeof e&&e.length>1))(Ql),tn=tl((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Ql),ln=(nn=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,tl((e=>"string"==typeof e&&nn.test(e))))(Ql);var nn;const an=tl((e=>"boolean"==typeof e&&e))("Согласие обязательно"),rn={typeForm:Jl,surname:en,name:en,region:Zl,addressBranch:Zl,phone:ln,secondaryPhone:ln,birthday:Jl,email:Jl,fullName:en,inn:tn,partnerComments:Jl,collectionCount:Jl,comment:Jl,acquiringType:Zl,feedbackType:Zl,feedbackMethod:Zl,serviceType:Zl,serviceDirection:Zl,consentDataProcessing:an,annualRevenue:Jl},sn=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>"required"in e&&e.required)));return Object.fromEntries(t.map((e=>[e,rn?.[e]])))},on=(e,t)=>{const{value:l,isDirty:n}=e,a=n?t(l):[];return{...e,errors:a,error:a[0]}},cn=(e,t,l=!1)=>l?on(e,t):e,dn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],mn=d((({field:e,input:t})=>o(Gl,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:dn,...cn(e("acquiringType"),rn.acquiringType,t?.required)}))),hn=(e="")=>Boolean("trade"===e||"all"===e),un=e=>null!=e,pn=new Map,gn=e=>Boolean(e?.every((e=>Array.isArray(e)?gn(e):!e||"string"==typeof e))),xn=e=>gn(e)?e.toString():"";function fn(e,t,{fallback:l,cache:i}={}){const s=r((()=>bn(e)),[e]),[o,c]=n(void 0),[d,m]=n(void 0);a((()=>{if(!s.some(un))return;let e=!1;const l=(t,l)=>{e||(c(t),m(l))};return(async()=>{try{l(await((e,t=pn)=>l=>{const n=xn(l),a=t.get(n);if(n&&un(a))return a;const i=e(...l);return n&&un(i)&&t.set(n,Promise.resolve(i)),i})(t,i)(s))}catch(e){l(void 0,e)}})(),()=>{e=!0}}),[t,i,s]);const h=l&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&l[s[0]];return{data:!o&&h?h:o,error:d,mutate:()=>Promise.resolve(void 0)}}function bn(e){return Array.isArray(e)?e:e instanceof Function?bn(e()):[e]}const yn=[];const vn=async e=>await ft(e,{method:"GET"})||yn;function Nn(){const{data:e}=fn("/api/v1/branchesByRegions",bt);return Array.isArray(e)?e:[]}const wn=d((({field:e,input:t,isPremium:l=!1})=>{const n=e("region"),i=n?.value?.key,r=n?.value?.text,s=l?Nn()?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=fn(e?`/api/v1/branches?regionCode=${e}`:null,vn);return t||yn}(i)?.filter((e=>e?.address));return a((()=>{""!==n?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[n?.value]),o(Gl,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...cn(e("addressBranch"),rn.addressBranch,t?.required),isSearch:!0})})),kn=(e,{normalize:t,format:l})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=n(!1),m=i((e=>{d(!0),r&&r(e)}),[]),h=i((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!l?a:l(a),onFocus:m,onBlur:h}},Sn=(e,t,l)=>Math.max(t,Math.min(e,l));function Cn(e){const t=(e||"").replace(/\D/g,""),l=parseInt(t,10);return Number.isNaN(l)?0:l}function Tn({list:e=[],min:t,max:l,step:n,value:a=e[0]||t,disabled:i,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(l-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||i?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:l,step:n,value:s,disabled:i,onChange:t=>{const l=Cn(t.target?.value),n=e.length?e[l]:l;r&&r(n||0)}})})]})}const In=1,Bn=100,Pn=d((e=>{const{className:t,title:l,items:n=[],list:a=[],min:r=(a.length?0:In),max:s=(a.length?a.length-1:Bn),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=kn(e,{normalize:(e=0)=>a.length?Mn(a)(e):Sn(e,r,s),format:tt()}),x=i((e=>{p&&p(Cn(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[l?o(Le,{size:"text-m",font:"font-light",color:"text-primary-text",children:l}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",pl,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:x,...g}),Tn({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),Rn(n)]})})),Mn=e=>t=>e.reduce(((e,l)=>Math.abs(l-t)<Math.abs(e-t)?l:e)),Rn=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Le,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),Vn=["От 1 000 ₽","До 1 000 000 000 ₽"],zn=d((({field:e})=>o(Pn,{title:"Сумма, ₽",items:Vn,min:1e3,max:1e9,...e("amount")}))),Dn=d((({field:e,input:t})=>o(El,{className:"col-span-2",...cn(e("comment"),rn.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),_n=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],An=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],$n=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],jn=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Ln=d((({field:e})=>o(Gl,{label:"Способ получения ответа",options:jn,...on(e("feedbackMethod"),rn.feedbackMethod)}))),On=d((({field:e})=>{const t=e("feedbackType");return a((()=>{"FEEDBACK"===t?.value?.key&&e("serviceDirection")?.onChange?.(An[0])}),[t?.value]),o(Gl,{label:"Тема",placeholder:"Выберите тему",options:$n,...on(t,rn.feedbackType)})})),En=d((({field:e})=>o(ml,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Fn=d((({value:e=!1,text:t,type:l="checkbox",onChange:n})=>c("div",{role:l,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>n&&n(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Le,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Un=d((({field:e})=>hn(e("acquiringType")?.value?.key)?o(Fn,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),Wn=d((({field:e})=>{const t=e("secondaryPhone");return o(Yl,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?on(t,rn.secondaryPhone):t})})),Hn=d((({field:e})=>hn(e("acquiringType")?.value?.key)?o(Fn,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null));function Kn(){const{data:e}=fn("/api/v1/regions",bt);return Array.isArray(e)?e:[]}const qn=d((({field:e,input:t})=>{const l=Kn();return o(Gl,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>l?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[l]),...cn(e("region"),rn.region,t?.required)})})),Xn=d((({field:e,input:t})=>{const l=Nn(),n=r((()=>l?.map((({region:e})=>({key:e,text:e})))),[l]);return o(Gl,{label:"Регион",placeholder:"Выберите регион",options:n,...cn(e("region"),rn.region,t?.required)})})),Yn=d((({field:e})=>o(Gl,{label:"Направление обслуживания",placeholder:"Выберите направление",options:An,...on(e("serviceDirection"),rn.serviceDirection)}))),Gn=["От 1 мес","До 15 лет"],Qn=d((({field:e})=>o(Pn,{title:"Срок, месяцев",items:Gn,min:1,max:180,...e("term")}))),Jn=d((({field:e})=>o(Gl,{label:"Тип обслуживания",options:_n,...on(e("serviceType"),rn.serviceType)}))),Zn=d((({name:e,text:t,value:l,checked:n,onChange:a,className:i})=>o("div",{className:i,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(pl,al,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:l,name:e,checked:n,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(Le,{color:"text-primary-text",children:t}):null]})}))),ea=["currencyControl","documentOperations","conversionTransactions","otherIssues"],ta=d((({field:e})=>{const{value:t,onChange:l}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),c("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:[o(Zn,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:l}),o(Zn,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:l}),o(Zn,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:l}),o(Zn,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:l})]})})),la=(e,t)=>(l,n)=>{const{required:a,...i}=l,r="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,s={surname:o(El,{label:"Фамилия",...cn(e("surname"),rn.surname,a)}),name:o(El,{label:"Имя",...cn(e("name"),rn.name,a),...i}),middleName:o(El,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),phone:o(Yl,{label:"Телефон",...cn(e("phone"),rn.phone,a)}),email:o(El,{label:"Электронная почта",...cn(e("email"),rn.email,a)}),fullName:o(El,{label:"ФИО",...cn(e("fullName"),rn.fullName,a),...i}),inn:o(El,{label:"ИНН",type:"number",...cn(e("inn"),rn.inn,a)}),comment:o(Dn,{field:e,input:l}),region:r?o(Xn,{field:e}):o(qn,{field:e,input:l}),addressBranch:o(wn,{field:e,input:l,isPremium:r}),birthday:o(Ol,{label:"Дата рождения",...cn(e("birthday"),rn.birthday,a)}),isClient:o(En,{field:e}),consentToReceiveMaterials:o(ml,{...e("consentToReceiveMaterials"),text:"Согласен на получение информационных и аналитических материалов по электронной почте"}),partnerComments:o(El,{...cn(e("partnerComments"),rn.partnerComments,a),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i}),collectionCount:o(El,{label:"Количество объектов инкассации",type:"number",...cn(e("collectionCount"),rn.collectionCount,a)}),acquiringType:o(mn,{field:e,input:l}),onlineCheckout:o(Un,{field:e}),posTerminal:o(Hn,{field:e}),serviceType:o(Jn,{field:e}),term:o(Qn,{field:e}),amount:o(zn,{field:e}),annualRevenue:o(El,{label:"Годовая выручка, ₽",...cn(e("annualRevenue"),rn.annualRevenue,a)}),vedTypes:o(ta,{field:e}),feedbackType:o(On,{field:e}),feedbackMethod:o(Ln,{field:e}),serviceDirection:o(Yn,{field:e}),bankEmpolee:o(El,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}),applicationDate:o(El,{label:"Дата и время обращения в Банк",...e("applicationDate")}),secondaryPhone:o(Wn,{field:e})};return function({input:e,field:t}){const{condition:l}=e,{value:n}=t(l?.name||"");return!l||l?.values?.find((e=>e===(n?.key??n)))}({input:l,field:e})?o("div",{children:s[l?.name]},String(n)):null};const na=e=>{const{acquiringType:t,onlineCheckout:l,posTerminal:n,amount:a,term:i,annualRevenue:r,serviceType:s,feedbackType:o,vedTypes:c,region:d,...m}=e,h=t||r?(e=>{const{acquiringType:t,onlineCheckout:l=!1,posTerminal:n=!1,term:a,amount:i,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${hn(t?.key)?`/Онлайн касса=${l}/POS-терминал=${n}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${i}/Срок=${a}/Выручка=${r}`})(e):null,u={...m,...ia(c),...aa(d),...h?{partnerComments:h}:{},...s?{typeForm:s}:{},...o?{typeForm:o}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},aa=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},ia=e=>e?{vedTypes:Object.fromEntries(ea.map((t=>[t,t===e])))}:{},ra={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:dn[0],serviceType:_n[0],feedbackType:$n[0],feedbackMethod:jn[0],serviceDirection:An[0],vedTypes:ea[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1},sa=(e,t="")=>{const l=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||ra[e.name]])));return l?.serviceType&&"PREMIUMSERVICE"===t&&(l.serviceType=_n[1]),{...l,typeForm:{key:t,text:""}}},oa=d((({text:e,link:t})=>c(S,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Le,{children:e}):null,t?o(ve,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Le,{children:t.text})}):null]}))),ca=(e,t)=>o(Qt,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),da=(e,t,l)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(rl,{...e}),o(oa,{link:t})]}),ll(on(e,an).error)]}):o(oa,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),ca(l)]}),ma={send:async function(e,t=!1){const{typeForm:l,region:n,phone:a="",email:i,birthday:r,inn:s,fullName:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:h,serviceDirection:u,...p}=e,g=t&&"Юридическое лицо / ИП"!==u,x=g?"/api/v1/lead":"/api/v1/sendcorporatelead",f={typeForm:l,...Vt(n,g),...zt(i,g),...Mt(a),...g?Rt(r):{inn:s,fullName:o},..."FEEDBACK"===l?{}:{addressBranch:c,bankEmpolee:m,applicationDate:h,...Dt(d)},...p};try{const e=await fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(f)});return e?.ok?await e.json():null}catch(e){return null}}},ha=d((({className:e,title:t,typeForm:l="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...x})=>{const f=r?.flatMap((e=>e?.inputs))||[],b=sa(f,l),[y,v]=n(""),N=i((async(e,t)=>{const l=xa(f,e),n=(a=sn(l),e=>e&&Object.entries(a).flatMap((([t,l])=>l(e[t])))||[]);var a;if(n(e)?.length)return"Fail";const i=na({...e,...h}),r=await ma.send(i,"lead"===m)?"OK":"Fail";if(v(r),r){(e=>{const{open:t,close:l}=he();return{open:(l={})=>t(o(el,{...e}),l),close:l}})({responseType:r}).open()}if("OK"===r&&g){const e=Ht();_t({aspectsAttributes:g,aspects:e,ev:t})}return r}),[]),[,{field:w,onSubmit:S,reset:C}]=Kt(b,{onSubmit:N}),T=ga(f)?.name;return a((()=>{"OK"===y&&(v(""),C())}),[y]),c(qt,{className:u("container space-y-m",e),title:t,...x,children:[c("form",{onSubmit:S,children:[r.map(((e,t)=>c("div",{className:u(pa(e.columns),"grid gap-x-m"),children:[ua(e.title),(e?.inputs||[])?.map(la(w,l))]},`section-${t}`))),da(T?w("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(k,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"8 (800) 200-78-70",children:[o(ae,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ae,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),ua=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Le,{size:"text-h6",children:e})}):null,pa=e=>2===e?"@xl:grid-cols-2":"",ga=e=>e?.find((e=>"consentDataProcessing"===e?.name)),xa=(e,t)=>e.filter((e=>e)).filter((e=>!e?.condition||e?.condition.values.find((l=>{const n=t?.[e?.condition?.name??""];return"secondaryPhone"===e.name?Boolean(t.secondaryPhone):l===(n?.key??n)})))),fa=()=>{const[e,t]=n(false);return a((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),l=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",l),e?.matches&&t(Boolean(e.matches)),()=>{e?.removeEventListener("change",l)}}),[]),e},ba=d((({title:e,description:t})=>{const l=fa();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ae,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(T,{title:e,description:t,headlineVersion:l?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),ya=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",va=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Na(e,{sensitivity:t,rootRef:l}={}){const n=s(null),i=r((()=>({threshold:wa(t),root:l?.current})),[t,l?.current]);return a((()=>{if(!n.current)return;const t=new IntersectionObserver(e,i);return t.observe(n.current),()=>{t.disconnect()}}),[e,i]),n}function wa(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,l)=>Math.min(l/t)),1).concat(1)}const ka=d((({className:e,style:t,idx:l,activeIndex:n,observerOptions:a,children:r,onIntersection:s})=>{const c=Na(i((e=>{e.length&&s&&s(l||0,e[e.length-1])}),[s,l]),a);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(l===n),ref:c,role:"listitem",children:r})})),Sa=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Ca=d((({className:e,itemClassName:t,containerRef:l,activeIndex:n,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:x})=>{const f={sensitivity:1,rootRef:l},b=s([]),y=i(((e,t)=>{const l=[...b.current||[]];l[e]=t,b.current=l,g&&g(l),x&&x(Ia(l))}),[g,x]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,k={...w?Ta(c,v):{},...N?va(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:k,ref:l,role:"list",children:(S=(e,l)=>o(ka,{className:u(m,a?Sa[a-1]:"",N?"h-full":"",t),style:w?Ta(c/4):{},activeIndex:n,idx:l,observerOptions:f,onIntersection:y,children:e},String(l)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),Ta=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Ia=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Ba={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Pa={"horizontal-list":"w-6","vertical-list":"h-6"},Ma=d((({className:e="",containerRef:t,activeIndex:l,dotCount:n=0,listType:a="horizontal-list",version:i})=>n?o("div",{className:u("flex gap-xs",Ba[a],i?"group":"",e),"data-ver":i,children:Array.from({length:n}).fill(null).map(((e,n)=>o("div",{className:`cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white ${n===l?Pa[a]:"w-2 h-2 opacity-30"}`,role:"button","aria-hidden":!0,onClick:()=>(e=>{e!==l&&t?.current&&t.current.children[e]?.scrollIntoView({behavior:"smooth",block:"nearest"})})(n)},String(n))))}):null)),Ra=d((({className:e,disabled:t,...l})=>o(ve,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e||""),disabled:t,...l,children:o(ae,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),Va=d((e=>o(Ra,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),za=d((e=>o(Ra,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Da="absolute top-[calc(50%-24px)] z-40",_a="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Aa=d((({className:e,scroll:t,hasBlur:l,arrowsPadded:n})=>{const{canScrollLeft:a,canScrollRight:i,scrollLeft:r,scrollRight:s}=t;return c("div",{className:u(e),children:[l?$a(t):null,a?o(Va,{className:u(Da,n?"left-1":"left-0"),onClick:r}):null,i?o(za,{className:u(Da,n?"right-1":"right-0"),onClick:s}):null]})})),$a=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(_a,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(_a,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),ja=e=>e,La=(e=ja)=>t=>t.reduceRight(((t,l)=>e(t)>e(l)?t:l)),Oa=La(),Ea=(e=ja)=>La((t=>-e(t))),Fa=Ea(),Ua=e=>t=>e.scrollWidth/t,Wa=e=>(t,l)=>{e.scrollBy({left:l*Ua(e)(t),behavior:"smooth"})},Ha=({itemCount:e,onVisibleIndicesChange:t})=>{const l=s(null),[a,r]=n([]),o=i((e=>{r((t=>{return(l=t)===(n=e)||Boolean(l&&n&&l?.length===n?.length&&l.every(((e,t)=>e===n[t])))?t:e;var l,n})),t&&t(e)}),[e]),[c,d]=a.length?[Ea()(a),La()(a)]:[-1,-1],m=c>0,h=d<e-1,u=i((()=>{var t;l.current&&(m?Wa(l.current)(e,-1):(t=l.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{l.current&&(h?Wa(l.current)(e,1):l.current.scrollTo({left:0,behavior:"smooth"}))}),[e,h]),g=i(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{l?.current&&l.current.children[e]?.scrollIntoView(t)}),[l]);return[l,{scrollLeft:u,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:h,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Ka=d((({className:e,version:t,gap:l=14,padding:n=16,visibleItemCount:a=1,listType:i="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:x})=>{const f=Array.isArray(g)?g.length:0,[b,y]=Ha({itemCount:f,onVisibleIndicesChange:x}),[v]=y.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===i?"relative h-full":""),children:[o(Ca,{containerRef:b,activeIndex:v,visibleItemCount:a,gap:l,padding:n,listType:i,snapAlign:r,minHeight:s,onVisibleIndicesChange:y.handleVisibleIndicesChange,children:g}),o(Aa,{className:u(!d&&"hidden lg:block"),scroll:y,hasBlur:m,arrowsPadded:h}),o(Ma,{className:u(!p&&"lg:hidden"),containerRef:b,activeIndex:v,dotCount:f,listType:i,version:t})]})})),qa=({blocksToRender:e,...t})=>o(Ka,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:R(e,{...t.options,parent:t.block,renderProps:(e,t,l)=>o("div",{className:u("relative min-w-80",ya(!0)),children:P(e,t)},String(l))})}),Xa=e=>e%2!=0,Ya=d((({textNode:e,iconNode:t,tag:l,onClick:n,justifyContent:a="between",className:i,role:r,...s})=>c(l,{tag:l,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",i),onClick:n,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Ga=d((({className:e="",label:t,icon:l,dataTheme:n="pc",disabled:a=!1,onClick:i})=>o(Ya,{tag:"button",onClick:i,disabled:a,"data-theme":n,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Le,{size:"text-h4",children:t}),iconNode:l?o(ae,{image:{icon:l,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Qa=({isUnfolded:e,onToggle:t})=>o(Ga,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Ja=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:l=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=n(l),d=i((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),h=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[h,m]}:{className:e,role:"group",children:[m,h]})}));const Za=d((({className:e="",isUnfolded:t,children:l})=>{const n=s(null),i=function(e,t){const l=s(null);return a((()=>{const t=l?.current;if(!t)return;const n=new ResizeObserver((l=>{e(t,l[0])}));return n.observe(t),()=>{n.disconnect()}}),[e,...t]),l}((e=>{n.current&&(n.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:n,className:`transition-max-h duration-300 overflow-hidden ${n.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:i,children:l})})})),ei=["ArrowDownIcon","ArrowUpIcon"],ti="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",li=({topItemsCount:e=0,label:t="",block:l,blocksToRender:n=[],...a})=>{const[i,r]=e>0?[n.slice(0,e),n.slice(e)]:[n,[]];return c("div",{className:u("space-y-2xs",n.length?"":"hidden"),children:[c("div",{className:u(ti),children:[R(i,{...a.options,parent:l}),Xa(i.length)?o(Tt,{className:"col-span-6",...a}):null]}),o(Ja,{renderFoldableSection:({isUnfolded:e})=>c(Za,{className:u(ti),isUnfolded:e,children:[R(r,{...a.options,parent:l}),Xa(r.length)?o(Tt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:l,onToggle:n})=>o(Ga,{className:u(e<1?"hidden":""),disabled:!r?.length,label:t,icon:ei[Number(l)],dataTheme:a.options?.page?.colorPalette,onClick:n})})]})},ni=d((({blocksSection:e,blocksToRender:t=[],notFound:l,...n})=>{switch(e?.view){case"grid":return c("div",{children:[ai(l,t),li({...e,...n,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[ai(l,t),qa({...n,blocksToRender:t})]});default:return null}})),ai=(e,t)=>e&&!t.length?o(ba,{...e}):null,ii=e=>t=>t.reduce(((t,l,n)=>t.length?t.concat({...e,key:`sep-${n}`},l):[l]),[]),ri=d((({value:e,onChange:t,items:l=[],multiple:n})=>l.map((l=>o(Fn,{text:l?.title,value:[e].flatMap((e=>e)).includes(l.value),onChange:()=>(l=>{if(!t)return;const a=e?.includes(l);t(n?a?(e||[]).filter((e=>e!==l)):[...e||[],l]:a?[]:[l])})(l.value),type:n?"checkbox":"radio"},l.value))))),si=d((({children:e,filtrationSchema:t,resetButton:l,field:n,reset:a})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,ii(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(oi(n)).filter(Boolean))]}),l?o("div",{children:o(Qt,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:l?.text})}):null]}))),oi=e=>([t,l])=>{const n=l?.type;return"array"===n?ci(t,e)(l):null},ci=(e,t)=>l=>{const n=l?.items?.enum?.map(((e,t)=>({value:e,title:l?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[l?.title?o("div",{className:"mb-m",children:o(Le,{size:"text-m",font:"font-medium",color:"text-primary-text",children:l.title})}):null,o(ri,{items:n,multiple:!l?.single,...t(e)})]},e)};function di(e,...t){return e.map(((e,l)=>[e,...t.map((e=>e[l]))]))}const mi=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,hi=(e,t)=>Object.entries(e).map((([l,n])=>"number"==typeof n?Array.isArray(t[l])?((e,t)=>l=>mi(t[e])||mi(l[e])||l[e]?.includes(t[e]))(l,e):((e,t)=>l=>mi(t[e])||mi(l[e])||ui(t[e])<=ui(l[e]))(l,e):"object"==typeof n&&"min"in n&&"max"in n?((e,t)=>l=>mi(t[e])||mi(l[e])||ui(t[e]?.min)>=ui(l[e]?.min)&&ui(t[e]?.min)<=ui(l[e]?.max))(l,e):Array.isArray(n)?((e,t)=>l=>mi(t[e])||mi(l[e])||t[e]?.every((t=>l[e]?.includes(t))))(l,e):((e,t)=>l=>mi(t[e])||mi(l[e])||t[e]===l[e])(l,e))).every((e=>e(t))),ui=e=>Number(e||0),pi=(e,{block:t,page:l,normalize:n=h})=>{const a=t?.blocks||[],[i,{field:s,reset:o,update:c}]=Kt(e),d=r((()=>di(a,a.map((e=>wt(e.content,l?.fallback))))),[a,l?.fallback]),m=i===e?a:((e,t)=>(l=h)=>e?.filter((([,e])=>hi(t,l(e)||{}))).map((([e])=>e)))(d,i)(n);return[i,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},gi={},xi={},fi=St((({className:e,filtrationSchema:t=gi,consumerField:l={},resetButton:n,...a})=>{const[,{blocksToRender:i},{field:r,reset:s}]=pi(xi,{block:a.block,page:a.options?.page}),d=o(kl,{className:"w-64",label:l?.title,options:bi(l),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>bi(l).find((t=>t.key===e))||{key:""}})});return c(f,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(si,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Qt,{type:"reset",className:"mt-lg w-64",onClick:s,version:n?.version,children:n?.text})})]})}),o(ni,{blocksToRender:i,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),bi=e=>di(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),yi=(e=!1)=>e?"text-left":"text-center",vi={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Ni=d((({className:e,defaultIconSize:t=44,iconBgVersion:l="primary",size:n,icon:a,...i})=>{const r=String(n?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",vi[l],e),children:o(q,{...i,width:"54%",height:"54%",name:a})}):null})),wi=d((({className:e="",title:t,benefitList:l,...n})=>{const a=fa();return c(f,{className:e,defaultPadding:"p-6xl",...n,children:[t?o(k,{headingType:"h3",as:"h2",className:yi(a),title:t}):null,l?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:l.map(ki)}):null]})})),ki=({label:e,description:t,__html:l,icon:n,isDotted:a=!1,iconBgVersion:i},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[n?.icon?o(Ni,{className:"shrink-0",iconBgVersion:i,...n}):null,n?.src?o(ae,{className:"shrink-0",image:n}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(k,{headingType:"h6",children:e}),o(Le,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),l?o($e,{__html:l,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),Si=e=>({icon:t,title:l,description:n},a)=>c("div",{className:u("flex flex-col gap-1","items-center",n||l?"":"justify-center"),children:[l?o(Le,{size:"text-h6",font:"font-normal",align:e,children:l}):null,t?o(ae,{image:t,height:"180",className:"w-auto mx-auto"}):null,n?o(Le,{size:"text-h6",font:"font-normal",align:e,children:n}):null]},String(a)),Ci=(e,t,l)=>o("div",{className:`grid gap-2xs ${Ti(t)}`,children:e.map(Si(l))}),Ti=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},Ii=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:l="",columnsCount:n="4",subtitle:a,title:i,...r})=>c(f,{className:u("space-y-3xl",l),defaultPadding:"p-6xl",...r,children:[o(T,{defaultPadding:"",title:i,description:a,headlineVersion:"M"}),e?.length?Ci(e,n,t):null]}))),Bi={start:"justify-start",center:"justify-center",end:"justify-end"},Pi=d((({buttons:e,className:t="",align:l,...n})=>{const a=l?u("flex",Bi[l]):"";return o(f,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...n,children:Qe(e)})})),Mi=d((({className:e,title:t,children:l,...n})=>c(f,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...n,children:[t?o(k,{className:"text-center",title:t}):null,l]}))),Ri="flex flex-col justify-between @4xl:flex-row",Vi="gap-x-s gap-y-7 @xl:gap-y-4xl",zi="gap-7 @xl:gap-y-4xl",Di="flex flex-col lg:max-w-80 gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0",_i="flex flex-col gap-y-xl",Ai=d((({className:e,title:t,value:l,fractionDigits:n,fixed:a,prefix:i,postfix:r,color:s="text-secondary-text"})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Le,{size:"text-l",font:"font-light",color:s,children:t}):null,o("div",l?{children:o(Le,{size:"text-h3",children:[i,tt(n,{fixed:a})(l),r].filter(Boolean).join(" ")})}:{children:o(Le,{size:"text-h3",children:"-"})})]}))),$i=(e,t)=>e?o(S,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,ji=d((({rate:e=0,title:t="Ставка",unit:l,fractionDigits:n=2,depositeName:a,isShowDepositeName:i,color:r="text-secondary-text"})=>c("div",{children:[o(Le,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:tt(n,{fixed:!0})(e)}),l?o("span",{className:"text-7xl mt-5",children:l}):null]}),a&&i?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Li=d((({title:e="Ставка",isUnavailableByTerm:t=!1})=>c("div",{className:"space-y-s min-w-96",children:[o(Le,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(q,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:t?c(S,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",o("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):o(S,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),Oi=({title:e="Ставка",rate:t=0,unit:l="%",fractionDigits:n=2,isUnknownRateShown:a=!0,color:i="text-secondary-text",children:r,...s})=>a&&0===t?o(Li,{title:e,...s}):c("div",{className:"flex flex-col",children:[o("div",{className:"hidden @xl:block min-w-96",children:o(ji,{title:e,rate:t,unit:l,fractionDigits:n,color:i,...s})}),o(Ai,{className:"@xl:hidden",title:e,value:t,postfix:l,fractionDigits:n,fixed:!0,color:i,...s}),r]}),Ei=({isShowItems:e=!0,step:t=1e3,postfix:l="₽",...n})=>o(Pn,{items:e?[`От ${tt(1)(n.min||0)} ${l}`,`До ${tt(1)(n.max||0)} ${l}`]:[],step:t,...n}),Fi={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Ui={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Wi=(e,t)=>{const{travelExpenseValue:l,restExpenseValue:n}=e,[a,i]=((e,t,l)=>{const{maxBonus:n=5e3,prefMonthsNum:a=Fi.prefMonthsNum,prefTravelBonusRate:i=Fi.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(i*t)+Math.round(r*l),n);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*l),n)*(12-a)]})(t||Ui,l,n);return{...t,...e,monthBonus:a,yearBonus:i}},Hi=St((({className:e="",title:t,calcSource:l,buttons:n,footnote:a,...i})=>{const[r,{field:s}]=Kt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:x}=Wi(r,l);return o(Mi,{className:e,title:t,...i,children:c("section",{className:u(Ri,Vi,e),children:[c("div",{className:Di,children:[Ei({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Ei({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Oi({title:"Баллов за месяц",rate:g,fractionDigits:0,isUnknownRateShown:!1,unit:"",color:"text-primary-text"}):null}),c("div",{className:_i,children:[x>=0?o(Ai,{title:"Баллов за год",value:x,color:"text-primary-text"}):null,Qe(n,{isVertical:!0}),$i(a)]})]})})})),Ki=Math.round(29.5),qi=(e,t=0)=>e?.sum?e.sum:t,Xi=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Yi=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Gi={horizontal:"gap-5xl",vertical:"flex-col gap-s"},Qi=d((({items:e,checkedItem:t,className:l,onChange:n,disabled:a=!1,orientation:i="horizontal"})=>o("div",{className:u(`flex ${Gi[i]}`,l),role:"radiogroup",children:e?.map((({id:e,text:l})=>o(rl,{isRadio:!0,text:l,value:t===e,onChange:()=>n&&n(e),disabled:a},String(e))))}))),Ji=({items:e,title:t,mobileTitle:l=t,orientation:n="horizontal",value:a,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",children:o(Le,{color:"text-secondary-text",font:"font-light",children:t})}):null,l?o("div",{className:"@5xl:hidden",children:o(Le,{color:"text-secondary-text",font:"font-light",children:l})}):null,o(Qi,{orientation:n,items:e,checkedItem:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),Zi=e=>Ji({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),er=" (c капитализацией)",tr=({income:e,finalSum:t,postfix:l="₽",buttons:n=[],footnotes:a=[],isCapitalization:i=!1})=>c("div",{className:_i,children:[o(Ai,{title:`Доход в конце срока${i?er:""}`,value:e,postfix:l,prefix:"+"}),o(Ai,{title:`Сумма в конце срока${i?er:""}`,value:t,postfix:l}),Qe(n,{isVertical:!0}),a?.map($i)]}),lr=([e,t],l,n=[])=>l&&l[e]&&l[t]?{[e]:l[e],[t]:l[t]}:nr([e,t],n),nr=([e,t],l=[])=>({[e]:l.length?Fa(l.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:l.length?Oa(l.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),ar=(e,[t,l],n)=>e>=n[t]&&e<=n[l],ir={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const rr={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},sr=(e,t)=>{const{daysValue:l,moneyValue:n,isPartialWithdrawal:a,isReplenished:i,isMonthlyInterestPayment:r}=e,s=i||a,o=l<90||l>730,c=function(e){const t=e?.rateType?ir[e?.rateType]:"",{data:l}=fn(t?`/api/v1/depositrates/${t}`:null,bt);return Array.isArray(l)?l:[]}(t);if(l<=30)return{...rr,...e,isDisabledOperatingDeposit:o,isUnavailableByTerm:!0};const d=c?.find((e=>r===e.isMonthlyInterestPayment&&or(s,e)&&ar(n,["minSum","maxSum"],e)&&ar(l,["minDays","maxDays"],e)))||rr,{rate:m}=d,h=cr(m,e),u=n+h,p=c||[rr];return{...d,...nr(["minSum","maxSum"],p),...nr(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:h,finalSum:u}},or=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,cr=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,daysValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a/30)-n):Math.round(n*e*a/365/100)},dr=St((({className:e="",title:t,buttons:l,footnote:n,bottomFootnote:a,isShowDepositeName:i,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=Kt({moneyValue:qi(r,1e5),daysValue:Xi(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=sr(m,s),{income:g,finalSum:x,rate:f,isUnavailableByTerm:b,depositeName:y}=p;return o(Mi,{className:e,title:t,...d,children:c("section",{className:u(Ri,Vi,e),children:[c("div",{className:Di,children:[Ei({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(v={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(Pn,{items:[`От ${Yi(v.min||0)}`,`До ${Yi(v.max||0)}`],step:1,...v})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[mr(p,h),Zi({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),Oi({rate:f,depositeName:y,isShowDepositeName:i,isUnavailableByTerm:b}),tr({income:g,finalSum:x,buttons:l,footnotes:[n,a]})]})});var v})),mr=(e,t)=>c("div",{className:"space-y-s",children:[o(Le,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(rl,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(rl,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),hr=e=>ur([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e),ur=(e,t)=>{if(!t?.length)return;const l=t?.reduce(((t,l)=>e[0](l.rate,t[0].rate)?[l]:l.rate===t[0].rate?[...t,l]:t),[t[0]]);return l.length>1?l.reduce(((t,l)=>e[1](l,t)?l:t),l[0]):l[0]},pr=({min:e=0,max:t=0,availableMonths:l,...n})=>o(Pn,{items:[`От ${gr(e)}`,`До ${gr(t)}`],step:1,...l?.length?{list:l}:{min:e,max:t},...n}),gr=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,xr=e=>Ji({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),fr=({field:e,defParams:t,calcParams:l,map:n,monthsValue:a="maxMonths"})=>{Object.entries(n).forEach((([l,n])=>{e?.(l)?.onChange?.(t?.[n])})),e?.("monthsValue")?.onChange?.(Sn(t?.[a],l.minMonths,l.maxMonths))},br=(e,t)=>{const{isAnnuity:l,moneyValue:n,monthsValue:a,moneyExtra:i}=t;if(0===e)return 0;if(l){const t=e/1200;return i?(n+i)*(t+t/(Math.pow(1+t,a)-1)):n*(t+t/(Math.pow(1+t,a)-1))}return Math.round(n/a)+n*(e/1200)},yr={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},vr=e=>Nr({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Nr({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Nr({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Nr({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Nr=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],wr=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=t?.rateRows||[yr],r=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>vr({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:s,maxSum:o}=lr(["minSum","maxSum"],r,i),{minMonths:c,maxMonths:d}=lr(["minMonths","maxMonths"],r,i),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a})=>e?.find((e=>vr({row:e,userInputParams:t,paramsViewSettings:l})&&ar(n,["minSum","maxSum"],e)&&ar(a,["minMonths","maxMonths"],e)))||yr)({rateRows:i,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a}),{rate:h}=m,u=br(h,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:n,monthsValue:a,monthlyPayment:u}},kr=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Sr={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Cr=St((({className:e,title:t,calcSource:l,buttons:n,footnote:i,paramsViewSettings:r,defaultParams:s,...d})=>{const m=(h=l?.rateRows,ur([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],h));var h;const[p,{field:g}]=Kt({moneyValue:qi(s,2e5),monthsValue:Xi(s,Ki),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)}),x=wr(p,l,r),f=xr({title:"Тип платежа",orientation:"vertical",...g("isAnnuity")}),{onChange:b}=g("moneyValue"),{onChange:y}=g("monthsValue");return a((()=>{b&&b(Sn(p.moneyValue,x.minSum,x.maxSum))}),[x.minSum,x.maxSum]),a((()=>{y&&y(Sn(p.monthsValue,x.minMonths,x.maxMonths))}),[x.minMonths,x.maxMonths]),a((()=>{!kr(s)&&m&&fr({field:g,defParams:m,calcParams:x,map:Sr,monthsValue:"minMonths"})}),[l,s]),o(Mi,{className:e,title:t,...d,children:c("section",{className:u(Ri,zi,e),children:[c("div",{className:Di,children:[Ei({title:"Сумма кредита, ₽",step:500,min:x.minSum,max:x.maxSum,...g("moneyValue"),value:x.moneyValue}),pr({title:"Срок кредита, месяцев",min:x.minMonths,max:x.maxMonths,...g("monthsValue"),value:x.monthsValue}),Tr({...x,...r},g),o("div",{className:"sm:hidden",children:f})]}),c("div",{className:u(_i,"@4xl:w-1/2"),children:[o(Ai,{title:"Ежемесячный платёж",value:x.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:f}),Qe(n,{isVertical:!0}),$i(i)]})]})})})),Tr=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(rl,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(rl,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(rl,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(rl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Ir=(e="rub")=>"rub"!==e,Br=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let l=1;for(;l<t.length;){const[e,n]=t[l-1],[a,i]=t[l];n>=a?t.splice(l-1,2,[e,Math.max(n,i)]):l++}return t},Pr={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Mr=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=t?.[0]?zr(t[0].minMonths,t[0].maxMonths):0,r=!l?.isShowMonthlyInterestPayment,s=!l?.isShowRemoteRegistration,o=!l?.isShowReplenish,c=!l?.isShowWithdrawn,d=t?.find((t=>Vr({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o})&&Vr({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c})&&Vr({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r})&&Vr({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s})&&ar(n,["minSum","maxSum"],t)&&ar(a||i,["minMonths","maxMonths"],t)))||Pr,{rate:m}=d,h=Rr(m,e),u=n+h,p=t||[Pr];return{...d,...nr(["minSum","maxSum"],p),...nr(["minMonths","maxMonths"],p),availableMonths:Br(p.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,l=1)=>Array.from({length:Math.abs(t-e)/l+1},((n,a)=>t>=e?e+a*l:e-a*l)))(e,t))),...e,defaultMonth:i,income:h,finalSum:u}},Rr=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,monthsValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a)-n):Math.round(n*e*30*a/365/100)},Vr=({row:e,userInputParams:t,paramKey:l,isExclude:n})=>n||t[l]===e[l],zr=(e,t)=>e+Math.round((t-e)/2),Dr=(e,t)=>{const l="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?Ji({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:l}):null,e.isShowWithdrawn?Ji({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:l}):null]}),o("div",{className:"border-b border-main-divider w-full"}),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?Zi({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(n={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Ji({...n,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]})]});var n},_r={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},Ar={text:"₽",key:"rub"},$r=St((({className:e,title:t,calcSource:l,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=l??{},p=h?.map((e=>e.currency))??[Ar],[g,{field:x}]=Kt({moneyValue:qi(d,2e4),monthsValue:Xi(d),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),currency:Ar}),f=x?.("currency")?.value,{onChange:b}=x("monthsValue"),{onChange:y}=x("moneyValue"),v=Er(h,f),[N,w]=n(hr(h?.[0]?.rates)),k=Mr(g,Er(h,f),s),S=()=>{fr({field:x,defParams:N,calcParams:k,monthsValue:"minMonths",map:_r})},{defaultMonth:C,rate:T,income:I,finalSum:B,type:P=""}=k;a((()=>{w(hr(v))}),[f,h]),a((()=>{!g.monthsValue&&b&&b(C)}),[C]),a((()=>{y&&y(Sn(g.moneyValue,k.minSum,k.maxSum))}),[k.minSum,k.maxSum,v]),a((()=>{!kr(d)&&N&&S()}),[N,d]),a((()=>{y?.(Sn(g.moneyValue,k.minSum,k.maxSum)),Ir(f?.key)&&(x?.("isReplenish")?.onChange?.(!1),x?.("isWithdrawn")?.onChange?.(!1))}),[f]),a((()=>{!kr(d)&&N&&S()}),[d,v,N]);const M=T===N?.rate;return o(Mi,{className:e,title:t,...m,children:c("section",{className:u(Ri,Vi,e),children:[c("div",{className:Di,children:[c("div",{className:"flex gap-m",children:[Ei({className:"w-full",title:`Сумма, ${f?.text}`,min:k.minSum,max:k.maxSum,...x("moneyValue"),value:k.moneyValue,postfix:f?.text,step:jr(f?.key)}),h&&h?.length>1?o(Gl,{className:"w-20",label:"Валюта",options:p,...x("currency")}):null]}),pr({title:"Срок, месяцев",min:k.minMonths,max:k.maxMonths,availableMonths:k.availableMonths,...x("monthsValue"),value:k.monthsValue}),Dr({...k,...s},x)]}),Oi({rate:T,children:Or(S,M)}),tr({income:I,finalSum:B,buttons:[...i,Lr(l?.buttons,P)],footnotes:[r],postfix:f?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),jr=(e="")=>Ir(e)?100:1e3,Lr=(e=[],t="")=>{const{type:l,...n}=e.find((e=>e.type===t))??{};return n},Or=(e,t=!1)=>t?null:o(Qt,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Er=(e,t)=>{const{rates:l}=e?.find((e=>e?.currency.key===t?.key))??{};return l??e?.[0]?.rates},Fr=e=>Ur({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Ur({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Ur=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],Wr={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Hr=(e,t,l)=>{const{moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}=e,s=t?.rateRows||[Wr],o=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>Fr({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:c,maxSum:d}=lr(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=lr(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>Fr({row:e,userInputParams:t,paramsViewSettings:l})&&ar(n+r,["minSum","maxSum"],e)&&ar(i,["minSumOld","maxSumOld"],e)&&ar(r,["minSumExtra","maxSumExtra"],e)&&ar(a,["minMonths","maxMonths"],e)))||Wr)({rateRows:s,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}),{rate:p}=u,g=br(p,e),x=e.oldMonthlyPayment-g;return{...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r,monthlyPayment:g,benefit:x}},Kr=St((({className:e="",title:t,calcSource:l,buttons:n,footnote:a,paramsViewSettings:i,...r})=>{const[s,{field:d}]=Kt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=Hr(s,l,i),h=xr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Mi,{className:e,title:t,...r,children:c("section",{className:u(Ri,zi,e),children:[c("div",{className:Di,children:[Ei({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),Ei({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),pr({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),qr({...m,...i},d),m.isExtraMoney?Ei({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(_i,"@4xl:w-1/2"),children:[o(Ai,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(Ai,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),Qe(n,{isVertical:!0}),$i(a)]})]})})})),qr=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(rl,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(rl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(rl,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Xr=d((e=>{const{onChange:t,min:l,max:n,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=kn(e,{normalize:(e=a)=>l&&n?String(Sn(Number(Yr(e)),l,n)):Yr(e),format:tt(r)}),d=i((e=>t&&t(Yr(e))),[t]);return o(gl,{onChange:d,...s,...c})})),Yr=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Gr=d((e=>o(Xr,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Le,{size:"text-xl",font:"font-light",children:"₽"})})}))),Qr={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Jr={amount:1500},Zr=d((({className:e="",title:t="Укажите сумму перевода",label:l="Сумма перевода",button:i,formType:r="private",...s})=>{const[{amount:d},{field:m}]=Kt(Jr),[h,p]=n(!1);return a((()=>{p(d<=0)}),[d]),c(f,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(k,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Qr[r],children:[o(Gr,{valid:!h,label:l,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),i?.text?o(Qt,{className:"w-full mt-lg",type:"submit",disabled:h,children:i.text}):null]})]})})),es=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(q,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(S,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),ts="relative h-full",ls={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},ns=({noCardBorder:e,cardSize:t="normal",...l})=>{const{blocks:n}=l.block||{},a=n?.some(rs);return V({...l,renderProps:(l,n,i)=>c("div",{className:as(l,{someCardsHighlighted:a}),children:[P(l,n,{className:is(l,{someCardsHighlighted:a,showBorder:!e,cardSize:t}),blockIndex:i}),rs(l)?es({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},as=(e,{someCardsHighlighted:t})=>u(ts,t&&(rs(e)?"pt-3xl":"pt-3xl sm:pt-16")),is=(e,{someCardsHighlighted:t,showBorder:l,cardSize:n="normal"})=>u(ts,"min-w-80",ls[n],t&&(rs(e)?"pt-3xl sm:pt-16":"pt-3xl"),ya(l),l&&"h-full"),rs=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,ss=St((({className:e,visibleItemCount:t=1,noCardBorder:l,arrowsPadded:n=!0,isGap:a=!0,cardSize:i="normal",...r})=>o(f,{className:u(e),defaultPadding:"p-6xl",...r,children:o(Ka,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:n,hasBlur:!0,children:ns({noCardBorder:l,cardSize:i,...r})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),os="z-10 border border-solid w-full h-full",cs=u(os,"absolute hidden @xl:block border-transparent"),ds=d((({className:e,title:t,description:l,button:n,...a})=>o(f,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:u(cs,"top-9 right-12 bg-green-dark")}),o("div",{className:u(cs,"top-6 right-8 bg-green")}),o("div",{className:u(cs,"top-3 right-4 bg-green-light")}),c("div",{className:u(os,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(T,{title:t,description:l,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Qe([n],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),ms={black:"bg-black",white:"bg-white"},hs=d((({className:e="",title:t,description:l,image:n,price:a,button:i,colors:r=[],align:s="text-left",padding:d,...m})=>o(f,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Ce,{className:"h-full",padding:d,title:o(T,{title:t,description:l,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:n?.src?o(ae,{className:"flex justify-center align-center mb-xl",image:n}):null,buttons:Qe([i],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Le,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(us)]}):null,a?c(Le,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),us=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${ms[e]}`},String(t)),ps=d((({icon:e,...t})=>{const l=pe(),{text:n,href:a,target:i,onClick:r}=l(t);return n?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,target:i,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ae,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:n}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:n})]})})}):null})),gs=d((({className:e,additionalDescription:t,description:l,links:n,title:a,...i})=>o(f,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...i,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(T,{isEmbedded:!0,title:a,description:l,as:"h1",align:"text-left",headlineVersion:"XL"}),o(T,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),n?.length?xs(n):null]})}))),xs=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(ps,{...e},String(t))))}),fs=(e,t)=>e?.map((({aspectName:e,params:l})=>({aspectName:e,params:"mindboxEvent"===e?{...l,eventJson:t}:l}))),bs=d((({className:e="",href:t,target:l,onClick:n,data:a,children:i})=>{const r=pe()({href:t,target:l,onClick:n});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...ge(a),children:i})})),ys=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],vs=d((({className:e="",media:t,showButtonText:l,stretched:a,version:i="white",children:r})=>{if(!t?.length)return null;const[s,d]=n(),m=t?.map((e=>{const{href:t,icon:n,text:a}=e,{iconMapped:r}=(e=>ys.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Ge(n)?n:r,c=l?{text:a}:{text:""};return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:"color"},version:e?.version??i}})),h=u("border border-solid hover:border-transparent group-data-primary:border-main-divider border-main-divider group-data-gray:border-green group/media",l&&s?"":"basis-auto",Ns(a));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),children:[o("div",{className:"flex gap-xs",children:Qe(m,{className:ws(s??!1,a??!1,l),buttonClassName:h})}),r?o(Le,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Ns=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",ws=(e,t,l=!1)=>u(e||t?"basis-full":"",!t||l&&e?"":"flex-nowrap"),ks=d((({className:e,padding:t,description:l,additionalDescription:n,href:a,icon:i,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:g,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:b=true,isImageSecondary:y=!1}={},data:v,...N})=>o(f,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(bs,{href:a,target:m,className:"h-full",data:fs(v),children:c(Ce,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(T,{title:h,description:l,headlineVersion:"XS",isEmbedded:!0,align:p}),...ot(Ge(i)?o(ae,{image:i}):null,x),buttons:d.length?o(vs,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(Ye,{benefits:g}),s?o($e,{__html:s,isDotted:r,itemSize:"list-s"}):null,Ss(n,p)]})})}))),Ss=(e,t)=>e?o(S,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Cs=(e,t)=>{const{title:l,description:n,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[l?o("div",{className:"opacity-80",children:o(Le,{size:"text-m",color:"text-secondary-text",children:l})}):null,n?o("div",{className:"mt-2xs",children:o(Le,{size:"text-xl",color:"text-primary-text",children:n})}):null,a?.length?o("div",{className:"text-primary-main",children:Qe(a)}):null]},String(t))},Ts=d((({className:e="",title:t,align:l="text-center",icon:i,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const g=d.map(Cs),[x,b]=s>0?[g.slice(0,s),g.slice(s)]:[g,[]],[y,v]=n(!1);return a((()=>me.subscribe("fold",(e=>{void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(f,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[Ge(i)?o("div",{className:"self-center",children:o(ae,{image:i})}):null,t?o(k,{className:u("pt-xs",l),headingType:"h5",title:t}):null,r?.text?o(ve,{className:"w-full mt-m mb-lg",...r}):null,b.length?o(Ja,{renderFoldableSection:()=>c("div",{children:[x,o(Za,{isUnfolded:y,children:b})]}),renderFoldButton:d.length>=s?Is(y,m?.parent,h):null}):o("div",{children:x})]})})),Is=(e,t,l)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==t&&me.fire("fold",{type:"fold",isUnfolded:!e,parent:t})},type:"button",...e?ge(l):{},children:[o("div",{children:e?"Скрыть":"Подробнее о тарифе"}),o(q,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Bs=d((({className:e,contacts:t,info:l,version:n="secondary",...a})=>c(f,{className:u("flex",e),defaultPadding:"p-6xl",version:n,...a,children:[l?.length?Ps(l):null,t?.length?Ps(t):null]}))),Ps=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>Ms({column:e,i:t})))}),Ms=({column:e,i:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:l,button:n},a)=>c("div",{children:[o(T,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),l?o("div",{className:"mt-xs opacity-80",children:o(S,{size:"text-m",font:"font-light",children:l})}):null,n?.text?o(ve,{className:"mt-xl",...n}):null]},String(a))))},`col-${String(t)}`):null,Rs=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Vs=(e,t)=>Array.from({length:t-e+1},((t,l)=>e+l)),zs=1e9,Ds={sum:{min:1e4,max:zs},period:3},_s=St((({className:e,filtrationSchema:t={},resetButton:l,sumInput:n,periodInput:a,...i})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=pi(Ds,{block:i.block,page:i.options?.page,normalize:e=>({...e,period:As(e)})}),h=s.map((([,e])=>e?.paramsSource?.rateRows)),p=$s(h);return c(f,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(si,{filtrationSchema:t,resetButton:l,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Gr,{label:n?.title,min:500,max:zs,...d("sum",{parse:e=>({min:Number(e),max:zs}),format:({min:e})=>String(e)})}),o(Pn,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(ni,{blocksToRender:r,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),As=e=>yt((e?.paramsSource?.rateRows||[]).filter(Rs).flatMap((e=>Vs(e.minMonths,e.maxMonths)))),$s=e=>yt(e.flatMap((e=>e||[])).filter(Rs).flatMap((e=>Vs(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],js=[{key:"10"},{key:"50"},{key:"100"}],Ls=({itemCount:e,onItemCountChange:t})=>{const l=i((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(kl,{className:"min-w-20",onChange:l,value:{key:String(e)},options:js,iconVersion:"black"})]})},Os="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",Es=(e,t)=>{const{currentPage:l,onPageChange:n,totalPages:a}=e,i=t+1;return i===l?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:i},String(t)):1!==i&&i!==a&&((e,t,l)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,l)=>t<=2&&e<=t+2||t>=l-1&&e>=l-3)(e,t,l))(i,l,a)?o("div",{onClick:()=>n(i),className:Os,"aria-label":`Страница ${i}`,children:i},String(t)):null},Fs={width:"24",height:"24"},Us=({currentPage:e,onPageChange:t,totalPages:l})=>{const n=r((()=>Array.from({length:l}).fill({currentPage:e,onPageChange:t,totalPages:l})),[l,e]),a=i((()=>{e>1&&t(e-1)}),[e]),s=i((()=>{e<l&&t(e+1)}),[e,l]),d=i((()=>t(1)),[]),m=i((()=>t(l)),[l]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:a,children:o(q,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Ws(1===e),...Fs})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Os,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,n.map(Es),e<l-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<l?o("div",{onClick:m,className:Os,"aria-label":`Страница ${l}`,children:l}):null]}),o("div",{onClick:s,children:o(q,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Ws(e===l),...Fs})})]})},Ws=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Hs=({currentPage:e,onPageChange:t,totalPages:l,itemCount:n,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Us,{currentPage:e,onPageChange:t,totalPages:l}),n&&a?o(Ls,{itemCount:n,onItemCountChange:a}):null]}),Ks=d((({className:e,value:t,autoFocus:l,onChange:n,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{n&&n(e.target?.value||"")}),[n]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ae,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",pl),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:l,onChange:s,onFocus:a})]})})),qs=d((({field:e,onClearFilter:t,filtrationState:l})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Ks,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(jl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:l.endDate,...e("startDate")}),o(jl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:l.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(Qt,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Xs=({title:e,timestamp:t,publicId:l})=>{const n=pe(),{href:a}=n({href:`/api/v1/depository/${l}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[null,c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Le,{size:"text-m","font-weight":"font-light",children:Bt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},l)},Ys="/api/v1/depository",Gs={startDate:void 0,endDate:void 0,query:""},Qs=St((({className:e,...t})=>{const[l,a]=n(0),[r,s]=n(10),[d,{field:m,reset:h}]=Kt(Gs),{totalPages:p=0,items:g=[]}=(({size:e,page:t,query:l,startDate:n,endDate:a})=>{const i=n?Bt(n,!0):"",r=a?Bt(a,!0):"",s=new URLSearchParams(Ys);s.set("page",String(t)),s.set("size",String(e)),s.set("query",l),s.set("timestampStart",i),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=fn(Ys+o,bt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:l,...d}),x=i((e=>a(e-1)),[]),b=i((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(f,{className:u(e,"container p-6xl"),...t,children:[o(qs,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Le,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Le,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),g.length?g.map((e=>o(Xs,{...e},String(e.publicId)))):o(ba,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Hs,{currentPage:l+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:b})]})]})})),Js=e=>"Image"===e?.contentType&&e?.image?o(ae,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Zs=d((({className:e="",title:t,description:l,error:n,button:a,...i})=>c(f,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...i,children:[o("div",{className:"flex justify-center",children:Js(n)}),o(T,{title:t,description:l,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ve,{version:a?.version,text:a?.text,...a}):null]}))),eo="location";function to(e="Москва"){const[t,l]=((e,t,l)=>{const[r,s]=n(l||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,i((l=>e.fire(t,l)),[e,t])]})(me,"location",no()??{name:e}),r=i((e=>{ao(e),l(e)}),[]),{data:s}=fn(lo()?null:"/api/v1/region",bt);return a((()=>{s&&!lo()&&l(s)}),[s]),[t??{name:e},r]}const lo=()=>Boolean(globalThis.localStorage?.getItem(eo)),no=()=>{try{const e=globalThis.localStorage?.getItem(eo);return e&&JSON.parse(e)}catch(e){return null}},ao=e=>{try{globalThis.localStorage?.setItem(eo,JSON.stringify(e))}catch(e){}};var io;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(io||(io={}));const ro=new Intl.NumberFormat("ru",{style:"currency",currency:io.RUB}),so=e=>e?ro.format(e):"",oo="text-m font-light text-secondary-text ",co=`${oo} text-left`,mo=`${oo} pl-5xl text-center`,ho=`${oo} pl-5xl text-right`,uo={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},po=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:co,children:o(Le,{size:"text-m",children:"Валюта"})}),o("th",{className:mo,children:o(Le,{size:"text-m",children:"Купить"})}),o("th",{className:ho,children:o(Le,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(go)})]}))),go=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ae,{image:{icon:uo[t]},width:"24",height:"24"}):null,o(Le,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Le,{size:"text-h6",children:so(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Le,{size:"text-h6",children:so(e?.buyExchangeRate)})})]},t)},xo={icon:"GpsIcon"},fo=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Ni,{...xo,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(S,{size:"text-l",color:"text-primary-main",children:t}):null,o(S,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),bo=(e,t,l)=>{const n=Number(yo(e))*Math.pow(t,l?-1:1);return Number.isInteger(n)?n:((e,t=2)=>{const l=10**t;return Math.round(parseFloat(String(e))*l)/l})(n)},yo=e=>e.replace(/[^\d.,]/g,"").replace(",","."),vo=e=>Ot([[e=>e.value!==io.RUB&&e.oppositeValue!==io.RUB,()=>e.handleConvert(e.value,io.RUB)],[e=>e.value===io.RUB&&e.oppositeValue===io.RUB,()=>e.handleConvert(e.value,io.USD)],[e=>e.value===io.RUB&&e.oppositeValue===io.RUB,()=>e.handleConvert(e.value,io.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function No(e){const{placeholder:t,rates:l,selected:n,value:a,setValue:i,setSelected:r}=e,s=l.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:n,text:n};return c("div",{className:"relative flex",children:[o(gl,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:i}),s.length?o(kl,{isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const wo=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:l,button:a})=>{const[r,s]=n({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||io.RUB,selectBuy:l?.[0]?.currency?.currency||io.USD}),d=i((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&l?c("div",{className:"grid gap-m",children:[No({placeholder:"Хочу продать",rates:l,selected:r.selectSell,setSelected:ko(r,d,l),value:r.inputSell,setValue:e=>Co(d,l)(e,r.selectSell,r.selectBuy)}),No({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:So(r,d,t),value:r.inputBuy,setValue:e=>To(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(ve,{text:a.text,version:a?.version,...a}):null]})})),ko=(e,t,l)=>n=>{t({selectSell:n}),vo({value:n,oppositeValue:e.selectBuy,handleConvert:(n=e.selectSell,a=e.selectBuy)=>{Co(t,l)(e.inputSell,n,a)}})},So=(e,t,l)=>n=>{t({selectBuy:n}),vo({value:n,oppositeValue:e.selectSell,handleConvert:(n=e.selectBuy,a=e.selectSell)=>To(t,l)(e.inputBuy,n,a)})},Co=(e,t)=>(l,n,a)=>{e({inputSell:yo(l),selectBuy:a});const i=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===n))?.buyExchangeRate;i&&e({inputBuy:String(bo(l,i,n===io.RUB)||"")})},To=(e,t)=>(l,n,a)=>{e({inputBuy:yo(l),selectSell:a});const i=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===n))?.saleExchangeRate;i&&e({inputSell:String(bo(l,i,n===io.RUB)||"")})};const Io=d((({className:e="",title:t="Курсы обмена валют",button:l,...n})=>{const[a]=to(),i=function(e){const t=e?.code||"000",{data:l}=fn(`/api/v1/exchangerates?regionCode=${t}`,bt);return l||{}}(a),r=Bo(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:io.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:io.RUB}}),o(f,{className:u("box-border min-h-80",e),...n,children:o(Ce,{className:"h-full",title:o(k,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[r?o(po,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(fo,{address:i?.address})]}),o(wo,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:l})]})})})})),Bo=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Po=d((({className:e="",items:t})=>{const l=pe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Mo(l))})})),Mo=e=>({dataFooter:t,...l},n)=>{const{text:a,href:i,target:r,onClick:s}=e(l);return a?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:i,target:r||"_self",onClick:s,...ge(t),children:a||null})},String(n)):null},Ro=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),Vo=["all","footer"],zo=d((({className:e,navigationItems:t})=>{const l=pe();return o("div",{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2",e),children:t?.filter(Ro(Vo)).map(l).map(Do)})})),Do=(e,t)=>{const{text:l,items:n=[],href:a,target:i="_self",onClick:r,dataFooter:s}=e,d=n.filter(Ro(Vo));return c("div",{role:"menuitem",className:"flex flex-col gap-s w-full @md:w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:i,onClick:r,...ge(s),children:l}),d?o(Po,{items:d}):null]},String(t))},_o=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Ao)}):null)),Ao=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Le,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map($o)})]},String(t)),$o=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:jo(e.type,e.text)}),o(S,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),jo=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Lo(t)}`,children:o(Le,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(S,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Lo=e=>e.replaceAll(/\D/g,""),Oo=d((({className:e="",index:t,text:l,...n})=>{const a=pe(),{href:i,target:r,onClick:s}=a(n);return o("a",{className:u("text-secondary-text",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),Eo=d((({className:e="",title:t,links:l})=>o("div",{className:e,children:l?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Le,{size:"text-l",font:"font-normal",children:t})}),l.map(((e,t)=>o(Oo,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Fo="w-full lg:w-52",Uo={width:"40",height:"45"},Wo={"bg-white":"color",transparent:"white"},Ho={"bg-white":"text-primary-main",transparent:"text-white"},Ko=(e,t,l)=>o(ae,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Wo[e]},className:Ho[e],width:l?.width,height:l?.height}),qo={"bg-white":"text-primary-text",transparent:"text-white"},Xo=d((({className:e,href:t="/",logo:l,children:n,targetBlank:a,bgColor:i="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:l?.href??t,target:a?"_blank":"_self","aria-label":l?.title??"Россельхозбанк",...ge(s),children:[Ko(i,l?.image,Uo),r?n??o("div",{className:"ml-s",children:o(Le,{font:"font-medium",color:qo[i],size:"",children:l?.title??"Россельхозбанк"})}):null]})));function Yo(e,t,l=300){a((()=>{const t=globalThis.setTimeout(e,l);return()=>{globalThis.clearTimeout(t)}}),t)}const Go=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:l,s1Matches:n,s2Matches:a}=function(e,t){const l=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),n=Array.from({length:e.length}),a=Array.from({length:t.length});let i=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-l),o=Math.min(r+l,t.length-1);for(let l=s;l<=o;l++)n[r]||a[l]||e[r]!==t[l]||(i++,n[r]=!0,a[l]=!0)}return{m:i,s1Matches:n,s2Matches:a}}(e,t);if(0===l)return 0;const i=function(e,t,{s1Matches:l,s2Matches:n}){let a=0;for(let i=0,r=0;i<e.length;i++){if(!l[i])continue;let s=r;for(;s<t.length;s++)if(n[s]){r=s+1;break}e[i]!==t[s]&&a++}return a}(e,t,{s1Matches:n,s2Matches:a}),r=(l/e.length+l/t.length+(l-i/2)/l)/3,s=r>.7?.1*function(e,t){let l=0;for(;e[l]===t[l]&&l<4;)l++;return l}(e,t):0;return r+s*(1-r)};const Qo=(e,t)=>(l,n)=>{for(const[a,i]of n)l.set(a,e(l.get(a)||t,i));return l},Jo=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Zo=e=>t=>e.map((([e,l])=>[Go(t)(e),l])).filter((([e])=>e>=.8)).map((([e,t])=>tc(t,e))).reduce(Qo(Math.max,0),new Map),ec=e=>t=>{return di(t,t.map((({title:e})=>e)).map((e=>t=>{const l=Jo(t||"");return l.length?De(e.map((e=>Oa(l.map(Go(e)))))):0})(e))).sort((n=([,e])=>e,l=(e,t)=>n(e)-n(t),(e,t)=>-l(e,t))).map((([e])=>e));var l,n},tc=(e,t)=>new Map(e.map((e=>[e,t]))),lc=({basePathList:e,initialQuery:t=""})=>{const[l,i]=n(t||"");a((()=>{null!=t&&i(t)}),[t]);const{data:r}=fn(e?.length?e:null,nc),[s,o]=n(null);return Yo((()=>{r&&o(r.map((e=>t=>{const{corpus:l,dictionary:n}=t||{};if(!(e&&l?.length&&n&&Object.keys(n).length))return[];const a=Jo(e);if(!a.length)return[];const i=Object.entries(n),r=[...a.map(Zo(i)).reduce(Qo(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>l[e]));return ec(a)(r)})(l)))}),[r,l]),[s,{value:l,onChange:i}]},nc=async(...e)=>(await Promise.allSettled(e.map((e=>ft(O(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),ac=d((({initialQuery:e,navigationItems:t})=>{const l=r((()=>t?.map((e=>e.href||"/"))),[t]),[n,a]=lc({basePathList:l,initialQuery:e}),i=r((()=>ic(t)(n)),[t,n]);return o(Zt,{head:o(Ks,{autoFocus:!0,...a}),children:o(zo,{navigationItems:i})})})),ic=e=>t=>e?.length&&t?.length?di(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:O("/",t)})))}))):[],rc=(e={})=>{const{open:t,close:l}=he();return{open:(l={},n={})=>t(o(ac,{...e,...l}),n),close:l}},sc=d((({className:e,search:t,...l})=>{const[a,r]=n(""),s=i((()=>r("")),[]),d=rc(l),m=i((e=>{r(e),oc(e)&&d.open({initialQuery:e},{onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(Ks,{value:a,placeholder:t?.placeholder,onChange:m}),o(Jt,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),oc=e=>e&&e.length>=3,cc=(e,t)=>{const{logo:l}=e??{},{dataHeader:n,dataFooter:a,...i}=l??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(Xo,{className:Fo,logo:i,data:a}),o(sc,{className:"grow",navigationItems:t,...e})]})},dc=d((({className:e="",index:t,...l})=>{const n=pe(),{href:a,target:i,text:r,onClick:s}=n(l);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:a,target:i,onClick:s,children:r||`Документ ${t}`})})),mc=d((({className:e="",links:t,license:l})=>c("div",{className:u("@container space-y-lg",e),children:[l?o("div",{children:o(Le,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${l}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(dc,{index:t,...e},String(t))))}):null]}))),hc=St((({className:e,footer:t,...l})=>{const{navigationItems:n}=l.options?.page?.navigation??{},a=l.options?.page?.common??{},{documents:i,relatedEnterprises:r,contacts:s,mediaLinks:d=[],horizontalNavigationTitle:m,feedbackButton:h,license:p,otherLinks:g=[]}=t??{};return c(f,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...l,children:[cc(a,n),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(zo,{navigationItems:n}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(Fo,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(_o,{items:s}),h?o(ve,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(vs,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),g.map(((e,t)=>o(ve,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Eo,{title:m,links:r}),o(mc,{links:i,license:p})]})})),uc=d((({className:e="",title:t,description:l,calendar:n,...a})=>c(f,{className:u("space-y-m",e),defaultPadding:"p-6xl",...a,children:[o(T,{title:t,description:l,headlineVersion:"M",isEmbedded:!0}),n?pc(n):null]}))),pc=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),l=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return c("div",{className:"w-full flex flex-col justify-center gap-s",children:[o("div",{className:"flex w-full text-h6 text-center",children:l.map((e=>gc(e,t)))}),o("div",{className:"flex gap-s w-full",children:l.map(((e,t)=>c("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[o("div",{className:"flex gap-s",children:xc(e)}),c("div",{className:"text-s",children:[o(Le,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(Le,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},gc=(e,t)=>e.month?.map(((e,l)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${l}`))),xc=e=>e.month?.map((e=>e.image?.src?o("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:o(ae,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),fc=St((({className:e,title:t,button:l,regionSource:a,data:i,...r})=>{const[s,d]=n({key:""}),m=a?.regions??[],h=de({className:"text-white",version:l?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,g=l?.text?l.text:"Перейти";return o(f,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(k,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Gl,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(ve,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:fs(i,s?.key),children:g})}):null]})})}));function bc(e=[]){const t=z(),l=Array.from(e.entries()).filter((([,e])=>yc(t)(e)));return l.find((([,e])=>yc(t,!0)(e)))??l[l.length-1]??[]}const yc=(e,t=!1)=>({href:l})=>{if(!l)return!1;const n=L(vc(e)(l));return t?n===L(l):n.startsWith(L(l))},vc=e=>t=>{const l=J(Q.SITE_URL);return A(t)?e.href:O(l,e.pathname)},Nc=d((({className:e="",items:t,activeItem:l,ariaLabel:n})=>{const[r,{setFalse:d,toggle:m}]=hl(!1),h=yl(d),p=s(null),g=i((({isOpened:e,buttonRef:t,menuRef:l})=>{if(e&&t.current&&l.current){const e=l.current.getBoundingClientRect(),n=t.current.getBoundingClientRect(),a=globalThis.innerWidth-e.width;e.right>=globalThis.innerWidth?l.current.style.left=`${a}px`:n.left>e.left&&(a>n.left?l.current.style.left="":l.current.style.left=`${a}px`)}}),[r]);return bl(globalThis,"resize",(()=>g({isOpened:r,buttonRef:h,menuRef:p}))),a((()=>{g({isOpened:r,buttonRef:h,menuRef:p})}),[r]),c("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:h,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":n,onClick:m,children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),o("div",{ref:p,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",r?"":"hidden"),"aria-hidden":!r,children:t?.map(((e,t)=>o(wc,{isActive:e===l,...e},e?.text??String(t))))})]})})),wc=d((({isActive:e,...t})=>{const l=pe(),{text:n,href:a,target:i,onClick:r}=l(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",e?"text-primary-main":""),href:a,target:i,onClick:r,role:"menuitem",...ge(t?.data),children:n})})),kc={default:"w-6 h-6",large:"w-12 h-12"},Sc=d((({className:e,isRounded:t,buttonSize:l="default",isGrayBg:n=!1,disabled:a,ariaLabel:i,image:r,data:s,onClick:c,version:d})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",n?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":n&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${kc[l]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:a,"aria-label":i,onClick:c,...ge(s),children:o(ae,{image:r,className:u("h-full",t?"bg-main-divider/20 rounded-full":""),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Cc=e=>globalThis[e],Tc=(e,t)=>{const l=document.getElementById(t);if(l){const t=Cc(e);return t?Promise.resolve(t):new Promise((t=>{l.addEventListener("load",(()=>{t(Cc(e))}))}))}return new Promise(((l,n)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{l(Cc(e))})),a.addEventListener("error",(e=>{n(e)})),document.head.appendChild(a)}))};const Ic="chatbot",Bc="text-page__btn-chat",Pc={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},Mc=d((({chat:e="personal",iconVersion:t,className:l,ariaLabel:n="Чат",version:i})=>{const r=(e=>{a((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=Pc[e??""];return l=>{if(t)if("personal"!==e)Tc(Ic,t);else{const e=l.target;e?.classList.contains(Bc)||e?.classList.add(Bc),document.getElementById("webchat-js-container:webchat_rshb")||Tc(Ic,t)}}})(e);return o(Sc,{className:l,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:n,onClick:r,buttonSize:"large",isGrayBg:!0,version:i})})),Rc=d((({className:e="",active:t,dataItemName:l,children:n,data:a,...i})=>{const r=pe(),{href:s,target:d,text:m,onClick:h}=r(i);return c("a",{className:u("relative inline-block bg-transparent text-center no-underline",e),href:s,target:d,"data-item-name":l,onClick:h,...ge(a),children:[o("span",{className:Vc(t),children:m||n}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),Vc=(e=!1)=>u("font-sans text-l lg:font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),zc=d((({observerOptions:e,onVisibilityChange:t,children:l,className:n,...a})=>{const r=Na(i((e=>{if(!e.length||!t)return;const l=e[e.length-1];t(l.isIntersecting)}),[t]),e);return o("span",{ref:r,className:n,role:"menuitem",children:o(Rc,{...a,children:l})})})),Dc={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},_c=d((({version:e,text:t,mobileText:l,...n})=>{const a=fa()?l:t;return a?o(ve,{className:u("py-s px-lg font-light whitespace-nowrap",Dc["transparent"===e?"transparent":"default"]),...n,children:a}):null})),Ac=d((({subItems:e=[],version:t,internetBankButton:l,dropdownMenuAriaLabel:a,chatBotAriaLabel:i})=>{const d="transparent"===t?"white":"black",[,m]=bc(e),[h,u]=n(e.length),p=e.slice(h),g=s(null),x={rootRef:g},f=r((()=>e.map(((e,t)=>e=>{u(e?$c(t):jc(t))}))),[e]);return c("nav",{className:"mt-s flex gap-s items-center justify-between",children:[o("div",{ref:g,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg",role:"menu",children:e.map(((e,t)=>o(zc,{className:h-1<t?"invisible":"",active:e===m,observerOptions:x,onVisibilityChange:f[t],data:e.dataHeader,...e},String(t))))}),p.length?o(Nc,{items:p,activeItem:m,ariaLabel:a}):null,_.CHAT_BOT?o(Mc,{version:t,iconVersion:d,chat:_.CHAT_BOT,ariaLabel:i}):null,o(_c,{version:t,...l})]})})),$c=e=>t=>Math.max(t,e+1),jc=e=>t=>Math.min(t,e),Lc=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Le,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(Oc,{...e},String(t))))})]}):null,Oc=d((({icon:e,...t})=>{const l=pe(),{text:n,target:a,href:i,onClick:r}=l(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ae,{image:e}):null,n?o("a",{className:"hover:text-primary-hover",href:i,target:a,onClick:r,children:o(Le,{size:"text-l",font:"font-light",color:"text-primary-text",children:n})}):null]})})),Ec=(e,t)=>l=>l.name?o(bs,{href:`/branches/${l.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(l),data:fs(e,l.name),children:o(Le,{size:"text-l",font:"font-light",children:l.name})},String(l.id)):null,Fc=d((({className:e,searchTerm:t,onSearch:l})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(pl,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>l(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),Uc=d((({foreignOffices:e,branches:t})=>{const[l,a]=to(t?.default),r=pe(),{href:s}=r({href:`/branches/${l.slug}`}),[d,m]=n(""),h=Hc(Kn()).sort(((e,t)=>e.name.localeCompare(t.name))),u=((e,t)=>{const l=new Map;for(const n of e){const e=t(n),a=l.get(e)||[];l.set(e,[...a,n])}return l})(h,Wc),{close:p}=he(),g=i((e=>{a(e),p()}),[]);return c(Zt,{className:"pb-20",head:c("div",{children:[o(Le,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),l?o("div",{className:"mb-s",children:c(S,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(bs,{href:s,className:"inline mx-2xs text-primary-main",children:l.name})]})}):null,o(Fc,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:h.filter((({name:e})=>e&&Go(e.toLowerCase())(d.toLowerCase())>=.8)).map(Ec(t?.dataSelect,g))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(u.entries()).map((x=g,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Le,{size:"text-h6",children:e})}),t.map(Ec(f,x))]},e)))}),Lc(e)]});var x,f})),Wc=e=>e.name?.charAt(0)||"",Hc=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Kc=d((({className:e="",active:t,flat:l,children:n,data:a,...i})=>{const r=pe(),{href:s,target:c,text:d,onClick:m}=r(i);return o("a",{className:u(qc(t,l),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":d,...ge(a),children:o("span",{suppressHydrationWarning:!0,className:Xc(t,l),children:d||n})})})),qc=(e=!1,t=!1)=>u("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",t?"":"px-m py-xs"),Xc=(e=!1,t=!1)=>u("font-sans text-s font-light",e?"text-primary-main":u(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Yc=d((({className:e,version:t,...l})=>{const n="transparent"===t?"white":"black",[a]=to(l?.branches?.default),r=rc(l),s=(e=>{const{open:t,close:l}=he();return{open:(l={})=>t(o(Uc,{...e}),l),close:l}})(l),d=i((()=>r.open()),[r]),m=i((()=>s.open()),[s]);return c("div",{className:u("flex items-center ml-5 md:max-w-[300px] xl:max-w-full gap-lg",e),role:"navigation",children:[l?.branches?.visible?o(Kc,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:a?.name,data:fs(l?.branches?.dataClick,a?.name??""),onClick:m}):null,l?.officesAtms?.href?o(Kc,{className:"whitespace-nowrap",flat:!0,...l.officesAtms}):null,o(Sc,{image:{icon:"LoupeIcon",iconVersion:n},ariaLabel:l?.search?.ariaLabel??"Поиск",onClick:d,data:l?.search?.data})]})})),Gc=d((({observerOptions:e,onVisibilityChange:t,children:l,className:n,...a})=>{const r=Na(i((e=>{if(!e.length||!t)return;const l=e[e.length-1];t(l.isIntersecting)}),[t]),e);return o("span",{ref:r,className:n,role:"menuitem",children:o(Kc,{...a,children:l})})})),Qc=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:l,version:a,headerData:i,search:d,bgColor:m,logo:h})=>{const[u,p]=n(e.length),g=e.slice(u),x=s(null),f={rootRef:x},b=r((()=>e.map(((e,t)=>e=>{p(e?Jc(t):Zc(t))}))),[e]),{dataFooter:y,dataHeader:v,...N}=h??{};return c("div",{className:"flex items-center justify-between",children:[o(Xo,{className:"mr-3xl",bgColor:m,logo:N,data:v}),o("div",{ref:x,className:"overflow-hidden min-w-[160px] pb-xs mt-xs",role:"menu",children:e.map(((e,l)=>o(Gc,{className:u-1<l?"invisible":"",active:e===t,observerOptions:f,onVisibilityChange:b[l],data:e.dataHeader,...e},String(l))))}),g.length?o(Nc,{className:"mx-xs",items:g,activeItem:t,ariaLabel:l}):null,o(Yc,{version:a,className:"ml-auto",search:d,navigationItems:e,...i})]})})),Jc=e=>t=>Math.max(t,e+1),Zc=e=>t=>Math.min(t,e),ed={"bg-white":"primary",transparent:"transparent"},td=["all","header"],ld=St((({className:e,bgColor:t="bg-white",logo:l={},version:n=ed[t],portal:a,header:i={},...r})=>{const{common:s,navigation:d}=ad(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=bc(m),{internetBankButton:g}=a||{},x=l.image?.icon||l.image?.src||l?.title?l:h;return o(f,{tag:"header",className:u("pt-m px-20",p?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:n,...r,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(Qc,{activeTopItem:p,navigationItems:m?.filter(Ro(td)),version:n,headerData:{...i,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",nd(n))}),p?.items?.length&&o(Ac,{subItems:p?.items?.filter(Ro(td)),version:n,internetBankButton:g})]})})})),nd=e=>"transparent"===e?"opacity-30":"",ad=e=>({navigation:e?.navigation??{},common:e?.common??{}}),id=(e=!1)=>e?{}:{padding:"p-0"},rd={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},sd=St((({className:e="",padding:t="p-0",gap:l="XS",isInnerPadding:n=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r,...s})=>o(f,{className:u("relative","grid grid-cols-12",rd[l],e),padding:t,version:a,isTheme:i,...s,children:V({...s,extraProps:{...id(n),className:ya(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),od=d((e=>{const{className:t,align:l,image:n,...a}=e,i=l?u("flex",Bi[l]):"";return o(f,{className:u(i,t),defaultPadding:"p-0",...a,children:o(ae,{image:n})})})),cd=(e,t=0)=>{const{itemCount:l,visibleItemCount:a}=e,[r,s]=n(t),o=i((()=>s((e=>Math.min(e+1,l-1)))),[l]),c=i((()=>s((e=>Math.max(e-1,0)))),[l]),d=a?l>a&&r<l-a:r<l-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]};function dd({dec:e,inc:t,canDec:l,canInc:n,btnClass:a,className:i=""}){return l||n?c("div",{children:[l?o(Ra,{className:u("absolute z-40",a[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!l}):null,n?o(Ra,{className:u("absolute z-40 rotate-180",a[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!n}):null]}):null}const md=d((({className:e="",cards:t=[],button:l})=>{const[a,r]=n(0),s=i((e=>r(e)),[]),d=t.length,[m,h]=cd({itemCount:d,visibleItemCount:2}),{canDec:u,canInc:p}=h,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden",children:[d?hd({activeIndex:m,cards:t,selectedCardIndex:a,onClick:s}):null,dd({...h,btnClass:["left-12","right-12"],className:"top-16"}),u?o("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,p?o("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),o(ve,{className:"w-60 text-center",version:"primary",...l,href:g})]})}));function hd({activeIndex:e,cards:t,selectedCardIndex:l,onClick:n}){const a=460*e,i=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${a}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${i}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:l,onClick:n}){return c("button",{type:"button",onClick:n,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(l?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?o(ae,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,c("div",{className:"flex gap-s",children:[e?.sum?ud("страховая сумма",e.sum):null,e?.fee?ud("страховой взнос",e.fee):null]}),pd(l)]},String(t))}({slide:e,i:t,isActive:Boolean(t===l),onClick:()=>n(t)})))})})}function ud(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(Le,{size:"text-h6",children:[tt(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(Le,{size:"text-l",color:"text-secondary-text",children:e})})]})}function pd(e){return e?o(ae,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const gd=d((({className:e="",title:t,insuranceTabs:l=[],button:a,...r})=>{const[s,d]=n(0),m=i((e=>d(e)),[]);return c(f,{className:u("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?o(k,{className:"text-center",title:t,headingType:"h3"}):null,l?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:l.map(((e,t)=>function({title:e,i:t,isActive:l,onClick:n}){return o("button",{type:"button",onClick:n,"aria-label":e,className:"box-border px-m py-s text-m font-light "+(l?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>m(t)})))}):null,o("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:xd({insuranceTabs:l,button:a})})]})})),xd=({insuranceTabs:e,button:t})=>{const l=e?.map((e=>e.cards));return l?.length?l.map(((e,l)=>o(md,{button:t,cards:e},String(l)))):null};const fd={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},bd={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},yd=d((e=>{const{className:t="",__html:l,isDotted:n,investmentZeroColumn:a,investmentColumns:i,...r}=e,s=i?[...i]:[];return a&&s.unshift(a),o(f,{className:t,defaultPadding:"p-4xl",...r,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[ii(o("div",{className:"w-px h-4 bg-gray"}))(s.map(vd)),o("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),o("div",{className:"border-t border-gray -mt-xs mx-3xl"}),o("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(kd)})]}):null,l?o("div",{className:"max-w-2xl font-light text-base",children:o($e,{__html:l,isDotted:n,itemSize:"list-s"})}):null]})})})),vd=(e,t,l)=>{const n=1===t,a=t===l.length-1;return o("div",{className:`${Nd(n,a,e.cells)}`,children:e.cells?.length?o("div",{className:"w-full "+(a?"border-4 border-green-more-dark p-1.5 min-w-72":""),children:e.cells.reverse().map(wd)}):null},`column_${t}`)},Nd=(e,t,l=[])=>[l.length?"flex-1":"flex-0",!l.length||e||t?"":"pl-s",l.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),wd=(e,t)=>{const l=e.cellSize||"XS",n=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${bd[l]} ${fd[n]} ${"XS"===l?"px-s":"px-5xl"}`,children:o(Le,{align:"text-center",children:e.text})},`cell_${t}`):null},kd=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52",children:e.title},`title_${t}`):null,Sd=["байт","Кб","Мб","Гб","Тб","Пб"],Cd=d((({icon:e,text:t,href:l,target:n,fileFormat:a,data:i,fileSize:r})=>{const s=r&&a?",":"",d=r??"",m=a?String(a):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:l,target:n,...ge(i),children:[e,t?c(Le,{size:"text-l",font:"font-light",children:[t," ",Td(d,m),o(Le,{color:"text-secondary-text",children:l&&`${d+s+m}`})]}):null]})})),Td=(e,t)=>e||t?o("span",{children:", "}):"",Id=(e,t)=>(l,n)=>{const a=H(e)("Attachment"===l?.docType?l?.attachment?.src:l?.href),i="Attachment"===l?.docType?((e,t=2)=>{if(0===e)return"";const l=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,l)).toFixed(t))} ${Sd[l]}`})(l?.attachment?.fileSize||0):l?.fileSize,r="Attachment"===l?.docType?Pd(a):l?.fileFormat;return c("div",{role:"listitem",children:[o(Cd,{text:l?.text,target:l?.target,href:a,fileFormat:r,fileSize:i,icon:Bd(t),data:l?.data}),o($e,{__html:l?.__html})]},String(n))},Bd=e=>e?o(ae,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,Pd=e=>{if(!e)return"";const t=e.lastIndexOf("."),l=new RegExp(/\/(.*)/),n=-1!==t?e.substring(t+1):"";return n.includes("/")?n.replace(l,""):n},Md=d((({href:e,__html:t,target:l})=>{const{close:n}=he(),a=z(),r=H(a)(e),s=i((()=>{n()}),[]);return c(Zt,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o($e,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ve,{text:"Я согласен",version:"primary",target:l,href:r,onClick:s}),o(Qt,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Rd=d((({text:e,href:t,target:l,__html:n})=>{if(!e&&!n)return null;const a=(e=>{const{open:t,close:l}=he();return{open:(l={})=>t(o(Md,{...e}),l),close:l}})({__html:n,href:t,target:l}),r=i((()=>a.open()),[a]);return o("button",{className:"text-primary-main",onClick:r,children:e})})),Vd={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},zd=St((({className:e="",title:t,description:l,align:n="text-center",documents:a,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=z();return c(f,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(T,{title:t,description:l,align:n,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Vd[r]),role:"list",children:a.map(Dd(d,i))}):null]})})),Dd=(e,t)=>(l,n)=>{const a=l?.docType;return""===a?null:"reportSource"in l&&l?.reportSource?.__html?_d(l,n):Id(e,t)(l,n)},_d=(e,t)=>{const l={text:e.text,target:e.target,__html:e.reportSource?.__html};return e.reportSource?.__html&&e.text?c("div",{role:"listitem",children:[o(Rd,{...l,href:Ad(e)?e?.href:e?.attachment?.src}),o($e,{__html:e?.__html})]},String(t)):null},Ad=e=>"href"in e,$d=St((({className:e,padding:t,align:l="text-left",buttons:n=[],description:a,image:i,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...g})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",b=i?.src?o(ae,{className:"hidden lg:block",image:i}):null;return o(f,{className:u("min-h-80",e),padding:"p-0",version:p,...g,children:c(Ce,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(k,{headingType:s,title:h,className:u("whitespace-pre-wrap",l)}),rightImage:b,buttons:Qe(n,{className:"flex-wrap"}),children:[a?o(Le,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o($e,{__html:r,itemSize:"list-m"}):null,o(Le,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ae,{className:"w-fit",image:d})}):null,i?.src?o(ae,{className:"lg:hidden",image:i}):null]})]})})})),jd=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Ld=(e=[],t={})=>e.filter((({content:e={}})=>hi(t,e))).length,Od=(e,t)=>e===t;const Ed=(Fd=function(...e){return(t,l)=>e.some((e=>e(t,l)))}(Od,((e=Od)=>(t,l)=>t===l||Boolean(t&&l&&t.length===l.length&&t.every(((t,n)=>e(t,l[n])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,l])=>Fd(l,t[e])))));var Fd;const Ud=[],Wd={},Hd={primary:"bg-white/30",secondary:"bg-main-divider"},Kd={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},qd=d((({count:e,version:t="secondary"})=>{const l=fa(),n=l?"bg-main-divider":Hd[t],a=Kd[t][l?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",n),role:"status",children:o(Le,{size:"text-xs",color:a,children:e})})})),Xd=({text:e,description:t,icon:l,isActive:n,type:a})=>{const i=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(n);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,role:"tab",children:[l?o(ae,{className:u("h-6 w-6 min-w-6 min-h-6",i.icon),image:{...l,iconVersion:l?.iconVersion??i.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===a?i.text:i.oldText,children:e}),o("div",{className:"animated"===a?i.desc:i.oldDesc,children:t})]})]})},Yd={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Gd={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Qd={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Jd={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Zd=d((({tag:e="div",item:t={},isActive:l=!1,type:n="default",onClick:a})=>{const i=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(i,{className:u("h-12","block flex-1","cursor-pointer",Yd[n],l?Jd[n]:Qd[n]),role:"tablist",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",l?Gd[n]:"text-secondary-text hover:text-primary-main"),children:[Xd({text:r,description:s,icon:d,isActive:l,type:n}),Number.isInteger(m)?o("div",{className:"ml-xs",children:o(qd,{count:m,version:jd(l,n)})}):null]})})})),em=d((e=>o(e?.item?.href?tm:lm,{...e}))),tm=d((e=>{const t=pe(),l=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:n,...a}=t({...e.item,onClick:l});return o(Zd,{...e,tag:"a",item:a,onClick:n})})),lm=d((({item:e={},onClick:t,...l})=>{const n=i((()=>{t&&t(e)}),[t,e]);return o(Zd,{item:e,onClick:n,...l})})),nm=(e,t,l)=>(n,a)=>o(em,{isActive:n===e,onClick:t,type:l,item:n},String(a)),am=d((({className:e,tabsType:t="default",items:l=[],activeItem:n,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel",children:l.map(nm(n,a,t))}))),im={categories:[],extraOptions:[],propertyType:[],stage:[]},rm=St((({className:e,hotFilters:t,filtrationSchema:l={},resetButton:n,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=pi(im,{block:a.block,page:a.options?.page}),g=i(((e=im)=>p(e)),[]),x=(({hotFilters:e=Ud,filtrationState:t=Wd,blocks:l=Ud,onFiltrationStateChange:n})=>{const a=r((()=>Math.max(0,e.findIndex((e=>Ed(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Ld(l,t.filter),version:jd(t===e[a])})))),[e,l,a]),o=i((t=>{n(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:g});return c(f,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(am,{...x}),o(si,{filtrationSchema:l,resetButton:n,field:m,reset:h}),o(ni,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),sm=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),om=d((({children:e})=>sm?e:null)),cm=d((({color:e="text-primary-main",position:t="absolute"})=>o("div",{className:u("flex justify-center items-center h-full w-full backdrop-blur-sm z-50",t),children:o("div",{className:u("inline-block h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),dm="/icons/MapMarkerClusterIcon.svg",mm="/icons/MapMarkerClusterYellowIcon.svg";function hm({yandexMaps:e,map:t,points:l,isLoad:n}){if(n||!l?.length)return;t.geoObjects.removeAll();const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),i=um("offices",e,a);if(l.length&&l.every((e=>"type"in e))){const n=um("workplaces",e,a),r=pm(l.filter((e=>"workplaces"===e.type)),"workplaces",e),s=pm(l.filter((e=>"offices"===e.type)),"offices",e);i.add(s),n.add(r),t.geoObjects.add(n),t.geoObjects.add(i)}else{const n=pm(l,"offices",e);i.add(n),t.geoObjects.add(i)}t.setBounds(e.util.bounds.fromPoints(l.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const um=(e,t,l)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?dm:mm,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:l,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),pm=(e,t,l)=>e.map((({coords:e,content:n})=>new l.Placemark(e,{balloonContentHeader:n?.header,balloonContentBody:n?.body,balloonContentFooter:n?.footer,hintContent:n?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?dm:mm,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),gm={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},xm={...gm,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},fm=(e,t,l)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(xm).join(" ")} ${l}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(q,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),bm=()=>function(e,t,l=!0){const[i,r]=n(void 0);return a((()=>{let n=!0;return Tc(e,t).then((e=>{n&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(n=!1,l){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,l]),i}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${_.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),ym={...gm,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},vm=d((({yandexMaps:e,direction:t="in"})=>{const l="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const l=e.current.getZoom(),n="in"===t?l+1:l-1;e.current.setZoom(n,{checkZoomRange:!0})},className:`${Object.values(ym).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(q,{name:l,width:"20",height:"16"})})})),Nm=[55.753995,37.614069],wm=d((({points:e,className:t="",zoom:l=5,isLoad:n})=>{const i=s(null),r=bm();if(a((()=>{i.current?(hm({yandexMaps:r,map:i.current,points:e,isLoad:n}),i.current.setCenter(km(e))):r?.ready((()=>{i.current||(i.current=new r.Map("map",{center:km(e),zoom:l,controls:[],suppressMapOpenBlock:!0})),hm({yandexMaps:r,map:i.current,points:e,isLoad:n})}))}),[r,e,l,n]),!r)return null;const d="z-10";return c("div",{id:"map",className:u("relative","w-full",t),children:[n?o(cm,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",d),children:[o(vm,{yandexMaps:i}),o(vm,{yandexMaps:i,direction:"out"})]}),fm(i,r,u("right-2 top-80",d))]})})),km=e=>{const t=[Cm(Sm(e,0)),Cm(Sm(e,1))];return t.every((e=>e))?t:Nm},Sm=(e,t)=>e.map((e=>e.coords?.[t])),Cm=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Tm=({__html:e,list:t})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o($e,{__html:e})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ae,{image:e.image}):null,e?.text?o(Le,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Im={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Bm="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Pm=(e,{field:t,reset:l},n)=>{const a=n?5:6,i=(e||[]).map((e=>o(rl,{text:Im[e],...t(e)},e))),[r,s]=a>0?[i.slice(0,a),i.slice(a)]:[i,[]];return o("div",{children:e?.length?o("div",{children:o(Ja,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Bm,children:r}),o(Za,{className:Bm,isUnfolded:e,children:s})]}),renderFoldButton:Mm(l,n)})}):null})},Mm=(e,t)=>({isUnfolded:l,onToggle:n})=>c("div",{className:"flex space-x-lg",children:[t?o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(q,{name:["ArrowDownIcon","ArrowUpIcon"][Number(l)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(l)],onClick:n}):null,o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Rm()})]}),Rm=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(q,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Vm=()=>{},zm=()=>[],Dm=e=>"all"===e?"block":"hidden",_m=d((({className:e,data:t=[],isLoad:l,remoteWorkplaces:a=[],renderCard:i=Vm,renderRemoteWorkplaceCard:s=Vm,filterItems:d=zm,getBalloon:m=Vm,getBalloonRemoteWorkplaces:h=Vm,initFilterState:p={},descriptionData:g,title:x})=>{const f=x?.includes("Офис"),[b,{field:y,reset:v}]=Kt(p),[N,w,k,S]=r((()=>{const e=d(t,b),l=d(a,b),n=[...e.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:m(e)}))),...l.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:h({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[e,n,l,e.length+l?.length]}),[t,a,b]),[C,T]=n("all");return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Am(x,S),g?Tm(g):null,f&&$m(t,C,T),o("div",{className:u("pb-3xl",Dm(C)),children:Pm(Object.keys(p),{field:y,reset:v},f)})]}),o("div",{className:"h-[600px]",children:o(om,{children:o(wm,{points:w,isLoad:l,className:"h-full"})})})]}),c(om,{children:[N.map(i),k.map(s)]})]})})),Am=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(k,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Le,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),$m=(e,t,l)=>{const n=jd("all"===t),a=jd("business"===t),i=(e,t,n)=>(e.currentTarget===e.target&&"business"===t&&n.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription)),l(t),n);return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(Qt,{"data-id":"all",onClick:t=>i(t,"all",e),version:n,children:"Для физических лиц"}),o(Qt,{"data-id":"business",onClick:t=>i(t,"business",e),version:a,children:"Для юридических лиц"})]})},jm={yellow:{border:"border-yellow-light",text:"text-yellow"},green:{border:"border-green-more-light",text:"text-green-dark"},gray:{border:"border-gray",text:"text-secondary-text"},red:{border:"border-error/30",text:"text-error"}},Lm=d((({className:e,children:t,color:l="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",jm[l].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ae,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Le,{size:"text-m",color:jm[l].text,children:t})]}))),Om=d((({value:e,subText:t,children:l,isPhone:n,...a})=>{const i=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[i.length,l,t].every((e=>!e))?null:Em({textItems:i,subText:t,children:l,isPhone:n,...a})})),Em=({label:e,labelSize:t="text-m",textItems:l,subColor:n,subText:a,className:i,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",i),children:[e?o(Le,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Fm(l,s),a?o(Le,{color:n,size:"text-m",children:a}):null]}),Fm=(e,t)=>e.filter(Boolean).map(((e,l)=>o(Le,{size:"text-l",children:t?o("a",{href:`tel:${Um(e)}`,children:e.trim()}):e.trim()},String(l)))),Um=e=>e.replace(/\D/g,""),Wm=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),Hm=["ArrowDownIcon","ArrowUpIcon"],Km=["Подробнее","Скрыть"],qm=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:Km[Number(e)]}),o(q,{className:"text-primary-text",name:Hm[Number(e)],width:"16",height:"16"})]}),Xm=({location:e,address:t,billAcceptorType:l,terminalType:n,billAcceptorEnable:a,atmCode:i="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Qm(n)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===l?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Le,{size:"text-h4",children:Qm(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(q,{name:"GeolocationIcon",width:"24",height:"24"}),o(Le,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Lm,{color:"green",children:Qm(s)})})]}),o("div",{className:"hidden sm:block",children:o(Wm,{className:"flex-wrap",children:m?.map(Gm)})}),o(Ja,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Za,{isUnfolded:e,children:o(Wm,{className:"flex-wrap",children:m?.map(Gm)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>qm({isUnfolded:e,onToggle:t})})]},String(d))},Ym=({address:e="",terminalType:t,atmCode:l=""})=>({header:`${Qm(t)} №${l}`,body:e.toUpperCase()}),Gm=(e,t)=>o(Om,{...e},String(t)),Qm=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Jm=[];const Zm=async e=>{const t=await ft(e,{method:"GET"});return Array.isArray(t)?t:Jm},eh={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},th={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},lh=d((({descriptionData:e,className:t})=>{const[l]=to(),n=l?.code??"000",{data:a,isLoad:i}=function(e){const{data:t,error:l}=fn(`/api/v1/atms?regionCode=${e}`,Zm);return{data:t||Jm,isLoad:!t&&!l}}(n);return o(_m,{className:t,filterItems:nh,data:a,isLoad:i,initFilterState:eh,renderCard:Xm,getBalloon:Ym,title:`Банкоматы филиала ${l?.name}`,descriptionData:e})})),nh=(e,t)=>{const l=Object.keys(t).filter((e=>t[e])),n=l.filter((e=>e.startsWith("terminalType"))),a=l.filter((e=>!n.includes(e)));return e.filter((e=>{const t=a.every((t=>th[t](e))),l=!n.length||n.some((t=>th[t](e)));return t&&l}))},ah=e=>{const t=rh(e);return o(Om,{label:"Режим работы",value:t,className:"max-w-none"})},ih=({workTime:e="",lunchHour:t="",daysOff:l=""},n=!1)=>e?[`${n?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",l?`не работает: ${l}`:""].filter(Boolean).join("; "):"",rh=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),l=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[ih({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:l?"":n}),ih({workTime:l?.workTime,lunchHour:l?.lunchHour,daysOff:n},!0)].filter(Boolean)},sh=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],oh=e=>sh.map((([t,l,n])=>({key:t,title:n,short:l,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),ch=e=>{if(!e)return null;const t=dh(e);return c(Wm,{className:"border-none",children:[o(Om,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(mh)})}),o(Om,{label:"Режим работы",className:"max-w-none",children:o(Le,{children:e})})]})},dh=e=>{const t=sh.map((([,e])=>({short:e,status:!0}))),l=e.split("/")??[],n=l[l.length-1]?.toLowerCase();return n?.includes("выходной")?t.map((e=>({...e,status:!n?.includes(e.short.toLowerCase())}))):t},mh=({short:e,status:t},l)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Le,{size:"text-xs",children:e})},String(l)),hh=({currency:e,buyExchangeRate:t,saleExchangeRate:l},n)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Om,{label:"Валюта",value:e.currency}):null,t?o(Om,{label:"Купить",value:String(t)}):null,l?o(Om,{label:"Продать",value:String(l)}):null]},String(n)),uh=(new Date).getDay(),ph=e=>{const[t]=e?.slice(uh-1)??[];if(!t)return null;const{lunchHour:l,status:n,workTime:a,hasLunch:i}=t;return n?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(Lm,{color:"green",children:a}):null,l&&i?o(Lm,{color:"yellow",children:`перерыв: ${l}`}):null]}):o(Lm,{color:"red",children:"Выходной"})},gh=({lunchHour:e,hasLunch:t=!1,status:l=!1})=>l?e&&t?`Перерыв ${e}`:e:"Не работает",xh=({title:e,status:t,workTime:l,lunchHour:n,hasLunch:a},i)=>o(Om,{label:e,value:t&&l?l:"",subText:gh({lunchHour:n,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(i)),fh=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,bh=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,yh=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,vh=({name:e,address:t,phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},h)=>{if(!d)return null;const u=oh(d);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Le,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(q,{name:"GeolocationIcon",width:"24",height:"24"}),o(Le,{size:"text-l",children:t})]}):null]}),ph(u)]}),o("div",{className:"hidden sm:block",children:Nh({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Ja,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Za,{isUnfolded:e,children:Nh({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>qm({isUnfolded:e,onToggle:t})})]},String(h))},Nh=({phone:e,fax:t,phoneBusiness:l,phoneNatural:n,phoneCallCentre:a,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const d=oh(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Wm,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Om,{label:"Факс",value:t,isPhone:!0}),o(Om,{label:"Телефон филиала",value:e,isPhone:!0}),o(Om,{label:"Для обращений юридических лиц",value:l,isPhone:!0}),o(Om,{label:"Обслуживание физических лиц",value:n,isPhone:!0}),o(Om,{label:"Для консультаций по валютному контролю",value:i,isPhone:!0}),o(Om,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(Wm,{children:o(Om,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(xh)})})}):c(Wm,{children:[o(Om,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(mh)})}),ah(d)]}),r?.businessScheduleVisibleTag?ch(r?.businessScheduleDescription):null,s?.currencies?.length?o(Wm,{className:"flex-wrap",children:s?.currencies?.map(hh)}):null]})},wh=({name:e="",address:t="",workSchedule:l})=>{const n=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const i=`${t} ${(e=>{const t=oh(e),l=e?rh(t):"",n=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?fh(l):yh(l,n):bh(l):null})(l)}`;return{header:n,body:i}},kh=({address:e,workScheduleDescription:t},l)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Le,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(q,{name:"GeolocationIcon",width:"24",height:"24"}),o(Le,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:Sh({workScheduleDescription:t})}),o(Ja,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Za,{isUnfolded:e,children:Sh({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>qm({isUnfolded:e,onToggle:t})})]},String(l)):null,Sh=({workScheduleDescription:e})=>c("div",{children:[c(Wm,{className:"flex",children:[o(Om,{label:"Операции для физических лиц",children:o(Le,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Om,{label:"Операции для физических лиц",children:o(Le,{children:"Оформление и обслуживание банковских карт"})}),o(Om,{label:"Операции для физических лиц",children:o(Le,{children:"Инвестиционное и накопительное страхование"})}),o(Om,{label:"Операции для физических лиц",children:o(Le,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Om,{label:"Режим работы",className:"max-w-none",children:o(Le,{children:e})})]}),Ch=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Th={branches:[],remoteWorkplaces:[]};const Ih=async e=>await ft(e,{method:"GET"})||Th,Bh={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Ph={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)},Mh=d((({className:e})=>{const[t]=to(),l=t?.code??"000",{data:n,isLoad:a}=function(e){const{data:t,error:l}=fn(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${e}`,Ih);return{data:t||Th,isLoad:!t&&!l}}(l);return o(_m,{className:e,filterItems:Rh,data:n?.branches,isLoad:a,remoteWorkplaces:n?.remoteWorkplaces,initFilterState:Bh,renderCard:vh,renderRemoteWorkplaceCard:kh,getBalloon:wh,getBalloonRemoteWorkplaces:Ch,title:`Офисы филиала ${t?.name}`})})),Rh=(e,t)=>{const l=Object.keys(t).filter((e=>t[e]));return e.filter((e=>l.every((t=>Ph[t](e)))))},Vh=d((({data:e,className:t,...l})=>{const n=e?.dataType??"offices";return o(f,{version:"transparent",className:u(t),defaultPadding:"p-0",...l,children:"offices"===n?o(Mh,{}):o(lh,{descriptionData:e})})})),zh=d((({className:e,title:t,description:l="Блок в разработке...",...n})=>c(f,{className:u("box-border",e),...n,children:[o(T,{className:"max-w-[600px]",title:t,description:l,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(b,{})]}))),Dh="hidden sm:flex absolute z-40 top-10",_h=St((({className:e="",padding:t,slides:l=[],...a})=>{const[i,r]=n(0),[s,d]=Ha({itemCount:l?.length||0});return c(f,{className:u("box-border overflow-hidden",e),defaultPadding:"pt-6xl",padding:t,...a,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*i}%)`},role:"list",children:l.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(st,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...a})},String(t))))}),c("div",{className:"relative pr-xs mt-m -mb-m flex gap-xs box-border",children:[o(Ca,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:l.map(Ah({activeSlideIndex:i,onClick:r}))}),d.canScrollLeft?o(Va,{className:u("left-6",Dh),onClick:d.scrollLeft}):null,d.canScrollRight?o(za,{className:u("right-6",Dh),onClick:d.scrollRight}):null]})]})})),Ah=({activeSlideIndex:e,onClick:t})=>({nav:l},n)=>{const a=n===e,i=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(n),"aria-label":l?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",i),children:[o("div",{className:r,children:l?.title}),o("div",{className:s,children:l?.description})]},String(n))},$h=d((({address:e,email:t,telephone:l,button:n,className:a="",__html:i,icon:r,title:s,version:d="primary",...m})=>c(f,{className:u("box-border text-left space-y-s",a),version:d,...m,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Ge(r)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ae,{image:r})}):null,s?o(k,{headingType:"h3",as:"h3",title:s}):null]}),c("div",{className:"w-full space-y-m",children:[i?jh(i):null,Lh({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Lh({label:"Телефон(факс)",data:l,iconName:"PhoneIcon"}),Lh({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),n?.text?Qe([n]):null]})]}))),jh=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o($e,{__html:e,itemSize:"list-s"})}),Lh=({label:e,data:t,iconName:l,dataColor:n=""})=>t?c("div",{className:"flex gap-s",children:[o(q,{iconVersion:"black",name:l,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Le,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Le,{size:"text-xl",color:n,children:t})]})]}):null,Oh=d((e=>{const{__html:t,richVersion:l="",...n}=e;return o(f,{defaultPadding:"p-0",...n,children:o($e,{__html:t,richVersion:l})})})),Eh=d((({label:e,labelIconBgVersion:t,icon:l,onToggle:n,labelIcon:a})=>o(Ya,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:n,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(Le,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:l?o(q,{name:l,iconVersion:"color",width:"24",height:"24"}):null}))),Fh=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Uh=(e=!1)=>e?"MinusIcon":"PlusIcon",Wh=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",Hh=St((({className:e="",isExpanded:t,isFoldButtonOnTop:l=!0,label:n="Развернуть",labelIcon:a,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=fa();return o(f,{className:u("w-full","border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(Ja,{isFoldButtonOnTop:l,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(Za,{className:u("gap-lg",Fh(m)),isUnfolded:e,children:V({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Kh({foldButtonVersion:r,label:n,labelIcon:a,labelIconBgVersion:i,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Kh=({foldButtonVersion:e,label:t,labelIcon:l,labelIconBgVersion:n,isUnfolded:a,onToggle:i,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?Wh(e):Uh(e))(a,r);return"accordion"===e?o(Eh,{label:s,labelIcon:l,labelIconBgVersion:n,icon:c,onToggle:i}):o(Ga,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},qh=d((({className:e=""})=>{const[t,l]=n("option2"),a=i((e=>l(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Zn,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(Zn,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),Xh=d((({data:e,fieldLabel:t,fieldValue:l,selected:n,placeholder:a="",setSelected:i,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[l||t],text:e?.[t]}))),c=s.find((e=>e.key===n));return o(kl,{options:s,label:r,placeholder:a||n,onChange:e=>i(e.key),value:c})})),Yh=d((({regions:e=[],selectedRegion:t,onSelectedRegion:l,branches:n=[],selectedBranch:a,onSelectedBranch:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Xh,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:l,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Xh,{data:n,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Gh=["От 1 дня","До 365 дней"],Qh=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Le,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Pn,{min:1,max:365,value:e,items:Gh,onChange:t})]}))),Jh=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:l,safeBoxCases:n=[],selectedBoxSize:a,onSelectedBoxSize:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Xh,{data:e,fieldLabel:"volume",selected:t,setSelected:l,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Xh,{data:n,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Zh=d((({regions:e,selectedRegion:t,branches:l,selectedBranch:n,days:a,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:h})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Yh,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:l,selectedBranch:n,onSelectedBranch:eu(m)}),o(Qh,{days:a,setDays:e=>m({days:e})}),o(Jh,{caseVolumes:d,selectedCaseVolume:i,onSelectedCaseVolume:tu(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Le,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(qh,{}),o(ve,{text:"Офисы на карте",version:"primary",onClick:h,className:"order-6"})]})]}))),eu=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},tu=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},lu=d((({days:e,tariffs:t=[]})=>{const l=au(e,t),n="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[nu("Аренда за",e),nu("Цена",l+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(S,{size:"text-s",font:"font-light",color:"text-secondary-text",children:n})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ae,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(S,{size:"text-s",font:"font-light",color:"text-white",children:n})})]})]})})),nu=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Le,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),au=(e,t)=>{const l=iu(e);return e*(t?.find((e=>e.tariffType===String(l)))?.tariffValue||0)},iu=e=>{let t=1;switch(!0){case e>30&&e<=90:t=2;break;case e>90&&e<=180:t=3;break;case e>180&&e<=365:t=4}return t},ru=(e,t)=>e.find((e=>e.branchCode===t)),su=d((e=>{const{regions:t,data:l,branches:n,onChange:i,onClick:r}=e;a((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[l.selectedRegion,i]);const s=ru(n,l.selectedBranch),d=ou(s?.safeBoxCaseVolumes),m=cu(s?.safeBoxCaseVolumes,l.selectedCaseVolume)?.safeBoxCases,h=du(m,l.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Zh,{...l,regions:t,onClick:r,branches:n,caseVolumes:d,safeBoxCases:m,onChange:i}),o(lu,{days:l.days,tariffs:h})]})})),ou=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],cu=(e,t)=>e?.find((e=>e.volume===t)),du=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,mu=[];const hu=async e=>await ft(e,{method:"GET"})||mu,uu=d((({title:e,footnote:t,className:l="",...a})=>{const[r,s]=n(!1),d=i((()=>s((e=>!e))),[]),[m,h]=n({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),u=Kn(),p=pu(m.selectedRegion,u),g=function(e){const{data:t}=fn(e?`/api/v1/safeboxes?regionCode=${e}`:null,hu);return t||mu}(p),x=i((e=>h((t=>({...t,...e})))),[h]),b=(y=ru(g,m.selectedBranch)||g,Array.isArray(y)?y.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):y?.gpsLatitude&&y?.gpsLongitude?[{coords:[y.gpsLatitude,y.gpsLongitude]}]:[]);var y;return c(f,{className:l,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(k,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(su,{regions:u,branches:g,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(S,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&r?o(wm,{points:b,className:"h-[640px]"}):null]})})),pu=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,gu=e=>e<4?"w-72":"w-52",xu={description:"text-white/80 text-l font-light group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconText:"text-white group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconBackground:"bg-white/30 group-data-primary:bg-main-divider",iconConnector:"bg-white group-data-primary:bg-secondary-light",dot:"bg-white/80 group-data-primary:bg-secondary-text"},fu=d((({buttons:e,className:t="",description:l,showLines:n=!0,size:a="normal",steps:i=[],stepVersion:r="gray",title:s,version:d="primary",...m})=>{const h=i.length,p=h>3,g=xu,x=(e=>e?"":"opacity-0")(n),b=fa(),y=h<4?"px-24":"px-16",v=h<4?"px-28":"px-20";return c(f,{className:u("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:d,...m,children:[o(T,{headlineVersion:"S",title:s,description:l,isEmbedded:!0,className:"w-full",align:yi(b)}),i?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:u("flex items-center","normal"===a?y:v),children:ii(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",x)}))(i.map(bu(g,a,r)))}),o("div",{className:u("flex justify-between",p?"gap-x-s":"gap-x-20"),children:i.map((N={styleMap:g,version:d},(e,t,l)=>{const{styleMap:n,version:a}=N,{label:i,description:r,button:s,isDotted:d}=e;return c("div",{className:u("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",gu(l.length)),children:[c("div",{className:"space-y-xs",children:[i?o(Le,{size:"text-h6",align:"text-center",children:i}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[r?o("div",{className:n.description,children:r}):null,o($e,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ve,{className:"box-border py-s w-full max-w-60 mt-auto",version:a,...s,children:s?.text}):null]},String(t))}))})]}):null,Qe(e)]});var N})),bu=(e,t,l)=>({icon:n},a)=>{const i="secondary"===l?"white":"color";return o(f,{defaultPadding:"",className:`${yu(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:l,children:Ge(n)?o(ae,{image:{...n,iconVersion:n?.iconVersion||i},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===l?e.iconText:(r=l,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:a+1})},String(a));var r},yu=e=>"normal"===e?"h-24 w-24":"h-16 w-16",vu=d((()=>o("div",{className:"hidden",role:"none"}))),Nu="hidden sm:flex absolute z-40",wu={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},ku=d((({className:e,items:t=[],activeItem:l,onChange:n,tabsType:i="default"})=>{const[r,s]=Ha({itemCount:t?.length||0});return a((()=>Su(r.current,t,l)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Ca,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:wu[i].item,gap:wu[i].gap,children:t.map(nm(l,n,i))}),s.canScrollLeft?o(Va,{className:u("left-6",Nu,wu[i].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(za,{className:u("right-6",Nu,wu[i].buttonTop),onClick:s.scrollRight}):null]})})),Su=(e,t,l)=>{const n=t.findIndex((e=>e===l));e&&n>0&&e.scrollTo({left:e?.children[n]?.offsetLeft,behavior:"smooth"})},Cu={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},Tu=({className:e="",tabsType:t="animated",...l})=>t?o("div",{className:u(Cu[t].wrapper,e),children:o(ku,{className:Cu[t].component,tabsType:t,...l})}):null,Iu=St((({className:e="",tabs:t=[],block:l,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=Bu(l??{}),p=z(),g=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?l?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:b}=p,[y,v]=n(Ru(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[y],w=x.findIndex((e=>Boolean(e.selected)));a((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[b,w,h]);const k=Mu(x[y],y),S=i((e=>{const t=x.indexOf(e),l=x[t];v(t),"group"===l.type&&((e,t)=>{const l=new URLSearchParams(p.query);e.text?l.set(h,e?.tabName??String(t)):l.delete(h),p.replace(`${p.pathname}?${l}`,"",{scroll:!1})})(e,t)}),[x]);return c(f,{className:u({"sticky top-1 z-20":d&&g},e),defaultPadding:"p-0",block:l,...m,children:[Tu({className:u({"pb-1":Boolean(l?.slots)&&"default"===r,"sticky top-1 z-20":d&&!g}),items:Pu(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(l?.slots??{}).map((([e,t])=>R(t,{...m?.options,slotName:k,parent:l,extraProps:{className:e===k?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Mu)?.filter(Boolean)||[]}),Bu=({__id:e,anchor:t})=>t??e??"tabs",Pu=(e,t)=>t?.length?t:e,Mu=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Ru=(e,t)=>t?Number(t):e.reduce(((e,t,l)=>t.selected?l:e),0),Vu={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},zu=d((({children:e,activeIndex:t,columnWidth:l,version:n="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Vu[n],style:{transform:`translateX(-${t*l}px)`},children:e})}))),Du=d((({className:e="",isOpen:t,onClick:l})=>o(ve,{className:e,appendRight:o(ae,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:l}))),_u={Buttons:({buttons:e})=>Qe(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ae,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o($e,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Le,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Le,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:l,pdfUrl:n,isOpen:a})=>e?o(Du,{isOpen:a,onClick:()=>{t({tableSource:l,pdfUrl:n})}}):null},Au=d((({cell:e,fieldIdx:t,rowIdx:l,cellIdx:i,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=n(!0);a((()=>{i===o&&s||m(!0)}),[s,o]);return $u({cell:e,cellProps:{rowIdx:l,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),$u=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:l,...n}=e;if(!l||!(l in _u))return null;return o(_u[l],{...t,...n})},ju=d((({cells:e,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(Au,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),Lu=(e,t)=>140*De(e.slice(0,t).map((e=>e?.cols?.length??1))),Ou=(e,t)=>e?.length>0?o("div",{className:u("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Le,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Eu=d((({rows:e})=>{const t=e?.[0]?.length??0,[l,n]=cd({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((a=l,(e,t)=>{if(!e?.length)return null;const[l,...n]=e,i=u("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[l?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Le,{size:"text-xl",font:"font-light",children:l.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${Lu(n,a)}px)`},children:n?.map(((e,t)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Le,{size:"text-xl",children:e.data}):null,e?.cols?Ou(e.cols,a):null]},`row${t}`)))})})]},String(t))})),dd({...n,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var a})),Fu=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,l)=>{const n=`activeTabIdx:${e}-tableIdx:${l}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(Le,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(Eu,{rows:t.rowsData})})})]},n)}))}))),Uu=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Wu=d((({currencies:e,linkToPDF:t,activeTabIndex:l,setActiveTabIndex:n})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",t===l?"bg-primary-main":""),onClick:()=>n(t),children:o(Le,{size:"text-xl",font:"font-light",color:Uu(t===l),children:e||t+1})},e)))}):null,t?o(ve,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(q,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Hu=St((({tableSource:e,pdfUrl:t,onClick:l})=>{const a=e?.tableData,[r,s]=n(0),d=i((e=>s(e)),[]),m=a?.[r]?.items??[],h=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(Wu,{currencies:h,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Fu,{activeTabIndex:r,items:m}),o(Du,{className:"mt-xl",onClick:l,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Le,{size:"text-h6",children:"Данных нет"}),o(Du,{onClick:l,isOpen:!0})]})})),Ku=d((({children:e,tableInner:t,onHideContentClick:l})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Hu,{...t,onClick:l})}):null]}))),qu=d((({row:{header:e,data:t},activeIndex:l,rowIdx:a,...r})=>{const[s,d]=n(void 0),m=i((e=>d(e)),[]),[h,p]=n(void 0),g=i((e=>p(e)),[]);return c(Ku,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ae,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Le,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(zu,{activeIndex:l,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(ju,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),Xu=d((({children:e,controls:t})=>{const{isScrollAvailable:l}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,dd({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),l?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Yu=d((({className:e="",title:t,description:l,rowHeaders:n,tariffsColumns:a,hiddenRowsNum:i=0,...r})=>{const s=a?.map((({data:e})=>e))||[],d=n?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,p]=cd({itemCount:m,visibleItemCount:2}),g=(d||[]).map(((e,t)=>o(qu,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[x,b]=i>0?[g.slice(0,-i),g.slice(-i)]:[g,[]];return c(f,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(T,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:i>0?o(Ja,{renderFoldableSection:({isUnfolded:e})=>c(Xu,{controls:p,children:[x,o(Za,{isUnfolded:e,children:b})]}),renderFoldButton:Qa}):o(Xu,{controls:p,children:g})})]})})),Gu=d((({className:e="",title:t,description:l,iconVersion:n,__html:a,...i})=>c(f,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...i,children:["small"===n?Qu():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Le,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,l?Ju(l):null,a?o($e,{__html:a}):null]})]}))),Qu=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),Ju=e=>o(S,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Zu=d((({prefix:e,unit:t,suffix:l})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Le,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,l?o("div",{className:"gradient-color-text",children:o(Le,{size:"text-h2",children:l})}):null]}))),ep=d((e=>{const{prefix:t,unit:l,suffix:n,...a}=e;return o(f,{defaultPadding:"p-0",...a,children:o(Zu,{prefix:t,unit:l,suffix:n})})})),tp=St((({className:e="",padding:t="p-0",gap:l="",isInnerPadding:n=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...c})=>{const d=z();return o(f,{className:u("relative flex flex-col",rd[l],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Z(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:i,...c,children:V({...c,extraProps:{className:u("w-full",ya(r)),...id(n)}})})}),{childrenTypes:[]}),lp=e=>(e=>{const t="col-span-",l=e?.split(/\s+/).find((e=>e.startsWith(t)));return l?parseInt(l.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",np=d((({className:e,title:t,url:l,previewImg:n,...a})=>{const i=z();return c(f,{className:e,defaultPadding:lp(e),...a,children:[o(T,{title:t,headlineVersion:"M"}),l?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:H(i)(n?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:H(i)(l)})}):null]})})),ap={AdTile:Tt,ApplicationForm:ha,BankAccountFiltration:fi,BenefitsBlock:wi,BonusBenefitsBlock:Ii,ButtonsBlock:Pi,CalculatorBonus:Hi,CalculatorBusinessDeposit:dr,CalculatorCredit:Cr,CalculatorDeposit:$r,CalculatorRefinancing:Kr,CardTransfer:Zr,Carousel:ss,CarouselCard:ds,CarouselCatalogCard:hs,CarouselLinks:gs,CarouselRecommendationCard:ks,CarouselTariffsCard:Ts,ContactsBlock:Bs,DepositFiltration:_s,Depository:Qs,ErrorBlock:Zs,ExchangeRateTile:Io,Footer:hc,GracePeriod:uc,GrantSupport:fc,Header:ld,Headline:T,HorizontalLayout:sd,ImgBlock:od,InsuranceAmountBlock:gd,InvestmentInfo:yd,LinkDocs:zd,MobileAppTile:$d,MortgageFiltration:rm,OfficesAtmsMap:Vh,Placeholder:zh,ProductBlock:Ct,ProductGallery:_h,RepresentativeOfficeInfo:$h,RichTextBlock:Oh,RollupItem:Hh,SafeDepositRental:uu,StepsBlock:fu,StickyBottomMenu:vu,TabsLayout:Iu,TariffsTable:Yu,TextBlock:Gu,UnitBlock:ep,VerticalLayout:tp,Video:np},ip=ue((()=>{a((()=>{$t()}),[]);const e=Ht();bl(globalThis,"click",(e=>t=>{const l=t.target?.closest("[data-aspects]");try{const n=JSON.parse(l?.dataset?.aspects??"[]");_t({aspectsAttributes:n,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),rp="cookie",sp=d((({__html:e})=>{const[t,{setTrue:l,setFalse:n}]=hl();Yo((()=>{globalThis.localStorage?.getItem(rp)||l()}),[],3e3);const a=i((()=>{globalThis.localStorage?.setItem(rp,"true"),n()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o($e,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Jt,{className:"bg-main-gray rounded-md w-11 h-11",onClose:a})})]})}):null}));function op(e){throw new Error(e)}const cp=({onCloseAll:e,onClose:t}={})=>{const[l,{push:r,pop:s,clear:o}]=function(e=[]){const[t,l]=n(e),a=i((e=>l((t=>[...t,e]))),[]),r=i((()=>l((e=>e.slice(0,-1)))),[]),s=i((e=>l((t=>t.filter((t=>t!==e))))),[]),o=i((()=>l([])),[]);return[t,{setList:l,push:a,pop:r,remove:s,clear:o}]}(),c=i((()=>{e&&e(l),o()}),[l,e]),d=i((()=>{t&&t(l[l.length-1]),s()}),[l,t]);return a((()=>me.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:op(e)}}))),[c,d]),l},dp=d((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),l=cp({onCloseAll:e,onClose:t}),{close:n}=he(),r=i((({key:e})=>{"Escape"===e&&n()}),[]);return bl(globalThis.document,"keydown",r),a((()=>{l.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[l]),l.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:l.map((({dialog:e,id:t},n)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",n===l.length-1?"":"hidden"),children:e},String(t||n))))}):null})),mp=d((()=>{const[e,t]=n(null),l=i((()=>{t(null)}),[]);a((()=>me.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":l();break;default:op(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&l()}),[l]);return bl(globalThis.document,"keydown",r),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),hp="header",up="footer",pp="sticky-footer",gp={},xp=d((({className:e,data:t=gp,blocksRegistry:l,blockDecorator:n})=>{const{slots:a,blocks:i,fallback:r,...s}=t,d=kt(s,r);ip();const m={key:"",page:{slots:a,blocks:i,fallback:r,...d},blocksRegistry:l,blockDecorator:n,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:R(a?.header,{...m,slotName:hp})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[V({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),R(a?.footer,{...m,slotName:up})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(a?.["sticky-footer"],{...m,slotName:pp})}):null,o(dp,{}),o(mp,{}),o(sp,{__html:d?.cookieContent?.__html})]})}));Object.assign(xp,{childrenTypes:[],slots:()=>[hp,up,pp]});e.Blocks=ap,e.ContentPage=xp,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),l=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await l.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.handlerDecorator=ue,e.joinList=ii,e.packageVersion="0.14.528",e.projectSettings=_,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=F,e.useRouter=z,Object.defineProperty(e,"__esModule",{value:!0})}));