@redneckz/wildless-cms-uni-blocks 0.14.216 → 0.14.217

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).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const l=e=>(...l)=>t[e](...l),n=l("useState"),a=l("useEffect"),r=l("useCallback"),i=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||{},r=l?.slots?.default,i=n||r&&r();return e(Object.assign(a,i&&{children:i}),l)}return t.inheritAttrs=!1,t};const h=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}};function u(){return u._impl()}u._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),u.setup=e=>{u._impl=e};const p=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),g={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","":""},x=d((({className:e,version:t="primary",isTheme:l=!0,defaultPadding:r="p-xl",padding:i,block:s,tag:c="section",role:d,children:m,style:x})=>{const f=c,b=u(),[y,v]=n(!1);a((()=>h.subscribe("tab",(e=>{e.groupName&&e.groupName!==s?.labelGroup||v(Boolean(e.label&&s?.labels?.length&&!s.labels.includes(e.label)))}))),[s,b]);const N=t&&l;return o(f,{className:p("@container font-sans",N?"group":"",g[t],y?"hidden":"",i||r,e),...N?{"data-ver":t}:{},...s?.anchor?{id:s.anchor}:{},role:d,style:x,children:m})})),f=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),b=d((({children:e})=>f?e:null)),y=d((({className:e,size:t})=>o("figure",{className:p("m-0 mt-xl min-w-[80%]",e),children:v(t)}))),v=(e=3)=>w(100,e).map((e=>Math.floor(e))).map(N),N=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),w=(e,t)=>[e].concat(t>0?w(e/1.618,t-1):[]),k={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},C={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},S=d((({className:e="",headingType:t="h3",as:l="h3",title:n,children:a})=>{const r=k[l]||"h3";return o(r,{role:"heading",className:p("font-sans m-0",C[t],e),children:n||a})})),T=d((({children:e,...t})=>o("p",{className:p("font-sans",Object.values(t)),children:e}))),I={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"}},B=d((({className:e,version:t="",headlineVersion:l="XL",title:n,description:a,align:r="text-center",as:i,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=I[l],u={marginTop:h.descriptionStyle};return c(x,{className:p(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[n?o(S,{className:p("whitespace-pre-wrap",r),...h?.title,as:i||h?.title.as,title:n}):null,a?o(T,{size:h.descriptionSize,font:h.descriptionWeight,align:r,...u,children:a}):null]})})),M=({blockClassName:e,block:t,render:l})=>l({blockClassName:e,block:t}),V=[];function R(e,t,{className:l,...n}={}){const{key:a,blockDecorator:r=M,blocksRegistry:i={},ancestors:s=V}=t,{type:c}=e;c&&c in i||console.warn(`No block with "${c}" is registered`);const d=c&&i[c];return r({blockClassName:p(e.style?.length?e.style:"col-span-12",l),block:e,ancestors:s,render:({block:l,blockClassName:r})=>{const{content:i}=l;return d?o(d,{className:r,block:e,options:t,...i,...n},a):null}},a)}const P=[],z=(e,{key:t,ancestors:l=P,slotName:n=null,extraProps:a,renderProps:r=R,...i})=>{const s=a?(e,t)=>R(e,t,a):r;return(e||[]).map(((e,a)=>s(e,{...i,key:`${t||e.type}-${a}`,ancestors:i.parent?[...l||P,[i.parent,n]]:l},a)))};function A({block:e,options:t,children:l,extraProps:n,renderProps:a}){return l||(e&&t?z(e.blocks,{...t,parent:e,extraProps:n,renderProps:a}):null)}const j=e=>e&&!e.endsWith("/")?`${e}/`:e,D=["CDN","BASE_PATH"],E=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const l=e._[t]||e[t];return D.includes(t)?j(l):l}}),L=e=>Boolean(e?.includes(":")),$=(e,t)=>Boolean(e&&!L(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),O=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),_=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/");var U=Object.freeze({__proto__:null,isURL:L,isLocalURL:$,isHash:F,withoutQuery:O,joinPath:_});const H="/api/",W=`${H}v1/storage`,K=e=>(t,l=E.BASE_PATH)=>{if([!t,L(t),F(t),[E.CDN,H].some((e=>q(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}/file`;const n=t?.startsWith("/");return _(q(t,l)?"":l,n?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},q=(e,t)=>t&&e&&e.startsWith(t),G={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},Y=d((({className:e="",imageClassName:t="",name:l="",alt:n=`Иконка ${l}`,title:a=n,iconVersion:r="color",width:i,height:s})=>{const d=u(),m="normal"===r?`${l}.svg`:`sprites.svg#${l}`,h=K(d)(_(E.CDN,"/icons/",m));return"normal"===r?o("img",{className:e,src:h,alt:n,title:a,"aria-hidden":"true",width:i,height:s,style:X(e,s)}):o(Z,{className:e,children:c("svg",{className:p(Q(i),G[r],"white"===r?"invert":"",t),width:i,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},Q=e=>e?"":"w-full h-full",Z=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),J=(e,t)=>l=>l&&!L(l)?K(e)(_(t,l)):l,ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n})=>{const a=u();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:l,media:r},i)=>o("source",{srcSet:J(a,n)(e),type:ne(l),media:r?`(max-width: ${r}px)`:"",width:t?.size?.width,height:t?.size?.height},`${i}_${e}`))):null,t?.src?le({...t,src:J(a,n)(t.src)},l):null]})})),le=(e,t="")=>o("img",{src:e.src,className:p("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="",pathPrefix:n,...a})=>t?.src||t?.icon?t.icon?o(Y,{className:e,imageClassName:l,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:l,image:t,pathPrefix:n}):null)),re={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","":""},ie="bg-main-divider text-main-disabled",se={primary:ie,secondary:ie,white:ie,link:"",transparent:"",gray:ie,"":""},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?re[l]:"",t?"rounded-full":"rounded-md",e].join(" "),me=()=>({open:(e,t={})=>h.fire("dialog",{type:"open",dialog:e,...t}),close:()=>h.fire("dialog",{type:"close"}),closeAll:()=>h.fire("dialog",{type:"close",all:!0})}),he=e=>he._impl(e);function ue(e={}){const{isRemote:t,basePath:l}=e,n=u(),{closeAll:a}=me();return e=>({...e,href:t&&!l?e.href:K(n)(e.href,l),"aria-label":e.text,onClick:he(r(e))});function r({href:e,target:l,onClick:r}){return i=>{r&&r(i),e&&!t&&$(e,l)&&(a(),i?.preventDefault(),n.push(e))}}}he._impl=e=>e,he.setup=e=>{he._impl=e};const pe=(e={})=>Object.entries(e).reduce(((e,[t,l])=>({...e,[`data-${t.toLowerCase()}`]:l})),{}),ge=d((e=>{const{text:t,aboveText:l,appendLeft:n,appendRight:a,version:r="primary"}=e,i=fe(e)?"hidden lg:block":"";return c("div",{className:p(xe(e),"flex gap-xs"),children:[n?o("div",{className:p(i,ce[r]),children:n}):null,fe(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:p(i,ce[r]),children:a}):null]})})),xe=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 p("group/btn items-center justify-center",fe(e)?a:"h-12 w-12 m-auto",n?"rounded-full":"")},fe=({text:e,aboveText:t,appendLeft:l})=>Boolean(e||t||!l),be=({className:e,rounded:t,version:l})=>["inline-block",oe,l?se[l]:"",t?"rounded-full":"rounded-md",e].join(" "),ye=d((({disabled:e,children:t,method:l="LINK",href:n,...a})=>{const i=(({method:e,href:t})=>r((l=>{if("POST"!==e||!t)return;l.preventDefault(),l.stopPropagation();const{origin:n,pathname:a,searchParams:r}=new URL(t||""),i=document.createElement("form");i.setAttribute("method","POST"),i.setAttribute("action",[n,a].join(""));for(const[e,t]of r.entries()){const l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name",e),l.setAttribute("value",t),i.appendChild(l)}document.body.appendChild(i),i.submit()}),[]))({method:l,href:n}),s=ue()({onClick:i,href:n,...a}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:l,target:n,ariaLabel:a,version:r,rounded:i,onClick:s,type:c,data:d,children:m})=>o("a",{className:de({className:e,version:r,rounded:i}),href:t,rel:l,target:n,"aria-label":a,role:t?"link":"button",onClick:s,type:c,...pe(d),children:m}))),Ne=d((({className:e,ariaLabel:t,version:l,rounded:n,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:n,version:l}),children:a})));function we(e,t){const l="primary"===e?"white":"black",n="Вернуться назад";return c("div",{className:"hidden sm:flex items-center gap-s",children:[o("div",{className:de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",version:e,rounded:!0}),onClick:t,children:o(ae,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:l}})}),o(ye,{version:"link",className:"group-data-secondary:text-white/80",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const ke={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:i="",buttons:s,leftImage:d,rightImage:m,imageAlign:h,isImageAlwaysOnRight:g=!1,isImageSecondary:x=!1,backwardButton:f,children:b,...y})=>{const v=u(),N=r((()=>{v.back()}),[]);return c("div",{className:Se(n,l,e),children:[f?we(t,N):null,a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:p("grow relative flex flex-col @xl:flex-row gap-3xl w-full",d?"self-start @xl:w-auto":""),children:[Ve(d,{imageAlign:h,className:"mx-auto"}),c("div",{className:p("grid gap-3xl",m?"@xl:grid-cols-2":"",d?"":"grow","h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[i,b]}),Me(A({...y,extraProps:{className:"@container-normal"}})),Ve(m,{className:p("@xl:justify-self-end @xl:col-start-2",s?Te(g):"",Ie(g),Re(x)),imageAlign:h}),Be(s)]})]})]})})),Se=(e="",t="",l="")=>p("relative flex flex-col gap-3xl overflow-hidden",e||t,l),Te=e=>e?"row-span-2":"@xl:row-span-2",Ie=e=>e?"col-start-2 self-center":"",Be=e=>e?o("div",{className:"self-end",children:e}):null,Me=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:p("shrink-1/2 justify-self-center",l&&ke[l],t),children:e}):null,Re=e=>e?"hidden @xl:block":"",Pe=(e=[])=>e.reduce(((e,t)=>e+t),0),ze=(e=[])=>e?.length?Pe(e)/e.length:0,Ae=(e,t="normal")=>e?o("div",{className:p("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,je=d((e=>{const{__html:t="",richVersion:l=""}=e;return t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:p(l,"md-container"),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(e,t)=>e?o(T,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ee=d((({children:e,...t})=>o("span",{className:p("font-sans",Object.values(t)),children:e}))),Le=(e,t)=>e?o(Ee,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,$e=(e,t)=>"rte"===e.type&&"__html"in e&&e.__html?o(je,{...e},`rte-${t}`):["label"in e?Le(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:De(e.description,t)},String(t)):null],Fe=d((({className:e,benefitsVersion:t,...l})=>c("div",{className:p("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in l?Ae(l.icon,t):null,o("div",{children:$e(l)})]}))),Oe=e=>"rte"===e.type?e?.__html?.length||0:Math.max(e?.label?.length||0,e?.description?.length||0),_e=e=>{return((t=e.map(Oe))?.length?Math.sqrt(Math.abs(ze(t.map((e=>e**2)))-ze(t)**2)):0)>16;var t},Ue=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),He=e=>!e.some(Ue),We=d((({className:e,benefitsVersion:t="normal",benefits:l})=>l?.length?o("div",{className:p("flex gap-x-m gap-y-s",_e(l)||He(l)?"flex-col":"flex-wrap",e),role:"list",children:l.map(((e,l)=>o(Fe,{benefitsVersion:t,...e},String(l))))}):null)),Ke=d((({className:e,benefits:t})=>t?.length?o("div",{className:p("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap($e)}):null)),qe=d((({isTabularBenefits:e,...t})=>o(e?Ke:We,{...t}))),Ge=e=>Boolean(e?.src||e?.icon),Ye=(e,{className:t,buttonClassName:l,isVertical:n}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:p("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(Xe(l))}):null,Xe=(e="")=>(t,l)=>{const{text:n,icon:a,iconRight:r,version:i,...s}=t||{},c=Qe(a,i),d=Qe(r,i);return n||a?.icon?o(ye,{className:p("basis-full @lg:basis-auto",e),appendLeft:Ze({...a,iconVersion:c}),appendRight:Ze({...r,iconVersion:d}),version:i,text:n,...s},l?String(l):""):null},Qe=(e,t="secondary")=>{const l="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:l},Ze=e=>Ge(e)?o(ae,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,Je=d((({className:e,isDotted:t,dotClassName:l,children:n})=>c("div",{className:p("font-sans flex",e),role:"listitem",children:[t?o("div",{className:"shrink-0",children:o("div",{className:p("align-middle inline-block rounded-full group-data-secondary:bg-white",l)})}):null,o("span",{children:n})]}))),et={S:{textSize:"text-l font-light",indentStyle:"ml-xs",dotStyle:"w-1 h-1 mr-xs"},M:{textSize:"text-h6",indentStyle:"ml-s",dotStyle:"w-1.5 h-1.5 mr-s"},L:{textSize:"text-h5",indentStyle:"ml-m",dotStyle:"w-1.5 h-1.5 mr-m"}},tt=d((({className:e,isDotted:t=!0,items:l=[],listItemSize:n="M",dotClassName:a=""})=>{const r=et[n];return l?.length?o("section",{className:p("flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text",r.textSize,e),role:"list",children:l.map(((e,l)=>o(Je,{isDotted:t,dotClassName:p(a||"bg-primary-text",r.dotStyle),children:e},String(l))))}):null})),lt=(e=0,{fixed:t}={})=>(l=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(l)||0),nt=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(at)}):null)),at=({label:e,amount:t},l)=>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(Ee,{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:[lt(2)(t)," ₽"]}):null]},String(l)),rt=d((({className:e,tags:t})=>t?.length?o("div",{className:p("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(Ee,{size:"text-m",font:"font-light",children:e})},String(t)),st={XXL:"L",XL:"L",L:"M",M:"M",S:"S",XS:"S"},ot=d((({className:e,padding:t,defaultPadding:l,title:n,description:a,headlineVersion:r="L",align:i="text-left",benefitsVersion:s,isTabularBenefits:d,benefits:m,__html:h,isFullWidthTitle:u,items:p,isDotted:g=!0,priceList:x=[],tags:f=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:k=!1}={},backwardButton:C,children:S,...T})=>{const I=y?.src?o(ae,{image:y}):null,M=o(B,{title:n,description:a,headlineVersion:r,align:i,isEmbedded:!0}),V=m?.filter((e=>"rte"===e?.type||"label"in e||"description"in e));return o(Ce,{className:e,padding:t,defaultPadding:l,...u?{title:M}:{insetTitle:M},...ct(I,N),isImageSecondary:k,imageAlign:v,isImageAlwaysOnRight:w,buttons:Ye(b),backwardButton:C,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[V?.length?o(qe,{benefitsVersion:s,isTabularBenefits:d,benefits:V}):null,h?o(je,{__html:h}):null,p?.length?o(tt,{items:p,isDotted:g,listItemSize:st[r]}):null,S,x?.length?o(nt,{priceList:x}):null,dt(f)]})})})),ct=(e,t)=>t?{rightImage:e}:{leftImage:e},dt=e=>e?.length?o(rt,{tags:e}):null,mt=e=>Boolean(e&&Array.isArray(e)),ht=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),ut=(e,t)=>{return l=e,Boolean(ht(l)&&"string"==typeof l.$ref)?t.ref(e):ht(e)?t.record(e):mt(e)?t.array(e):t.scalar?t.scalar(e):e;var l},pt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(gt,e),gt=(e,t)=>e&&t?ht(e)?e[t]:mt(e)?e[parseInt(t,10)]:e:e,xt=(e,t)=>ut(e,{ref:({$ref:e,...l})=>xt(e?pt(t(e),e):l,t),record:e=>Object.entries(e).map((([e,l])=>({[e]:xt(l,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>xt(e,t)))}),ft=(e,t,l=[])=>{ut(e,{ref:e=>t(e.$ref,l),record:e=>{for(const n in e)ft(e[n],t,[...l,n])},array:e=>{for(let n=0;n<e.length;n++)ft(e[n],t,[...l,n])}})};async function bt(e,t){try{return e?await yt(e,t):null}catch(e){console.error(e)}return null}const yt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),vt=e=>[...new Set(e)],Nt={},wt=["/portal-resources"],kt=(e,t)=>xt(e,(e=>t?.[e])),Ct=(e,t)=>{const l=(e=>{const t=[];return ft(e,(e=>t.push(e))),t})(e),[r,i]=n({});return a((()=>{l.length&&(async e=>Object.fromEntries((await Promise.allSettled(vt(e).filter((e=>!wt.some((t=>e.startsWith(t))))).map((async e=>[e,Nt[e]||=await yt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(l).then(i)}),[l.join()]),l.length?kt(e,{...t,...r}):e};function St(e,t={}){const l=d((t=>{const l=Ct((({block:e,options:t,className:l,defaultPadding:n,padding:a,isTheme:r,version:i,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...l})}));return Object.assign(l,t),l}const Tt=St((({className:e,padding:t,...l})=>o(x,{className:p("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:o(ot,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...l})})),{childrenTypes:["UnitBlock"]}),It=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},l=i((()=>Bt(0,t?.length)),[t]),n=t?.[l];return n?o(b,{children:o(Tt,{...n,...e})}):o(x,{...e,children:o(y,{})})})),Bt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Mt=e=>e?.replace(/[^+\d]/g,"");function Vt(){return{send:async function(e,t=!1){const l=t?"/api/v1/lead":"/api/v1/sendcorporatelead",{typeForm:n,region:a,phone:r="",email:i,birthday:s,inn:o,fullName:c,addressBranch:d,secondaryPhone:m="",bankEmpolee:h,applicationDate:u,...p}=e,g={typeForm:n,[t?"regionBranch":"region"]:a,[t?"phoneNumber":"phone"]:Mt(r),[t?"email":"mail"]:i,...t?{birthday:s}:{inn:o,fullName:c},..."FEEDBACK"===n?{}:{addressBranch:d,bankEmpolee:h,applicationDate:u,...Rt(m)},...p};try{const e=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(g)});if(!e?.ok)return null;return await e.json()}catch(e){return null}}}}const Rt=e=>e&&"+7 ("!==e?{secondaryPhoneNumber:Mt(e)}:{},Pt=d((({responseType:e})=>{const t="OK"===e,l=t?"ResponseOKIcon":"ResponseFailIcon";return c("div",{className:p("flex items-center p-lg rounded-md space-x-m",t?"bg-ok":"bg-fail"),children:[o(ae,{image:{icon:l,iconVersion:"normal"},width:"42",height:"42"}),c("div",{children:[o(S,{headingType:"h6",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",className:"mb-2xs"}),o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее"})]})]})})),zt=e=>e,At=(e,{resetOnSubmit:t,onSubmit:l}={})=>{const[a,i]=n(e),[o,c]=n(!1),[d,m]=n({}),h=s({}),u=r(((e,t)=>{const{parse:l=zt,format:n=zt}=t||{};return h.current||(h.current={}),h.current[e]||=t=>{i((n=>({...n,[e]:l(t)}))),m((t=>({...t,[e]:!0})))},{value:n(a[e]),isDirty:o||d[e],onChange:h.current[e]}}),[a,o,d]),p=r((e=>{i(e),m(e)}),[]),g=r((()=>{i(e),c(!1),m({})}),[e]),x=r((e=>{e.preventDefault(),t?g():c(!0),l&&l(a)}),[l,a]);return[a,{isDirty:o||Object.values(d).some(Boolean),field:u,update:p,reset:g,onSubmit:x}]},jt=e=>o("div",{className:"h-6",children:e?o(Ee,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null});function Dt(e=!1){const[t,l]=n(e),a=r((()=>l(!0)),[]),i=r((()=>l(!1)),[]),s=r((()=>l((e=>!e))),[]);return[t,{setValue:l,setTrue:a,setFalse:i,toggle:s}]}const Et=(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=t?String(e.getFullYear()):String(e.getFullYear()).slice(-2);return t?`${a}-${n}-${l}`:`${l}.${n}.${a}`}},Lt=e=>e?o(Ee,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,$t=d((({key:e,className:t="",id:l,name:n,type:i="text",label:d,placeholder:m,value:h="",valid:u=!0,children:g,onChange:x,onFocus:f,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1})=>{const w=s(null),k=r((e=>{x&&x(e.target?.value||"")}),[x]);a((()=>{v&&w.current?.focus()}),[v,w]);const C="w-full border rounded-md text-primary-text outline-none p-m",S=g?"pr-3xl":"",T=Ft(u);return c("div",{className:p("relative",t),children:[c("label",{className:"space-y-xs",children:[Lt(d),N?o("textarea",{className:p("block resize-y min-h-24",C,T),id:p("textarea",l),name:n||l,placeholder:m,value:h,onInput:k,onFocus:f,onBlur:b},e):o("input",{type:i,className:p("h-14",C,S,T),ref:w,id:l,name:n||l,placeholder:m,value:h,onInput:k,onFocus:f,onBlur:b,pattern:y},e)]}),g]})})),Ft=e=>e?"border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text":"border-error",Ot=e=>e?.text||e?.key||"";function _t(e,t,l,n){a((()=>{if(e&&l)return e.addEventListener(t,l,n),()=>{e.removeEventListener(t,l,n)}}),[e,t,l])}function Ut(e){const t=s(null),l=r((l=>{t&&t.current&&l.target instanceof Node&&!t.current.contains(l.target)&&e()}),[e]);return _t(globalThis.document,"click",l),t}const Ht=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Wt=d((({popupRef:e,options:t,value:l,query:n,onChange:a,iconVersion:r})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md",role:"list",ref:e,children:Ht(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:Ot(e)}),o(Y,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:r,className:p("absolute right-4 pt-3xs",e.key===l?.key?"":"hidden")})]},e.key)))}):null));function Kt({isOpen:e,options:t,value:l,query:n,onChange:i,onClose:c,iconVersion:d}){const m={open:(e,t)=>h.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>h.fire("popup",{type:"update",popup:e,...t}),close:()=>h.fire("popup",{type:"close"})},u=r((()=>{m.close(),c&&c()}),[c]),p=r((e=>{u(),i&&i(e)}),[u,i]),g=s(null),x=Ut(u);return a((()=>{if(!e||!g.current)return;const a=g.current,{top:r,left:i,width:s,height:c}=a.getBoundingClientRect();m.update(o(Wt,{popupRef:x,options:t,value:l,query:n,onChange:p,iconVersion:d}),{top:r+window.scrollY+c,left:i,width:s})}),[e,t,l,n,p]),g}const qt=d((({className:e,label:t,options:l=[],value:a,valid:i=!0,isBorder:s=!0,placeholder:d="",isSearch:m=!1,iconVersion:h,onChange:u,disabled:g})=>{const[x,{setFalse:f,setTrue:b}]=Dt(),[y,v]=n(""),N=g||0===l.length,w=x&&!N,k=r((()=>{v(""),f()}),[]),C=Kt({isOpen:x,options:l,value:a,query:y,onChange:u,onClose:k,iconVersion:h});return c("div",{className:p("space-y-xs",e),children:[Lt(t),c("div",{className:p("relative",w?"z-20":"z-10"),ref:C,children:[c("div",{className:p("h-14 [&>*]:p-m pr-8 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Yt(s,i,N)),onClick:w?k:b,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Ot(a)||d}),Gt(w,h)]}),m&&w?o("div",{className:p("absolute top-0 w-full z-20"),children:o($t,{type:"text",autoFocus:!0,value:y,onChange:v})}):null]})]})})),Gt=(e,t)=>o(Y,{className:p("absolute right-3 flex self-center",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Yt=(e,t,l)=>p(e?"border rounded-md ":"",e&&!l?"hover:border-primary-hover":"",l?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Xt=()=>{},Qt=({today:e,firstDayOfWeek:t,totalDays:l,currentMonth:n,currentYear:a,min:r,max:i,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=Zt(t,e),c=Jt(t,r,i);h.push(o("td",{children:o("div",{className:el(l,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:h},`row-${m}`))}return c},Zt=(e,t)=>t&&e.toDateString()===t.toDateString(),Jt=(e,t,l)=>t&&e.getTime()<t.getTime()||l&&e.getTime()>l.getTime(),el=(e,t)=>p("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),tl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],ll=d((({today:e,currentMonth:t,currentYear:l,min:n,max:a,onDateSelect:s=Xt})=>{const d=r((e=>s(e)),[]),{firstDayOfWeek:m,totalDays:h}=i((()=>({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:tl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Qt({firstDayOfWeek:m,today:e,totalDays:h,currentYear:l,currentMonth:t,min:n,max:a,onDateClick:d})})]})})),nl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],al=nl.map((e=>({key:e}))),rl=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),il={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},sl={className:"min-w-32",iconVersion:"black",isBorder:!1},ol=d((({className:e="",label:t="",value:l,valid:a=!0,minDate:i,maxDate:s,onChange:d})=>{const[m,{setValue:h}]=Dt(!1),[u,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:C,ref:S}=(({onShowCalendar:e,showCalendar:t,selectedMonth:l,onMonthSelect:n,onYearSelect:a,selectedYear:i})=>{const s=Ut(r((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:r((()=>e(!t)),[t]),handleNextMonth:r((()=>{l+1<=11?n(l+1):(n(0),a(i+1))}),[l]),handlePrevMonth:r((()=>{l-1>=0?n(l-1):(n(11),a(i-1))}),[l]),handleSelectMonth:r((({key:e})=>n(nl.indexOf(e))),[]),handleSelectYear:r((({key:e})=>a(Number(e))),[]),monthsOptions:al,yearsOptions:rl,ref:s}})({onYearSelect:f,onMonthSelect:g,onShowCalendar:h,selectedYear:x,selectedMonth:u,showCalendar:m});return c("div",{className:p("space-y-xs",e),ref:S,children:[Lt(t),c("div",{className:"relative",children:[cl(C,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(Y,{...il,className:"-rotate-90 cursor-pointer"})}),o(qt,{onChange:v,value:{key:nl[u]},options:w,...sl}),o(qt,{onChange:N,value:{key:String(x)},options:k,...sl}),o("div",{className:"my-auto",onClick:y,children:o(Y,{...il,className:"rotate-90 cursor-pointer"})})]}),o(ll,{today:l,currentMonth:u,currentYear:x,onDateSelect:d,min:i,max:s})]}):null]})]})})),cl=(e,t,l)=>c("div",{onClick:e,className:p("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(T,{children:t&&Et(t)}),o(Y,{...il,name:"CalendarIcon"})]}),dl=d((({className:e,label:t,error:l,...n})=>c("div",{className:p("shrink-0 w-full",e),children:[o(ol,{label:t&&n?.errors?`${t}*`:t,valid:Boolean(!l),...n}),jt(l)]}))),ml=d((({className:e,label:t,value:l="",placeholder:n,error:a,onChange:r,onBlur:i,isTextarea:s,...d})=>c("div",{className:p("shrink-0 w-full",e),children:[o($t,{type:"text","aria-label":t,label:t&&d?.errors?`${t}*`:t,valid:Boolean(!a),value:l,onChange:r,onBlur:i,isTextarea:s,placeholder:d?.errors&&!t?`${n}*`:n}),jt(a)]}))),hl=e=>"_"===e,ul=e=>/\d/.test(e),pl=e=>hl(e)||ul(e),gl=[..."+7 (___) ___-__-__"],xl=gl.findIndex(hl),fl=gl.map(((e,t)=>pl(e)?gl.slice(0,t).filter(pl).length:-1));const bl=d((({children:e,onChange:t,...l})=>{const n=r((e=>t&&t(function(e){const t=e.replace(/\D/g,""),l=gl.map(((e,l)=>ul(e)?e:t.charAt(fl[l])||e)),n=fl.indexOf(t.length-1)+1;return(n?l.slice(0,Math.max(xl,n)):l).join("")}(e))),[t]);return o($t,{onChange:n,onFocus:e=>n(e?.target?.value||""),...l,children:e})})),yl=d((({className:e,label:t,value:l,error:n,onChange:a,onBlur:r,...i})=>c("div",{className:p("shrink-0 w-full",e),children:[o(bl,{"aria-label":t,label:i?.errors?`${t}*`:t,valid:Boolean(!n),value:l,onChange:a,onBlur:r,placeholder:"+7 (___) ___-__-__"}),jt(n)]}))),vl=d((({className:e="",label:t,error:l,...n})=>c("div",{className:e,children:[o(qt,{...n,valid:!l,label:n?.errors?`${t}*`:t}),jt(l)]}))),Nl=e=>t=>t&&Object.entries(e).flatMap((([e,l])=>l(t[e])))||[],wl=e=>!e?.length,kl=e=>t=>l=>e(l)?[]:[t],Cl=(e,t)=>{const{value:l,isDirty:n}=e,a=n?t(l):[];return{...e,errors:a,error:a[0]}},Sl=e=>null!=e,Tl=new Map,Il=e=>Boolean(e?.every((e=>Array.isArray(e)?Il(e):!e||"string"==typeof e))),Bl=e=>Il(e)?e.toString():"";function Ml(e,t,{fallback:l,cache:r}={}){const s=i((()=>Vl(e)),[e]),[o,c]=n(void 0),[d,m]=n(void 0);a((()=>{if(!s.some(Sl))return;let e=!1;const l=(t,l)=>{e||(c(t),m(l))};return(async()=>{try{l(await((e,t=Tl)=>l=>{const n=Bl(l),a=t.get(n);if(n&&Sl(a))return a;const r=e(...l);return n&&Sl(r)&&t.set(n,Promise.resolve(r)),r})(t,r)(s))}catch(e){l(void 0,e)}})(),()=>{e=!0}}),[t,r,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 Vl(e){return Array.isArray(e)?e:e instanceof Function?Vl(e()):[e]}const Rl=[];const Pl=async e=>await bt(e,{method:"GET"})||Rl;function zl(){const{data:e}=Ml("/api/v1/premiumBranchesByRegions",yt);return Array.isArray(e)?e:[]}const Al=d((({className:e,viewBox:t,fill:l="none",width:n,height:a,paths:r,...i})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:l,width:n,height:a,children:r.map((({d:e,fill:t,...l},n)=>{const a={...i,...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)}))}))),jl=[{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"}],Dl=d((({className:e,value:t,text:l,disabled:n,isRadio:a,onChange:i})=>{const s=r((e=>{n||(e.preventDefault(),i&&i(!t))}),[i,n,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Al,{paths:jl,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:"flex items-center relative cursor-pointer group/box",onClick:s,children:[o("div",{className:p("appearance-none w-5 h-5 border-solid cursor-pointer m-0",a?"rounded-full border-2":Ll(t),t?"border-primary-main":"border-gray",n?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:El(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(n)}),t?d:null,l?o("div",{className:"ml-s",children:o(Ee,{size:"text-l",font:"font-light",children:l})}):null]})})})),El=e=>e?"radio":"checkbox",Ll=e=>p("rounded border",e?"bg-primary-main":""),$l=d((({className:e,text:t,value:l,key:n,disabled:a,error:r,onChange:i})=>c("div",{className:p("shrink-0 w-full",e),children:[o(Dl,{text:t,value:l,disabled:a,onChange:i},n),jt(r)]}))),Fl="Некорректно заполненное поле",Ol=kl((e=>null!=e&&""!==e))(Fl),_l=kl((e=>e?.key&&""!==e?.key))(Fl),Ul=kl((e=>"string"==typeof e&&e.length>1))(Fl),Hl=kl((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Fl),Wl=(Kl=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,kl((e=>"string"==typeof e&&Kl.test(e))))(Fl);var Kl;const ql=kl((e=>"boolean"==typeof e&&e))(Fl),Gl=e=>Object.values(e).map((e=>e.name)),Yl={typeForm:Ol,surname:Ul,name:Ul,region:_l,addressBranch:_l,phone:Wl,birthday:Ol,email:Ol,fullName:Ol,inn:Hl,partnerComments:Ol,comment:Ol,acquiringType:_l,serviceType:_l,consentDataProcessing:ql,annualRevenue:Ol},Xl=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Ql=d((({field:e,input:t})=>o(vl,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:Xl,...kn(e("acquiringType"),Yl.acquiringType,t?.required)}))),Zl=(e="")=>Boolean("trade"===e||"all"===e),Jl=(e,{normalize:t,format:l})=>{const{value:a,onFocus:i,onBlur:s,onChange:o}=e,[c,d]=n(!1),m=r((e=>{d(!0),i&&i(e)}),[]),h=r((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!l?a:l(a),onFocus:m,onBlur:h}},en=(e,t,l)=>Math.max(t,Math.min(e,l));function tn(e){const t=(e||"").replace(/\D/g,""),l=parseInt(t,10);return Number.isNaN(l)?0:l}function ln({list:e=[],min:t,max:l,step:n,value:a=e[0]||t,disabled:r,onChange:i}){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:p("w-2 h-2 rounded-full",s<=t||r?"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:r,onInput:t=>{const l=tn(t.target?.value),n=e.length?e[l]:l;i&&i(n||0)}})})]})}const nn=1,an=100,rn=d((e=>{const{className:t,title:l,items:n=[],list:a=[],min:i=(a.length?0:nn),max:s=(a.length?a.length-1:an),step:d=1,value:m=a[0]||i,disabled:h=!1,onChange:u}=e,g=Jl(e,{normalize:(e=0)=>a.length?sn(a)(e):en(e,i,s),format:lt()}),x=r((e=>{u&&u(tn(e.target?.value))}),[u]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[l?o(Ee,{size:"text-m",font:"font-light",color:"text-primary-text",children:l}):null,o("input",{className:p("mt-xs font-sans text-h3 w-full h-14","border border-solid border-gray rounded-md outline-none","pl-m box-border","text-primary-text hover:border-primary-hover focus:border-primary-text","disabled:border-gray disabled:bg-main-divider"),disabled:h,onInput:x,...g}),ln({list:a,min:i,max:s,step:d,disabled:h,value:m,onChange:u})]}),on(n)]})})),sn=e=>t=>e.reduce(((e,l)=>Math.abs(l-t)<Math.abs(e-t)?l:e)),on=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Ee,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),cn=["От 1 000 ₽","До 1 000 000 000 ₽"],dn=d((({field:e})=>o(rn,{title:"Сумма, ₽",items:cn,min:1e3,max:1e9,...e("amount")}))),mn=d((({field:e,input:t})=>o(ml,{className:"col-span-2",...kn(e("comment"),Yl.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),hn=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:p("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:p("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Ee,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),un=d((({field:e})=>Zl(e("acquiringType")?.value?.key)?o(hn,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),pn=d((({field:e})=>Zl(e("acquiringType")?.value?.key)?o(hn,{type:"radio",text:"Хочу купить POS-терминал",...e("posTerminal")}):null));function gn(){const{data:e}=Ml("/api/v1/regions",yt);return Array.isArray(e)?e:[]}const xn=d((({field:e,input:t})=>{const l=gn();return o(vl,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:i((()=>l?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[l]),...kn(e("region"),Yl.region,t?.required)})})),fn=d((({field:e,input:t})=>{const l=zl(),n=i((()=>l?.map((({region:e})=>({key:e,text:e})))),[l]);return o(vl,{label:"Регион",placeholder:"Выберите регион",options:n,...kn(e("region"),Yl.region,t?.required)})})),bn=["От 1 мес","До 15 лет"],yn=d((({field:e})=>o(rn,{title:"Срок, месяцев",items:bn,min:1,max:180,...e("term")}))),vn=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Nn=d((({field:e})=>o(vl,{label:"Тип обслуживания",options:vn,...Cl(e("serviceType"),Ol)}))),wn=(e,t)=>(l,n)=>{const{required:a,...r}=l,i="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,s={surname:o(ml,{label:"Фамилия",...kn(e("surname"),Yl.surname,a)}),name:o(ml,{label:"Имя",...kn(e("name"),Yl.name,a),...r}),middleName:o(ml,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),phone:o(yl,{label:"Телефон",...kn(e("phone"),Yl.phone,a)}),email:o(ml,{label:"Электронная почта",...kn(e("email"),Yl.email,a)}),fullName:o(ml,{label:"ФИО",...kn(e("fullName"),Yl.fullName,a),...r}),inn:o(ml,{label:"ИНН",...kn(e("inn"),Yl.inn,a)}),comment:o(mn,{field:e,input:l}),region:i?o(fn,{field:e}):o(xn,{field:e,input:l}),addressBranch:o(Cn,{field:e,input:l,isPremium:i}),birthday:o(dl,{label:"Дата рождения",...kn(e("birthday"),Yl.birthday,a)}),isClient:o($l,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}),partnerComments:o(ml,{label:"Количество объектов инкассации",...kn(e("partnerComments"),Yl.partnerComments,a)}),acquiringType:o(Ql,{field:e,input:l}),onlineCheckout:o(un,{field:e}),posTerminal:o(pn,{field:e}),serviceType:o(Nn,{field:e}),term:o(yn,{field:e}),amount:o(dn,{field:e}),annualRevenue:o(ml,{label:"Годовая выручка, ₽",...kn(e("annualRevenue"),Yl.annualRevenue,a)})};return o("div",{children:s[l.name]},String(n))},kn=(e,t,l=!1)=>l?Cl(e,t):e,Cn=d((({field:e,input:t,isPremium:l=!1})=>{const n=e("region")?.value?.text,r=l?zl()?.find((e=>e?.region===n))?.branches:function(e){const{data:t}=Ml(e?`/api/v1/branches?regionCode=${e}`:null,Pl);return t||Rl}(n)?.filter((e=>e?.address));return a((()=>{""!==e("region")?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[e("region")?.value]),o(vl,{label:"Адрес",placeholder:"Выберите адрес",options:(r||[]).map((({address:e=""})=>({key:e,text:e}))),...kn(e("addressBranch"),Yl.addressBranch,t?.required)})})),Sn=d((({title:e,children:t})=>c("fieldset",{className:"grid @xl:flex @xl:justify-between gap-m border-b border-b-main-divider @xl:border-none",children:[e?o("legend",{className:"w-full",children:o(S,{title:e,headingType:"h6",className:"@xl:text-center"})}):null,t]}))),Tn=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],In=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Bn=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Mn="container space-y-m",Vn=d((({text:e,link:t})=>c(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:[o(Ee,{children:e}),t?o(ye,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"text-primary-main",children:o(Ee,{children:t.text})}):null]})));function Rn({disabled:e,onClick:t}){return l=>{!e&&t&&t(l)}}const Pn={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"},zn={primary:p("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:p("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")},An=d((({children:e,...t})=>{const l=e=>({...e,onClick:he(Rn(e))}),{className:n,version:a="primary",active:r,disabled:i,type:s="button",rounded:c=!0,role:d,onClick:m}=l(t);return o("button",{className:p("font-sans px-9 py-4","flex justify-center items-center gap-xs",r?"text-white bg-primary-active":"",i?"bg-main-gray text-main-disabled cursor-not-allowed":"",r||i?"":p(Pn[a],zn[a]),c?"rounded-md":"",n),type:s,role:d,onClick:m,children:e})})),jn=(e,t)=>o(An,{className:p("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Dn=(e,t,l)=>c("div",{className:"flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3",children:[o(Dl,{...e}),o(Vn,{link:t})]}),jt(Cl(e,ql).error)]}):o(Vn,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),jn(l)]}),En={surname:"",name:"",middleName:"",typeForm:{key:"FEEDBACK",text:"Задать вопрос по продуктам и услугам"},serviceDirection:{key:"Физическое лицо"},birthday:void 0,feedbackMethod:{key:"Телефонный звонок"},phone:"",email:"",comment:"",consentDataProcessing:!1},Ln={typeForm:Ol,region:Ol,surname:Ol,name:Ul,feedbackMethod:Ol,phone:Wl,email:Ol,comment:Ol,consentDataProcessing:ql},$n=d((({button:e,link:t,onSubmit:l})=>{const n=r((e=>{Fn(e,l)}),[l]),[,{field:a,...i}]=At(En,{onSubmit:n}),s="FEEDBACK_QS"===a("typeForm").value?.key,d=_n(a("typeForm").value?.key,a("serviceDirection").value?.key);return o("form",{className:Mn,onSubmit:i.onSubmit,children:o(Sn,{children:c("div",{className:"w-full max-w-xl space-y-s m-auto",children:[o(vl,{label:"Тема",placeholder:"Выберите тему",options:Tn,...Cl(a("typeForm"),Ol)}),s?o(vl,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Bn,...Cl(a("serviceDirection"),Ol)}):null,o(xn,{field:a}),s?o(Cn,{field:a}):null,c("div",{className:"space-y-s",children:[o(ml,{label:"Фамилия",...Cl(a("surname"),Ul)}),o(ml,{label:"Имя",...Cl(a("name"),Ul)}),o(ml,{label:"Отчество (Обязательно, при наличии)",...a("middleName")}),o(dl,{label:"Дата рождения",...Cl(a("birthday"),Ol)})]}),d?c("div",{children:[o(ml,{label:"ИНН",...Cl(a("inn"),Hl)}),o(ml,{label:"Наименование организации",...a("fullName")})]}):null,o(vl,{label:"Способ получения ответа",options:In,...Cl(a("feedbackMethod"),Ol)}),o(yl,{label:"Телефон",...Cl(a("phone"),Wl)}),s?c("div",{children:[o(yl,{label:"Дополнительный телефон",...a("secondaryPhone").value&&"+7 ("!==a("secondaryPhone").value?Cl(a("secondaryPhone"),Wl):a("secondaryPhone")}),o(ml,{label:"Электронная почта",...Cl(a("email"),Ol)}),o(ml,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...a("bankEmpolee")}),o(ml,{label:"Дата и время обращения в Банк",...a("applicationDate")})]}):o(ml,{label:"Электронная почта",...Cl(a("email"),Ol)}),o(ml,{...Cl(a("comment"),Ol),placeholder:"Ваше сообщение",isTextarea:!0}),Dn(a("consentDataProcessing"),t,e)]})})})})),Fn=(e,t)=>{const l=_n(e?.typeForm.key,e?.serviceDirection?.key),n=Nl({...Ln,...On(e,l)});wl(n(e))&&t(e,!l)},On=(e,t)=>t?{addressBranch:Ol,inn:Hl}:"FEEDBACK"===e.typeForm.key?{birthday:Ol}:{addressBranch:Ol},_n=(e="",t="")=>"FEEDBACK_QS"===e&&"Юридическое лицо / ИП"===t,Un=d((e=>{const{button:t,regionSource:l}=e,[a,r]=n({key:""}),i=l?.regions??[],s=de({className:"text-white",version:t?.version}),d=i?.find((e=>e.name===a.key))?.href;return c("div",{className:"container space-y-s",children:[i?o(vl,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:i.map((({name:e=""})=>({key:e,text:e}))),value:a,onChange:r}):null,d?o("div",{className:"text-center",children:o(ye,{href:d,target:"_blank",className:p("p-m w-full @xl:w-auto",s),children:t?.text?t.text:"Перейти"})}):null]})})),Hn=d((({name:e,text:t,value:l,checked:n,onChange:a,className:r})=>o("div",{className:r,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:"appearance-none flex justify-center items-center shrink-0 w-5 h-5 border border-gray hover:border-primary-hover\n checked:border-2 checked:!border-primary-main focus:checked:border-primary-main focus:border-primary-text active:border-primary-text\n after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main outline-none rounded-full cursor-pointer",type:"radio",value:l,name:e,checked:n,onChange:e=>a(e.target.value),role:"radio"}),t?o(Ee,{color:"text-primary-text",children:t}):null]})}))),Wn=e=>{const{value:t,onChange:l}=e("vedTypes");return o(Sn,{children:c("div",{className:"gap-m grid @xl:flex @xl:items-center",children:[o(Hn,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:e=>l&&l(e)}),o(Hn,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:e=>l&&l(e)}),o(Hn,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:e=>l&&l(e)}),o(Hn,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:e=>l&&l(e)})]})})},Kn=({field:e})=>{const t="currencyControl"===e("vedTypes").value;return c("div",{className:"space-y-s",children:[t?o(xn,{field:e}):null,c("div",{className:"grid @xl:grid-cols-2 @xl:gap-x-m gap-s",children:[t?o(ml,{label:"ИНН",...Cl(e("inn"),Hl)}):null,o(ml,{label:"Наименование организации",...Cl(e("fullName"),Ol)}),o(ml,{label:"ФИО",...Cl(e("name"),Ul)}),o(yl,{label:"Телефон",...Cl(e("phone"),Wl)}),t?null:o(ml,{label:"Электронная почта",...e("email")})]})]})},qn={typeForm:{key:"KVED",text:"Заявка на консультацию ВЭД"},vedTypes:"currencyControl",fullName:"",name:"",phone:"",inn:"",email:"",partnerComments:""},Gn={fullName:Ol,name:Ul,phone:Wl},Yn=Nl({...Gn}),Xn=Nl({...Gn,inn:Hl,region:Ol}),Qn=e=>"currencyControl"===e,Zn=e=>({currencyControl:"currencyControl"===e,documentOperations:"documentOperations"===e,conversionTransactions:"conversionTransactions"===e,otherIssues:"otherIssues"===e}),Jn={ApplicationFormWed:d((e=>{const{button:t,link:l,onSubmit:n}=e,a=r((e=>{const{typeForm:t,fullName:l,name:a,phone:r,email:i,inn:s,region:o,vedTypes:c,partnerComments:d}=e,m={typeForm:t,fullName:l,name:a,phone:r,vedTypes:Zn(c),partnerComments:d,...Qn(c)?{inn:s,region:o}:{email:i}};wl((e=>Qn(e)?Xn:Yn)(c)(e))&&n(m)}),[n]),[,{field:i,...s}]=At(qn,{onSubmit:a});return c("form",{className:"container space-y-m",onSubmit:s.onSubmit,children:[Wn(i),o(S,{headingType:"h6",title:"Данные организации",className:"@xl:text-center"}),Kn({field:i}),o(ml,{label:"Обращение",placeholder:"Укажите интересующий вас вопрос, место ведения бизнеса и удобное время для телефонного звонка",...i("partnerComments"),isTextarea:!0}),jn(t),o(Vn,{link:l}),o(S,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex 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"})]})]})]})})),ApplicationFormGrantSupport:Un,ApplicationFormFeedback:$n},ea=Vt(),ta=St((({className:e,formBlock:t,...l})=>{const[a,i]=n(""),s=r((async(e,t=!1)=>{const l=na(e),n=await ea.send(l,t)?"OK":"Fail";return i(n),n}),[]);return o(x,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?.title?o(S,{headingType:"h3",title:t.title,className:"@xl:text-center"}):null,t?la(t,s):null,a?o(Pt,{responseType:a}):null]})})})),la=(e,t)=>{const l=e?.formType;if(!l||!(l in Jn))return null;return o(Jn[l],{...e,onSubmit:t})},na=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(t?.region?t?.text:t?.key)||t]))),aa=d((e=>{const{className:t,title:l,responseType:n,children:a,...r}=e;return o(x,{className:t,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[l?o(S,{headingType:"h3",title:l,className:"@xl:text-center"}):null,a,n?o(Pt,{responseType:n}):null]})})})),ra=e=>{const{acquiringType:t,onlineCheckout:l,posTerminal:n,amount:a,term:r,annualRevenue:i,serviceType:s,...o}=e,c=t||i?(e=>{const{acquiringType:t,onlineCheckout:l=!1,posTerminal:n=!1,term:a,amount:r,annualRevenue:i}=e;return t?`Вид эквайринга=${t?.text||""}${Zl(t?.key)?`/Онлайн касса=${l}/POS-терминал=${n}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${a}/Выручка=${i}`})(e):null,d={...o,...c?{partnerComments:c}:{}};return Object.fromEntries(Object.entries(d)?.map((([e,t])=>[e,("region"===e?t?.text:t?.key)||t])))},ia={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",middleName:"",phone:"",email:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e3,acquiringType:Xl[0],serviceType:vn[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentDataProcessing:!1},sa=(e,t="")=>{const l=Object.fromEntries(Gl(e).map((e=>[e,ia[e]])));return l?.serviceType&&"PREMIUMSERVICE"===t&&(l.serviceType=vn[1]),{...l,typeForm:{key:t,text:""}}},oa=Vt(),ca=d((({className:e,title:t,typeForm:l="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m})=>{const h=a?.flatMap((e=>e?.inputs))||[],u=sa(h,l),[g,x]=n(""),f=Nl((e=>{const t=Gl(e.filter((e=>"required"in e&&e.required)));return Object.fromEntries(t.map((e=>[e,Yl?.[e]])))})(h)),b=r((async e=>{if(!wl(f(e)))return"Fail";const t=ra({...e,...m}),l=await oa.send(t,"lead"===d)?"OK":"Fail";return x(l),l}),[]),[,{field:y,onSubmit:v}]=At(u,{onSubmit:b}),N=ma(h)?.name;return o(aa,{className:p(Mn,e),title:t,responseType:g,children:c("form",{className:"",onSubmit:v,children:[a.map(((e,t)=>c("div",{className:p(da(e.columns),"grid gap-x-m"),children:[e?.title?o("div",{className:"@xl:text-center @xl:col-span-2",children:e.title}):null,e?.inputs?.map(wn(y,l))]},`section-${t}`))),Dn(N?y("consentDataProcessing"):void 0,s,i)]})})})),da=e=>2===e?"@xl:grid-cols-2":"",ma=e=>e?.find((e=>"consentDataProcessing"===e?.name)),ha="text-left",ua={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},pa=d((({className:e,defaultIconSize:t=44,iconBgVersion:l="primary",size:n,icon:a,...r})=>{const i=String(n?.width||t);return a?o("div",{style:{width:`${i}px`,height:`${i}px`},className:p("rounded-icon object-fit flex justify-center items-center",ua[l],e),children:o(Y,{...r,width:"54%",height:"54%",name:a})}):null})),ga=d((({className:e="",title:t,benefitList:l,...n})=>c(x,{className:e,defaultPadding:"p-6xl",...n,children:[t?o(S,{headingType:"h3",as:"h2",className:ha,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(xa)}):null]}))),xa=({label:e,description:t,items:l,icon:n,iconBgVersion:a,isDotted:r=!1},i)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[n?.icon?o(pa,{className:"shrink-0",defaultIconSize:56,iconBgVersion:a||"",...n}):null,n?.src?o(ae,{className:"shrink-0",image:n}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(S,{headingType:"h6",children:e}),o(Ee,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),o(tt,{dotClassName:"bg-secondary-text",listItemSize:"S",items:l,isDotted:r})]}):null]},String(i)),fa=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function ba(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 ya=d((({className:e,style:t,idx:l,activeIndex:n,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:l}={}){const n=s(null),r=i((()=>({threshold:ba(t),root:l?.current})),[t,l?.current]);return a((()=>{if(!n.current)return;const t=new IntersectionObserver(e,r);return t.observe(n.current),()=>{t.disconnect()}}),[e,r]),n}(r((e=>{e.length&&m&&m(l||0,e[e.length-1])}),[m,l]),c);return o("div",{className:p("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(l===n),ref:h,role:"listitem",children:d})})),va=["min-w-full","@lg:min-w-[50%]","@lg:min-w-[33.3%]","@lg:min-w-[25%]"],Na=d((({className:e,itemClassName:t,containerRef:l,activeIndex:n,visibleItemCount:a=0,gap:i=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:u,onVisibleItemsChange:g,onVisibleIndicesChange:x})=>{const f={sensitivity:1,rootRef:l},b=s([]),y=r(((e,t)=>{const l=[...b.current||[]];l[e]=t,b.current=l,g&&g(l),x&&x(ka(l))}),[g,x]),v=a>0?i*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,k={...w?wa(c,v):{},...N?fa(h):{},gap:`${i}px`};return o("div",{className:p("box-border overflow-auto no-scrollbar",d,e),style:k,ref:l,role:"list",children:(C=(e,l)=>o(ya,{className:p(m,a?va[a-1]:"",N?"h-full":"",t),style:w?wa(c/4):{},activeIndex:n,idx:l,observerOptions:f,onIntersection:y,children:e},String(l)),e=>null==e?e:Array.isArray(e)?e.map(C):C(e,0))(u)});var C})),wa=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),ka=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Ca={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Sa={"horizontal-list":"w-6","vertical-list":"h-6"},Ta=d((({className:e="",containerRef:t,activeIndex:l,dotCount:n=0,listType:a="horizontal-list",version:r})=>n?o("div",{className:p("flex gap-xs",Ca[a],r?"group":"",e),"data-ver":r,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 group-data-transparent:bg-white ${n===l?Sa[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)),Ia=e=>e,Ba=(e=Ia)=>t=>t.reduceRight(((t,l)=>e(t)>e(l)?t:l)),Ma=Ba(),Va=(e=Ia)=>Ba((t=>-e(t))),Ra=Va(),Pa=e=>t=>e.scrollWidth/t,za=e=>(t,l)=>{e.scrollBy({left:l*Pa(e)(t),behavior:"smooth"})},Aa=({itemCount:e,onVisibleIndicesChange:t})=>{const l=s(null),[a,i]=n([]),o=r((e=>{i((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?[Va()(a),Ba()(a)]:[-1,-1],m=c>0,h=d<e-1,u=r((()=>{var t;l.current&&(m?za(l.current)(e,-1):(t=l.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=r((()=>{l.current&&(h?za(l.current)(e,1):l.current.scrollTo({left:0,behavior:"smooth"}))}),[e,h]),g=r(((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}]},ja=d((({className:e,version:t,gap:l=14,padding:n=16,showDots:a=true,minHeight:r,children:i,onVisibleIndicesChange:s,listType:d="horizontal-list"})=>{const m=Array.isArray(i)?i.length:0,[h,u]=Aa({itemCount:m,onVisibleIndicesChange:s}),[g]=u.visibleIndicesRange;return c("div",{className:p(e,"vertical-list"===d?"relative h-full":""),children:[o(Na,{containerRef:h,activeIndex:g,visibleItemCount:1,gap:l,padding:n,onVisibleIndicesChange:u.handleVisibleIndicesChange,listType:d,minHeight:r,children:i}),a?o(Ta,{containerRef:h,activeIndex:g,dotCount:m,listType:d,version:t}):null]})})),Da=(e,t,l)=>{return o(ja,{children:e.map((n=l,({icon:e,title:t,description:l},a)=>c("div",{className:p("flex flex-col gap-1","justify-between p-m h-full border border-gray",l||t?"":"justify-center"),children:[t?o(Ee,{size:"text-h6",font:"font-normal",align:n,children:t}):null,e?o(ae,{image:e,height:"180",className:"w-auto mx-auto"}):null,l?o(Ee,{size:"text-h6",font:"font-normal",align:n,children:l}):null]},String(a))))});var n},Ea=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:l="",columnsCount:n="4",subtitle:a,title:r,...i})=>c(x,{className:p("space-y-3xl",l),defaultPadding:"p-6xl",...i,children:[o(B,{defaultPadding:"",title:r,description:a,headlineVersion:"M"}),e?.length?Da(e,0,t):null]}))),La={start:"justify-start",center:"justify-center",end:"justify-end"},$a=d((({buttons:e,className:t="",align:l,...n})=>{const a=l?p("flex",La[l]):"";return o(x,{className:p("!bg-transparent",a,t),defaultPadding:"p-0",...n,children:Ye(e)})})),Fa=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:l=!1,renderFoldableSection:a,renderFoldButton:i})=>{const[s,o]=n(l),d=r((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),h=i?i({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[h,m]}:{className:e,role:"group",children:[m,h]})}));const Oa=d((({className:e="",isUnfolded:t,children:l})=>{const n=s(null),r=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:r,children:l})})})),_a=d((({className:e,title:t,value:l,fractionDigits:n,fixed:a,prefix:r,postfix:i})=>c("div",{className:p("flex justify-between @xl:flex-col",e),children:[t?o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}):null,o("div",l?{children:o(Ee,{size:"text-h3",children:[r,lt(n,{fixed:a})(l),i].filter(Boolean).join(" ")})}:{children:o(Ee,{size:"text-h3",children:"-"})})]}))),Ua=Math.round(29.5),Ha={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Wa={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Ka={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},qa={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0},Ga={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Ya=(e,t)=>{const{travelExpenseValue:l,restExpenseValue:n}=e,[a,r]=((e,t,l)=>{const{maxBonus:n=5e3,prefMonthsNum:a=Ka.prefMonthsNum,prefTravelBonusRate:r=Ka.prefTravelBonusRate,prefRestBonusRate:i=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(r*t)+Math.round(i*l),n);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*l),n)*(12-a)]})(t||Ka,l,n);return{...t,...e,monthBonus:a,yearBonus:r}},Xa=e=>e?o(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e}):null,Qa=d((({rate:e=0,title:t="Ставка",unit:l,fractionDigits:n=2,depositeName:a,isShowDepositeName:r})=>c("div",{children:[o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}),c("div",{className:"relative",children:[c("div",{className:"flex justify-start gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]",children:lt(n,{fixed:!0})(e)}),l?o("span",{className:"text-7xl",children:l}):null]}),a&&r?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Za=d((({title:e="Ставка",isUnavailableByTerm:t=!1})=>c("div",{className:"space-y-s",children:[o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(Y,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:t?c(T,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",o("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):o(T,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),Ja=({title:e="Ставка",rate:t=0,unit:l="%",fractionDigits:n=2,isUnknownRateShown:a=!0,...r})=>a&&0===t?o(Za,{title:e,...r}):c("div",{children:[o("div",{className:"hidden @xl:block",children:o(Qa,{title:e,rate:t,unit:l,fractionDigits:n,...r})}),o("div",{className:"@xl:hidden",children:o(_a,{title:e,value:t,postfix:l,fractionDigits:n,fixed:!0,...r})})]});function er({isShowItems:e=!0,step:t=1e3,...l}){const n=[`От ${lt(2)(l.min||0)} ₽`,`До ${lt(2)(l.max||0)} ₽`];return o(rn,{items:e?n:[],step:t,...l})}const tr=d((({className:e="",calcSource:t,buttons:l,footnote:n})=>{const[a,{field:r}]=At({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:i,maxSumTravel:s,minSumOther:d,maxSumOther:m,monthBonus:h,yearBonus:u}=Ya(a,t);return c("section",{className:p("flex flex-col justify-between @5xl:flex-row gap-y-4xl",e),children:[c("div",{className:"flex flex-col @xl:max-w-md gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0",children:[er({title:"Сумма покупок в категории путешествия, ₽",min:i,max:s,step:500,isShowItems:!1,...r("travelExpenseValue")}),er({title:"Сумма покупок в остальных категориях, ₽",min:d,max:m,step:500,isShowItems:!1,...r("restExpenseValue")})]}),h>=0?Ja({title:"Баллов за месяц",rate:h,fractionDigits:0,isUnknownRateShown:!1,unit:""}):null,c("div",{className:"flex flex-col gap-y-xl @xl:w-96",children:[u>=0?o(_a,{title:"Баллов за год",value:u}):null,Ye(l,{isVertical:!0}),Xa(n)]})]})})),lr=d((({className:e,inputChildren:t,rateChildren:l,resultChildren:n})=>c("section",{className:p("flex flex-col justify-between @5xl:flex-row gap-m",e),children:[o("div",{className:"flex flex-col gap-y-m sm:max-w-md gap-2xl",children:t}),o("div",{className:"border-b border-main-divider md:hidden"}),l,o("div",{className:"flex flex-col gap-2xl sm:w-96 max-w-full",children:n})]}))),nr=([e,t],l,n=[])=>l&&l[e]&&l[t]?{[e]:l[e],[t]:l[t]}:ar([e,t],n),ar=([e,t],l=[])=>({[e]:l.length?Ra(l.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:l.length?Ma(l.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),rr=(e,[t,l],n)=>e>=n[t]&&e<=n[l],ir=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,sr=(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)},or=(e,t=0)=>e?.sum?e.sum:t,cr=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,dr=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,mr={horizontal:"gap-5xl",vertical:"flex-col gap-s"},hr=d((({items:e,checkedItem:t,className:l,onChange:n,orientation:a="horizontal"})=>o("div",{className:p(`flex ${mr[a]}`,l),role:"radiogroup",children:e?.map((({id:e,text:l})=>o(Dl,{isRadio:!0,text:l,value:t===e,onChange:()=>n&&n(e)},String(e))))}))),ur=({items:e,title:t,mobileTitle:l=t,orientation:n="horizontal",value:a,radioGroupClassName:r,onChange:i})=>c("div",{className:"space-y-s",children:[t?o("div",{className:"hidden @5xl:block",children:o(Ee,{color:"text-secondary-text",font:"font-light",children:t})}):null,l?o("div",{className:"@5xl:hidden",children:o(Ee,{color:"text-secondary-text",font:"font-light",children:l})}):null,o(hr,{orientation:n,items:e,checkedItem:e[a?0:1].id,className:p("flex-col sm:flex-row",r),onChange:t=>i&&i(t===e[0].id)})]}),pr=e=>ur({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),gr=d((({className:e="",buttons:t,footnote:l,bottomFootnote:n,isShowDepositeName:a,defaultParams:r,calcSource:i})=>{const[s,{field:d}]=At({moneyValue:or(r,1e5),daysValue:cr(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),m=((e,t)=>{const{daysValue:l,moneyValue:n,isPartialWithdrawal:a,isReplenished:r,isMonthlyInterestPayment:i}=e,s=r||a,o=l<90||l>730;if(l<=30)return{...Ga,...e,isDisabledOperatingDeposit:o,isUnavailableByTerm:!0};const c=t?.rateRows?.find((e=>i===e.isMonthlyInterestPayment&&ir(s,e)&&rr(n,["minSum","maxSum"],e)&&rr(l,["minDays","maxDays"],e)))||Ga,{rate:d}=c,m=sr(d,e),h=n+m,u=t?.rateRows||[Ga];return{...c,...ar(["minSum","maxSum"],u),...ar(["minDays","maxDays"],u),...e,isDisabledOperatingDeposit:o,income:m,finalSum:h}})(s,i),{income:h,finalSum:u,rate:p,isUnavailableByTerm:g,depositeName:x}=m;return o(lr,{className:e,inputChildren:c("div",{children:[er({title:"Сумма, ₽",min:m.minSum,max:m.maxSum,...d("moneyValue"),value:m.moneyValue}),(f={title:"Срок, дней",min:m.minDays,max:m.maxDays,...d("daysValue"),value:m.daysValue},o(rn,{items:[`От ${dr(f.min||0)}`,`До ${dr(f.max||0)}`],step:1,...f})),c("div",{className:"flex flex-col sm:flex-row gap-y-4 gap-x-14",children:[xr(m,d),pr({title:"Выплата процентов",orientation:"vertical",...d("isMonthlyInterestPayment"),radioGroupClassName:"sm:flex-col"})]})]}),rateChildren:Ja({rate:p,depositeName:x,isShowDepositeName:a,isUnavailableByTerm:g}),resultChildren:c("div",{children:[fr(u,h),Ye(t,{isVertical:!0}),Xa(l),Xa(n)]})});var f})),xr=(e,t)=>c("div",{className:"space-y-s",children:[o(Ee,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-xl sm:gap-y-s",children:[o(Dl,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Dl,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),fr=(e,t)=>c("div",{className:"flex flex-col gap-2xl sm:gap-0 mb-lg",children:[o(_a,{title:"Доход в конце срока",value:t,postfix:"₽",prefix:"+"}),o(_a,{title:"Сумма в конце срока",value:e,postfix:"₽"})]}),br=e=>yr({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&yr({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&yr({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&yr({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),yr=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],vr=(e,t)=>{const{isAnnuity:l,moneyValue:n,monthsValue:a,moneyExtra:r}=t;if(0===e)return 0;if(l){const t=e/1200;return r?(n+r)*(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)},Nr=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,r=t?.rateRows||[Ha],i=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>br({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:s,maxSum:o}=nr(["minSum","maxSum"],i,r),{minMonths:c,maxMonths:d}=nr(["minMonths","maxMonths"],i,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a})=>e?.find((e=>br({row:e,userInputParams:t,paramsViewSettings:l})&&rr(n,["minSum","maxSum"],e)&&rr(a,["minMonths","maxMonths"],e)))||Ha)({rateRows:r,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a}),{rate:h}=m,u=vr(h,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:n,monthsValue:a,monthlyPayment:u}},wr=({min:e=0,max:t=0,availableMonths:l,...n})=>o(rn,{items:[`От ${kr(e)}`,`До ${kr(t)}`],step:1,...l?.length?{list:l}:{min:e,max:t},...n}),kr=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Cr=e=>ur({...e,radioGroupClassName:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Sr=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:a,defaultParams:r})=>{const[i,{field:s}]=At({moneyValue:or(r,2e5),monthsValue:cr(r,Ua),isAnnuity:Boolean(r?.isAnnuity),isInsurance:Boolean(r?.isEnableInsurance),isSalaryClient:Boolean(r?.isEnableSalaryClient),isPensionClient:Boolean(r?.isEnablePensionClient),isStateEmployee:Boolean(r?.isEnableStateEmployee)}),d=Nr(i,t,a),m=Cr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...s("isAnnuity")});return o(lr,{className:e,inputChildren:c("div",{children:[er({title:"Сумма кредита, ₽",step:500,min:d.minSum,max:d.maxSum,...s("moneyValue"),value:d.moneyValue}),wr({title:"Срок кредита, месяцев",min:d.minMonths,max:d.maxMonths,...s("monthsValue"),value:d.monthsValue}),Tr({...d,...a},s),o("div",{className:"sm:hidden",children:m})]}),rateChildren:Ja({rate:d.rate}),resultChildren:c("div",{children:[o(_a,{title:"Ежемесячный платёж",value:d.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:m}),Ye(l,{isVertical:!0}),Xa(n)]})})})),Tr=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Dl,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Dl,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Dl,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Dl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Ir=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let l=1;for(;l<t.length;){const[e,n]=t[l-1],[a,r]=t[l];n>=a?t.splice(l-1,2,[e,Math.max(n,r)]):l++}return t},Br=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,r=t?.rateRows?.[0]?Rr(t.rateRows[0].minMonths,t.rateRows[0].maxMonths):0,i=!l?.isShowMonthlyInterestPayment,s=!l?.isShowRemoteRegistration,o=t?.rateRows?.find((t=>Vr({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:i})&&Vr({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s})&&rr(n,["minSum","maxSum"],t)&&rr(a||r,["minMonths","maxMonths"],t)))||qa,{rate:c}=o,d=Mr(c,e),m=n+d,h=t?.rateRows||[qa];return{...o,...ar(["minSum","maxSum"],h),...ar(["minMonths","maxMonths"],h),availableMonths:Ir(h.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:r,income:d,finalSum:m}},Mr=(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],Rr=(e,t)=>e+Math.round((t-e)/2),Pr=d((e=>{const{className:t,calcSource:l,buttons:n,footnote:r,paramsViewSettings:i,defaultParams:s}=e,[d,{field:m}]=At({moneyValue:or(s,2e4),monthsValue:cr(s),isMonthlyInterestPayment:Boolean(s?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(s?.isRemoteRegistration)}),h=Br(d,l,i),{defaultMonth:u,rate:p,income:g,finalSum:x}=h,{onChange:f}=m("monthsValue"),{onChange:b}=m("moneyValue");return a((()=>{!d.monthsValue&&f&&f(u)}),[u]),a((()=>{b&&b(en(d.moneyValue,h.minSum,h.maxSum))}),[h.minSum,h.maxSum]),o(lr,{className:t,inputChildren:c("div",{children:[er({title:"Сумма, ₽",min:h.minSum,max:h.maxSum,...m("moneyValue"),value:h.moneyValue}),wr({title:"Срок, месяцев",min:h.minMonths,max:h.maxMonths,availableMonths:h.availableMonths,...m("monthsValue"),value:h.monthsValue}),zr({...h,...i},m)]}),rateChildren:Ja({rate:p}),resultChildren:c("div",{children:[o(_a,{title:"Доход в конце срока",value:g,postfix:"₽",prefix:"+"}),o(_a,{title:"Сумма в конце срока",value:x,postfix:"₽"}),Ye(n,{isVertical:!0}),Xa(r)]})})})),zr=(e,t)=>{return c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowMonthlyInterestPayment?pr({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment}):null,e.isShowRemoteRegistration?(l={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration},ur({...l,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]});var l},Ar=e=>jr({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&jr({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),jr=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],Dr=(e,t,l)=>{const{moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i}=e,s=t?.rateRows||[Wa],o=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>Ar({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:c,maxSum:d}=nr(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=nr(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i})=>e?.find((e=>Ar({row:e,userInputParams:t,paramsViewSettings:l})&&rr(n+i,["minSum","maxSum"],e)&&rr(r,["minSumOld","maxSumOld"],e)&&rr(i,["minSumExtra","maxSumExtra"],e)&&rr(a,["minMonths","maxMonths"],e)))||Wa)({rateRows:s,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i}),{rate:p}=u,g=vr(p,e),x=e.oldMonthlyPayment-g;return{...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i,monthlyPayment:g,benefit:x}},Er=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:a})=>{const[r,{field:i}]=At({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),s=Dr(r,t,a),d=Cr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...i("isAnnuity")});return o(lr,{className:e,inputChildren:c("div",{children:[er({title:"Остаток долга в других банках, ₽ ",step:500,min:s.minSum,max:s.maxSum-s.maxSumExtra,...i("moneyValue"),value:s.moneyValue}),er({title:"Ежемесячный платёж в других банках, ₽",step:500,min:s.minSumOld,max:s.maxSumOld,...i("oldMonthlyPayment"),value:s.oldMonthlyPayment}),wr({title:"Новый срок кредита, месяцев",min:s.minMonths,max:s.maxMonths,...i("monthsValue"),value:s.monthsValue}),Lr({...s,...a},i),s.isExtraMoney?er({title:"Дополнительная сумма, ₽ ",step:500,min:s.minSumExtra,max:s.maxSumExtra,...i("moneyExtra"),value:s.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:d})]}),rateChildren:Ja({rate:s.rate,fractionDigits:1}),resultChildren:c("div",{children:[o(_a,{title:"Ежемесячный платёж",value:s.monthlyPayment,postfix:"₽"}),s.benefit>0?o(_a,{title:"Выгода в месяц",value:s.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:d}),Ye(l,{isVertical:!0}),Xa(n)]})})})),Lr=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Dl,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Dl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Dl,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),$r={CreditCalculatorForm:Sr,DepositCalculatorForm:Pr,BusinessDepositCalculatorForm:gr,BonusCalculatorForm:tr,RefinancingCalculatorForm:Er},Fr=St((({className:e,calculatorTabs:t=[],...l})=>o(x,{className:e,defaultPadding:"p-0",...l,children:_r(t)}))),Or=e=>{const t=e.calculatorBlock?.calcType;if(!t||!(t in $r))return null;const l=$r[t];return c("div",{className:"p-xl",children:[e?.calculatorBlock?.title?o(S,{className:"mb-lg",title:e?.calculatorBlock?.title}):null,o(l,{...e.calculatorBlock,isMobile:!0})]})},_r=e=>{if(!e||!e.length)return null;return 1===e.length?Or(e[0]):e.map(((e,t)=>o(Fa,{isFoldButtonOnTop:!0,unfoldedByDefault:0===t,renderFoldableSection:({isUnfolded:t})=>o(Oa,{isUnfolded:t,children:Or(e)}),renderFoldButton:Ur(e)},t.toString())))},Ur=e=>({isUnfolded:t,onToggle:l})=>{const n=e.nav?.align||"text-left";return c("button",{type:"button",onClick:l,className:"w-full p-xl bg-primary-main flex items-center border-b border-white",children:[o("div",{className:"w-11 h-11 bg-white rounded-md flex justify-center items-center",children:o(Y,{name:e.nav?.icon?.icon,iconVersion:"color",width:"24",height:"24"})}),c("div",{className:"flex-1 flex flex-col pl-s",children:[o(Ee,{align:n,color:"text-white",children:e.nav?.title}),o(Ee,{align:n,size:"text-s",color:"text-white",font:"font-light",children:e.nav?.description})]}),o(Y,{name:t?"ArrowUpIcon":"ArrowDownIcon",iconVersion:"white",width:"24",height:"24"})]})},Hr=d((e=>{const{onChange:t,min:l,max:n,defaultValue:a="0",fractionDigits:i=0,...s}=e,c=Jl(e,{normalize:(e=a)=>l&&n?String(en(Number(Wr(e)),l,n)):Wr(e),format:lt(i)}),d=r((e=>t&&t(Wr(e))),[t]);return o($t,{onChange:d,...s,...c})})),Wr=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Kr=d((e=>o(Hr,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Ee,{size:"text-xl",font:"font-light",children:"₽"})})}))),qr={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Gr={amount:1500},Yr=d((({className:e="",title:t="Укажите сумму перевода",label:l="Сумма перевода",placeholder:r="1500",button:i,formType:s="private",...d})=>{const[{amount:m},{field:h}]=At(Gr),[u,g]=n(!1);return a((()=>{g(m<=0)}),[m]),c(x,{className:p("flex flex-col items-center",e),defaultPadding:"p-6xl",...d,children:[t?o(S,{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[s],children:[o(Kr,{valid:!u,placeholder:r,label:l,...h("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:m}),i?.text?o(An,{className:"w-full mt-lg",type:"submit",disabled:u,children:i.text}):null]})]})})),Xr=(e,t=0)=>{const{itemCount:l,visibleItemCount:a}=e,[i,s]=n(t),o=r((()=>s((e=>Math.min(e+1,l-1)))),[l]),c=r((()=>s((e=>Math.max(e-1,0)))),[l]),d=a?l>a&&i<l-a:i<l-1,m=i>0;return[i,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]},Qr=d((({className:e,disabled:t,...l})=>o(ye,{rounded:!0,className:p("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"})}))),Zr=d((e=>o(Qr,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Jr=d((e=>o(Qr,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),ei="absolute top-[calc(50%-24px)] z-40",ti="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",li=d((({scroll:e,activeIndex:t,itemCount:l,arrowsPadded:n,hasEdgeBlocks:a,onScrollLeft:i,onScrollRight:s})=>{const{canScrollLeft:d,canScrollRight:m,scrollLeft:h,scrollRight:u}=e,g=a?t>0:d,x=a?t<l-1:m,f=r((()=>{a?(d&&t!==l-1&&h(),i()):h()}),[h,i,a,d,t,l]),b=r((()=>{a?(m&&0!==t&&u(),s()):u()}),[u,s,a,d,t,l]);return c("div",{className:"m:hidden block",children:[ni(e),g?o(Zr,{className:p(ei,n?"left-1 m:left-8":"left-0"),onClick:f}):null,x?o(Jr,{className:p(ei,n?"right-1 m:right-8":"right-0"),onClick:b}):null]})})),ni=e=>c("div",{children:[e.canScrollLeft?o("div",{className:p(ti,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:p(ti,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),ai=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",ri=({className:e,text:t="ХИТ"}={})=>c("div",{className:p("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(Y,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(T,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),ii="relative h-full",si={small:"sm:min-w-64",normal:"sm:min-w-96",big:"sm:min-w-[515px]"},oi=({noCardBorder:e,activeIndex:t,cardSize:l="normal",...n})=>{const{blocks:a}=n.block||{},r=a?.some(mi);return A({...n,renderProps:(n,a,i)=>c("div",{className:ci(n,{someCardsHighlighted:r}),children:[R(n,a,{className:di(n,{someCardsHighlighted:r,showBorder:!e,cardSize:l}),blockIndex:i,isActive:i===t}),mi(n)?ri({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},ci=(e,{someCardsHighlighted:t})=>p(ii,t&&(mi(e)?"pt-3xl":"pt-3xl sm:pt-16")),di=(e,{someCardsHighlighted:t,showBorder:l,cardSize:n="normal"})=>p(ii,"min-w-80",si[n],t&&(mi(e)?"pt-3xl sm:pt-16":"pt-3xl"),ai(l),l&&"h-full"),mi=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,hi=St((({className:e,itemCount:t,visibleItemCount:l=0,noCardBorder:n,isAlignCenter:a,arrowsPadded:r=!0,isGap:i=!0,cardSize:s="normal",...d})=>{const{blocks:m=[]}=d.block||{},h=t||m?.length,[u,{inc:g,dec:f}]=Xr({itemCount:h,visibleItemCount:l},Math.floor(l/2)),[b,y]=Aa({itemCount:h}),[v]=y.visibleIndicesRange,N=m&&"CarouselBankHistoryCard"===m[0]?.type;return c(x,{className:e,defaultPadding:"p-6xl",...d,children:[c("div",{className:p(a?"flex justify-center":"","relative max-w-full"),children:[o(Na,{containerRef:b,visibleItemCount:l,snapAlign:"snap-start",gap:i?16:void 0,onVisibleIndicesChange:y.handleVisibleIndicesChange,children:oi({noCardBorder:n,activeIndex:u,cardSize:s,...d})}),o(li,{scroll:y,arrowsPadded:r,onScrollLeft:f,onScrollRight:g,hasEdgeBlocks:N,activeIndex:u,itemCount:h})]}),o(Ta,{className:"@5xl:hidden",containerRef:b,activeIndex:v,dotCount:h,listType:"horizontal-list"})]})}),{childrenTypes:["CarouselCard","CarouselBankHistoryCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),ui=d((({title:e,description:t,className:l})=>o(x,{className:l,defaultPadding:"p-6xl",children:o(B,{headlineVersion:"XS",title:e,description:t,align:"text-left",className:"text-primary-text",isEmbedded:!0})}))),pi="z-10 border border-solid w-full h-full",gi=p(pi,"absolute hidden @xl:block border-transparent"),xi=d((({className:e,title:t,description:l,button:n,...a})=>o(x,{className:p("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:p(gi,"top-9 right-12 bg-green-dark")}),o("div",{className:p(gi,"top-6 right-8 bg-green")}),o("div",{className:p(gi,"top-3 right-4 bg-green-light")}),c("div",{className:p(pi,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(B,{title:t,description:l,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Ye([n],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),fi={black:"bg-black",white:"bg-white"},bi=d((({className:e="",title:t,description:l,image:n,price:a,button:r,colors:i=[],align:s="text-left",padding:d,...m})=>o(x,{className:p("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Ce,{className:"h-full",padding:d,title:o(B,{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:Ye([r],{buttonClassName:"w-full self-end"}),children:[i?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Ee,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),i.map(yi)]}):null,a?c(Ee,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),yi=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${fi[e]}`},String(t)),vi="20",Ni="absolute w-full h-full border border-white",wi=d((({className:e="",icon:t,...l})=>{const n=ue(),{text:a,href:r,target:i,onClick:s}=n(l);return a?o("div",{className:p("flex relative group/link pl-s pb-s sm:pr-2xs min-w-64 sm:min-w-72",e),children:c("div",{className:"relative min-h-16 w-full pb-lg sm:pb-0",children:[c("a",{className:p("absolute border\n bg-white flex items-center justify-between group-hover/link:text-primary-main","flex rounded-md lg:rounded-none w-full w-full p-lg whitespace-nowrap z-10"),role:"link",href:r,target:i,onClick:s,children:[c("div",{className:"flex items-center space-x-lg",children:[t?o(ae,{imageClassName:"text-green-dark",image:t,width:vi,height:vi}):null,o(Ee,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})]}),o(ae,{className:"group-hover/link:brightness-100 sm:ml-2xs",image:{icon:"ArrowRightIcon",iconVersion:"color"},imageClassName:"group-hover/link:text-primary-main",width:vi,height:vi})]}),o("div",{className:p(Ni,"-bottom-1 -left-1")}),o("div",{className:p(Ni,"-bottom-2 -left-2")})]})}):null})),ki=d((({className:e,additionalDescription:t,description:l,links:n,title:a,...r})=>o(x,{defaultPadding:"p-5xl",className:p("overflow-hidden",e),...r,children:c("div",{className:"flex flex-col m:flex-row gap-s justify-between",children:[c("div",{className:"w-full m:w-1/3",children:[o(B,{isEmbedded:!0,title:a,description:l,as:"h1",align:"text-left"}),o(B,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),n?.length?Ci(n,"m:justify-self-end m:pt-s w-full m:w-2/3"):null]})}))),Ci=(e,t="")=>{const l=Math.ceil(e.length/3);return o(hi,{className:t,version:"secondary",itemCount:l,arrowsPadded:!1,padding:"p-0",visibleItemCount:0,children:Array.from({length:l}).fill(null).map(((t,l)=>o("div",{className:p("flex flex-wrap gap-2xs m:justify-center"),children:e.slice(3*l,3*(l+1)).map(((e,t)=>o(wi,{...e},String(t))))},String(l))))})},Si=d((({className:e="",href:t,target:l,isRemote:n=!1,children:a})=>{const r=ue({isRemote:n})({href:t,target:l});return o(t?"a":"div",{className:p("block",e),...t?r:{},role:t?"link":"none",children:a})})),Ti=[{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:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}}],Ii=e=>Ti.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{},Bi=d((({className:e="",media:t,showButtonText:l,stretched:a,version:r="white",children:i})=>{const[s,d]=n(),m=t?.map((e=>{const{href:t,icon:n,text:a}=e,{iconMapped:i}=Ii(t),o=Ge(n)?n:i,c=l?{text:a}:{text:""};return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:"color"},version:e?.version??r}})),h=p("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",a?"flex-1 justify-center":"");return c("div",{className:p("flex flex-col gap-xs",e),children:[o("div",{className:"flex gap-xs",children:Ye(m,{className:p(a||s?"basis-full":""),buttonClassName:h})}),i?o(Ee,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i}):null]})})),Mi=d((({className:e,padding:t,description:l,additionalDescription:n,href:a,icon:r,items:i=[],isDotted:s,socialMedia:d=[],target:m,title:h,align:u="text-left",benefits:g,imageOptions:{directionRight:f=!0,isImageAlwaysOnRight:b=false,isImageSecondary:y=!1}={},...v})=>o(x,{className:p("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...v,children:o(Si,{href:a,target:m,className:"h-full",children:c(Ce,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(B,{title:h,description:l,headlineVersion:"XS",isEmbedded:!0,align:u}),...ct(Ge(r)?o(ae,{image:r}):null,f),buttons:d.length?o(Bi,{media:d,showButtonText:!0,version:v?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(qe,{benefits:g}),o(tt,{items:i,isDotted:s,listItemSize:"S"}),Vi(n,u)]})})}))),Vi=(e,t)=>e?o(T,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Ri=(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(Ee,{size:"text-m",color:"text-secondary-text",children:l})}):null,n?o("div",{className:"mt-2xs",children:o(Ee,{size:"text-xl",color:"text-primary-text",children:n})}):null,a?.length?o("div",{className:"text-primary-main",children:Ye(a)}):null]},String(t))},Pi=d((({className:e="",title:t,align:l="text-center",icon:n,button:a,visibleCellsCount:r=1,cardCells:i=[],...s})=>{const d=i.map(Ri),[m,h]=r>0?[d.slice(0,r),d.slice(r)]:[d,[]];return c(x,{className:p("flex flex-col",e),defaultPadding:"p-2xl",...s,children:[Ge(n)?o("div",{className:"self-center",children:o(ae,{image:n})}):null,t?o(S,{className:p("pt-xs",l),headingType:"h5",title:t}):null,a?.text?o(ye,{className:"w-full mt-m mb-lg",...a}):null,h.length?o(Fa,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[m,o(Oa,{isUnfolded:e,children:h})]}),renderFoldButton:i.length>1?zi:null}):o("div",{children:m})]})})),zi=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:t,type:"button",children:[o("div",{children:e?"Скрыть":"Подробнее о тарифе"}),o(Y,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Ai=(e=!1)=>e?"text-white":"",ji=(e=!1)=>"text-s mb-m "+(e?"text-white":"text-secondary-text/80"),Di=d((({icon:e,image:t,title:l,subtitle:n,isFillGradient:a})=>c("th",{className:"space-y-4 flex flex-col items-start",children:[e?o(ae,{className:"h-16 w-16 min-w-16 min-h-16",image:e,width:"64",height:"64"}):null,t?.src&&o("div",{children:o(ae,{image:t})}),l?o(S,{headingType:"h4",className:Ai(a),title:l}):null,n?o("div",{className:ji(a),children:n}):null]}))),Ei=d((({cell:e,rowHeader:t,isFillGradient:l=!1})=>o("div",{className:"box-border flex flex-col",role:"cell",children:o("div",{className:p("h-full","border-main-divider border-b"),children:e?e.map(Fi(l,t)):null})}))),Li=(e=!1)=>""+(e?"text-white/80":"text-secondary-text"),$i=(e=!1)=>""+(e?"text-white":""),Fi=(e,t)=>({label:l,description:n},a)=>c("div",{className:"flex justify-between text-s py-s",children:[o(T,{size:"text-s",color:Li(e),children:t}),c("div",{className:"basis-1/2",children:[l?o("div",{className:"text-right",children:o(T,{size:"text-s",align:"text-right",color:$i(e),children:l})}):null,n?o("div",{className:"text-right",children:o(T,{size:"text-s",color:Li(e),children:n})}):null]})]},String(a)),Oi=d((({header:e,columnData:t,visibleRowLength:l=0,isFillGradient:n,showRow:a,onToggleColumn:r})=>{const i=t?.slice(0,a?t.length:l),s=n?"secondary":"primary";return o("tr",{className:"mb-m",children:c("td",{className:p("border border-gray rounded-md p-m",n?"bg-gradient-to-r from-main-gradient-start to-main-gradient-end":""),children:[o(Di,{...e,isFillGradient:n}),i?.length?i.map((({rowHeader:e,cell:t},l)=>o(Ei,{cell:t,rowHeader:e,isFillGradient:n},String(l)))):null,a&&e?.link?o(ye,{href:e.link.href,target:e.link?.target,version:s,ariaLabel:"Подробнее",className:"text-s font-medium mt-m p-s",children:e.link.text}):null,_i({onToggleColumn:r,isFillGradient:n,showRow:a})]})})})),_i=({onToggleColumn:e,isFillGradient:t,showRow:l})=>o("td",{className:"pt-lg",children:o("a",{role:"link",onClick:e,className:"cursor-pointer "+(t?"text-white/80":"text-primary-main"),children:o(Ee,{size:"text-s",font:"font-medium",children:l?"Скрыть":"Показать описание"})})}),Ui=d((e=>{const{className:t,title:l}=e;return c("section",{className:`bg-white font-sans p-6xl overflow-hidden text-primary-text relative space-y-lg ${t||""}`,children:[l?o(S,{headingType:"h3",className:"font-medium text-center",title:l}):null,o("table",{className:"border-separate",children:o(Hi,{...e})})]})})),Hi=d((({columns:e=[],rowHeaders:t,isColoredFirstColumn:l,visibleRowLength:a,orientation:i,...s})=>{const[c,d]=n(Array.from({length:e.length}).fill(!a)),m=r((e=>{const t=(t,l)=>l===e?!t:t;d((e=>e.map(t)))}),[]),h=r((()=>d((e=>Array.from({length:e.length}).fill(!1)))),[]),u=e?.map((({data:e,header:n},r)=>{return o(Oi,{visibleRowLength:a,showRow:c[r],header:n,columnData:(i=e,i?.map(((e,l)=>({cell:e,rowHeader:t?.[l]?.title})))),isFillGradient:0===r&&l,onToggleColumn:()=>m(r),...s},String(r));var i}));return o("tbody","horizontal"===i?{children:o(ja,{onVisibleIndicesChange:h,children:u})}:{children:u})})),Wi=e=>e%2!=0,Ki=d((({textNode:e,iconNode:t,tag:l,onClick:n,justifyContent:a="between",className:r,role:i,...s})=>c(l,{tag:l,className:p("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",r),onClick:n,role:i,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),qi=d((({className:e="",label:t,icon:l,dataTheme:n="",disabled:a=!1,onClick:r})=>o(Ki,{tag:"button",onClick:r,disabled:a,"data-theme":n,justifyContent:"center",role:"button",className:p("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(Ee,{size:"text-h4",children:t}),iconNode:l?o(ae,{image:{icon:l,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Gi=({isUnfolded:e,onToggle:t})=>o(qi,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Yi=d((({title:e,description:t})=>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(B,{title:e,description:t,headlineVersion:"S",isEmbedded:!0,align:ha})]}))),Xi=["ArrowDownIcon","ArrowUpIcon"],Qi="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box",Zi=d((({label:e="",blocksToRender:t=[],topItemsCount:l=0,block:n,notFound:a,...r})=>{const[i,s]=l>0?[t.slice(0,l),t.slice(l)]:[t,[]];return c("div",{children:[o("div",{className:p(t.length?"hidden":"block"),children:a?o(Yi,{...a}):null}),c("div",{className:p("space-y-2xs",t.length?"":"hidden"),children:[c("div",{className:p(Qi),children:[z(i,{...r.options,parent:n}),Wi(i.length)?o(It,{className:"col-span-6",...r}):null]}),o(Fa,{renderFoldableSection:({isUnfolded:e})=>c(Oa,{className:p(Qi),isUnfolded:e,children:[z(s,{...r.options,parent:n}),Wi(s.length)?o(It,{className:"col-span-6",...r}):null]}),renderFoldButton:({isUnfolded:t,onToggle:n})=>o(qi,{className:p(l<1?"hidden":""),disabled:!s?.length,label:e,icon:Xi[Number(t)],dataTheme:r.options?.page?.colorPalette,onClick:n})})]})]})})),Ji=d((({value:e,onChange:t,items:l=[],multiple:n})=>l.map((l=>o(hn,{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))))),es=({field:e,reset:t,filtrationSchema:l,resetButton:n,children: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-5xl",children:[a,Object.entries(l).map(ts(e))]}),n?o("div",{children:o(An,{type:"reset",className:"w-full @4xl:w-72 @4xl:ml-s",onClick:t,children:n?.text})}):null]}),ts=e=>([t,l])=>{const n=l?.type;return"array"===n?ls(t,e)(l):null},ls=(e,t)=>l=>{const n=l?.items?.enum?.map(((e,t)=>({value:e,title:l?.items?.enumNames?.[t]||""})))||[];return c("div",{children:[l?.title?o("div",{className:"mb-m",children:o(Ee,{size:"text-m",font:"font-light",color:"text-secondary-text",children:l.title})}):null,o(Ji,{items:n,multiple:!l?.single,...t(e)})]},e)};function ns(e,...t){return e.map(((e,l)=>[e,...t.map((e=>e[l]))]))}const as=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,rs=(e,t)=>Object.entries(e).map((([l,n])=>"number"==typeof n?Array.isArray(t[l])?((e,t)=>l=>as(t[e])||as(l[e])||l[e]?.includes(t[e]))(l,e):((e,t)=>l=>as(t[e])||as(l[e])||is(t[e])<=is(l[e]))(l,e):"object"==typeof n&&"min"in n&&"max"in n?((e,t)=>l=>as(t[e])||as(l[e])||is(t[e]?.min)>=is(l[e]?.min)&&is(t[e]?.min)<=is(l[e]?.max))(l,e):Array.isArray(n)?((e,t)=>l=>as(t[e])||as(l[e])||t[e]?.every((t=>l[e]?.includes(t))))(l,e):((e,t)=>l=>as(t[e])||as(l[e])||t[e]===l[e])(l,e))).every((e=>e(t))),is=e=>Number(e||0),ss=(e,{block:t,page:l,normalize:n=zt})=>{const a=t?.blocks||[],[r,{field:s,reset:o,update:c}]=At(e),d=i((()=>ns(a,a.map((e=>kt(e.content,l?.fallback))))),[a,l?.fallback]),m=r===e?a:((e,t)=>(l=zt)=>e?.filter((([,e])=>rs(t,l(e)||{}))).map((([e])=>e)))(d,r)(n);return[r,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},os=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,cs=(e,t)=>Array.from({length:t-e+1},((t,l)=>e+l)),ds=1e9,ms={sum:{min:1e4,max:ds},period:3},hs=St((({className:e,filtrationSchema:t={},resetButton:l,sumInput:n,periodInput:a,...r})=>{const[,{blocksToRender:i,blocksWithProps:s},{field:d,reset:m}]=ss(ms,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:us(e)})}),h=s.map((([,e])=>e?.paramsSource?.rateRows)),u=ps(h),g=c("div",{children:[o(Kr,{label:n?.title,min:500,max:ds,...d("sum",{parse:e=>({min:Number(e),max:ds}),format:({min:e})=>String(e)})}),o(rn,{title:a?.title,items:["От 3 мес","До 5 лет"],list:u,...d("period")})]});return c(x,{className:p("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[es({field:d,reset:m,filtrationSchema:t,resetButton:l,children:g}),o(Zi,{blocksToRender:i,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),us=e=>vt((e?.paramsSource?.rateRows||[]).filter(os).flatMap((e=>cs(e.minMonths,e.maxMonths)))),ps=e=>vt(e.flatMap((e=>e||[])).filter(os).flatMap((e=>cs(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],gs=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,xs=d((({className:e="",title:t,description:l,error:n,button:a,...r})=>c(x,{className:p("flex flex-col justify-center items-center",e),defaultPadding:p("p-6xl"),version:"transparent",...r,children:[o("div",{className:"flex justify-center",children:gs(n)}),o(B,{title:t,description:l,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ye,{version:a?.version,text:a?.text,...a}):null]}))),fs="location";function bs(e="Москва"){const[t,l]=((e,t,l)=>{const[i,s]=n(l||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[i,r((l=>e.fire(t,l)),[e,t])]})(h,"location",vs()??{name:e}),i=r((e=>{Ns(e),l(e)}),[]),{data:s}=Ml(ys()?null:"/api/v1/region",yt);return a((()=>{s&&!ys()&&l(s)}),[s]),[t??{name:e},i]}const ys=()=>Boolean(globalThis.localStorage?.getItem(fs)),vs=()=>{try{const e=globalThis.localStorage?.getItem(fs);return e&&JSON.parse(e)}catch(e){return null}},Ns=e=>{try{globalThis.localStorage?.setItem(fs,JSON.stringify(e))}catch(e){}};var ws;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(ws||(ws={}));const ks=new Intl.NumberFormat("ru",{style:"currency",currency:ws.RUB}),Cs=e=>e?ks.format(e):"",Ss="text-left text-m font-light text-secondary-text",Ts=`${Ss} pl-5xl`,Is={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Bs=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:`h-fit w-fit ${e}`,children:[o("thead",{children:c("tr",{children:[o("th",{className:Ss,children:o(Ee,{size:"text-m",children:"Валюта"})}),o("th",{className:Ts,children:o(Ee,{size:"text-m",children:"Купить"})}),o("th",{className:Ts,children:o(Ee,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Ms)})]}))),Ms=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ae,{image:{icon:Is[t]},width:"24",height:"24"}):null,o(Ee,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl",children:o(Ee,{size:"text-h6",children:Cs(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl",children:o(Ee,{size:"text-h6",children:Cs(e?.buyExchangeRate)})})]},t)},Vs={icon:"GpsIcon"},Rs=d((({className:e="",address:t})=>c("div",{className:`flex gap-s ${e}`,children:[o(pa,{...Vs,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(T,{size:"text-l",color:"text-primary-main",children:t}):null,o(T,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Ps=(e,t,l)=>{const n=Number(zs(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)},zs=e=>e.replace(/[^\d.,]/g,"").replace(",","."),As=e=>{return(t=[[e=>e.value!==ws.RUB&&e.oppositeValue!==ws.RUB,()=>e.handleConvert(e.value,ws.RUB)],[e=>e.value===ws.RUB&&e.oppositeValue===ws.RUB,()=>e.handleConvert(e.value,ws.USD)],[e=>e.value===ws.RUB&&e.oppositeValue===ws.RUB,()=>e.handleConvert(e.value,ws.CNY)],[()=>!0,()=>e.handleConvert(e.value)]],e=>{const[,l]=t.find((([t])=>t(e)))||[];return l})(e)?.();var t};function js(e){const{placeholder:t,rates:l,selected:n,value:a,setValue:r,setSelected:i}=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($t,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:r}),s.length?o(qt,{isBorder:!1,onChange:e=>i(e.key),options:s,value:d}):null]})}const Ds=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:l,button:a})=>{const[i,s]=n({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||ws.RUB,selectBuy:l?.[0]?.currency?.currency||ws.USD}),d=r((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[js({placeholder:"Хочу продать",rates:l,selected:i.selectSell,setSelected:Es(i,d,l),value:i.inputSell,setValue:e=>$s(d,l)(e,i.selectSell,i.selectBuy)}),js({placeholder:"Получу",rates:t,selected:i.selectBuy,setSelected:Ls(i,d,t),value:i.inputBuy,setValue:e=>Fs(d,t)(e,i.selectBuy,i.selectSell)}),a?.text?o(ye,{text:a.text,version:a?.version,...a}):null]})})),Es=(e,t,l)=>n=>{t({selectSell:n}),As({value:n,oppositeValue:e.selectBuy,handleConvert:(n=e.selectSell,a=e.selectBuy)=>{$s(t,l)(e.inputSell,n,a)}})},Ls=(e,t,l)=>n=>{t({selectBuy:n}),As({value:n,oppositeValue:e.selectSell,handleConvert:(n=e.selectBuy,a=e.selectSell)=>Fs(t,l)(e.inputBuy,n,a)})},$s=(e,t)=>(l,n,a)=>{e({inputSell:zs(l),selectBuy:a});const r=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===n))?.buyExchangeRate;r&&e({inputBuy:String(Ps(l,r,n===ws.RUB)||"")})},Fs=(e,t)=>(l,n,a)=>{e({inputBuy:zs(l),selectSell:a});const r=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===n))?.saleExchangeRate;r&&e({inputSell:String(Ps(l,r,n===ws.RUB)||"")})};const Os=d((({className:e="",title:t="Курсы обмена валют",button:l,...n})=>{const[a]=bs(),r=function(e){const t=e?.code||"000",{data:l}=Ml(`/api/v1/exchangerates?regionCode=${t}`,yt);return l||{}}(a),i=_s(r?.exchangeRate?.currencies),s=i.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:ws.RUB}});const d=i.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:ws.RUB}}),o(x,{className:p("box-border min-h-80",e),...n,children:o(Ce,{className:"h-full",title:o(S,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap sm:flex-nowrap",children:[c("div",{className:"max-w-1/2",children:[i?o(Bs,{className:"mb-xl",exchangeCurrencyItems:i}):null,o(Rs,{address:r?.address})]}),i.length&&s.length&&d.length?o(Ds,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:l}):null]})})})})),_s=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Us=(e,t)=>o(pa,{...e,iconBgVersion:t,className:"shrink-0"}),Hs=d((({label:e,labelIconBgVersion:t,icon:l,onToggle:n,labelIcon:a})=>o(Ki,{tag:"button",className:p("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:[Us(a,t),e?o(Ee,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:l?o(Y,{name:l,iconVersion:"black",width:"24",height:"24"}):null}))),Ws=St((({className:e="",isExpanded:t,isFoldButtonOnTop:l=!0,label:n="Развернуть",labelIcon:a,labelIconBgVersion:r,foldButtonVersion:i="default",version:s,role:c,...d})=>o(x,{className:p("w-full","",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(Fa,{isFoldButtonOnTop:l,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(Oa,{className:p("gap-lg","flex flex-wrap group-last:last:pb-0"),isUnfolded:e,children:A({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ks({foldButtonVersion:i,label:n,labelIcon:a,labelIconBgVersion:r,isUnfolded:e,onToggle:t})})})),{childrenTypes:{exclude:["RollupItem"]}}),Ks=({foldButtonVersion:e,label:t,labelIcon:l,labelIconBgVersion:n,isUnfolded:a,onToggle:r})=>{const i=t||(a?"Скрыть":"Развернуть"),s=((e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon")(a);return"accordion"===e?o(Hs,{label:i,labelIcon:l,labelIconBgVersion:n,icon:s,onToggle:r}):o(qi,{label:i,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:r})},qs=d((({className:e="",items:t})=>c("div",{className:e,children:[t?.length?t.map(Gs):null,o(ye,{version:"primary",className:"w-full",href:"https://www.rshb.ru/natural/feedback/question",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"})]}))),Gs=(e,t)=>c("div",{className:"mb-m space-y-m",children:[o("div",{children:o(Ee,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Ys)})]},String(t)),Ys=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Xs(e.type,e.text)}),o(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Xs=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Qs(t)}`,children:o(Ee,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(T,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Qs=e=>e.replaceAll(/\D/g,""),Zs=["split_version","New","Old"],Js=d((({className:e="",index:t,text:l,...n})=>{const a=ue(),{href:r,target:i,onClick:s}=a(n);return o("a",{className:p("",e),href:r,target:i,onClick:s,children:l||`Документ ${t}`})})),eo=d((({title:e,links:t,className:l=""})=>c("div",{className:p("flex flex-col gap-4",l),children:[o(Ee,{size:"text-l",font:"font-normal",children:e}),t?.length?o("div",{className:"flex flex-col gap-lg",children:t.map(((e,t)=>o(Js,{className:"text-l font-light",index:t,...e},String(t))))}):null]}))),to=d((({className:e="",items:t,basePath:l})=>t?.length?o("ul",{className:p("flex flex-col",e),children:t.map(lo(l))}):null)),lo=e=>(t,l)=>{const{text:n,...a}=t,r=ue({isRemote:!(!E.BASE_PATH||!e)&&!E.BASE_PATH.startsWith(e),basePath:e}),{href:i,target:s,onClick:c}=r(a);return o("li",{className:"list-none my-xs",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:i,target:s||"_self",onClick:c,children:n||null})},`list_item_${String(l)}`)},no=d((({className:e="",index:t,...l})=>{const n=ue({isRemote:!0}),{href:a,target:r,text:i,onClick:s}=n(l);return o("a",{className:`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:r,onClick:s,children:i||`Документ ${t}`})})),ao=d((({className:e="",links:t})=>c("div",{className:p("@container",e),children:[o("div",{className:"pt-lg",children:o(Ee,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs pt-lg",children:t.map(((e,t)=>o(no,{index:t,...e},String(t))))}):null]}))),ro=St((({className:e,footer:t,...l})=>{const{topItems:n}=l.options?.page?.sitemap??{},{relatedEnterprises:a,contacts:i,socialMedia:s,mobileApps:d,horizontalNavigationTitle:m,documents:h}=t||{},u=r((()=>{const[e,t,l]=Zs;((e,t)=>{const l=globalThis.document?.cookie.split(";")??[],[,n]=l.map((e=>e.split("="))).find((([t])=>t.trim()===e))||[];t(n)&&(globalThis.document.cookie=`${e}=${t(n)}`)})(e,(e=>e?.replace(t,l)))}),[]);return c(x,{tag:"footer",className:e,defaultPadding:"p-4xl pb-24",...l,children:[o("div",{className:"mb-lg pb-xs border-b border-main-divider",role:"menu",children:io(n)}),o(qs,{className:"overflow-hidden",items:i}),c("div",{className:"mt-xl",children:[o(Bi,{className:"mb-xl",media:s,stretched:!0,children:"Соцсети"}),c("div",{className:"mb-xl",children:[o("div",{className:"flex flex-col gap-4 mb-xs",children:d?.map(so)}),o(Ee,{size:"text-s",font:"font-light",color:"text-secondary-text",children:"Мобильное приложение"})]})]}),o("div",{className:"py-lg border-t border-main-divider",children:o(Js,{text:"Вернуться на прежнюю версию сайта",className:"text-l font-light max-w-[292px]",href:"https://old.rshb.ru",onClick:u})}),o(eo,{className:"py-lg border-y border-main-divider",title:m,links:a}),o(ao,{links:h})]})})),io=e=>e?.map(((e,t)=>o(Ws,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:o(to,{items:e.items,basePath:j(e.href)})},String(t)))),so=({href:e="/",text:t},l)=>{const{label:n}=Ii(e);return o(ye,{className:"w-full",text:t||n,version:"secondary",href:e,target:"_blank"},String(l))},oo={width:"34",height:"34"},co={"bg-white":"color",transparent:"white"},mo={"bg-white":"text-primary-main",transparent:"text-white"},ho=(e,t,l)=>o(ae,t?.src?{image:t,className:mo[e],width:l?.width,height:l?.height}:{image:{icon:t?.icon||"LogoIcon",iconVersion:co[e]},className:mo[e],width:l?.width,height:l?.height}),uo={"bg-white":"text-primary-text",transparent:"text-white"},po=d((({className:e,href:t="/",logo:l,children:n,targetBlank:a,bgColor:r="bg-white",showTitle:i=!0})=>c("a",{className:p("inline-flex items-center font-sans no-underline",e),href:t,target:a?"_blank":"_self","aria-label":l?.title??"Россельхозбанк",children:[ho(r,l?.image,oo),i?n??o("div",{className:"ml-s",children:o(Ee,{font:"font-medium",color:uo[r],size:"text-s",children:l?.title??"Россельхозбанк"})}):null]}))),go={default:"px-5 bg-main-divider rounded hover:text-primary-main",transparent:"text-white hover:text-primary-hover"},xo=d((({bgColor:e,logo:t,alwaysShowLogo:l,internetBankUrl:n,version:a})=>{const i=u(),s=E.BASE_PATH?.startsWith(i.pathname),d=r((()=>{i.back()}),[]);return c("div",{className:"flex items-center justify-between w-full",children:[l||s?o("div",{children:o(po,{className:"my-2xs",bgColor:e,logo:t})}):fo(d),n?o("div",{children:o(ye,{href:n,ariaLabel:"Войти",target:"_blank",className:p("p-s text-s whitespace-nowrap text-primary-main hover:text-primary-hover",go["transparent"===a?"transparent":"default"]),children:"Войти"})}):null]})})),fo=e=>o("div",{children:c("button",{className:"flex items-center text-l my-2xs","aria-label":"Вернуться назад",onClick:e,type:"button",children:[o(ae,{className:"w-6 h-6",image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24"}),"Вернуться назад"]})}),bo={"bg-white":"primary",transparent:"transparent"},yo=St((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:l=bo[e],portal:n,...a})=>{const{logo:r}=a.options?.page?.sitemap??{},{internetBankUrl:i}=n||{};return o(x,{tag:"header",defaultPadding:"",version:l,...a,children:o("div",{className:"container px-lg py-2xs box-border",children:o(xo,{bgColor:e,logo:r,alwaysShowLogo:t,internetBankUrl:i,version:l,...a})})})})),vo={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},No=St((({className:e="",padding:t="p-0",gap:l="",isInnerPadding:n=!0,version:a="transparent",isTheme:r=!1,isCardBorder:i=!1,image:s,...c})=>{const d=u();return o(x,{className:p("relative flex flex-col",vo[l],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:r,...c,children:A({...c,extraProps:{className:p("w-full",ai(i)),padding:n?"":"p-0"}})})}),{childrenTypes:[]}),wo=St((e=>o(No,{...e})),{childrenTypes:[]}),ko=d((e=>{const{className:t,image:l,...n}=e;return o(x,{className:t,defaultPadding:"p-0",...n,children:o(ae,{image:l})})})),Co=["байт","Кб","Мб","Гб","Тб","Пб"],So=d((({icon:e,text:t,href:l,target:n,fileFormat:a,fileSize:r})=>{const i=r&&a?",":"",s=r??"",d=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,children:[e,t?c(Ee,{size:"text-l",font:"font-light",children:[t," ",To(s,d),o(Ee,{color:"text-secondary-text",children:l&&`${s+i+d}`})]}):null]})})),To=(e,t)=>e||t?o("span",{children:", "}):"",Io={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Bo=d((({className:e="",title:t,description:l,align:n="text-center",documents:a,icon:r={icon:"DocIcon"},columnsMode:i="double",...s})=>{const d=u();return c(x,{className:p("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(B,{title:t,description:l,align:n,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:p("grid gap-xl","double"===i?"@md:grid-cols-2":"grid-cols-1",Io[i]),role:"list",children:a.map(Mo(d,r))}):null]})})),Mo=(e,t)=>(l,n)=>{if(""===l?.docType)return null;const a="Attachment"===l?.docType?K(e)(l?.attachment?.src):l?.href,r="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))} ${Co[l]}`})(l?.attachment?.fileSize||0):l?.fileSize,i="Attachment"===l?.docType?Vo(a):l?.fileFormat;return o("div",{role:"listitem",children:o(So,{text:l?.text,target:l?.target,href:a,fileFormat:i,fileSize:r,icon:t?o(ae,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:t,width:"24",height:"24"}):null})},String(n))},Vo=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},Ro=d((({className:e,padding:t,align:l="text-left",buttons:n=[],description:a,image:r,items:i,qr:s,additionalDescription:d="",title:m="Мобильное приложение",version:h="primary",...u})=>{const g="secondary"===h?"p-m min-w-32":"min-w-24",f=r?.src?o(ae,{className:"hidden lg:block",image:r}):null;return o(x,{className:p("min-h-80",e),padding:"p-0",version:h,...u,children:c(Ce,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(S,{headingType:"h3",title:m,className:p("whitespace-pre-wrap",l)}),rightImage:f,buttons:Ye(n,{className:"flex-wrap"}),children:[a?o(Ee,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:p("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[o(tt,{items:i,listItemSize:"M"}),o(Ee,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:d}),s?.src?o("div",{className:p("flex justify-center bg-white rounded-md @xl:-order-1",g),children:o(ae,{className:"w-fit",image:s})}):null,r?.src?o(ae,{className:"lg:hidden",image:r}):null]})]})})})),Po={primary:"bg-white/30",secondary:"bg-main-divider"},zo={primary:"text-white",secondary:"text-secondary-text"},Ao=d((({count:e,version:t="secondary"})=>o("div",{className:p("w-6 h-6 rounded-full flex items-center justify-center",Po[t]),role:"status",children:o(Ee,{size:"text-xs",color:zo[t],children:e})}))),jo=(e=[],t={})=>e.filter((({content:e={}})=>rs(t,e))).length,Do=(e,t)=>e===t;const Eo=(Lo=function(...e){return(t,l)=>e.some((e=>e(t,l)))}(Do,((e=Do)=>(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])=>Lo(l,t[e])))));var Lo;const $o=[],Fo={},Oo={default:"px-xs",underlined:"px-m",rounded:"px-lg rounded-md"},_o={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",rounded:"text-white"},Uo={default:"bg-white",underlined:"bg-white",rounded:"bg-transparent"},Ho={default:"sm:bg-primary-main",underlined:"bg-white",rounded:"bg-primary-main"},Wo=d((({tag:e="div",item:t={},isActive:l,type:n="default",onClick:a})=>{const r=e,{text:i,appendRight:s,...d}=t;return o(r,{className:p("h-12","block flex-1","cursor-pointer",Oo[n],l?Ho[n]:Uo[n]),role:"tab","aria-selected":l,onClick:a,...d,children:c("div",{className:p("h-full","flex justify-center items-center","text-center whitespace-nowrap",l?_o[n]:"text-secondary-text hover:text-primary-main"),children:[o(Ee,{size:"text-m",children:i}),s?o("div",{className:"ml-xs",children:s}):null]})})})),Ko=d((e=>o(e?.item?.href?qo:Go,{...e}))),qo=d((e=>{const t=ue(),l=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:n,...a}=t({...e.item,onClick:l});return o(Wo,{...e,tag:"a",item:a,onClick:n})})),Go=d((({item:e={},onClick:t,...l})=>{const n=r((()=>{t&&t(e)}),[t,e]);return o(Wo,{item:e,onClick:n,...l})})),Yo=(e,t,l)=>(n,a)=>o(Ko,{isActive:n===e,onClick:t,type:l,item:n},String(a)),Xo=d((({className:e,tabsType:t="default",items:l=[],value:n,onChange:a})=>o("div",{className:p("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tablist",children:l.map(Yo(n,a,t))}))),Qo={categories:[],extraOptions:[],propertyType:[],stage:[]},Zo=St((({className:e,hotFilters:t,filtrationSchema:l={},resetButton:n,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:u}]=ss(Qo,{block:a.block,page:a.options?.page}),g=r(((e=Qo)=>u(e)),[]),f=(({hotFilters:e=$o,filtrationState:t=Fo,blocks:l=$o,onFiltrationStateChange:n})=>{const a=i((()=>Math.max(0,e.findIndex((e=>Eo(e.filter,t))))),[e,t]),s=i((()=>e.map((t=>({text:t.text,appendRight:o(Ao,{version:t===e[a]?"primary":"secondary",count:jo(l,t.filter)})})))),[e,l,a]),c=r((t=>{n(e[s.indexOf(t)].filter)}),[e,s]);return{value:s[a],items:s,onChange:c}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:g});return c(x,{className:p("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Xo,{...f}),es({field:m,reset:h,filtrationSchema:l,resetButton:n}),o(Zi,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}});function Jo(e,t,l){t.geoObjects.removeAll();const n=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),a=new e.Clusterer({clusterIcons:[{href:"/icons/MapMarkerClusterIcon.svg",size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),r=l.map((({coords:t,content:l})=>new e.Placemark(t,{balloonContentHeader:l?.header,balloonContentBody:l?.body,balloonContentFooter:l?.footer,hintContent:l?.hint},{iconLayout:"default#image",iconImageHref:"/icons/MapMarkerSingleIcon.svg",iconImageSize:[78,84],iconImageOffset:[-35,-50]})));a.add(r),t.geoObjects.add(a),t.setBounds(e.util.bounds.fromPoints(l.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const ec={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center",font:"text-center font-sans"},tc=(e,t,l)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(ec).join(" ")} ${l}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.geoObjects.add(t.geoObjects)}))},children:o(Y,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),lc=e=>globalThis[e];const nc=()=>function(e,t){const[l,i]=n(),s=r((()=>i(lc(e))),[e]);return a((()=>{const l=document.getElementById(t);if(!l){const e=document.createElement("script");return e.src=t,e.async=!0,e.id=t,e.addEventListener("load",s),document.head.appendChild(e),()=>{document.head.removeChild(e),i(void 0)}}if(!lc(e))return l.addEventListener("load",s),()=>{l.removeEventListener("load",s)};s()}),[e,t]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${E.YANDEX_MAP_API_KEY||""}&lang=ru_RU`),ac={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center",font:"text-center font-sans text-l"},rc=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(ac).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(Y,{name:l,width:"20",height:"16"})})})),ic={border:"border border-transparent rounded-md ",position:"absolute flex items-center justify-center",size:"w-12 h-12",focus:"focus:border-primary-text focus:border",font:"text-center font-sans",active:"active:bg-primary-active",hover:"hover:bg-primary-hover",other:"select-none cursor-pointer"},sc=[55.753995,37.614069],oc=d((({points:e,className:t="",zoom:l=5})=>{const r=s(null),i=nc(),[d,m]=n();if(a((()=>{r?.current?i&&(Jo(i,r.current,e),e?.length||r.current.setCenter(sc)):i?.ready((()=>{r.current||(r.current=new i.Map("map",{center:e?cc(e):sc,zoom:l,controls:[],suppressMapOpenBlock:!0}),Jo(i,r.current,e))}))}),[i,r,e,l]),!i)return null;const h=d?"z-[100000]":"z-10";return c("div",{id:"map",className:p(!d&&"relative","w-full",t),children:[o("div",{className:p(Object.values(ic),h,"right-2 top-4 bg-white"),onClick:()=>{const e=r.current.container;d?e.exitFullscreen():e.enterFullscreen(),m(e.isFullscreen())},children:o(Y,{name:"FullScreenIcon",width:"16",height:"16"})}),c("div",{className:p("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(rc,{yandexMaps:r}),o(rc,{yandexMaps:r,direction:"out"})]}),tc(r.current,i,p("right-2 top-80",h))]})})),cc=e=>[mc(dc(e,0)),mc(dc(e,1))],dc=(e,t)=>e.map((e=>e.coords[t])),mc=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,hc={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных"},uc=(e,{field:t,reset:l})=>c("div",{className:"pb-2xl",children:[e?.length?o("div",{className:"flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",children:e.map((e=>o(Dl,{text:hc[e],...t(e)},e)))}):null,o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:l,text:"Очистить фильтр",appendRight:o(Y,{name:"CloseIcon",width:"16",height:"16"})})]}),pc=()=>{},gc=()=>[],xc=d((({className:e,data:t=[],renderCard:l=pc,filterItems:n=gc,getBalloon:a=pc,initFilterState:r={},descriptionData:s,title:d})=>{const[m,{field:h,reset:u}]=At(r),[g,x,f]=i((()=>{const e=n(t,m),l=e.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))).filter((e=>e.coords&&2===e.coords.length));return[e,l,e.length]}),[t,m]);return c("div",{className:p("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-6xl pb-0",children:[c("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:[o(S,{headingType:"h2",children:d}),f?o(Ee,{size:"text-h2",color:"text-secondary-text",children:`(${f})`}):null]}),s?fc(s):null,uc(Object.keys(r),{field:h,reset:u})]}),o("div",{className:"h-[600px]",children:o(b,{children:o(oc,{points:x,className:"h-full"})})})]}),g.map(l)]})})),fc=({__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(je,{__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(Ee,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,bc={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"}},yc=d((({className:e,children:t,color:l="gray"})=>c("div",{className:p("pt-2xl sm:p-s sm:border sm:border-gray rounded-md flex items-center",bc[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(Ee,{size:"text-m",color:bc[l].text,children:t})]}))),vc=d((({value:e,subText:t,children:l,...n})=>{const a=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[a.length,l,t].every((e=>!e))?null:Nc({textItems:a,subText:t,children:l,...n})})),Nc=({label:e,labelSize:t="text-m",textItems:l,subColor:n,subText:a,className:r,children:i})=>c("div",{className:p("flex gap-2xl sm:gap-2xs flex-col h-full max-w-[300px]",r),children:[e?o(Ee,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,i||l.filter(Boolean).map(((e,t)=>o(Ee,{size:"text-l",children:e.trim()},String(t)))),a?o(Ee,{color:n,size:"text-m",children:a}):null]}),wc=d((({className:e,children:t})=>o("div",{className:p("sm:flex sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),kc=["ArrowDownIcon","ArrowUpIcon"],Cc=["Подробнее","Скрыть"],Sc=({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:Cc[Number(e)]}),o(Y,{className:"text-primary-text",name:kc[Number(e)],width:"16",height:"16"})]}),Tc=({location:e,address:t,billAcceptorType:l,terminalType:n,billAcceptorEnable:a,atmCode:r="",atmAccess:i="",workTime:s},d)=>{const m=[{label:"Устройство",value:Mc(n)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===l?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(i)?"Общедоступный":""},{label:"Регистрационный номер",value:r}];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(Ee,{size:"text-h4",children:Mc(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ee,{size:"text-l",children:t})]}):null]}),o(yc,{color:"green",children:Mc(s)})]}),o("div",{className:"hidden sm:block",children:o(wc,{className:"flex-wrap",children:m?.map(Bc)})}),o(Fa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Oa,{isUnfolded:e,children:o(wc,{className:"flex-wrap",children:m?.map(Bc)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sc({isUnfolded:e,onToggle:t})})]},String(d))},Ic=({address:e="",terminalType:t,atmCode:l=""})=>({header:`${Mc(t)} №${l}`,body:e.toUpperCase()}),Bc=(e,t)=>o(vc,{...e},String(t)),Mc=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Vc=[];const Rc=async e=>await bt(e,{method:"GET"})||Vc,Pc={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1},zc={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable)},Ac=d((({data:e,className:t})=>{const[l]=bs(),n=function(e){const{data:t=Vc}=Ml(`/api/v1/atms?regionCode=${e}`,Rc);return t}(l?.code??"000");return o(xc,{className:t,filterItems:jc,data:n,initFilterState:Pc,renderCard:Tc,getBalloon:Ic,title:`Банкоматы филиала ${l?.name}`,descriptionData:e})})),jc=(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=>zc[t](e))),l=!n.length||n.some((t=>zc[t](e)));return t&&l}))},Dc=e=>{const t=Lc(e);return o(vc,{label:"Режим работы",value:t,className:"max-w-none"})},Ec=({workTime:e="",lunchHour:t="",daysOff:l=""},n=!1)=>e?[`${n?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",l?`не работает: ${l}`:""].filter(Boolean).join("; "):"",Lc=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[Ec({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:l?"":n}),Ec({workTime:l?.workTime,lunchHour:l?.lunchHour,daysOff:n},!0)].filter(Boolean)},$c=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Fc=e=>$c.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??"")}}))),Oc=e=>{if(!e)return null;const t=_c(e);return c(wc,{className:"border-none",children:[o(vc,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Uc)})}),o(vc,{label:"Режим работы",className:"max-w-none",children:o(Ee,{children:e})})]})},_c=e=>{const t=$c.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},Uc=({short:e,status:t},l)=>o("div",{className:p("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(Ee,{size:"text-xs",children:e})},String(l)),Hc=({currency:e,buyExchangeRate:t,saleExchangeRate:l},n)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(vc,{label:"Валюта",value:e.currency}):null,t?o(vc,{label:"Купить",value:String(t)}):null,l?o(vc,{label:"Продать",value:String(l)}):null]},String(n)),Wc=(new Date).getDay(),Kc=e=>{const[t]=e?.slice(Wc-1)??[];if(!t)return null;const{lunchHour:l,status:n,workTime:a,hasLunch:r}=t;return n?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(yc,{color:"green",children:a}):null,l&&r?o(yc,{color:"yellow",children:`перерыв: ${l}`}):null]}):o(yc,{color:"red",children:"Выходной"})},qc=({lunchHour:e,hasLunch:t=!1,status:l=!1})=>l?e&&t?`Перерыв ${e}`:e:"Не работает",Gc=({title:e,status:t,workTime:l,lunchHour:n,hasLunch:a},r)=>o(vc,{label:e,value:t&&l?l:"",subText:qc({lunchHour:n,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(r)),Yc=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Xc=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${e}</p>`,Qc=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Zc=({name:e,address:t,phone:l,fax:n,phoneBusiness:a,phoneNatural:r,phoneCallCentre:i,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},h)=>{if(!d)return null;const u=Fc(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(Ee,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ee,{size:"text-l",children:t})]}):null]}),Kc(u)]}),o("div",{className:"hidden sm:block",children:Jc({phone:l,fax:n,phoneBusiness:a,phoneNatural:r,phoneCallCentre:i,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Fa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Oa,{isUnfolded:e,children:Jc({phone:l,fax:n,phoneBusiness:a,phoneNatural:r,phoneCallCentre:i,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sc({isUnfolded:e,onToggle:t})})]},String(h))},Jc=({phone:e,fax:t,phoneBusiness:l,phoneNatural:n,phoneCallCentre:a,phoneCurrencyControl:r,workSchedule:i,exchangeRate:s})=>{const d=Fc(i),m=i?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(wc,{className:"flex-wrap",children:[o(vc,{label:"Факс",value:t}),o(vc,{label:"Телефон филиала",value:e}),o(vc,{label:"Для обращений юридических лиц",value:l}),o(vc,{label:"Обслуживание физических лиц",value:n}),o(vc,{label:"Для консультаций по валютному контролю",value:r}),o(vc,{label:"Контакт-центр",value:a})]}),i?.isMatchesPattern?o(wc,{children:o(vc,{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(Gc)})})}):c(wc,{children:[o(vc,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Uc)})}),Dc(d)]}),i?.businessScheduleVisibleTag?Oc(i?.businessScheduleDescription):null,s?.currencies?.length?o(wc,{className:"flex-wrap",children:s?.currencies?.map(Hc)}):null]})},ed=({name:e="",address:t="",workSchedule:l})=>{const n=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const r=`${t} ${(e=>{const t=Fc(e),l=e?Lc(t):"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&!e.businessScheduleDescription?Yc(l):Xc(l):Qc(l):null})(l)}`;return{header:n,body:r}},td=[];const ld=async e=>await bt(e,{method:"GET"})||td,nd={workingSaturday:!1},ad={workingSaturday:e=>Boolean(e.workSchedule?.workingSaturday)},rd=d((({className:e})=>{const[t]=bs(),l=function(e){const{data:t=td}=Ml(`/api/v1/branches?regionCode=${e}`,ld);return t}(t?.code??"000");return o(xc,{className:e,filterItems:id,data:l,initFilterState:nd,renderCard:Zc,getBalloon:ed,title:`Офисы филиала ${t?.name}`})})),id=(e,t)=>{const l=Object.keys(t).filter((e=>t[e]));return e.filter((e=>l.every((t=>ad[t](e)))))},sd=d((({data:e,className:t,...l})=>{const n=e?.dataType??"offices";return o(x,{version:"transparent",className:p(t),defaultPadding:"p-0",...l,children:"offices"===n?o(rd,{}):o(Ac,{data:e})})})),od=d((({className:e,title:t,description:l="Блок в разработке...",...n})=>c(x,{className:p("box-border",e),...n,children:[o(B,{className:"max-w-[600px]",title:t,description:l,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(y,{})]}))),cd=d((({className:e,padding:t,slides:l=[],...n})=>o(x,{className:p("overflow-hidden relative",e),padding:t,...n,children:o(ja,{gap:0,padding:0,children:l.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(ot,{className:"px-5 h-full",headlineVersion:"L",...e,...n})},String(t))))})}))),dd=d((({address:e,email:t,telephone:l,button:n,className:a="",__html:r,icon:i,title:s,version:d="primary",...m})=>c(x,{className:p("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(i)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ae,{image:i})}):null,s?o(S,{headingType:"h3",as:"h3",title:s}):null]}),c("div",{className:"w-full space-y-m",children:[r?md(r):null,hd({label:"Адрес",data:e,iconName:"GeolocationIcon"}),hd({label:"Телефон(факс)",data:l,iconName:"PhoneIcon"}),hd({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),n?.text?Ye([n]):null]})]}))),md=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(je,{__html:e})}),hd=({label:e,data:t,iconName:l,dataColor:n=""})=>t?c("div",{className:"flex gap-s",children:[o(Y,{iconVersion:"black",name:l,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Ee,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Ee,{size:"text-xl",color:n,children:t})]})]}):null,ud=d((e=>{const{__html:t,richVersion:l,...n}=e;return o(x,{defaultPadding:"p-0",...n,children:o(je,{__html:t,richVersion:l})})})),pd=d((({className:e=""})=>{const[t,l]=n("option2"),a=r((e=>l(e)),[]);return c("div",{className:p("order-4",e),role:"radiogroup",children:[o(Hn,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(Hn,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),gd=d((({data:e,fieldLabel:t,fieldValue:l,selected:n,placeholder:a="",setSelected:r,label:i})=>{const s=e.filter(Boolean).map((e=>({key:e?.[l||t],text:e?.[t]}))),c=s.find((e=>e.key===n));return o(qt,{options:s,label:i,placeholder:a||n,onChange:e=>r(e.key),value:c})})),xd=d((({regions:e=[],selectedRegion:t,onSelectedRegion:l,branches:n=[],selectedBranch:a,onSelectedBranch:r})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(gd,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:l,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(gd,{data:n,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:r,label:"Отделение",placeholder:"Выберите отделение"})})]}))),fd=["От 1 дня","До 365 дней"],bd=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Ee,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(rn,{min:1,max:365,value:e,items:fd,onChange:t})]}))),yd=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:l,safeBoxCases:n=[],selectedBoxSize:a,onSelectedBoxSize:r})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(gd,{data:e,fieldLabel:"volume",selected:t,setSelected:l,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(gd,{data:n,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:r,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),vd=d((({regions:e,selectedRegion:t,branches:l,selectedBranch:n,days:a,selectedCaseVolume:r,selectedBoxSize:i,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:h})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(xd,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:l,selectedBranch:n,onSelectedBranch:Nd(m)}),o(bd,{days:a,setDays:e=>m({days:e})}),o(yd,{caseVolumes:d,selectedCaseVolume:r,onSelectedCaseVolume:wd(m),safeBoxCases:s,selectedBoxSize:i,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Ee,{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(pd,{}),o(ye,{text:"Офисы на карте",version:"primary",onClick:h,className:"order-6"})]})]}))),Nd=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},wd=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},kd=d((({days:e,tariffs:t=[]})=>{const l=Sd(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:[Cd("Аренда за",e),Cd("Цена",l+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(T,{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(T,{size:"text-s",font:"font-light",color:"text-white",children:n})})]})]})})),Cd=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Ee,{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})]}),Sd=(e,t)=>{const l=Td(e);return e*(t?.find((e=>e.tariffType===String(l)))?.tariffValue||0)},Td=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},Id=(e,t)=>e.find((e=>e.branchCode===t)),Bd=d((e=>{const{regions:t,data:l,branches:n,onChange:r,onClick:i}=e;a((()=>{r({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[l.selectedRegion,r]);const s=Id(n,l.selectedBranch),d=Md(s?.safeBoxCaseVolumes),m=Vd(s?.safeBoxCaseVolumes,l.selectedCaseVolume)?.safeBoxCases,h=Rd(m,l.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(vd,{...l,regions:t,onClick:i,branches:n,caseVolumes:d,safeBoxCases:m,onChange:r}),o(kd,{days:l.days,tariffs:h})]})})),Md=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Vd=(e,t)=>e?.find((e=>e.volume===t)),Rd=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Pd=[];const zd=async e=>await bt(e,{method:"GET"})||Pd,Ad=d((({title:e,footnote:t,className:l="",...a})=>{const[i,s]=n(!1),d=r((()=>s((e=>!e))),[]),[m,h]=n({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),u=gn(),p=jd(m.selectedRegion,u),g=function(e){const{data:t}=Ml(e?`/api/v1/safeboxes?regionCode=${e}`:null,zd);return t||Pd}(p),f=r((e=>h((t=>({...t,...e})))),[h]),b=(y=Id(g,m.selectedBranch)||g,Array.isArray(y)?y.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean)}))).filter((e=>e.coords&&2===e.coords.length)):y?.gpsLatitude&&y?.gpsLongitude?[{coords:[y.gpsLatitude,y.gpsLongitude]}]:[]);var y;return c(x,{className:l,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(S,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Bd,{regions:u,branches:g,data:{...m,selectedRegion:p},onClick:d,onChange:f}),t?o(T,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&i?o(oc,{points:b,className:"h-[640px]"}):null]})})),jd=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e;function Dd(e){throw new Error(e)}const Ed={normal:{icon:"h-11 w-11",image:"h-14 w-14"},small:{icon:"h-12 w-12",image:"h-14 w-14"}},Ld={normal:"",small:"min-h-6xl"},$d={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"},Fd=d((({className:e="",title:t,description:l,steps:n,buttons:a,size:r="normal",stepVersion:i="gray",version:s="primary",...d})=>c(x,{className:p("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:s,...d,children:[o(B,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),n?.length?o("div",{className:"box-border",children:o("div",{className:"flex flex-col gap-6xl justify-between",children:n.map(Od(r,i))})}):null,Ye(a,{isVertical:!0})]}))),Od=(e,t)=>(l,n)=>{const{type:a}=l;if("default"!==a&&"rte"!==a)return null;switch(a){case"default":return _d(e,t)(l,n);case"rte":return o(je,{__html:l.__html});default:Dd(l)}},_d=(e,t)=>(l,n)=>o("div",{className:"contents",children:c("div",{className:"flex flex-row items-center relative",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:Ud(e,t)(l,n)}),c("div",{className:p("flex flex-col justify-center h-fit",Ld[e]),children:[l.label?o(T,{size:"text-l",align:"text-left",children:l.label}):null,l.description?o("div",{className:p("text-s font-light text-left",$d.description),children:l.description}):null]})]})},String(n)),Ud=(e,t)=>(l,n)=>{const a="secondary"===t?"white":"color",r=Boolean(l?.icon?.src),i=Ed[e][r?"image":"icon"],s=r?"transparent"===t:t;return o(x,{className:p(i,"z-10 mr-s flex justify-center content-center rounded-md"),defaultPadding:"",version:s,children:o("span",{className:"flex max-w-full max-h-full items-center justify-center",children:Ge(l?.icon)?o(ae,{image:{...l.icon,iconVersion:l.icon?.iconVersion||a},imageClassName:"max-w-full max-h-full",width:Hd(e),height:Hd(e)}):o("span",{className:p("text-h4","transparent"===t?$d.iconText:(c=t,"secondary"===c?"group-data-primary:text-white":"text-secondary-text")),children:n+1})})});var c},Hd=e=>"normal"===e?"38":"24",Wd=e=>({href:t})=>!!t&&O(Kd(t,e)).startsWith(O(t)),Kd=(e,t)=>L(e)?t.href:t.pathname;function qd(e=[]){const t=u(),l=e.findIndex((e=>Wd(E.BASE_PATH?{pathname:E.BASE_PATH}:e))(t));return[l,e[l]]}const Gd=d((({isActive:e,onClick:t})=>c("button",{className:p(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),onClick:t,type:"button",children:[o(Y,{className:"w-6 h-6",name:"BurgerIcon",iconVersion:e?"color":"black"}),"Меню"]}))),Yd=d((({isActive:e,item:t,onClick:l})=>{const n=ue({isRemote:!0}),{href:a,onClick:r}=n({href:t?.href,onClick:l});return c("a",{className:p(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),href:a,target:"_self",title:t?.title||"",onClick:r,children:[o(Y,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]})}));const Xd=({onCloseAll:e,onClose:t}={})=>{const[l,{push:i,pop:s,clear:o}]=function(e=[]){const[t,l]=n(e),a=r((e=>l((t=>[...t,e]))),[]),i=r((()=>l((e=>e.slice(0,-1)))),[]),s=r((e=>l((t=>t.filter((t=>t!==e))))),[]),o=r((()=>l([])),[]);return[t,{setList:l,push:a,pop:i,remove:s,clear:o}]}(),c=r((()=>{e&&e(l),o()}),[l,e]),d=r((()=>{t&&t(l[l.length-1]),s()}),[l,t]);return a((()=>h.subscribe("dialog",(e=>{switch(e.type){case"open":i(e);break;case"close":e.all?c():d();break;default:Dd(e)}}))),[c,d]),l},Qd=d((({className:e,onClose:t})=>o("button",{className:p("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(ae,{image:{icon:"CloseIcon"},width:"24",height:"24"})}))),Zd=d((({className:e,head:t,children:l,onClose:n})=>{const{close:a}=me(),i=r((()=>{a(),n&&n()}),[n]);return c("div",{className:p("relative min-h-full bg-white pt-0 p-5",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Qd,{className:"absolute top-0 right-0",onClose:i}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:l})]})})),Jd=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 r=0;for(let i=0;i<e.length;i++){const s=Math.max(0,i-l),o=Math.min(i+l,t.length-1);for(let l=s;l<=o;l++)n[i]||a[l]||e[i]!==t[l]||(r++,n[i]=!0,a[l]=!0)}return{m:r,s1Matches:n,s2Matches:a}}(e,t);if(0===l)return 0;const r=function(e,t,{s1Matches:l,s2Matches:n}){let a=0;for(let r=0,i=0;r<e.length;r++){if(!l[r])continue;let s=i;for(;s<t.length;s++)if(n[s]){i=s+1;break}e[r]!==t[s]&&a++}return a}(e,t,{s1Matches:n,s2Matches:a}),i=(l/e.length+l/t.length+(l-r/2)/l)/3,s=i>.7?.1*function(e,t){let l=0;for(;e[l]===t[l]&&l<4;)l++;return l}(e,t):0;return i+s*(1-i)};const em=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(Ee,{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(tm,{...e},String(t))))})]}):null,tm=d((({icon:e,...t})=>{const l=ue(),{text:n,target:a,href:r,onClick:i}=l(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ae,{pathPrefix:"/wcms-resources/",image:e}):null,n?o("a",{className:"hover:text-primary-hover",href:r,target:a,onClick:i,children:o(Ee,{size:"text-l",font:"font-light",color:"text-primary-text",children:n})}):null]})})),lm=e=>t=>o("div",{className:"mb-xs sm:mb-2xs",children:o("button",{className:"cursor-pointer hover:text-primary-hover",onClick:()=>{e&&e(t)},type:"button",children:o(Ee,{size:"text-l",font:"font-light",children:t.name||""})})},t.id),nm=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:"h-12 pl-m w-full peer text-l text-black border border-solid rounded-md box-border\n outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text",value:t,onChange:e=>l(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),am=d((({foreignOffices:e,defaultLocation:t})=>{const[l,a]=bs(t),[i,s]=n(""),d=im(gn()).sort(((e,t)=>e.name.localeCompare(t.name))),m=((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})(d,rm),{close:h}=me(),u=r((e=>{a(e),h()}),[]);return c(Zd,{className:"pb-20",head:c("div",{children:[o(Ee,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),l?c("div",{className:"mb-s",children:[o(Ee,{size:"text-l",font:"font-light",children:"Сейчас выбран: "}),o("button",{type:"button",onClick:()=>a(l),children:o(Ee,{color:"text-primary-main",children:l.name})})]}):null,o(nm,{onSearch:s,searchTerm:i})]}),children:[i&&i.length>=3?o("div",{children:d.filter((({name:e})=>e&&Jd(e.toLowerCase())(i.toLowerCase())>=.8)).map(lm(u))}):o("div",{className:"columns-1 sm:columns-5",children:Array.from(m.entries()).map((p=u,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Ee,{size:"text-h6",children:e})}),t.map(lm(p))]},e)))}),em(e)]});var p})),rm=e=>e.name?.charAt(0)||"",im=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),sm=d((({className:e,value:t,autoFocus:l,onChange:n,onFocus:a,placeholder:i="Поиск по сайту"})=>{const s=r((e=>{n&&n(e.target?.value||"")}),[n]);return c("div",{className:p("font-sans 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:p("h-14 w-full px-10 text-l text-black outline-none box-border border border-solid rounded-md","border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text"),value:t,type:"text",name:"search-bar-input",placeholder:i,autoFocus:l,onChange:s,onFocus:a})]})}));function om(e,t,l=300){a((()=>{const t=globalThis.setTimeout(e,l);return()=>{globalThis.clearTimeout(t)}}),t)}const cm=(e,t)=>(l,n)=>{for(const[a,r]of n)l.set(a,e(l.get(a)||t,r));return l},dm=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),mm=e=>t=>e.map((([e,l])=>[Jd(t)(e),l])).filter((([e])=>e>=.8)).map((([e,t])=>um(t,e))).reduce(cm(Math.max,0),new Map),hm=e=>t=>{return ns(t,t.map((({title:e})=>e)).map((e=>t=>{const l=dm(t||"");return l.length?Pe(e.map((e=>Ma(l.map(Jd(e)))))):0})(e))).sort((e=>(t,l)=>-e(t,l))((l=([,e])=>e,(e,t)=>l(e)-l(t)))).map((([e])=>e));var l},um=(e,t)=>new Map(e.map((e=>[e,t]))),pm=({basePathList:e,initialQuery:t=""})=>{const[l,r]=n(t||"");a((()=>{null!=t&&r(t)}),[t]);const{data:i}=Ml(e?.length?e:null,gm),[s,o]=n(null);return om((()=>{i&&o(i.map((e=>t=>{const{corpus:l,dictionary:n}=t||{};if(!(e&&l?.length&&n&&Object.keys(n).length))return[];const a=dm(e);if(!a.length)return[];const r=Object.entries(n),i=[...a.map(mm(r)).reduce(cm(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>l[e]));return hm(a)(i)})(l)))}),[i,l]),[s,{value:l,onChange:r}]},gm=async(...e)=>(await Promise.allSettled(e.map((e=>bt(_(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),xm=d((({className:e,topItems:t})=>{const l=ue({isRemote:!0});return o("div",{className:p("flex items-start justify-between",e),children:t?.map(l).map(bm)})})),fm=["all","footer"],bm=(e,t)=>{const{text:l,items:n=[],href:a,target:r,onClick:i}=e,s=n.filter((e=>!e.displayArea||fm.includes(e.displayArea.toLowerCase())));return c("div",{className:"flex flex-col gap-s w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:r||"_self",onClick:i,children:l||`Раздел ${t}`}),s.map(((e,t)=>o(ym,{...e,basePath:j(a),index:t},String(t))))]},String(t))},ym=d((({text:e,index:t,basePath:l,...n})=>{const a=ue({isRemote:!(!E.BASE_PATH||!l)&&!E.BASE_PATH.startsWith(l),basePath:l}),{href:r,target:i,onClick:s}=a(n);return o("a",{className:p("text-l font-light text-secondary-text hover:text-primary-main no-underline","overflow-x-hidden overflow-ellipsis whitespace-nowrap"),href:r,target:i||"_self",onClick:s,children:e||`Раздел ${t}`})})),vm=d((({initialQuery:e,topItems:t})=>{const l=i((()=>t?.map((e=>e.href||"/"))),[t]),[n,a]=pm({basePathList:l,initialQuery:e}),r=i((()=>Nm(t)(n)),[t,n]);return o(Zd,{head:o(sm,{autoFocus:!0,...a}),children:o(xm,{topItems:r})})})),Nm=e=>t=>e?.length&&t?.length?ns(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:_("/",t)})))}))):[],wm=d((({className:e,...t})=>{const[l,a]=n(""),i=r((()=>a("")),[]),s=((e={})=>{const{open:t,close:l}=me();return{open:(l={},n={})=>t(o(vm,{...e,...l}),n),close:l}})(t),d=r((e=>{a(e),km(e)&&s.open({initialQuery:e},{onClose:i})}),[i,s]);return c("div",{className:p("relative",e),role:"search",children:[o(sm,{value:l,onChange:d}),o(Qd,{className:"absolute top-0 right-0 sm:hidden",onClose:i})]})})),km=e=>e&&e.length>=3,Cm=d((({item:e,basePath:t})=>{const l=ue({isRemote:!(!E.BASE_PATH||!t)&&!E.BASE_PATH.startsWith(t),basePath:t}),{href:n,target:a,onClick:r}=l(e),i=u(),s=Wd(i)({href:n});return c("a",{className:p(s?"text-primary-main":"text-primary-text","py-3 text-h5 font-light flex justify-between cursor-pointer"),href:n,target:a,onClick:r,children:[e.text,o(ae,{image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24",className:"text-secondary-text rotate-180 opacity-30"})]})})),Sm=({item:e,isActive:t,onClick:l})=>c("button",{type:"button",className:"relative",onClick:l,children:[o("span",{className:p("whitespace-nowrap",t?"text-primary-main":""),children:e.text}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent"}):null]}),Tm=d((e=>{const{topItems:t,defaultLocation:l,officesLink:s}=e,[d]=bs(l),m=(e=>{const{open:t,close:l}=me();return{open:(l={})=>t(o(am,{...e}),l),close:l}})(e),[h,u]=Aa({itemCount:t?.length??0}),[p]=qd(t),[g,x]=n(p),f=i((()=>t?.[g]),[t,g]),b=f?.items||[];a((()=>{x(p)}),[p]),a((()=>{g>0&&u.scrollTo(g)}),[g,u]);const y=r((e=>x(e)),[]);return o(Zd,{head:o("div",{className:"flex items-center",children:o(S,{as:"h4",title:"Меню"})}),children:c("div",{className:"flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md",children:[o("div",{className:"w-full mb-3",children:o(Na,{containerRef:h,visibleItemCount:0,gap:20,className:"pb-3",children:t?.map(((e,t)=>o(Sm,{item:e,isActive:g===t,onClick:()=>y(t)},String(t))))})}),c("div",{className:"relative grow overflow-auto",children:[Im(b,f?.href),o(wm,{className:"grow mb-5",...e}),Bm(s),Mm(d,(()=>m.open()))]})]})})})),Im=(e,t)=>e?o("div",{children:e.map(((e,l)=>o(Cm,{item:e,basePath:t},String(l))))}):null,Bm=e=>e?c("a",{className:"flex items-center mb-3",href:e,rel:"noopener noreferrer","aria-label":"Офисы и банкоматы",children:[o(ae,{image:{icon:"MapOpenedIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),o("span",{children:"Офисы и банкоматы"})]}):null,Mm=(e,t)=>c("div",{className:"flex items-center text-s cursor-pointer",onClick:t,children:[o(ae,{image:{icon:"GeolocationIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),c("div",{className:"flex flex-col items-start",children:[o(Ee,{size:"text-h5",children:e.name}),o(Ee,{color:"text-secondary-text",size:"text-s",children:"Ваша локация"})]})]}),Vm="burgerMenuDialog",Rm=e=>{const{open:t,closeAll:l,close:n}=me(),a=Xd(),r=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Vm,a),i=()=>t(o(Tm,{...e}),{id:Vm});return[r,{open:i,close:n,toggle:()=>{r?l():i()}}]},Pm=[],zm=St((({sticky:e,...t})=>{const{menuItems:l=Pm}=e??{},[n,{toggle:a,close:r}]=Rm(t.options?.page?.sitemap??{}),[,i]=qd(l),s=Math.floor(l.length/2),d=l.slice(0,s),m=l.slice(s);return o(x,{className:"h-[74px]",defaultPadding:"p-0",...t,children:c("div",{className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[d.map(Am(i,r)),o(Gd,{isActive:n,onClick:a}),m.map(Am(i,r))]})})})),Am=(e,t)=>(l,n)=>o(Yd,{isActive:l===e,item:l,onClick:t},l.href||String(n)),jm="hidden sm:flex absolute z-40 top-0",Dm=d((({className:e,items:t=[],value:l,onChange:n,tabsType:a})=>{const[r,i]=Aa({itemCount:t?.length||0});return c("div",{className:p("relative overflow-x-auto no-scrollbar",e),role:"tablist",children:[o(Na,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:i.handleVisibleIndicesChange,children:t.map(Yo(l,n,a))}),i.canScrollLeft?o(Zr,{className:p("left-6",jm),onClick:i.scrollLeft}):null,i.canScrollRight?o(Jr,{className:p("right-6",jm),onClick:i.scrollRight}):null]})})),Em=({tabsMode:e,...t})=>{switch(e){case"wideScreen":return o(Xo,{...t});case"centered":return o("div",{className:"flex",children:o(Xo,{className:"m-auto p-xs rounded-md bg-main-gray",tabsType:"rounded",...t})});case"scrollable":return o("div",{className:"flex",children:o(Dm,{className:"m-auto",tabsType:"underlined",...t})});default:return null}},Lm="tab",$m=d((({className:e="",isSticky:t,tabs:l=[],tabsMode:s,...c})=>{const d=u(),{isReady:m}=d,g=i((()=>l.map(Om)),[l]),[f,b]=n(0);a((()=>{if(!l||!l[0])return;const e=d.query.tab&&l.findIndex((e=>"group"===e.type&&e.ref===d.query.tab))||0,t=l[e]||l[0];b(e),Fm(t)}),[m]),a((()=>{const e=l[f];"group"===e?.type&&h.subject("tab",{type:e.type,label:e.ref,groupName:e.name})}),[l,f]);const y=r((e=>{const t=g.indexOf(e),n=l[t];b(t),Fm(n),"group"===n.type&&(e=>{const t=new URLSearchParams(d.query);e.name?t.set(Lm,e.name):t.delete(Lm),d.replace(`${d.pathname}?${t}`,"",{scroll:!1})})(e)}),[l,g]);return o(x,{className:p(t?"sticky top-1 z-20":"",e),defaultPadding:"p-0",...c,children:Em({items:g,value:g[f],tabsMode:s,onChange:y})})})),Fm=e=>{"group"===e.type&&h.fire("tab",{type:e.type,label:e.ref,groupName:e.name}),"link"===e.type&&h.fire("tab",{type:e.type,label:e.href})},Om=e=>"group"===e?.type?{text:e.title,name:e.ref}:e,_m={start:"text-start",center:"text-center",end:"text-end"},Um=d((({tab:e,className:t,onClick:l,isActive:n})=>{const a=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white text-primary-text"),title:e?"mb-xs text-xl":"mb-2xs text-l",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal"}))(n);return c("button",{type:"button",onClick:l,"aria-label":e?.title,className:p("border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs",a.btn,t),children:[e?.icon?o(ae,{className:p("h-6 w-6 min-w-6 min-h-6",a.icon),image:{...e?.icon,iconVersion:e?.icon?.iconVersion??a.iconVersion},width:"24",height:"24"}):null,c("div",{className:"border-0",children:[e?.title?o("div",{className:a.title,children:e.title}):null,e?.description?o("div",{className:a.desc,children:e.description}):null]})]})})),Hm=d((({tab:e})=>{const t=ue(),{onClick:l}=t({...e,onClick:()=>{e.href&&!$(e.href)&&(globalThis.location.href=e.href)}});return om(l,[],800),o(y,{className:"col-span-12 p-xl",size:5})})),Wm=St((({className:e="",tabs:t=[],block:l,tabAlign:a,...r})=>{const[i,s]=n(qm(t)),d=Km(t[i],i),m=t.length,[h,{inc:u,dec:g}]=Xr({itemCount:m},i),[f,b]=Aa({itemCount:m});return c(x,{className:p(e),defaultPadding:"p-0",...r,children:[c("div",{className:"relative border-b-8 border-primary-main",children:[o(Na,{itemClassName:"flex",containerRef:f,snapAlign:"snap-end",gap:8,onVisibleIndicesChange:b.handleVisibleIndicesChange,children:t.map(Gm(i,s,a))}),o(li,{scroll:b,arrowsPadded:!0,onScrollLeft:g,onScrollRight:u,activeIndex:h,itemCount:m})]}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:t[i]?.href?o(Hm,{tab:t[i]}):z(l?.slots?.[d],{...r?.options,slotName:d,parent:l})})]})}),{slots:({tabs:e})=>e?.filter((e=>!e.href)).map(Km)||[],childrenTypes:{exclude:["TabsLayout"]}}),Km=(e,t)=>e?.title||`Слот №${t}`,qm=e=>e.reduce(((e,t,l)=>t.selected?l:e),0),Gm=(e,t,l="start")=>(n,a)=>o(Um,{className:_m[l],tab:n,isActive:e===a,onClick:()=>t(a)},String(a)),Ym={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Xm=d((({children:e,activeIndex:t,columnWidth:l,version:n="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Ym[n],style:{transform:`translateX(-${t*l}px)`},children:e})}))),Qm=d((({className:e="",isOpen:t,onClick:l})=>o(ye,{className:e,appendRight:o(ae,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:l}))),Zm={Buttons:({buttons:e})=>Ye(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ae,{image:e}):null,List:({isDotted:e,...t})=>o(tt,{className:"flex flex-col justify-between items-start text-h6",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Ee,{size:"text-h6",children:e})}):null,t?o("div",{children:o(Ee,{size:"text-l",color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,dataUrl:l,pdfUrl:n,isOpen:a})=>e?o(Qm,{isOpen:a,onClick:()=>{t({dataUrl:l,pdfUrl:n})}}):null},Jm=d((({cell:e,fieldIdx:t,rowIdx:l,cellIdx:r,setTableInner:i,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=n(!0);a((()=>{r===o&&s||m(!0)}),[s,o]);return eh({cell:e,cellProps:{rowIdx:l,cellIdx:r,fieldIdx:t,displayTable:e=>{m(!1),c(r),i(e)},isVisible:d}})})),eh=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:l,...n}=e;if(!l||!(l in Zm))return null;return o(Zm[l],{...t,...n})},th=d((({cells:e,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:r,setOpenTableInnerIdx:i})=>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(Jm,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:r,setOpenTableInnerIdx:i},String(s)))):null}))),lh=(e,t)=>140*Pe(e.slice(0,t).map((e=>e?.cols?.length??1))),nh=(e,t)=>e?.length>0?o("div",{className:p("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Ee,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,ah=d((({rows:e})=>{return o(Na,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,l)=>{if(!e?.length)return null;const[n,...a]=e,r=p("flex duration-1000 text-center",0!==l?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[n?.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(Ee,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:r,style:{transform:`translateX(-${lh(a,t)}px)`},children:a?.map(((e,l)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Ee,{size:"text-xl",children:e.data}):null,e?.cols?nh(e.cols,t):null]},`row${l}`)))})})]},String(l))}))})});var t})),rh=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(Ee,{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(ah,{rows:t.rowsData})})})]},n)}))}))),ih=(e=!1)=>""+(e?"text-white":"text-secondary-text"),sh=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:p("rounded-md px-4 py-3 cursor-pointer",t===l?"bg-primary-main":""),onClick:()=>n(t),children:o(Ee,{size:"text-xl",font:"font-light",color:ih(t===l),children:e||t+1})},e)))}):null,t?o(ye,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(Y,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]})));async function oh(e){const t=await fetch(e);return await t.json()}const ch=d((({dataUrl:e,pdfUrl:t,onClick:l})=>{const{tableData:a}=function(e){const{data:t}=Ml(function(e){return`/wcms-resources/${e||"tariffs-inner-table-data"}.json`}(e),oh);return t||{}}(e),[i,s]=n(0),d=r((e=>s(e)),[]),m=a?.[i]?.items??[],h=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(sh,{currencies:h,activeTabIndex:i,setActiveTabIndex:d,linkToPDF:t}),o(rh,{activeTabIndex:i,items:m}),o(Qm,{className:"mt-xl",onClick:l,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Ee,{size:"text-h6",children:"Данных нет"}),o(Qm,{onClick:l,isOpen:!0})]})})),dh=d((({children:e,tableInner:t,onHideContentClick:l})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:p("@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(ch,{...t,onClick:l})}):null]}))),mh=d((({row:{header:e,data:t},activeIndex:l,rowIdx:a,...i})=>{const[s,d]=n(void 0),m=r((e=>d(e)),[]),[h,u]=n(void 0),g=r((e=>u(e)),[]);return c(dh,{onHideContentClick:()=>d(void 0),tableInner:s,...i,children:[o("div",{className:p("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(Ee,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Xm,{activeIndex:l,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(th,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...i},String(t))))}):null]})}));function hh({dec:e,inc:t,canDec:l,canInc:n,btnClass:a,className:r=""}){return l||n?c("div",{children:[l?o(Qr,{className:p("absolute z-40",a[0],r),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!l}):null,n?o(Qr,{className:p("absolute z-40 rotate-180",a[1],r),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!n}):null]}):null}const uh=d((({children:e,controls:t})=>{const{isScrollAvailable:l}=t;return c("div",{role:"table",children:[c("div",{className:"relative space-y-xs",children:[e,hh({...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]})})),ph=d((({className:e="",title:t,description:l,rowHeaders:n,tariffsColumns:a,hiddenRowsNum:r=0,...i})=>{const s=a?.map((({data:e})=>e))||[],d=n?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,u]=Xr({itemCount:m,visibleItemCount:2}),g=(d||[]).map(((e,t)=>o(mh,{row:e,activeIndex:h,rowIdx:t,...i},String(t)))),[f,b]=r>0?[g.slice(0,-r),g.slice(-r)]:[g,[]];return c(x,{className:p("overflow-hidden relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...i,children:[o(B,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m",children:r>0?o(Fa,{renderFoldableSection:({isUnfolded:e})=>c(uh,{controls:u,children:[f,o(Oa,{isUnfolded:e,children:b})]}),renderFoldButton:Gi}):o(uh,{controls:u,children:g})})]})})),gh=d((({className:e="",title:t,description:l,iconVersion:n,__html:a,...r})=>c(x,{className:p("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===n?xh():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Ee,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,l?fh(l):null,a?o(je,{__html:a}):null]})]}))),xh=()=>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"}),fh=e=>o(T,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),bh=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(Ee,{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(Ee,{size:"text-h2",children:l})}):null]}))),yh=d((e=>{const{prefix:t,unit:l,suffix:n,...a}=e;return o(x,{defaultPadding:"p-0",...a,children:o(bh,{prefix:t,unit:l,suffix:n})})})),vh={AdTile:It,ApplicationForm:ta,ApplicationFormCustom:ca,BenefitsBlock:ga,BonusBenefitsBlock:Ea,ButtonsBlock:$a,Calculator:Fr,CardTransfer:Yr,Carousel:hi,CarouselBankHistoryCard:ui,CarouselCard:xi,CarouselCatalogCard:bi,CarouselLinks:ki,CarouselRecommendationCard:Mi,CarouselTariffsCard:Pi,ComparisonTable:Ui,DepositFiltration:hs,ErrorBlock:xs,ExchangeRateTile:Os,Footer:ro,Header:yo,Headline:B,HorizontalLayout:wo,ImgBlock:ko,LinkDocs:Bo,MobileAppTile:Ro,MortgageFiltration:Zo,OfficesAtmsMap:sd,Placeholder:od,ProductBlock:Tt,ProductGallery:cd,RepresentativeOfficeInfo:dd,RichTextBlock:ud,RollupItem:Ws,SafeDepositRental:Ad,StepsBlock:Fd,StickyBottomMenu:zm,Tabs:$m,TabsLayout:Wm,TariffsTable:ph,TextBlock:gh,UnitBlock:yh,VerticalLayout:No},Nh="rshb-query-params";function wh(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Nh)||"";return e&&globalThis.sessionStorage?.setItem(Nh,e),e}const kh=he((()=>{a((()=>{wh()}),[]),_t(globalThis,"click",Ch)})),Ch=e=>{const t=Sh(e.target),[l]=E._.YANDEX_METRIKA_ID?.split(",").reverse()??[],n=t?.dataset?.ymtarget;if([l,n,globalThis.ym].every(Boolean)&&globalThis.ym(l,"reachGoal",n),L(t?.href)){e.preventDefault(),e.stopPropagation();const l=(e=>{const t=wh();if(!L(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;l&&(globalThis.location.href=l)}},Sh=e=>{let t=e;for(;Boolean(t)&&"A"!==t.tagName;)t=t?.parentNode;return t},Th="cookie",Ih=d((({termLink:e,personalDataPolicyLink:t})=>{const[l,{setTrue:n,setFalse:a}]=Dt();om((()=>{globalThis.localStorage?.getItem(Th)||n()}),[],3e3);const i=r((()=>{globalThis.localStorage?.setItem(Th,"true"),a()}),[]);return l?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:c(T,{size:"text-s",font:"font-light",color:"text-primary-text",children:["АО «Россельхозбанк» использует",o(Si,{isRemote:!0,className:Bh(e?.href),...e,children:"cookie"}),"(файлы с данными о прошлых посещениях сайта) для персонализации сервисов и удобства пользователей. Вы можете запретить сохранение cookie в настройках своего браузера.",o(Si,{isRemote:!0,className:Bh(t?.href),...t,children:"Обработка Ваших персональных данных"}),"производится в соответствии с требованиями Федерального закона от 27.07.2006 № 152-Ф3 «О персональных данных»."]})}),o("div",{className:"ml-s sm:ml-0 w-24 flex justify-end",children:o(Qd,{className:"bg-main-gray rounded-md",onClose:i})})]})}):null})),Bh=e=>p("inline mx-2xs",e?"text-green-dark":""),Mh=d((()=>{const e=r((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=r((e=>{e?.onClose&&e.onClose()}),[]),l=Xd({onCloseAll:e,onClose:t}),{close:n}=me(),i=r((({key:e})=>{"Escape"===e&&n()}),[]);return _t(globalThis.document,"keydown",i),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:p("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar",n===l.length-1?"":"hidden"),children:e},String(t||n))))}):null})),Vh=d((()=>{const[e,t]=n(null),l=r((()=>{t(null)}),[]);a((()=>h.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":l();break;default:Dd(e)}}))),[]);const i=r((({key:e})=>{"Escape"===e&&l()}),[l]);return _t(globalThis.document,"keydown",i),e?o("div",{className:"absolute z-50",style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),Rh="header",Ph="footer",zh="sticky-footer",Ah={},jh=d((({className:e,data:t=Ah,blocksRegistry:l,blockDecorator:n})=>{const{slots:a,blocks:r,fallback:i,...s}=t,d=Ct(s,i);kh();const m={key:"",page:{slots:a,blocks:r,fallback:i,...d},blocksRegistry:l,blockDecorator:n,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:p("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:z(a?.header,{...m,slotName:Rh})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[A({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),z(a?.footer,{...m,slotName:Ph})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:z(a?.["sticky-footer"],{...m,slotName:zh})}):null,o(Mh,{}),o(Vh,{}),o(Ih,{termLink:{href:"/pd-policy#cookie",target:"_blank"},personalDataPolicyLink:{href:"/pd-policy",target:"_blank"}})]})}));Object.assign(jh,{childrenTypes:[],slots:()=>[Rh,Ph,zh]});e.Blocks=vh,e.ContentPage=jh,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=he,e.joinList=e=>t=>t.reduce(((t,l,n)=>t.length?t.concat({...e,key:`sep-${n}`},l):[l]),[]),e.packageVersion="0.14.215",e.projectSettings=E,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=U,e.useRouter=u,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).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const l=e=>(...l)=>t[e](...l),n=l("useState"),a=l("useEffect"),r=l("useCallback"),i=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||{},r=l?.slots?.default,i=n||r&&r();return e(Object.assign(a,i&&{children:i}),l)}return t.inheritAttrs=!1,t};const h=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}};function u(){return u._impl()}u._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),u.setup=e=>{u._impl=e};const p=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),g={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","":""},x=d((({className:e,version:t="primary",isTheme:l=!0,defaultPadding:r="p-xl",padding:i,block:s,tag:c="section",role:d,children:m,style:x})=>{const f=c,b=u(),[y,v]=n(!1);a((()=>h.subscribe("tab",(e=>{e.groupName&&e.groupName!==s?.labelGroup||v(Boolean(e.label&&s?.labels?.length&&!s.labels.includes(e.label)))}))),[s,b]);const N=t&&l;return o(f,{className:p("@container font-sans",N?"group":"",g[t],y?"hidden":"",i||r,e),...N?{"data-ver":t}:{},...s?.anchor?{id:s.anchor}:{},role:d,style:x,children:m})})),f=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),b=d((({children:e})=>f?e:null)),y=d((({className:e,size:t})=>o("figure",{className:p("m-0 mt-xl min-w-[80%]",e),children:v(t)}))),v=(e=3)=>w(100,e).map((e=>Math.floor(e))).map(N),N=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),w=(e,t)=>[e].concat(t>0?w(e/1.618,t-1):[]),k={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},C={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},S=d((({className:e="",headingType:t="h3",as:l="h3",title:n,children:a})=>{const r=k[l]||"h3";return o(r,{role:"heading",className:p("font-sans m-0",C[t],e),children:n||a})})),T=d((({children:e,...t})=>o("p",{className:p("font-sans",Object.values(t)),children:e}))),I={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"}},B=d((({className:e,version:t="",headlineVersion:l="XL",title:n,description:a,align:r="text-center",as:i,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=I[l],u={marginTop:h.descriptionStyle};return c(x,{className:p(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[n?o(S,{className:p("whitespace-pre-wrap",r),...h?.title,as:i||h?.title.as,title:n}):null,a?o(T,{size:h.descriptionSize,font:h.descriptionWeight,align:r,...u,children:a}):null]})})),M=({blockClassName:e,block:t,render:l})=>l({blockClassName:e,block:t}),V=[];function R(e,t,{className:l,...n}={}){const{key:a,blockDecorator:r=M,blocksRegistry:i={},ancestors:s=V}=t,{type:c}=e;c&&c in i||console.warn(`No block with "${c}" is registered`);const d=c&&i[c];return r({blockClassName:p(e.style?.length?e.style:"col-span-12",l),block:e,ancestors:s,render:({block:l,blockClassName:r})=>{const{content:i}=l;return d?o(d,{className:r,block:e,options:t,...i,...n},a):null}},a)}const P=[],z=(e,{key:t,ancestors:l=P,slotName:n=null,extraProps:a,renderProps:r=R,...i})=>{const s=a?(e,t)=>R(e,t,a):r;return(e||[]).map(((e,a)=>s(e,{...i,key:`${t||e.type}-${a}`,ancestors:i.parent?[...l||P,[i.parent,n]]:l},a)))};function A({block:e,options:t,children:l,extraProps:n,renderProps:a}){return l||(e&&t?z(e.blocks,{...t,parent:e,extraProps:n,renderProps:a}):null)}const j=e=>e&&!e.endsWith("/")?`${e}/`:e,D=["CDN","BASE_PATH"],E=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const l=e._[t]||e[t];return D.includes(t)?j(l):l}}),L=e=>Boolean(e?.includes(":")),$=(e,t)=>Boolean(e&&!L(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),O=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),_=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/");var U=Object.freeze({__proto__:null,isURL:L,isLocalURL:$,isHash:F,withoutQuery:O,joinPath:_});const H="/api/",W=`${H}v1/storage`,K=e=>(t,l=E.BASE_PATH)=>{if([!t,L(t),F(t),[E.CDN,H].some((e=>q(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}/file`;const n=t?.startsWith("/");return _(q(t,l)?"":l,n?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},q=(e,t)=>t&&e&&e.startsWith(t),G={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},Y=d((({className:e="",imageClassName:t="",name:l="",alt:n=`Иконка ${l}`,title:a=n,iconVersion:r="color",width:i,height:s})=>{const d=u(),m="normal"===r?`${l}.svg`:`sprites.svg#${l}`,h=K(d)(_(E.CDN,"/icons/",m));return"normal"===r?o("img",{className:e,src:h,alt:n,title:a,"aria-hidden":"true",width:i,height:s,style:X(e,s)}):o(Z,{className:e,children:c("svg",{className:p(Q(i),G[r],"white"===r?"invert":"",t),width:i,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},Q=e=>e?"":"w-full h-full",Z=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),J=(e,t)=>l=>l&&!L(l)?K(e)(_(t,l)):l,ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n})=>{const a=u();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:l,media:r},i)=>o("source",{srcSet:J(a,n)(e),type:ne(l),media:r?`(max-width: ${r}px)`:"",width:t?.size?.width,height:t?.size?.height},`${i}_${e}`))):null,t?.src?le({...t,src:J(a,n)(t.src)},l):null]})})),le=(e,t="")=>o("img",{src:e.src,className:p("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="",pathPrefix:n,...a})=>t?.src||t?.icon?t.icon?o(Y,{className:e,imageClassName:l,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:l,image:t,pathPrefix:n}):null)),re={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","":""},ie="bg-main-divider text-main-disabled",se={primary:ie,secondary:ie,white:ie,link:"",transparent:"",gray:ie,"":""},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?re[l]:"",t?"rounded-full":"rounded-md",e].join(" "),me=()=>({open:(e,t={})=>h.fire("dialog",{type:"open",dialog:e,...t}),close:()=>h.fire("dialog",{type:"close"}),closeAll:()=>h.fire("dialog",{type:"close",all:!0})}),he=e=>he._impl(e);function ue(e={}){const{isRemote:t,basePath:l}=e,n=u(),{closeAll:a}=me();return e=>({...e,href:t&&!l?e.href:K(n)(e.href,l),"aria-label":e.text,onClick:he(r(e))});function r({href:e,target:l,onClick:r}){return i=>{r&&r(i),e&&!t&&$(e,l)&&(a(),i?.preventDefault(),n.push(e))}}}he._impl=e=>e,he.setup=e=>{he._impl=e};const pe=(e={})=>Object.entries(e).reduce(((e,[t,l])=>({...e,[`data-${t.toLowerCase()}`]:l})),{}),ge=d((e=>{const{text:t,aboveText:l,appendLeft:n,appendRight:a,version:r="primary"}=e,i=fe(e)?"hidden lg:block":"";return c("div",{className:p(xe(e),"flex gap-xs"),children:[n?o("div",{className:p(i,ce[r]),children:n}):null,fe(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:p(i,ce[r]),children:a}):null]})})),xe=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 p("group/btn items-center justify-center",fe(e)?a:"h-12 w-12 m-auto",n?"rounded-full":"")},fe=({text:e,aboveText:t,appendLeft:l})=>Boolean(e||t||!l),be=({className:e,rounded:t,version:l})=>["inline-block",oe,l?se[l]:"",t?"rounded-full":"rounded-md",e].join(" "),ye=d((({disabled:e,children:t,method:l="LINK",href:n,...a})=>{const i=(({method:e,href:t})=>r((l=>{if("POST"!==e||!t)return;l.preventDefault(),l.stopPropagation();const{origin:n,pathname:a,searchParams:r}=new URL(t||""),i=document.createElement("form");i.setAttribute("method","POST"),i.setAttribute("action",[n,a].join(""));for(const[e,t]of r.entries()){const l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name",e),l.setAttribute("value",t),i.appendChild(l)}document.body.appendChild(i),i.submit()}),[]))({method:l,href:n}),s=ue()({onClick:i,href:n,...a}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:l,target:n,ariaLabel:a,version:r,rounded:i,onClick:s,type:c,data:d,children:m})=>o("a",{className:de({className:e,version:r,rounded:i}),href:t,rel:l,target:n,"aria-label":a,role:t?"link":"button",onClick:s,type:c,...pe(d),children:m}))),Ne=d((({className:e,ariaLabel:t,version:l,rounded:n,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:n,version:l}),children:a})));function we(e,t){const l="primary"===e?"white":"black",n="Вернуться назад";return c("div",{className:"hidden sm:flex items-center gap-s",children:[o("div",{className:de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",version:e,rounded:!0}),onClick:t,children:o(ae,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:l}})}),o(ye,{version:"link",className:"group-data-secondary:text-white/80",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const ke={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:i="",buttons:s,leftImage:d,rightImage:m,imageAlign:h,isImageAlwaysOnRight:g=!1,isImageSecondary:x=!1,backwardButton:f,children:b,...y})=>{const v=u(),N=r((()=>{v.back()}),[]);return c("div",{className:Se(n,l,e),children:[f?we(t,N):null,a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:p("grow relative flex flex-col @xl:flex-row gap-3xl w-full",d?"self-start @xl:w-auto":""),children:[Ve(d,{imageAlign:h,className:"mx-auto"}),c("div",{className:p("grid gap-3xl",m?"@xl:grid-cols-2":"",d?"":"grow","h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[i,b]}),Me(A({...y,extraProps:{className:"@container-normal"}})),Ve(m,{className:p("@xl:justify-self-end @xl:col-start-2",s?Te(g):"",Ie(g),Re(x)),imageAlign:h}),Be(s)]})]})]})})),Se=(e="",t="",l="")=>p("relative flex flex-col gap-3xl overflow-hidden",e||t,l),Te=e=>e?"row-span-2":"@xl:row-span-2",Ie=e=>e?"col-start-2 self-center":"",Be=e=>e?o("div",{className:"self-end",children:e}):null,Me=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:p("shrink-1/2 justify-self-center",l&&ke[l],t),children:e}):null,Re=e=>e?"hidden @xl:block":"",Pe=(e=[])=>e.reduce(((e,t)=>e+t),0),ze=(e=[])=>e?.length?Pe(e)/e.length:0,Ae=(e,t="normal")=>e?o("div",{className:p("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,je=d((e=>{const{__html:t="",richVersion:l=""}=e;return t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:p(l,"md-container"),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(e,t)=>e?o(T,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ee=d((({children:e,...t})=>o("span",{className:p("font-sans",Object.values(t)),children:e}))),Le=(e,t)=>e?o(Ee,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,$e=(e,t)=>"rte"===e.type&&"__html"in e&&e.__html?o(je,{...e},`rte-${t}`):["label"in e?Le(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:De(e.description,t)},String(t)):null],Fe=d((({className:e,benefitsVersion:t,...l})=>c("div",{className:p("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in l?Ae(l.icon,t):null,o("div",{children:$e(l)})]}))),Oe=e=>"rte"===e.type?e?.__html?.length||0:Math.max(e?.label?.length||0,e?.description?.length||0),_e=e=>{return((t=e.map(Oe))?.length?Math.sqrt(Math.abs(ze(t.map((e=>e**2)))-ze(t)**2)):0)>16;var t},Ue=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),He=e=>!e.some(Ue),We=d((({className:e,benefitsVersion:t="normal",benefits:l})=>l?.length?o("div",{className:p("flex gap-x-m gap-y-s",_e(l)||He(l)?"flex-col":"flex-wrap",e),role:"list",children:l.map(((e,l)=>o(Fe,{benefitsVersion:t,...e},String(l))))}):null)),Ke=d((({className:e,benefits:t})=>t?.length?o("div",{className:p("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap($e)}):null)),qe=d((({isTabularBenefits:e,...t})=>o(e?Ke:We,{...t}))),Ge=e=>Boolean(e?.src||e?.icon),Ye=(e,{className:t,buttonClassName:l,isVertical:n}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:p("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(Xe(l))}):null,Xe=(e="")=>(t,l)=>{const{text:n,icon:a,iconRight:r,version:i,...s}=t||{},c=Qe(a,i),d=Qe(r,i);return n||a?.icon?o(ye,{className:p("basis-full @lg:basis-auto",e),appendLeft:Ze({...a,iconVersion:c}),appendRight:Ze({...r,iconVersion:d}),version:i,text:n,...s},l?String(l):""):null},Qe=(e,t="secondary")=>{const l="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:l},Ze=e=>Ge(e)?o(ae,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,Je=d((({className:e,isDotted:t,dotClassName:l,children:n})=>c("div",{className:p("font-sans flex",e),role:"listitem",children:[t?o("div",{className:"shrink-0",children:o("div",{className:p("align-middle inline-block rounded-full group-data-secondary:bg-white",l)})}):null,o("span",{children:n})]}))),et={S:{textSize:"text-l font-light",indentStyle:"ml-xs",dotStyle:"w-1 h-1 mr-xs"},M:{textSize:"text-h6",indentStyle:"ml-s",dotStyle:"w-1.5 h-1.5 mr-s"},L:{textSize:"text-h5",indentStyle:"ml-m",dotStyle:"w-1.5 h-1.5 mr-m"}},tt=d((({className:e,isDotted:t=!0,items:l=[],listItemSize:n="M",dotClassName:a=""})=>{const r=et[n];return l?.length?o("section",{className:p("flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text",r.textSize,e),role:"list",children:l.map(((e,l)=>o(Je,{isDotted:t,dotClassName:p(a||"bg-primary-text",r.dotStyle),children:e},String(l))))}):null})),lt=(e=0,{fixed:t}={})=>(l=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(l)||0),nt=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(at)}):null)),at=({label:e,amount:t},l)=>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(Ee,{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:[lt(2)(t)," ₽"]}):null]},String(l)),rt=d((({className:e,tags:t})=>t?.length?o("div",{className:p("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(Ee,{size:"text-m",font:"font-light",children:e})},String(t)),st={XXL:"L",XL:"L",L:"M",M:"M",S:"S",XS:"S"},ot=d((({className:e,padding:t,defaultPadding:l,title:n,description:a,headlineVersion:r="L",align:i="text-left",benefitsVersion:s,isTabularBenefits:d,benefits:m,__html:h,isFullWidthTitle:u,items:p,isDotted:g=!0,priceList:x=[],tags:f=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:k=!1}={},backwardButton:C,children:S,...T})=>{const I=y?.src?o(ae,{image:y}):null,M=o(B,{title:n,description:a,headlineVersion:r,align:i,isEmbedded:!0}),V=m?.filter((e=>"rte"===e?.type||"label"in e||"description"in e));return o(Ce,{className:e,padding:t,defaultPadding:l,...u?{title:M}:{insetTitle:M},...ct(I,N),isImageSecondary:k,imageAlign:v,isImageAlwaysOnRight:w,buttons:Ye(b),backwardButton:C,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[V?.length?o(qe,{benefitsVersion:s,isTabularBenefits:d,benefits:V}):null,h?o(je,{__html:h}):null,p?.length?o(tt,{items:p,isDotted:g,listItemSize:st[r]}):null,S,x?.length?o(nt,{priceList:x}):null,dt(f)]})})})),ct=(e,t)=>t?{rightImage:e}:{leftImage:e},dt=e=>e?.length?o(rt,{tags:e}):null,mt=e=>Boolean(e&&Array.isArray(e)),ht=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),ut=(e,t)=>{return l=e,Boolean(ht(l)&&"string"==typeof l.$ref)?t.ref(e):ht(e)?t.record(e):mt(e)?t.array(e):t.scalar?t.scalar(e):e;var l},pt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(gt,e),gt=(e,t)=>e&&t?ht(e)?e[t]:mt(e)?e[parseInt(t,10)]:e:e,xt=(e,t)=>ut(e,{ref:({$ref:e,...l})=>xt(e?pt(t(e),e):l,t),record:e=>Object.entries(e).map((([e,l])=>({[e]:xt(l,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>xt(e,t)))}),ft=(e,t,l=[])=>{ut(e,{ref:e=>t(e.$ref,l),record:e=>{for(const n in e)ft(e[n],t,[...l,n])},array:e=>{for(let n=0;n<e.length;n++)ft(e[n],t,[...l,n])}})};async function bt(e,t){try{return e?await yt(e,t):null}catch(e){console.error(e)}return null}const yt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),vt=e=>[...new Set(e)],Nt={},wt=["/portal-resources"],kt=(e,t)=>xt(e,(e=>t?.[e])),Ct=(e,t)=>{const l=(e=>{const t=[];return ft(e,(e=>t.push(e))),t})(e),[r,i]=n({});return a((()=>{l.length&&(async e=>Object.fromEntries((await Promise.allSettled(vt(e).filter((e=>!wt.some((t=>e.startsWith(t))))).map((async e=>[e,Nt[e]||=await yt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(l).then(i)}),[l.join()]),l.length?kt(e,{...t,...r}):e};function St(e,t={}){const l=d((t=>{const l=Ct((({block:e,options:t,className:l,defaultPadding:n,padding:a,isTheme:r,version:i,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...l})}));return Object.assign(l,t),l}const Tt=St((({className:e,padding:t,...l})=>o(x,{className:p("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:o(ot,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...l})})),{childrenTypes:["UnitBlock"]}),It=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},l=i((()=>Bt(0,t?.length)),[t]),n=t?.[l];return n?o(b,{children:o(Tt,{...n,...e})}):o(x,{...e,children:o(y,{})})})),Bt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Mt=e=>e?.replace(/[^+\d]/g,"");function Vt(){return{send:async function(e,t=!1){const l=t?"/api/v1/lead":"/api/v1/sendcorporatelead",{typeForm:n,region:a,phone:r="",email:i,birthday:s,inn:o,fullName:c,addressBranch:d,secondaryPhone:m="",bankEmpolee:h,applicationDate:u,...p}=e,g={typeForm:n,[t?"regionBranch":"region"]:a,[t?"phoneNumber":"phone"]:Mt(r),[t?"email":"mail"]:i,...t?{birthday:s}:{inn:o,fullName:c},..."FEEDBACK"===n?{}:{addressBranch:d,bankEmpolee:h,applicationDate:u,...Rt(m)},...p};try{const e=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(g)});if(!e?.ok)return null;return await e.json()}catch(e){return null}}}}const Rt=e=>e&&"+7 ("!==e?{secondaryPhoneNumber:Mt(e)}:{},Pt=d((({responseType:e})=>{const t="OK"===e,l=t?"ResponseOKIcon":"ResponseFailIcon";return c("div",{className:p("flex items-center p-lg rounded-md space-x-m",t?"bg-ok":"bg-fail"),children:[o(ae,{image:{icon:l,iconVersion:"normal"},width:"42",height:"42"}),c("div",{children:[o(S,{headingType:"h6",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",className:"mb-2xs"}),o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее"})]})]})})),zt=e=>e,At=(e,{resetOnSubmit:t,onSubmit:l}={})=>{const[a,i]=n(e),[o,c]=n(!1),[d,m]=n({}),h=s({}),u=r(((e,t)=>{const{parse:l=zt,format:n=zt}=t||{};return h.current||(h.current={}),h.current[e]||=t=>{i((n=>({...n,[e]:l(t)}))),m((t=>({...t,[e]:!0})))},{value:n(a[e]),isDirty:o||d[e],onChange:h.current[e]}}),[a,o,d]),p=r((e=>{i(e),m(e)}),[]),g=r((()=>{i(e),c(!1),m({})}),[e]),x=r((e=>{e.preventDefault(),t?g():c(!0),l&&l(a)}),[l,a]);return[a,{isDirty:o||Object.values(d).some(Boolean),field:u,update:p,reset:g,onSubmit:x}]},jt=e=>o("div",{className:"h-6",children:e?o(Ee,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null});function Dt(e=!1){const[t,l]=n(e),a=r((()=>l(!0)),[]),i=r((()=>l(!1)),[]),s=r((()=>l((e=>!e))),[]);return[t,{setValue:l,setTrue:a,setFalse:i,toggle:s}]}const Et=(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=t?String(e.getFullYear()):String(e.getFullYear()).slice(-2);return t?`${a}-${n}-${l}`:`${l}.${n}.${a}`}},Lt=e=>e?o(Ee,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,$t=d((({key:e,className:t="",id:l,name:n,type:i="text",label:d,placeholder:m,value:h="",valid:u=!0,children:g,onChange:x,onFocus:f,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1})=>{const w=s(null),k=r((e=>{x&&x(e.target?.value||"")}),[x]);a((()=>{v&&w.current?.focus()}),[v,w]);const C="w-full border rounded-md text-primary-text outline-none p-m",S=g?"pr-3xl":"",T=Ft(u);return c("div",{className:p("relative",t),children:[c("label",{className:"space-y-xs",children:[Lt(d),N?o("textarea",{className:p("block resize-y min-h-24",C,T),id:p("textarea",l),name:n||l,placeholder:m,value:h,onInput:k,onFocus:f,onBlur:b},e):o("input",{type:i,className:p("h-14",C,S,T),ref:w,id:l,name:n||l,placeholder:m,value:h,onInput:k,onFocus:f,onBlur:b,pattern:y},e)]}),g]})})),Ft=e=>e?"border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text":"border-error",Ot=e=>e?.text||e?.key||"";function _t(e,t,l,n){a((()=>{if(e&&l)return e.addEventListener(t,l,n),()=>{e.removeEventListener(t,l,n)}}),[e,t,l])}function Ut(e){const t=s(null),l=r((l=>{t&&t.current&&l.target instanceof Node&&!t.current.contains(l.target)&&e()}),[e]);return _t(globalThis.document,"click",l),t}const Ht=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Wt=d((({popupRef:e,options:t,value:l,query:n,onChange:a,iconVersion:r})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md",role:"list",ref:e,children:Ht(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:Ot(e)}),o(Y,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:r,className:p("absolute right-4 pt-3xs",e.key===l?.key?"":"hidden")})]},e.key)))}):null));function Kt({isOpen:e,options:t,value:l,query:n,onChange:i,onClose:c,iconVersion:d}){const m={open:(e,t)=>h.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>h.fire("popup",{type:"update",popup:e,...t}),close:()=>h.fire("popup",{type:"close"})},u=r((()=>{m.close(),c&&c()}),[c]),p=r((e=>{u(),i&&i(e)}),[u,i]),g=s(null),x=Ut(u);return a((()=>{if(!e||!g.current)return;const a=g.current,{top:r,left:i,width:s,height:c}=a.getBoundingClientRect();m.update(o(Wt,{popupRef:x,options:t,value:l,query:n,onChange:p,iconVersion:d}),{top:r+window.scrollY+c,left:i,width:s})}),[e,t,l,n,p]),g}const qt=d((({className:e,label:t,options:l=[],value:a,valid:i=!0,isBorder:s=!0,placeholder:d="",isSearch:m=!1,iconVersion:h,onChange:u,disabled:g})=>{const[x,{setFalse:f,setTrue:b}]=Dt(),[y,v]=n(""),N=g||0===l.length,w=x&&!N,k=r((()=>{v(""),f()}),[]),C=Kt({isOpen:x,options:l,value:a,query:y,onChange:u,onClose:k,iconVersion:h});return c("div",{className:p("space-y-xs",e),children:[Lt(t),c("div",{className:p("relative",w?"z-20":"z-10"),ref:C,children:[c("div",{className:p("h-14 [&>*]:p-m pr-8 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Yt(s,i,N)),onClick:w?k:b,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Ot(a)||d}),Gt(w,h)]}),m&&w?o("div",{className:p("absolute top-0 w-full z-20"),children:o($t,{type:"text",autoFocus:!0,value:y,onChange:v})}):null]})]})})),Gt=(e,t)=>o(Y,{className:p("absolute right-3 flex self-center",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Yt=(e,t,l)=>p(e?"border rounded-md ":"",e&&!l?"hover:border-primary-hover":"",l?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Xt=()=>{},Qt=({today:e,firstDayOfWeek:t,totalDays:l,currentMonth:n,currentYear:a,min:r,max:i,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=Zt(t,e),c=Jt(t,r,i);h.push(o("td",{children:o("div",{className:el(l,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:h},`row-${m}`))}return c},Zt=(e,t)=>t&&e.toDateString()===t.toDateString(),Jt=(e,t,l)=>t&&e.getTime()<t.getTime()||l&&e.getTime()>l.getTime(),el=(e,t)=>p("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),tl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],ll=d((({today:e,currentMonth:t,currentYear:l,min:n,max:a,onDateSelect:s=Xt})=>{const d=r((e=>s(e)),[]),{firstDayOfWeek:m,totalDays:h}=i((()=>({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:tl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Qt({firstDayOfWeek:m,today:e,totalDays:h,currentYear:l,currentMonth:t,min:n,max:a,onDateClick:d})})]})})),nl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],al=nl.map((e=>({key:e}))),rl=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),il={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},sl={className:"min-w-32",iconVersion:"black",isBorder:!1},ol=d((({className:e="",label:t="",value:l,valid:a=!0,minDate:i,maxDate:s,onChange:d})=>{const[m,{setValue:h}]=Dt(!1),[u,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:C,ref:S}=(({onShowCalendar:e,showCalendar:t,selectedMonth:l,onMonthSelect:n,onYearSelect:a,selectedYear:i})=>{const s=Ut(r((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:r((()=>e(!t)),[t]),handleNextMonth:r((()=>{l+1<=11?n(l+1):(n(0),a(i+1))}),[l]),handlePrevMonth:r((()=>{l-1>=0?n(l-1):(n(11),a(i-1))}),[l]),handleSelectMonth:r((({key:e})=>n(nl.indexOf(e))),[]),handleSelectYear:r((({key:e})=>a(Number(e))),[]),monthsOptions:al,yearsOptions:rl,ref:s}})({onYearSelect:f,onMonthSelect:g,onShowCalendar:h,selectedYear:x,selectedMonth:u,showCalendar:m});return c("div",{className:p("space-y-xs",e),ref:S,children:[Lt(t),c("div",{className:"relative",children:[cl(C,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(Y,{...il,className:"-rotate-90 cursor-pointer"})}),o(qt,{onChange:v,value:{key:nl[u]},options:w,...sl}),o(qt,{onChange:N,value:{key:String(x)},options:k,...sl}),o("div",{className:"my-auto",onClick:y,children:o(Y,{...il,className:"rotate-90 cursor-pointer"})})]}),o(ll,{today:l,currentMonth:u,currentYear:x,onDateSelect:d,min:i,max:s})]}):null]})]})})),cl=(e,t,l)=>c("div",{onClick:e,className:p("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(T,{children:t&&Et(t)}),o(Y,{...il,name:"CalendarIcon"})]}),dl=d((({className:e,label:t,error:l,...n})=>c("div",{className:p("shrink-0 w-full",e),children:[o(ol,{label:t&&n?.errors?`${t}*`:t,valid:Boolean(!l),...n}),jt(l)]}))),ml=d((({className:e,label:t,value:l="",placeholder:n,error:a,onChange:r,onBlur:i,isTextarea:s,...d})=>c("div",{className:p("shrink-0 w-full",e),children:[o($t,{type:"text","aria-label":t,label:t&&d?.errors?`${t}*`:t,valid:Boolean(!a),value:l,onChange:r,onBlur:i,isTextarea:s,placeholder:d?.errors&&!t?`${n}*`:n}),jt(a)]}))),hl=e=>"_"===e,ul=e=>/\d/.test(e),pl=e=>hl(e)||ul(e),gl=[..."+7 (___) ___-__-__"],xl=gl.findIndex(hl),fl=gl.map(((e,t)=>pl(e)?gl.slice(0,t).filter(pl).length:-1));const bl=d((({children:e,onChange:t,...l})=>{const n=r((e=>t&&t(function(e){const t=e.replace(/\D/g,""),l=gl.map(((e,l)=>ul(e)?e:t.charAt(fl[l])||e)),n=fl.indexOf(t.length-1)+1;return(n?l.slice(0,Math.max(xl,n)):l).join("")}(e))),[t]);return o($t,{onChange:n,onFocus:e=>n(e?.target?.value||""),...l,children:e})})),yl=d((({className:e,label:t,value:l,error:n,onChange:a,onBlur:r,...i})=>c("div",{className:p("shrink-0 w-full",e),children:[o(bl,{"aria-label":t,label:i?.errors?`${t}*`:t,valid:Boolean(!n),value:l,onChange:a,onBlur:r,placeholder:"+7 (___) ___-__-__"}),jt(n)]}))),vl=d((({className:e="",label:t,error:l,...n})=>c("div",{className:e,children:[o(qt,{...n,valid:!l,label:n?.errors?`${t}*`:t}),jt(l)]}))),Nl=e=>t=>t&&Object.entries(e).flatMap((([e,l])=>l(t[e])))||[],wl=e=>!e?.length,kl=e=>t=>l=>e(l)?[]:[t],Cl=(e,t)=>{const{value:l,isDirty:n}=e,a=n?t(l):[];return{...e,errors:a,error:a[0]}},Sl=e=>null!=e,Tl=new Map,Il=e=>Boolean(e?.every((e=>Array.isArray(e)?Il(e):!e||"string"==typeof e))),Bl=e=>Il(e)?e.toString():"";function Ml(e,t,{fallback:l,cache:r}={}){const s=i((()=>Vl(e)),[e]),[o,c]=n(void 0),[d,m]=n(void 0);a((()=>{if(!s.some(Sl))return;let e=!1;const l=(t,l)=>{e||(c(t),m(l))};return(async()=>{try{l(await((e,t=Tl)=>l=>{const n=Bl(l),a=t.get(n);if(n&&Sl(a))return a;const r=e(...l);return n&&Sl(r)&&t.set(n,Promise.resolve(r)),r})(t,r)(s))}catch(e){l(void 0,e)}})(),()=>{e=!0}}),[t,r,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 Vl(e){return Array.isArray(e)?e:e instanceof Function?Vl(e()):[e]}const Rl=[];const Pl=async e=>await bt(e,{method:"GET"})||Rl;function zl(){const{data:e}=Ml("/api/v1/premiumBranchesByRegions",yt);return Array.isArray(e)?e:[]}const Al=d((({className:e,viewBox:t,fill:l="none",width:n,height:a,paths:r,...i})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:l,width:n,height:a,children:r.map((({d:e,fill:t,...l},n)=>{const a={...i,...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)}))}))),jl=[{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"}],Dl=d((({className:e,value:t,text:l,disabled:n,isRadio:a,onChange:i})=>{const s=r((e=>{n||(e.preventDefault(),i&&i(!t))}),[i,n,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Al,{paths:jl,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:"flex items-center relative cursor-pointer group/box",onClick:s,children:[o("div",{className:p("appearance-none w-5 h-5 border-solid cursor-pointer m-0",a?"rounded-full border-2":Ll(t),t?"border-primary-main":"border-gray",n?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:El(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(n)}),t?d:null,l?o("div",{className:"ml-s",children:o(Ee,{size:"text-l",font:"font-light",children:l})}):null]})})})),El=e=>e?"radio":"checkbox",Ll=e=>p("rounded border",e?"bg-primary-main":""),$l=d((({className:e,text:t,value:l,key:n,disabled:a,error:r,onChange:i})=>c("div",{className:p("shrink-0 w-full",e),children:[o(Dl,{text:t,value:l,disabled:a,onChange:i},n),jt(r)]}))),Fl="Некорректно заполненное поле",Ol=kl((e=>null!=e&&""!==e))(Fl),_l=kl((e=>e?.key&&""!==e?.key))(Fl),Ul=kl((e=>"string"==typeof e&&e.length>1))(Fl),Hl=kl((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Fl),Wl=(Kl=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,kl((e=>"string"==typeof e&&Kl.test(e))))(Fl);var Kl;const ql=kl((e=>"boolean"==typeof e&&e))(Fl),Gl=e=>Object.values(e).map((e=>e.name)),Yl={typeForm:Ol,surname:Ul,name:Ul,region:_l,addressBranch:_l,phone:Wl,birthday:Ol,email:Ol,fullName:Ol,inn:Hl,partnerComments:Ol,comment:Ol,acquiringType:_l,serviceType:_l,consentDataProcessing:ql,annualRevenue:Ol},Xl=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Ql=d((({field:e,input:t})=>o(vl,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:Xl,...kn(e("acquiringType"),Yl.acquiringType,t?.required)}))),Zl=(e="")=>Boolean("trade"===e||"all"===e),Jl=(e,{normalize:t,format:l})=>{const{value:a,onFocus:i,onBlur:s,onChange:o}=e,[c,d]=n(!1),m=r((e=>{d(!0),i&&i(e)}),[]),h=r((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!l?a:l(a),onFocus:m,onBlur:h}},en=(e,t,l)=>Math.max(t,Math.min(e,l));function tn(e){const t=(e||"").replace(/\D/g,""),l=parseInt(t,10);return Number.isNaN(l)?0:l}function ln({list:e=[],min:t,max:l,step:n,value:a=e[0]||t,disabled:r,onChange:i}){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:p("w-2 h-2 rounded-full",s<=t||r?"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:r,onInput:t=>{const l=tn(t.target?.value),n=e.length?e[l]:l;i&&i(n||0)}})})]})}const nn=1,an=100,rn=d((e=>{const{className:t,title:l,items:n=[],list:a=[],min:i=(a.length?0:nn),max:s=(a.length?a.length-1:an),step:d=1,value:m=a[0]||i,disabled:h=!1,onChange:u}=e,g=Jl(e,{normalize:(e=0)=>a.length?sn(a)(e):en(e,i,s),format:lt()}),x=r((e=>{u&&u(tn(e.target?.value))}),[u]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[l?o(Ee,{size:"text-m",font:"font-light",color:"text-primary-text",children:l}):null,o("input",{className:p("mt-xs font-sans text-h3 w-full h-14","border border-solid border-gray rounded-md outline-none","pl-m box-border","text-primary-text hover:border-primary-hover focus:border-primary-text","disabled:border-gray disabled:bg-main-divider"),disabled:h,onInput:x,...g}),ln({list:a,min:i,max:s,step:d,disabled:h,value:m,onChange:u})]}),on(n)]})})),sn=e=>t=>e.reduce(((e,l)=>Math.abs(l-t)<Math.abs(e-t)?l:e)),on=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Ee,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),cn=["От 1 000 ₽","До 1 000 000 000 ₽"],dn=d((({field:e})=>o(rn,{title:"Сумма, ₽",items:cn,min:1e3,max:1e9,...e("amount")}))),mn=d((({field:e,input:t})=>o(ml,{className:"col-span-2",...kn(e("comment"),Yl.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),hn=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:p("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:p("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Ee,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),un=d((({field:e})=>Zl(e("acquiringType")?.value?.key)?o(hn,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),pn=d((({field:e})=>Zl(e("acquiringType")?.value?.key)?o(hn,{type:"radio",text:"Хочу купить POS-терминал",...e("posTerminal")}):null));function gn(){const{data:e}=Ml("/api/v1/regions",yt);return Array.isArray(e)?e:[]}const xn=d((({field:e,input:t})=>{const l=gn();return o(vl,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:i((()=>l?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[l]),...kn(e("region"),Yl.region,t?.required)})})),fn=d((({field:e,input:t})=>{const l=zl(),n=i((()=>l?.map((({region:e})=>({key:e,text:e})))),[l]);return o(vl,{label:"Регион",placeholder:"Выберите регион",options:n,...kn(e("region"),Yl.region,t?.required)})})),bn=["От 1 мес","До 15 лет"],yn=d((({field:e})=>o(rn,{title:"Срок, месяцев",items:bn,min:1,max:180,...e("term")}))),vn=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Nn=d((({field:e})=>o(vl,{label:"Тип обслуживания",options:vn,...Cl(e("serviceType"),Ol)}))),wn=(e,t)=>(l,n)=>{const{required:a,...r}=l,i="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,s={surname:o(ml,{label:"Фамилия",...kn(e("surname"),Yl.surname,a)}),name:o(ml,{label:"Имя",...kn(e("name"),Yl.name,a),...r}),middleName:o(ml,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),phone:o(yl,{label:"Телефон",...kn(e("phone"),Yl.phone,a)}),email:o(ml,{label:"Электронная почта",...kn(e("email"),Yl.email,a)}),fullName:o(ml,{label:"ФИО",...kn(e("fullName"),Yl.fullName,a),...r}),inn:o(ml,{label:"ИНН",...kn(e("inn"),Yl.inn,a)}),comment:o(mn,{field:e,input:l}),region:i?o(fn,{field:e}):o(xn,{field:e,input:l}),addressBranch:o(Cn,{field:e,input:l,isPremium:i}),birthday:o(dl,{label:"Дата рождения",...kn(e("birthday"),Yl.birthday,a)}),isClient:o($l,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}),partnerComments:o(ml,{label:"Количество объектов инкассации",...kn(e("partnerComments"),Yl.partnerComments,a)}),acquiringType:o(Ql,{field:e,input:l}),onlineCheckout:o(un,{field:e}),posTerminal:o(pn,{field:e}),serviceType:o(Nn,{field:e}),term:o(yn,{field:e}),amount:o(dn,{field:e}),annualRevenue:o(ml,{label:"Годовая выручка, ₽",...kn(e("annualRevenue"),Yl.annualRevenue,a)})};return o("div",{children:s[l.name]},String(n))},kn=(e,t,l=!1)=>l?Cl(e,t):e,Cn=d((({field:e,input:t,isPremium:l=!1})=>{const n=e("region")?.value?.text,r=l?zl()?.find((e=>e?.region===n))?.branches:function(e){const{data:t}=Ml(e?`/api/v1/branches?regionCode=${e}`:null,Pl);return t||Rl}(n)?.filter((e=>e?.address));return a((()=>{""!==e("region")?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[e("region")?.value]),o(vl,{label:"Адрес",placeholder:"Выберите адрес",options:(r||[]).map((({address:e=""})=>({key:e,text:e}))),...kn(e("addressBranch"),Yl.addressBranch,t?.required)})})),Sn=d((({title:e,children:t})=>c("fieldset",{className:"grid @xl:flex @xl:justify-between gap-m border-b border-b-main-divider @xl:border-none",children:[e?o("legend",{className:"w-full",children:o(S,{title:e,headingType:"h6",className:"@xl:text-center"})}):null,t]}))),Tn=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],In=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Bn=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Mn="container space-y-m",Vn=d((({text:e,link:t})=>c(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:[o(Ee,{children:e}),t?o(ye,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"text-primary-main",children:o(Ee,{children:t.text})}):null]})));function Rn({disabled:e,onClick:t}){return l=>{!e&&t&&t(l)}}const Pn={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"},zn={primary:p("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:p("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")},An=d((({children:e,...t})=>{const l=e=>({...e,onClick:he(Rn(e))}),{className:n,version:a="primary",active:r,disabled:i,type:s="button",rounded:c=!0,role:d,onClick:m}=l(t);return o("button",{className:p("font-sans px-9 py-4","flex justify-center items-center gap-xs",r?"text-white bg-primary-active":"",i?"bg-main-gray text-main-disabled cursor-not-allowed":"",r||i?"":p(Pn[a],zn[a]),c?"rounded-md":"",n),type:s,role:d,onClick:m,children:e})})),jn=(e,t)=>o(An,{className:p("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Dn=(e,t,l)=>c("div",{className:"flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3",children:[o(Dl,{...e}),o(Vn,{link:t})]}),jt(Cl(e,ql).error)]}):o(Vn,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),jn(l)]}),En={surname:"",name:"",middleName:"",typeForm:{key:"FEEDBACK",text:"Задать вопрос по продуктам и услугам"},serviceDirection:{key:"Физическое лицо"},birthday:void 0,feedbackMethod:{key:"Телефонный звонок"},phone:"",email:"",comment:"",consentDataProcessing:!1},Ln={typeForm:Ol,region:Ol,surname:Ol,name:Ul,feedbackMethod:Ol,phone:Wl,email:Ol,comment:Ol,consentDataProcessing:ql},$n=d((({button:e,link:t,onSubmit:l})=>{const n=r((e=>{Fn(e,l)}),[l]),[,{field:a,...i}]=At(En,{onSubmit:n}),s="FEEDBACK_QS"===a("typeForm").value?.key,d=_n(a("typeForm").value?.key,a("serviceDirection").value?.key);return o("form",{className:Mn,onSubmit:i.onSubmit,children:o(Sn,{children:c("div",{className:"w-full max-w-xl space-y-s m-auto",children:[o(vl,{label:"Тема",placeholder:"Выберите тему",options:Tn,...Cl(a("typeForm"),Ol)}),s?o(vl,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Bn,...Cl(a("serviceDirection"),Ol)}):null,o(xn,{field:a}),s?o(Cn,{field:a}):null,c("div",{className:"space-y-s",children:[o(ml,{label:"Фамилия",...Cl(a("surname"),Ul)}),o(ml,{label:"Имя",...Cl(a("name"),Ul)}),o(ml,{label:"Отчество (Обязательно, при наличии)",...a("middleName")}),o(dl,{label:"Дата рождения",...Cl(a("birthday"),Ol)})]}),d?c("div",{children:[o(ml,{label:"ИНН",...Cl(a("inn"),Hl)}),o(ml,{label:"Наименование организации",...a("fullName")})]}):null,o(vl,{label:"Способ получения ответа",options:In,...Cl(a("feedbackMethod"),Ol)}),o(yl,{label:"Телефон",...Cl(a("phone"),Wl)}),s?c("div",{children:[o(yl,{label:"Дополнительный телефон",...a("secondaryPhone").value&&"+7 ("!==a("secondaryPhone").value?Cl(a("secondaryPhone"),Wl):a("secondaryPhone")}),o(ml,{label:"Электронная почта",...Cl(a("email"),Ol)}),o(ml,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...a("bankEmpolee")}),o(ml,{label:"Дата и время обращения в Банк",...a("applicationDate")})]}):o(ml,{label:"Электронная почта",...Cl(a("email"),Ol)}),o(ml,{...Cl(a("comment"),Ol),placeholder:"Ваше сообщение",isTextarea:!0}),Dn(a("consentDataProcessing"),t,e)]})})})})),Fn=(e,t)=>{const l=_n(e?.typeForm.key,e?.serviceDirection?.key),n=Nl({...Ln,...On(e,l)});wl(n(e))&&t(e,!l)},On=(e,t)=>t?{addressBranch:Ol,inn:Hl}:"FEEDBACK"===e.typeForm.key?{birthday:Ol}:{addressBranch:Ol},_n=(e="",t="")=>"FEEDBACK_QS"===e&&"Юридическое лицо / ИП"===t,Un=d((e=>{const{button:t,regionSource:l}=e,[a,r]=n({key:""}),i=l?.regions??[],s=de({className:"text-white",version:t?.version}),d=i?.find((e=>e.name===a.key))?.href;return c("div",{className:"container space-y-s",children:[i?o(vl,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:i.map((({name:e=""})=>({key:e,text:e}))),value:a,onChange:r}):null,d?o("div",{className:"text-center",children:o(ye,{href:d,target:"_blank",className:p("p-m w-full @xl:w-auto",s),children:t?.text?t.text:"Перейти"})}):null]})})),Hn=d((({name:e,text:t,value:l,checked:n,onChange:a,className:r})=>o("div",{className:r,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:"appearance-none flex justify-center items-center shrink-0 w-5 h-5 border border-gray hover:border-primary-hover\n checked:border-2 checked:!border-primary-main focus:checked:border-primary-main focus:border-primary-text active:border-primary-text\n after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main outline-none rounded-full cursor-pointer",type:"radio",value:l,name:e,checked:n,onChange:e=>a(e.target.value),role:"radio"}),t?o(Ee,{color:"text-primary-text",children:t}):null]})}))),Wn=e=>{const{value:t,onChange:l}=e("vedTypes");return o(Sn,{children:c("div",{className:"gap-m grid @xl:flex @xl:items-center",children:[o(Hn,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:e=>l&&l(e)}),o(Hn,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:e=>l&&l(e)}),o(Hn,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:e=>l&&l(e)}),o(Hn,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:e=>l&&l(e)})]})})},Kn=({field:e})=>{const t="currencyControl"===e("vedTypes").value;return c("div",{className:"space-y-s",children:[t?o(xn,{field:e}):null,c("div",{className:"grid @xl:grid-cols-2 @xl:gap-x-m gap-s",children:[t?o(ml,{label:"ИНН",...Cl(e("inn"),Hl)}):null,o(ml,{label:"Наименование организации",...Cl(e("fullName"),Ol)}),o(ml,{label:"ФИО",...Cl(e("name"),Ul)}),o(yl,{label:"Телефон",...Cl(e("phone"),Wl)}),t?null:o(ml,{label:"Электронная почта",...e("email")})]})]})},qn={typeForm:{key:"KVED",text:"Заявка на консультацию ВЭД"},vedTypes:"currencyControl",fullName:"",name:"",phone:"",inn:"",email:"",partnerComments:""},Gn={fullName:Ol,name:Ul,phone:Wl},Yn=Nl({...Gn}),Xn=Nl({...Gn,inn:Hl,region:Ol}),Qn=e=>"currencyControl"===e,Zn=e=>({currencyControl:"currencyControl"===e,documentOperations:"documentOperations"===e,conversionTransactions:"conversionTransactions"===e,otherIssues:"otherIssues"===e}),Jn={ApplicationFormWed:d((e=>{const{button:t,link:l,onSubmit:n}=e,a=r((e=>{const{typeForm:t,fullName:l,name:a,phone:r,email:i,inn:s,region:o,vedTypes:c,partnerComments:d}=e,m={typeForm:t,fullName:l,name:a,phone:r,vedTypes:Zn(c),partnerComments:d,...Qn(c)?{inn:s,region:o}:{email:i}};wl((e=>Qn(e)?Xn:Yn)(c)(e))&&n(m)}),[n]),[,{field:i,...s}]=At(qn,{onSubmit:a});return c("form",{className:"container space-y-m",onSubmit:s.onSubmit,children:[Wn(i),o(S,{headingType:"h6",title:"Данные организации",className:"@xl:text-center"}),Kn({field:i}),o(ml,{label:"Обращение",placeholder:"Укажите интересующий вас вопрос, место ведения бизнеса и удобное время для телефонного звонка",...i("partnerComments"),isTextarea:!0}),jn(t),o(Vn,{link:l}),o(S,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex 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"})]})]})]})})),ApplicationFormGrantSupport:Un,ApplicationFormFeedback:$n},ea=Vt(),ta=St((({className:e,formBlock:t,...l})=>{const[a,i]=n(""),s=r((async(e,t=!1)=>{const l=na(e),n=await ea.send(l,t)?"OK":"Fail";return i(n),n}),[]);return o(x,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?.title?o(S,{headingType:"h3",title:t.title,className:"@xl:text-center"}):null,t?la(t,s):null,a?o(Pt,{responseType:a}):null]})})})),la=(e,t)=>{const l=e?.formType;if(!l||!(l in Jn))return null;return o(Jn[l],{...e,onSubmit:t})},na=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(t?.region?t?.text:t?.key)||t]))),aa=d((e=>{const{className:t,title:l,responseType:n,children:a,...r}=e;return o(x,{className:t,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[l?o(S,{headingType:"h3",title:l,className:"@xl:text-center"}):null,a,n?o(Pt,{responseType:n}):null]})})})),ra=e=>{const{acquiringType:t,onlineCheckout:l,posTerminal:n,amount:a,term:r,annualRevenue:i,serviceType:s,...o}=e,c=t||i?(e=>{const{acquiringType:t,onlineCheckout:l=!1,posTerminal:n=!1,term:a,amount:r,annualRevenue:i}=e;return t?`Вид эквайринга=${t?.text||""}${Zl(t?.key)?`/Онлайн касса=${l}/POS-терминал=${n}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${a}/Выручка=${i}`})(e):null,d={...o,...c?{partnerComments:c}:{}};return Object.fromEntries(Object.entries(d)?.map((([e,t])=>[e,("region"===e?t?.text:t?.key)||t])))},ia={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",middleName:"",phone:"",email:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e3,acquiringType:Xl[0],serviceType:vn[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentDataProcessing:!1},sa=(e,t="")=>{const l=Object.fromEntries(Gl(e).map((e=>[e,ia[e]])));return l?.serviceType&&"PREMIUMSERVICE"===t&&(l.serviceType=vn[1]),{...l,typeForm:{key:t,text:""}}},oa=Vt(),ca=d((({className:e,title:t,typeForm:l="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m})=>{const h=a?.flatMap((e=>e?.inputs))||[],u=sa(h,l),[g,x]=n(""),f=Nl((e=>{const t=Gl(e.filter((e=>"required"in e&&e.required)));return Object.fromEntries(t.map((e=>[e,Yl?.[e]])))})(h)),b=r((async e=>{if(!wl(f(e)))return"Fail";const t=ra({...e,...m}),l=await oa.send(t,"lead"===d)?"OK":"Fail";return x(l),l}),[]),[,{field:y,onSubmit:v}]=At(u,{onSubmit:b}),N=ma(h)?.name;return o(aa,{className:p(Mn,e),title:t,responseType:g,children:c("form",{className:"",onSubmit:v,children:[a.map(((e,t)=>c("div",{className:p(da(e.columns),"grid gap-x-m"),children:[e?.title?o("div",{className:"@xl:text-center @xl:col-span-2",children:e.title}):null,e?.inputs?.map(wn(y,l))]},`section-${t}`))),Dn(N?y("consentDataProcessing"):void 0,s,i)]})})})),da=e=>2===e?"@xl:grid-cols-2":"",ma=e=>e?.find((e=>"consentDataProcessing"===e?.name)),ha="text-left",ua={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},pa=d((({className:e,defaultIconSize:t=44,iconBgVersion:l="primary",size:n,icon:a,...r})=>{const i=String(n?.width||t);return a?o("div",{style:{width:`${i}px`,height:`${i}px`},className:p("rounded-icon object-fit flex justify-center items-center",ua[l],e),children:o(Y,{...r,width:"54%",height:"54%",name:a})}):null})),ga=d((({className:e="",title:t,benefitList:l,...n})=>c(x,{className:e,defaultPadding:"p-6xl",...n,children:[t?o(S,{headingType:"h3",as:"h2",className:ha,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(xa)}):null]}))),xa=({label:e,description:t,items:l,icon:n,iconBgVersion:a,isDotted:r=!1},i)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[n?.icon?o(pa,{className:"shrink-0",defaultIconSize:56,iconBgVersion:a||"",...n}):null,n?.src?o(ae,{className:"shrink-0",image:n}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(S,{headingType:"h6",children:e}),o(Ee,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),o(tt,{dotClassName:"bg-secondary-text",listItemSize:"S",items:l,isDotted:r})]}):null]},String(i)),fa=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function ba(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 ya=d((({className:e,style:t,idx:l,activeIndex:n,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:l}={}){const n=s(null),r=i((()=>({threshold:ba(t),root:l?.current})),[t,l?.current]);return a((()=>{if(!n.current)return;const t=new IntersectionObserver(e,r);return t.observe(n.current),()=>{t.disconnect()}}),[e,r]),n}(r((e=>{e.length&&m&&m(l||0,e[e.length-1])}),[m,l]),c);return o("div",{className:p("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(l===n),ref:h,role:"listitem",children:d})})),va=["min-w-full","@lg:min-w-[50%]","@lg:min-w-[33.3%]","@lg:min-w-[25%]"],Na=d((({className:e,itemClassName:t,containerRef:l,activeIndex:n,visibleItemCount:a=0,gap:i=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:u,onVisibleItemsChange:g,onVisibleIndicesChange:x})=>{const f={sensitivity:1,rootRef:l},b=s([]),y=r(((e,t)=>{const l=[...b.current||[]];l[e]=t,b.current=l,g&&g(l),x&&x(ka(l))}),[g,x]),v=a>0?i*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,k={...w?wa(c,v):{},...N?fa(h):{},gap:`${i}px`};return o("div",{className:p("box-border overflow-auto no-scrollbar",d,e),style:k,ref:l,role:"list",children:(C=(e,l)=>o(ya,{className:p(m,a?va[a-1]:"",N?"h-full":"",t),style:w?wa(c/4):{},activeIndex:n,idx:l,observerOptions:f,onIntersection:y,children:e},String(l)),e=>null==e?e:Array.isArray(e)?e.map(C):C(e,0))(u)});var C})),wa=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),ka=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Ca={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Sa={"horizontal-list":"w-6","vertical-list":"h-6"},Ta=d((({className:e="",containerRef:t,activeIndex:l,dotCount:n=0,listType:a="horizontal-list",version:r})=>n?o("div",{className:p("flex gap-xs",Ca[a],r?"group":"",e),"data-ver":r,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 group-data-transparent:bg-white ${n===l?Sa[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)),Ia=e=>e,Ba=(e=Ia)=>t=>t.reduceRight(((t,l)=>e(t)>e(l)?t:l)),Ma=Ba(),Va=(e=Ia)=>Ba((t=>-e(t))),Ra=Va(),Pa=e=>t=>e.scrollWidth/t,za=e=>(t,l)=>{e.scrollBy({left:l*Pa(e)(t),behavior:"smooth"})},Aa=({itemCount:e,onVisibleIndicesChange:t})=>{const l=s(null),[a,i]=n([]),o=r((e=>{i((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?[Va()(a),Ba()(a)]:[-1,-1],m=c>0,h=d<e-1,u=r((()=>{var t;l.current&&(m?za(l.current)(e,-1):(t=l.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=r((()=>{l.current&&(h?za(l.current)(e,1):l.current.scrollTo({left:0,behavior:"smooth"}))}),[e,h]),g=r(((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}]},ja=d((({className:e,version:t,gap:l=14,padding:n=16,showDots:a=true,minHeight:r,children:i,onVisibleIndicesChange:s,listType:d="horizontal-list"})=>{const m=Array.isArray(i)?i.length:0,[h,u]=Aa({itemCount:m,onVisibleIndicesChange:s}),[g]=u.visibleIndicesRange;return c("div",{className:p(e,"vertical-list"===d?"relative h-full":""),children:[o(Na,{containerRef:h,activeIndex:g,visibleItemCount:1,gap:l,padding:n,onVisibleIndicesChange:u.handleVisibleIndicesChange,listType:d,minHeight:r,children:i}),a?o(Ta,{containerRef:h,activeIndex:g,dotCount:m,listType:d,version:t}):null]})})),Da=(e,t,l)=>{return o(ja,{children:e.map((n=l,({icon:e,title:t,description:l},a)=>c("div",{className:p("flex flex-col gap-1","justify-between p-m h-full border border-gray",l||t?"":"justify-center"),children:[t?o(Ee,{size:"text-h6",font:"font-normal",align:n,children:t}):null,e?o(ae,{image:e,height:"180",className:"w-auto mx-auto"}):null,l?o(Ee,{size:"text-h6",font:"font-normal",align:n,children:l}):null]},String(a))))});var n},Ea=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:l="",columnsCount:n="4",subtitle:a,title:r,...i})=>c(x,{className:p("space-y-3xl",l),defaultPadding:"p-6xl",...i,children:[o(B,{defaultPadding:"",title:r,description:a,headlineVersion:"M"}),e?.length?Da(e,0,t):null]}))),La={start:"justify-start",center:"justify-center",end:"justify-end"},$a=d((({buttons:e,className:t="",align:l,...n})=>{const a=l?p("flex",La[l]):"";return o(x,{className:p("!bg-transparent",a,t),defaultPadding:"p-0",...n,children:Ye(e)})})),Fa=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:l=!1,renderFoldableSection:a,renderFoldButton:i})=>{const[s,o]=n(l),d=r((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),h=i?i({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[h,m]}:{className:e,role:"group",children:[m,h]})}));const Oa=d((({className:e="",isUnfolded:t,children:l})=>{const n=s(null),r=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:r,children:l})})})),_a=d((({className:e,title:t,value:l,fractionDigits:n,fixed:a,prefix:r,postfix:i})=>c("div",{className:p("flex justify-between @xl:flex-col",e),children:[t?o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}):null,o("div",l?{children:o(Ee,{size:"text-h3",children:[r,lt(n,{fixed:a})(l),i].filter(Boolean).join(" ")})}:{children:o(Ee,{size:"text-h3",children:"-"})})]}))),Ua=Math.round(29.5),Ha={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Wa={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Ka={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},qa={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0},Ga={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Ya=(e,t)=>{const{travelExpenseValue:l,restExpenseValue:n}=e,[a,r]=((e,t,l)=>{const{maxBonus:n=5e3,prefMonthsNum:a=Ka.prefMonthsNum,prefTravelBonusRate:r=Ka.prefTravelBonusRate,prefRestBonusRate:i=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(r*t)+Math.round(i*l),n);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*l),n)*(12-a)]})(t||Ka,l,n);return{...t,...e,monthBonus:a,yearBonus:r}},Xa=e=>e?o(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e}):null,Qa=d((({rate:e=0,title:t="Ставка",unit:l,fractionDigits:n=2,depositeName:a,isShowDepositeName:r})=>c("div",{children:[o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}),c("div",{className:"relative",children:[c("div",{className:"flex justify-start gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]",children:lt(n,{fixed:!0})(e)}),l?o("span",{className:"text-7xl",children:l}):null]}),a&&r?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Za=d((({title:e="Ставка",isUnavailableByTerm:t=!1})=>c("div",{className:"space-y-s",children:[o(Ee,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(Y,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:t?c(T,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",o("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):o(T,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),Ja=({title:e="Ставка",rate:t=0,unit:l="%",fractionDigits:n=2,isUnknownRateShown:a=!0,...r})=>a&&0===t?o(Za,{title:e,...r}):c("div",{children:[o("div",{className:"hidden @xl:block",children:o(Qa,{title:e,rate:t,unit:l,fractionDigits:n,...r})}),o("div",{className:"@xl:hidden",children:o(_a,{title:e,value:t,postfix:l,fractionDigits:n,fixed:!0,...r})})]});function er({isShowItems:e=!0,step:t=1e3,...l}){const n=[`От ${lt(2)(l.min||0)} ₽`,`До ${lt(2)(l.max||0)} ₽`];return o(rn,{items:e?n:[],step:t,...l})}const tr=d((({className:e="",calcSource:t,buttons:l,footnote:n})=>{const[a,{field:r}]=At({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:i,maxSumTravel:s,minSumOther:d,maxSumOther:m,monthBonus:h,yearBonus:u}=Ya(a,t);return c("section",{className:p("flex flex-col justify-between @5xl:flex-row gap-y-4xl",e),children:[c("div",{className:"flex flex-col @xl:max-w-md gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0",children:[er({title:"Сумма покупок в категории путешествия, ₽",min:i,max:s,step:500,isShowItems:!1,...r("travelExpenseValue")}),er({title:"Сумма покупок в остальных категориях, ₽",min:d,max:m,step:500,isShowItems:!1,...r("restExpenseValue")})]}),h>=0?Ja({title:"Баллов за месяц",rate:h,fractionDigits:0,isUnknownRateShown:!1,unit:""}):null,c("div",{className:"flex flex-col gap-y-xl @xl:w-96",children:[u>=0?o(_a,{title:"Баллов за год",value:u}):null,Ye(l,{isVertical:!0}),Xa(n)]})]})})),lr=d((({className:e,inputChildren:t,rateChildren:l,resultChildren:n})=>c("section",{className:p("flex flex-col justify-between @5xl:flex-row gap-m",e),children:[o("div",{className:"flex flex-col gap-y-m sm:max-w-md gap-2xl",children:t}),o("div",{className:"border-b border-main-divider md:hidden"}),l,o("div",{className:"flex flex-col gap-2xl sm:w-96 max-w-full",children:n})]}))),nr=([e,t],l,n=[])=>l&&l[e]&&l[t]?{[e]:l[e],[t]:l[t]}:ar([e,t],n),ar=([e,t],l=[])=>({[e]:l.length?Ra(l.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:l.length?Ma(l.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),rr=(e,[t,l],n)=>e>=n[t]&&e<=n[l],ir=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,sr=(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)},or=(e,t=0)=>e?.sum?e.sum:t,cr=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,dr=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,mr={horizontal:"gap-5xl",vertical:"flex-col gap-s"},hr=d((({items:e,checkedItem:t,className:l,onChange:n,orientation:a="horizontal"})=>o("div",{className:p(`flex ${mr[a]}`,l),role:"radiogroup",children:e?.map((({id:e,text:l})=>o(Dl,{isRadio:!0,text:l,value:t===e,onChange:()=>n&&n(e)},String(e))))}))),ur=({items:e,title:t,mobileTitle:l=t,orientation:n="horizontal",value:a,radioGroupClassName:r,onChange:i})=>c("div",{className:"space-y-s",children:[t?o("div",{className:"hidden @5xl:block",children:o(Ee,{color:"text-secondary-text",font:"font-light",children:t})}):null,l?o("div",{className:"@5xl:hidden",children:o(Ee,{color:"text-secondary-text",font:"font-light",children:l})}):null,o(hr,{orientation:n,items:e,checkedItem:e[a?0:1].id,className:p("flex-col sm:flex-row",r),onChange:t=>i&&i(t===e[0].id)})]}),pr=e=>ur({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),gr=d((({className:e="",buttons:t,footnote:l,bottomFootnote:n,isShowDepositeName:a,defaultParams:r,calcSource:i})=>{const[s,{field:d}]=At({moneyValue:or(r,1e5),daysValue:cr(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),m=((e,t)=>{const{daysValue:l,moneyValue:n,isPartialWithdrawal:a,isReplenished:r,isMonthlyInterestPayment:i}=e,s=r||a,o=l<90||l>730;if(l<=30)return{...Ga,...e,isDisabledOperatingDeposit:o,isUnavailableByTerm:!0};const c=t?.rateRows?.find((e=>i===e.isMonthlyInterestPayment&&ir(s,e)&&rr(n,["minSum","maxSum"],e)&&rr(l,["minDays","maxDays"],e)))||Ga,{rate:d}=c,m=sr(d,e),h=n+m,u=t?.rateRows||[Ga];return{...c,...ar(["minSum","maxSum"],u),...ar(["minDays","maxDays"],u),...e,isDisabledOperatingDeposit:o,income:m,finalSum:h}})(s,i),{income:h,finalSum:u,rate:p,isUnavailableByTerm:g,depositeName:x}=m;return o(lr,{className:e,inputChildren:c("div",{children:[er({title:"Сумма, ₽",min:m.minSum,max:m.maxSum,...d("moneyValue"),value:m.moneyValue}),(f={title:"Срок, дней",min:m.minDays,max:m.maxDays,...d("daysValue"),value:m.daysValue},o(rn,{items:[`От ${dr(f.min||0)}`,`До ${dr(f.max||0)}`],step:1,...f})),c("div",{className:"flex flex-col sm:flex-row gap-y-4 gap-x-14",children:[xr(m,d),pr({title:"Выплата процентов",orientation:"vertical",...d("isMonthlyInterestPayment"),radioGroupClassName:"sm:flex-col"})]})]}),rateChildren:Ja({rate:p,depositeName:x,isShowDepositeName:a,isUnavailableByTerm:g}),resultChildren:c("div",{children:[fr(u,h),Ye(t,{isVertical:!0}),Xa(l),Xa(n)]})});var f})),xr=(e,t)=>c("div",{className:"space-y-s",children:[o(Ee,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-xl sm:gap-y-s",children:[o(Dl,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Dl,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),fr=(e,t)=>c("div",{className:"flex flex-col gap-2xl sm:gap-0 mb-lg",children:[o(_a,{title:"Доход в конце срока",value:t,postfix:"₽",prefix:"+"}),o(_a,{title:"Сумма в конце срока",value:e,postfix:"₽"})]}),br=e=>yr({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&yr({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&yr({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&yr({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),yr=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],vr=(e,t)=>{const{isAnnuity:l,moneyValue:n,monthsValue:a,moneyExtra:r}=t;if(0===e)return 0;if(l){const t=e/1200;return r?(n+r)*(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)},Nr=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,r=t?.rateRows||[Ha],i=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>br({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:s,maxSum:o}=nr(["minSum","maxSum"],i,r),{minMonths:c,maxMonths:d}=nr(["minMonths","maxMonths"],i,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a})=>e?.find((e=>br({row:e,userInputParams:t,paramsViewSettings:l})&&rr(n,["minSum","maxSum"],e)&&rr(a,["minMonths","maxMonths"],e)))||Ha)({rateRows:r,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a}),{rate:h}=m,u=vr(h,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:n,monthsValue:a,monthlyPayment:u}},wr=({min:e=0,max:t=0,availableMonths:l,...n})=>o(rn,{items:[`От ${kr(e)}`,`До ${kr(t)}`],step:1,...l?.length?{list:l}:{min:e,max:t},...n}),kr=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Cr=e=>ur({...e,radioGroupClassName:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Sr=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:a,defaultParams:r})=>{const[i,{field:s}]=At({moneyValue:or(r,2e5),monthsValue:cr(r,Ua),isAnnuity:Boolean(r?.isAnnuity),isInsurance:Boolean(r?.isEnableInsurance),isSalaryClient:Boolean(r?.isEnableSalaryClient),isPensionClient:Boolean(r?.isEnablePensionClient),isStateEmployee:Boolean(r?.isEnableStateEmployee)}),d=Nr(i,t,a),m=Cr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...s("isAnnuity")});return o(lr,{className:e,inputChildren:c("div",{children:[er({title:"Сумма кредита, ₽",step:500,min:d.minSum,max:d.maxSum,...s("moneyValue"),value:d.moneyValue}),wr({title:"Срок кредита, месяцев",min:d.minMonths,max:d.maxMonths,...s("monthsValue"),value:d.monthsValue}),Tr({...d,...a},s),o("div",{className:"sm:hidden",children:m})]}),rateChildren:Ja({rate:d.rate}),resultChildren:c("div",{children:[o(_a,{title:"Ежемесячный платёж",value:d.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:m}),Ye(l,{isVertical:!0}),Xa(n)]})})})),Tr=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Dl,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Dl,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Dl,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Dl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Ir=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let l=1;for(;l<t.length;){const[e,n]=t[l-1],[a,r]=t[l];n>=a?t.splice(l-1,2,[e,Math.max(n,r)]):l++}return t},Br=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,r=t?.rateRows?.[0]?Rr(t.rateRows[0].minMonths,t.rateRows[0].maxMonths):0,i=!l?.isShowMonthlyInterestPayment,s=!l?.isShowRemoteRegistration,o=t?.rateRows?.find((t=>Vr({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:i})&&Vr({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s})&&rr(n,["minSum","maxSum"],t)&&rr(a||r,["minMonths","maxMonths"],t)))||qa,{rate:c}=o,d=Mr(c,e),m=n+d,h=t?.rateRows||[qa];return{...o,...ar(["minSum","maxSum"],h),...ar(["minMonths","maxMonths"],h),availableMonths:Ir(h.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:r,income:d,finalSum:m}},Mr=(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],Rr=(e,t)=>e+Math.round((t-e)/2),Pr=d((e=>{const{className:t,calcSource:l,buttons:n,footnote:r,paramsViewSettings:i,defaultParams:s}=e,[d,{field:m}]=At({moneyValue:or(s,2e4),monthsValue:cr(s),isMonthlyInterestPayment:Boolean(s?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(s?.isRemoteRegistration)}),h=Br(d,l,i),{defaultMonth:u,rate:p,income:g,finalSum:x}=h,{onChange:f}=m("monthsValue"),{onChange:b}=m("moneyValue");return a((()=>{!d.monthsValue&&f&&f(u)}),[u]),a((()=>{b&&b(en(d.moneyValue,h.minSum,h.maxSum))}),[h.minSum,h.maxSum]),o(lr,{className:t,inputChildren:c("div",{children:[er({title:"Сумма, ₽",min:h.minSum,max:h.maxSum,...m("moneyValue"),value:h.moneyValue}),wr({title:"Срок, месяцев",min:h.minMonths,max:h.maxMonths,availableMonths:h.availableMonths,...m("monthsValue"),value:h.monthsValue}),zr({...h,...i},m)]}),rateChildren:Ja({rate:p}),resultChildren:c("div",{children:[o(_a,{title:"Доход в конце срока",value:g,postfix:"₽",prefix:"+"}),o(_a,{title:"Сумма в конце срока",value:x,postfix:"₽"}),Ye(n,{isVertical:!0}),Xa(r)]})})})),zr=(e,t)=>{return c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowMonthlyInterestPayment?pr({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment}):null,e.isShowRemoteRegistration?(l={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration},ur({...l,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]});var l},Ar=e=>jr({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&jr({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),jr=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],Dr=(e,t,l)=>{const{moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i}=e,s=t?.rateRows||[Wa],o=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>Ar({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:c,maxSum:d}=nr(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=nr(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i})=>e?.find((e=>Ar({row:e,userInputParams:t,paramsViewSettings:l})&&rr(n+i,["minSum","maxSum"],e)&&rr(r,["minSumOld","maxSumOld"],e)&&rr(i,["minSumExtra","maxSumExtra"],e)&&rr(a,["minMonths","maxMonths"],e)))||Wa)({rateRows:s,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i}),{rate:p}=u,g=vr(p,e),x=e.oldMonthlyPayment-g;return{...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i,monthlyPayment:g,benefit:x}},Er=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:a})=>{const[r,{field:i}]=At({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),s=Dr(r,t,a),d=Cr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...i("isAnnuity")});return o(lr,{className:e,inputChildren:c("div",{children:[er({title:"Остаток долга в других банках, ₽ ",step:500,min:s.minSum,max:s.maxSum-s.maxSumExtra,...i("moneyValue"),value:s.moneyValue}),er({title:"Ежемесячный платёж в других банках, ₽",step:500,min:s.minSumOld,max:s.maxSumOld,...i("oldMonthlyPayment"),value:s.oldMonthlyPayment}),wr({title:"Новый срок кредита, месяцев",min:s.minMonths,max:s.maxMonths,...i("monthsValue"),value:s.monthsValue}),Lr({...s,...a},i),s.isExtraMoney?er({title:"Дополнительная сумма, ₽ ",step:500,min:s.minSumExtra,max:s.maxSumExtra,...i("moneyExtra"),value:s.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:d})]}),rateChildren:Ja({rate:s.rate,fractionDigits:1}),resultChildren:c("div",{children:[o(_a,{title:"Ежемесячный платёж",value:s.monthlyPayment,postfix:"₽"}),s.benefit>0?o(_a,{title:"Выгода в месяц",value:s.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:d}),Ye(l,{isVertical:!0}),Xa(n)]})})})),Lr=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Dl,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Dl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Dl,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),$r={CreditCalculatorForm:Sr,DepositCalculatorForm:Pr,BusinessDepositCalculatorForm:gr,BonusCalculatorForm:tr,RefinancingCalculatorForm:Er},Fr=St((({className:e,calculatorTabs:t=[],...l})=>o(x,{className:e,defaultPadding:"p-0",...l,children:_r(t)}))),Or=e=>{const t=e.calculatorBlock?.calcType;if(!t||!(t in $r))return null;const l=$r[t];return c("div",{className:"p-xl",children:[e?.calculatorBlock?.title?o(S,{className:"mb-lg",title:e?.calculatorBlock?.title}):null,o(l,{...e.calculatorBlock,isMobile:!0})]})},_r=e=>{if(!e||!e.length)return null;return 1===e.length?Or(e[0]):e.map(((e,t)=>o(Fa,{isFoldButtonOnTop:!0,unfoldedByDefault:0===t,renderFoldableSection:({isUnfolded:t})=>o(Oa,{isUnfolded:t,children:Or(e)}),renderFoldButton:Ur(e)},t.toString())))},Ur=e=>({isUnfolded:t,onToggle:l})=>{const n=e.nav?.align||"text-left";return c("button",{type:"button",onClick:l,className:"w-full p-xl bg-primary-main flex items-center border-b border-white",children:[o("div",{className:"w-11 h-11 bg-white rounded-md flex justify-center items-center",children:o(Y,{name:e.nav?.icon?.icon,iconVersion:"color",width:"24",height:"24"})}),c("div",{className:"flex-1 flex flex-col pl-s",children:[o(Ee,{align:n,color:"text-white",children:e.nav?.title}),o(Ee,{align:n,size:"text-s",color:"text-white",font:"font-light",children:e.nav?.description})]}),o(Y,{name:t?"ArrowUpIcon":"ArrowDownIcon",iconVersion:"white",width:"24",height:"24"})]})},Hr=d((e=>{const{onChange:t,min:l,max:n,defaultValue:a="0",fractionDigits:i=0,...s}=e,c=Jl(e,{normalize:(e=a)=>l&&n?String(en(Number(Wr(e)),l,n)):Wr(e),format:lt(i)}),d=r((e=>t&&t(Wr(e))),[t]);return o($t,{onChange:d,...s,...c})})),Wr=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Kr=d((e=>o(Hr,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Ee,{size:"text-xl",font:"font-light",children:"₽"})})}))),qr={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Gr={amount:1500},Yr=d((({className:e="",title:t="Укажите сумму перевода",label:l="Сумма перевода",placeholder:r="1500",button:i,formType:s="private",...d})=>{const[{amount:m},{field:h}]=At(Gr),[u,g]=n(!1);return a((()=>{g(m<=0)}),[m]),c(x,{className:p("flex flex-col items-center",e),defaultPadding:"p-6xl",...d,children:[t?o(S,{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[s],children:[o(Kr,{valid:!u,placeholder:r,label:l,...h("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:m}),i?.text?o(An,{className:"w-full mt-lg",type:"submit",disabled:u,children:i.text}):null]})]})})),Xr=(e,t=0)=>{const{itemCount:l,visibleItemCount:a}=e,[i,s]=n(t),o=r((()=>s((e=>Math.min(e+1,l-1)))),[l]),c=r((()=>s((e=>Math.max(e-1,0)))),[l]),d=a?l>a&&i<l-a:i<l-1,m=i>0;return[i,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]},Qr=d((({className:e,disabled:t,...l})=>o(ye,{rounded:!0,className:p("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"})}))),Zr=d((e=>o(Qr,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Jr=d((e=>o(Qr,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),ei="absolute top-[calc(50%-24px)] z-40",ti="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",li=d((({scroll:e,activeIndex:t,itemCount:l,arrowsPadded:n,hasEdgeBlocks:a,onScrollLeft:i,onScrollRight:s})=>{const{canScrollLeft:d,canScrollRight:m,scrollLeft:h,scrollRight:u}=e,g=a?t>0:d,x=a?t<l-1:m,f=r((()=>{a?(d&&t!==l-1&&h(),i()):h()}),[h,i,a,d,t,l]),b=r((()=>{a?(m&&0!==t&&u(),s()):u()}),[u,s,a,d,t,l]);return c("div",{className:"m:hidden block",children:[ni(e),g?o(Zr,{className:p(ei,n?"left-1 m:left-8":"left-0"),onClick:f}):null,x?o(Jr,{className:p(ei,n?"right-1 m:right-8":"right-0"),onClick:b}):null]})})),ni=e=>c("div",{children:[e.canScrollLeft?o("div",{className:p(ti,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:p(ti,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),ai=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",ri=({className:e,text:t="ХИТ"}={})=>c("div",{className:p("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(Y,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(T,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),ii="relative h-full",si={small:"sm:min-w-64",normal:"sm:min-w-96",big:"sm:min-w-[515px]"},oi=({noCardBorder:e,activeIndex:t,cardSize:l="normal",...n})=>{const{blocks:a}=n.block||{},r=a?.some(mi);return A({...n,renderProps:(n,a,i)=>c("div",{className:ci(n,{someCardsHighlighted:r}),children:[R(n,a,{className:di(n,{someCardsHighlighted:r,showBorder:!e,cardSize:l}),blockIndex:i,isActive:i===t}),mi(n)?ri({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},ci=(e,{someCardsHighlighted:t})=>p(ii,t&&(mi(e)?"pt-3xl":"pt-3xl sm:pt-16")),di=(e,{someCardsHighlighted:t,showBorder:l,cardSize:n="normal"})=>p(ii,"min-w-80",si[n],t&&(mi(e)?"pt-3xl sm:pt-16":"pt-3xl"),ai(l),l&&"h-full"),mi=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,hi=St((({className:e,itemCount:t,visibleItemCount:l=0,noCardBorder:n,isAlignCenter:a,arrowsPadded:r=!0,isGap:i=!0,cardSize:s="normal",...d})=>{const{blocks:m=[]}=d.block||{},h=t||m?.length,[u,{inc:g,dec:f}]=Xr({itemCount:h,visibleItemCount:l},Math.floor(l/2)),[b,y]=Aa({itemCount:h}),[v]=y.visibleIndicesRange,N=m&&"CarouselBankHistoryCard"===m[0]?.type;return c(x,{className:e,defaultPadding:"p-6xl",...d,children:[c("div",{className:p(a?"flex justify-center":"","relative max-w-full"),children:[o(Na,{containerRef:b,visibleItemCount:l,snapAlign:"snap-start",gap:i?16:void 0,onVisibleIndicesChange:y.handleVisibleIndicesChange,children:oi({noCardBorder:n,activeIndex:u,cardSize:s,...d})}),o(li,{scroll:y,arrowsPadded:r,onScrollLeft:f,onScrollRight:g,hasEdgeBlocks:N,activeIndex:u,itemCount:h})]}),o(Ta,{className:"@5xl:hidden",containerRef:b,activeIndex:v,dotCount:h,listType:"horizontal-list"})]})}),{childrenTypes:["CarouselCard","CarouselBankHistoryCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),ui=d((({title:e,description:t,className:l})=>o(x,{className:l,defaultPadding:"p-6xl",children:o(B,{headlineVersion:"XS",title:e,description:t,align:"text-left",className:"text-primary-text",isEmbedded:!0})}))),pi="z-10 border border-solid w-full h-full",gi=p(pi,"absolute hidden @xl:block border-transparent"),xi=d((({className:e,title:t,description:l,button:n,...a})=>o(x,{className:p("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:p(gi,"top-9 right-12 bg-green-dark")}),o("div",{className:p(gi,"top-6 right-8 bg-green")}),o("div",{className:p(gi,"top-3 right-4 bg-green-light")}),c("div",{className:p(pi,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(B,{title:t,description:l,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Ye([n],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),fi={black:"bg-black",white:"bg-white"},bi=d((({className:e="",title:t,description:l,image:n,price:a,button:r,colors:i=[],align:s="text-left",padding:d,...m})=>o(x,{className:p("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Ce,{className:"h-full",padding:d,title:o(B,{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:Ye([r],{buttonClassName:"w-full self-end"}),children:[i?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Ee,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),i.map(yi)]}):null,a?c(Ee,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),yi=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${fi[e]}`},String(t)),vi="20",Ni="absolute w-full h-full border border-white",wi=d((({className:e="",icon:t,...l})=>{const n=ue(),{text:a,href:r,target:i,onClick:s}=n(l);return a?o("div",{className:p("flex relative group/link pl-s pb-s sm:pr-2xs min-w-64 sm:min-w-72",e),children:c("div",{className:"relative min-h-16 w-full pb-lg sm:pb-0",children:[c("a",{className:p("absolute border\n bg-white flex items-center justify-between group-hover/link:text-primary-main","flex rounded-md lg:rounded-none w-full w-full p-lg whitespace-nowrap z-10"),role:"link",href:r,target:i,onClick:s,children:[c("div",{className:"flex items-center space-x-lg",children:[t?o(ae,{imageClassName:"text-green-dark",image:t,width:vi,height:vi}):null,o(Ee,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})]}),o(ae,{className:"group-hover/link:brightness-100 sm:ml-2xs",image:{icon:"ArrowRightIcon",iconVersion:"color"},imageClassName:"group-hover/link:text-primary-main",width:vi,height:vi})]}),o("div",{className:p(Ni,"-bottom-1 -left-1")}),o("div",{className:p(Ni,"-bottom-2 -left-2")})]})}):null})),ki=d((({className:e,additionalDescription:t,description:l,links:n,title:a,...r})=>o(x,{defaultPadding:"p-5xl",className:p("overflow-hidden",e),...r,children:c("div",{className:"flex flex-col m:flex-row gap-s justify-between",children:[c("div",{className:"w-full m:w-1/3",children:[o(B,{isEmbedded:!0,title:a,description:l,as:"h1",align:"text-left"}),o(B,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),n?.length?Ci(n,"m:justify-self-end m:pt-s w-full m:w-2/3"):null]})}))),Ci=(e,t="")=>{const l=Math.ceil(e.length/3);return o(hi,{className:t,version:"secondary",itemCount:l,arrowsPadded:!1,padding:"p-0",visibleItemCount:0,children:Array.from({length:l}).fill(null).map(((t,l)=>o("div",{className:p("flex flex-wrap gap-2xs m:justify-center"),children:e.slice(3*l,3*(l+1)).map(((e,t)=>o(wi,{...e},String(t))))},String(l))))})},Si=d((({className:e="",href:t,target:l,isRemote:n=!1,children:a})=>{const r=ue({isRemote:n})({href:t,target:l});return o(t?"a":"div",{className:p("block",e),...t?r:{},role:t?"link":"none",children:a})})),Ti=[{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:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}}],Ii=e=>Ti.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{},Bi=d((({className:e="",media:t,showButtonText:l,stretched:a,version:r="white",children:i})=>{const[s,d]=n(),m=t?.map((e=>{const{href:t,icon:n,text:a}=e,{iconMapped:i}=Ii(t),o=Ge(n)?n:i,c=l?{text:a}:{text:""};return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:"color"},version:e?.version??r}})),h=p("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",a?"flex-1 justify-center":"");return c("div",{className:p("flex flex-col gap-xs",e),children:[o("div",{className:"flex gap-xs",children:Ye(m,{className:p(a||s?"basis-full":""),buttonClassName:h})}),i?o(Ee,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i}):null]})})),Mi=d((({className:e,padding:t,description:l,additionalDescription:n,href:a,icon:r,items:i=[],isDotted:s,socialMedia:d=[],target:m,title:h,align:u="text-left",benefits:g,imageOptions:{directionRight:f=!0,isImageAlwaysOnRight:b=false,isImageSecondary:y=!1}={},...v})=>o(x,{className:p("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...v,children:o(Si,{href:a,target:m,className:"h-full",children:c(Ce,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(B,{title:h,description:l,headlineVersion:"XS",isEmbedded:!0,align:u}),...ct(Ge(r)?o(ae,{image:r}):null,f),buttons:d.length?o(Bi,{media:d,showButtonText:!0,version:v?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(qe,{benefits:g}),o(tt,{items:i,isDotted:s,listItemSize:"S"}),Vi(n,u)]})})}))),Vi=(e,t)=>e?o(T,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Ri=(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(Ee,{size:"text-m",color:"text-secondary-text",children:l})}):null,n?o("div",{className:"mt-2xs",children:o(Ee,{size:"text-xl",color:"text-primary-text",children:n})}):null,a?.length?o("div",{className:"text-primary-main",children:Ye(a)}):null]},String(t))},Pi=d((({className:e="",title:t,align:l="text-center",icon:n,button:a,visibleCellsCount:r=1,cardCells:i=[],...s})=>{const d=i.map(Ri),[m,h]=r>0?[d.slice(0,r),d.slice(r)]:[d,[]];return c(x,{className:p("flex flex-col",e),defaultPadding:"p-2xl",...s,children:[Ge(n)?o("div",{className:"self-center",children:o(ae,{image:n})}):null,t?o(S,{className:p("pt-xs",l),headingType:"h5",title:t}):null,a?.text?o(ye,{className:"w-full mt-m mb-lg",...a}):null,h.length?o(Fa,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[m,o(Oa,{isUnfolded:e,children:h})]}),renderFoldButton:i.length>1?zi:null}):o("div",{children:m})]})})),zi=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:t,type:"button",children:[o("div",{children:e?"Скрыть":"Подробнее о тарифе"}),o(Y,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Ai=(e=!1)=>e?"text-white":"",ji=(e=!1)=>"text-s mb-m "+(e?"text-white":"text-secondary-text/80"),Di=d((({icon:e,image:t,title:l,subtitle:n,isFillGradient:a})=>c("th",{className:"space-y-4 flex flex-col items-start",children:[e?o(ae,{className:"h-16 w-16 min-w-16 min-h-16",image:e,width:"64",height:"64"}):null,t?.src&&o("div",{children:o(ae,{image:t})}),l?o(S,{headingType:"h4",className:Ai(a),title:l}):null,n?o("div",{className:ji(a),children:n}):null]}))),Ei=d((({cell:e,rowHeader:t,isFillGradient:l=!1})=>o("div",{className:"box-border flex flex-col",role:"cell",children:o("div",{className:p("h-full","border-main-divider border-b"),children:e?e.map(Fi(l,t)):null})}))),Li=(e=!1)=>""+(e?"text-white/80":"text-secondary-text"),$i=(e=!1)=>""+(e?"text-white":""),Fi=(e,t)=>({label:l,description:n},a)=>c("div",{className:"flex justify-between text-s py-s",children:[o(T,{size:"text-s",color:Li(e),children:t}),c("div",{className:"basis-1/2",children:[l?o("div",{className:"text-right",children:o(T,{size:"text-s",align:"text-right",color:$i(e),children:l})}):null,n?o("div",{className:"text-right",children:o(T,{size:"text-s",color:Li(e),children:n})}):null]})]},String(a)),Oi=d((({header:e,columnData:t,visibleRowLength:l=0,isFillGradient:n,showRow:a,onToggleColumn:r})=>{const i=t?.slice(0,a?t.length:l),s=n?"secondary":"primary";return o("tr",{className:"mb-m",children:c("td",{className:p("border border-gray rounded-md p-m",n?"bg-gradient-to-r from-main-gradient-start to-main-gradient-end":""),children:[o(Di,{...e,isFillGradient:n}),i?.length?i.map((({rowHeader:e,cell:t},l)=>o(Ei,{cell:t,rowHeader:e,isFillGradient:n},String(l)))):null,a&&e?.link?o(ye,{href:e.link.href,target:e.link?.target,version:s,ariaLabel:"Подробнее",className:"text-s font-medium mt-m p-s",children:e.link.text}):null,_i({onToggleColumn:r,isFillGradient:n,showRow:a})]})})})),_i=({onToggleColumn:e,isFillGradient:t,showRow:l})=>o("td",{className:"pt-lg",children:o("a",{role:"link",onClick:e,className:"cursor-pointer "+(t?"text-white/80":"text-primary-main"),children:o(Ee,{size:"text-s",font:"font-medium",children:l?"Скрыть":"Показать описание"})})}),Ui=d((e=>{const{className:t,title:l}=e;return c("section",{className:`bg-white font-sans p-6xl overflow-hidden text-primary-text relative space-y-lg ${t||""}`,children:[l?o(S,{headingType:"h3",className:"font-medium text-center",title:l}):null,o("table",{className:"border-separate",children:o(Hi,{...e})})]})})),Hi=d((({columns:e=[],rowHeaders:t,isColoredFirstColumn:l,visibleRowLength:a,orientation:i,...s})=>{const[c,d]=n(Array.from({length:e.length}).fill(!a)),m=r((e=>{const t=(t,l)=>l===e?!t:t;d((e=>e.map(t)))}),[]),h=r((()=>d((e=>Array.from({length:e.length}).fill(!1)))),[]),u=e?.map((({data:e,header:n},r)=>{return o(Oi,{visibleRowLength:a,showRow:c[r],header:n,columnData:(i=e,i?.map(((e,l)=>({cell:e,rowHeader:t?.[l]?.title})))),isFillGradient:0===r&&l,onToggleColumn:()=>m(r),...s},String(r));var i}));return o("tbody","horizontal"===i?{children:o(ja,{onVisibleIndicesChange:h,children:u})}:{children:u})})),Wi=e=>e%2!=0,Ki=d((({textNode:e,iconNode:t,tag:l,onClick:n,justifyContent:a="between",className:r,role:i,...s})=>c(l,{tag:l,className:p("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",r),onClick:n,role:i,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),qi=d((({className:e="",label:t,icon:l,dataTheme:n="",disabled:a=!1,onClick:r})=>o(Ki,{tag:"button",onClick:r,disabled:a,"data-theme":n,justifyContent:"center",role:"button",className:p("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(Ee,{size:"text-h4",children:t}),iconNode:l?o(ae,{image:{icon:l,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Gi=({isUnfolded:e,onToggle:t})=>o(qi,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Yi=d((({title:e,description:t})=>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(B,{title:e,description:t,headlineVersion:"S",isEmbedded:!0,align:ha})]}))),Xi=["ArrowDownIcon","ArrowUpIcon"],Qi="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box",Zi=d((({label:e="",blocksToRender:t=[],topItemsCount:l=0,block:n,notFound:a,...r})=>{const[i,s]=l>0?[t.slice(0,l),t.slice(l)]:[t,[]];return c("div",{children:[o("div",{className:p(t.length?"hidden":"block"),children:a?o(Yi,{...a}):null}),c("div",{className:p("space-y-2xs",t.length?"":"hidden"),children:[c("div",{className:p(Qi),children:[z(i,{...r.options,parent:n}),Wi(i.length)?o(It,{className:"col-span-6",...r}):null]}),o(Fa,{renderFoldableSection:({isUnfolded:e})=>c(Oa,{className:p(Qi),isUnfolded:e,children:[z(s,{...r.options,parent:n}),Wi(s.length)?o(It,{className:"col-span-6",...r}):null]}),renderFoldButton:({isUnfolded:t,onToggle:n})=>o(qi,{className:p(l<1?"hidden":""),disabled:!s?.length,label:e,icon:Xi[Number(t)],dataTheme:r.options?.page?.colorPalette,onClick:n})})]})]})})),Ji=d((({value:e,onChange:t,items:l=[],multiple:n})=>l.map((l=>o(hn,{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))))),es=({field:e,reset:t,filtrationSchema:l,resetButton:n,children: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-5xl",children:[a,Object.entries(l).map(ts(e))]}),n?o("div",{children:o(An,{type:"reset",className:"w-full @4xl:w-72 @4xl:ml-s",onClick:t,children:n?.text})}):null]}),ts=e=>([t,l])=>{const n=l?.type;return"array"===n?ls(t,e)(l):null},ls=(e,t)=>l=>{const n=l?.items?.enum?.map(((e,t)=>({value:e,title:l?.items?.enumNames?.[t]||""})))||[];return c("div",{children:[l?.title?o("div",{className:"mb-m",children:o(Ee,{size:"text-m",font:"font-light",color:"text-secondary-text",children:l.title})}):null,o(Ji,{items:n,multiple:!l?.single,...t(e)})]},e)};function ns(e,...t){return e.map(((e,l)=>[e,...t.map((e=>e[l]))]))}const as=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,rs=(e,t)=>Object.entries(e).map((([l,n])=>"number"==typeof n?Array.isArray(t[l])?((e,t)=>l=>as(t[e])||as(l[e])||l[e]?.includes(t[e]))(l,e):((e,t)=>l=>as(t[e])||as(l[e])||is(t[e])<=is(l[e]))(l,e):"object"==typeof n&&"min"in n&&"max"in n?((e,t)=>l=>as(t[e])||as(l[e])||is(t[e]?.min)>=is(l[e]?.min)&&is(t[e]?.min)<=is(l[e]?.max))(l,e):Array.isArray(n)?((e,t)=>l=>as(t[e])||as(l[e])||t[e]?.every((t=>l[e]?.includes(t))))(l,e):((e,t)=>l=>as(t[e])||as(l[e])||t[e]===l[e])(l,e))).every((e=>e(t))),is=e=>Number(e||0),ss=(e,{block:t,page:l,normalize:n=zt})=>{const a=t?.blocks||[],[r,{field:s,reset:o,update:c}]=At(e),d=i((()=>ns(a,a.map((e=>kt(e.content,l?.fallback))))),[a,l?.fallback]),m=r===e?a:((e,t)=>(l=zt)=>e?.filter((([,e])=>rs(t,l(e)||{}))).map((([e])=>e)))(d,r)(n);return[r,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},os=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,cs=(e,t)=>Array.from({length:t-e+1},((t,l)=>e+l)),ds=1e9,ms={sum:{min:1e4,max:ds},period:3},hs=St((({className:e,filtrationSchema:t={},resetButton:l,sumInput:n,periodInput:a,...r})=>{const[,{blocksToRender:i,blocksWithProps:s},{field:d,reset:m}]=ss(ms,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:us(e)})}),h=s.map((([,e])=>e?.paramsSource?.rateRows)),u=ps(h),g=c("div",{children:[o(Kr,{label:n?.title,min:500,max:ds,...d("sum",{parse:e=>({min:Number(e),max:ds}),format:({min:e})=>String(e)})}),o(rn,{title:a?.title,items:["От 3 мес","До 5 лет"],list:u,...d("period")})]});return c(x,{className:p("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[es({field:d,reset:m,filtrationSchema:t,resetButton:l,children:g}),o(Zi,{blocksToRender:i,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),us=e=>vt((e?.paramsSource?.rateRows||[]).filter(os).flatMap((e=>cs(e.minMonths,e.maxMonths)))),ps=e=>vt(e.flatMap((e=>e||[])).filter(os).flatMap((e=>cs(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],gs=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,xs=d((({className:e="",title:t,description:l,error:n,button:a,...r})=>c(x,{className:p("flex flex-col justify-center items-center",e),defaultPadding:p("p-6xl"),version:"transparent",...r,children:[o("div",{className:"flex justify-center",children:gs(n)}),o(B,{title:t,description:l,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ye,{version:a?.version,text:a?.text,...a}):null]}))),fs="location";function bs(e="Москва"){const[t,l]=((e,t,l)=>{const[i,s]=n(l||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[i,r((l=>e.fire(t,l)),[e,t])]})(h,"location",vs()??{name:e}),i=r((e=>{Ns(e),l(e)}),[]),{data:s}=Ml(ys()?null:"/api/v1/region",yt);return a((()=>{s&&!ys()&&l(s)}),[s]),[t??{name:e},i]}const ys=()=>Boolean(globalThis.localStorage?.getItem(fs)),vs=()=>{try{const e=globalThis.localStorage?.getItem(fs);return e&&JSON.parse(e)}catch(e){return null}},Ns=e=>{try{globalThis.localStorage?.setItem(fs,JSON.stringify(e))}catch(e){}};var ws;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(ws||(ws={}));const ks=new Intl.NumberFormat("ru",{style:"currency",currency:ws.RUB}),Cs=e=>e?ks.format(e):"",Ss="text-left text-m font-light text-secondary-text",Ts=`${Ss} pl-5xl`,Is={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Bs=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:`h-fit w-fit ${e}`,children:[o("thead",{children:c("tr",{children:[o("th",{className:Ss,children:o(Ee,{size:"text-m",children:"Валюта"})}),o("th",{className:Ts,children:o(Ee,{size:"text-m",children:"Купить"})}),o("th",{className:Ts,children:o(Ee,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Ms)})]}))),Ms=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ae,{image:{icon:Is[t]},width:"24",height:"24"}):null,o(Ee,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl",children:o(Ee,{size:"text-h6",children:Cs(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl",children:o(Ee,{size:"text-h6",children:Cs(e?.buyExchangeRate)})})]},t)},Vs={icon:"GpsIcon"},Rs=d((({className:e="",address:t})=>c("div",{className:`flex gap-s ${e}`,children:[o(pa,{...Vs,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(T,{size:"text-l",color:"text-primary-main",children:t}):null,o(T,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Ps=(e,t,l)=>{const n=Number(zs(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)},zs=e=>e.replace(/[^\d.,]/g,"").replace(",","."),As=e=>{return(t=[[e=>e.value!==ws.RUB&&e.oppositeValue!==ws.RUB,()=>e.handleConvert(e.value,ws.RUB)],[e=>e.value===ws.RUB&&e.oppositeValue===ws.RUB,()=>e.handleConvert(e.value,ws.USD)],[e=>e.value===ws.RUB&&e.oppositeValue===ws.RUB,()=>e.handleConvert(e.value,ws.CNY)],[()=>!0,()=>e.handleConvert(e.value)]],e=>{const[,l]=t.find((([t])=>t(e)))||[];return l})(e)?.();var t};function js(e){const{placeholder:t,rates:l,selected:n,value:a,setValue:r,setSelected:i}=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($t,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:r}),s.length?o(qt,{isBorder:!1,onChange:e=>i(e.key),options:s,value:d}):null]})}const Ds=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:l,button:a})=>{const[i,s]=n({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||ws.RUB,selectBuy:l?.[0]?.currency?.currency||ws.USD}),d=r((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[js({placeholder:"Хочу продать",rates:l,selected:i.selectSell,setSelected:Es(i,d,l),value:i.inputSell,setValue:e=>$s(d,l)(e,i.selectSell,i.selectBuy)}),js({placeholder:"Получу",rates:t,selected:i.selectBuy,setSelected:Ls(i,d,t),value:i.inputBuy,setValue:e=>Fs(d,t)(e,i.selectBuy,i.selectSell)}),a?.text?o(ye,{text:a.text,version:a?.version,...a}):null]})})),Es=(e,t,l)=>n=>{t({selectSell:n}),As({value:n,oppositeValue:e.selectBuy,handleConvert:(n=e.selectSell,a=e.selectBuy)=>{$s(t,l)(e.inputSell,n,a)}})},Ls=(e,t,l)=>n=>{t({selectBuy:n}),As({value:n,oppositeValue:e.selectSell,handleConvert:(n=e.selectBuy,a=e.selectSell)=>Fs(t,l)(e.inputBuy,n,a)})},$s=(e,t)=>(l,n,a)=>{e({inputSell:zs(l),selectBuy:a});const r=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===n))?.buyExchangeRate;r&&e({inputBuy:String(Ps(l,r,n===ws.RUB)||"")})},Fs=(e,t)=>(l,n,a)=>{e({inputBuy:zs(l),selectSell:a});const r=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===n))?.saleExchangeRate;r&&e({inputSell:String(Ps(l,r,n===ws.RUB)||"")})};const Os=d((({className:e="",title:t="Курсы обмена валют",button:l,...n})=>{const[a]=bs(),r=function(e){const t=e?.code||"000",{data:l}=Ml(`/api/v1/exchangerates?regionCode=${t}`,yt);return l||{}}(a),i=_s(r?.exchangeRate?.currencies),s=i.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:ws.RUB}});const d=i.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:ws.RUB}}),o(x,{className:p("box-border min-h-80",e),...n,children:o(Ce,{className:"h-full",title:o(S,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap sm:flex-nowrap",children:[c("div",{className:"max-w-1/2",children:[i?o(Bs,{className:"mb-xl",exchangeCurrencyItems:i}):null,o(Rs,{address:r?.address})]}),i.length&&s.length&&d.length?o(Ds,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:l}):null]})})})})),_s=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Us=(e,t)=>o(pa,{...e,iconBgVersion:t,className:"shrink-0"}),Hs=d((({label:e,labelIconBgVersion:t,icon:l,onToggle:n,labelIcon:a})=>o(Ki,{tag:"button",className:p("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:[Us(a,t),e?o(Ee,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:l?o(Y,{name:l,iconVersion:"black",width:"24",height:"24"}):null}))),Ws=St((({className:e="",isExpanded:t,isFoldButtonOnTop:l=!0,label:n="Развернуть",labelIcon:a,labelIconBgVersion:r,foldButtonVersion:i="default",version:s,role:c,...d})=>o(x,{className:p("w-full","",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(Fa,{isFoldButtonOnTop:l,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(Oa,{className:p("gap-lg","flex flex-wrap group-last:last:pb-0"),isUnfolded:e,children:A({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ks({foldButtonVersion:i,label:n,labelIcon:a,labelIconBgVersion:r,isUnfolded:e,onToggle:t})})})),{childrenTypes:{exclude:["RollupItem"]}}),Ks=({foldButtonVersion:e,label:t,labelIcon:l,labelIconBgVersion:n,isUnfolded:a,onToggle:r})=>{const i=t||(a?"Скрыть":"Развернуть"),s=((e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon")(a);return"accordion"===e?o(Hs,{label:i,labelIcon:l,labelIconBgVersion:n,icon:s,onToggle:r}):o(qi,{label:i,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:r})},qs=d((({className:e="",items:t})=>c("div",{className:e,children:[t?.length?t.map(Gs):null,o(ye,{version:"primary",className:"w-full",href:"https://www.rshb.ru/natural/feedback/question",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"})]}))),Gs=(e,t)=>c("div",{className:"mb-m space-y-m",children:[o("div",{children:o(Ee,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Ys)})]},String(t)),Ys=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Xs(e.type,e.text)}),o(T,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Xs=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Qs(t)}`,children:o(Ee,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(T,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Qs=e=>e.replaceAll(/\D/g,""),Zs=["split_version","New","Old"],Js=d((({className:e="",index:t,text:l,...n})=>{const a=ue(),{href:r,target:i,onClick:s}=a(n);return o("a",{className:p("",e),href:r,target:i,onClick:s,children:l||`Документ ${t}`})})),eo=d((({title:e,links:t,className:l=""})=>c("div",{className:p("flex flex-col gap-4",l),children:[o(Ee,{size:"text-l",font:"font-normal",children:e}),t?.length?o("div",{className:"flex flex-col gap-lg",children:t.map(((e,t)=>o(Js,{className:"text-l font-light",index:t,...e},String(t))))}):null]}))),to=d((({className:e="",items:t,basePath:l})=>t?.length?o("ul",{className:p("flex flex-col",e),children:t.map(lo(l))}):null)),lo=e=>(t,l)=>{const{text:n,...a}=t,r=ue({isRemote:!(!E.BASE_PATH||!e)&&!E.BASE_PATH.startsWith(e),basePath:e}),{href:i,target:s,onClick:c}=r(a);return o("li",{className:"list-none my-xs",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:i,target:s||"_self",onClick:c,children:n||null})},`list_item_${String(l)}`)},no=d((({className:e="",index:t,...l})=>{const n=ue({isRemote:!0}),{href:a,target:r,text:i,onClick:s}=n(l);return o("a",{className:`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:r,onClick:s,children:i||`Документ ${t}`})})),ao=d((({className:e="",links:t})=>c("div",{className:p("@container",e),children:[o("div",{className:"pt-lg",children:o(Ee,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs pt-lg",children:t.map(((e,t)=>o(no,{index:t,...e},String(t))))}):null]}))),ro=St((({className:e,footer:t,...l})=>{const{topItems:n}=l.options?.page?.sitemap??{},{relatedEnterprises:a,contacts:i,socialMedia:s,mobileApps:d,horizontalNavigationTitle:m,documents:h}=t||{},u=r((()=>{const[e,t,l]=Zs;((e,t)=>{const l=globalThis.document?.cookie.split(";")??[],[,n]=l.map((e=>e.split("="))).find((([t])=>t.trim()===e))||[];t(n)&&(globalThis.document.cookie=`${e}=${t(n)}`)})(e,(e=>e?.replace(t,l)))}),[]);return c(x,{tag:"footer",className:e,defaultPadding:"p-4xl pb-24",...l,children:[o("div",{className:"mb-lg pb-xs border-b border-main-divider",role:"menu",children:io(n)}),o(qs,{className:"overflow-hidden",items:i}),c("div",{className:"mt-xl",children:[o(Bi,{className:"mb-xl",media:s,stretched:!0,children:"Соцсети"}),c("div",{className:"mb-xl",children:[o("div",{className:"flex flex-col gap-4 mb-xs",children:d?.map(so)}),o(Ee,{size:"text-s",font:"font-light",color:"text-secondary-text",children:"Мобильное приложение"})]})]}),o("div",{className:"py-lg border-t border-main-divider",children:o(Js,{text:"Вернуться на прежнюю версию сайта",className:"text-l font-light max-w-[292px]",href:"https://old.rshb.ru",onClick:u})}),o(eo,{className:"py-lg border-y border-main-divider",title:m,links:a}),o(ao,{links:h})]})})),io=e=>e?.filter((e=>e.icon)).map(((e,t)=>o(Ws,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:o(to,{items:e.items,basePath:j(e.href)})},String(t)))),so=({href:e="/",text:t},l)=>{const{label:n}=Ii(e);return o(ye,{className:"w-full",text:t||n,version:"secondary",href:e,target:"_blank"},String(l))},oo={width:"34",height:"34"},co={"bg-white":"color",transparent:"white"},mo={"bg-white":"text-primary-main",transparent:"text-white"},ho=(e,t,l)=>o(ae,t?.src?{image:t,className:mo[e],width:l?.width,height:l?.height}:{image:{icon:t?.icon||"LogoIcon",iconVersion:co[e]},className:mo[e],width:l?.width,height:l?.height}),uo={"bg-white":"text-primary-text",transparent:"text-white"},po=d((({className:e,href:t="/",logo:l,children:n,targetBlank:a,bgColor:r="bg-white",showTitle:i=!0})=>c("a",{className:p("inline-flex items-center font-sans no-underline",e),href:t,target:a?"_blank":"_self","aria-label":l?.title??"Россельхозбанк",children:[ho(r,l?.image,oo),i?n??o("div",{className:"ml-s",children:o(Ee,{font:"font-medium",color:uo[r],size:"text-s",children:l?.title??"Россельхозбанк"})}):null]}))),go={default:"px-5 bg-main-divider rounded hover:text-primary-main",transparent:"text-white hover:text-primary-hover"},xo=d((({bgColor:e,logo:t,alwaysShowLogo:l,internetBankUrl:n,version:a})=>{const i=u(),s=E.BASE_PATH?.startsWith(i.pathname),d=r((()=>{i.back()}),[]);return c("div",{className:"flex items-center justify-between w-full",children:[l||s?o("div",{children:o(po,{className:"my-2xs",bgColor:e,logo:t})}):fo(d),n?o("div",{children:o(ye,{href:n,ariaLabel:"Войти",target:"_blank",className:p("p-s text-s whitespace-nowrap text-primary-main hover:text-primary-hover",go["transparent"===a?"transparent":"default"]),children:"Войти"})}):null]})})),fo=e=>o("div",{children:c("button",{className:"flex items-center text-l my-2xs","aria-label":"Вернуться назад",onClick:e,type:"button",children:[o(ae,{className:"w-6 h-6",image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24"}),"Вернуться назад"]})}),bo={"bg-white":"primary",transparent:"transparent"},yo=St((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:l=bo[e],portal:n,...a})=>{const{logo:r}=a.options?.page?.sitemap??{},{internetBankUrl:i}=n||{};return o(x,{tag:"header",defaultPadding:"",version:l,...a,children:o("div",{className:"container px-lg py-2xs box-border",children:o(xo,{bgColor:e,logo:r,alwaysShowLogo:t,internetBankUrl:i,version:l,...a})})})})),vo={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},No=St((({className:e="",padding:t="p-0",gap:l="",isInnerPadding:n=!0,version:a="transparent",isTheme:r=!1,isCardBorder:i=!1,image:s,...c})=>{const d=u();return o(x,{className:p("relative flex flex-col",vo[l],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:r,...c,children:A({...c,extraProps:{className:p("w-full",ai(i)),padding:n?"":"p-0"}})})}),{childrenTypes:[]}),wo=St((e=>o(No,{...e})),{childrenTypes:[]}),ko=d((e=>{const{className:t,image:l,...n}=e;return o(x,{className:t,defaultPadding:"p-0",...n,children:o(ae,{image:l})})})),Co=["байт","Кб","Мб","Гб","Тб","Пб"],So=d((({icon:e,text:t,href:l,target:n,fileFormat:a,fileSize:r})=>{const i=r&&a?",":"",s=r??"",d=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,children:[e,t?c(Ee,{size:"text-l",font:"font-light",children:[t," ",To(s,d),o(Ee,{color:"text-secondary-text",children:l&&`${s+i+d}`})]}):null]})})),To=(e,t)=>e||t?o("span",{children:", "}):"",Io={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Bo=d((({className:e="",title:t,description:l,align:n="text-center",documents:a,icon:r={icon:"DocIcon"},columnsMode:i="double",...s})=>{const d=u();return c(x,{className:p("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(B,{title:t,description:l,align:n,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:p("grid gap-xl","double"===i?"@md:grid-cols-2":"grid-cols-1",Io[i]),role:"list",children:a.map(Mo(d,r))}):null]})})),Mo=(e,t)=>(l,n)=>{if(""===l?.docType)return null;const a="Attachment"===l?.docType?K(e)(l?.attachment?.src):l?.href,r="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))} ${Co[l]}`})(l?.attachment?.fileSize||0):l?.fileSize,i="Attachment"===l?.docType?Vo(a):l?.fileFormat;return o("div",{role:"listitem",children:o(So,{text:l?.text,target:l?.target,href:a,fileFormat:i,fileSize:r,icon:t?o(ae,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:t,width:"24",height:"24"}):null})},String(n))},Vo=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},Ro=d((({className:e,padding:t,align:l="text-left",buttons:n=[],description:a,image:r,items:i,qr:s,additionalDescription:d="",title:m="Мобильное приложение",version:h="primary",...u})=>{const g="secondary"===h?"p-m min-w-32":"min-w-24",f=r?.src?o(ae,{className:"hidden lg:block",image:r}):null;return o(x,{className:p("min-h-80",e),padding:"p-0",version:h,...u,children:c(Ce,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(S,{headingType:"h3",title:m,className:p("whitespace-pre-wrap",l)}),rightImage:f,buttons:Ye(n,{className:"flex-wrap"}),children:[a?o(Ee,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:p("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[o(tt,{items:i,listItemSize:"M"}),o(Ee,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:d}),s?.src?o("div",{className:p("flex justify-center bg-white rounded-md @xl:-order-1",g),children:o(ae,{className:"w-fit",image:s})}):null,r?.src?o(ae,{className:"lg:hidden",image:r}):null]})]})})})),Po={primary:"bg-white/30",secondary:"bg-main-divider"},zo={primary:"text-white",secondary:"text-secondary-text"},Ao=d((({count:e,version:t="secondary"})=>o("div",{className:p("w-6 h-6 rounded-full flex items-center justify-center",Po[t]),role:"status",children:o(Ee,{size:"text-xs",color:zo[t],children:e})}))),jo=(e=[],t={})=>e.filter((({content:e={}})=>rs(t,e))).length,Do=(e,t)=>e===t;const Eo=(Lo=function(...e){return(t,l)=>e.some((e=>e(t,l)))}(Do,((e=Do)=>(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])=>Lo(l,t[e])))));var Lo;const $o=[],Fo={},Oo={default:"px-xs",underlined:"px-m",rounded:"px-lg rounded-md"},_o={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",rounded:"text-white"},Uo={default:"bg-white",underlined:"bg-white",rounded:"bg-transparent"},Ho={default:"sm:bg-primary-main",underlined:"bg-white",rounded:"bg-primary-main"},Wo=d((({tag:e="div",item:t={},isActive:l,type:n="default",onClick:a})=>{const r=e,{text:i,appendRight:s,...d}=t;return o(r,{className:p("h-12","block flex-1","cursor-pointer",Oo[n],l?Ho[n]:Uo[n]),role:"tab","aria-selected":l,onClick:a,...d,children:c("div",{className:p("h-full","flex justify-center items-center","text-center whitespace-nowrap",l?_o[n]:"text-secondary-text hover:text-primary-main"),children:[o(Ee,{size:"text-m",children:i}),s?o("div",{className:"ml-xs",children:s}):null]})})})),Ko=d((e=>o(e?.item?.href?qo:Go,{...e}))),qo=d((e=>{const t=ue(),l=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:n,...a}=t({...e.item,onClick:l});return o(Wo,{...e,tag:"a",item:a,onClick:n})})),Go=d((({item:e={},onClick:t,...l})=>{const n=r((()=>{t&&t(e)}),[t,e]);return o(Wo,{item:e,onClick:n,...l})})),Yo=(e,t,l)=>(n,a)=>o(Ko,{isActive:n===e,onClick:t,type:l,item:n},String(a)),Xo=d((({className:e,tabsType:t="default",items:l=[],value:n,onChange:a})=>o("div",{className:p("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tablist",children:l.map(Yo(n,a,t))}))),Qo={categories:[],extraOptions:[],propertyType:[],stage:[]},Zo=St((({className:e,hotFilters:t,filtrationSchema:l={},resetButton:n,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:u}]=ss(Qo,{block:a.block,page:a.options?.page}),g=r(((e=Qo)=>u(e)),[]),f=(({hotFilters:e=$o,filtrationState:t=Fo,blocks:l=$o,onFiltrationStateChange:n})=>{const a=i((()=>Math.max(0,e.findIndex((e=>Eo(e.filter,t))))),[e,t]),s=i((()=>e.map((t=>({text:t.text,appendRight:o(Ao,{version:t===e[a]?"primary":"secondary",count:jo(l,t.filter)})})))),[e,l,a]),c=r((t=>{n(e[s.indexOf(t)].filter)}),[e,s]);return{value:s[a],items:s,onChange:c}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:g});return c(x,{className:p("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Xo,{...f}),es({field:m,reset:h,filtrationSchema:l,resetButton:n}),o(Zi,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}});function Jo(e,t,l){t.geoObjects.removeAll();const n=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),a=new e.Clusterer({clusterIcons:[{href:"/icons/MapMarkerClusterIcon.svg",size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),r=l.map((({coords:t,content:l})=>new e.Placemark(t,{balloonContentHeader:l?.header,balloonContentBody:l?.body,balloonContentFooter:l?.footer,hintContent:l?.hint},{iconLayout:"default#image",iconImageHref:"/icons/MapMarkerSingleIcon.svg",iconImageSize:[78,84],iconImageOffset:[-35,-50]})));a.add(r),t.geoObjects.add(a),t.setBounds(e.util.bounds.fromPoints(l.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const ec={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center",font:"text-center font-sans"},tc=(e,t,l)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(ec).join(" ")} ${l}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.geoObjects.add(t.geoObjects)}))},children:o(Y,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),lc=e=>globalThis[e];const nc=()=>function(e,t){const[l,i]=n(),s=r((()=>i(lc(e))),[e]);return a((()=>{const l=document.getElementById(t);if(!l){const e=document.createElement("script");return e.src=t,e.async=!0,e.id=t,e.addEventListener("load",s),document.head.appendChild(e),()=>{document.head.removeChild(e),i(void 0)}}if(!lc(e))return l.addEventListener("load",s),()=>{l.removeEventListener("load",s)};s()}),[e,t]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${E.YANDEX_MAP_API_KEY||""}&lang=ru_RU`),ac={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center",font:"text-center font-sans text-l"},rc=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(ac).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(Y,{name:l,width:"20",height:"16"})})})),ic={border:"border border-transparent rounded-md ",position:"absolute flex items-center justify-center",size:"w-12 h-12",focus:"focus:border-primary-text focus:border",font:"text-center font-sans",active:"active:bg-primary-active",hover:"hover:bg-primary-hover",other:"select-none cursor-pointer"},sc=[55.753995,37.614069],oc=d((({points:e,className:t="",zoom:l=5})=>{const r=s(null),i=nc(),[d,m]=n();if(a((()=>{r?.current?i&&(Jo(i,r.current,e),e?.length||r.current.setCenter(sc)):i?.ready((()=>{r.current||(r.current=new i.Map("map",{center:e?cc(e):sc,zoom:l,controls:[],suppressMapOpenBlock:!0}),Jo(i,r.current,e))}))}),[i,r,e,l]),!i)return null;const h=d?"z-[100000]":"z-10";return c("div",{id:"map",className:p(!d&&"relative","w-full",t),children:[o("div",{className:p(Object.values(ic),h,"right-2 top-4 bg-white"),onClick:()=>{const e=r.current.container;d?e.exitFullscreen():e.enterFullscreen(),m(e.isFullscreen())},children:o(Y,{name:"FullScreenIcon",width:"16",height:"16"})}),c("div",{className:p("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(rc,{yandexMaps:r}),o(rc,{yandexMaps:r,direction:"out"})]}),tc(r.current,i,p("right-2 top-80",h))]})})),cc=e=>[mc(dc(e,0)),mc(dc(e,1))],dc=(e,t)=>e.map((e=>e.coords[t])),mc=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,hc={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных"},uc=(e,{field:t,reset:l})=>c("div",{className:"pb-2xl",children:[e?.length?o("div",{className:"flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",children:e.map((e=>o(Dl,{text:hc[e],...t(e)},e)))}):null,o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:l,text:"Очистить фильтр",appendRight:o(Y,{name:"CloseIcon",width:"16",height:"16"})})]}),pc=()=>{},gc=()=>[],xc=d((({className:e,data:t=[],renderCard:l=pc,filterItems:n=gc,getBalloon:a=pc,initFilterState:r={},descriptionData:s,title:d})=>{const[m,{field:h,reset:u}]=At(r),[g,x,f]=i((()=>{const e=n(t,m),l=e.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))).filter((e=>e.coords&&2===e.coords.length));return[e,l,e.length]}),[t,m]);return c("div",{className:p("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-6xl pb-0",children:[c("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:[o(S,{headingType:"h2",children:d}),f?o(Ee,{size:"text-h2",color:"text-secondary-text",children:`(${f})`}):null]}),s?fc(s):null,uc(Object.keys(r),{field:h,reset:u})]}),o("div",{className:"h-[600px]",children:o(b,{children:o(oc,{points:x,className:"h-full"})})})]}),g.map(l)]})})),fc=({__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(je,{__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(Ee,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,bc={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"}},yc=d((({className:e,children:t,color:l="gray"})=>c("div",{className:p("pt-2xl sm:p-s sm:border sm:border-gray rounded-md flex items-center",bc[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(Ee,{size:"text-m",color:bc[l].text,children:t})]}))),vc=d((({value:e,subText:t,children:l,...n})=>{const a=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[a.length,l,t].every((e=>!e))?null:Nc({textItems:a,subText:t,children:l,...n})})),Nc=({label:e,labelSize:t="text-m",textItems:l,subColor:n,subText:a,className:r,children:i})=>c("div",{className:p("flex gap-2xl sm:gap-2xs flex-col h-full max-w-[300px]",r),children:[e?o(Ee,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,i||l.filter(Boolean).map(((e,t)=>o(Ee,{size:"text-l",children:e.trim()},String(t)))),a?o(Ee,{color:n,size:"text-m",children:a}):null]}),wc=d((({className:e,children:t})=>o("div",{className:p("sm:flex sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),kc=["ArrowDownIcon","ArrowUpIcon"],Cc=["Подробнее","Скрыть"],Sc=({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:Cc[Number(e)]}),o(Y,{className:"text-primary-text",name:kc[Number(e)],width:"16",height:"16"})]}),Tc=({location:e,address:t,billAcceptorType:l,terminalType:n,billAcceptorEnable:a,atmCode:r="",atmAccess:i="",workTime:s},d)=>{const m=[{label:"Устройство",value:Mc(n)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===l?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(i)?"Общедоступный":""},{label:"Регистрационный номер",value:r}];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(Ee,{size:"text-h4",children:Mc(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ee,{size:"text-l",children:t})]}):null]}),o(yc,{color:"green",children:Mc(s)})]}),o("div",{className:"hidden sm:block",children:o(wc,{className:"flex-wrap",children:m?.map(Bc)})}),o(Fa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Oa,{isUnfolded:e,children:o(wc,{className:"flex-wrap",children:m?.map(Bc)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sc({isUnfolded:e,onToggle:t})})]},String(d))},Ic=({address:e="",terminalType:t,atmCode:l=""})=>({header:`${Mc(t)} №${l}`,body:e.toUpperCase()}),Bc=(e,t)=>o(vc,{...e},String(t)),Mc=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Vc=[];const Rc=async e=>await bt(e,{method:"GET"})||Vc,Pc={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1},zc={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable)},Ac=d((({data:e,className:t})=>{const[l]=bs(),n=function(e){const{data:t=Vc}=Ml(`/api/v1/atms?regionCode=${e}`,Rc);return t}(l?.code??"000");return o(xc,{className:t,filterItems:jc,data:n,initFilterState:Pc,renderCard:Tc,getBalloon:Ic,title:`Банкоматы филиала ${l?.name}`,descriptionData:e})})),jc=(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=>zc[t](e))),l=!n.length||n.some((t=>zc[t](e)));return t&&l}))},Dc=e=>{const t=Lc(e);return o(vc,{label:"Режим работы",value:t,className:"max-w-none"})},Ec=({workTime:e="",lunchHour:t="",daysOff:l=""},n=!1)=>e?[`${n?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",l?`не работает: ${l}`:""].filter(Boolean).join("; "):"",Lc=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[Ec({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:l?"":n}),Ec({workTime:l?.workTime,lunchHour:l?.lunchHour,daysOff:n},!0)].filter(Boolean)},$c=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Fc=e=>$c.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??"")}}))),Oc=e=>{if(!e)return null;const t=_c(e);return c(wc,{className:"border-none",children:[o(vc,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Uc)})}),o(vc,{label:"Режим работы",className:"max-w-none",children:o(Ee,{children:e})})]})},_c=e=>{const t=$c.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},Uc=({short:e,status:t},l)=>o("div",{className:p("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(Ee,{size:"text-xs",children:e})},String(l)),Hc=({currency:e,buyExchangeRate:t,saleExchangeRate:l},n)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(vc,{label:"Валюта",value:e.currency}):null,t?o(vc,{label:"Купить",value:String(t)}):null,l?o(vc,{label:"Продать",value:String(l)}):null]},String(n)),Wc=(new Date).getDay(),Kc=e=>{const[t]=e?.slice(Wc-1)??[];if(!t)return null;const{lunchHour:l,status:n,workTime:a,hasLunch:r}=t;return n?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(yc,{color:"green",children:a}):null,l&&r?o(yc,{color:"yellow",children:`перерыв: ${l}`}):null]}):o(yc,{color:"red",children:"Выходной"})},qc=({lunchHour:e,hasLunch:t=!1,status:l=!1})=>l?e&&t?`Перерыв ${e}`:e:"Не работает",Gc=({title:e,status:t,workTime:l,lunchHour:n,hasLunch:a},r)=>o(vc,{label:e,value:t&&l?l:"",subText:qc({lunchHour:n,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(r)),Yc=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Xc=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${e}</p>`,Qc=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Zc=({name:e,address:t,phone:l,fax:n,phoneBusiness:a,phoneNatural:r,phoneCallCentre:i,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},h)=>{if(!d)return null;const u=Fc(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(Ee,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(Y,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ee,{size:"text-l",children:t})]}):null]}),Kc(u)]}),o("div",{className:"hidden sm:block",children:Jc({phone:l,fax:n,phoneBusiness:a,phoneNatural:r,phoneCallCentre:i,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Fa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Oa,{isUnfolded:e,children:Jc({phone:l,fax:n,phoneBusiness:a,phoneNatural:r,phoneCallCentre:i,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sc({isUnfolded:e,onToggle:t})})]},String(h))},Jc=({phone:e,fax:t,phoneBusiness:l,phoneNatural:n,phoneCallCentre:a,phoneCurrencyControl:r,workSchedule:i,exchangeRate:s})=>{const d=Fc(i),m=i?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(wc,{className:"flex-wrap",children:[o(vc,{label:"Факс",value:t}),o(vc,{label:"Телефон филиала",value:e}),o(vc,{label:"Для обращений юридических лиц",value:l}),o(vc,{label:"Обслуживание физических лиц",value:n}),o(vc,{label:"Для консультаций по валютному контролю",value:r}),o(vc,{label:"Контакт-центр",value:a})]}),i?.isMatchesPattern?o(wc,{children:o(vc,{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(Gc)})})}):c(wc,{children:[o(vc,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Uc)})}),Dc(d)]}),i?.businessScheduleVisibleTag?Oc(i?.businessScheduleDescription):null,s?.currencies?.length?o(wc,{className:"flex-wrap",children:s?.currencies?.map(Hc)}):null]})},ed=({name:e="",address:t="",workSchedule:l})=>{const n=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const r=`${t} ${(e=>{const t=Fc(e),l=e?Lc(t):"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&!e.businessScheduleDescription?Yc(l):Xc(l):Qc(l):null})(l)}`;return{header:n,body:r}},td=[];const ld=async e=>await bt(e,{method:"GET"})||td,nd={workingSaturday:!1},ad={workingSaturday:e=>Boolean(e.workSchedule?.workingSaturday)},rd=d((({className:e})=>{const[t]=bs(),l=function(e){const{data:t=td}=Ml(`/api/v1/branches?regionCode=${e}`,ld);return t}(t?.code??"000");return o(xc,{className:e,filterItems:id,data:l,initFilterState:nd,renderCard:Zc,getBalloon:ed,title:`Офисы филиала ${t?.name}`})})),id=(e,t)=>{const l=Object.keys(t).filter((e=>t[e]));return e.filter((e=>l.every((t=>ad[t](e)))))},sd=d((({data:e,className:t,...l})=>{const n=e?.dataType??"offices";return o(x,{version:"transparent",className:p(t),defaultPadding:"p-0",...l,children:"offices"===n?o(rd,{}):o(Ac,{data:e})})})),od=d((({className:e,title:t,description:l="Блок в разработке...",...n})=>c(x,{className:p("box-border",e),...n,children:[o(B,{className:"max-w-[600px]",title:t,description:l,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(y,{})]}))),cd=d((({className:e,padding:t,slides:l=[],...n})=>o(x,{className:p("overflow-hidden relative",e),padding:t,...n,children:o(ja,{gap:0,padding:0,children:l.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(ot,{className:"px-5 h-full",headlineVersion:"L",...e,...n})},String(t))))})}))),dd=d((({address:e,email:t,telephone:l,button:n,className:a="",__html:r,icon:i,title:s,version:d="primary",...m})=>c(x,{className:p("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(i)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ae,{image:i})}):null,s?o(S,{headingType:"h3",as:"h3",title:s}):null]}),c("div",{className:"w-full space-y-m",children:[r?md(r):null,hd({label:"Адрес",data:e,iconName:"GeolocationIcon"}),hd({label:"Телефон(факс)",data:l,iconName:"PhoneIcon"}),hd({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),n?.text?Ye([n]):null]})]}))),md=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(je,{__html:e})}),hd=({label:e,data:t,iconName:l,dataColor:n=""})=>t?c("div",{className:"flex gap-s",children:[o(Y,{iconVersion:"black",name:l,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Ee,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Ee,{size:"text-xl",color:n,children:t})]})]}):null,ud=d((e=>{const{__html:t,richVersion:l,...n}=e;return o(x,{defaultPadding:"p-0",...n,children:o(je,{__html:t,richVersion:l})})})),pd=d((({className:e=""})=>{const[t,l]=n("option2"),a=r((e=>l(e)),[]);return c("div",{className:p("order-4",e),role:"radiogroup",children:[o(Hn,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(Hn,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),gd=d((({data:e,fieldLabel:t,fieldValue:l,selected:n,placeholder:a="",setSelected:r,label:i})=>{const s=e.filter(Boolean).map((e=>({key:e?.[l||t],text:e?.[t]}))),c=s.find((e=>e.key===n));return o(qt,{options:s,label:i,placeholder:a||n,onChange:e=>r(e.key),value:c})})),xd=d((({regions:e=[],selectedRegion:t,onSelectedRegion:l,branches:n=[],selectedBranch:a,onSelectedBranch:r})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(gd,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:l,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(gd,{data:n,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:r,label:"Отделение",placeholder:"Выберите отделение"})})]}))),fd=["От 1 дня","До 365 дней"],bd=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Ee,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(rn,{min:1,max:365,value:e,items:fd,onChange:t})]}))),yd=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:l,safeBoxCases:n=[],selectedBoxSize:a,onSelectedBoxSize:r})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(gd,{data:e,fieldLabel:"volume",selected:t,setSelected:l,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(gd,{data:n,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:r,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),vd=d((({regions:e,selectedRegion:t,branches:l,selectedBranch:n,days:a,selectedCaseVolume:r,selectedBoxSize:i,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:h})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(xd,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:l,selectedBranch:n,onSelectedBranch:Nd(m)}),o(bd,{days:a,setDays:e=>m({days:e})}),o(yd,{caseVolumes:d,selectedCaseVolume:r,onSelectedCaseVolume:wd(m),safeBoxCases:s,selectedBoxSize:i,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Ee,{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(pd,{}),o(ye,{text:"Офисы на карте",version:"primary",onClick:h,className:"order-6"})]})]}))),Nd=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},wd=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},kd=d((({days:e,tariffs:t=[]})=>{const l=Sd(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:[Cd("Аренда за",e),Cd("Цена",l+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(T,{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(T,{size:"text-s",font:"font-light",color:"text-white",children:n})})]})]})})),Cd=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Ee,{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})]}),Sd=(e,t)=>{const l=Td(e);return e*(t?.find((e=>e.tariffType===String(l)))?.tariffValue||0)},Td=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},Id=(e,t)=>e.find((e=>e.branchCode===t)),Bd=d((e=>{const{regions:t,data:l,branches:n,onChange:r,onClick:i}=e;a((()=>{r({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[l.selectedRegion,r]);const s=Id(n,l.selectedBranch),d=Md(s?.safeBoxCaseVolumes),m=Vd(s?.safeBoxCaseVolumes,l.selectedCaseVolume)?.safeBoxCases,h=Rd(m,l.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(vd,{...l,regions:t,onClick:i,branches:n,caseVolumes:d,safeBoxCases:m,onChange:r}),o(kd,{days:l.days,tariffs:h})]})})),Md=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Vd=(e,t)=>e?.find((e=>e.volume===t)),Rd=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Pd=[];const zd=async e=>await bt(e,{method:"GET"})||Pd,Ad=d((({title:e,footnote:t,className:l="",...a})=>{const[i,s]=n(!1),d=r((()=>s((e=>!e))),[]),[m,h]=n({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),u=gn(),p=jd(m.selectedRegion,u),g=function(e){const{data:t}=Ml(e?`/api/v1/safeboxes?regionCode=${e}`:null,zd);return t||Pd}(p),f=r((e=>h((t=>({...t,...e})))),[h]),b=(y=Id(g,m.selectedBranch)||g,Array.isArray(y)?y.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean)}))).filter((e=>e.coords&&2===e.coords.length)):y?.gpsLatitude&&y?.gpsLongitude?[{coords:[y.gpsLatitude,y.gpsLongitude]}]:[]);var y;return c(x,{className:l,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(S,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Bd,{regions:u,branches:g,data:{...m,selectedRegion:p},onClick:d,onChange:f}),t?o(T,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&i?o(oc,{points:b,className:"h-[640px]"}):null]})})),jd=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e;function Dd(e){throw new Error(e)}const Ed={normal:{icon:"h-11 w-11",image:"h-14 w-14"},small:{icon:"h-12 w-12",image:"h-14 w-14"}},Ld={normal:"",small:"min-h-6xl"},$d={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"},Fd=d((({className:e="",title:t,description:l,steps:n,buttons:a,size:r="normal",stepVersion:i="gray",version:s="primary",...d})=>c(x,{className:p("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:s,...d,children:[o(B,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),n?.length?o("div",{className:"box-border",children:o("div",{className:"flex flex-col gap-6xl justify-between",children:n.map(Od(r,i))})}):null,Ye(a,{isVertical:!0})]}))),Od=(e,t)=>(l,n)=>{const{type:a}=l;if("default"!==a&&"rte"!==a)return null;switch(a){case"default":return _d(e,t)(l,n);case"rte":return o(je,{__html:l.__html});default:Dd(l)}},_d=(e,t)=>(l,n)=>o("div",{className:"contents",children:c("div",{className:"flex flex-row items-center relative",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:Ud(e,t)(l,n)}),c("div",{className:p("flex flex-col justify-center h-fit",Ld[e]),children:[l.label?o(T,{size:"text-l",align:"text-left",children:l.label}):null,l.description?o("div",{className:p("text-s font-light text-left",$d.description),children:l.description}):null]})]})},String(n)),Ud=(e,t)=>(l,n)=>{const a="secondary"===t?"white":"color",r=Boolean(l?.icon?.src),i=Ed[e][r?"image":"icon"],s=r?"transparent"===t:t;return o(x,{className:p(i,"z-10 mr-s flex justify-center content-center rounded-md"),defaultPadding:"",version:s,children:o("span",{className:"flex max-w-full max-h-full items-center justify-center",children:Ge(l?.icon)?o(ae,{image:{...l.icon,iconVersion:l.icon?.iconVersion||a},imageClassName:"max-w-full max-h-full",width:Hd(e),height:Hd(e)}):o("span",{className:p("text-h4","transparent"===t?$d.iconText:(c=t,"secondary"===c?"group-data-primary:text-white":"text-secondary-text")),children:n+1})})});var c},Hd=e=>"normal"===e?"38":"24",Wd=e=>({href:t})=>!!t&&O(Kd(t,e)).startsWith(O(t)),Kd=(e,t)=>L(e)?t.href:t.pathname;function qd(e=[]){const t=u(),l=e.findIndex((e=>Wd(E.BASE_PATH?{pathname:E.BASE_PATH}:e))(t));return[l,e[l]]}const Gd=d((({isActive:e,onClick:t})=>c("button",{className:p(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),onClick:t,type:"button",children:[o(Y,{className:"w-6 h-6",name:"BurgerIcon",iconVersion:e?"color":"black"}),"Меню"]}))),Yd=d((({isActive:e,item:t,onClick:l})=>{const n=ue({isRemote:!0}),{href:a,onClick:r}=n({href:t?.href,onClick:l});return c("a",{className:p(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),href:a,target:"_self",title:t?.title||"",onClick:r,children:[o(Y,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]})}));const Xd=({onCloseAll:e,onClose:t}={})=>{const[l,{push:i,pop:s,clear:o}]=function(e=[]){const[t,l]=n(e),a=r((e=>l((t=>[...t,e]))),[]),i=r((()=>l((e=>e.slice(0,-1)))),[]),s=r((e=>l((t=>t.filter((t=>t!==e))))),[]),o=r((()=>l([])),[]);return[t,{setList:l,push:a,pop:i,remove:s,clear:o}]}(),c=r((()=>{e&&e(l),o()}),[l,e]),d=r((()=>{t&&t(l[l.length-1]),s()}),[l,t]);return a((()=>h.subscribe("dialog",(e=>{switch(e.type){case"open":i(e);break;case"close":e.all?c():d();break;default:Dd(e)}}))),[c,d]),l},Qd=d((({className:e,onClose:t})=>o("button",{className:p("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(ae,{image:{icon:"CloseIcon"},width:"24",height:"24"})}))),Zd=d((({className:e,head:t,children:l,onClose:n})=>{const{close:a}=me(),i=r((()=>{a(),n&&n()}),[n]);return c("div",{className:p("relative min-h-full bg-white pt-0 p-5",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Qd,{className:"absolute top-0 right-0",onClose:i}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:l})]})})),Jd=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 r=0;for(let i=0;i<e.length;i++){const s=Math.max(0,i-l),o=Math.min(i+l,t.length-1);for(let l=s;l<=o;l++)n[i]||a[l]||e[i]!==t[l]||(r++,n[i]=!0,a[l]=!0)}return{m:r,s1Matches:n,s2Matches:a}}(e,t);if(0===l)return 0;const r=function(e,t,{s1Matches:l,s2Matches:n}){let a=0;for(let r=0,i=0;r<e.length;r++){if(!l[r])continue;let s=i;for(;s<t.length;s++)if(n[s]){i=s+1;break}e[r]!==t[s]&&a++}return a}(e,t,{s1Matches:n,s2Matches:a}),i=(l/e.length+l/t.length+(l-r/2)/l)/3,s=i>.7?.1*function(e,t){let l=0;for(;e[l]===t[l]&&l<4;)l++;return l}(e,t):0;return i+s*(1-i)};const em=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(Ee,{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(tm,{...e},String(t))))})]}):null,tm=d((({icon:e,...t})=>{const l=ue(),{text:n,target:a,href:r,onClick:i}=l(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ae,{pathPrefix:"/wcms-resources/",image:e}):null,n?o("a",{className:"hover:text-primary-hover",href:r,target:a,onClick:i,children:o(Ee,{size:"text-l",font:"font-light",color:"text-primary-text",children:n})}):null]})})),lm=e=>t=>o("div",{className:"mb-xs sm:mb-2xs",children:o("button",{className:"cursor-pointer hover:text-primary-hover",onClick:()=>{e&&e(t)},type:"button",children:o(Ee,{size:"text-l",font:"font-light",children:t.name||""})})},t.id),nm=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:"h-12 pl-m w-full peer text-l text-black border border-solid rounded-md box-border\n outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text",value:t,onChange:e=>l(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),am=d((({foreignOffices:e,defaultLocation:t})=>{const[l,a]=bs(t),[i,s]=n(""),d=im(gn()).sort(((e,t)=>e.name.localeCompare(t.name))),m=((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})(d,rm),{close:h}=me(),u=r((e=>{a(e),h()}),[]);return c(Zd,{className:"pb-20",head:c("div",{children:[o(Ee,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),l?c("div",{className:"mb-s",children:[o(Ee,{size:"text-l",font:"font-light",children:"Сейчас выбран: "}),o("button",{type:"button",onClick:()=>a(l),children:o(Ee,{color:"text-primary-main",children:l.name})})]}):null,o(nm,{onSearch:s,searchTerm:i})]}),children:[i&&i.length>=3?o("div",{children:d.filter((({name:e})=>e&&Jd(e.toLowerCase())(i.toLowerCase())>=.8)).map(lm(u))}):o("div",{className:"columns-1 sm:columns-5",children:Array.from(m.entries()).map((p=u,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Ee,{size:"text-h6",children:e})}),t.map(lm(p))]},e)))}),em(e)]});var p})),rm=e=>e.name?.charAt(0)||"",im=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),sm=d((({className:e,value:t,autoFocus:l,onChange:n,onFocus:a,placeholder:i="Поиск по сайту"})=>{const s=r((e=>{n&&n(e.target?.value||"")}),[n]);return c("div",{className:p("font-sans 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:p("h-14 w-full px-10 text-l text-black outline-none box-border border border-solid rounded-md","border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text"),value:t,type:"text",name:"search-bar-input",placeholder:i,autoFocus:l,onChange:s,onFocus:a})]})}));function om(e,t,l=300){a((()=>{const t=globalThis.setTimeout(e,l);return()=>{globalThis.clearTimeout(t)}}),t)}const cm=(e,t)=>(l,n)=>{for(const[a,r]of n)l.set(a,e(l.get(a)||t,r));return l},dm=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),mm=e=>t=>e.map((([e,l])=>[Jd(t)(e),l])).filter((([e])=>e>=.8)).map((([e,t])=>um(t,e))).reduce(cm(Math.max,0),new Map),hm=e=>t=>{return ns(t,t.map((({title:e})=>e)).map((e=>t=>{const l=dm(t||"");return l.length?Pe(e.map((e=>Ma(l.map(Jd(e)))))):0})(e))).sort((e=>(t,l)=>-e(t,l))((l=([,e])=>e,(e,t)=>l(e)-l(t)))).map((([e])=>e));var l},um=(e,t)=>new Map(e.map((e=>[e,t]))),pm=({basePathList:e,initialQuery:t=""})=>{const[l,r]=n(t||"");a((()=>{null!=t&&r(t)}),[t]);const{data:i}=Ml(e?.length?e:null,gm),[s,o]=n(null);return om((()=>{i&&o(i.map((e=>t=>{const{corpus:l,dictionary:n}=t||{};if(!(e&&l?.length&&n&&Object.keys(n).length))return[];const a=dm(e);if(!a.length)return[];const r=Object.entries(n),i=[...a.map(mm(r)).reduce(cm(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>l[e]));return hm(a)(i)})(l)))}),[i,l]),[s,{value:l,onChange:r}]},gm=async(...e)=>(await Promise.allSettled(e.map((e=>bt(_(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),xm=d((({className:e,topItems:t})=>{const l=ue({isRemote:!0});return o("div",{className:p("flex items-start justify-between",e),children:t?.map(l).map(bm)})})),fm=["all","footer"],bm=(e,t)=>{const{text:l,items:n=[],href:a,target:r,onClick:i}=e,s=n.filter((e=>!e.displayArea||fm.includes(e.displayArea.toLowerCase())));return c("div",{className:"flex flex-col gap-s w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:r||"_self",onClick:i,children:l||`Раздел ${t}`}),s.map(((e,t)=>o(ym,{...e,basePath:j(a),index:t},String(t))))]},String(t))},ym=d((({text:e,index:t,basePath:l,...n})=>{const a=ue({isRemote:!(!E.BASE_PATH||!l)&&!E.BASE_PATH.startsWith(l),basePath:l}),{href:r,target:i,onClick:s}=a(n);return o("a",{className:p("text-l font-light text-secondary-text hover:text-primary-main no-underline","overflow-x-hidden overflow-ellipsis whitespace-nowrap"),href:r,target:i||"_self",onClick:s,children:e||`Раздел ${t}`})})),vm=d((({initialQuery:e,topItems:t})=>{const l=i((()=>t?.map((e=>e.href||"/"))),[t]),[n,a]=pm({basePathList:l,initialQuery:e}),r=i((()=>Nm(t)(n)),[t,n]);return o(Zd,{head:o(sm,{autoFocus:!0,...a}),children:o(xm,{topItems:r})})})),Nm=e=>t=>e?.length&&t?.length?ns(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:_("/",t)})))}))):[],wm=d((({className:e,...t})=>{const[l,a]=n(""),i=r((()=>a("")),[]),s=((e={})=>{const{open:t,close:l}=me();return{open:(l={},n={})=>t(o(vm,{...e,...l}),n),close:l}})(t),d=r((e=>{a(e),km(e)&&s.open({initialQuery:e},{onClose:i})}),[i,s]);return c("div",{className:p("relative",e),role:"search",children:[o(sm,{value:l,onChange:d}),o(Qd,{className:"absolute top-0 right-0 sm:hidden",onClose:i})]})})),km=e=>e&&e.length>=3,Cm=d((({item:e,basePath:t})=>{const l=ue({isRemote:!(!E.BASE_PATH||!t)&&!E.BASE_PATH.startsWith(t),basePath:t}),{href:n,target:a,onClick:r}=l(e),i=u(),s=Wd(i)({href:n});return c("a",{className:p(s?"text-primary-main":"text-primary-text","py-3 text-h5 font-light flex justify-between cursor-pointer"),href:n,target:a,onClick:r,children:[e.text,o(ae,{image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24",className:"text-secondary-text rotate-180 opacity-30"})]})})),Sm=({item:e,isActive:t,onClick:l})=>c("button",{type:"button",className:"relative",onClick:l,children:[o("span",{className:p("whitespace-nowrap",t?"text-primary-main":""),children:e.text}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent"}):null]}),Tm=d((e=>{const{topItems:t,defaultLocation:l,officesLink:s}=e,[d]=bs(l),m=(e=>{const{open:t,close:l}=me();return{open:(l={})=>t(o(am,{...e}),l),close:l}})(e),[h,u]=Aa({itemCount:t?.length??0}),[p]=qd(t),[g,x]=n(p),f=i((()=>t?.[g]),[t,g]),b=f?.items||[];a((()=>{x(p)}),[p]),a((()=>{g>0&&u.scrollTo(g)}),[g,u]);const y=r((e=>x(e)),[]);return o(Zd,{head:o("div",{className:"flex items-center",children:o(S,{as:"h4",title:"Меню"})}),children:c("div",{className:"flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md",children:[o("div",{className:"w-full mb-3",children:o(Na,{containerRef:h,visibleItemCount:0,gap:20,className:"pb-3",children:t?.map(((e,t)=>o(Sm,{item:e,isActive:g===t,onClick:()=>y(t)},String(t))))})}),c("div",{className:"relative grow overflow-auto",children:[Im(b,f?.href),o(wm,{className:"grow mb-5",...e}),Bm(s),Mm(d,(()=>m.open()))]})]})})})),Im=(e,t)=>e?o("div",{children:e.map(((e,l)=>o(Cm,{item:e,basePath:t},String(l))))}):null,Bm=e=>e?c("a",{className:"flex items-center mb-3",href:e,rel:"noopener noreferrer","aria-label":"Офисы и банкоматы",children:[o(ae,{image:{icon:"MapOpenedIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),o("span",{children:"Офисы и банкоматы"})]}):null,Mm=(e,t)=>c("div",{className:"flex items-center text-s cursor-pointer",onClick:t,children:[o(ae,{image:{icon:"GeolocationIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),c("div",{className:"flex flex-col items-start",children:[o(Ee,{size:"text-h5",children:e.name}),o(Ee,{color:"text-secondary-text",size:"text-s",children:"Ваша локация"})]})]}),Vm="burgerMenuDialog",Rm=e=>{const{open:t,closeAll:l,close:n}=me(),a=Xd(),r=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Vm,a),i=()=>t(o(Tm,{...e}),{id:Vm});return[r,{open:i,close:n,toggle:()=>{r?l():i()}}]},Pm=[],zm=St((({sticky:e,...t})=>{const{menuItems:l=Pm}=e??{},[n,{toggle:a,close:r}]=Rm(t.options?.page?.sitemap??{}),[,i]=qd(l),s=Math.floor(l.length/2),d=l.slice(0,s),m=l.slice(s);return o(x,{className:"h-[74px]",defaultPadding:"p-0",...t,children:c("div",{className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[d.map(Am(i,r)),o(Gd,{isActive:n,onClick:a}),m.map(Am(i,r))]})})})),Am=(e,t)=>(l,n)=>o(Yd,{isActive:l===e,item:l,onClick:t},l.href||String(n)),jm="hidden sm:flex absolute z-40 top-0",Dm=d((({className:e,items:t=[],value:l,onChange:n,tabsType:a})=>{const[r,i]=Aa({itemCount:t?.length||0});return c("div",{className:p("relative overflow-x-auto no-scrollbar",e),role:"tablist",children:[o(Na,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:i.handleVisibleIndicesChange,children:t.map(Yo(l,n,a))}),i.canScrollLeft?o(Zr,{className:p("left-6",jm),onClick:i.scrollLeft}):null,i.canScrollRight?o(Jr,{className:p("right-6",jm),onClick:i.scrollRight}):null]})})),Em=({tabsMode:e,...t})=>{switch(e){case"wideScreen":return o(Xo,{...t});case"centered":return o("div",{className:"flex",children:o(Xo,{className:"m-auto p-xs rounded-md bg-main-gray",tabsType:"rounded",...t})});case"scrollable":return o("div",{className:"flex",children:o(Dm,{className:"m-auto",tabsType:"underlined",...t})});default:return null}},Lm="tab",$m=d((({className:e="",isSticky:t,tabs:l=[],tabsMode:s,...c})=>{const d=u(),{isReady:m}=d,g=i((()=>l.map(Om)),[l]),[f,b]=n(0);a((()=>{if(!l||!l[0])return;const e=d.query.tab&&l.findIndex((e=>"group"===e.type&&e.ref===d.query.tab))||0,t=l[e]||l[0];b(e),Fm(t)}),[m]),a((()=>{const e=l[f];"group"===e?.type&&h.subject("tab",{type:e.type,label:e.ref,groupName:e.name})}),[l,f]);const y=r((e=>{const t=g.indexOf(e),n=l[t];b(t),Fm(n),"group"===n.type&&(e=>{const t=new URLSearchParams(d.query);e.name?t.set(Lm,e.name):t.delete(Lm),d.replace(`${d.pathname}?${t}`,"",{scroll:!1})})(e)}),[l,g]);return o(x,{className:p(t?"sticky top-1 z-20":"",e),defaultPadding:"p-0",...c,children:Em({items:g,value:g[f],tabsMode:s,onChange:y})})})),Fm=e=>{"group"===e.type&&h.fire("tab",{type:e.type,label:e.ref,groupName:e.name}),"link"===e.type&&h.fire("tab",{type:e.type,label:e.href})},Om=e=>"group"===e?.type?{text:e.title,name:e.ref}:e,_m={start:"text-start",center:"text-center",end:"text-end"},Um=d((({tab:e,className:t,onClick:l,isActive:n})=>{const a=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white text-primary-text"),title:e?"mb-xs text-xl":"mb-2xs text-l",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal"}))(n);return c("button",{type:"button",onClick:l,"aria-label":e?.title,className:p("border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs",a.btn,t),children:[e?.icon?o(ae,{className:p("h-6 w-6 min-w-6 min-h-6",a.icon),image:{...e?.icon,iconVersion:e?.icon?.iconVersion??a.iconVersion},width:"24",height:"24"}):null,c("div",{className:"border-0",children:[e?.title?o("div",{className:a.title,children:e.title}):null,e?.description?o("div",{className:a.desc,children:e.description}):null]})]})})),Hm=d((({tab:e})=>{const t=ue(),{onClick:l}=t({...e,onClick:()=>{e.href&&!$(e.href)&&(globalThis.location.href=e.href)}});return om(l,[],800),o(y,{className:"col-span-12 p-xl",size:5})})),Wm=St((({className:e="",tabs:t=[],block:l,tabAlign:a,...r})=>{const[i,s]=n(qm(t)),d=Km(t[i],i),m=t.length,[h,{inc:u,dec:g}]=Xr({itemCount:m},i),[f,b]=Aa({itemCount:m});return c(x,{className:p(e),defaultPadding:"p-0",...r,children:[c("div",{className:"relative border-b-8 border-primary-main",children:[o(Na,{itemClassName:"flex",containerRef:f,snapAlign:"snap-end",gap:8,onVisibleIndicesChange:b.handleVisibleIndicesChange,children:t.map(Gm(i,s,a))}),o(li,{scroll:b,arrowsPadded:!0,onScrollLeft:g,onScrollRight:u,activeIndex:h,itemCount:m})]}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:t[i]?.href?o(Hm,{tab:t[i]}):z(l?.slots?.[d],{...r?.options,slotName:d,parent:l})})]})}),{slots:({tabs:e})=>e?.filter((e=>!e.href)).map(Km)||[],childrenTypes:{exclude:["TabsLayout"]}}),Km=(e,t)=>e?.title||`Слот №${t}`,qm=e=>e.reduce(((e,t,l)=>t.selected?l:e),0),Gm=(e,t,l="start")=>(n,a)=>o(Um,{className:_m[l],tab:n,isActive:e===a,onClick:()=>t(a)},String(a)),Ym={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Xm=d((({children:e,activeIndex:t,columnWidth:l,version:n="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Ym[n],style:{transform:`translateX(-${t*l}px)`},children:e})}))),Qm=d((({className:e="",isOpen:t,onClick:l})=>o(ye,{className:e,appendRight:o(ae,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:l}))),Zm={Buttons:({buttons:e})=>Ye(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ae,{image:e}):null,List:({isDotted:e,...t})=>o(tt,{className:"flex flex-col justify-between items-start text-h6",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Ee,{size:"text-h6",children:e})}):null,t?o("div",{children:o(Ee,{size:"text-l",color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,dataUrl:l,pdfUrl:n,isOpen:a})=>e?o(Qm,{isOpen:a,onClick:()=>{t({dataUrl:l,pdfUrl:n})}}):null},Jm=d((({cell:e,fieldIdx:t,rowIdx:l,cellIdx:r,setTableInner:i,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=n(!0);a((()=>{r===o&&s||m(!0)}),[s,o]);return eh({cell:e,cellProps:{rowIdx:l,cellIdx:r,fieldIdx:t,displayTable:e=>{m(!1),c(r),i(e)},isVisible:d}})})),eh=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:l,...n}=e;if(!l||!(l in Zm))return null;return o(Zm[l],{...t,...n})},th=d((({cells:e,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:r,setOpenTableInnerIdx:i})=>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(Jm,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:r,setOpenTableInnerIdx:i},String(s)))):null}))),lh=(e,t)=>140*Pe(e.slice(0,t).map((e=>e?.cols?.length??1))),nh=(e,t)=>e?.length>0?o("div",{className:p("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Ee,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,ah=d((({rows:e})=>{return o(Na,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,l)=>{if(!e?.length)return null;const[n,...a]=e,r=p("flex duration-1000 text-center",0!==l?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[n?.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(Ee,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:r,style:{transform:`translateX(-${lh(a,t)}px)`},children:a?.map(((e,l)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Ee,{size:"text-xl",children:e.data}):null,e?.cols?nh(e.cols,t):null]},`row${l}`)))})})]},String(l))}))})});var t})),rh=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(Ee,{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(ah,{rows:t.rowsData})})})]},n)}))}))),ih=(e=!1)=>""+(e?"text-white":"text-secondary-text"),sh=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:p("rounded-md px-4 py-3 cursor-pointer",t===l?"bg-primary-main":""),onClick:()=>n(t),children:o(Ee,{size:"text-xl",font:"font-light",color:ih(t===l),children:e||t+1})},e)))}):null,t?o(ye,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(Y,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]})));async function oh(e){const t=await fetch(e);return await t.json()}const ch=d((({dataUrl:e,pdfUrl:t,onClick:l})=>{const{tableData:a}=function(e){const{data:t}=Ml(function(e){return`/wcms-resources/${e||"tariffs-inner-table-data"}.json`}(e),oh);return t||{}}(e),[i,s]=n(0),d=r((e=>s(e)),[]),m=a?.[i]?.items??[],h=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(sh,{currencies:h,activeTabIndex:i,setActiveTabIndex:d,linkToPDF:t}),o(rh,{activeTabIndex:i,items:m}),o(Qm,{className:"mt-xl",onClick:l,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Ee,{size:"text-h6",children:"Данных нет"}),o(Qm,{onClick:l,isOpen:!0})]})})),dh=d((({children:e,tableInner:t,onHideContentClick:l})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:p("@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(ch,{...t,onClick:l})}):null]}))),mh=d((({row:{header:e,data:t},activeIndex:l,rowIdx:a,...i})=>{const[s,d]=n(void 0),m=r((e=>d(e)),[]),[h,u]=n(void 0),g=r((e=>u(e)),[]);return c(dh,{onHideContentClick:()=>d(void 0),tableInner:s,...i,children:[o("div",{className:p("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(Ee,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Xm,{activeIndex:l,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(th,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...i},String(t))))}):null]})}));function hh({dec:e,inc:t,canDec:l,canInc:n,btnClass:a,className:r=""}){return l||n?c("div",{children:[l?o(Qr,{className:p("absolute z-40",a[0],r),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!l}):null,n?o(Qr,{className:p("absolute z-40 rotate-180",a[1],r),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!n}):null]}):null}const uh=d((({children:e,controls:t})=>{const{isScrollAvailable:l}=t;return c("div",{role:"table",children:[c("div",{className:"relative space-y-xs",children:[e,hh({...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]})})),ph=d((({className:e="",title:t,description:l,rowHeaders:n,tariffsColumns:a,hiddenRowsNum:r=0,...i})=>{const s=a?.map((({data:e})=>e))||[],d=n?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,u]=Xr({itemCount:m,visibleItemCount:2}),g=(d||[]).map(((e,t)=>o(mh,{row:e,activeIndex:h,rowIdx:t,...i},String(t)))),[f,b]=r>0?[g.slice(0,-r),g.slice(-r)]:[g,[]];return c(x,{className:p("overflow-hidden relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...i,children:[o(B,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m",children:r>0?o(Fa,{renderFoldableSection:({isUnfolded:e})=>c(uh,{controls:u,children:[f,o(Oa,{isUnfolded:e,children:b})]}),renderFoldButton:Gi}):o(uh,{controls:u,children:g})})]})})),gh=d((({className:e="",title:t,description:l,iconVersion:n,__html:a,...r})=>c(x,{className:p("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===n?xh():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Ee,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,l?fh(l):null,a?o(je,{__html:a}):null]})]}))),xh=()=>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"}),fh=e=>o(T,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),bh=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(Ee,{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(Ee,{size:"text-h2",children:l})}):null]}))),yh=d((e=>{const{prefix:t,unit:l,suffix:n,...a}=e;return o(x,{defaultPadding:"p-0",...a,children:o(bh,{prefix:t,unit:l,suffix:n})})})),vh={AdTile:It,ApplicationForm:ta,ApplicationFormCustom:ca,BenefitsBlock:ga,BonusBenefitsBlock:Ea,ButtonsBlock:$a,Calculator:Fr,CardTransfer:Yr,Carousel:hi,CarouselBankHistoryCard:ui,CarouselCard:xi,CarouselCatalogCard:bi,CarouselLinks:ki,CarouselRecommendationCard:Mi,CarouselTariffsCard:Pi,ComparisonTable:Ui,DepositFiltration:hs,ErrorBlock:xs,ExchangeRateTile:Os,Footer:ro,Header:yo,Headline:B,HorizontalLayout:wo,ImgBlock:ko,LinkDocs:Bo,MobileAppTile:Ro,MortgageFiltration:Zo,OfficesAtmsMap:sd,Placeholder:od,ProductBlock:Tt,ProductGallery:cd,RepresentativeOfficeInfo:dd,RichTextBlock:ud,RollupItem:Ws,SafeDepositRental:Ad,StepsBlock:Fd,StickyBottomMenu:zm,Tabs:$m,TabsLayout:Wm,TariffsTable:ph,TextBlock:gh,UnitBlock:yh,VerticalLayout:No},Nh="rshb-query-params";function wh(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Nh)||"";return e&&globalThis.sessionStorage?.setItem(Nh,e),e}const kh=he((()=>{a((()=>{wh()}),[]),_t(globalThis,"click",Ch)})),Ch=e=>{const t=Sh(e.target),[l]=E._.YANDEX_METRIKA_ID?.split(",").reverse()??[],n=t?.dataset?.ymtarget;if([l,n,globalThis.ym].every(Boolean)&&globalThis.ym(l,"reachGoal",n),L(t?.href)){e.preventDefault(),e.stopPropagation();const l=(e=>{const t=wh();if(!L(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;l&&(globalThis.location.href=l)}},Sh=e=>{let t=e;for(;Boolean(t)&&"A"!==t.tagName;)t=t?.parentNode;return t},Th="cookie",Ih=d((({termLink:e,personalDataPolicyLink:t})=>{const[l,{setTrue:n,setFalse:a}]=Dt();om((()=>{globalThis.localStorage?.getItem(Th)||n()}),[],3e3);const i=r((()=>{globalThis.localStorage?.setItem(Th,"true"),a()}),[]);return l?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:c(T,{size:"text-s",font:"font-light",color:"text-primary-text",children:["АО «Россельхозбанк» использует",o(Si,{isRemote:!0,className:Bh(e?.href),...e,children:"cookie"}),"(файлы с данными о прошлых посещениях сайта) для персонализации сервисов и удобства пользователей. Вы можете запретить сохранение cookie в настройках своего браузера.",o(Si,{isRemote:!0,className:Bh(t?.href),...t,children:"Обработка Ваших персональных данных"}),"производится в соответствии с требованиями Федерального закона от 27.07.2006 № 152-Ф3 «О персональных данных»."]})}),o("div",{className:"ml-s sm:ml-0 w-24 flex justify-end",children:o(Qd,{className:"bg-main-gray rounded-md",onClose:i})})]})}):null})),Bh=e=>p("inline mx-2xs",e?"text-green-dark":""),Mh=d((()=>{const e=r((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=r((e=>{e?.onClose&&e.onClose()}),[]),l=Xd({onCloseAll:e,onClose:t}),{close:n}=me(),i=r((({key:e})=>{"Escape"===e&&n()}),[]);return _t(globalThis.document,"keydown",i),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:p("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar",n===l.length-1?"":"hidden"),children:e},String(t||n))))}):null})),Vh=d((()=>{const[e,t]=n(null),l=r((()=>{t(null)}),[]);a((()=>h.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":l();break;default:Dd(e)}}))),[]);const i=r((({key:e})=>{"Escape"===e&&l()}),[l]);return _t(globalThis.document,"keydown",i),e?o("div",{className:"absolute z-50",style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),Rh="header",Ph="footer",zh="sticky-footer",Ah={},jh=d((({className:e,data:t=Ah,blocksRegistry:l,blockDecorator:n})=>{const{slots:a,blocks:r,fallback:i,...s}=t,d=Ct(s,i);kh();const m={key:"",page:{slots:a,blocks:r,fallback:i,...d},blocksRegistry:l,blockDecorator:n,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:p("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:z(a?.header,{...m,slotName:Rh})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[A({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),z(a?.footer,{...m,slotName:Ph})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:z(a?.["sticky-footer"],{...m,slotName:zh})}):null,o(Mh,{}),o(Vh,{}),o(Ih,{termLink:{href:"/pd-policy#cookie",target:"_blank"},personalDataPolicyLink:{href:"/pd-policy",target:"_blank"}})]})}));Object.assign(jh,{childrenTypes:[],slots:()=>[Rh,Ph,zh]});e.Blocks=vh,e.ContentPage=jh,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=he,e.joinList=e=>t=>t.reduce(((t,l,n)=>t.length?t.concat({...e,key:`sep-${n}`},l):[l]),[]),e.packageVersion="0.14.216",e.projectSettings=E,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=U,e.useRouter=u,Object.defineProperty(e,"__esModule",{value:!0})}));