@redneckz/wildless-cms-uni-blocks 0.14.151 → 0.14.152

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 n=e=>(...n)=>t[e](...n),l=n("useState"),a=n("useEffect"),i=n("useCallback"),r=n("useMemo"),s=n("useRef");const o=e=>e&&!e.endsWith("/")?`${e}/`:e,c={PROD_BRANCH:"master"},d=new class{_=c;setup(e){this._=e}get TEST_BRANCH(){return this._.TEST_BRANCH}get RC_BRANCH(){return this._.RC_BRANCH}get PROD_BRANCH(){return this._.PROD_BRANCH||c.PROD_BRANCH}get FORCED_DRAFT_FLOW(){return this._.FORCED_DRAFT_FLOW}get ASSIST_PROJECT_ID(){return this._.ASSIST_PROJECT_ID}get SITEMAP(){return this._.SITEMAP}get STICKY_MOBILE_MENU(){return this._.STICKY_MOBILE_MENU}get FOOTER(){return this._.FOOTER}get PORTAL_DATA(){return this._.PORTAL_DATA}get CHAT_BOT(){return this._.CHAT_BOT}get CDN(){return o(this._.CDN)}get BASE_PATH(){return o(this._.BASE_PATH)}get YANDEX_MAP_API_KEY(){return this._.YANDEX_MAP_API_KEY}get YANDEX_METRIKA_ID(){return this._.YANDEX_METRIKA_ID}},m="likesToken";function h(){async function e(){try{const e=JSON.parse(globalThis.localStorage?.getItem(m)||"");if(e?.token)return e}catch(e){}try{const e=await fetch("/assist/v1/public/auth",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:t,name:n}=await e.json();return globalThis.localStorage?.setItem(m,JSON.stringify({token:t,name:n})),{token:t,name:n}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...t){if(!t.length)return[];const{token:n}=await e();try{const e=await fetch(`/assist/v1/public/projects/${d.ASSIST_PROJECT_ID}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:n},body:JSON.stringify({node_ids:t})}),{likes:l}=await e.json();return l||[]}catch(e){return console.error(e),[]}},like:async function(t){if(!t)return 0;const{token:n,name:l}=await e();try{const e=await fetch(`/assist/v1/public/projects/${d.ASSIST_PROJECT_ID}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:n,UserID:l},body:JSON.stringify({node_id:t,user_name:l})}),{likes:a}=await e.json();return a||0}catch(e){return console.error(e),0}},dislike:async function(t){if(!t)return 0;const{token:n,name:l}=await e();try{const e=await fetch(`/assist/v1/public/projects/${d.ASSIST_PROJECT_ID}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:n,UserID:l},body:JSON.stringify({node_id:t,user_name:l})}),{likes:a}=await e.json();return a||0}catch(e){return console.error(e),0}}}}const u=(...e)=>globalThis._uni._jsx(...e),p=(...e)=>globalThis._uni._jsxs(...e),g=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:x(e)),t._tmpl},x=e=>{function t(t,n){const{children:l,...a}=t||{},i=n?.slots?.default,r=l||i&&i();return e(Object.assign(a,r&&{children:r}),n)}return t.inheritAttrs=!1,t},f=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),b=g((({children:e})=>f?e:null));const y=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{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 v(){return v._impl()}v._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),v.setup=e=>{v._impl=e};const N=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),w={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","":""},k=g((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:i="p-xl",padding:r,block:s,tag:o="section",role:c,children:d,style:m})=>{const h=o,p=v(),[g,x]=l(!1);a((()=>y.subscribe("tab",(e=>{e.groupName&&e.groupName!==s?.labelGroup||x(Boolean(e.label&&s?.labels?.length&&!s.labels.includes(e.label)))}))),[s,p]);const f=t&&n;return u(h,{className:N("@container font-sans",f?"group":"",w[t],g?"hidden":"",r||i,e),...f?{"data-ver":t}:{},...s?.anchor?{id:s.anchor}:{},role:c,style:m,children:d})})),S={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"},T=g((({className:e="",headingType:t="h3",as:n="h3",title:l,children:a})=>{const i=S[n]||"h3";return u(i,{className:N("font-sans m-0",C[t],e),children:l||a})})),I=g((({children:e,...t})=>u("p",{className:N("font-sans",Object.values(t)),children:e}))),B={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"}},P=g((({className:e,version:t="",headlineVersion:n="XL",title:l,description:a,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:o=!1,...c})=>{const d=B[n],m={marginTop:d.descriptionStyle};return p(k,{className:N(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:o,...c,children:[l?u(T,{className:N("whitespace-pre-wrap",i),...d?.title,as:r||d?.title.as,title:l}):null,a?u(I,{size:d.descriptionSize,font:d.descriptionWeight,align:i,...m,children:a}):null]})})),M=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),R=[];function A(e,t,{className:n,...l}={}){const{key:a,blockDecorator:i=M,blocksRegistry:r={},ancestors:s=R}=t,{type:o}=e;o&&o in r||console.warn(`No block with "${o}" is registered`);const c=o&&r[o];return i({blockClassName:N(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:i})=>{const{content:r}=n;return c?u(c,{className:i,block:e,options:t,...r,...l},a):null}},a)}const V=[],z=(e,{key:t,ancestors:n=V,slotName:l=null,extraProps:a,renderProps:i=A,...r})=>{const s=a?(e,t)=>A(e,t,a):i;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||V,[r.parent,l]]:n},a)))};function D({block:e,options:t,children:n,extraProps:l,renderProps:a}){return n||(e&&t?z(e.blocks,{...t,parent:e,extraProps:l,renderProps:a}):null)}const _=e=>Boolean(e?.includes(":")),F=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),E=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),j=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/");var O=Object.freeze({__proto__:null,isURL:_,isLocalURL:F,isHash:e=>Boolean(e?.startsWith("#")),withoutQuery:E,joinPath:j});const L="/api/",$=`${L}v1/storage`,U=e=>(t,n=d.BASE_PATH)=>{if(!t||_(t)||[d.CDN,L].some((e=>H(t,e))))return t;if(/^[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(t))return`${$}/${t}/file`;const l=t.startsWith("/");return j(H(t,n)?"":n,l?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},H=(e,t)=>t&&e&&e.startsWith(t),W={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},K=g((({className:e="",imageClassName:t="",name:n="",alt:l=`Иконка ${n}`,title:a=l,iconVersion:i="color",width:r,height:s})=>{const o=v(),c="normal"===i?`${n}.svg`:`sprites.svg#${n}`,m=U(o)(j(d.CDN,"/icons/",c));return"normal"===i?u("img",{className:e,src:m,alt:l,title:a,"aria-hidden":"true",width:r,height:s,style:Y(e,s)}):u(X,{className:e,children:p("svg",{className:N(G(r),W[i],"white"===i?"invert":"",t),width:r,height:s,"aria-hidden":"true",children:[a?u("title",{children:a}):null,l?u("desc",{children:l}):null,u("use",{href:m,xlinkHref:m})]})})})),Y=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},G=e=>e?"":"w-full h-full",X=g((({className:e,children:t})=>e?u("div",{className:e,children:t}):t)),q=(e,t)=>n=>n&&!_(n)?U(e)(j(t,n)):n,J=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=g((({className:e="",image:t,imageClassName:n="",pathPrefix:l})=>{const a=v();return p("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(J).map((({src:e,format:n,media:i},r)=>u("source",{srcSet:q(a,l)(e),type:ee(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?Z({...t,src:q(a,l)(t.src)},n):null]})})),Z=(e,t="")=>u("img",{src:e.src,className:N("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}),ee=e=>e?`image/${String(e)}`:void 0,te=g((({className:e="",image:t,imageClassName:n="",pathPrefix:l,...a})=>t?.src||t?.icon?t.icon?u(K,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):u(Q,{className:e,imageClassName:n,image:t,pathPrefix:l}):null)),ne={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","":""},le="bg-main-divider text-main-disabled",ae={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},ie="text-center font-sans select-none",re={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","":""},se=({className:e,rounded:t,version:n})=>[ie,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ne[n]:"",t?"rounded-full":"rounded-md",e].join(" "),oe=()=>({open:(e,t={})=>y.fire("dialog",{type:"open",dialog:e,...t}),close:()=>y.fire("dialog",{type:"close"}),closeAll:()=>y.fire("dialog",{type:"close",all:!0})}),ce=(e,t)=>ce._impl(e,t);function de(e={}){const{isRemote:t,basePath:n}=e,l=v(),{closeAll:a}=oe();return e=>({...e,href:t&&!n?e.href:U(l)(e.href,n),"aria-label":e.text,onClick:ce(i(e),e)});function i({href:e,target:n,onClick:i}){return r=>{i&&i(r),e&&!t&&F(e,n)&&(a(),r?.preventDefault(),l.push(e))}}}ce._impl=e=>e,ce.setup=e=>{ce._impl=e};const me=g((e=>{const{text:t,aboveText:n,appendLeft:l,appendRight:a,version:i="primary"}=e,r=ue(e)?"hidden lg:block":"";return p("div",{className:N(he(e),"flex gap-xs"),children:[l?u("div",{className:N(r,re[i]),children:l}):null,ue(e)?p("div",{className:"whitespace-pre",children:[n?u("div",{className:"text-xs font-light text-left",children:n}):null,u("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?u("div",{className:N(r,re[i]),children:a}):null]})})),he=e=>{const{version:t,aboveText:n,rounded:l}=e;if("link"===t)return"";const a=""+(n?"py-2.5 px-9":"py-4 px-9");return N("group/btn items-center justify-center",ue(e)?a:"h-12 w-12 m-auto",l?"rounded-full":"")},ue=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),pe=({className:e,rounded:t,version:n})=>["inline-block",ie,n?ae[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ge=g((({disabled:e,children:t,method:n="LINK",href:l,...a})=>{const r=(({method:e,href:t})=>i((n=>{if("POST"!==e||!t)return;n.preventDefault();const{origin:l,pathname:a,searchParams:i}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[l,a].join(""));for(const[e,t]of i.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:l}),s=de()({onClick:r,href:l,...a}),o=t??u(me,{...s});return u(e?fe:xe,{...s,children:o})})),xe=g((({className:e="",href:t,rel:n,target:l,ariaLabel:a,version:i,rounded:r,onClick:s,children:o})=>u("a",{className:se({className:e,version:i,rounded:r}),href:t,rel:n,target:l,"aria-label":a,role:t?"link":"button",onClick:s,children:o}))),fe=g((({className:e,ariaLabel:t,version:n,rounded:l,children:a})=>u("div",{role:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:pe({className:e,rounded:l,version:n}),children:a})));function be(e,t){const n="primary"===e?"white":"black",l="Вернуться назад";return p("div",{className:"hidden sm:flex items-center gap-s",children:[u("div",{className:se({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",version:e,rounded:!0}),onClick:t,children:u(te,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:n}})}),u(ge,{version:"link",className:"group-data-secondary:text-white/80",text:l,ariaLabel:l,onClick:t})]})}const ye={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},ve=g((({className:e,version:t="primary",defaultPadding:n,padding:l="",title:a="",insetTitle:r="",buttons:s,leftImage:o,rightImage:c,imageAlign:d,isImageAlwaysOnRight:m=!1,isImageSecondary:h=!1,backwardButton:g,children:x,...f})=>{const b=v(),y=i((e=>{e?.preventDefault(),b.back()}),[]);return p("div",{className:Ne(l,n,e),children:[g?be(t,y):null,a?u("div",{className:"relative h-full",children:a}):null,p("div",{className:N("grow relative flex flex-col @xl:flex-row gap-3xl w-full",o?"self-start @xl:w-auto":""),children:[Te(o,{imageAlign:d,className:"mx-auto"}),p("div",{className:N("grid gap-3xl",c?"@xl:grid-cols-2":"",o?"":"grow","h-full","auto-rows-[max-content_1fr]"),children:[p("div",{className:"grow space-y-lg min-w-fit",children:[r,x]}),Ce(D({...f,extraProps:{className:"@container-normal"}})),Te(c,{className:N("@xl:justify-self-end @xl:col-start-2",s?we(m):"",ke(m),Ie(h)),imageAlign:d}),Se(s)]})]})]})})),Ne=(e="",t="",n="")=>N("relative flex flex-col gap-3xl overflow-hidden",e||t,n),we=e=>e?"row-span-2":"@xl:row-span-2",ke=e=>e?"col-start-2 self-center":"",Se=e=>e?u("div",{className:"self-end",children:e}):null,Ce=e=>e&&e?.length?u("div",{className:"flex items-start justify-end",children:e}):null,Te=(e,{className:t,imageAlign:n})=>e?u("div",{className:N("shrink-1/2 justify-self-center",n&&ye[n],t),children:e}):null,Ie=e=>e?"hidden @xl:block":"",Be=(e=[])=>e.reduce(((e,t)=>e+t),0),Pe=(e=[])=>e?.length?Be(e)/e.length:0,Me=(e,t="normal")=>e?u("div",{className:N("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:u(te,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Re=g((e=>{const{__html:t="",richVersion:n=""}=e;return t.replace(/<\/?[^>]+\/?>/g,"").trim()?u("div",{"data-component":"rich-text-container",children:u("div",{className:N(n,"md-container"),dangerouslySetInnerHTML:{__html:t}})}):null})),Ae=(e,t)=>e?u(I,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ve=g((({children:e,...t})=>u("span",{className:N("font-sans",Object.values(t)),children:e}))),ze=(e,t)=>e?u(Ve,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,De=(e,t)=>"rte"===e.type&&"__html"in e&&e.__html?u(Re,{...e},`rte-${t}`):["label"in e?ze(e.label,t):null,"description"in e?u("span",{className:e.descriptionClassName,children:Ae(e.description,t)},String(t)):null],_e=g((({className:e,benefitsVersion:t,...n})=>p("div",{className:N("flex gap-m min-w-56 items-center",e),children:["icon"in n?Me(n.icon,t):null,u("div",{children:De(n)})]}))),Fe=e=>"rte"===e.type?e?.__html?.length||0:Math.max(e?.label?.length||0,e?.description?.length||0),Ee=e=>{return((t=e.map(Fe))?.length?Math.sqrt(Math.abs(Pe(t.map((e=>e**2)))-Pe(t)**2)):0)>16;var t},je=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),Oe=e=>!e.some(je),Le=g((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?u("div",{className:N("flex gap-x-m gap-y-s",Ee(n)||Oe(n)?"flex-col":"flex-wrap",e),children:n.map(((e,n)=>u(_e,{benefitsVersion:t,...e},String(n))))}):null)),$e=g((({className:e,benefits:t})=>t?.length?u("div",{className:N("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),children:t.flatMap(De)}):null)),Ue=g((({isTabularBenefits:e,...t})=>u(e?$e:Le,{...t}))),He=e=>Boolean(e?.src||e?.icon),We=(e,{className:t,buttonClassName:n,isVertical:l}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?u("div",{className:N("flex",l?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m",t),children:e.map(Ke(n))}):null,Ke=(e="")=>(t,n)=>{const{text:l,icon:a,iconRight:i,version:r,...s}=t||{},o=Ye(a,r),c=Ye(i,r);return l||a?.icon?u(ge,{className:N("basis-full @lg:basis-auto",e),appendLeft:Ge({...a,iconVersion:o}),appendRight:Ge({...i,iconVersion:c}),version:r,text:l,...s},n?String(n):""):null},Ye=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:n},Ge=e=>He(e)?u(te,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,Xe=g((({className:e,isDotted:t,dotClassName:n,children:l})=>p("div",{className:N("font-sans flex",e),role:"listitem",children:[t?u("div",{className:"shrink-0",children:u("div",{className:N("align-middle inline-block rounded-full group-data-secondary:bg-white",n)})}):null,u("span",{children:l})]}))),qe={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"}},Je=g((({className:e,isDotted:t=!0,items:n=[],listItemSize:l="M",dotClassName:a=""})=>{const i=qe[l];return n?.length?u("section",{className:N("flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text",i.textSize,e),role:"list",children:n.map(((e,n)=>u(Xe,{isDotted:t,dotClassName:N(a||"bg-primary-text",i.dotStyle),children:e},String(n))))}):null})),Qe=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Ze=g((({priceList:e})=>e?.length?u("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",children:e.map(et)}):null)),et=({label:e,amount:t})=>p("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",children:[u(Ve,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?p("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[Qe(2)(t)," ₽"]}):null]}),tt=g((({className:e,tags:t})=>t?.length?u("div",{className:N("flex flex-wrap gap-xs",e),role:"list",children:t.map(nt)}):null)),nt=(e,t)=>u("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:u(Ve,{size:"text-m",font:"font-light",children:e})},String(t)),lt={XXL:"L",XL:"L",L:"M",M:"M",S:"S",XS:"S"},at=g((({className:e,padding:t,defaultPadding:n,title:l,description:a,headlineVersion:i="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:o,benefits:c,__html:d,isFullWidthTitle:m,items:h,isDotted:g=!0,priceList:x=[],tags:f=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:k=!1}={},backwardButton:S,children:C,...T})=>{const I=y?.src?u(te,{image:y}):null,B=u(P,{title:l,description:a,headlineVersion:i,align:r,isEmbedded:!0}),M=c?.filter((e=>"rte"===e?.type||"label"in e||"description"in e));return u(ve,{className:e,padding:t,defaultPadding:n,...m?{title:B}:{insetTitle:B},...it(I,N),isImageSecondary:k,imageAlign:v,isImageAlwaysOnRight:w,buttons:We(b),backwardButton:S,...T,children:p("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[M?.length?u(Ue,{benefitsVersion:s,isTabularBenefits:o,benefits:M}):null,d?u(Re,{__html:d}):null,h?.length?u(Je,{items:h,isDotted:g,listItemSize:lt[i]}):null,C,x?.length?u(Ze,{priceList:x}):null,rt(f)]})})})),it=(e,t)=>t?{rightImage:e}:{leftImage:e},rt=e=>e?.length?u(tt,{tags:e}):null,st=g((({className:e,padding:t,...n})=>u(k,{className:N("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...n,children:u(at,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...n})})));st.childrenTypes=["UnitBlock"];const ot=e=>null!=e,ct=new Map,dt=e=>Boolean(e?.every((e=>Array.isArray(e)?dt(e):!e||"string"==typeof e))),mt=e=>dt(e)?e.toString():"";function ht(e,t,{fallback:n,cache:i}={}){const s=r((()=>ut(e)),[e]),[o,c]=l(void 0),[d,m]=l(void 0);a((()=>{if(!s.some(ot))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=ct)=>n=>{const l=mt(n),a=t.get(l);if(l&&ot(a))return a;const i=e(...n);return l&&ot(i)&&t.set(l,Promise.resolve(i)),i})(t,i)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,i,s]);const h=n&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&n[s[0]];return{data:!o&&h?h:o,error:d,mutate:()=>Promise.resolve(void 0)}}function ut(e){return Array.isArray(e)?e:e instanceof Function?ut(e()):[e]}async function pt(e,t){try{return e?await gt(e,t):null}catch(e){console.error(e)}return null}const gt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),xt={},ft="/wcms-resources";function bt(e,t={}){const{fallback:n=xt,pathDir:l=ft}=t,{data:a}=ht(e?`${l}/${e}.json`:null,gt,{fallback:n});return a||xt}const yt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),vt=g((e=>{const t=((e="reklamnaya-plitka")=>{const t=bt(e),n=r((()=>yt(0,t?.items?.length)),[t]);return t?.items?.[n]})(e.options?.page?.adSourceBook);return t?u(b,{children:u(st,{...t,...e})}):null}));const Nt=e=>e,wt=(e,t)=>{const[n,a]=l(e),[r,o]=l(!1),[c,d]=l({}),m=s({}),h=i(((e,t)=>{const{parse:l=Nt,format:i=Nt}=t||{};return m.current||(m.current={}),m.current[e]||=t=>{a((n=>({...n,[e]:l(t)}))),d((t=>({...t,[e]:!0})))},{value:i(n[e]),isDirty:r||c[e],onChange:m.current[e]}}),[n,r,c]),u=i((e=>{a(e),d(e)}),[]),p=i((()=>{a(e),o(!1),d({})}),[e]),g=i((e=>{e.preventDefault(),o(!0),t&&t(n)}),[t,n]);return[n,{isDirty:r||Object.values(c).some(Boolean),field:h,update:u,reset:p,onSubmit:g}]},kt=e=>e.replace(/[^+\d]/g,""),St=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Ct=e=>!e?.length,Tt=e=>t=>n=>e(n)?[]:[t],It=g((({text:e,link:t})=>p(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:[u(Ve,{children:e||"Нажимая кнопку, вы подтверждаете согласие с "}),t?u(ge,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"text-primary-main",children:u(Ve,{children:t.text})}):null]}))),Bt="container space-y-lg",Pt="w-full max-w-xl space-y-s m-auto",Mt=(e,t)=>{const{value:n,isDirty:l}=e,a=l?t(n):[];return{...e,errors:a,error:a[0]}},Rt=g((({title:e,children:t})=>p("fieldset",{className:"grid @xl:flex @xl:justify-between gap-lg border-b border-b-main-divider @xl:border-none",children:[e?u("legend",{className:"w-full",children:u(T,{title:e,headingType:"h6",className:"@xl:text-center"})}):null,t]}))),At="@xl:w-1/2 space-y-s",Vt=g((({key:e,className:t="",id:n,name:l,type:r="text",label:o,placeholder:c,value:d="",valid:m=!0,children:h,onChange:g,onFocus:x,onBlur:f,pattern:b,autoFocus:y=!1,isTextarea:v=!1})=>{const w=s(null),k=i((e=>{g&&g(e.target?.value||"")}),[g]);a((()=>{y&&w.current?.focus()}),[y,w]);const S="w-full border rounded-md text-primary-text outline-none p-m",C=h?"pr-3xl":"",T=Dt(m);return p("div",{className:N("relative",t),children:[p("label",{children:[o?zt(o):null,v?u("textarea",{className:N("block resize-y min-h-24",S,T),id:N("textarea",n),name:l||n,placeholder:c,value:d,onInput:k,onFocus:x,onBlur:f},e):u("input",{type:r,className:N("h-14",S,C,T),ref:w,id:n,name:l||n,placeholder:c,value:d,onInput:k,onFocus:x,onBlur:f,pattern:b},e)]}),h]})})),zt=e=>u("div",{className:"mb-xs",children:u(Ve,{size:"text-m",font:"font-light",children:e})}),Dt=e=>e?"border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text":"border-error",_t=e=>u("div",{className:"h-4",children:e?u(Ve,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Ft=g((({className:e,label:t,value:n="",placeholder:l,error:a,onChange:i,onBlur:r,isTextarea:s})=>p("div",{className:N("shrink-0 w-full",e),children:[u(Vt,{type:"text","aria-label":t,label:t,valid:Boolean(!a),value:n,onChange:i,onBlur:r,isTextarea:s,placeholder:l}),_t(a)]}))),Et=e=>"_"===e,jt=e=>/\d/.test(e),Ot=e=>Et(e)||jt(e),Lt=[..."+7 (___) ___-__-__"],$t=Lt.findIndex(Et),Ut=Lt.map(((e,t)=>Ot(e)?Lt.slice(0,t).filter(Ot).length:-1));const Ht=g((({children:e,onChange:t,...n})=>{const l=i((e=>t&&t(function(e){const t=e.replace(/\D/g,""),n=Lt.map(((e,n)=>jt(e)?e:t.charAt(Ut[n])||e)),l=Ut.indexOf(t.length-1)+1;return(l?n.slice(0,Math.max($t,l)):n).join("")}(e))),[t]);return u(Vt,{onChange:l,onFocus:e=>l(e?.target?.value||""),...n,children:e})})),Wt=g((({className:e,label:t,value:n,error:l,onChange:a,onBlur:i})=>p("div",{className:N("shrink-0 w-full",e),children:[u(Ht,{"aria-label":t,label:t,valid:Boolean(!l),value:n,onChange:a,onBlur:i,placeholder:"+7 (___) ___-__-__"}),_t(l)]}))),Kt="Некорректно заполненное поле",Yt=Tt((e=>null!=e&&""!==e))(Kt),Gt=Tt((e=>"string"==typeof e&&e.length>1))(Kt),Xt=Tt((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Kt),qt=(Jt=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Tt((e=>"string"==typeof e&&Jt.test(e))))(Kt);var Jt;const Qt=Tt((e=>"boolean"==typeof e&&e))(Kt),Zt=(e,t)=>p(Rt,{title:t,children:[p("div",{className:At,children:[u(Ft,{label:"Наименование организации*",...Mt(e("fullName"),Yt)}),u(Ft,{label:"Контактное лицо*",...Mt(e("name"),Gt)})]}),p("div",{className:At,children:[u(Ft,{label:"ИНН*",...Mt(e("inn"),Xt)}),u(Wt,{label:"Телефон*",...Mt(e("phone"),qt)})]})]}),en=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}];function tn(){const{data:e}=ht("/api/v1/regions",gt);return e||[]}function nn(e=!1){const[t,n]=l(e),a=i((()=>n(!0)),[]),r=i((()=>n(!1)),[]),s=i((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}const ln=e=>e?.text||e?.key||"";function an(e,t,n,l){a((()=>{if(e&&n)return e.addEventListener(t,n,l),()=>{e.removeEventListener(t,n,l)}}),[e,t,n])}function rn(e){const t=s(null),n=i((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return an(globalThis.document,"click",n),t}const sn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,on=g((({popupRef:e,options:t,value:n,query:l,onChange:a,iconVersion:i})=>t?.length?u("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md",role:"listbox",ref:e,children:sn(t,l).map((e=>p("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"option","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[u("span",{className:"min-h-6",children:ln(e)}),u(K,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:N("absolute right-4 pt-3xs",e.key===n?.key?"":"hidden")})]},e.key)))}):null));function cn({isOpen:e,options:t,value:n,query:l,onChange:r,onClose:o,iconVersion:c}){const d={open:(e,t)=>y.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>y.fire("popup",{type:"update",popup:e,...t}),close:()=>y.fire("popup",{type:"close"})},m=i((()=>{d.close(),o&&o()}),[o]),h=i((e=>{m(),r&&r(e)}),[m,r]),p=s(null),g=rn(m);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:i,left:r,width:s,height:o}=a.getBoundingClientRect();d.update(u(on,{popupRef:g,options:t,value:n,query:l,onChange:h,iconVersion:c}),{top:i+window.scrollY+o,left:r,width:s})}),[e,t,n,l,h]),p}const dn=g((({className:e,label:t,options:n=[],value:a,valid:r=!0,isBorder:s=!0,placeholder:o="",isSearch:c=!1,iconVersion:d,onChange:m})=>{const[h,{setFalse:g,setTrue:x}]=nn(),[f,b]=l(""),y=i((()=>{b(""),g()}),[]),v=cn({isOpen:h,options:n,value:a,query:f,onChange:m,onClose:y,iconVersion:d});return p("div",{className:e,children:[mn(t),p("div",{className:N("relative",h?"z-20":"z-10"),ref:v,children:[p("div",{className:N("h-14 text-l flex justify-between items-center text-primary-text cursor-pointer relative z-10",un(s,r)),onClick:h?y:x,children:[u("p",{className:"p-m pr-8 flex items-center overflow-hidden text-ellipsis",children:ln(a)||o}),hn(h,d)]}),c&&h?u("div",{className:N("absolute top-0 w-full z-20"),children:u(Vt,{type:"text",autoFocus:!0,value:f,onChange:b})}):null]})]})})),mn=e=>e?u("div",{className:"mb-xs",children:u(Ve,{size:"text-m",color:"text-primary-text",font:"font-light",children:e})}):null,hn=(e,t)=>u(K,{className:N("absolute right-3",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),un=(e,t)=>N(e?"border rounded-md hover:border-primary-hover":"",t?" border-gray":"border-error"),pn=g((({className:e="",error:t,...n})=>p("div",{className:e,children:[u(dn,{...n,valid:!t}),_t(t)]}))),gn=g((({field:e})=>{const t=tn();return u(pn,{className:"w-full",label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:t.map((({code:e="",name:t=""})=>({key:e,text:t}))),...Mt(e("region"),Yt)})})),xn=({field:e,title:t})=>p(Rt,{title:t,children:[u("div",{className:At,children:u(pn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:en,...Mt(e("acquiringType"),Yt)})}),u("div",{className:At,children:u(gn,{field:e})})]}),fn=g((({value:e=!1,text:t,type:n="checkbox",onChange:l})=>p("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>l&&l(!e),children:[u("div",{className:N("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:u("div",{className:N("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?u(Ve,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),bn=e=>p("div",{children:[u(fn,{text:"Хочу купить онлайн-кассу",...e("onlineCheckout")}),u(fn,{text:"Хочу купить POS-терминал",...e("posTerminal")})]});function yn({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const vn={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"},Nn={primary:N("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:N("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")},wn=g((({children:e,...t})=>{const n=e=>({...e,onClick:ce(yn(e),e)}),{className:l,version:a="primary",active:i,disabled:r,type:s="button",rounded:o=!0,role:c,onClick:d}=n(t);return u("button",{className:N("font-sans px-9 py-4","flex justify-center items-center gap-xs",i?"text-white bg-primary-active":"",r?"bg-main-gray text-main-disabled cursor-not-allowed":"",i||r?"":N(vn[a],Nn[a]),o?"rounded-md":"",l),type:s,role:c,onClick:d,children:e})})),kn=(e,t)=>u(wn,{className:N("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Sn={acquiringType:{key:"trade",text:"Торговый эквайринг"},fullName:"",inn:"",name:"",phone:"",onlineCheckout:!1,posTerminal:!1},Cn=St({acquiringType:Yt,region:Yt,fullName:Yt,inn:Xt,name:Gt,phone:qt}),Tn=g((e=>{const{button:t,link:n,onSubmit:l}=e,a=i((e=>{const{acquiringType:t,region:n,fullName:a,inn:i,name:r,phone:s,onlineCheckout:o,posTerminal:c}=e,d=In(t?.key),m=`Вид эквайринга=${t?.text||""}${d?`/Онлайн касса=${o}/POS-терминал=${c}`:"/Онлайн касса=false/POS-терминал=false"}`,h={typeForm:"acqr",region:n?.text||"",partnerComments:m,fullName:a,inn:i,name:r,phone:kt(s)};Ct(Cn(e))&&l(h,!1)}),[l]),[,{field:r,...s}]=wt(Sn,a),o=In(r("acquiringType").value?.key);return p("form",{className:Bt,onSubmit:s.onSubmit,children:[xn({field:r,title:"Вид эквайринга и регион"}),Zt(r,"Данные организации"),o?bn(r):null,kn(t),u(It,{link:n})]})})),In=e=>"all"===e||"trade"===e,Bn=g((({className:e,viewBox:t,fill:n="none",width:l,height:a,paths:i,...r})=>u("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:l,height:a,children:i.map((({d:e,fill:t,...n},l)=>{const a={...r,...n};return u("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},l)}))}))),Pn=[{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"}],Mn=g((({className:e,value:t,text:n,disabled:l,isRadio:a,onChange:r})=>{const s=i((e=>{l||(e.preventDefault(),r&&r(!t))}),[r,l,t]),o=a?u("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):u(Bn,{paths:Pn,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return u("div",{className:e,children:p("label",{className:"flex items-center relative cursor-pointer group/box",onClick:s,children:[u("div",{className:N("appearance-none w-5 h-5 border-solid cursor-pointer m-0",a?"rounded-full border-2":Rn(t),t?"border-primary-main":"border-gray",l?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:"checkbox","aria-checked":Boolean(t),"aria-disabled":Boolean(l)}),t?o:null,n?u("div",{className:"ml-s",children:u(Ve,{size:"text-l",font:"font-light",children:n})}):null]})})})),Rn=e=>N("rounded border",e?"bg-primary-main":""),An=g((({className:e,text:t,value:n,key:l,disabled:a,error:i,onChange:r})=>p("div",{className:N("shrink-0 w-full",e),children:[u(Mn,{text:t,value:n,disabled:a,onChange:r},l),_t(i)]}))),Vn=(e,t,n)=>p("div",{className:"flex gap-m flex-col lg:flex-row w-full justify-between items-baseline",children:[p("div",{children:[p("div",{className:"flex gap-3",children:[u(Mn,{...e}),u(It,{text:"Согласен с ",link:t})]}),_t(Mt(e,Qt).error)]}),kn(n)]}),zn=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),l=String(e.getMonth()+1).padStart(2,"0"),a=t?String(e.getFullYear()):String(e.getFullYear()).slice(-2);return t?`${a}-${l}-${n}`:`${n}.${l}.${a}`}},Dn=()=>{},_n=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:l,currentYear:a,min:i,max:r,onDateClick:s})=>{const o=[];let c=1;for(let d=0;d<6;d++){const m=[];for(let o=0;o<7;o++)if(0===d&&o<t)m.push(u("td",{},`empty-${o}`));else if(c>n)m.push(u("td",{},`empty-${o}`));else{const t=new Date(a,l,c),n=Fn(t,e),o=En(t,i,r);m.push(u("td",{children:u("div",{className:jn(n,o),onClick:()=>!o&&s(t),children:c})},`day-${c}`)),c++}o.push(u("tr",{children:m},`row-${d}`))}return o},Fn=(e,t)=>t&&e.toDateString()===t.toDateString(),En=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),jn=(e,t)=>N("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),On=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ln=g((({today:e,currentMonth:t,currentYear:n,min:l,max:a,onDateSelect:s=Dn})=>{const o=i((e=>s(e)),[]),{firstDayOfWeek:c,totalDays:d}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return p("table",{className:"mx-auto",children:[u("thead",{className:"text-gray font-light",children:u("tr",{children:On.map(((e,t)=>u("th",{className:"p-s",children:e},String(t))))})}),u("tbody",{children:_n({firstDayOfWeek:c,today:e,totalDays:d,currentYear:n,currentMonth:t,min:l,max:a,onDateClick:o})})]})})),$n=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],Un=$n.map((e=>({key:e}))),Hn=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),Wn={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Kn={className:"min-w-32",iconVersion:"black",isBorder:!1},Yn=g((({className:e="",label:t="",value:n,valid:a=!0,minDate:r,maxDate:s,onChange:o})=>{const[c,{setValue:d}]=nn(!1),[m,h]=l(n?.getMonth()||(new Date).getMonth()),[g,x]=l(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:f,handleNextMonth:b,handleSelectMonth:y,handleSelectYear:v,monthsOptions:w,yearsOptions:k,handleChangeVisibleCalendar:S,ref:C}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:l,onYearSelect:a,selectedYear:r})=>{const s=rn(i((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:i((()=>e(!t)),[t]),handleNextMonth:i((()=>{n+1<=11?l(n+1):(l(0),a(r+1))}),[n]),handlePrevMonth:i((()=>{n-1>=0?l(n-1):(l(11),a(r-1))}),[n]),handleSelectMonth:i((({key:e})=>l($n.indexOf(e))),[]),handleSelectYear:i((({key:e})=>a(Number(e))),[]),monthsOptions:Un,yearsOptions:Hn,ref:s}})({onYearSelect:x,onMonthSelect:h,onShowCalendar:d,selectedYear:g,selectedMonth:m,showCalendar:c});return p("div",{className:N(e,"relative"),ref:C,children:[u(Ve,{size:"text-m","font-weight":"font-light",children:t}),Gn(S,n,a),c?p("div",{className:"absolute bg-white z-20 select-none",children:[p("div",{className:"flex gap-s",children:[u("div",{className:"my-auto",onClick:f,children:u(K,{...Wn,className:"-rotate-90 cursor-pointer"})}),u(dn,{onChange:y,value:{key:$n[m]},options:w,...Kn}),u(dn,{onChange:v,value:{key:String(g)},options:k,...Kn}),u("div",{className:"my-auto",onClick:b,children:u(K,{...Wn,className:"rotate-90 cursor-pointer"})})]}),u(Ln,{today:n,currentMonth:m,currentYear:g,onDateSelect:o,min:r,max:s})]}):null]})})),Gn=(e,t,n)=>p("div",{onClick:e,className:N("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",n?"border-gray":"border-error"),children:[u(I,{children:t&&zn(t)}),u(K,{...Wn,name:"CalendarIcon"})]}),Xn=g((({className:e,label:t,value:n,error:l,onChange:a})=>p("div",{className:N("shrink-0 w-full",e),children:[t?u("div",{className:"mb-xs",children:u(Ve,{size:"text-m",font:"font-light",children:t})}):null,u(Yn,{value:n,onChange:a,valid:Boolean(!l)}),_t(l)]}))),qn={surname:"",name:"",middleName:""},Jn=(e,t=!0)=>p("div",{className:"space-y-s",children:[u(Ft,{label:"Фамилия*",...Mt(e("surname"),Gt)}),u(Ft,{label:"Имя*",...Mt(e("name"),Gt)}),u(Ft,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),t?u(Xn,{label:"Дата рождения*",...Mt(e("birthday"),Yt)}):null]}),Qn={...qn,typeForm:{key:"ANTIFRAUD",text:"Предупреждение о мошенничестве"},phone:"",birthday:void 0,isClient:!1,comment:"",consentDataProcessing:!1},Zn=St({typeForm:Yt,surname:Yt,name:Gt,birthday:Yt,phone:qt,isClient:Qt,comment:Yt,consentDataProcessing:Qt}),el=g((({button:e,link:t,onSubmit:n})=>{const l=i((e=>{const{typeForm:t,phone:l,...a}=e,i={...a,typeForm:t.key,phone:kt(l)};Ct(Zn(e))&&n(i,!0)}),[n]),[,{field:a,...r}]=wt(Qn,l);return u("form",{className:Bt,onSubmit:r.onSubmit,children:u(Rt,{children:p("div",{className:Pt,children:[Jn(a,!0),u(Wt,{label:"Телефон*",...Mt(a("phone"),qt)}),u(An,{...Mt(a("isClient"),Qt),text:'Являюсь клиентом банка АО "Россельхозбанк"'}),u(Ft,{...Mt(a("comment"),Yt),placeholder:"Комментарий*",isTextarea:!0}),Vn(a("consentDataProcessing"),t,e)]})})})})),tl=e=>p(Rt,{children:[p("div",{className:At,children:[u(Ft,{label:"Контактное лицо",...Mt(e("name"),Gt)}),u(Ft,{label:"ИНН",...Mt(e("inn"),Xt)})]}),p("div",{className:At,children:[u(Wt,{label:"Телефон",...Mt(e("phone"),qt)}),u(Ft,{label:"Электронная почта",...Mt(e("mail"),Yt)})]})]}),nl={name:"",phone:"",inn:"",mail:""},ll=St({region:Yt,name:Gt,phone:qt,inn:Xt,mail:Yt}),al=g((e=>{const{button:t,link:n,onSubmit:l}=e,a=i((e=>{const{region:t,name:n,phone:a,inn:i,mail:r}=e;Ct(ll(e))&&l({typeForm:"bcrd",region:t?.text||"",name:n,inn:i,mail:r,phone:kt(a)})}),[l]),[,{field:r,...s}]=wt(nl,a);return p("form",{className:Bt,onSubmit:s.onSubmit,children:[u(gn,{field:r}),tl(r),kn(t),u(It,{link:n})]})})),il={...qn,typeForm:{key:"CORRUPTION",text:"Факты коррупции"},phone:"",email:"",comment:"",consentDataProcessing:!1},rl=St({typeForm:Yt,surname:Yt,name:Gt,region:Yt,phone:qt,email:Yt,comment:Yt,consentDataProcessing:Qt}),sl=g((({button:e,link:t,onSubmit:n})=>{const l=i((e=>{const{typeForm:t,phone:l,region:a,...i}=e,r={...i,typeForm:t.key,regionBranch:a?.text,phone:kt(l)};Ct(rl(e))&&n(r,!0)}),[n]),[,{field:a,...r}]=wt(il,l);return u("form",{className:Bt,onSubmit:r.onSubmit,children:u(Rt,{children:p("div",{className:Pt,children:[Jn(a,!1),u(gn,{field:a}),u(Wt,{label:"Телефон*",...Mt(a("phone"),qt)}),u(Ft,{label:"Электронная почта*",...Mt(a("email"),Yt)}),u(Ft,{...Mt(a("comment"),Yt),placeholder:"Ваше сообщение*",isTextarea:!0}),Vn(a("consentDataProcessing"),t,e)]})})})})),ol=[];function cl(e){const{data:t}=ht(e?`/api/v1/branches?regionCode=${e}`:null,dl);return t||ol}const dl=async e=>await pt(e,{method:"GET"})||ol,ml=["От 1 000 ₽","До 1 000 000 000 ₽"],hl=["От 1 мес","До 15 лет"],ul=(e,t)=>p(Rt,{title:t,children:[p("div",{className:At,children:[u(Ft,{label:"Наименование организации",...Mt(e("fullName"),Yt)}),u(Ft,{label:"ИНН",...Mt(e("inn"),Xt)}),u(Wt,{label:"Телефон",...Mt(e("phone"),qt)})]}),p("div",{className:At,children:[u(Ft,{label:"Годовая выручка, ₽",...Mt(e("annualRevenue"),Yt)}),u(Ft,{label:"Контактное лицо",...Mt(e("name"),Gt)}),u(Ft,{label:"Электронная почта",...Mt(e("mail"),Yt)})]})]}),pl=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=l(!1),m=i((e=>{d(!0),r&&r(e)}),[]),h=i((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:h}},gl=(e,t,n)=>Math.max(t,Math.min(e,n));function xl(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function fl({list:e=[],min:t,max:n,step:l,value:a=e[0]||t,disabled:i,onChange:r}){const s=e.length?e.indexOf(a):a,o={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return p("div",{children:[e.length?u("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>u("div",{className:N("w-2 h-2 rounded-full",s<=t||i?"bg-gray":"bg-primary-main")},String(t))))}):null,u("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:u("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:o,type:"range",min:t,max:n,step:l,value:s,disabled:i,onInput:t=>{const n=xl(t.target?.value),l=e.length?e[n]:n;r&&r(l||0)}})})]})}const bl=1,yl=100,vl=g((e=>{const{className:t,title:n,items:l=[],list:a=[],min:r=(a.length?0:bl),max:s=(a.length?a.length-1:yl),step:o=1,value:c=a[0]||r,disabled:d=!1,onChange:m}=e,h=pl(e,{normalize:(e=0)=>a.length?Nl(a)(e):gl(e,r,s),format:Qe()}),g=i((e=>{m&&m(xl(e.target?.value))}),[m]);return p("div",{className:t,children:[p("label",{className:"block relative",children:[n?u(Ve,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,u("input",{className:N("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:d,onInput:g,...h}),fl({list:a,min:r,max:s,step:o,disabled:d,value:c,onChange:m})]}),wl(l)]})})),Nl=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),wl=e=>u("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>u(Ve,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),kl=(e,t)=>p(Rt,{title:t,children:[u("div",{className:At,children:u(vl,{title:"Сумма, ₽",items:ml,min:1e3,max:1e9,...e("amount")})}),u("div",{className:At,children:u(vl,{title:"Срок, месяцев",items:hl,min:1,max:180,...e("term")})})]}),Sl={amount:1e3,term:12,fullName:"",inn:"",name:"",phone:"",mail:"",annualRevenue:""},Cl=St({fullName:Yt,annualRevenue:Yt,inn:Xt,name:Gt,phone:qt,region:Yt,department:Yt}),Tl=g((({button:e,link:t,onSubmit:n})=>{const l=i((e=>{const{amount:t,term:l,fullName:a,inn:i,name:r,phone:s,mail:o,region:c,department:d,annualRevenue:m}=e;Ct(Cl(e))&&n({typeForm:"cred",fullName:a,inn:i,name:r,phone:kt(s),mail:o,region:c?.text||"",department:d?.text||"",partnerComments:`Сумма=${t}/Срок=${l}/Выручка=${m}`})}),[n]),[a,{field:r,...s}]=wt(Sl,l),o=cl(a.region?.key).filter((e=>e?.address));return p("form",{className:Bt,onSubmit:s.onSubmit,children:[kl(r,"Параметры"),ul(r,"Данные организации"),p(Rt,{title:"Офис банка",children:[u("div",{className:At,children:u(gn,{field:r})}),u("div",{className:At,children:u(pn,{label:"Адрес",placeholder:"Выберите адрес",options:o.map((({branchCode:e="",address:t=""})=>({key:e,text:t}))),...Mt(r("department"),Yt)})})]}),kn(e),u(It,{link:t})]})})),Il={name:"",phone:""},Bl=St({name:Gt,phone:qt}),Pl=g((({button:e,link:t,onSubmit:n})=>{const l=i((e=>{const{name:t,phone:l}=e;Ct(Bl(e))&&n({typeForm:"dpst",name:t,phone:kt(l)})}),[n]),[,{field:a,...r}]=wt(Il,l);return u("form",{className:Bt,onSubmit:r.onSubmit,children:u(Rt,{title:"Оставьте заявку и мы ответим на любые вопросы по депозитам",children:p("div",{className:Pt,children:[u(Ft,{label:"Имя",...Mt(a("name"),Gt)}),u(Wt,{label:"Телефон",...Mt(a("phone"),qt)}),kn(e),u(It,{link:t})]})})})})),Ml=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],Rl=[{key:"phone",text:"Телефонный звонок"},{key:"mail",text:"Электронное сообщение"}],Al=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Vl={typeForm:Yt,region:Yt,surname:Yt,name:Gt,feedbackMethod:Yt,phone:qt,email:Yt,comment:Yt,consentDataProcessing:Qt},zl={...qn,typeForm:{key:"FEEDBACK",text:"Задать вопрос по продуктам и услугам"},serviceDirection:{key:"Физическое лицо"},birthday:void 0,feedbackMethod:{key:"Телефонный звонок"},phone:"",email:"",comment:"",consentDataProcessing:!1},Dl=g((({button:e,link:t,onSubmit:n})=>{const l=i((e=>{_l(e.typeForm.key,e.serviceDirection?.key)?((e,t)=>{const n=St({...Vl,addressBranch:Yt,inn:Xt}),l={typeForm:e.typeForm.key,region:e.region?.text,addressBranch:e.addressBranch?.text||"",surname:e.surname,name:e.name,middleName:e.middleName,inn:e.inn,fullName:e.fullName,feedbackMethod:e.feedbackMethod.text,phone:kt(e.phone),secondaryPhoneNumber:e?.secondaryPhone,mail:e.email,bankEmpolee:e.bankEmpolee,applicationDate:e.applicationDate,comment:e.comment,consentDataProcessing:e.consentDataProcessing};Ct(n(e))&&t(l,!1)})(e,n):"FEEDBACK"===e.typeForm.key?((e,t)=>{const n=St({...Vl,birthday:Yt}),l={typeForm:e.typeForm.key,regionBranch:e.region?.text,surname:e.surname,name:e.name,middleName:e.middleName,birthday:e.birthday,feedbackMethod:e.feedbackMethod.text,phoneNumber:kt(e.phone),email:e.email,comment:e.comment,consentDataProcessing:e.consentDataProcessing};Ct(n(e))&&t(l,!0)})(e,n):((e,t)=>{const n=St({...Vl,addressBranch:Yt}),l={typeForm:e.typeForm.key,regionBranch:e?.region?.text,addressBranch:e.addressBranch?.text||"",surname:e.surname,name:e.name,middleName:e.middleName,feedbackMethod:e.feedbackMethod.text,phoneNumber:kt(e.phone),secondaryPhoneNumber:e.secondaryPhone?.replace(/[^+\d]/g,""),email:e.email,bankEmpolee:e.bankEmpolee,applicationDate:e.applicationDate,comment:e.comment,consentDataProcessing:e.consentDataProcessing};Ct(n(e))&&t(l,!0)})(e,n)}),[n]),[a,{field:r,...s}]=wt(zl,l),o="FEEDBACK_QS"===r("typeForm").value?.key,c=_l(r("typeForm").value?.key,r("serviceDirection").value?.key),d=cl(a?.region?.key).filter((e=>e?.address));return u("form",{className:Bt,onSubmit:s.onSubmit,children:u(Rt,{children:p("div",{className:Pt,children:[u(pn,{label:"Тема*",placeholder:"Выберите тему",options:Ml,...Mt(r("typeForm"),Yt)}),o?u(pn,{label:"Направление обслуживания*",placeholder:"Выберите направление",options:Al,...Mt(r("serviceDirection"),Yt)}):null,u(gn,{field:r}),o?u(pn,{label:"Адрес*",placeholder:"Выберите адрес",options:d.map((({branchCode:e="",address:t=""})=>({key:e,text:t}))),...Mt(r("addressBranch"),Yt)}):null,Jn(r,!0),c?p("div",{children:[u(Ft,{label:"ИНН*",...Mt(r("inn"),Xt)}),u(Ft,{label:"Наименование организации",...r("fullName")})]}):null,u(pn,{label:"Способ получения ответа*",options:Rl,...Mt(r("feedbackMethod"),Yt)}),u(Wt,{label:"Телефон*",...Mt(r("phone"),qt)}),o?p("div",{children:[u(Wt,{label:"Дополнительный телефон",...r("secondaryPhone")}),u(Ft,{label:"Электронная почта*",...Mt(r("email"),Yt)}),u(Ft,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...r("bankEmpolee")}),u(Ft,{label:"Дата и время обращения в Банк",...r("applicationDate")})]}):u(Ft,{label:"Электронная почта*",...Mt(r("email"),Yt)}),u(Ft,{...Mt(r("comment"),Yt),placeholder:"Ваше сообщение*",isTextarea:!0}),Vn(r("consentDataProcessing"),t,e)]})})})})),_l=(e="",t="")=>"FEEDBACK_QS"===e&&"Юридическое лицо / ИП"===t,Fl=g((e=>{const{button:t,sourceBookDir:n}=e,{regions:a}=bt(n||"regions-grant-support"),[i,r]=l({key:""}),s=se({className:"text-white",version:t?.version}),o=a?.find((e=>e.name===i.key))?.href;return p("div",{className:"container space-y-s",children:[a?u(pn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:a.map((({name:e=""})=>({key:e,text:e}))),value:i,onChange:r}):null,o?u("div",{className:"text-center",children:u(ge,{href:o,target:"_blank",className:N("p-m w-full @xl:w-auto",s),children:t?.text?t.text:"Перейти"})}):null]})})),El={...qn,phone:"",email:"",birthday:void 0,consentDataProcessing:!1},jl=St({surname:Gt,name:Gt,phone:qt,email:Yt,birthday:Yt}),Ol=g((e=>{const{button:t,link:n,product:l,onSubmit:a}=e,r=i((e=>{const{surname:t,name:n,middleName:i,phone:r,email:s,birthday:o,consentDataProcessing:c}=e;Ct(jl(e))&&a({typeForm:"dpst",surname:t,name:n,middleName:i,email:s,consentDataProcessing:c,phoneNumber:kt(r),birthday:o?.toISOString().slice(0,10)||"",product:l||""},!0)}),[a]),[,{field:s,...o}]=wt(El,r);return p("form",{className:Bt,onSubmit:o.onSubmit,children:[p(Rt,{children:[p("div",{className:At,children:[u(Ft,{label:"Фамилия",...Mt(s("surname"),Gt)}),u(Ft,{label:"Отчество (Обязательно, при наличии)",...s("middleName")}),u(Wt,{label:"Телефон",...Mt(s("phone"),qt)})]}),p("div",{className:At,children:[u(Ft,{label:"Имя",...Mt(s("name"),Gt)}),u(Xn,{label:"Дата рождения*",...Mt(s("birthday"),Yt)}),u(Ft,{label:"Электронная почта",...Mt(s("email"),Yt)})]})]}),Vn(s("consentDataProcessing"),n,t)]})})),Ll={...qn,typeForm:{key:"SELFCOLLECTION",text:"Самоинкассация"},fullName:"",phone:""},$l=St({typeForm:Yt,region:Yt,fullName:Yt,phone:qt}),Ul=g((({button:e,link:t,onSubmit:n})=>{const l=i((e=>{const{typeForm:t,region:l,fullName:a,phone:i}=e,r={typeForm:t.key,region:l?.text,name:a,phone:kt(i)};Ct($l(e))&&n(r,!0)}),[n]),[,{field:a,...r}]=wt(Ll,l);return u("form",{className:Bt,onSubmit:r.onSubmit,children:u(Rt,{children:p("div",{className:Pt,children:[u(Ft,{label:"ФИО*",...Mt(a("fullName"),Yt)}),u(gn,{field:a}),u(Wt,{label:"Телефон*",...Mt(a("phone"),qt)}),kn(e),u(It,{link:t})]})})})}));const Hl=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Wl={typeForm:Hl[0],...qn,email:"",phone:"",comment:"",consentDataProcessing:!1},Kl=St({typeForm:Yt,surname:Yt,name:Gt,phone:qt,email:Yt,addressBranch:Yt,consentDataProcessing:Qt}),Yl=g((({button:e,link:t,onSubmit:n,defaultType:l="PREMIUMSERVICE"})=>{const a=i((e=>{const{surname:t,name:l,middleName:a,email:i,comment:r,consentDataProcessing:s}=e,o={typeForm:e.typeForm.key,surname:t,name:l,middleName:a,phoneNumber:kt(e.phone),email:i,addressBranch:e.addressBranch?.key,comment:r,consentDataProcessing:s};console.log(o),Ct(Kl(e))&&n(o,!0)}),[n]),[r,{field:s,...o}]=wt({...Wl,typeForm:Gl(l)},a),c=function(){const{data:e}=ht("/api/v1/premiumBranchesByRegions",gt);return e||[]}(),d=c.map((({region:e})=>({key:e,text:e}))),m=r?.region?.key,h=c.find((e=>e?.region===m))?.branches;return p("form",{className:Bt,onSubmit:o.onSubmit,children:[p(Rt,{title:"Ваши данные",children:[p("div",{className:At,children:[u(Ft,{label:"Фамилия*",...Mt(s("surname"),Gt)}),u(Ft,{label:"Отчество (Обязательно, при наличии)",...s("middleName")}),u(Ft,{label:"Электронная почта*",...Mt(s("email"),Yt)})]}),p("div",{className:At,children:[u(Ft,{label:"Имя*",...Mt(s("name"),Gt)}),u(Wt,{label:"Телефон*",...Mt(s("phone"),qt)}),u(pn,{label:"Тип обслуживания*",options:Hl,...Mt(s("typeForm"),Yt)})]})]}),p(Rt,{title:"Офис банка",children:[u("div",{className:At,children:u(pn,{label:"Регион*",placeholder:"Выберите регион",options:d,...Mt(s("region"),Yt)})}),u("div",{className:At,children:u(pn,{className:"w-full",label:"Адрес*",placeholder:"Выберите отделение",options:(h||[]).map((({address:e=""})=>({key:e,text:e}))),...Mt(s("addressBranch"),Yt)})})]}),u(Ft,{...s("comment"),placeholder:"Комментарий, удобное время и прочее",isTextarea:!0}),Vn(s("consentDataProcessing"),t,e)]})})),Gl=e=>Hl.find((t=>t.key===e)),Xl=g((({name:e,text:t,value:n,checked:l,onChange:a,className:i})=>u("div",{className:i,children:p("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[u("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:n,name:e,checked:l,onChange:e=>a(e.target.value)}),t?u(Ve,{color:"text-primary-text",children:t}):null]})}))),ql=e=>{const{value:t,onChange:n}=e("vedTypes");return u(Rt,{children:p("div",{className:"gap-xl grid @xl:flex @xl:items-center",children:[u(Xl,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:e=>n&&n(e)}),u(Xl,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:e=>n&&n(e)}),u(Xl,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:e=>n&&n(e)}),u(Xl,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:e=>n&&n(e)})]})})},Jl=({textField:e,text:t,placeholder:n="",error:l})=>p("div",{children:[p("label",{className:"space-y-xs",htmlFor:"textarea",children:[t?u("div",{children:u(Ve,{size:"text-m",font:"font-light",children:t})}):null,u("textarea",{id:"textarea",placeholder:n,className:N("block w-full resize-y min-h-24 p-m outline-none border rounded-md border-gray","hover:border-primary-hover active:focus:border-primary-text focus:border-primary-text"),value:e.value,onInput:t=>e.onChange&&e.onChange(t.target?.value||"")})]}),_t(l)]}),Ql=({field:e,regions:t})=>{const n="currencyControl"===e("vedTypes").value;return p("div",{className:"space-y-s",children:[n?u(pn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:t.map((({code:e="",name:t=""})=>({key:e,text:t}))),...Mt(e("region"),Yt)}):null,p("div",{className:"grid @xl:grid-cols-2 @xl:gap-x-lg gap-s",children:[n?u(Ft,{label:"ИНН",...Mt(e("inn"),Xt)}):null,u(Ft,{label:"Наименование организации",...Mt(e("fullName"),Yt)}),u(Ft,{label:"ФИО",...Mt(e("name"),Gt)}),u(Wt,{label:"Телефон",...Mt(e("phone"),qt)}),n?null:u(Ft,{label:"Электронная почта",...Mt(e("mail"),Yt)})]})]})},Zl={fullName:"",name:"",phone:"",inn:"",vedTypes:"currencyControl",text:""},ea={fullName:Yt,name:Gt,phone:qt},ta=St({...ea,mail:Yt}),na=St({...ea,inn:Xt,region:Yt}),la=e=>"currencyControl"===e,aa=e=>({currencyControl:"currencyControl"===e,documentOperations:"documentOperations"===e,conversionTransactions:"conversionTransactions"===e,otherIssues:"otherIssues"===e}),ia={ApplicationFormBusinessCard:al,ApplicationFormWed:g((e=>{const{button:t,link:n,onSubmit:l}=e,a=i((e=>{const{fullName:t,name:n,phone:a,mail:i,inn:r,region:s,vedTypes:o,text:c}=e,d={typeForm:"KVED",fullName:t,name:n,phone:kt(a),text:c,vedTypes:aa(o),PartnerComments:c,...la(o)?{inn:r,region:s?.text||""}:{mail:i}};Ct((e=>la(e)?na:ta)(o)(e))&&l(d)}),[l]),[,{field:r,...s}]=wt(Zl,a),o=tn(),c=r("text");return p("form",{className:"container space-y-lg",onSubmit:s.onSubmit,children:[ql(r),u(T,{headingType:"h6",title:"Данные организации",className:"@xl:text-center"}),Ql({field:r,regions:o}),Jl({textField:c,text:"Обращение",placeholder:"Укажите интересующий вас вопрос, место ведения бизнеса и удобное время для телефонного звонка"}),kn(t),u(It,{link:n}),u(T,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),p("div",{className:"flex gap-xl",children:[p("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:[u(te,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),u("span",{children:"8 (800) 200-78-70"})]}),p("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[u(te,{image:{icon:"MailIcon"},width:"24",height:"24"}),u("span",{children:"ved@rshb.ru"})]})]})]})})),ApplicationFormDeposit:Pl,ApplicationFormCredit:Tl,ApplicationFormAcquiring:Tn,ApplicationFormGrantSupport:Fl,ApplicationFormIndividuals:Ol,ApplicationFormFeedback:Dl,ApplicationFormAntiFraud:el,ApplicationFormCorruption:sl,ApplicationFormSelfCollection:Ul,ApplicationFormUltraPremium:Yl},ra=g((({responseType:e})=>{const t="OK"===e;return p("div",{className:`flex items-center p-lg rounded-md space-x-m ${t?"bg-ok":"bg-fail"}`,children:[u(te,{image:{icon:(t?"ResponseOKIcon":"ResponseFailIcon")?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"42",height:"42"}),p("div",{children:[u(T,{headingType:"h6",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",className:"mb-2xs"}),u(Ve,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее"})]})]})})),sa={send:async function(e,t=!1){const n=t?"/api/v1/lead":"/api/v1/sendcorporatelead";try{const t=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(e)});return t?.ok?await t.json():null}catch(e){return null}}},oa=g((e=>{const{className:t,formBlock:n,...a}=e,[r,s]=l(""),o=i((async(e,t=!1)=>{const n=await sa.send(e,t)?"OK":"Fail";return s(n),n}),[]);return u(k,{className:t,defaultPadding:"p-6xl",...a,children:p("div",{className:"container max-w-[978px] space-y-lg",children:[n?.title?u(T,{headingType:"h3",title:n.title,className:"@xl:text-center"}):null,n?ca(n,o):null,r?u(ra,{responseType:r}):null]})})})),ca=(e,t)=>{const n=e?.formType;if(!n||!(n in ia))return null;return u(ia[n],{...e,onSubmit:t})},da="text-left",ma={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},ha=g((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:l,icon:a,...i})=>{const r=String(l?.width||t);return a?u("div",{style:{width:`${r}px`,height:`${r}px`},className:N("rounded-icon object-fit flex justify-center items-center",ma[n],e),children:u(K,{...i,width:"54%",height:"54%",name:a})}):null})),ua=g((({className:e="",title:t,benefitList:n,...l})=>p(k,{className:e,defaultPadding:"p-6xl",...l,children:[t?u(T,{headingType:"h3",as:"h2",className:da,title:t}):null,n?.length?u("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(pa)}):null]}))),pa=({label:e,description:t,items:n,icon:l,iconBgVersion:a,isDotted:i=!1},r)=>p("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[l?.icon?u(ha,{className:"shrink-0",defaultIconSize:56,iconBgVersion:a||"",...l}):null,l?.src?u(te,{className:"shrink-0",image:l}):null,e?p("div",{className:"@sm:h-full space-y-xs",children:[u(T,{headingType:"h6",children:e}),u(Ve,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),u(Je,{dotClassName:"bg-secondary-text",listItemSize:"S",items:n,isDotted:i})]}):null]},String(r)),ga=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function xa(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const fa=g((({className:e,style:t,idx:n,activeIndex:l,observerOptions:o,children:c,onIntersection:d})=>{const m=function(e,{sensitivity:t,rootRef:n}={}){const l=s(null),i=r((()=>({threshold:xa(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!l.current)return;const t=new IntersectionObserver(e,i);return t.observe(l.current),()=>{t.disconnect()}}),[e,i]),l}(i((e=>{e.length&&d&&d(n||0,e[e.length-1])}),[d,n]),o);return u("div",{className:N("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===l),ref:m,children:c})})),ba=["min-w-full","@lg:min-w-[50%]","@lg:min-w-[33.3%]","@lg:min-w-[25%]"],ya=g((({className:e,itemClassName:t,containerRef:n,activeIndex:l,visibleItemCount:a=0,gap:r=0,padding:o=0,listType:c="horizontal-list",snapAlign:d="snap-center",minHeight:m,children:h,onVisibleItemsChange:p,onVisibleIndicesChange:g})=>{const x={sensitivity:1,rootRef:n},f=s([]),b=i(((e,t)=>{const n=[...f.current||[]];n[e]=t,f.current=n,p&&p(n),g&&g(Na(n))}),[p,g]),y=a>0?r*Number(a)-1:0,v="vertical-list"===c,w="horizontal-list"===c,k={...w?va(o,y):{},...v?ga(m):{},gap:`${r}px`};return u("div",{className:N("box-border overflow-auto no-scrollbar",c,e),style:k,ref:n,children:(S=(e,n)=>u(fa,{className:N(d,a?ba[a-1]:"",v?"h-full":"",t),style:w?va(o/4):{},activeIndex:l,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(h)});var S})),va=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Na=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),wa={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},ka={"horizontal-list":"w-6","vertical-list":"h-6"},Sa=g((({className:e="",containerRef:t,activeIndex:n,dotCount:l=0,listType:a="horizontal-list",version:i})=>l?u("div",{className:N("flex gap-xs",wa[a],i?"group":"",e),"data-ver":i,children:Array.from({length:l}).fill(null).map(((e,l)=>u("div",{className:`cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white ${l===n?ka[a]:"w-2 h-2 opacity-30"}`,role:"button","aria-hidden":!0,onClick:()=>(e=>{e!==n&&t?.current&&t.current.children[e]?.scrollIntoView({behavior:"smooth",block:"nearest"})})(l)},String(l))))}):null)),Ca=e=>e,Ta=(e=Ca)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Ia=Ta(),Ba=(e=Ca)=>Ta((t=>-e(t))),Pa=Ba(),Ma=e=>t=>e.scrollWidth/t,Ra=e=>(t,n)=>{e.scrollBy({left:n*Ma(e)(t),behavior:"smooth"})},Aa=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=l([]),o=i((e=>{r((t=>{return(n=t)===(l=e)||Boolean(n&&l&&n?.length===l?.length&&n.every(((e,t)=>e===l[t])))?t:e;var n,l})),t&&t(e)}),[e]),[c,d]=a.length?[Ba()(a),Ta()(a)]:[-1,-1],m=c>0,h=d<e-1,u=i((()=>{var t;n.current&&(m?Ra(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{n.current&&(h?Ra(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,h]),g=i(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:u,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:h,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Va=g((({className:e,version:t,gap:n=14,padding:l=16,showDots:a=true,minHeight:i,children:r,onVisibleIndicesChange:s,listType:o="horizontal-list"})=>{const c=Array.isArray(r)?r.length:0,[d,m]=Aa({itemCount:c,onVisibleIndicesChange:s}),[h]=m.visibleIndicesRange;return p("div",{className:N(e,"vertical-list"===o?"relative h-full":""),children:[u(ya,{containerRef:d,activeIndex:h,visibleItemCount:1,gap:n,padding:l,onVisibleIndicesChange:m.handleVisibleIndicesChange,listType:o,minHeight:i,children:r}),a?u(Sa,{containerRef:d,activeIndex:h,dotCount:c,listType:o,version:t}):null]})})),za=(e,t,n)=>{return u(Va,{children:e.map((l=n,({icon:e,title:t,description:n},a)=>p("div",{className:N("flex flex-col gap-1","justify-between p-m h-full border border-gray",n||t?"":"justify-center"),children:[t?u(Ve,{size:"text-h6",font:"font-normal",align:l,children:t}):null,e?u(te,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?u(Ve,{size:"text-h6",font:"font-normal",align:l,children:n}):null]},String(a))))});var l},Da=g((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:l="4",subtitle:a,title:i,...r})=>p(k,{className:N("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[u(P,{defaultPadding:"",title:i,description:a,headlineVersion:"M"}),e?.length?za(e,0,t):null]}))),_a={start:"justify-start",center:"justify-center",end:"justify-end"},Fa=g((({buttons:e,className:t="",align:n,...l})=>{const a=n?N("flex",_a[n]):"";return u(k,{className:N("!bg-transparent",a,t),defaultPadding:"p-0",...l,children:We(e)})})),Ea=g((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=l(n),c=i((()=>{o((e=>!e))}),[]),d=a({isUnfolded:s,onToggle:c}),m=r?r({isUnfolded:s,onToggle:c}):null;return p("div",t?{className:e,children:[m,d]}:{className:e,children:[d,m]})}));const ja=g((({className:e="",isUnfolded:t,children:n})=>{const l=s(null),i=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const l=new ResizeObserver((n=>{e(t,n[0])}));return l.observe(t),()=>{l.disconnect()}}),[e,...t]),n}((e=>{l.current&&(l.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return u("div",{ref:l,className:`transition-max-h duration-300 overflow-hidden ${l.current||!t?"max-h-0":""} `,children:u("div",{className:e,ref:i,children:n})})})),Oa=g((({className:e,title:t,value:n,fractionDigits:l,fixed:a,prefix:i,postfix:r})=>p("div",{className:N("flex justify-between @xl:flex-col",e),children:[t?u(Ve,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}):null,u("div",n?{children:u(Ve,{size:"text-h3",children:[i,Qe(l,{fixed:a})(n),r].filter(Boolean).join(" ")})}:{children:u(Ve,{size:"text-h3",children:"-"})})]}))),La=1e4,$a=5e6,Ua=Math.round(29.5),Ha={minSum:La,maxSum:$a,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Wa={minSum:La,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},Ya={minSum:5e4,maxSum:5e6,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0},Ga={minSum:1e3,maxSum:5e5,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Xa=e=>e?u(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e}):null,qa=g((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:l=2,depositeName:a,isShowDepositeName:i})=>p("div",{children:[u(Ve,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}),p("div",{className:"relative",children:[p("div",{className:"flex justify-start gradient-color-text",children:[u("span",{className:"font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]",children:Qe(l,{fixed:!0})(e)}),n?u("span",{className:"text-7xl",children:n}):null]}),a&&i?u("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Ja=g((({title:e="Ставка",isUnavailableByTerm:t=!1})=>p("div",{className:"space-y-s",children:[u(Ve,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),u(K,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),u("div",{className:"w-64",children:t?p(I,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",u("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):u(I,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),Qa=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:l=2,isUnknownRateShown:a=!0,...i})=>a&&0===t?u(Ja,{title:e,...i}):p("div",{children:[u("div",{className:"hidden @xl:block",children:u(qa,{title:e,rate:t,unit:n,fractionDigits:l,...i})}),u("div",{className:"@xl:hidden",children:u(Oa,{title:e,value:t,postfix:n,fractionDigits:l,fixed:!0,...i})})]});function Za({isShowItems:e=!0,step:t=1e3,...n}){const l=[`От ${Qe(2)(n.min||0)} ₽`,`До ${Qe(2)(n.max||0)} ₽`];return u(vl,{items:e?l:[],step:t,...n})}function ei(e){const{data:t}=ht(`/wcms-resources/${e}.json`,gt);return t}const ti=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:l}=e,a=ei(t||"bonus-calculator-data")||Ka,[i,r]=((e,t,n)=>{const{minSumTravel:l,minSumOther:a,maxBonus:i,prefMonthsNum:r,prefTravelBonusRate:s,prefRestBonusRate:o,travelBonusRate:c,restBonusRate:d}=e;if(t===l&&n===a)return[0,0];const m=Math.min(Math.round(s*t)+Math.round(o*n),i);return[m,m*r+Math.min(Math.round(c*t)+Math.round(d*n),i)*(12-r)]})(a,n,l);return{...a,...e,monthBonus:i,yearBonus:r}},ni=g((({className:e="",sourceBookDir:t,buttons:n,footnote:l})=>{const[a,{field:i}]=wt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:r,maxSumTravel:s,minSumOther:o,maxSumOther:c,monthBonus:d,yearBonus:m}=ti(a,t);return p("section",{className:N("flex flex-col justify-between @5xl:flex-row gap-y-4xl",e),children:[p("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:[Za({title:"Сумма покупок в категории путешествия, ₽",min:r,max:s,step:500,isShowItems:!1,...i("travelExpenseValue")}),Za({title:"Сумма покупок в остальных категориях, ₽",min:o,max:c,step:500,isShowItems:!1,...i("restExpenseValue")})]}),d>=0?Qa({title:"Баллов за месяц",rate:d,fractionDigits:0,isUnknownRateShown:!1,unit:""}):null,p("div",{className:"flex flex-col gap-y-xl @xl:w-96",children:[m>=0?u(Oa,{title:"Баллов за год",value:m}):null,We(n,{isVertical:!0}),Xa(l)]})]})})),li=g((({className:e,inputChildren:t,rateChildren:n,resultChildren:l})=>p("section",{className:N("flex flex-col justify-between @5xl:flex-row gap-m",e),children:[u("div",{className:"flex flex-col gap-y-m sm:max-w-md gap-2xl",children:t}),u("div",{className:"border-b border-main-divider md:hidden"}),n,u("div",{className:"flex flex-col gap-2xl sm:w-96 max-w-full",children:l})]}))),ai=(e,t=0)=>e?.sum&&e.sum>=La&&e.sum<=$a?e.sum:t,ii=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,ri=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,si={horizontal:"gap-5xl",vertical:"flex-col gap-s"},oi=g((({items:e,checkedItem:t,className:n,onChange:l,orientation:a="horizontal"})=>u("div",{className:N(`flex ${si[a]}`,n),children:e?.map((({id:e,text:n})=>u(Mn,{isRadio:!0,text:n,value:t===e,onChange:()=>l&&l(e)},String(e))))}))),ci=({items:e,title:t,mobileTitle:n=t,orientation:l="horizontal",value:a,radioGroupClassName:i,onChange:r})=>p("div",{className:"space-y-s",children:[t?u("div",{className:"hidden @5xl:block",children:u(Ve,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?u("div",{className:"@5xl:hidden",children:u(Ve,{color:"text-secondary-text",font:"font-light",children:n})}):null,u(oi,{orientation:l,items:e,checkedItem:e[a?0:1].id,className:N("flex-col sm:flex-row",i),onChange:t=>r&&r(t===e[0].id)})]}),di=e=>ci({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),mi=([e,t],n,l=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:hi([e,t],l),hi=([e,t],n=[])=>({[e]:n.length?Pa(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Ia(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),ui=(e,[t,n],l)=>e>=l[t]&&e<=l[n],pi=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,gi=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:l,daysValue:a}=t;return n?Math.round(l*Math.pow((1200+e)/1200,a/30)-l):Math.round(l*e*a/365/100)},xi=g((({className:e="",rateParams:t,buttons:n,footnote:l,bottomFootnote:a,isShowDepositeName:i,defaultParams:r})=>{const[s,{field:o}]=wt({moneyValue:ai(r,1e5),daysValue:ii(r,90),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),c=((e,t)=>{const{daysValue:n,moneyValue:l,isPartialWithdrawal:a,isReplenished:i,isMonthlyInterestPayment:r}=e,s=ei(t||"business-calculator-data"),o=i||a,c=n<90||n>730;if(n<=30)return{...Ga,...e,isDisabledOperatingDeposit:c,isUnavailableByTerm:!0};const d=s?.rateRows?.find((e=>r===e.isMonthlyInterestPayment&&pi(o,e)&&ui(l,["minSum","maxSum"],e)&&ui(n,["minDays","maxDays"],e)))||Ga,{rate:m}=d,h=gi(m,e),u=l+h,p=s?.rateRows||[Ga];return{...d,...hi(["minSum","maxSum"],p),...hi(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:c,income:h,finalSum:u}})(s,t?.rateType&&t.sourceBookDir),{income:d,finalSum:m,rate:h,isUnavailableByTerm:g,depositeName:x}=c;return u(li,{className:e,inputChildren:p("div",{children:[Za({title:"Сумма, ₽",min:c.minSum,max:c.maxSum,...o("moneyValue"),value:c.moneyValue}),(f={title:"Срок, дней",min:c.minDays,max:c.maxDays,...o("daysValue"),value:c.daysValue},u(vl,{items:[`От ${ri(f.min||0)}`,`До ${ri(f.max||0)}`],step:1,...f})),p("div",{className:"flex flex-col sm:flex-row gap-y-4 gap-x-14",children:[fi(c,o),di({title:"Выплата процентов",orientation:"vertical",...o("isMonthlyInterestPayment"),radioGroupClassName:"sm:flex-col"})]})]}),rateChildren:Qa({rate:h,depositeName:x,isShowDepositeName:i,isUnavailableByTerm:g}),resultChildren:p("div",{children:[bi(m,d),We(n,{isVertical:!0}),Xa(l),Xa(a)]})});var f})),fi=(e,t)=>p("div",{className:"space-y-s",children:[u(Ve,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),p("div",{className:"flex flex-col gap-y-xl sm:gap-y-s",children:[u(Mn,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),u(Mn,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),bi=(e,t)=>p("div",{className:"flex flex-col gap-2xl sm:gap-0 mb-lg",children:[u(Oa,{title:"Доход в конце срока",value:t,postfix:"₽",prefix:"+"}),u(Oa,{title:"Сумма в конце срока",value:e,postfix:"₽"})]}),yi=({min:e=0,max:t=0,availableMonths:n,...l})=>u(vl,{items:[`От ${vi(e)}`,`До ${vi(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...l}),vi=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Ni=e=>ci({...e,radioGroupClassName:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),wi=e=>ki({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&ki({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&ki({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&ki({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),ki=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:l,viewSettingFieldKey:a})=>!!n&&!n[a]||t[l]===e[l],Si=(e,t)=>{const{isAnnuity:n,moneyValue:l,monthsValue:a,moneyExtra:i}=t;if(0===e)return 0;if(n){const t=e/1200;return i?(l+i)*(t+t/(Math.pow(1+t,a)-1)):l*(t+t/(Math.pow(1+t,a)-1))}return Math.round(l/a)+l*(e/1200)},Ci=(e,t,n)=>{const{moneyValue:l,monthsValue:a}=e,i=ei(t||"credit-calculator-data"),s=i?.rateRows||[Ha],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>wi({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:i?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=mi(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=mi(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:l,monthsValue:a})=>e?.find((e=>wi({row:e,userInputParams:t,paramsViewSettings:n})&&ui(l,["minSum","maxSum"],e)&&ui(a,["minMonths","maxMonths"],e)))||Ha)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:l,monthsValue:a}),{rate:p}=u,g=Si(p,e);return r((()=>({...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:l,monthsValue:a,monthlyPayment:g})),[e,i])},Ti=g((({className:e,sourceBookDir:t,buttons:n,footnote:l,paramsViewSettings:a,defaultParams:i})=>{const[r,{field:s}]=wt({moneyValue:ai(i,2e5),monthsValue:ii(i,Ua),isAnnuity:Boolean(i?.isAnnuity),isInsurance:Boolean(i?.isEnableInsurance),isSalaryClient:Boolean(i?.isEnableSalaryClient),isPensionClient:Boolean(i?.isEnablePensionClient),isStateEmployee:Boolean(i?.isEnableStateEmployee)}),o=Ci(r,t,a),c=Ni({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...s("isAnnuity")});return u(li,{className:e,inputChildren:p("div",{children:[Za({title:"Сумма кредита, ₽",step:500,min:o.minSum,max:o.maxSum,...s("moneyValue"),value:o.moneyValue}),yi({title:"Срок кредита, месяцев",min:o.minMonths,max:o.maxMonths,...s("monthsValue"),value:o.monthsValue}),Ii({...o,...a},s),u("div",{className:"sm:hidden",children:c})]}),rateChildren:Qa({rate:o.rate}),resultChildren:p("div",{children:[u(Oa,{title:"Ежемесячный платёж",value:o.monthlyPayment,postfix:"₽"}),u("div",{className:"hidden sm:block mb-lg",children:c}),We(n,{isVertical:!0}),Xa(l)]})})})),Ii=(e,t)=>p("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?u(Mn,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?u(Mn,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?u(Mn,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?u(Mn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Bi=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,l]=t[n-1],[a,i]=t[n];l>=a?t.splice(n-1,2,[e,Math.max(l,i)]):n++}return t},Pi=(e,t,n)=>{const{moneyValue:l,monthsValue:a}=e,i=ei(t||"deposit-calculator-data"),r=i?.rateRows?.[0]?Ai(i.rateRows[0].minMonths,i.rateRows[0].maxMonths):0,s=!n?.isShowMonthlyInterestPayment,o=!n?.isShowRemoteRegistration,c=i?.rateRows?.find((t=>Ri({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:s})&&Ri({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:o})&&ui(l,["minSum","maxSum"],t)&&ui(a||r,["minMonths","maxMonths"],t)))||Ya,{rate:d}=c,m=Mi(d,e),h=l+m,u=i?.rateRows||[Ya];return{...c,...hi(["minSum","maxSum"],u),...hi(["minMonths","maxMonths"],u),availableMonths:Bi(u.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((l,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:r,income:m,finalSum:h}},Mi=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:l,monthsValue:a}=t;return n?Math.round(l*Math.pow((1200+e)/1200,a)-l):Math.round(l*e*30*a/365/100)},Ri=({row:e,userInputParams:t,paramKey:n,isExclude:l})=>l||t[n]===e[n],Ai=(e,t)=>e+Math.round((t-e)/2),Vi=g((({className:e,sourceBookDir:t,buttons:n,footnote:l,paramsViewSettings:i,defaultParams:r})=>{const[s,{field:o}]=wt({moneyValue:ai(r,2e4),monthsValue:ii(r),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(r?.isRemoteRegistration)}),c=Pi(s,t,i),{defaultMonth:d,rate:m,income:h,finalSum:g}=c,{onChange:x}=o("monthsValue");return a((()=>{!s.monthsValue&&x&&x(d)}),[d]),u(li,{className:e,inputChildren:p("div",{children:[Za({title:"Сумма, ₽",min:c.minSum,max:c.maxSum,...o("moneyValue"),value:c.moneyValue}),yi({title:"Срок, месяцев",min:c.minMonths,max:c.maxMonths,availableMonths:c.availableMonths,...o("monthsValue"),value:c.monthsValue}),zi({...c,...i},o)]}),rateChildren:Qa({rate:m}),resultChildren:p("div",{children:[u(Oa,{title:"Доход в конце срока",value:h,postfix:"₽",prefix:"+"}),u(Oa,{title:"Сумма в конце срока",value:g,postfix:"₽"}),We(n,{isVertical:!0}),Xa(l)]})})})),zi=(e,t)=>{return p("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowMonthlyInterestPayment?di({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment}):null,e.isShowRemoteRegistration?(n={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration},ci({...n,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]});var n},Di=e=>_i({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&_i({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),_i=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:l,viewSettingFieldKey:a})=>!!n&&!n[a]||t[l]===e[l],Fi=(e,t,n)=>{const{moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:s}=e,o=ei(t||"refinancing-calculator-data"),c=o?.rateRows||[Wa],d=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Di({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:o?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:m,maxSum:h}=mi(["minSum","maxSum"],d,c),{minMonths:u,maxMonths:p}=mi(["minMonths","maxMonths"],d,c),g=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>Di({row:e,userInputParams:t,paramsViewSettings:n})&&ui(l+r,["minSum","maxSum"],e)&&ui(i,["minSumOld","maxSumOld"],e)&&ui(r,["minSumExtra","maxSumExtra"],e)&&ui(a,["minMonths","maxMonths"],e)))||Wa)({rateRows:c,userInputParams:e,paramsViewSettings:n,moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:s}),{rate:x}=g,f=Si(x,e),b=e.oldMonthlyPayment-f;return r((()=>({...g,...e,minSum:m,maxSum:h,minMonths:u,maxMonths:p,moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:s,monthlyPayment:f,benefit:b})),[e,o])},Ei=g((({className:e,sourceBookDir:t,buttons:n,footnote:l,paramsViewSettings:a})=>{const[i,{field:r}]=wt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),s=Fi(i,t,a),o=Ni({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...r("isAnnuity")});return u(li,{className:e,inputChildren:p("div",{children:[Za({title:"Остаток долга в других банках, ₽ ",step:500,min:s.minSum,max:s.maxSum-s.maxSumExtra,...r("moneyValue"),value:s.moneyValue}),Za({title:"Ежемесячный платёж в других банках, ₽",step:500,min:s.minSumOld,max:s.maxSumOld,...r("oldMonthlyPayment"),value:s.oldMonthlyPayment}),yi({title:"Новый срок кредита, месяцев",min:s.minMonths,max:s.maxMonths,...r("monthsValue"),value:s.monthsValue}),ji({...s,...a},r),s.isExtraMoney?Za({title:"Дополнительная сумма, ₽ ",step:500,min:s.minSumExtra,max:s.maxSumExtra,...r("moneyExtra"),value:s.moneyExtra}):null,u("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:o})]}),rateChildren:Qa({rate:s.rate,fractionDigits:1}),resultChildren:p("div",{children:[u(Oa,{title:"Ежемесячный платёж",value:s.monthlyPayment,postfix:"₽"}),s.benefit>0?u(Oa,{title:"Выгода в месяц",value:s.benefit,postfix:"₽"}):null,u("div",{className:"hidden sm:block mb-lg",children:o}),We(n,{isVertical:!0}),Xa(l)]})})})),ji=(e,t)=>p("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?u(Mn,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?u(Mn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,u(Mn,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Oi={CreditCalculatorForm:Ti,DepositCalculatorForm:Vi,BusinessDepositCalculatorForm:xi,BonusCalculatorForm:ni,RefinancingCalculatorForm:Ei},Li=g((({className:e,calculatorTabs:t=[],...n})=>u(k,{className:e,defaultPadding:"p-0",...n,children:Ui(t)}))),$i=e=>{const t=e.calculatorBlock?.calcType;if(!t||!(t in Oi))return null;const n=Oi[t];return p("div",{className:"p-xl",children:[e?.calculatorBlock?.title?u(T,{className:"mb-lg",title:e?.calculatorBlock?.title}):null,u(n,{...e.calculatorBlock,isMobile:!0})]})},Ui=e=>{if(!e||!e.length)return null;return 1===e.length?$i(e[0]):e.map(((e,t)=>u(Ea,{isFoldButtonOnTop:!0,unfoldedByDefault:0===t,renderFoldableSection:({isUnfolded:t})=>u(ja,{isUnfolded:t,children:$i(e)}),renderFoldButton:Hi(e)},t.toString())))},Hi=e=>({isUnfolded:t,onToggle:n})=>{const l=e.nav?.align||"text-left";return p("button",{onClick:n,className:"w-full p-xl bg-primary-main flex items-center border-b border-white",children:[u("div",{className:"w-11 h-11 bg-white rounded-md flex justify-center items-center",children:u(K,{name:e.nav?.icon?.icon,iconVersion:"color",width:"24",height:"24"})}),p("div",{className:"flex-1 flex flex-col pl-s",children:[u(Ve,{align:l,color:"text-white",children:e.nav?.title}),u(Ve,{align:l,size:"text-s",color:"text-white",font:"font-light",children:e.nav?.description})]}),u(K,{name:t?"ArrowUpIcon":"ArrowDownIcon",iconVersion:"white",width:"24",height:"24"})]})},Wi=g((e=>{const{onChange:t,min:n,max:l,defaultValue:a="0",fractionDigits:r=0,...s}=e,o=pl(e,{normalize:(e=a)=>n&&l?String(gl(Number(Ki(e)),n,l)):Ki(e),format:Qe(r)}),c=i((e=>t&&t(Ki(e))),[t]);return u(Vt,{onChange:c,...s,...o})})),Ki=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Yi=g((e=>u(Wi,{...e,fractionDigits:2,children:u("div",{className:"absolute right-4 bottom-4",children:u(Ve,{size:"text-xl",font:"font-light",children:"₽"})})}))),Gi={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Xi={amount:1500},qi=g((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",placeholder:i="1500",button:r,formType:s="private",...o})=>{const[{amount:c},{field:d}]=wt(Xi),[m,h]=l(!1);return a((()=>{h(c<=0)}),[c]),p(k,{className:N("flex flex-col items-center",e),defaultPadding:"p-6xl",...o,children:[t?u(T,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,p("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Gi[s],children:[u(Yi,{valid:!m,placeholder:i,label:n,...d("amount",{parse:Number,format:String})}),u("input",{type:"hidden",name:"amount",value:c}),r?.text?u(wn,{className:"w-full mt-lg",type:"submit",disabled:m,children:r.text}):null]})]})})),Ji=(e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=l(t),o=i((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=i((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]},Qi=g((({className:e,disabled:t,...n})=>u(ge,{rounded:!0,className:N("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,...n,children:u(te,{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"})}))),Zi=g((e=>u(Qi,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),er=g((e=>u(Qi,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),tr="absolute top-[calc(50%-24px)] z-40",nr="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",lr=g((({scroll:e,activeIndex:t,itemCount:n,arrowsPadded:l,hasEdgeBlocks:a,onScrollLeft:r,onScrollRight:s})=>{const{canScrollLeft:o,canScrollRight:c,scrollLeft:d,scrollRight:m}=e,h=a?t>0:o,g=a?t<n-1:c,x=i((()=>{a?(o&&t!==n-1&&d(),r()):d()}),[d,r,a,o,t,n]),f=i((()=>{a?(c&&0!==t&&m(),s()):m()}),[m,s,a,o,t,n]);return p("div",{className:"hidden @lg:block",children:[ar(e),h?u(Zi,{className:N(tr,l?"left-1 @lg:left-8":"left-0"),onClick:x}):null,g?u(er,{className:N(tr,l?"right-1 @lg:right-8":"right-0"),onClick:f}):null]})})),ar=e=>p("div",{children:[e.canScrollLeft?u("div",{className:N(nr,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?u("div",{className:N(nr,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),ir=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",rr=({className:e,text:t="ХИТ"}={})=>p("div",{className:N("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[u(K,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),u(I,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),sr="relative h-full",or={small:"sm:min-w-64",normal:"sm:min-w-96",big:"sm:min-w-[515px]"},cr=({noCardBorder:e,activeIndex:t,cardSize:n="normal",...l})=>{const{blocks:a}=l.block||{},i=a?.some(hr);return D({...l,renderProps:(l,a,r)=>p("div",{className:dr(l,{someCardsHighlighted:i}),children:[A(l,a,{className:mr(l,{someCardsHighlighted:i,showBorder:!e,cardSize:n}),blockIndex:r,isActive:r===t}),hr(l)?rr({className:"absolute top-0 -right-4 z-40"}):null]},String(r))})},dr=(e,{someCardsHighlighted:t})=>N(sr,t&&(hr(e)?"pt-3xl":"pt-3xl sm:pt-16")),mr=(e,{someCardsHighlighted:t,showBorder:n,cardSize:l="normal"})=>N(sr,"min-w-80",or[l],t&&(hr(e)?"pt-3xl sm:pt-16":"pt-3xl"),ir(n),n&&"h-full"),hr=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,ur=g((({className:e,itemCount:t,visibleItemCount:n=0,noCardBorder:l,isAlignCenter:a,arrowsPadded:i=!0,isGap:r=!0,cardSize:s="normal",...o})=>{const{blocks:c=[]}=o.block||{},d=t||c?.length,[m,{inc:h,dec:g}]=Ji({itemCount:d,visibleItemCount:n},Math.floor(n/2)),[x,f]=Aa({itemCount:d}),[b]=f.visibleIndicesRange,y=c&&"CarouselBankHistoryCard"===c[0]?.type;return p(k,{className:e,defaultPadding:"p-6xl",...o,children:[p("div",{className:N(a?"flex justify-center":"","relative max-w-full"),children:[u(ya,{containerRef:x,visibleItemCount:n,snapAlign:"snap-start",gap:r?16:void 0,onVisibleIndicesChange:f.handleVisibleIndicesChange,children:cr({noCardBorder:l,activeIndex:m,cardSize:s,...o})}),u(lr,{scroll:f,arrowsPadded:i,onScrollLeft:g,onScrollRight:h,hasEdgeBlocks:y,activeIndex:m,itemCount:d})]}),u(Sa,{className:"@5xl:hidden",containerRef:x,activeIndex:b,dotCount:d,listType:"horizontal-list"})]})}));ur.childrenTypes=["CarouselCard","CarouselBankHistoryCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],ur.childSchema=()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}});const pr=g((({title:e,description:t,className:n})=>u(k,{className:n,defaultPadding:"p-6xl",children:u(P,{headlineVersion:"XS",title:e,description:t,align:"text-left",className:"text-primary-text",isEmbedded:!0})}))),gr="z-10 border border-solid w-full h-full",xr=N(gr,"absolute hidden @xl:block border-transparent"),fr=g((({className:e,title:t,description:n,button:l,...a})=>u(k,{className:N("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:p("div",{className:"relative h-full",children:[u("div",{className:N(xr,"top-9 right-12 bg-green-dark")}),u("div",{className:N(xr,"top-6 right-8 bg-green")}),u("div",{className:N(xr,"top-3 right-4 bg-green-light")}),p("div",{className:N(gr,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[u(P,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),We([l],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),br={black:"bg-black",white:"bg-white"},yr=g((({className:e="",title:t,description:n,image:l,price:a,button:i,colors:r=[],align:s="text-left",padding:o,...c})=>u(k,{className:N("flex flex-col justify-left",e),defaultPadding:"p-2xl",...c,children:p(ve,{className:"h-full",padding:o,title:u(P,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:l?.src?u(te,{className:"flex justify-center align-center mb-xl",image:l}):null,buttons:We([i],{buttonClassName:"w-full self-end"}),children:[r?.length?p("div",{className:"flex text-secondary-text mb-m",children:[u("div",{className:"mr-xs",children:u(Ve,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(vr)]}):null,a?p(Ve,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),vr=(e,t)=>u("div",{role:"figure",className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${br[e]}`},String(t)),Nr=g((({textNode:e,iconNode:t,tag:n,onClick:l,justifyContent:a="between",className:i,...r})=>p(n,{tag:n,className:N("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",i),onClick:l,...r,children:[e?u("div",{children:e}):null,t?u("div",{children:t}):null]}))),wr=g((({className:e="",label:t,icon:n,dataTheme:l="",disabled:a=!1,onClick:i})=>u(Nr,{tag:"button",onClick:i,disabled:a,"data-theme":l,justifyContent:"center",className:N("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:u(Ve,{size:"text-h4",children:t}),iconNode:n?u(te,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),kr=({isUnfolded:e,onToggle:t})=>u(wr,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Sr=g((({className:e="",icon:t,...n})=>{const l=de(),{text:a,href:i,target:r,onClick:s}=l(n);return a?u("div",{className:N("w-full pb-lg",e),children:p("a",{className:"bg-white flex justify-between rounded-md w-full p-lg whitespace-nowrap",role:"link",href:i,target:r,onClick:s,children:[p("div",{className:"flex items-center space-x-lg",children:[t?u(te,{imageClassName:"text-green-dark",image:t,width:"20",height:"20"}):null,u(Ve,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})]}),u(K,{className:"text-green",name:"ArrowRightIcon",width:"20",height:"20"})]})}):null})),Cr=g((({className:e,additionalDescription:t,description:n,links:l=[],title:a,...i})=>p(k,{className:e,...i,children:[p("div",{children:[u(P,{isEmbedded:!0,title:a,description:n,as:"h1",align:"text-left"}),u(P,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),l?.length?Tr(l):null]}))),Tr=(e,t=3)=>{const n=(e||[]).map(((e,t)=>u(Sr,{...e},String(t)))),[l,a]=t>0?[n.slice(0,t),n.slice(t)]:[n,[]];return u("div",{className:"mt-4xl",children:a.length>0?u(Ea,{renderFoldableSection:({isUnfolded:e})=>p("div",{children:[u("div",{className:"mb-1",children:l}),u(ja,{isUnfolded:e,children:a})]}),renderFoldButton:Ir}):u("div",{children:l})})},Ir=({isUnfolded:e,onToggle:t})=>e?null:u(wr,{className:"border-t-main-divider/50",icon:"PlusIcon",label:"Показать еще",onClick:t}),Br=g((({className:e="",href:t,target:n,isRemote:l=!1,children:a})=>{const i=de({isRemote:l})({href:t,target:n});return u(t?"a":"div",{className:N("block",e),...t?i:{},children:a})})),Pr=[{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"}}],Mr=e=>Pr.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{},Rr=g((({className:e="",media:t,showButtonText:n,stretched:a,version:i="white",children:r})=>{const[s,o]=l(),c=t?.map((e=>{const{href:t,icon:l,text:a}=e,{iconMapped:r}=Mr(t),c=He(l)?l:r,d=n?{text:a}:{text:""};return!s&&a&&o(!0),{...e,...d,icon:{...c,iconVersion:"color"},version:e?.version??i}})),d=N("border border-solid hover:border-transparent group-data-primary:border-main-divider border-main-divider group-data-gray:border-green group/media",n&&s?"":"basis-auto",a?"flex-1 justify-center":"");return p("div",{className:N("flex flex-col gap-xs",e),children:[u("div",{className:"flex gap-xs",children:We(c,{className:N(a||s?"basis-full":""),buttonClassName:d})}),r?u(Ve,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Ar=g((({className:e,padding:t,description:n,additionalDescription:l,href:a,icon:i,items:r=[],isDotted:s,socialMedia:o=[],target:c,title:d,align:m="text-left",benefits:h,imageOptions:{directionRight:g=!0,isImageAlwaysOnRight:x=false,isImageSecondary:f=!1}={},...b})=>u(k,{className:N("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...b,children:u(Br,{href:a,target:c,className:"h-full",children:p(ve,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:u(P,{title:d,description:n,headlineVersion:"XS",isEmbedded:!0,align:m}),...it(He(i)?u(te,{image:i}):null,g),buttons:o.length?u(Rr,{media:o,showButtonText:!0,version:b?.version}):null,isImageAlwaysOnRight:x,isImageSecondary:f,imageAlign:"center",children:[u(Ue,{benefits:h}),u(Je,{items:r,isDotted:s,listItemSize:"S"}),Vr(l,m)]})})}))),Vr=(e,t)=>e?u(I,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,zr=(e,t)=>{const{title:n,description:l,buttons:a}=e;return p("div",{className:"py-lg border-b border-main-divider",children:[n?u("div",{className:"opacity-80",children:u(Ve,{size:"text-m",color:"text-secondary-text",children:n})}):null,l?u("div",{className:"mt-2xs",children:u(Ve,{size:"text-xl",color:"text-primary-text",children:l})}):null,a?.length?u("div",{className:"text-primary-main",children:We(a)}):null]},String(t))},Dr=g((({className:e="",title:t,align:n="text-center",icon:l,button:a,visibleCellsCount:i=1,cardCells:r=[],...s})=>{const o=r.map(zr),[c,d]=i>0?[o.slice(0,i),o.slice(i)]:[o,[]];return p(k,{className:N("flex flex-col",e),defaultPadding:"p-2xl",...s,children:[He(l)?u("div",{className:"self-center",children:u(te,{image:l})}):null,t?u(T,{className:N("pt-xs",n),headingType:"h5",title:t}):null,a?.text?u(ge,{className:"w-full mt-m mb-lg",...a}):null,d.length?u(Ea,{renderFoldableSection:({isUnfolded:e})=>p("div",{children:[c,u(ja,{isUnfolded:e,children:d})]}),renderFoldButton:r.length>1?_r:null}):u("div",{children:c})]})})),_r=({isUnfolded:e,onToggle:t})=>p("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:t,children:[u("div",{children:e?"Скрыть":"Подробнее о тарифе"}),u(K,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Fr=(e=!1)=>e?"text-white":"",Er=(e=!1)=>"text-s mb-m "+(e?"text-white":"text-secondary-text/80"),jr=g((({icon:e,image:t,title:n,subtitle:l,isFillGradient:a})=>p("div",{className:"space-y-4",role:"columnheader",children:[e?u(te,{className:"h-16 w-16 min-w-16 min-h-16",image:e,width:"64",height:"64"}):null,t?.src&&u("div",{children:u(te,{image:t})}),n?u(T,{headingType:"h4",className:Fr(a),title:n}):null,l?u("div",{className:Er(a),children:l}):null]}))),Or=g((({cell:e,rowHeader:t,isFillGradient:n=!1})=>u("div",{className:"box-border flex flex-col",role:"cell",children:u("div",{className:N("h-full","border-main-divider border-b"),children:e?e.map(Ur(n,t)):null})}))),Lr=(e=!1)=>""+(e?"text-white/80":"text-secondary-text"),$r=(e=!1)=>""+(e?"text-white":""),Ur=(e,t)=>({label:n,description:l},a)=>p("div",{className:"flex justify-between text-s py-s",children:[u(I,{size:"text-s",color:Lr(e),children:t}),p("div",{className:"basis-1/2",children:[n?u("div",{className:"text-right",children:u(I,{size:"text-s",align:"text-right",color:$r(e),children:n})}):null,l?u("div",{className:"text-right",children:u(I,{size:"text-s",color:Lr(e),children:l})}):null]})]},String(a)),Hr=g((({header:e,columnData:t,visibleRowLength:n=0,isFillGradient:l,showRow:a,onToggleColumn:i})=>{const r=t?.slice(0,a?t.length:n),s=l?"secondary":"primary";return p("div",{className:N("border border-gray rounded-md p-m mb-m",l?"bg-gradient-to-r from-main-gradient-start to-main-gradient-end":""),role:"row",children:[u(jr,{...e,isFillGradient:l}),r?.length?r.map((({rowHeader:e,cell:t},n)=>u(Or,{cell:t,rowHeader:e,isFillGradient:l},String(n)))):null,a&&e?.link?u(ge,{href:e.link.href,target:e.link?.target,version:s,className:"text-s font-medium mt-m py-s",children:e.link.text}):null,Wr({onToggleColumn:i,isFillGradient:l,showRow:a})]})})),Wr=({onToggleColumn:e,isFillGradient:t,showRow:n})=>u("div",{className:"mt-lg",role:"cell",children:u("a",{role:"link",onClick:e,className:"cursor-pointer "+(t?"text-white/80":"text-primary-main"),children:u(Ve,{size:"text-s",font:"font-medium",children:n?"Скрыть":"Показать описание"})})}),Kr=g((e=>{const{className:t,title:n}=e;return p("section",{className:`bg-white font-sans p-6xl overflow-hidden text-primary-text relative space-y-lg ${t||""}`,children:[n?u(T,{headingType:"h3",className:"font-medium text-center",title:n}):null,u("div",{role:"table",children:u(Yr,{...e})})]})})),Yr=g((({columns:e=[],rowHeaders:t,isColoredFirstColumn:n,visibleRowLength:a,orientation:r,...s})=>{const[o,c]=l(Array.from({length:e.length}).fill(!a)),d=i((e=>{const t=(t,n)=>n===e?!t:t;c((e=>e.map(t)))}),[]),m=i((()=>c((e=>Array.from({length:e.length}).fill(!1)))),[]),h=e?.map((({data:e,header:l},i)=>{return u(Hr,{visibleRowLength:a,showRow:o[i],header:l,columnData:(r=e,r?.map(((e,n)=>({cell:e,rowHeader:t?.[n]?.title})))),isFillGradient:0===i&&n,onToggleColumn:()=>d(i),...s},String(i));var r}));return"horizontal"===r?u(Va,{onVisibleIndicesChange:m,children:h}):h})),Gr=e=>e%2!=0,Xr=g((({title:e,description:t})=>p("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[u(te,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),u(P,{title:e,description:t,headlineVersion:"S",isEmbedded:!0,align:da})]}))),qr=["ArrowDownIcon","ArrowUpIcon"],Jr="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box",Qr=g((({label:e="",blocksToRender:t=[],topItemsCount:n=0,block:l,notFound:a,...i})=>{const[r,s]=n>0?[t.slice(0,n),t.slice(n)]:[t,[]];return p("div",{children:[u("div",{className:N(t.length?"hidden":"block"),children:a?u(Xr,{...a}):null}),p("div",{className:N("space-y-2xs",t.length?"":"hidden"),children:[p("div",{className:N(Jr),children:[z(r,{...i.options,parent:l}),Gr(r.length)?u(vt,{className:"col-span-6"}):null]}),u(Ea,{renderFoldableSection:({isUnfolded:e})=>p(ja,{className:N(Jr),isUnfolded:e,children:[z(s,{...i.options,parent:l}),Gr(s.length)?u(vt,{className:"col-span-6"}):null]}),renderFoldButton:({isUnfolded:t,onToggle:l})=>u(wr,{className:N(n<1?"hidden":""),disabled:!s?.length,label:e,icon:qr[Number(t)],dataTheme:i.options?.page?.colorPalette,onClick:l})})]})]})})),Zr=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,es=(e,t)=>Object.entries(e).map((([n,l])=>"number"==typeof l?Array.isArray(t[n])?((e,t)=>n=>Zr(t[e])||Zr(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Zr(t[e])||Zr(n[e])||ts(t[e])<=ts(n[e]))(n,e):"object"==typeof l&&"min"in l&&"max"in l?((e,t)=>n=>Zr(t[e])||Zr(n[e])||ts(t[e]?.min)>=ts(n[e]?.min)&&ts(t[e]?.min)<=ts(n[e]?.max))(n,e):Array.isArray(l)?((e,t)=>n=>Zr(t[e])||Zr(n[e])||t[e]?.some((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Zr(t[e])||Zr(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),ts=e=>Number(e||0),ns=(e,t)=>(n=Nt)=>e&&e.filter((e=>es(t,n(e.content||{})))),ls=g((({value:e,onChange:t,items:n=[],multiple:l})=>n.map((n=>u(fn,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(l?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:l?"checkbox":"radio"},n.value))))),as=({field:e,reset:t,filtrationSchema:n,resetButton:l,children:a})=>p("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[p("div",{className:"flex flex-col @4xl:flex-row gap-5xl",children:[a,Object.entries(n).map(is(e))]}),l?u("div",{children:u(wn,{className:"w-full @4xl:w-72 @4xl:ml-s",onClick:t,children:l?.text})}):null]}),is=e=>([t,n])=>{const l=n?.type;return"array"===l?rs(t,e)(n):null},rs=(e,t)=>n=>{const l=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return p("div",{children:[n?.title?u("div",{className:"mb-m",children:u(Ve,{size:"text-m",font:"font-light",color:"text-secondary-text",children:n.title})}):null,u(ls,{items:l,multiple:!n?.single,...t(e)})]},e)},ss=(e,t)=>{const n=e[t?.sourceBook];return n?n?.rateRows.map((e=>e.minMonths)).filter((e=>void 0!==e)):[]},os=(...e)=>{const t=e.map((e=>pt(e)));return Promise.all(t)};function cs(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const ds=e=>Boolean(e&&e.content&&"string"==typeof e.content.sourceBook);function ms(e){const{dirs:t=[],source:n=[]}=r((()=>{const t=(e=>e?.filter(ds).map((({content:{sourceBook:e}})=>e)))(e);return{dirs:t?.map((e=>`/wcms-resources/${e}.json`)),source:t}}),[e]),{data:l=[]}=ht(t,os);return{source:Object.fromEntries(cs(n,l).filter((([,e])=>Boolean(e)))),months:(a=l.flatMap((e=>e?.rateRows||[])).filter((e=>"number"==typeof e.minMonths&&e.minMonths===e.maxMonths)).map((e=>e.minMonths)),[...new Set(a)]).sort(((e,t)=>e-t))||[]};var a}const hs=1e9,us={sum:{min:1e4,max:hs},period:3},ps=g((({className:e,filtrationSchema:t={},resetButton:n,sumInput:l,periodInput:a,...i})=>{const{source:r,months:s}=ms(i.block?.blocks),[o,{field:c,reset:d}]=wt(us),m=ns(i.block?.blocks,o)((e=>({...e,period:ss(r,e||{})||[]}))),h=p("div",{children:[u(Yi,{label:l?.title,min:500,max:hs,...c("sum",{parse:e=>({min:Number(e),max:hs}),format:({min:e})=>String(e)})}),u(vl,{title:a?.title,items:["От 3 мес","До 5 лет"],list:s,...c("period")})]});return p(k,{className:N("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[as({field:c,reset:d,filtrationSchema:t,resetButton:n,children:h}),u(Qr,{blocksToRender:m,...i})]})})),gs={type:"string",title:"Адрес справочника"};ps.childrenTypes=["ProductTile"],ps.childSchema=e=>({...e?.filtrationSchema||{},sourceBook:gs});const xs=e=>"Image"===e?.contentType&&e?.image?u(te,{image:e.image}):"Code"===e?.contentType&&e.code?u("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,fs=g((({className:e="",title:t,description:n,error:l,button:a,...i})=>p(k,{className:N("flex flex-col justify-center items-center",e),defaultPadding:N("p-6xl"),version:"transparent",...i,children:[u("div",{className:"flex justify-center",children:xs(l)}),u(P,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?u(ge,{version:a?.version,text:a?.text,...a}):null]}))),bs="location";function ys(e="Москва"){const[t,n]=((e,t,n)=>{const[r,s]=l(n||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,i((n=>e.fire(t,n)),[e,t])]})(y,"location",Ns()??{name:e}),r=i((e=>{ws(e),n(e)}),[]),{data:s}=ht(vs()?null:"/api/v1/region",gt);return a((()=>{s&&!vs()&&n(s)}),[s]),[t??{name:e},r]}const vs=()=>Boolean(globalThis.localStorage?.getItem(bs)),Ns=()=>{try{const e=globalThis.localStorage?.getItem(bs);return e&&JSON.parse(e)}catch(e){return null}},ws=e=>{try{globalThis.localStorage?.setItem(bs,JSON.stringify(e))}catch(e){}};var ks;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD"}(ks||(ks={}));const Ss=new Intl.NumberFormat("ru",{style:"currency",currency:ks.RUB}),Cs=e=>e?Ss.format(e):"",Ts="text-left text-m font-light text-secondary-text",Is=`${Ts} pl-5xl`,Bs={USD:"DollarIcon",EUR:"EuroIcon"},Ps=g((({className:e,exchangeCurrencyItems:t})=>p("table",{className:`h-fit w-fit ${e}`,children:[u("thead",{children:p("tr",{children:[u("th",{className:Ts,children:u(Ve,{size:"text-m",children:"Валюта"})}),u("th",{className:Is,children:u(Ve,{size:"text-m",children:"Купить"})}),u("th",{className:Is,children:u(Ve,{size:"text-m",children:"Продать"})})]})}),u("tbody",{children:t.map(Ms)})]}))),Ms=e=>{const t=e?.currency?.currency;return p("tr",{className:"pb-2xs text-h6",children:[u("td",{className:"pt-m",children:p("div",{className:"flex items-center gap-xs",children:[t?u(te,{image:{icon:Bs[t]},width:"24",height:"24"}):null,u(Ve,{size:"text-h6",children:t})]})}),u("td",{className:"pt-m pl-5xl",children:u(Ve,{size:"text-h6",children:Cs(e?.saleExchangeRate)})}),u("td",{className:"pt-m pl-5xl",children:u(Ve,{size:"text-h6",children:Cs(e?.buyExchangeRate)})})]},t)},Rs={icon:"GpsIcon"},As=g((({className:e="",address:t})=>p("div",{className:`flex gap-s ${e}`,children:[u(ha,{...Rs,iconBgVersion:"primary"}),p("div",{className:"space-y-2xs",children:[t?u(I,{size:"text-l",color:"text-primary-main",children:t}):null,u(I,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Vs=(e,t,n)=>{const l=Number(zs(e))*Math.pow(t,n?-1:1);return Number.isInteger(l)?l:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(l)},zs=e=>e.replace(/[^\d.,]/g,"").replace(",","."),Ds=e=>{return(t=[[e=>e.value!==ks.RUB&&e.oppositeValue!==ks.RUB,()=>e.handleConvert(e.value,ks.RUB)],[e=>e.value===ks.RUB&&e.oppositeValue===ks.RUB,()=>e.handleConvert(e.value,ks.USD)],[()=>!0,()=>e.handleConvert(e.value)]],e=>{const[,n]=t.find((([t])=>t(e)))||[];return n})(e)?.();var t};function _s(e){const{placeholder:t,rates:n,selected:l,value:a,setValue:i,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),o={key:l,text:l};return p("div",{className:"relative flex",children:[u(Vt,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:i}),s.length?u(dn,{isBorder:!1,onChange:e=>r(e.key),options:s,value:o}):null]})}const Fs=g((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=l({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||ks.RUB,selectBuy:n?.[0]?.currency?.currency||ks.USD}),o=i((e=>s((t=>({...t,...e})))),[]);return p("div",{className:`grid gap-m pt-2xl ${e}`,children:[_s({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:Es(r,o,n),value:r.inputSell,setValue:e=>Os(o,n)(e,r.selectSell,r.selectBuy)}),_s({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:js(r,o,t),value:r.inputBuy,setValue:e=>Ls(o,t)(e,r.selectBuy,r.selectSell)}),a?.text?u(ge,{text:a.text,version:a?.version,...a}):null]})})),Es=(e,t,n)=>l=>{t({selectSell:l}),Ds({value:l,oppositeValue:e.selectBuy,handleConvert:(l=e.selectSell,a=e.selectBuy)=>{Os(t,n)(e.inputSell,l,a)}})},js=(e,t,n)=>l=>{t({selectBuy:l}),Ds({value:l,oppositeValue:e.selectSell,handleConvert:(l=e.selectBuy,a=e.selectSell)=>Ls(t,n)(e.inputBuy,l,a)})},Os=(e,t)=>(n,l,a)=>{e({inputSell:zs(n),selectBuy:a});const i=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===l))?.saleExchangeRate;i&&e({inputBuy:String(Vs(n,i,l===ks.RUB)||"")})},Ls=(e,t)=>(n,l,a)=>{e({inputBuy:zs(n),selectSell:a});const i=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===l))?.buyExchangeRate;i&&e({inputSell:String(Vs(n,i,l===ks.RUB)||"")})};const $s=g((({className:e="",title:t="Курсы обмена валют",button:n,...l})=>{const[a]=ys(),i=function(e){const t=e?.code||"000",{data:n}=ht(`/api/v1/exchangerates?regionCode=${t}`,gt);return n||{}}(a),r=Us(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:ks.RUB}});const o=r.filter((e=>e.saleExchangeRate));return o.push({currency:{currency:ks.RUB}}),u(k,{className:N("box-border min-h-80",e),...l,children:u(ve,{className:"h-full",title:u(T,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:p("div",{className:"flex gap-6xl flex-wrap",children:[p("div",{children:[r?u(Ps,{className:"mb-xl",exchangeCurrencyItems:r}):null,u(As,{address:i?.address})]}),r.length&&s.length&&o.length?u(Fs,{className:"grow",currencyRatesBuy:s,currencyRatesSell:o,button:n}):null]})})})})),Us=e=>e?.filter((e=>1===e?.currency?.id||2===e?.currency?.id))||[],Hs=e=>bt(d.SITEMAP||"sitemap",{fallback:e}),Ws=(e,t)=>u(ha,{...e,iconBgVersion:t,className:"shrink-0"}),Ks=g((({label:e,labelIconBgVersion:t,icon:n,onToggle:l,labelIcon:a})=>u(Nr,{tag:"button",className:N("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:l,textNode:p("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[Ws(a,t),e?u(Ve,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?u(K,{name:n,iconVersion:"black",width:"24",height:"24"}):null}))),Ys=g((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:l="Развернуть",labelIcon:a,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,...o})=>u(k,{className:N("w-full","",e),defaultPadding:"p-0",tag:"div",version:"transparent",...o,children:u(Ea,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>u(ja,{className:N("gap-lg","flex flex-wrap group-last:last:pb-0"),isUnfolded:e,children:D({...o,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Gs({foldButtonVersion:r,label:l,labelIcon:a,labelIconBgVersion:i,isUnfolded:e,onToggle:t})})})));Ys.childrenTypes={exclude:["RollupItem"]};const Gs=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:l,isUnfolded:a,onToggle:i})=>{const r=t||(a?"Скрыть":"Развернуть"),s=((e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon")(a);return"accordion"===e?u(Ks,{label:r,labelIcon:n,labelIconBgVersion:l,icon:s,onToggle:i}):u(wr,{label:r,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},Xs=g((({className:e="",items:t})=>p("div",{className:e,children:[t?.length?t.map(qs):null,u(ge,{version:"primary",className:"w-full",href:"https://old.rshb.ru/feedback/question/",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"})]}))),qs=(e,t)=>p("div",{className:"mb-m space-y-m",children:[u("div",{children:u(Ve,{size:"text-l",font:"font-medium",children:e?.title})}),u("div",{className:"space-y-m",children:e.items?.map(Js)})]},String(t)),Js=(e,t)=>p("div",{className:"space-y-2xs",children:[u("div",{children:Qs(e.type,e.text)}),u(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Qs=(e,t="")=>{switch(e){case"tel":return u("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Zs(t)}`,children:u(Ve,{size:"text-h6",children:t})});case"email":return u("a",{className:"no-underline",href:`mailto:${t}`,children:u(I,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return u("span",{children:t})}},Zs=e=>e.replaceAll(/\D/g,""),eo=["split_version","New","Old"],to=g((({className:e="",index:t,text:n,...l})=>{const a=de(),{href:i,target:r,onClick:s}=a(l);return u("a",{className:N("",e),href:i,target:r,onClick:s,children:n||`Документ ${t}`})})),no=g((({title:e,links:t,className:n=""})=>p("div",{className:N("flex flex-col gap-4",n),children:[u(Ve,{size:"text-l",font:"font-normal",children:e}),t?.length?u("div",{className:"flex flex-col gap-lg",children:t.map(((e,t)=>u(to,{className:"text-l font-light",index:t,...e},String(t))))}):null]}))),lo=g((({className:e="",items:t,basePath:n})=>t?.length?u("ul",{className:N("flex flex-col",e),children:t.map(ao(n))}):null)),ao=e=>(t,n)=>{const{text:l,...a}=t,i=de({isRemote:!(!d.BASE_PATH||!e)&&!d.BASE_PATH.startsWith(e),basePath:e}),{href:r,target:s,onClick:o}=i(a);return u("li",{className:"list-none my-xs",children:u("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:s||"_self",onClick:o,children:l||null})},`list_item_${String(n)}`)},io=g((({className:e="",index:t,...n})=>{const l=de({isRemote:!0}),{href:a,target:i,text:r,onClick:s}=l(n);return u("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:i,onClick:s,children:r||`Документ ${t}`})})),ro=g((({className:e="",links:t})=>p("div",{className:N("@container",e),children:[u("div",{className:"pt-lg",children:u(Ve,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?u("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)=>u(io,{index:t,...e},String(t))))}):null]}))),so=g((({className:e,...t})=>{const n=t.options?.page?.fallback,{topItems:l}=Hs(n),{relatedEnterprises:a,contacts:r,socialMedia:s,mobileApps:c,horizontalNavigationTitle:m,documents:h}=bt(d.FOOTER||"footer",{fallback:n}),g=i((()=>{const[e,t,n]=eo;((e,t)=>{const n=globalThis.document?.cookie.split(";")??[],[,l]=n.map((e=>e.split("="))).find((([t])=>t.trim()===e))||[];t(l)&&(globalThis.document.cookie=`${e}=${t(l)}`)})(e,(e=>e?.replace(t,n)))}),[]);return p(k,{tag:"footer",className:e,defaultPadding:"p-4xl pb-24",...t,children:[u("div",{className:"mb-lg pb-xs border-b border-main-divider",children:l?.map(((e,t)=>u(Ys,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,children:u(lo,{items:e.items,basePath:o(e.href)})},String(t))))}),u(Xs,{className:"overflow-hidden",items:r}),p("div",{className:"mt-xl",children:[u(Rr,{className:"mb-xl",media:s,stretched:!0,children:"Соцсети"}),p("div",{className:"mb-xl",children:[u("div",{className:"flex flex-col gap-4 mb-xs",children:c?.map(oo)}),u(Ve,{size:"text-s",font:"font-light",color:"text-secondary-text",children:"Мобильное приложение"})]})]}),u("div",{className:"py-lg border-t border-main-divider",children:u(to,{text:"Вернуться на прежнюю версию сайта",className:"text-l font-light max-w-[292px]",href:"https://old.rshb.ru",onClick:g})}),u(no,{className:"py-lg border-y border-main-divider",title:m,links:a}),u(ro,{links:h})]})})),oo=({href:e="/",text:t},n)=>{const{label:l}=Mr(e);return u(ge,{className:"w-full",text:t||l,version:"secondary",href:e,target:"_blank"},String(n))},co={width:"34",height:"34"},mo={"bg-white":"color",transparent:"white"},ho={"bg-white":"text-primary-main",transparent:"text-white"},uo=(e,t,n)=>u(te,t?.src?{image:t,className:ho[e],width:n?.width,height:n?.height}:{image:{icon:t?.icon||"LogoIcon",iconVersion:mo[e]},className:ho[e],width:n?.width,height:n?.height}),po={"bg-white":"text-primary-text",transparent:"text-white"},go=g((({className:e,href:t="/",logo:n,children:l,targetBlank:a,bgColor:i="bg-white",showTitle:r=!0})=>p("a",{className:N("inline-flex items-center font-sans no-underline",e),href:t,target:a?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",children:[uo(i,n?.image,co),r?l??u("div",{className:"ml-s",children:u(Ve,{font:"font-medium",color:po[i],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),xo={default:"px-5 bg-main-divider rounded hover:text-primary-main",transparent:"text-white hover:text-primary-hover"},fo=g((({bgColor:e,logo:t,internetBankUrl:n,version:l})=>{const a=v(),r=d.BASE_PATH?.startsWith(a.pathname),s=i((e=>{e.preventDefault(),a.back()}),[]);return p("div",{className:"flex items-center justify-between w-full",children:[r?u("div",{children:u(go,{className:"my-2xs",bgColor:e,logo:t})}):bo(s),n?u("div",{children:u(ge,{href:n,ariaLabel:"Войти",target:"_blank",className:N("p-s text-s whitespace-nowrap text-primary-main hover:text-primary-hover",xo["transparent"===l?"transparent":"default"]),children:"Войти"})}):null]})})),bo=e=>u("div",{children:p("button",{className:"flex items-center text-l my-2xs","aria-label":"Вернуться назад",onClick:e,children:[u(te,{className:"w-6 h-6",image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24"}),"Вернуться назад"]})}),yo={"bg-white":"primary",transparent:"transparent"},vo=g((({bgColor:e="bg-white",version:t=yo[e],...n})=>{const{logo:l}=Hs(n.options?.page?.fallback),{internetBankUrl:a}=bt(d.PORTAL_DATA||"portal-data",{fallback:n.options?.page?.fallback,pathDir:j(d.BASE_PATH,"portal-resources")});return u(k,{tag:"header",defaultPadding:"",version:t,...n,children:u("div",{className:"container px-lg py-2xs box-border",children:u(fo,{bgColor:e,logo:l,internetBankUrl:a,version:t,...n})})})})),No={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},wo=g((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:l=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...o})=>{const c=v();return u(k,{className:N("relative flex flex-col",No[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${q(c)(s?.src)})`}}:{},padding:t,version:a,isTheme:i,...o,children:D({...o,extraProps:{className:N("w-full",ir(r)),padding:l?"":"p-0"}})})}));wo.childrenTypes=[];const ko=g((e=>u(wo,{...e})));ko.childrenTypes=[];const So=g((e=>{const{className:t,image:n,...l}=e;return u(k,{className:t,defaultPadding:"p-0",...l,children:u(te,{image:n})})})),Co=["байт","Кб","Мб","Гб","Тб","Пб"],To=g((({icon:e,text:t,href:n,target:l,fileFormat:a,fileSize:i})=>{const r=i&&a?",":"",s=i??"",o=a?String(a):"";return p("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",role:"link",href:n,target:l,children:[e,t?p(Ve,{size:"text-l",font:"font-light",children:[t," ",Io(s,o),u(Ve,{color:"text-secondary-text",children:n&&`${s+r+o}`})]}):null]})})),Io=(e,t)=>e||t?u("span",{children:", "}):"",Bo={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Po=g((({className:e="",title:t,description:n,align:l="text-center",documents:a,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const o=v();return p(k,{className:N("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[u(P,{title:t,description:n,align:l,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?u("div",{className:N("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Bo[r]),role:"list",children:a.map(Mo(o,i))}):null]})})),Mo=(e,t)=>(n,l)=>{if(""===n?.docType)return null;const a="Attachment"===n?.docType?U(e)(n?.attachment?.src):n?.href,i="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${Co[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Ro(a):n?.fileFormat;return u("div",{role:"listitem",children:u(To,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:i,icon:t?u(te,{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(l))},Ro=e=>{if(!e)return"";const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},Ao=g((({className:e,padding:t,align:n="text-left",buttons:l=[],description:a,image:i,items:r,qr:s,additionalDescription:o="",title:c="Мобильное приложение",version:d="primary",...m})=>{const h="secondary"===d?"p-m min-w-32":"min-w-24",g=i?.src?u(te,{className:"hidden lg:block",image:i}):null;return u(k,{className:N("min-h-80",e),padding:"p-0",version:d,...m,children:p(ve,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:u(T,{headingType:"h3",title:c,className:N("whitespace-pre-wrap",n)}),rightImage:g,buttons:We(l,{className:"flex-wrap"}),children:[a?u(Ve,{size:"text-xl","font-weight":"font-light",children:a}):null,p("div",{className:N("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[u(Je,{items:r,listItemSize:"M"}),u(Ve,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:o}),s?.src?u("div",{className:N("flex justify-center bg-white rounded-md @xl:-order-1",h),children:u(te,{className:"w-fit",image:s})}):null,i?.src?u(te,{className:"lg:hidden",image:i}):null]})]})})})),Vo={primary:"bg-white/30",secondary:"bg-main-divider"},zo={primary:"text-white",secondary:"text-secondary-text"},Do=g((({count:e,version:t="secondary"})=>u("div",{className:N("w-6 h-6 rounded-full flex items-center justify-center",Vo[t]),children:u(Ve,{size:"text-xs",color:zo[t],children:e})}))),_o=(e=[],t={})=>e.filter((({content:e={}})=>es(t,e))).length,Fo=(e,t)=>e===t;const Eo=(jo=function(...e){return(t,n)=>e.some((e=>e(t,n)))}(Fo,((e=Fo)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,l)=>e(t,n[l])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,n])=>jo(n,t[e])))));var jo;const Oo=[],Lo={},$o={default:"px-xs",underlined:"px-m",rounded:"px-lg rounded-md"},Uo={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",rounded:"text-white"},Ho={default:"bg-white",underlined:"bg-white",rounded:"bg-transparent"},Wo={default:"sm:bg-primary-main",underlined:"bg-white",rounded:"bg-primary-main"},Ko=g((({tag:e="div",item:t={},isActive:n,type:l="default",onClick:a})=>{const i=e,{text:r,appendRight:s,...o}=t;return u(i,{className:N("h-12","block flex-1","cursor-pointer",$o[l],n?Wo[l]:Ho[l]),role:"tab","aria-selected":n,onClick:a,...o,children:p("div",{className:N("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Uo[l]:"text-secondary-text hover:text-primary-main"),children:[u(Ve,{size:"text-m",children:r}),s?u("div",{className:"ml-xs",children:s}):null]})})})),Yo=g((e=>u(e?.item?.href?Go:Xo,{...e}))),Go=g((e=>{const t=de(),n=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:l,...a}=t({...e.item,onClick:n});return u(Ko,{...e,tag:"a",item:a,onClick:l})})),Xo=g((({item:e={},onClick:t,...n})=>{const l=i((()=>{t&&t(e)}),[t,e]);return u(Ko,{item:e,onClick:l,...n})})),qo=(e,t,n)=>(l,a)=>u(Yo,{isActive:l===e,onClick:t,type:n,item:l},String(a)),Jo=g((({className:e,tabsType:t="default",items:n=[],value:l,onChange:a})=>u("div",{className:N("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tablist",children:n.map(qo(l,a,t))}))),Qo={categories:[],extraOptions:[],propertyType:[],stage:[]},Zo=g((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:l,...a})=>{const[s,{field:o,reset:c,update:d}]=wt(Qo),m=ns(a.block?.blocks,s)(),h=i(((e=Qo)=>d(e)),[]),g=(({hotFilters:e=Oo,filtrationState:t=Lo,blocks:n=Oo,onFiltrationStateChange:l})=>{const a=r((()=>Math.max(0,e.findIndex((e=>Eo(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,appendRight:u(Do,{version:t===e[a]?"primary":"secondary",count:_o(n,t.filter)})})))),[e,n,a]),o=i((t=>{l(e[s.indexOf(t)].filter)}),[e,s]);return{value:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:h});return p(k,{className:N("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[u(Jo,{...g}),as({field:o,reset:c,filtrationSchema:n,resetButton:l}),u(Qr,{blocksToRender:m,...a})]})}));function ec(e,t,n){t.geoObjects.removeAll();const l=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:l,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),i=n.map((t=>new e.Placemark(t,{},{iconLayout:"default#image",iconImageHref:"/icons/MapMarkerSingleIcon.svg",iconImageSize:[78,84],iconImageOffset:[-35,-50]})));a.add(i),t.geoObjects.add(a),t.setBounds(e.util.bounds.fromPoints(n)).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}Zo.childrenTypes=["ProductTile"],Zo.childSchema=e=>e?.filtrationSchema||{};const tc={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"},nc=(e,t,n)=>u("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(tc).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.geoObjects.add(t.geoObjects)}))},children:u(K,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),lc=e=>globalThis[e];const ac=()=>function(e,t){const[n,r]=l(),s=i((()=>r(lc(e))),[e]);return a((()=>{const n=document.getElementById(t);if(!n){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),r(void 0)}}if(!lc(e))return n.addEventListener("load",s),()=>{n.removeEventListener("load",s)};s()}),[e,t]),n}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${d.YANDEX_MAP_API_KEY||""}&lang=ru_RU`),ic={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=g((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return u("div",{onClick:()=>{const n=e.current.getZoom(),l="in"===t?n+1:n-1;e.current.setZoom(l,{checkZoomRange:!0})},className:`${Object.values(ic).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:u(K,{name:n,width:"20",height:"16"})})})),sc={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"},oc=[55.753995,37.614069],cc=g((({points:e,className:t="",zoom:n=5})=>{const i=s(null),r=ac(),[o,c]=l();if(a((()=>{i?.current?r&&(ec(r,i.current,e),e?.length||i.current.setCenter(oc)):r?.ready((()=>{i.current||(i.current=new r.Map("map",{center:e?dc(e):oc,zoom:n,controls:[],suppressMapOpenBlock:!0}),ec(r,i.current,e))}))}),[r,i,e,n]),!r)return null;const d=o?"z-[100000]":"z-10";return p("div",{id:"map",className:N(!o&&"relative","w-full",t),children:[u("div",{className:N(Object.values(sc),d,"right-2 top-4 bg-white"),onClick:()=>{const e=i.current.container;o?e.exitFullscreen():e.enterFullscreen(),c(e.isFullscreen())},children:u(K,{name:"FullScreenIcon",width:"16",height:"16"})}),p("div",{className:N("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",d),children:[u(rc,{yandexMaps:i}),u(rc,{yandexMaps:i,direction:"out"})]}),nc(i.current,r,N("right-2 top-80",d))]})})),dc=e=>[hc(mc(e,0)),hc(mc(e,1))],mc=(e,t)=>e.map((e=>e[t])),hc=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,uc={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных"},pc=(e,{field:t,reset:n})=>p("div",{className:"pb-2xl",children:[e?.length?u("div",{className:"flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",children:e.map((e=>u(Mn,{text:uc[e],...t(e)},e)))}):null,u(ge,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:n,text:"Очистить фильтр",appendRight:u(K,{name:"CloseIcon",width:"16",height:"16"})})]}),gc=()=>null,xc=()=>[],fc=g((({className:e,data:t=[],renderCard:n=gc,filterItems:l=xc,initFilterState:a={},descriptionData:i,title:s})=>{const[o,{field:c,reset:d}]=wt(a),[m,h,g]=r((()=>{const e=l(t,o),n=e.map((e=>[e.gpsLatitude,e.gpsLongitude].filter(Boolean))).filter((e=>e&&2===e.length));return[e,n,e.length]}),[t,o]);return p("div",{className:N("space-y-1",e),children:[p("div",{className:"bg-white",children:[p("div",{className:"pt-6xl px-6xl",children:[p("div",{className:"flex gap-xs pb-2xl",children:[u(T,{headingType:"h2",children:s}),g?u(Ve,{size:"text-h2",color:"text-secondary-text",children:`(${g})`}):null]}),i?bc(i):null,pc(Object.keys(a),{field:c,reset:d})]}),u("div",{className:"h-[600px]",children:u(b,{children:u(cc,{points:h,className:"h-full"})})})]}),m.map(n)]})})),bc=({__html:e,list:t})=>e||t?.length?p("div",{className:"p-xl mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?u(Re,{__html:e}):null,t?.length?u("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pt-xs",children:t.map(((e,t)=>p("div",{className:"flex gap-xs items-center",children:[e?.image?u(te,{image:e.image}):null,e?.text?u(Ve,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,yc={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"}},vc=g((({className:e,children:t,color:n="gray"})=>u("div",{className:N("p-s sm:border sm:border-gray rounded-md flex items-center",yc[n].border,e),children:u(Ve,{size:"text-m",color:yc[n].text,children:t})}))),Nc=g((({value:e,subText:t,children:n,...l})=>{const a=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[a.length,n,t].every((e=>!e))?null:wc({textItems:a,subText:t,children:n,...l})})),wc=({label:e,labelSize:t="text-m",textItems:n,subColor:l,subText:a,className:i,children:r})=>p("div",{className:N("flex gap-2xs flex-col h-full max-w-[300px]",i),children:[e?u(Ve,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||n.filter(Boolean).map(((e,t)=>u(Ve,{size:"text-l",children:e.trim()},String(t)))),a?u(Ve,{color:l,size:"text-m",children:a}):null]}),kc=g((({className:e,children:t})=>u("div",{className:N("sm:flex sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),Sc=["ArrowDownIcon","ArrowUpIcon"],Cc=["Подробнее","Скрыть"],Tc=({isUnfolded:e,onToggle:t})=>p("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,children:[u("div",{className:"pr-m",children:Cc[Number(e)]}),u(K,{className:"text-primary-text",name:Sc[Number(e)],width:"16",height:"16"})]}),Ic=({location:e,address:t,billAcceptorType:n,terminalType:l,billAcceptorEnable:a,atmCode:i="",atmAccess:r="",workTime:s},o)=>{const c=[{label:"Устройство",value:Pc(l)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];return p("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[p("div",{className:"sm:flex sm:justify-between",children:[p("div",{children:[u(Ve,{size:"text-h4",children:Pc(e)}),t?p("div",{className:"flex pb-xl pt-xs gap-2xs",children:[u(K,{name:"GeolocationIcon",width:"24",height:"24"}),u(Ve,{size:"text-l",children:t})]}):null]}),u(vc,{color:"green",children:Pc(s)})]}),u("div",{className:"hidden sm:block",children:u(kc,{className:"flex-wrap",children:c?.map(Bc)})}),u(Ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>u(ja,{isUnfolded:e,children:u(kc,{className:"flex-wrap",children:c?.map(Bc)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Tc({isUnfolded:e,onToggle:t})})]},String(o))},Bc=(e,t)=>u(Nc,{...e},String(t)),Pc=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Mc=[];const Rc=async e=>await pt(e,{method:"GET"})||Mc,Ac={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1},Vc={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable)},zc=g((({data:e,className:t})=>{const[n]=ys(),l=function(e){const{data:t=Mc}=ht(`/api/v1/atms?regionCode=${e}`,Rc);return t}(n?.code??"000");return u(fc,{className:t,filterItems:Dc,data:l,initFilterState:Ac,renderCard:Ic,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Dc=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),l=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!l.includes(e)));return e.filter((e=>{const t=a.every((t=>Vc[t](e))),n=!l.length||l.some((t=>Vc[t](e)));return t&&n}))},_c=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),l=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", "),a=[Fc({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":l}),Fc({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:l},!0)].filter(Boolean);return u(Nc,{label:"Режим работы",value:a,className:"max-w-none"})},Fc=({workTime:e="",lunchHour:t="",daysOff:n=""},l=!1)=>e?[`${l?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Ec=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],jc=e=>Ec.map((([t,n,l])=>({key:t,title:l,short:n,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=Lc(e);return p(kc,{className:"border-none",children:[u(Nc,{label:"Для юридических лиц",labelSize:"text-l",children:u("div",{className:"flex gap-1",children:t.map($c)})}),u(Nc,{label:"Режим работы",className:"max-w-none",children:u(Ve,{children:e})})]})},Lc=e=>{const t=Ec.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],l=n[n.length-1]?.toLowerCase();return l?.includes("выходной")?t.map((e=>({...e,status:!l?.includes(e.short.toLowerCase())}))):t},$c=({short:e,status:t},n)=>u("div",{className:N("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:u(Ve,{size:"text-xs",children:e})},String(n)),Uc=({currency:e,buyExchangeRate:t,saleExchangeRate:n},l)=>p("div",{className:"flex gap-lg h-full",children:[e?.currency?u(Nc,{label:"Валюта",value:e.currency}):null,t?u(Nc,{label:"Купить",value:String(t)}):null,n?u(Nc,{label:"Продать",value:String(n)}):null]},String(l)),Hc=(new Date).getDay(),Wc=e=>{const[t]=e?.slice(Hc-1)??[];if(!t)return null;const{lunchHour:n,status:l,workTime:a,hasLunch:i}=t;return l?p("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?u(vc,{color:"green",children:a}):null,n&&i?u(vc,{color:"yellow",children:`перерыв: ${n}`}):null]}):u(vc,{color:"red",children:"Выходной"})},Kc=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Yc=({title:e,status:t,workTime:n,lunchHour:l,hasLunch:a},i)=>u(Nc,{label:e,value:t&&n?n:"",subText:Kc({lunchHour:l,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(i)),Gc=({name:e,address:t,phone:n,fax:l,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:o,exchangeRate:c},d)=>{if(!o)return null;const m=jc(o);return p("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[p("div",{className:"sm:flex sm:justify-between",children:[p("div",{children:[u(Ve,{size:"text-h4",children:e}),t?p("div",{className:"flex pb-xl pt-xs gap-2xs",children:[u(K,{name:"GeolocationIcon",width:"24",height:"24"}),u(Ve,{size:"text-l",children:t})]}):null]}),Wc(m)]}),u("div",{className:"hidden sm:block",children:Xc({phone:n,fax:l,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:o,exchangeRate:c})}),u(Ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>u(ja,{isUnfolded:e,children:Xc({phone:n,fax:l,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:o,exchangeRate:c})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Tc({isUnfolded:e,onToggle:t})})]},String(d))},Xc=({phone:e,fax:t,phoneBusiness:n,phoneNatural:l,phoneCallCentre:a,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const o=jc(r),c=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return p("div",{children:[p(kc,{className:"flex-wrap",children:[u(Nc,{label:"Факс",value:t}),u(Nc,{label:"Телефон филиала",value:e}),u(Nc,{label:"Для обращений юридических лиц",value:n}),u(Nc,{label:"Обслуживание физических лиц",value:l}),u(Nc,{label:"Для консультаций по валютному контролю",value:i}),u(Nc,{label:"Контакт-центр",value:a})]}),r?.isMatchesPattern?u(kc,{children:u(Nc,{label:c,labelSize:"text-l",className:"w-full max-w-none",children:u("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:o?.map(Yc)})})}):p(kc,{children:[u(Nc,{label:c,labelSize:"text-l",children:u("div",{className:"flex gap-1",children:o?.map($c)})}),_c(o)]}),r?.businessScheduleVisibleTag?Oc(r?.businessScheduleDescription):null,s?.currencies?.length?u(kc,{className:"flex-wrap",children:s?.currencies?.map(Uc)}):null]})},qc=[];const Jc=async e=>await pt(e,{method:"GET"})||qc,Qc={workingSaturday:!1},Zc={workingSaturday:e=>Boolean(e.workSchedule?.workingSaturday)},ed=g((({className:e})=>{const[t]=ys(),n=function(e){const{data:t=qc}=ht(`/api/v1/branches?regionCode=${e}`,Jc);return t}(t?.code??"000");return u(fc,{className:e,filterItems:td,data:n,initFilterState:Qc,renderCard:Gc,title:`Офисы филиала ${t?.name}`})})),td=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Zc[t](e)))))},nd=g((({data:e,className:t,...n})=>{const l=e?.dataType??"offices";return u(k,{version:"transparent",className:N(t),defaultPadding:"p-0",...n,children:"offices"===l?u(ed,{}):u(zc,{data:e})})})),ld=g((({className:e,size:t})=>u("figure",{className:N("m-0 mt-xl min-w-[80%]",e),children:ad(t)}))),ad=(e=3)=>rd(100,e).map((e=>Math.floor(e))).map(id),id=(e,t)=>u("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-light"},String(t)),rd=(e,t)=>[e].concat(t>0?rd(e/1.618,t-1):[]),sd=g((({className:e,title:t,description:n="Блок в разработке...",...l})=>p(k,{className:N("box-border",e),...l,children:[u(P,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),u(ld,{})]}))),od=g((({className:e,padding:t,slides:n=[],...l})=>u(k,{className:N("overflow-hidden relative",e),padding:t,...l,children:u(Va,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>u("div",{className:"box-border h-full",children:u(at,{className:"px-5 h-full",headlineVersion:"L",...e,...l})},String(t))))})}))),cd=g((({address:e,email:t,telephone:n,button:l,className:a="",__html:i,icon:r,title:s,version:o="primary",...c})=>p(k,{className:N("box-border text-left space-y-s",a),version:o,...c,children:[p("div",{className:"w-full flex justify-between flex-row-reverse",children:[He(r)?u("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:u(te,{image:r})}):null,s?u(T,{headingType:"h3",as:"h3",title:s}):null]}),p("div",{className:"w-full space-y-m",children:[i?dd(i):null,md({label:"Адрес",data:e,iconName:"GeolocationIcon"}),md({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),md({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),l?.text?We([l]):null]})]}))),dd=e=>u("div",{className:"border-b border-main-divider pb-lg",children:u(Re,{__html:e})}),md=({label:e,data:t,iconName:n,dataColor:l=""})=>t?p("div",{className:"flex gap-s",children:[u(K,{iconVersion:"black",name:n,width:"24",height:"24"}),p("div",{className:"flex flex-col gap-2xs",children:[u(Ve,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),u(Ve,{size:"text-xl",color:l,children:t})]})]}):null,hd=g((e=>{const{__html:t,richVersion:n,...l}=e;return u(k,{defaultPadding:"p-0",...l,children:u(Re,{__html:t,richVersion:n})})})),ud=g((({className:e=""})=>{const[t,n]=l("option2"),a=i((e=>n(e)),[]);return p("div",{className:N("order-4",e),children:[u(Xl,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),u(Xl,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),pd=g((({data:e,fieldLabel:t,fieldValue:n,selected:l,placeholder:a="",setSelected:i,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),o=s.find((e=>e.key===l));return u(dn,{options:s,label:r,placeholder:a||l,onChange:e=>i(e.key),value:o})})),gd=g((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:l=[],selectedBranch:a,onSelectedBranch:i})=>p("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[u("div",{className:"flex-1 min-w-0",children:u(pd,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),u("div",{className:"flex-1 min-w-0",children:u(pd,{data:l,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),xd=["От 1 дня","До 365 дней"],fd=g((({days:e,setDays:t})=>p("div",{className:"order-1",children:[u(Ve,{size:"text-m",font:"font-light",children:"Срок аренды"}),u(vl,{min:1,max:365,value:e,items:xd,onChange:t})]}))),bd=g((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:l=[],selectedBoxSize:a,onSelectedBoxSize:i})=>p("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[u("div",{className:"flex-1 min-w-0",children:u(pd,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),u("div",{className:"flex-1 min-w-0",children:u(pd,{data:l,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),yd=g((({regions:e,selectedRegion:t,branches:n,selectedBranch:l,days:a,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:o,onChange:c,onClick:d})=>p("div",{className:"contents @xl:block flex-1 space-y-xl",children:[u(gd,{regions:e,selectedRegion:t,onSelectedRegion:e=>c({selectedRegion:e}),branches:n,selectedBranch:l,onSelectedBranch:vd(c)}),u(fd,{days:a,setDays:e=>c({days:e})}),u(bd,{caseVolumes:o,selectedCaseVolume:i,onSelectedCaseVolume:Nd(c),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>c({selectedBoxSize:e})}),u("div",{className:"order-4",children:u(Ve,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),p("div",{className:"contents @md:flex justify-between items-center gap-m",children:[u(ud,{}),u(ge,{text:"Офисы на карте",version:"primary",onClick:d,className:"order-6"})]})]}))),vd=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Nd=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},wd=g((({days:e,tariffs:t=[]})=>{const n=Sd(e,t),l="На рисунке изображена пачка листов\nформата А4";return p("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[p("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:[kd("Аренда за",e),kd("Цена",n+" ₽")]}),u("div",{className:"@xl:hidden order-3 mb-xs",children:u(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l})}),p("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:[u(te,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),u("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:u(I,{size:"text-s",font:"font-light",color:"text-white",children:l})})]})]})})),kd=(e,t)=>p("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[u(Ve,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),u("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),Sd=(e,t)=>{const n=Cd(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Cd=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},Td=(e,t)=>e.find((e=>e.branchCode===t)),Id=g((e=>{const{regions:t,data:n,branches:l,onChange:i,onClick:r}=e;a((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,i]);const s=Td(l,n.selectedBranch),o=Bd(s?.safeBoxCaseVolumes),c=Pd(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,d=Md(c,n.selectedBoxSize);return p("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[u(yd,{...n,regions:t,onClick:r,branches:l,caseVolumes:o,safeBoxCases:c,onChange:i}),u(wd,{days:n.days,tariffs:d})]})})),Bd=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Pd=(e,t)=>e?.find((e=>e.volume===t)),Md=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Rd=[];const Ad=async e=>await pt(e,{method:"GET"})||Rd,Vd=g((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=l(!1),o=i((()=>s((e=>!e))),[]),[c,d]=l({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),m=tn(),h=zd(c.selectedRegion,m),g=function(e){const{data:t}=ht(e?`/api/v1/safeboxes?regionCode=${e}`:null,Ad);return t||Rd}(h),x=i((e=>d((t=>({...t,...e})))),[d]),f=(b=Td(g,c.selectedBranch)||g,Array.isArray(b)?b.map((e=>e.gpsLatitude&&e.gpsLongitude?[e.gpsLatitude,e.gpsLongitude]:[])):b?.gpsLatitude&&b?.gpsLongitude?[[b.gpsLatitude,b.gpsLongitude]]:[]);var b;return p(k,{className:n,defaultPadding:"",...a,children:[p("div",{className:"p-4xl space-y-xl",children:[e?u(T,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,u(Id,{regions:m,branches:g,data:{...c,selectedRegion:h},onClick:o,onChange:x}),t?u(I,{size:"text-s",font:"font-light",children:t}):null]}),f.length&&r?u(cc,{points:f,className:"h-[640px]"}):null]})})),zd=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e;function Dd(e){throw new Error(e)}const _d={normal:{icon:"h-11 w-11",image:"h-14 w-14"},small:{icon:"h-12 w-12",image:"h-14 w-14"}},Fd={normal:"",small:"min-h-6xl"},Ed={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"},jd=g((({className:e="",title:t,description:n,steps:l,buttons:a,size:i="normal",stepVersion:r="gray",version:s="primary",...o})=>p(k,{className:N("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:s,...o,children:[u(P,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),l?.length?u("div",{className:"box-border",children:u("div",{className:"flex flex-col gap-6xl justify-between",children:l.map(Od(i,r))})}):null,We(a,{isVertical:!0})]}))),Od=(e,t)=>(n,l)=>{const{type:a}=n;if("default"!==a&&"rte"!==a)return null;switch(a){case"default":return Ld(e,t)(n,l);case"rte":return u(Re,{__html:n.__html});default:Dd(n)}},Ld=(e,t)=>(n,l)=>u("div",{className:"contents",children:p("div",{className:"flex flex-row items-center relative",children:[u("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:$d(e,t)(n,l)}),p("div",{className:N("flex flex-col justify-center h-fit",Fd[e]),children:[n.label?u(I,{size:"text-l",align:"text-left",children:n.label}):null,n.description?u("div",{className:N("text-s font-light text-left",Ed.description),children:n.description}):null]})]})},String(l)),$d=(e,t)=>(n,l)=>{const a="secondary"===t?"white":"color",i=Boolean(n?.icon?.src),r=_d[e][i?"image":"icon"],s=i?"transparent"===t:t;return u(k,{className:N(r,"z-10 mr-s flex justify-center content-center rounded-md"),defaultPadding:"",version:s,children:u("span",{className:"flex max-w-full max-h-full items-center justify-center",children:He(n?.icon)?u(te,{image:{...n.icon,iconVersion:n.icon?.iconVersion||a},imageClassName:"max-w-full max-h-full",width:Ud(e),height:Ud(e)}):u("span",{className:N("text-h4","transparent"===t?Ed.iconText:(o=t,"secondary"===o?"group-data-primary:text-white":"text-secondary-text")),children:l+1})})});var o},Ud=e=>"normal"===e?"38":"24",Hd="hidden sm:flex absolute z-40 top-0",Wd=g((({className:e,items:t=[],value:n,onChange:l,tabsType:a})=>{const[i,r]=Aa({itemCount:t?.length||0});return p("div",{className:N("relative overflow-x-auto no-scrollbar",e),role:"tablist",children:[u(ya,{containerRef:i,snapAlign:"snap-start",onVisibleIndicesChange:r.handleVisibleIndicesChange,children:t.map(qo(n,l,a))}),r.canScrollLeft?u(Zi,{className:N("left-6",Hd),onClick:r.scrollLeft}):null,r.canScrollRight?u(er,{className:N("right-6",Hd),onClick:r.scrollRight}):null]})})),Kd=({tabsMode:e,...t})=>{switch(e){case"wideScreen":return u(Jo,{...t});case"centered":return u("div",{className:"flex",children:u(Jo,{className:"m-auto p-xs rounded-md bg-main-gray",tabsType:"rounded",...t})});case"scrollable":return u("div",{className:"flex",children:u(Wd,{className:"m-auto",tabsType:"underlined",...t})});default:return null}},Yd="tab",Gd=g((({className:e="",isSticky:t,tabs:n=[],tabsMode:s,...o})=>{const c=v(),{isReady:d}=c,m=r((()=>n.map(qd)),[n]),[h,p]=l(0);a((()=>{if(!n||!n[0])return;const e=c.query.tab&&n.findIndex((e=>"group"===e.type&&e.ref===c.query.tab))||0,t=n[e]||n[0];p(e),Xd(t)}),[d]),a((()=>{const e=n[h];"group"===e?.type&&y.subject("tab",{type:e.type,label:e.ref,groupName:e.name})}),[n,h]);const g=i((e=>{const t=m.indexOf(e),l=n[t];p(t),Xd(l),"group"===l.type&&(e=>{const t=new URLSearchParams(c.query);e.name?t.set(Yd,e.name):t.delete(Yd),c.replace(`${c.pathname}?${t}`,"",{scroll:!1})})(e)}),[n,m]);return u(k,{className:N(t?"sticky top-1 z-20":"",e),defaultPadding:"p-0",...o,children:Kd({items:m,value:m[h],tabsMode:s,onChange:g})})})),Xd=e=>{"group"===e.type&&y.fire("tab",{type:e.type,label:e.ref,groupName:e.name}),"link"===e.type&&y.fire("tab",{type:e.type,label:e.href})},qd=e=>"group"===e?.type?{text:e.title,name:e.ref}:e,Jd={start:"text-start",center:"text-center",end:"text-end"},Qd=g((({tab:e,className:t,onClick:n,isActive:l})=>{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"}))(l);return p("button",{type:"button",onClick:n,"aria-label":e?.title,className:N("border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs",a.btn,t),children:[e?.icon?u(te,{className:N("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,p("div",{className:"border-0",children:[e?.title?u("div",{className:a.title,children:e.title}):null,e?.description?u("div",{className:a.desc,children:e.description}):null]})]})}));function Zd(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const em=g((({tab:e})=>{const t=de();return Zd((()=>{const{onClick:n}=t(e);n()}),[e],500),u(ld,{className:"col-span-12 p-xl",size:5})})),tm=g((({className:e="",tabs:t=[],block:n,tabAlign:i,...r})=>{const[s,o]=l(lm(t)),c=nm(t[s],s),d=t.length,[m,{inc:h,dec:g}]=Ji({itemCount:d},s),[x,f]=Aa({itemCount:d});return a((()=>{f.scrollTo(s,{behavior:"auto"})}),[]),p(k,{className:N(e),defaultPadding:"p-0",...r,children:[p("div",{className:"relative border-b-8 border-primary-main",children:[u(ya,{itemClassName:"flex",containerRef:x,snapAlign:"snap-end",gap:8,onVisibleIndicesChange:f.handleVisibleIndicesChange,children:t.map(am(s,o,i))}),u(lr,{scroll:f,arrowsPadded:!0,onScrollLeft:g,onScrollRight:h,activeIndex:m,itemCount:d})]}),u("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:t[s]?.href?u(em,{tab:t[s]}):z(n?.slots?.[c],{...r?.options,slotName:c})})]})}));tm.slots=({tabs:e})=>e?.filter((e=>!e.href)).map(nm)||[],tm.childrenTypes={exclude:["TabsLayout"]};const nm=(e,t)=>e?.title||`Слот №${t}`,lm=e=>e.reduce(((e,t,n)=>t.selected?n:e),0),am=(e,t,n="start")=>(l,a)=>u(Qd,{className:Jd[n],tab:l,isActive:e===a,onClick:()=>t(a)},String(a)),im={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},rm=g((({children:e,activeIndex:t,columnWidth:n,version:l="comparison"})=>u("div",{className:"flex flex-1 overflow-hidden",children:u("div",{className:im[l],style:{transform:`translateX(-${t*n}px)`},children:e})}))),sm=g((({className:e="",isOpen:t,onClick:n})=>u(ge,{className:e,appendRight:u(te,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),om={Buttons:({buttons:e})=>We(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?u(te,{image:e}):null,List:({isDotted:e,...t})=>u(Je,{className:"flex flex-col justify-between items-start text-h6",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>p("div",{className:"space-y-2xs",children:[e?u("div",{children:u(Ve,{size:"text-h6",children:e})}):null,t?u("div",{children:u(Ve,{size:"text-l",color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,dataUrl:n,pdfUrl:l,isOpen:a})=>e?u(sm,{isOpen:a,onClick:()=>{t({dataUrl:n,pdfUrl:l})}}):null},cm=g((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:i,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=l(!0);a((()=>{i===o&&s||m(!0)}),[s,o]);return dm({cell:e,cellProps:{rowIdx:n,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),dm=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...l}=e;if(!n||!(n in om))return null;return u(om[n],{...t,...l})},mm=g((({cells:e,rowIdx:t,cellIdx:n,setTableInner:l,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r})=>u("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>u(cm,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:l,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),hm=(e,t)=>140*Be(e.slice(0,t).map((e=>e?.cols?.length??1))),um=(e,t)=>e?.length>0?u("div",{className:N("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>u("div",{className:"w-20 mx-lg",children:u(Ve,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,pm=g((({rows:e})=>{return u(ya,{visibleItemCount:0,snapAlign:"snap-start",children:u("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[l,...a]=e,i=N("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return p("div",{className:"flex border-main-divider border-b border-solid h-full",children:[l?.data?u("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:u(Ve,{size:"text-xl",font:"font-light",children:l.data})}):null,u("div",{className:"flex flex-grow overflow-hidden",children:u("div",{className:i,style:{transform:`translateX(-${hm(a,t)}px)`},children:a?.map(((e,n)=>p("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?u(Ve,{size:"text-xl",children:e.data}):null,e?.cols?um(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),gm=g((({activeTabIndex:e,items:t})=>u("div",{children:t.map(((t,n)=>{const l=`activeTabIdx:${e}-tableIdx:${n}`;return p("div",{className:"w-full @container",children:[u("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:u(Ve,{size:"text-xl",align:"text-left",children:t.title})}),u("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:u("div",{className:"relative",children:u(pm,{rows:t.rowsData})})})]},l)}))}))),xm=(e=!1)=>""+(e?"text-white":"text-secondary-text"),fm=g((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:l})=>p("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?u("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>u("div",{className:N("rounded-md px-4 py-3 cursor-pointer",t===n?"bg-primary-main":""),onClick:()=>l(t),children:u(Ve,{size:"text-xl",font:"font-light",color:xm(t===n),children:e||t+1})},e)))}):null,t?u(ge,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:u(K,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]})));async function bm(e){const t=await fetch(e);return await t.json()}const ym=g((({dataUrl:e,pdfUrl:t,onClick:n})=>{const{tableData:a}=function(e){const{data:t}=ht(function(e){return`/wcms-resources/${e||"tariffs-inner-table-data"}.json`}(e),bm);return t||{}}(e),[r,s]=l(0),o=i((e=>s(e)),[]),c=a?.[r]?.items??[],d=a?.map((e=>e.currency??""));return p("div",a?{className:"bg-white z-10",children:[u(fm,{currencies:d,activeTabIndex:r,setActiveTabIndex:o,linkToPDF:t}),u(gm,{activeTabIndex:r,items:c}),u(sm,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[u(Ve,{size:"text-h6",children:"Данных нет"}),u(sm,{onClick:n,isOpen:!0})]})})),vm=g((({children:e,tableInner:t,onHideContentClick:n})=>p("div",{className:"self-start flex flex-col",role:"row",children:[u("div",{className:N("@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?u("div",{className:"origin-top animate-expansion",children:u(ym,{...t,onClick:n})}):null]}))),Nm=g((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,o]=l(void 0),c=i((e=>o(e)),[]),[d,m]=l(void 0),h=i((e=>m(e)),[]);return p(vm,{onHideContentClick:()=>o(void 0),tableInner:s,...r,children:[u("div",{className:N("text-s","w-80 flex-shrink-0"),children:p("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?u(te,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?u(Ve,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?u(rm,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>u(mm,{cells:e,rowIdx:a,cellIdx:t,setTableInner:c,tableInner:s,openTableInnerIdx:d,setOpenTableInnerIdx:h,...r},String(t))))}):null]})}));function wm({dec:e,inc:t,canDec:n,canInc:l,btnClass:a,className:i=""}){return n||l?p("div",{children:[n?u(Qi,{className:N("absolute z-40",a[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,l?u(Qi,{className:N("absolute z-40 rotate-180",a[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!l}):null]}):null}const km=g((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return p("div",{role:"table",children:[p("div",{className:"relative space-y-xs",children:[e,wm({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?u("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Sm=g((({className:e="",title:t,description:n,rowHeaders:l,tariffsColumns:a,hiddenRowsNum:i=0,...r})=>{const s=a?.map((({data:e})=>e))||[],o=l?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),c=s.length,[d,m]=Ji({itemCount:c,visibleItemCount:2}),h=(o||[]).map(((e,t)=>u(Nm,{row:e,activeIndex:d,rowIdx:t,...r},String(t)))),[g,x]=i>0?[h.slice(0,-i),h.slice(-i)]:[h,[]];return p(k,{className:N("overflow-hidden relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[u(P,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),u("div",{className:"space-y-m",children:i>0?u(Ea,{renderFoldableSection:({isUnfolded:e})=>p(km,{controls:m,children:[g,u(ja,{isUnfolded:e,children:x})]}),renderFoldButton:kr}):u(km,{controls:m,children:h})})]})})),Cm=g((({className:e="",title:t,description:n,iconVersion:l,__html:a,...i})=>p(k,{className:N("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...i,children:["small"===l?Tm():null,p("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?u(Ve,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Im(n):null,a?u(Re,{__html:a}):null]})]}))),Tm=()=>u("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"}),Im=e=>u(I,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Bm=g((({prefix:e,unit:t,suffix:n})=>p("div",{className:"w-full flex items-end",children:[e?u("div",{className:"gradient-color-text",children:u(Ve,{size:"text-h2",children:e})}):null,t?u("div",{className:"-mb-6 @xl:-mb-4",children:u("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?u("div",{className:"gradient-color-text",children:u(Ve,{size:"text-h2",children:n})}):null]}))),Pm=g((e=>{const{prefix:t,unit:n,suffix:l,...a}=e;return u(k,{defaultPadding:"p-0",...a,children:u(Bm,{prefix:t,unit:n,suffix:l})})})),Mm={AdTile:vt,ApplicationForm:oa,BenefitsBlock:ua,BonusBenefitsBlock:Da,ButtonsBlock:Fa,Calculator:Li,CardTransfer:qi,Carousel:ur,CarouselBankHistoryCard:pr,CarouselCard:fr,CarouselCatalogCard:yr,CarouselLinks:Cr,CarouselRecommendationCard:Ar,CarouselTariffsCard:Dr,ComparisonTable:Kr,DepositFiltration:ps,ErrorBlock:fs,ExchangeRateTile:$s,Footer:so,Header:vo,Headline:P,HorizontalLayout:ko,ImgBlock:So,LinkDocs:Po,MobileAppTile:Ao,MortgageFiltration:Zo,OfficesAtmsMap:nd,Placeholder:sd,ProductBlock:st,ProductGallery:od,RepresentativeOfficeInfo:cd,RichTextBlock:hd,RollupItem:Ys,SafeDepositRental:Vd,StepsBlock:jd,Tabs:Gd,TabsLayout:tm,TariffsTable:Sm,TextBlock:Cm,UnitBlock:Pm,VerticalLayout:wo},Rm=g((({className:e,onClose:t})=>u("button",{className:N("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",children:u(te,{image:{icon:"CloseIcon"},width:"24",height:"24"})}))),Am="cookie",Vm=g((({termLink:e,personalDataPolicyLink:t})=>{const[n,{setTrue:l,setFalse:a}]=nn();Zd((()=>{globalThis.localStorage?.getItem(Am)||l()}),[],3e3);const r=i((()=>{globalThis.localStorage?.setItem(Am,"true"),a()}),[]);return n?u("div",{className:"container fixed left-0 right-0 bottom-0 z-50",children:p("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[u("div",{className:"sm:flex-1",children:p(I,{size:"text-s",font:"font-light",color:"text-primary-text",children:["АО «Россельхозбанк» использует",u(Br,{isRemote:!0,className:zm(e?.href),...e,children:"cookie"}),"(файлы с данными о прошлых посещениях сайта) для персонализации сервисов и удобства пользователей. Вы можете запретить сохранение cookie в настройках своего браузера.",u(Br,{isRemote:!0,className:zm(t?.href),...t,children:"Обработка Ваших персональных данных"}),"производится в соответствии с требованиями Федерального закона от 27.07.2006 № 152-Ф3 «О персональных данных»."]})}),u("div",{className:"ml-s sm:ml-0 w-24 flex justify-end",children:u(Rm,{className:"bg-main-gray rounded-md",onClose:r})})]})}):null})),zm=e=>N("inline mx-2xs",e?"text-green-dark":"");const Dm=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=l(e),a=i((e=>n((t=>[...t,e]))),[]),r=i((()=>n((e=>e.slice(0,-1)))),[]),s=i((e=>n((t=>t.filter((t=>t!==e))))),[]),o=i((()=>n([])),[]);return[t,{setList:n,push:a,pop:r,remove:s,clear:o}]}(),c=i((()=>{e&&e(n),o()}),[n,e]),d=i((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return a((()=>y.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:Dd(e)}}))),[c,d]),n},_m=g((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),n=Dm({onCloseAll:e,onClose:t}),{close:l}=oe(),r=i((({key:e})=>{"Escape"===e&&l()}),[]);return an(globalThis.document,"keydown",r),a((()=>{n.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"))}),[n]),n.length?u("div",{className:"fixed inset-0 z-50",role:"dialog",children:n.map((({dialog:e,id:t},l)=>u("div",{className:N("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar",l===n.length-1?"":"hidden"),children:e},String(t||l))))}):null})),Fm=g((()=>{const[e,t]=l(null),n=i((()=>{t(null)}),[]);a((()=>y.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:Dd(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&n()}),[n]);return an(globalThis.document,"keydown",r),e?u("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})),Em=e=>({href:t})=>!!t&&E(jm(t,e)).startsWith(E(t)),jm=(e,t)=>_(e)?t.href:t.pathname;function Om(e=[]){const t=v(),n=e.findIndex((e=>Em(d.BASE_PATH?{pathname:d.BASE_PATH}:e))(t));return[n,e[n]]}const Lm=g((({isActive:e,onClick:t})=>p("button",{className:N(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),onClick:t,children:[u(K,{className:"w-6 h-6",name:"BurgerIcon",iconVersion:e?"color":"black"}),"Меню"]}))),$m=g((({isActive:e,item:t,onClick:n})=>{const l=de({isRemote:!0}),{href:a,onClick:i}=l({href:t?.href,onClick:n});return p("a",{className:N(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:i,children:[u(K,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]})})),Um=g((({className:e,head:t,children:n,onClose:l})=>{const{close:a}=oe(),r=i((()=>{a(),l&&l()}),[l]);return p("div",{className:N("relative min-h-full bg-white pt-0 p-5",e),children:[p("div",{className:"sticky py-xl top-0 bg-white z-10",children:[u(Rm,{className:"absolute top-0 right-0",onClose:r}),u("div",{className:"container",children:t})]}),u("div",{className:"container pb-6xl",children:n})]})})),Hm=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:l,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),l=Array.from({length:e.length}),a=Array.from({length:t.length});let i=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)l[r]||a[n]||e[r]!==t[n]||(i++,l[r]=!0,a[n]=!0)}return{m:i,s1Matches:l,s2Matches:a}}(e,t);if(0===n)return 0;const i=function(e,t,{s1Matches:n,s2Matches:l}){let a=0;for(let i=0,r=0;i<e.length;i++){if(!n[i])continue;let s=r;for(;s<t.length;s++)if(l[s]){r=s+1;break}e[i]!==t[s]&&a++}return a}(e,t,{s1Matches:l,s2Matches:a}),r=(n/e.length+n/t.length+(n-i/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const Wm=e=>e?.length?p("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[u("div",{className:"mb-m",children:u(Ve,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),u("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>u(Km,{...e},String(t))))})]}):null,Km=g((({icon:e,...t})=>{const n=de(),{text:l,target:a,href:i,onClick:r}=n(t);return p("div",{className:"flex gap-s items-center",children:[e?u(te,{pathPrefix:"/wcms-resources/",image:e}):null,l?u("a",{className:"hover:text-primary-hover",href:i,target:a,onClick:r,children:u(Ve,{size:"text-l",font:"font-light",color:"text-primary-text",children:l})}):null]})})),Ym=e=>t=>u("div",{className:"mb-xs sm:mb-2xs",children:u("button",{className:"cursor-pointer hover:text-primary-hover",onClick:()=>{e&&e(t)},children:u(Ve,{size:"text-l",font:"font-light",children:t.name||""})})},t.id),Gm=g((({className:e,searchTerm:t,onSearch:n})=>p("form",{className:`font-sans relative ${e}`,children:[u("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:u("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),u("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=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),Xm=g((()=>{const{defaultLocation:e,foreignOffices:t}=Hs(),[n,a]=ys(e),[r,s]=l(""),o=Jm(tn()).sort(((e,t)=>e.name.localeCompare(t.name))),c=((e,t)=>{const n=new Map;for(const l of e){const e=t(l),a=n.get(e)||[];n.set(e,[...a,l])}return n})(o,qm),{close:d}=oe(),m=i((e=>{a(e),d()}),[]);return p(Um,{className:"pb-20",head:p("div",{children:[u(Ve,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),n?p("div",{className:"mb-s",children:[u(Ve,{size:"text-l",font:"font-light",children:"Сейчас выбран: "}),u("button",{onClick:()=>a(n),children:u(Ve,{color:"text-primary-main",children:n.name})})]}):null,u(Gm,{onSearch:s,searchTerm:r})]}),children:[r&&r.length>=3?u("div",{children:o.filter((({name:e})=>e&&Hm(e.toLowerCase())(r.toLowerCase())>=.8)).map(Ym(m))}):u("div",{className:"columns-1 sm:columns-5",children:Array.from(c.entries()).map((h=m,([e,t])=>p("div",{className:"break-inside-avoid mb-2xl w-56",children:[u("div",{className:"mb-s",children:u(Ve,{size:"text-h6",children:e})}),t.map(Ym(h))]},e)))}),Wm(t)]});var h})),qm=e=>e.name?.charAt(0)||"",Jm=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Qm=g((({className:e,value:t,autoFocus:n,onChange:l,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{l&&l(e.target?.value||"")}),[l]);return p("div",{className:N("font-sans relative",e),role:"form",children:[u("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:u(te,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),u("input",{className:N("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:r,autoFocus:n,onChange:s,onFocus:a})]})})),Zm=(e,t)=>(n,l)=>{for(const[a,i]of l)n.set(a,e(n.get(a)||t,i));return n},eh=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),th=e=>t=>e.map((([e,n])=>[Hm(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>lh(t,e))).reduce(Zm(Math.max,0),new Map),nh=e=>t=>{return cs(t,t.map((({title:e})=>e)).map((e=>t=>{const n=eh(t||"");return n.length?Be(e.map((e=>Ia(n.map(Hm(e)))))):0})(e))).sort((e=>(t,n)=>-e(t,n))((n=([,e])=>e,(e,t)=>n(e)-n(t)))).map((([e])=>e));var n},lh=(e,t)=>new Map(e.map((e=>[e,t]))),ah=({basePathList:e,initialQuery:t=""})=>{const[n,i]=l(t||"");a((()=>{null!=t&&i(t)}),[t]);const{data:r}=ht(e?.length?e:null,ih),[s,o]=l(null);return Zd((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:l}=t||{};if(!(e&&n?.length&&l&&Object.keys(l).length))return[];const a=eh(e);if(!a.length)return[];const i=Object.entries(l),r=[...a.map(th(i)).reduce(Zm(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>n[e]));return nh(a)(r)})(n)))}),[r,n]),[s,{value:n,onChange:i}]},ih=async(...e)=>(await Promise.allSettled(e.map((e=>pt(j(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),rh=g((({className:e,topItems:t})=>{const n=de({isRemote:!0});return u("div",{className:N("flex items-start justify-between",e),children:t?.map(n).map(oh)})})),sh=["all","footer"],oh=(e,t)=>{const{text:n,items:l=[],href:a,target:i,onClick:r}=e,s=l.filter((e=>!e.displayArea||sh.includes(e.displayArea.toLowerCase())));return p("div",{className:"flex flex-col gap-s w-1/4",children:[u("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:i||"_self",onClick:r,children:n||`Раздел ${t}`}),s.map(((e,t)=>u(ch,{...e,basePath:o(a),index:t},String(t))))]},String(t))},ch=g((({text:e,index:t,basePath:n,...l})=>{const a=de({isRemote:!(!d.BASE_PATH||!n)&&!d.BASE_PATH.startsWith(n),basePath:n}),{href:i,target:r,onClick:s}=a(l);return u("a",{className:N("text-l font-light text-secondary-text hover:text-primary-main no-underline","overflow-x-hidden overflow-ellipsis whitespace-nowrap"),href:i,target:r||"_self",onClick:s,children:e||`Раздел ${t}`})})),dh=g((({initialQuery:e})=>{const{topItems:t}=Hs(),n=r((()=>t?.map((e=>e.href||"/"))),[t]),[l,i]=ah({basePathList:n,initialQuery:e}),s=r((()=>mh(t)(l)),[t,l]);return a((()=>function(e){for(const t of e.filter((({items:e})=>e?.length)))console.group(t.text),console.table(t.items,["text","href"]),console.groupEnd()}(s)),[s]),u(Um,{head:u(Qm,{autoFocus:!0,...i}),children:u(rh,{topItems:s})})})),mh=e=>t=>e?.length&&t?.length?cs(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:j("/",t)})))}))):[];const hh=g((({className:e})=>{const[t,n]=l(""),a=i((()=>n("")),[]),{open:r}=(()=>{const{open:e,close:t}=oe();return{open:(t={},n={})=>e(u(dh,{...t}),n),close:t}})(),s=i((e=>{n(e),uh(e)&&r({initialQuery:e},{onClose:a})}),[a]);return p("div",{className:N("relative",e),children:[u(Qm,{value:t,onChange:s}),u(Rm,{className:"absolute top-0 right-0 sm:hidden",onClose:a})]})})),uh=e=>e&&e.length>=3,ph=g((({item:e,basePath:t})=>{const n=de({isRemote:!(!d.BASE_PATH||!t)&&!d.BASE_PATH.startsWith(t),basePath:t}),{href:l,target:a,onClick:i}=n(e),r=v(),s=Em(r)({href:l});return p("a",{className:N(s?"text-primary-main":"text-primary-text","py-3 text-h5 font-light flex justify-between cursor-pointer"),href:l,target:a,onClick:i,children:[e.text,u(te,{image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24",className:"text-secondary-text rotate-180 opacity-30"})]})})),gh=g((({activeMenuSubItems:e,basePath:t})=>e?u("div",{className:"mb-5",children:e.map(((e,n)=>u(ph,{item:e,basePath:t},String(n))))}):null)),xh=({item:e,isActive:t,onClick:n})=>p("button",{type:"button",className:"relative",onClick:n,children:[u("span",{className:N("whitespace-nowrap",t?"text-primary-main":""),children:e.text}),t?u("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent"}):null]}),fh=g((e=>{const{topItems:t,officesLink:n,defaultLocation:s}=Hs(e.options?.page?.fallback),[o]=ys(s),c=(()=>{const{open:e,close:t}=oe();return{open:(t={})=>e(u(Xm,{}),t),close:t}})(),d=i((()=>c.open()),[]),[m,h]=Aa({itemCount:t?.length??0}),[g]=Om(t),[x,f]=l(g),b=r((()=>t?.[x]),[t,x]),y=b?.items||[];a((()=>{f(g)}),[g]),a((()=>{x>0&&h.scrollTo(x)}),[x,h]);const v=i((e=>f(e)),[]);return u(Um,{head:u("div",{className:"flex items-center",children:u(T,{as:"h4",title:"Меню"})}),children:p("div",{className:"flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md",children:[u("div",{className:"w-full mb-3",children:u(ya,{containerRef:m,visibleItemCount:0,gap:20,className:"pb-3",children:t?.map(((e,t)=>u(xh,{item:e,isActive:x===t,onClick:()=>v(t)},String(t))))})}),p("div",{className:"relative grow overflow-auto",children:[u(gh,{activeMenuSubItems:y,basePath:b?.href}),u(hh,{className:"grow mb-5"}),bh(n),p("div",{className:"flex items-center text-s cursor-pointer",onClick:d,children:[u(te,{image:{icon:"GeolocationIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),p("div",{className:"flex flex-col items-start",children:[u(Ve,{size:"text-h5",children:o.name}),u(Ve,{color:"text-secondary-text",size:"text-s",children:"Ваша локация"})]})]})]})]})})})),bh=e=>e?p("a",{className:"flex items-center mb-3",href:e,rel:"noopener noreferrer","aria-label":"Офисы и банкоматы",children:[u(te,{image:{icon:"MapOpenedIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),u("span",{children:"Офисы и банкоматы"})]}):null,yh="burgerMenuDialog",vh=[],Nh=g((({...e})=>{const[t,{toggle:n,close:l}]=(()=>{const{open:e,closeAll:t,close:n}=oe(),l=Dm(),a=((e,t)=>t.find((t=>t.id===e),e))(yh,l),r=i((()=>e(u(fh,{}),{id:yh})),[]),s=i((()=>{a?t():r()}),[a]);return[Boolean(a),{open:r,close:n,toggle:s}]})(),a=d.STICKY_MOBILE_MENU||"sticky-mobile-menu",{menuItems:r=vh}=bt(a,{fallback:e.options?.page?.fallback,pathDir:j(d.BASE_PATH,"portal-resources")}),[,s]=Om(r),o=Math.floor(r.length/2),c=r.slice(0,o),m=r.slice(o);return u("div",{className:"w-full mb-5","data-component":"sticky-bottom-menu-container",children:u("div",{className:"fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]",children:p("div",{className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[c.map(wh(s,l)),u(Lm,{isActive:t,onClick:n}),m.map(wh(s,l))]})})})})),wh=(e,t)=>(n,l)=>u($m,{isActive:n===e,item:n,onClick:t},n.href||String(l)),kh=h();const Sh=g((({className:e,onClick:t,ariaLabel:n})=>u("button",{type:"button",className:`border-0 w-9 bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":n,children:Ch()}))),Ch=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[Th("M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"),Th("M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z")]}),Th=e=>u("path",{stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",strokeMiterlimit:"10",d:e}),Ih=g((({className:e=""})=>{const t=function(e){const[t,n]=l(0);return a((()=>{(async()=>{const[t]=await kh.getLikeCount(e);n(t?.value||0)})()}),[e]),{likeCount:t,like:i((async()=>{n(await kh.like(e))}),[e]),dislike:i((async()=>{n(await kh.dislike(e))}),[e])}}(v().pathname);return p("div",{className:`border-main border-2 border-solid bg-white flex w-32 items-center justify-center gap-s p-xs font-sans ${e}`,children:[u(Sh,{onClick:ce(t.like),ariaLabel:"Поставить отметку «лайк»"}),u(Sh,{onClick:ce(t.dislike),className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),u("span",{className:"select-none",children:t.likeCount})]})})),Bh=g((({className:e,blocksRegistry:t,blockDecorator:n,data:l={}})=>{const{style:a,slots:i,likeControl:r,colorPalette:s="pc"}=l,o={key:"",page:l,blocksRegistry:t,blockDecorator:n,parent:l};return p("div",{"data-theme":s,children:[p("section",{className:N("@container relative",a,e),children:[i?.header?u("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:z(i?.header,{...o,slotName:"header"})}):null,p("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:l,options:o,extraProps:{className:"scroll-mt-12"}}),z(i?.footer,{...o,slotName:"footer"})]}),r?u("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:u(Ih,{className:"rounded-tl-3xl sticky bottom-0 pointer-events-auto"})}):null]}),u(Nh,{options:o}),u(_m,{}),u(Fm,{}),u(Vm,{termLink:{href:"/pd-policy#cookie",target:"_blank"},personalDataPolicyLink:{href:"/pd-policy",target:"_blank"}})]})}));Bh.childrenTypes=[],Bh.slots=()=>["header","footer"];e.Blocks=Mm,e.ContentPage=Bh,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))))))(),n=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await n.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.LikeAPI=h,e.handlerDecorator=ce,e.joinList=e=>t=>t.reduce(((t,n,l)=>t.length?t.concat({...e,key:`sep-${l}`},n):[n]),[]),e.packageVersion="0.14.150",e.projectSettings=d,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=O,e.useRouter=v,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 n=e=>(...n)=>t[e](...n),l=n("useState"),a=n("useEffect"),i=n("useCallback"),r=n("useMemo"),s=n("useRef");const o=e=>e&&!e.endsWith("/")?`${e}/`:e,c={PROD_BRANCH:"master"},d=new class{_=c;setup(e){this._=e}get TEST_BRANCH(){return this._.TEST_BRANCH}get RC_BRANCH(){return this._.RC_BRANCH}get PROD_BRANCH(){return this._.PROD_BRANCH||c.PROD_BRANCH}get FORCED_DRAFT_FLOW(){return this._.FORCED_DRAFT_FLOW}get ASSIST_PROJECT_ID(){return this._.ASSIST_PROJECT_ID}get SITEMAP(){return this._.SITEMAP}get STICKY_MOBILE_MENU(){return this._.STICKY_MOBILE_MENU}get FOOTER(){return this._.FOOTER}get PORTAL_DATA(){return this._.PORTAL_DATA}get CHAT_BOT(){return this._.CHAT_BOT}get CDN(){return o(this._.CDN)}get BASE_PATH(){return o(this._.BASE_PATH)}get YANDEX_MAP_API_KEY(){return this._.YANDEX_MAP_API_KEY}get YANDEX_METRIKA_ID(){return this._.YANDEX_METRIKA_ID}},m="likesToken";function h(){async function e(){try{const e=JSON.parse(globalThis.localStorage?.getItem(m)||"");if(e?.token)return e}catch(e){}try{const e=await fetch("/assist/v1/public/auth",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:t,name:n}=await e.json();return globalThis.localStorage?.setItem(m,JSON.stringify({token:t,name:n})),{token:t,name:n}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...t){if(!t.length)return[];const{token:n}=await e();try{const e=await fetch(`/assist/v1/public/projects/${d.ASSIST_PROJECT_ID}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:n},body:JSON.stringify({node_ids:t})}),{likes:l}=await e.json();return l||[]}catch(e){return console.error(e),[]}},like:async function(t){if(!t)return 0;const{token:n,name:l}=await e();try{const e=await fetch(`/assist/v1/public/projects/${d.ASSIST_PROJECT_ID}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:n,UserID:l},body:JSON.stringify({node_id:t,user_name:l})}),{likes:a}=await e.json();return a||0}catch(e){return console.error(e),0}},dislike:async function(t){if(!t)return 0;const{token:n,name:l}=await e();try{const e=await fetch(`/assist/v1/public/projects/${d.ASSIST_PROJECT_ID}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:n,UserID:l},body:JSON.stringify({node_id:t,user_name:l})}),{likes:a}=await e.json();return a||0}catch(e){return console.error(e),0}}}}const u=(...e)=>globalThis._uni._jsx(...e),p=(...e)=>globalThis._uni._jsxs(...e),g=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:x(e)),t._tmpl},x=e=>{function t(t,n){const{children:l,...a}=t||{},i=n?.slots?.default,r=l||i&&i();return e(Object.assign(a,r&&{children:r}),n)}return t.inheritAttrs=!1,t},f=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),b=g((({children:e})=>f?e:null));const y=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{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 v(){return v._impl()}v._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),v.setup=e=>{v._impl=e};const N=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),w={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","":""},k=g((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:i="p-xl",padding:r,block:s,tag:o="section",role:c,children:d,style:m})=>{const h=o,p=v(),[g,x]=l(!1);a((()=>y.subscribe("tab",(e=>{e.groupName&&e.groupName!==s?.labelGroup||x(Boolean(e.label&&s?.labels?.length&&!s.labels.includes(e.label)))}))),[s,p]);const f=t&&n;return u(h,{className:N("@container font-sans",f?"group":"",w[t],g?"hidden":"",r||i,e),...f?{"data-ver":t}:{},...s?.anchor?{id:s.anchor}:{},role:c,style:m,children:d})})),S={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"},T=g((({className:e="",headingType:t="h3",as:n="h3",title:l,children:a})=>{const i=S[n]||"h3";return u(i,{className:N("font-sans m-0",C[t],e),children:l||a})})),I=g((({children:e,...t})=>u("p",{className:N("font-sans",Object.values(t)),children:e}))),B={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"}},P=g((({className:e,version:t="",headlineVersion:n="XL",title:l,description:a,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:o=!1,...c})=>{const d=B[n],m={marginTop:d.descriptionStyle};return p(k,{className:N(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:o,...c,children:[l?u(T,{className:N("whitespace-pre-wrap",i),...d?.title,as:r||d?.title.as,title:l}):null,a?u(I,{size:d.descriptionSize,font:d.descriptionWeight,align:i,...m,children:a}):null]})})),M=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),R=[];function A(e,t,{className:n,...l}={}){const{key:a,blockDecorator:i=M,blocksRegistry:r={},ancestors:s=R}=t,{type:o}=e;o&&o in r||console.warn(`No block with "${o}" is registered`);const c=o&&r[o];return i({blockClassName:N(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:i})=>{const{content:r}=n;return c?u(c,{className:i,block:e,options:t,...r,...l},a):null}},a)}const V=[],z=(e,{key:t,ancestors:n=V,slotName:l=null,extraProps:a,renderProps:i=A,...r})=>{const s=a?(e,t)=>A(e,t,a):i;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||V,[r.parent,l]]:n},a)))};function D({block:e,options:t,children:n,extraProps:l,renderProps:a}){return n||(e&&t?z(e.blocks,{...t,parent:e,extraProps:l,renderProps:a}):null)}const _=e=>Boolean(e?.includes(":")),F=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),E=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),j=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/");var O=Object.freeze({__proto__:null,isURL:_,isLocalURL:F,isHash:e=>Boolean(e?.startsWith("#")),withoutQuery:E,joinPath:j});const L="/api/",$=`${L}v1/storage`,U=e=>(t,n=d.BASE_PATH)=>{if(!t||_(t)||[d.CDN,L].some((e=>H(t,e))))return t;if(/^[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(t))return`${$}/${t}/file`;const l=t.startsWith("/");return j(H(t,n)?"":n,l?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},H=(e,t)=>t&&e&&e.startsWith(t),W={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},K=g((({className:e="",imageClassName:t="",name:n="",alt:l=`Иконка ${n}`,title:a=l,iconVersion:i="color",width:r,height:s})=>{const o=v(),c="normal"===i?`${n}.svg`:`sprites.svg#${n}`,m=U(o)(j(d.CDN,"/icons/",c));return"normal"===i?u("img",{className:e,src:m,alt:l,title:a,"aria-hidden":"true",width:r,height:s,style:Y(e,s)}):u(X,{className:e,children:p("svg",{className:N(G(r),W[i],"white"===i?"invert":"",t),width:r,height:s,"aria-hidden":"true",children:[a?u("title",{children:a}):null,l?u("desc",{children:l}):null,u("use",{href:m,xlinkHref:m})]})})})),Y=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},G=e=>e?"":"w-full h-full",X=g((({className:e,children:t})=>e?u("div",{className:e,children:t}):t)),q=(e,t)=>n=>n&&!_(n)?U(e)(j(t,n)):n,J=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=g((({className:e="",image:t,imageClassName:n="",pathPrefix:l})=>{const a=v();return p("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(J).map((({src:e,format:n,media:i},r)=>u("source",{srcSet:q(a,l)(e),type:ee(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?Z({...t,src:q(a,l)(t.src)},n):null]})})),Z=(e,t="")=>u("img",{src:e.src,className:N("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}),ee=e=>e?`image/${String(e)}`:void 0,te=g((({className:e="",image:t,imageClassName:n="",pathPrefix:l,...a})=>t?.src||t?.icon?t.icon?u(K,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):u(Q,{className:e,imageClassName:n,image:t,pathPrefix:l}):null)),ne={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","":""},le="bg-main-divider text-main-disabled",ae={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},ie="text-center font-sans select-none",re={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","":""},se=({className:e,rounded:t,version:n})=>[ie,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ne[n]:"",t?"rounded-full":"rounded-md",e].join(" "),oe=()=>({open:(e,t={})=>y.fire("dialog",{type:"open",dialog:e,...t}),close:()=>y.fire("dialog",{type:"close"}),closeAll:()=>y.fire("dialog",{type:"close",all:!0})}),ce=(e,t)=>ce._impl(e,t);function de(e={}){const{isRemote:t,basePath:n}=e,l=v(),{closeAll:a}=oe();return e=>({...e,href:t&&!n?e.href:U(l)(e.href,n),"aria-label":e.text,onClick:ce(i(e),e)});function i({href:e,target:n,onClick:i}){return r=>{i&&i(r),e&&!t&&F(e,n)&&(a(),r?.preventDefault(),l.push(e))}}}ce._impl=e=>e,ce.setup=e=>{ce._impl=e};const me=g((e=>{const{text:t,aboveText:n,appendLeft:l,appendRight:a,version:i="primary"}=e,r=ue(e)?"hidden lg:block":"";return p("div",{className:N(he(e),"flex gap-xs"),children:[l?u("div",{className:N(r,re[i]),children:l}):null,ue(e)?p("div",{className:"whitespace-pre",children:[n?u("div",{className:"text-xs font-light text-left",children:n}):null,u("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?u("div",{className:N(r,re[i]),children:a}):null]})})),he=e=>{const{version:t,aboveText:n,rounded:l}=e;if("link"===t)return"";const a=""+(n?"py-2.5 px-9":"py-4 px-9");return N("group/btn items-center justify-center",ue(e)?a:"h-12 w-12 m-auto",l?"rounded-full":"")},ue=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),pe=({className:e,rounded:t,version:n})=>["inline-block",ie,n?ae[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ge=g((({disabled:e,children:t,method:n="LINK",href:l,...a})=>{const r=(({method:e,href:t})=>i((n=>{if("POST"!==e||!t)return;n.preventDefault();const{origin:l,pathname:a,searchParams:i}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[l,a].join(""));for(const[e,t]of i.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:l}),s=de()({onClick:r,href:l,...a}),o=t??u(me,{...s});return u(e?fe:xe,{...s,children:o})})),xe=g((({className:e="",href:t,rel:n,target:l,ariaLabel:a,version:i,rounded:r,onClick:s,children:o})=>u("a",{className:se({className:e,version:i,rounded:r}),href:t,rel:n,target:l,"aria-label":a,role:t?"link":"button",onClick:s,children:o}))),fe=g((({className:e,ariaLabel:t,version:n,rounded:l,children:a})=>u("div",{role:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:pe({className:e,rounded:l,version:n}),children:a})));function be(e,t){const n="primary"===e?"white":"black",l="Вернуться назад";return p("div",{className:"hidden sm:flex items-center gap-s",children:[u("div",{className:se({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",version:e,rounded:!0}),onClick:t,children:u(te,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:n}})}),u(ge,{version:"link",className:"group-data-secondary:text-white/80",text:l,ariaLabel:l,onClick:t})]})}const ye={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},ve=g((({className:e,version:t="primary",defaultPadding:n,padding:l="",title:a="",insetTitle:r="",buttons:s,leftImage:o,rightImage:c,imageAlign:d,isImageAlwaysOnRight:m=!1,isImageSecondary:h=!1,backwardButton:g,children:x,...f})=>{const b=v(),y=i((e=>{e?.preventDefault(),b.back()}),[]);return p("div",{className:Ne(l,n,e),children:[g?be(t,y):null,a?u("div",{className:"relative h-full",children:a}):null,p("div",{className:N("grow relative flex flex-col @xl:flex-row gap-3xl w-full",o?"self-start @xl:w-auto":""),children:[Te(o,{imageAlign:d,className:"mx-auto"}),p("div",{className:N("grid gap-3xl",c?"@xl:grid-cols-2":"",o?"":"grow","h-full","auto-rows-[max-content_1fr]"),children:[p("div",{className:"grow space-y-lg min-w-fit",children:[r,x]}),Ce(D({...f,extraProps:{className:"@container-normal"}})),Te(c,{className:N("@xl:justify-self-end @xl:col-start-2",s?we(m):"",ke(m),Ie(h)),imageAlign:d}),Se(s)]})]})]})})),Ne=(e="",t="",n="")=>N("relative flex flex-col gap-3xl overflow-hidden",e||t,n),we=e=>e?"row-span-2":"@xl:row-span-2",ke=e=>e?"col-start-2 self-center":"",Se=e=>e?u("div",{className:"self-end",children:e}):null,Ce=e=>e&&e?.length?u("div",{className:"flex items-start justify-end",children:e}):null,Te=(e,{className:t,imageAlign:n})=>e?u("div",{className:N("shrink-1/2 justify-self-center",n&&ye[n],t),children:e}):null,Ie=e=>e?"hidden @xl:block":"",Be=(e=[])=>e.reduce(((e,t)=>e+t),0),Pe=(e=[])=>e?.length?Be(e)/e.length:0,Me=(e,t="normal")=>e?u("div",{className:N("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:u(te,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Re=g((e=>{const{__html:t="",richVersion:n=""}=e;return t.replace(/<\/?[^>]+\/?>/g,"").trim()?u("div",{"data-component":"rich-text-container",children:u("div",{className:N(n,"md-container"),dangerouslySetInnerHTML:{__html:t}})}):null})),Ae=(e,t)=>e?u(I,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ve=g((({children:e,...t})=>u("span",{className:N("font-sans",Object.values(t)),children:e}))),ze=(e,t)=>e?u(Ve,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,De=(e,t)=>"rte"===e.type&&"__html"in e&&e.__html?u(Re,{...e},`rte-${t}`):["label"in e?ze(e.label,t):null,"description"in e?u("span",{className:e.descriptionClassName,children:Ae(e.description,t)},String(t)):null],_e=g((({className:e,benefitsVersion:t,...n})=>p("div",{className:N("flex gap-m min-w-56 items-center",e),children:["icon"in n?Me(n.icon,t):null,u("div",{children:De(n)})]}))),Fe=e=>"rte"===e.type?e?.__html?.length||0:Math.max(e?.label?.length||0,e?.description?.length||0),Ee=e=>{return((t=e.map(Fe))?.length?Math.sqrt(Math.abs(Pe(t.map((e=>e**2)))-Pe(t)**2)):0)>16;var t},je=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),Oe=e=>!e.some(je),Le=g((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?u("div",{className:N("flex gap-x-m gap-y-s",Ee(n)||Oe(n)?"flex-col":"flex-wrap",e),children:n.map(((e,n)=>u(_e,{benefitsVersion:t,...e},String(n))))}):null)),$e=g((({className:e,benefits:t})=>t?.length?u("div",{className:N("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),children:t.flatMap(De)}):null)),Ue=g((({isTabularBenefits:e,...t})=>u(e?$e:Le,{...t}))),He=e=>Boolean(e?.src||e?.icon),We=(e,{className:t,buttonClassName:n,isVertical:l}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?u("div",{className:N("flex",l?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m",t),children:e.map(Ke(n))}):null,Ke=(e="")=>(t,n)=>{const{text:l,icon:a,iconRight:i,version:r,...s}=t||{},o=Ye(a,r),c=Ye(i,r);return l||a?.icon?u(ge,{className:N("basis-full @lg:basis-auto",e),appendLeft:Ge({...a,iconVersion:o}),appendRight:Ge({...i,iconVersion:c}),version:r,text:l,...s},n?String(n):""):null},Ye=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:n},Ge=e=>He(e)?u(te,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,Xe=g((({className:e,isDotted:t,dotClassName:n,children:l})=>p("div",{className:N("font-sans flex",e),role:"listitem",children:[t?u("div",{className:"shrink-0",children:u("div",{className:N("align-middle inline-block rounded-full group-data-secondary:bg-white",n)})}):null,u("span",{children:l})]}))),qe={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"}},Je=g((({className:e,isDotted:t=!0,items:n=[],listItemSize:l="M",dotClassName:a=""})=>{const i=qe[l];return n?.length?u("section",{className:N("flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text",i.textSize,e),role:"list",children:n.map(((e,n)=>u(Xe,{isDotted:t,dotClassName:N(a||"bg-primary-text",i.dotStyle),children:e},String(n))))}):null})),Qe=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Ze=g((({priceList:e})=>e?.length?u("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",children:e.map(et)}):null)),et=({label:e,amount:t})=>p("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",children:[u(Ve,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?p("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[Qe(2)(t)," ₽"]}):null]}),tt=g((({className:e,tags:t})=>t?.length?u("div",{className:N("flex flex-wrap gap-xs",e),role:"list",children:t.map(nt)}):null)),nt=(e,t)=>u("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:u(Ve,{size:"text-m",font:"font-light",children:e})},String(t)),lt={XXL:"L",XL:"L",L:"M",M:"M",S:"S",XS:"S"},at=g((({className:e,padding:t,defaultPadding:n,title:l,description:a,headlineVersion:i="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:o,benefits:c,__html:d,isFullWidthTitle:m,items:h,isDotted:g=!0,priceList:x=[],tags:f=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:k=!1}={},backwardButton:S,children:C,...T})=>{const I=y?.src?u(te,{image:y}):null,B=u(P,{title:l,description:a,headlineVersion:i,align:r,isEmbedded:!0}),M=c?.filter((e=>"rte"===e?.type||"label"in e||"description"in e));return u(ve,{className:e,padding:t,defaultPadding:n,...m?{title:B}:{insetTitle:B},...it(I,N),isImageSecondary:k,imageAlign:v,isImageAlwaysOnRight:w,buttons:We(b),backwardButton:S,...T,children:p("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[M?.length?u(Ue,{benefitsVersion:s,isTabularBenefits:o,benefits:M}):null,d?u(Re,{__html:d}):null,h?.length?u(Je,{items:h,isDotted:g,listItemSize:lt[i]}):null,C,x?.length?u(Ze,{priceList:x}):null,rt(f)]})})})),it=(e,t)=>t?{rightImage:e}:{leftImage:e},rt=e=>e?.length?u(tt,{tags:e}):null,st=g((({className:e,padding:t,...n})=>u(k,{className:N("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...n,children:u(at,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...n})})));st.childrenTypes=["UnitBlock"];const ot=e=>null!=e,ct=new Map,dt=e=>Boolean(e?.every((e=>Array.isArray(e)?dt(e):!e||"string"==typeof e))),mt=e=>dt(e)?e.toString():"";function ht(e,t,{fallback:n,cache:i}={}){const s=r((()=>ut(e)),[e]),[o,c]=l(void 0),[d,m]=l(void 0);a((()=>{if(!s.some(ot))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=ct)=>n=>{const l=mt(n),a=t.get(l);if(l&&ot(a))return a;const i=e(...n);return l&&ot(i)&&t.set(l,Promise.resolve(i)),i})(t,i)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,i,s]);const h=n&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&n[s[0]];return{data:!o&&h?h:o,error:d,mutate:()=>Promise.resolve(void 0)}}function ut(e){return Array.isArray(e)?e:e instanceof Function?ut(e()):[e]}async function pt(e,t){try{return e?await gt(e,t):null}catch(e){console.error(e)}return null}const gt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),xt={},ft="/wcms-resources";function bt(e,t={}){const{fallback:n=xt,pathDir:l=ft}=t,{data:a}=ht(e?`${l}/${e}.json`:null,gt,{fallback:n});return a||xt}const yt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),vt=g((e=>{const t=((e="reklamnaya-plitka")=>{const t=bt(e),n=r((()=>yt(0,t?.items?.length)),[t]);return t?.items?.[n]})(e.options?.page?.adSourceBook);return t?u(b,{children:u(st,{...t,...e})}):null}));const Nt=e=>e,wt=(e,t)=>{const[n,a]=l(e),[r,o]=l(!1),[c,d]=l({}),m=s({}),h=i(((e,t)=>{const{parse:l=Nt,format:i=Nt}=t||{};return m.current||(m.current={}),m.current[e]||=t=>{a((n=>({...n,[e]:l(t)}))),d((t=>({...t,[e]:!0})))},{value:i(n[e]),isDirty:r||c[e],onChange:m.current[e]}}),[n,r,c]),u=i((e=>{a(e),d(e)}),[]),p=i((()=>{a(e),o(!1),d({})}),[e]),g=i((e=>{e.preventDefault(),o(!0),t&&t(n)}),[t,n]);return[n,{isDirty:r||Object.values(c).some(Boolean),field:h,update:u,reset:p,onSubmit:g}]},kt=e=>e.replace(/[^+\d]/g,""),St=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Ct=e=>!e?.length,Tt=e=>t=>n=>e(n)?[]:[t],It=g((({text:e,link:t})=>p(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:[u(Ve,{children:e||"Нажимая кнопку, вы подтверждаете согласие с "}),t?u(ge,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"text-primary-main",children:u(Ve,{children:t.text})}):null]}))),Bt="container space-y-lg",Pt="w-full max-w-xl space-y-s m-auto",Mt=(e,t)=>{const{value:n,isDirty:l}=e,a=l?t(n):[];return{...e,errors:a,error:a[0]}},Rt=g((({title:e,children:t})=>p("fieldset",{className:"grid @xl:flex @xl:justify-between gap-lg border-b border-b-main-divider @xl:border-none",children:[e?u("legend",{className:"w-full",children:u(T,{title:e,headingType:"h6",className:"@xl:text-center"})}):null,t]}))),At="@xl:w-1/2 space-y-s",Vt=g((({key:e,className:t="",id:n,name:l,type:r="text",label:o,placeholder:c,value:d="",valid:m=!0,children:h,onChange:g,onFocus:x,onBlur:f,pattern:b,autoFocus:y=!1,isTextarea:v=!1})=>{const w=s(null),k=i((e=>{g&&g(e.target?.value||"")}),[g]);a((()=>{y&&w.current?.focus()}),[y,w]);const S="w-full border rounded-md text-primary-text outline-none p-m",C=h?"pr-3xl":"",T=Dt(m);return p("div",{className:N("relative",t),children:[p("label",{children:[o?zt(o):null,v?u("textarea",{className:N("block resize-y min-h-24",S,T),id:N("textarea",n),name:l||n,placeholder:c,value:d,onInput:k,onFocus:x,onBlur:f},e):u("input",{type:r,className:N("h-14",S,C,T),ref:w,id:n,name:l||n,placeholder:c,value:d,onInput:k,onFocus:x,onBlur:f,pattern:b},e)]}),h]})})),zt=e=>u("div",{className:"mb-xs",children:u(Ve,{size:"text-m",font:"font-light",children:e})}),Dt=e=>e?"border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text":"border-error",_t=e=>u("div",{className:"h-4",children:e?u(Ve,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Ft=g((({className:e,label:t,value:n="",placeholder:l,error:a,onChange:i,onBlur:r,isTextarea:s})=>p("div",{className:N("shrink-0 w-full",e),children:[u(Vt,{type:"text","aria-label":t,label:t,valid:Boolean(!a),value:n,onChange:i,onBlur:r,isTextarea:s,placeholder:l}),_t(a)]}))),Et=e=>"_"===e,jt=e=>/\d/.test(e),Ot=e=>Et(e)||jt(e),Lt=[..."+7 (___) ___-__-__"],$t=Lt.findIndex(Et),Ut=Lt.map(((e,t)=>Ot(e)?Lt.slice(0,t).filter(Ot).length:-1));const Ht=g((({children:e,onChange:t,...n})=>{const l=i((e=>t&&t(function(e){const t=e.replace(/\D/g,""),n=Lt.map(((e,n)=>jt(e)?e:t.charAt(Ut[n])||e)),l=Ut.indexOf(t.length-1)+1;return(l?n.slice(0,Math.max($t,l)):n).join("")}(e))),[t]);return u(Vt,{onChange:l,onFocus:e=>l(e?.target?.value||""),...n,children:e})})),Wt=g((({className:e,label:t,value:n,error:l,onChange:a,onBlur:i})=>p("div",{className:N("shrink-0 w-full",e),children:[u(Ht,{"aria-label":t,label:t,valid:Boolean(!l),value:n,onChange:a,onBlur:i,placeholder:"+7 (___) ___-__-__"}),_t(l)]}))),Kt="Некорректно заполненное поле",Yt=Tt((e=>null!=e&&""!==e))(Kt),Gt=Tt((e=>"string"==typeof e&&e.length>1))(Kt),Xt=Tt((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Kt),qt=(Jt=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Tt((e=>"string"==typeof e&&Jt.test(e))))(Kt);var Jt;const Qt=Tt((e=>"boolean"==typeof e&&e))(Kt),Zt=(e,t)=>p(Rt,{title:t,children:[p("div",{className:At,children:[u(Ft,{label:"Наименование организации*",...Mt(e("fullName"),Yt)}),u(Ft,{label:"Контактное лицо*",...Mt(e("name"),Gt)})]}),p("div",{className:At,children:[u(Ft,{label:"ИНН*",...Mt(e("inn"),Xt)}),u(Wt,{label:"Телефон*",...Mt(e("phone"),qt)})]})]}),en=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}];function tn(){const{data:e}=ht("/api/v1/regions",gt);return e||[]}function nn(e=!1){const[t,n]=l(e),a=i((()=>n(!0)),[]),r=i((()=>n(!1)),[]),s=i((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}const ln=e=>e?.text||e?.key||"";function an(e,t,n,l){a((()=>{if(e&&n)return e.addEventListener(t,n,l),()=>{e.removeEventListener(t,n,l)}}),[e,t,n])}function rn(e){const t=s(null),n=i((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return an(globalThis.document,"click",n),t}const sn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,on=g((({popupRef:e,options:t,value:n,query:l,onChange:a,iconVersion:i})=>t?.length?u("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md",role:"listbox",ref:e,children:sn(t,l).map((e=>p("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"option","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[u("span",{className:"min-h-6",children:ln(e)}),u(K,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:N("absolute right-4 pt-3xs",e.key===n?.key?"":"hidden")})]},e.key)))}):null));function cn({isOpen:e,options:t,value:n,query:l,onChange:r,onClose:o,iconVersion:c}){const d={open:(e,t)=>y.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>y.fire("popup",{type:"update",popup:e,...t}),close:()=>y.fire("popup",{type:"close"})},m=i((()=>{d.close(),o&&o()}),[o]),h=i((e=>{m(),r&&r(e)}),[m,r]),p=s(null),g=rn(m);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:i,left:r,width:s,height:o}=a.getBoundingClientRect();d.update(u(on,{popupRef:g,options:t,value:n,query:l,onChange:h,iconVersion:c}),{top:i+window.scrollY+o,left:r,width:s})}),[e,t,n,l,h]),p}const dn=g((({className:e,label:t,options:n=[],value:a,valid:r=!0,isBorder:s=!0,placeholder:o="",isSearch:c=!1,iconVersion:d,onChange:m})=>{const[h,{setFalse:g,setTrue:x}]=nn(),[f,b]=l(""),y=i((()=>{b(""),g()}),[]),v=cn({isOpen:h,options:n,value:a,query:f,onChange:m,onClose:y,iconVersion:d});return p("div",{className:e,children:[mn(t),p("div",{className:N("relative",h?"z-20":"z-10"),ref:v,children:[p("div",{className:N("h-14 text-l flex justify-between items-center text-primary-text cursor-pointer relative z-10",un(s,r)),onClick:h?y:x,children:[u("p",{className:"p-m pr-8 flex items-center overflow-hidden text-ellipsis",children:ln(a)||o}),hn(h,d)]}),c&&h?u("div",{className:N("absolute top-0 w-full z-20"),children:u(Vt,{type:"text",autoFocus:!0,value:f,onChange:b})}):null]})]})})),mn=e=>e?u("div",{className:"mb-xs",children:u(Ve,{size:"text-m",color:"text-primary-text",font:"font-light",children:e})}):null,hn=(e,t)=>u(K,{className:N("absolute right-3",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),un=(e,t)=>N(e?"border rounded-md hover:border-primary-hover":"",t?" border-gray":"border-error"),pn=g((({className:e="",error:t,...n})=>p("div",{className:e,children:[u(dn,{...n,valid:!t}),_t(t)]}))),gn=g((({field:e})=>{const t=tn();return u(pn,{className:"w-full",label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:t.map((({code:e="",name:t=""})=>({key:e,text:t}))),...Mt(e("region"),Yt)})})),xn=({field:e,title:t})=>p(Rt,{title:t,children:[u("div",{className:At,children:u(pn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:en,...Mt(e("acquiringType"),Yt)})}),u("div",{className:At,children:u(gn,{field:e})})]}),fn=g((({value:e=!1,text:t,type:n="checkbox",onChange:l})=>p("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>l&&l(!e),children:[u("div",{className:N("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:u("div",{className:N("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?u(Ve,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),bn=e=>p("div",{children:[u(fn,{text:"Хочу купить онлайн-кассу",...e("onlineCheckout")}),u(fn,{text:"Хочу купить POS-терминал",...e("posTerminal")})]});function yn({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const vn={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"},Nn={primary:N("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:N("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")},wn=g((({children:e,...t})=>{const n=e=>({...e,onClick:ce(yn(e),e)}),{className:l,version:a="primary",active:i,disabled:r,type:s="button",rounded:o=!0,role:c,onClick:d}=n(t);return u("button",{className:N("font-sans px-9 py-4","flex justify-center items-center gap-xs",i?"text-white bg-primary-active":"",r?"bg-main-gray text-main-disabled cursor-not-allowed":"",i||r?"":N(vn[a],Nn[a]),o?"rounded-md":"",l),type:s,role:c,onClick:d,children:e})})),kn=(e,t)=>u(wn,{className:N("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Sn={acquiringType:{key:"trade",text:"Торговый эквайринг"},fullName:"",inn:"",name:"",phone:"",onlineCheckout:!1,posTerminal:!1},Cn=St({acquiringType:Yt,region:Yt,fullName:Yt,inn:Xt,name:Gt,phone:qt}),Tn=g((e=>{const{button:t,link:n,onSubmit:l}=e,a=i((e=>{const{acquiringType:t,region:n,fullName:a,inn:i,name:r,phone:s,onlineCheckout:o,posTerminal:c}=e,d=In(t?.key),m=`Вид эквайринга=${t?.text||""}${d?`/Онлайн касса=${o}/POS-терминал=${c}`:"/Онлайн касса=false/POS-терминал=false"}`,h={typeForm:"acqr",region:n?.text||"",partnerComments:m,fullName:a,inn:i,name:r,phone:kt(s)};Ct(Cn(e))&&l(h,!1)}),[l]),[,{field:r,...s}]=wt(Sn,a),o=In(r("acquiringType").value?.key);return p("form",{className:Bt,onSubmit:s.onSubmit,children:[xn({field:r,title:"Вид эквайринга и регион"}),Zt(r,"Данные организации"),o?bn(r):null,kn(t),u(It,{link:n})]})})),In=e=>"all"===e||"trade"===e,Bn=g((({className:e,viewBox:t,fill:n="none",width:l,height:a,paths:i,...r})=>u("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:l,height:a,children:i.map((({d:e,fill:t,...n},l)=>{const a={...r,...n};return u("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},l)}))}))),Pn=[{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"}],Mn=g((({className:e,value:t,text:n,disabled:l,isRadio:a,onChange:r})=>{const s=i((e=>{l||(e.preventDefault(),r&&r(!t))}),[r,l,t]),o=a?u("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):u(Bn,{paths:Pn,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return u("div",{className:e,children:p("label",{className:"flex items-center relative cursor-pointer group/box",onClick:s,children:[u("div",{className:N("appearance-none w-5 h-5 border-solid cursor-pointer m-0",a?"rounded-full border-2":Rn(t),t?"border-primary-main":"border-gray",l?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:"checkbox","aria-checked":Boolean(t),"aria-disabled":Boolean(l)}),t?o:null,n?u("div",{className:"ml-s",children:u(Ve,{size:"text-l",font:"font-light",children:n})}):null]})})})),Rn=e=>N("rounded border",e?"bg-primary-main":""),An=g((({className:e,text:t,value:n,key:l,disabled:a,error:i,onChange:r})=>p("div",{className:N("shrink-0 w-full",e),children:[u(Mn,{text:t,value:n,disabled:a,onChange:r},l),_t(i)]}))),Vn=(e,t,n)=>p("div",{className:"flex gap-m flex-col lg:flex-row w-full justify-between items-baseline",children:[p("div",{children:[p("div",{className:"flex gap-3",children:[u(Mn,{...e}),u(It,{text:"Согласен с ",link:t})]}),_t(Mt(e,Qt).error)]}),kn(n)]}),zn=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),l=String(e.getMonth()+1).padStart(2,"0"),a=t?String(e.getFullYear()):String(e.getFullYear()).slice(-2);return t?`${a}-${l}-${n}`:`${n}.${l}.${a}`}},Dn=()=>{},_n=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:l,currentYear:a,min:i,max:r,onDateClick:s})=>{const o=[];let c=1;for(let d=0;d<6;d++){const m=[];for(let o=0;o<7;o++)if(0===d&&o<t)m.push(u("td",{},`empty-${o}`));else if(c>n)m.push(u("td",{},`empty-${o}`));else{const t=new Date(a,l,c),n=Fn(t,e),o=En(t,i,r);m.push(u("td",{children:u("div",{className:jn(n,o),onClick:()=>!o&&s(t),children:c})},`day-${c}`)),c++}o.push(u("tr",{children:m},`row-${d}`))}return o},Fn=(e,t)=>t&&e.toDateString()===t.toDateString(),En=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),jn=(e,t)=>N("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),On=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ln=g((({today:e,currentMonth:t,currentYear:n,min:l,max:a,onDateSelect:s=Dn})=>{const o=i((e=>s(e)),[]),{firstDayOfWeek:c,totalDays:d}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return p("table",{className:"mx-auto",children:[u("thead",{className:"text-gray font-light",children:u("tr",{children:On.map(((e,t)=>u("th",{className:"p-s",children:e},String(t))))})}),u("tbody",{children:_n({firstDayOfWeek:c,today:e,totalDays:d,currentYear:n,currentMonth:t,min:l,max:a,onDateClick:o})})]})})),$n=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],Un=$n.map((e=>({key:e}))),Hn=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),Wn={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Kn={className:"min-w-32",iconVersion:"black",isBorder:!1},Yn=g((({className:e="",label:t="",value:n,valid:a=!0,minDate:r,maxDate:s,onChange:o})=>{const[c,{setValue:d}]=nn(!1),[m,h]=l(n?.getMonth()||(new Date).getMonth()),[g,x]=l(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:f,handleNextMonth:b,handleSelectMonth:y,handleSelectYear:v,monthsOptions:w,yearsOptions:k,handleChangeVisibleCalendar:S,ref:C}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:l,onYearSelect:a,selectedYear:r})=>{const s=rn(i((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:i((()=>e(!t)),[t]),handleNextMonth:i((()=>{n+1<=11?l(n+1):(l(0),a(r+1))}),[n]),handlePrevMonth:i((()=>{n-1>=0?l(n-1):(l(11),a(r-1))}),[n]),handleSelectMonth:i((({key:e})=>l($n.indexOf(e))),[]),handleSelectYear:i((({key:e})=>a(Number(e))),[]),monthsOptions:Un,yearsOptions:Hn,ref:s}})({onYearSelect:x,onMonthSelect:h,onShowCalendar:d,selectedYear:g,selectedMonth:m,showCalendar:c});return p("div",{className:N(e,"relative"),ref:C,children:[u(Ve,{size:"text-m","font-weight":"font-light",children:t}),Gn(S,n,a),c?p("div",{className:"absolute bg-white z-20 select-none",children:[p("div",{className:"flex gap-s",children:[u("div",{className:"my-auto",onClick:f,children:u(K,{...Wn,className:"-rotate-90 cursor-pointer"})}),u(dn,{onChange:y,value:{key:$n[m]},options:w,...Kn}),u(dn,{onChange:v,value:{key:String(g)},options:k,...Kn}),u("div",{className:"my-auto",onClick:b,children:u(K,{...Wn,className:"rotate-90 cursor-pointer"})})]}),u(Ln,{today:n,currentMonth:m,currentYear:g,onDateSelect:o,min:r,max:s})]}):null]})})),Gn=(e,t,n)=>p("div",{onClick:e,className:N("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",n?"border-gray":"border-error"),children:[u(I,{children:t&&zn(t)}),u(K,{...Wn,name:"CalendarIcon"})]}),Xn=g((({className:e,label:t,value:n,error:l,onChange:a})=>p("div",{className:N("shrink-0 w-full",e),children:[t?u("div",{className:"mb-xs",children:u(Ve,{size:"text-m",font:"font-light",children:t})}):null,u(Yn,{value:n,onChange:a,valid:Boolean(!l)}),_t(l)]}))),qn={surname:"",name:"",middleName:""},Jn=(e,t=!0)=>p("div",{className:"space-y-s",children:[u(Ft,{label:"Фамилия*",...Mt(e("surname"),Gt)}),u(Ft,{label:"Имя*",...Mt(e("name"),Gt)}),u(Ft,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),t?u(Xn,{label:"Дата рождения*",...Mt(e("birthday"),Yt)}):null]}),Qn={...qn,typeForm:{key:"ANTIFRAUD",text:"Предупреждение о мошенничестве"},phone:"",birthday:void 0,isClient:!1,comment:"",consentDataProcessing:!1},Zn=St({typeForm:Yt,surname:Yt,name:Gt,birthday:Yt,phone:qt,isClient:Qt,comment:Yt,consentDataProcessing:Qt}),el=g((({button:e,link:t,onSubmit:n})=>{const l=i((e=>{const{typeForm:t,phone:l,...a}=e,i={...a,typeForm:t.key,phone:kt(l)};Ct(Zn(e))&&n(i,!0)}),[n]),[,{field:a,...r}]=wt(Qn,l);return u("form",{className:Bt,onSubmit:r.onSubmit,children:u(Rt,{children:p("div",{className:Pt,children:[Jn(a,!0),u(Wt,{label:"Телефон*",...Mt(a("phone"),qt)}),u(An,{...Mt(a("isClient"),Qt),text:'Являюсь клиентом банка АО "Россельхозбанк"'}),u(Ft,{...Mt(a("comment"),Yt),placeholder:"Комментарий*",isTextarea:!0}),Vn(a("consentDataProcessing"),t,e)]})})})})),tl=e=>p(Rt,{children:[p("div",{className:At,children:[u(Ft,{label:"Контактное лицо",...Mt(e("name"),Gt)}),u(Ft,{label:"ИНН",...Mt(e("inn"),Xt)})]}),p("div",{className:At,children:[u(Wt,{label:"Телефон",...Mt(e("phone"),qt)}),u(Ft,{label:"Электронная почта",...Mt(e("mail"),Yt)})]})]}),nl={name:"",phone:"",inn:"",mail:""},ll=St({region:Yt,name:Gt,phone:qt,inn:Xt,mail:Yt}),al=g((e=>{const{button:t,link:n,onSubmit:l}=e,a=i((e=>{const{region:t,name:n,phone:a,inn:i,mail:r}=e;Ct(ll(e))&&l({typeForm:"bcrd",region:t?.text||"",name:n,inn:i,mail:r,phone:kt(a)})}),[l]),[,{field:r,...s}]=wt(nl,a);return p("form",{className:Bt,onSubmit:s.onSubmit,children:[u(gn,{field:r}),tl(r),kn(t),u(It,{link:n})]})})),il={...qn,typeForm:{key:"CORRUPTION",text:"Факты коррупции"},phone:"",email:"",comment:"",consentDataProcessing:!1},rl=St({typeForm:Yt,surname:Yt,name:Gt,region:Yt,phone:qt,email:Yt,comment:Yt,consentDataProcessing:Qt}),sl=g((({button:e,link:t,onSubmit:n})=>{const l=i((e=>{const{typeForm:t,phone:l,region:a,...i}=e,r={...i,typeForm:t.key,regionBranch:a?.text,phone:kt(l)};Ct(rl(e))&&n(r,!0)}),[n]),[,{field:a,...r}]=wt(il,l);return u("form",{className:Bt,onSubmit:r.onSubmit,children:u(Rt,{children:p("div",{className:Pt,children:[Jn(a,!1),u(gn,{field:a}),u(Wt,{label:"Телефон*",...Mt(a("phone"),qt)}),u(Ft,{label:"Электронная почта*",...Mt(a("email"),Yt)}),u(Ft,{...Mt(a("comment"),Yt),placeholder:"Ваше сообщение*",isTextarea:!0}),Vn(a("consentDataProcessing"),t,e)]})})})})),ol=[];function cl(e){const{data:t}=ht(e?`/api/v1/branches?regionCode=${e}`:null,dl);return t||ol}const dl=async e=>await pt(e,{method:"GET"})||ol,ml=["От 1 000 ₽","До 1 000 000 000 ₽"],hl=["От 1 мес","До 15 лет"],ul=(e,t)=>p(Rt,{title:t,children:[p("div",{className:At,children:[u(Ft,{label:"Наименование организации",...Mt(e("fullName"),Yt)}),u(Ft,{label:"ИНН",...Mt(e("inn"),Xt)}),u(Wt,{label:"Телефон",...Mt(e("phone"),qt)})]}),p("div",{className:At,children:[u(Ft,{label:"Годовая выручка, ₽",...Mt(e("annualRevenue"),Yt)}),u(Ft,{label:"Контактное лицо",...Mt(e("name"),Gt)}),u(Ft,{label:"Электронная почта",...Mt(e("mail"),Yt)})]})]}),pl=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=l(!1),m=i((e=>{d(!0),r&&r(e)}),[]),h=i((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:h}},gl=(e,t,n)=>Math.max(t,Math.min(e,n));function xl(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function fl({list:e=[],min:t,max:n,step:l,value:a=e[0]||t,disabled:i,onChange:r}){const s=e.length?e.indexOf(a):a,o={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return p("div",{children:[e.length?u("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>u("div",{className:N("w-2 h-2 rounded-full",s<=t||i?"bg-gray":"bg-primary-main")},String(t))))}):null,u("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:u("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:o,type:"range",min:t,max:n,step:l,value:s,disabled:i,onInput:t=>{const n=xl(t.target?.value),l=e.length?e[n]:n;r&&r(l||0)}})})]})}const bl=1,yl=100,vl=g((e=>{const{className:t,title:n,items:l=[],list:a=[],min:r=(a.length?0:bl),max:s=(a.length?a.length-1:yl),step:o=1,value:c=a[0]||r,disabled:d=!1,onChange:m}=e,h=pl(e,{normalize:(e=0)=>a.length?Nl(a)(e):gl(e,r,s),format:Qe()}),g=i((e=>{m&&m(xl(e.target?.value))}),[m]);return p("div",{className:t,children:[p("label",{className:"block relative",children:[n?u(Ve,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,u("input",{className:N("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:d,onInput:g,...h}),fl({list:a,min:r,max:s,step:o,disabled:d,value:c,onChange:m})]}),wl(l)]})})),Nl=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),wl=e=>u("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>u(Ve,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),kl=(e,t)=>p(Rt,{title:t,children:[u("div",{className:At,children:u(vl,{title:"Сумма, ₽",items:ml,min:1e3,max:1e9,...e("amount")})}),u("div",{className:At,children:u(vl,{title:"Срок, месяцев",items:hl,min:1,max:180,...e("term")})})]}),Sl={amount:1e3,term:12,fullName:"",inn:"",name:"",phone:"",mail:"",annualRevenue:""},Cl=St({fullName:Yt,annualRevenue:Yt,inn:Xt,name:Gt,phone:qt,region:Yt,department:Yt}),Tl=g((({button:e,link:t,onSubmit:n})=>{const l=i((e=>{const{amount:t,term:l,fullName:a,inn:i,name:r,phone:s,mail:o,region:c,department:d,annualRevenue:m}=e;Ct(Cl(e))&&n({typeForm:"cred",fullName:a,inn:i,name:r,phone:kt(s),mail:o,region:c?.text||"",department:d?.text||"",partnerComments:`Сумма=${t}/Срок=${l}/Выручка=${m}`})}),[n]),[a,{field:r,...s}]=wt(Sl,l),o=cl(a.region?.key).filter((e=>e?.address));return p("form",{className:Bt,onSubmit:s.onSubmit,children:[kl(r,"Параметры"),ul(r,"Данные организации"),p(Rt,{title:"Офис банка",children:[u("div",{className:At,children:u(gn,{field:r})}),u("div",{className:At,children:u(pn,{label:"Адрес",placeholder:"Выберите адрес",options:o.map((({branchCode:e="",address:t=""})=>({key:e,text:t}))),...Mt(r("department"),Yt)})})]}),kn(e),u(It,{link:t})]})})),Il={name:"",phone:""},Bl=St({name:Gt,phone:qt}),Pl=g((({button:e,link:t,onSubmit:n})=>{const l=i((e=>{const{name:t,phone:l}=e;Ct(Bl(e))&&n({typeForm:"dpst",name:t,phone:kt(l)})}),[n]),[,{field:a,...r}]=wt(Il,l);return u("form",{className:Bt,onSubmit:r.onSubmit,children:u(Rt,{title:"Оставьте заявку и мы ответим на любые вопросы по депозитам",children:p("div",{className:Pt,children:[u(Ft,{label:"Имя",...Mt(a("name"),Gt)}),u(Wt,{label:"Телефон",...Mt(a("phone"),qt)}),kn(e),u(It,{link:t})]})})})})),Ml=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],Rl=[{key:"phone",text:"Телефонный звонок"},{key:"mail",text:"Электронное сообщение"}],Al=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Vl={typeForm:Yt,region:Yt,surname:Yt,name:Gt,feedbackMethod:Yt,phone:qt,email:Yt,comment:Yt,consentDataProcessing:Qt},zl={...qn,typeForm:{key:"FEEDBACK",text:"Задать вопрос по продуктам и услугам"},serviceDirection:{key:"Физическое лицо"},birthday:void 0,feedbackMethod:{key:"Телефонный звонок"},phone:"",email:"",comment:"",consentDataProcessing:!1},Dl=g((({button:e,link:t,onSubmit:n})=>{const l=i((e=>{_l(e.typeForm.key,e.serviceDirection?.key)?((e,t)=>{const n=St({...Vl,addressBranch:Yt,inn:Xt}),l={typeForm:e.typeForm.key,region:e.region?.text,addressBranch:e.addressBranch?.text||"",surname:e.surname,name:e.name,middleName:e.middleName,inn:e.inn,fullName:e.fullName,feedbackMethod:e.feedbackMethod.text,phone:kt(e.phone),secondaryPhoneNumber:e?.secondaryPhone,mail:e.email,bankEmpolee:e.bankEmpolee,applicationDate:e.applicationDate,comment:e.comment,consentDataProcessing:e.consentDataProcessing};Ct(n(e))&&t(l,!1)})(e,n):"FEEDBACK"===e.typeForm.key?((e,t)=>{const n=St({...Vl,birthday:Yt}),l={typeForm:e.typeForm.key,regionBranch:e.region?.text,surname:e.surname,name:e.name,middleName:e.middleName,birthday:e.birthday,feedbackMethod:e.feedbackMethod.text,phoneNumber:kt(e.phone),email:e.email,comment:e.comment,consentDataProcessing:e.consentDataProcessing};Ct(n(e))&&t(l,!0)})(e,n):((e,t)=>{const n=St({...Vl,addressBranch:Yt}),l={typeForm:e.typeForm.key,regionBranch:e?.region?.text,addressBranch:e.addressBranch?.text||"",surname:e.surname,name:e.name,middleName:e.middleName,feedbackMethod:e.feedbackMethod.text,phoneNumber:kt(e.phone),secondaryPhoneNumber:e.secondaryPhone?.replace(/[^+\d]/g,""),email:e.email,bankEmpolee:e.bankEmpolee,applicationDate:e.applicationDate,comment:e.comment,consentDataProcessing:e.consentDataProcessing};Ct(n(e))&&t(l,!0)})(e,n)}),[n]),[a,{field:r,...s}]=wt(zl,l),o="FEEDBACK_QS"===r("typeForm").value?.key,c=_l(r("typeForm").value?.key,r("serviceDirection").value?.key),d=cl(a?.region?.key).filter((e=>e?.address));return u("form",{className:Bt,onSubmit:s.onSubmit,children:u(Rt,{children:p("div",{className:Pt,children:[u(pn,{label:"Тема*",placeholder:"Выберите тему",options:Ml,...Mt(r("typeForm"),Yt)}),o?u(pn,{label:"Направление обслуживания*",placeholder:"Выберите направление",options:Al,...Mt(r("serviceDirection"),Yt)}):null,u(gn,{field:r}),o?u(pn,{label:"Адрес*",placeholder:"Выберите адрес",options:d.map((({branchCode:e="",address:t=""})=>({key:e,text:t}))),...Mt(r("addressBranch"),Yt)}):null,Jn(r,!0),c?p("div",{children:[u(Ft,{label:"ИНН*",...Mt(r("inn"),Xt)}),u(Ft,{label:"Наименование организации",...r("fullName")})]}):null,u(pn,{label:"Способ получения ответа*",options:Rl,...Mt(r("feedbackMethod"),Yt)}),u(Wt,{label:"Телефон*",...Mt(r("phone"),qt)}),o?p("div",{children:[u(Wt,{label:"Дополнительный телефон",...r("secondaryPhone")}),u(Ft,{label:"Электронная почта*",...Mt(r("email"),Yt)}),u(Ft,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...r("bankEmpolee")}),u(Ft,{label:"Дата и время обращения в Банк",...r("applicationDate")})]}):u(Ft,{label:"Электронная почта*",...Mt(r("email"),Yt)}),u(Ft,{...Mt(r("comment"),Yt),placeholder:"Ваше сообщение*",isTextarea:!0}),Vn(r("consentDataProcessing"),t,e)]})})})})),_l=(e="",t="")=>"FEEDBACK_QS"===e&&"Юридическое лицо / ИП"===t,Fl=g((e=>{const{button:t,sourceBookDir:n}=e,{regions:a}=bt(n||"regions-grant-support"),[i,r]=l({key:""}),s=se({className:"text-white",version:t?.version}),o=a?.find((e=>e.name===i.key))?.href;return p("div",{className:"container space-y-s",children:[a?u(pn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:a.map((({name:e=""})=>({key:e,text:e}))),value:i,onChange:r}):null,o?u("div",{className:"text-center",children:u(ge,{href:o,target:"_blank",className:N("p-m w-full @xl:w-auto",s),children:t?.text?t.text:"Перейти"})}):null]})})),El={...qn,phone:"",email:"",birthday:void 0,consentDataProcessing:!1},jl=St({surname:Gt,name:Gt,phone:qt,email:Yt,birthday:Yt}),Ol=g((e=>{const{button:t,link:n,product:l,onSubmit:a}=e,r=i((e=>{const{surname:t,name:n,middleName:i,phone:r,email:s,birthday:o,consentDataProcessing:c}=e;Ct(jl(e))&&a({typeForm:"dpst",surname:t,name:n,middleName:i,email:s,consentDataProcessing:c,phoneNumber:kt(r),birthday:o?.toISOString().slice(0,10)||"",product:l||""},!0)}),[a]),[,{field:s,...o}]=wt(El,r);return p("form",{className:Bt,onSubmit:o.onSubmit,children:[p(Rt,{children:[p("div",{className:At,children:[u(Ft,{label:"Фамилия",...Mt(s("surname"),Gt)}),u(Ft,{label:"Отчество (Обязательно, при наличии)",...s("middleName")}),u(Wt,{label:"Телефон",...Mt(s("phone"),qt)})]}),p("div",{className:At,children:[u(Ft,{label:"Имя",...Mt(s("name"),Gt)}),u(Xn,{label:"Дата рождения*",...Mt(s("birthday"),Yt)}),u(Ft,{label:"Электронная почта",...Mt(s("email"),Yt)})]})]}),Vn(s("consentDataProcessing"),n,t)]})})),Ll={...qn,typeForm:{key:"SELFCOLLECTION",text:"Самоинкассация"},fullName:"",phone:""},$l=St({typeForm:Yt,region:Yt,fullName:Yt,phone:qt}),Ul=g((({button:e,link:t,onSubmit:n})=>{const l=i((e=>{const{typeForm:t,region:l,fullName:a,phone:i}=e,r={typeForm:t.key,region:l?.text,name:a,phone:kt(i)};Ct($l(e))&&n(r,!0)}),[n]),[,{field:a,...r}]=wt(Ll,l);return u("form",{className:Bt,onSubmit:r.onSubmit,children:u(Rt,{children:p("div",{className:Pt,children:[u(Ft,{label:"ФИО*",...Mt(a("fullName"),Yt)}),u(gn,{field:a}),u(Wt,{label:"Телефон*",...Mt(a("phone"),qt)}),kn(e),u(It,{link:t})]})})})}));const Hl=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Wl={typeForm:Hl[0],...qn,email:"",phone:"",comment:"",consentDataProcessing:!1},Kl=St({typeForm:Yt,surname:Yt,name:Gt,phone:qt,email:Yt,addressBranch:Yt,consentDataProcessing:Qt}),Yl=g((({button:e,link:t,onSubmit:n,defaultType:l="PREMIUMSERVICE"})=>{const a=i((e=>{const{surname:t,name:l,middleName:a,email:i,comment:r,consentDataProcessing:s}=e,o={typeForm:e.typeForm.key,surname:t,name:l,middleName:a,phoneNumber:kt(e.phone),email:i,addressBranch:e.addressBranch?.key,comment:r,consentDataProcessing:s};console.log(o),Ct(Kl(e))&&n(o,!0)}),[n]),[r,{field:s,...o}]=wt({...Wl,typeForm:Gl(l)},a),c=function(){const{data:e}=ht("/api/v1/premiumBranchesByRegions",gt);return e||[]}(),d=c.map((({region:e})=>({key:e,text:e}))),m=r?.region?.key,h=c.find((e=>e?.region===m))?.branches;return p("form",{className:Bt,onSubmit:o.onSubmit,children:[p(Rt,{title:"Ваши данные",children:[p("div",{className:At,children:[u(Ft,{label:"Фамилия*",...Mt(s("surname"),Gt)}),u(Ft,{label:"Отчество (Обязательно, при наличии)",...s("middleName")}),u(Ft,{label:"Электронная почта*",...Mt(s("email"),Yt)})]}),p("div",{className:At,children:[u(Ft,{label:"Имя*",...Mt(s("name"),Gt)}),u(Wt,{label:"Телефон*",...Mt(s("phone"),qt)}),u(pn,{label:"Тип обслуживания*",options:Hl,...Mt(s("typeForm"),Yt)})]})]}),p(Rt,{title:"Офис банка",children:[u("div",{className:At,children:u(pn,{label:"Регион*",placeholder:"Выберите регион",options:d,...Mt(s("region"),Yt)})}),u("div",{className:At,children:u(pn,{className:"w-full",label:"Адрес*",placeholder:"Выберите отделение",options:(h||[]).map((({address:e=""})=>({key:e,text:e}))),...Mt(s("addressBranch"),Yt)})})]}),u(Ft,{...s("comment"),placeholder:"Комментарий, удобное время и прочее",isTextarea:!0}),Vn(s("consentDataProcessing"),t,e)]})})),Gl=e=>Hl.find((t=>t.key===e)),Xl=g((({name:e,text:t,value:n,checked:l,onChange:a,className:i})=>u("div",{className:i,children:p("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[u("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:n,name:e,checked:l,onChange:e=>a(e.target.value)}),t?u(Ve,{color:"text-primary-text",children:t}):null]})}))),ql=e=>{const{value:t,onChange:n}=e("vedTypes");return u(Rt,{children:p("div",{className:"gap-xl grid @xl:flex @xl:items-center",children:[u(Xl,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:e=>n&&n(e)}),u(Xl,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:e=>n&&n(e)}),u(Xl,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:e=>n&&n(e)}),u(Xl,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:e=>n&&n(e)})]})})},Jl=({textField:e,text:t,placeholder:n="",error:l})=>p("div",{children:[p("label",{className:"space-y-xs",htmlFor:"textarea",children:[t?u("div",{children:u(Ve,{size:"text-m",font:"font-light",children:t})}):null,u("textarea",{id:"textarea",placeholder:n,className:N("block w-full resize-y min-h-24 p-m outline-none border rounded-md border-gray","hover:border-primary-hover active:focus:border-primary-text focus:border-primary-text"),value:e.value,onInput:t=>e.onChange&&e.onChange(t.target?.value||"")})]}),_t(l)]}),Ql=({field:e,regions:t})=>{const n="currencyControl"===e("vedTypes").value;return p("div",{className:"space-y-s",children:[n?u(pn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:t.map((({code:e="",name:t=""})=>({key:e,text:t}))),...Mt(e("region"),Yt)}):null,p("div",{className:"grid @xl:grid-cols-2 @xl:gap-x-lg gap-s",children:[n?u(Ft,{label:"ИНН",...Mt(e("inn"),Xt)}):null,u(Ft,{label:"Наименование организации",...Mt(e("fullName"),Yt)}),u(Ft,{label:"ФИО",...Mt(e("name"),Gt)}),u(Wt,{label:"Телефон",...Mt(e("phone"),qt)}),n?null:u(Ft,{label:"Электронная почта",...Mt(e("mail"),Yt)})]})]})},Zl={fullName:"",name:"",phone:"",inn:"",vedTypes:"currencyControl",text:""},ea={fullName:Yt,name:Gt,phone:qt},ta=St({...ea,mail:Yt}),na=St({...ea,inn:Xt,region:Yt}),la=e=>"currencyControl"===e,aa=e=>({currencyControl:"currencyControl"===e,documentOperations:"documentOperations"===e,conversionTransactions:"conversionTransactions"===e,otherIssues:"otherIssues"===e}),ia={ApplicationFormBusinessCard:al,ApplicationFormWed:g((e=>{const{button:t,link:n,onSubmit:l}=e,a=i((e=>{const{fullName:t,name:n,phone:a,mail:i,inn:r,region:s,vedTypes:o,text:c}=e,d={typeForm:"KVED",fullName:t,name:n,phone:kt(a),text:c,vedTypes:aa(o),PartnerComments:c,...la(o)?{inn:r,region:s?.text||""}:{mail:i}};Ct((e=>la(e)?na:ta)(o)(e))&&l(d)}),[l]),[,{field:r,...s}]=wt(Zl,a),o=tn(),c=r("text");return p("form",{className:"container space-y-lg",onSubmit:s.onSubmit,children:[ql(r),u(T,{headingType:"h6",title:"Данные организации",className:"@xl:text-center"}),Ql({field:r,regions:o}),Jl({textField:c,text:"Обращение",placeholder:"Укажите интересующий вас вопрос, место ведения бизнеса и удобное время для телефонного звонка"}),kn(t),u(It,{link:n}),u(T,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),p("div",{className:"flex gap-xl",children:[p("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:[u(te,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),u("span",{children:"8 (800) 200-78-70"})]}),p("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[u(te,{image:{icon:"MailIcon"},width:"24",height:"24"}),u("span",{children:"ved@rshb.ru"})]})]})]})})),ApplicationFormDeposit:Pl,ApplicationFormCredit:Tl,ApplicationFormAcquiring:Tn,ApplicationFormGrantSupport:Fl,ApplicationFormIndividuals:Ol,ApplicationFormFeedback:Dl,ApplicationFormAntiFraud:el,ApplicationFormCorruption:sl,ApplicationFormSelfCollection:Ul,ApplicationFormUltraPremium:Yl},ra=g((({responseType:e})=>{const t="OK"===e;return p("div",{className:`flex items-center p-lg rounded-md space-x-m ${t?"bg-ok":"bg-fail"}`,children:[u(te,{image:{icon:(t?"ResponseOKIcon":"ResponseFailIcon")?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"42",height:"42"}),p("div",{children:[u(T,{headingType:"h6",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",className:"mb-2xs"}),u(Ve,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее"})]})]})})),sa={send:async function(e,t=!1){const n=t?"/api/v1/lead":"/api/v1/sendcorporatelead";try{const t=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(e)});return t?.ok?await t.json():null}catch(e){return null}}},oa=g((e=>{const{className:t,formBlock:n,...a}=e,[r,s]=l(""),o=i((async(e,t=!1)=>{const n=await sa.send(e,t)?"OK":"Fail";return s(n),n}),[]);return u(k,{className:t,defaultPadding:"p-6xl",...a,children:p("div",{className:"container max-w-[978px] space-y-lg",children:[n?.title?u(T,{headingType:"h3",title:n.title,className:"@xl:text-center"}):null,n?ca(n,o):null,r?u(ra,{responseType:r}):null]})})})),ca=(e,t)=>{const n=e?.formType;if(!n||!(n in ia))return null;return u(ia[n],{...e,onSubmit:t})},da="text-left",ma={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},ha=g((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:l,icon:a,...i})=>{const r=String(l?.width||t);return a?u("div",{style:{width:`${r}px`,height:`${r}px`},className:N("rounded-icon object-fit flex justify-center items-center",ma[n],e),children:u(K,{...i,width:"54%",height:"54%",name:a})}):null})),ua=g((({className:e="",title:t,benefitList:n,...l})=>p(k,{className:e,defaultPadding:"p-6xl",...l,children:[t?u(T,{headingType:"h3",as:"h2",className:da,title:t}):null,n?.length?u("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(pa)}):null]}))),pa=({label:e,description:t,items:n,icon:l,iconBgVersion:a,isDotted:i=!1},r)=>p("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[l?.icon?u(ha,{className:"shrink-0",defaultIconSize:56,iconBgVersion:a||"",...l}):null,l?.src?u(te,{className:"shrink-0",image:l}):null,e?p("div",{className:"@sm:h-full space-y-xs",children:[u(T,{headingType:"h6",children:e}),u(Ve,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),u(Je,{dotClassName:"bg-secondary-text",listItemSize:"S",items:n,isDotted:i})]}):null]},String(r)),ga=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function xa(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const fa=g((({className:e,style:t,idx:n,activeIndex:l,observerOptions:o,children:c,onIntersection:d})=>{const m=function(e,{sensitivity:t,rootRef:n}={}){const l=s(null),i=r((()=>({threshold:xa(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!l.current)return;const t=new IntersectionObserver(e,i);return t.observe(l.current),()=>{t.disconnect()}}),[e,i]),l}(i((e=>{e.length&&d&&d(n||0,e[e.length-1])}),[d,n]),o);return u("div",{className:N("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===l),ref:m,children:c})})),ba=["min-w-full","@lg:min-w-[50%]","@lg:min-w-[33.3%]","@lg:min-w-[25%]"],ya=g((({className:e,itemClassName:t,containerRef:n,activeIndex:l,visibleItemCount:a=0,gap:r=0,padding:o=0,listType:c="horizontal-list",snapAlign:d="snap-center",minHeight:m,children:h,onVisibleItemsChange:p,onVisibleIndicesChange:g})=>{const x={sensitivity:1,rootRef:n},f=s([]),b=i(((e,t)=>{const n=[...f.current||[]];n[e]=t,f.current=n,p&&p(n),g&&g(Na(n))}),[p,g]),y=a>0?r*Number(a)-1:0,v="vertical-list"===c,w="horizontal-list"===c,k={...w?va(o,y):{},...v?ga(m):{},gap:`${r}px`};return u("div",{className:N("box-border overflow-auto no-scrollbar",c,e),style:k,ref:n,children:(S=(e,n)=>u(fa,{className:N(d,a?ba[a-1]:"",v?"h-full":"",t),style:w?va(o/4):{},activeIndex:l,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(h)});var S})),va=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Na=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),wa={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},ka={"horizontal-list":"w-6","vertical-list":"h-6"},Sa=g((({className:e="",containerRef:t,activeIndex:n,dotCount:l=0,listType:a="horizontal-list",version:i})=>l?u("div",{className:N("flex gap-xs",wa[a],i?"group":"",e),"data-ver":i,children:Array.from({length:l}).fill(null).map(((e,l)=>u("div",{className:`cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white ${l===n?ka[a]:"w-2 h-2 opacity-30"}`,role:"button","aria-hidden":!0,onClick:()=>(e=>{e!==n&&t?.current&&t.current.children[e]?.scrollIntoView({behavior:"smooth",block:"nearest"})})(l)},String(l))))}):null)),Ca=e=>e,Ta=(e=Ca)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Ia=Ta(),Ba=(e=Ca)=>Ta((t=>-e(t))),Pa=Ba(),Ma=e=>t=>e.scrollWidth/t,Ra=e=>(t,n)=>{e.scrollBy({left:n*Ma(e)(t),behavior:"smooth"})},Aa=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=l([]),o=i((e=>{r((t=>{return(n=t)===(l=e)||Boolean(n&&l&&n?.length===l?.length&&n.every(((e,t)=>e===l[t])))?t:e;var n,l})),t&&t(e)}),[e]),[c,d]=a.length?[Ba()(a),Ta()(a)]:[-1,-1],m=c>0,h=d<e-1,u=i((()=>{var t;n.current&&(m?Ra(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{n.current&&(h?Ra(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,h]),g=i(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:u,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:h,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Va=g((({className:e,version:t,gap:n=14,padding:l=16,showDots:a=true,minHeight:i,children:r,onVisibleIndicesChange:s,listType:o="horizontal-list"})=>{const c=Array.isArray(r)?r.length:0,[d,m]=Aa({itemCount:c,onVisibleIndicesChange:s}),[h]=m.visibleIndicesRange;return p("div",{className:N(e,"vertical-list"===o?"relative h-full":""),children:[u(ya,{containerRef:d,activeIndex:h,visibleItemCount:1,gap:n,padding:l,onVisibleIndicesChange:m.handleVisibleIndicesChange,listType:o,minHeight:i,children:r}),a?u(Sa,{containerRef:d,activeIndex:h,dotCount:c,listType:o,version:t}):null]})})),za=(e,t,n)=>{return u(Va,{children:e.map((l=n,({icon:e,title:t,description:n},a)=>p("div",{className:N("flex flex-col gap-1","justify-between p-m h-full border border-gray",n||t?"":"justify-center"),children:[t?u(Ve,{size:"text-h6",font:"font-normal",align:l,children:t}):null,e?u(te,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?u(Ve,{size:"text-h6",font:"font-normal",align:l,children:n}):null]},String(a))))});var l},Da=g((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:l="4",subtitle:a,title:i,...r})=>p(k,{className:N("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[u(P,{defaultPadding:"",title:i,description:a,headlineVersion:"M"}),e?.length?za(e,0,t):null]}))),_a={start:"justify-start",center:"justify-center",end:"justify-end"},Fa=g((({buttons:e,className:t="",align:n,...l})=>{const a=n?N("flex",_a[n]):"";return u(k,{className:N("!bg-transparent",a,t),defaultPadding:"p-0",...l,children:We(e)})})),Ea=g((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=l(n),c=i((()=>{o((e=>!e))}),[]),d=a({isUnfolded:s,onToggle:c}),m=r?r({isUnfolded:s,onToggle:c}):null;return p("div",t?{className:e,children:[m,d]}:{className:e,children:[d,m]})}));const ja=g((({className:e="",isUnfolded:t,children:n})=>{const l=s(null),i=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const l=new ResizeObserver((n=>{e(t,n[0])}));return l.observe(t),()=>{l.disconnect()}}),[e,...t]),n}((e=>{l.current&&(l.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return u("div",{ref:l,className:`transition-max-h duration-300 overflow-hidden ${l.current||!t?"max-h-0":""} `,children:u("div",{className:e,ref:i,children:n})})})),Oa=g((({className:e,title:t,value:n,fractionDigits:l,fixed:a,prefix:i,postfix:r})=>p("div",{className:N("flex justify-between @xl:flex-col",e),children:[t?u(Ve,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}):null,u("div",n?{children:u(Ve,{size:"text-h3",children:[i,Qe(l,{fixed:a})(n),r].filter(Boolean).join(" ")})}:{children:u(Ve,{size:"text-h3",children:"-"})})]}))),La=1e4,$a=5e6,Ua=Math.round(29.5),Ha={minSum:La,maxSum:$a,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Wa={minSum:La,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},Ya={minSum:5e4,maxSum:5e6,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0},Ga={minSum:1e3,maxSum:5e5,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Xa=e=>e?u(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e}):null,qa=g((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:l=2,depositeName:a,isShowDepositeName:i})=>p("div",{children:[u(Ve,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}),p("div",{className:"relative",children:[p("div",{className:"flex justify-start gradient-color-text",children:[u("span",{className:"font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]",children:Qe(l,{fixed:!0})(e)}),n?u("span",{className:"text-7xl",children:n}):null]}),a&&i?u("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Ja=g((({title:e="Ставка",isUnavailableByTerm:t=!1})=>p("div",{className:"space-y-s",children:[u(Ve,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),u(K,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),u("div",{className:"w-64",children:t?p(I,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",u("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):u(I,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),Qa=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:l=2,isUnknownRateShown:a=!0,...i})=>a&&0===t?u(Ja,{title:e,...i}):p("div",{children:[u("div",{className:"hidden @xl:block",children:u(qa,{title:e,rate:t,unit:n,fractionDigits:l,...i})}),u("div",{className:"@xl:hidden",children:u(Oa,{title:e,value:t,postfix:n,fractionDigits:l,fixed:!0,...i})})]});function Za({isShowItems:e=!0,step:t=1e3,...n}){const l=[`От ${Qe(2)(n.min||0)} ₽`,`До ${Qe(2)(n.max||0)} ₽`];return u(vl,{items:e?l:[],step:t,...n})}function ei(e){const{data:t}=ht(`/wcms-resources/${e}.json`,gt);return t}const ti=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:l}=e,a=ei(t||"bonus-calculator-data")||Ka,[i,r]=((e,t,n)=>{const{minSumTravel:l,minSumOther:a,maxBonus:i,prefMonthsNum:r,prefTravelBonusRate:s,prefRestBonusRate:o,travelBonusRate:c,restBonusRate:d}=e;if(t===l&&n===a)return[0,0];const m=Math.min(Math.round(s*t)+Math.round(o*n),i);return[m,m*r+Math.min(Math.round(c*t)+Math.round(d*n),i)*(12-r)]})(a,n,l);return{...a,...e,monthBonus:i,yearBonus:r}},ni=g((({className:e="",sourceBookDir:t,buttons:n,footnote:l})=>{const[a,{field:i}]=wt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:r,maxSumTravel:s,minSumOther:o,maxSumOther:c,monthBonus:d,yearBonus:m}=ti(a,t);return p("section",{className:N("flex flex-col justify-between @5xl:flex-row gap-y-4xl",e),children:[p("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:[Za({title:"Сумма покупок в категории путешествия, ₽",min:r,max:s,step:500,isShowItems:!1,...i("travelExpenseValue")}),Za({title:"Сумма покупок в остальных категориях, ₽",min:o,max:c,step:500,isShowItems:!1,...i("restExpenseValue")})]}),d>=0?Qa({title:"Баллов за месяц",rate:d,fractionDigits:0,isUnknownRateShown:!1,unit:""}):null,p("div",{className:"flex flex-col gap-y-xl @xl:w-96",children:[m>=0?u(Oa,{title:"Баллов за год",value:m}):null,We(n,{isVertical:!0}),Xa(l)]})]})})),li=g((({className:e,inputChildren:t,rateChildren:n,resultChildren:l})=>p("section",{className:N("flex flex-col justify-between @5xl:flex-row gap-m",e),children:[u("div",{className:"flex flex-col gap-y-m sm:max-w-md gap-2xl",children:t}),u("div",{className:"border-b border-main-divider md:hidden"}),n,u("div",{className:"flex flex-col gap-2xl sm:w-96 max-w-full",children:l})]}))),ai=(e,t=0)=>e?.sum&&e.sum>=La&&e.sum<=$a?e.sum:t,ii=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,ri=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,si={horizontal:"gap-5xl",vertical:"flex-col gap-s"},oi=g((({items:e,checkedItem:t,className:n,onChange:l,orientation:a="horizontal"})=>u("div",{className:N(`flex ${si[a]}`,n),children:e?.map((({id:e,text:n})=>u(Mn,{isRadio:!0,text:n,value:t===e,onChange:()=>l&&l(e)},String(e))))}))),ci=({items:e,title:t,mobileTitle:n=t,orientation:l="horizontal",value:a,radioGroupClassName:i,onChange:r})=>p("div",{className:"space-y-s",children:[t?u("div",{className:"hidden @5xl:block",children:u(Ve,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?u("div",{className:"@5xl:hidden",children:u(Ve,{color:"text-secondary-text",font:"font-light",children:n})}):null,u(oi,{orientation:l,items:e,checkedItem:e[a?0:1].id,className:N("flex-col sm:flex-row",i),onChange:t=>r&&r(t===e[0].id)})]}),di=e=>ci({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),mi=([e,t],n,l=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:hi([e,t],l),hi=([e,t],n=[])=>({[e]:n.length?Pa(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Ia(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),ui=(e,[t,n],l)=>e>=l[t]&&e<=l[n],pi=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,gi=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:l,daysValue:a}=t;return n?Math.round(l*Math.pow((1200+e)/1200,a/30)-l):Math.round(l*e*a/365/100)},xi=g((({className:e="",rateParams:t,buttons:n,footnote:l,bottomFootnote:a,isShowDepositeName:i,defaultParams:r})=>{const[s,{field:o}]=wt({moneyValue:ai(r,1e5),daysValue:ii(r,90),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),c=((e,t)=>{const{daysValue:n,moneyValue:l,isPartialWithdrawal:a,isReplenished:i,isMonthlyInterestPayment:r}=e,s=ei(t||"business-calculator-data"),o=i||a,c=n<90||n>730;if(n<=30)return{...Ga,...e,isDisabledOperatingDeposit:c,isUnavailableByTerm:!0};const d=s?.rateRows?.find((e=>r===e.isMonthlyInterestPayment&&pi(o,e)&&ui(l,["minSum","maxSum"],e)&&ui(n,["minDays","maxDays"],e)))||Ga,{rate:m}=d,h=gi(m,e),u=l+h,p=s?.rateRows||[Ga];return{...d,...hi(["minSum","maxSum"],p),...hi(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:c,income:h,finalSum:u}})(s,t?.rateType&&t.sourceBookDir),{income:d,finalSum:m,rate:h,isUnavailableByTerm:g,depositeName:x}=c;return u(li,{className:e,inputChildren:p("div",{children:[Za({title:"Сумма, ₽",min:c.minSum,max:c.maxSum,...o("moneyValue"),value:c.moneyValue}),(f={title:"Срок, дней",min:c.minDays,max:c.maxDays,...o("daysValue"),value:c.daysValue},u(vl,{items:[`От ${ri(f.min||0)}`,`До ${ri(f.max||0)}`],step:1,...f})),p("div",{className:"flex flex-col sm:flex-row gap-y-4 gap-x-14",children:[fi(c,o),di({title:"Выплата процентов",orientation:"vertical",...o("isMonthlyInterestPayment"),radioGroupClassName:"sm:flex-col"})]})]}),rateChildren:Qa({rate:h,depositeName:x,isShowDepositeName:i,isUnavailableByTerm:g}),resultChildren:p("div",{children:[bi(m,d),We(n,{isVertical:!0}),Xa(l),Xa(a)]})});var f})),fi=(e,t)=>p("div",{className:"space-y-s",children:[u(Ve,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),p("div",{className:"flex flex-col gap-y-xl sm:gap-y-s",children:[u(Mn,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),u(Mn,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),bi=(e,t)=>p("div",{className:"flex flex-col gap-2xl sm:gap-0 mb-lg",children:[u(Oa,{title:"Доход в конце срока",value:t,postfix:"₽",prefix:"+"}),u(Oa,{title:"Сумма в конце срока",value:e,postfix:"₽"})]}),yi=({min:e=0,max:t=0,availableMonths:n,...l})=>u(vl,{items:[`От ${vi(e)}`,`До ${vi(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...l}),vi=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Ni=e=>ci({...e,radioGroupClassName:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),wi=e=>ki({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&ki({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&ki({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&ki({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),ki=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:l,viewSettingFieldKey:a})=>!!n&&!n[a]||t[l]===e[l],Si=(e,t)=>{const{isAnnuity:n,moneyValue:l,monthsValue:a,moneyExtra:i}=t;if(0===e)return 0;if(n){const t=e/1200;return i?(l+i)*(t+t/(Math.pow(1+t,a)-1)):l*(t+t/(Math.pow(1+t,a)-1))}return Math.round(l/a)+l*(e/1200)},Ci=(e,t,n)=>{const{moneyValue:l,monthsValue:a}=e,i=ei(t||"credit-calculator-data"),s=i?.rateRows||[Ha],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>wi({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:i?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=mi(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=mi(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:l,monthsValue:a})=>e?.find((e=>wi({row:e,userInputParams:t,paramsViewSettings:n})&&ui(l,["minSum","maxSum"],e)&&ui(a,["minMonths","maxMonths"],e)))||Ha)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:l,monthsValue:a}),{rate:p}=u,g=Si(p,e);return r((()=>({...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:l,monthsValue:a,monthlyPayment:g})),[e,i])},Ti=g((({className:e,sourceBookDir:t,buttons:n,footnote:l,paramsViewSettings:a,defaultParams:i})=>{const[r,{field:s}]=wt({moneyValue:ai(i,2e5),monthsValue:ii(i,Ua),isAnnuity:Boolean(i?.isAnnuity),isInsurance:Boolean(i?.isEnableInsurance),isSalaryClient:Boolean(i?.isEnableSalaryClient),isPensionClient:Boolean(i?.isEnablePensionClient),isStateEmployee:Boolean(i?.isEnableStateEmployee)}),o=Ci(r,t,a),c=Ni({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...s("isAnnuity")});return u(li,{className:e,inputChildren:p("div",{children:[Za({title:"Сумма кредита, ₽",step:500,min:o.minSum,max:o.maxSum,...s("moneyValue"),value:o.moneyValue}),yi({title:"Срок кредита, месяцев",min:o.minMonths,max:o.maxMonths,...s("monthsValue"),value:o.monthsValue}),Ii({...o,...a},s),u("div",{className:"sm:hidden",children:c})]}),rateChildren:Qa({rate:o.rate}),resultChildren:p("div",{children:[u(Oa,{title:"Ежемесячный платёж",value:o.monthlyPayment,postfix:"₽"}),u("div",{className:"hidden sm:block mb-lg",children:c}),We(n,{isVertical:!0}),Xa(l)]})})})),Ii=(e,t)=>p("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?u(Mn,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?u(Mn,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?u(Mn,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?u(Mn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Bi=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,l]=t[n-1],[a,i]=t[n];l>=a?t.splice(n-1,2,[e,Math.max(l,i)]):n++}return t},Pi=(e,t,n)=>{const{moneyValue:l,monthsValue:a}=e,i=ei(t||"deposit-calculator-data"),r=i?.rateRows?.[0]?Ai(i.rateRows[0].minMonths,i.rateRows[0].maxMonths):0,s=!n?.isShowMonthlyInterestPayment,o=!n?.isShowRemoteRegistration,c=i?.rateRows?.find((t=>Ri({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:s})&&Ri({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:o})&&ui(l,["minSum","maxSum"],t)&&ui(a||r,["minMonths","maxMonths"],t)))||Ya,{rate:d}=c,m=Mi(d,e),h=l+m,u=i?.rateRows||[Ya];return{...c,...hi(["minSum","maxSum"],u),...hi(["minMonths","maxMonths"],u),availableMonths:Bi(u.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((l,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:r,income:m,finalSum:h}},Mi=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:l,monthsValue:a}=t;return n?Math.round(l*Math.pow((1200+e)/1200,a)-l):Math.round(l*e*30*a/365/100)},Ri=({row:e,userInputParams:t,paramKey:n,isExclude:l})=>l||t[n]===e[n],Ai=(e,t)=>e+Math.round((t-e)/2),Vi=g((({className:e,sourceBookDir:t,buttons:n,footnote:l,paramsViewSettings:i,defaultParams:r})=>{const[s,{field:o}]=wt({moneyValue:ai(r,2e4),monthsValue:ii(r),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(r?.isRemoteRegistration)}),c=Pi(s,t,i),{defaultMonth:d,rate:m,income:h,finalSum:g}=c,{onChange:x}=o("monthsValue");return a((()=>{!s.monthsValue&&x&&x(d)}),[d]),u(li,{className:e,inputChildren:p("div",{children:[Za({title:"Сумма, ₽",min:c.minSum,max:c.maxSum,...o("moneyValue"),value:c.moneyValue}),yi({title:"Срок, месяцев",min:c.minMonths,max:c.maxMonths,availableMonths:c.availableMonths,...o("monthsValue"),value:c.monthsValue}),zi({...c,...i},o)]}),rateChildren:Qa({rate:m}),resultChildren:p("div",{children:[u(Oa,{title:"Доход в конце срока",value:h,postfix:"₽",prefix:"+"}),u(Oa,{title:"Сумма в конце срока",value:g,postfix:"₽"}),We(n,{isVertical:!0}),Xa(l)]})})})),zi=(e,t)=>{return p("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowMonthlyInterestPayment?di({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment}):null,e.isShowRemoteRegistration?(n={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration},ci({...n,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]});var n},Di=e=>_i({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&_i({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),_i=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:l,viewSettingFieldKey:a})=>!!n&&!n[a]||t[l]===e[l],Fi=(e,t,n)=>{const{moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:s}=e,o=ei(t||"refinancing-calculator-data"),c=o?.rateRows||[Wa],d=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Di({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:o?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:m,maxSum:h}=mi(["minSum","maxSum"],d,c),{minMonths:u,maxMonths:p}=mi(["minMonths","maxMonths"],d,c),g=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>Di({row:e,userInputParams:t,paramsViewSettings:n})&&ui(l+r,["minSum","maxSum"],e)&&ui(i,["minSumOld","maxSumOld"],e)&&ui(r,["minSumExtra","maxSumExtra"],e)&&ui(a,["minMonths","maxMonths"],e)))||Wa)({rateRows:c,userInputParams:e,paramsViewSettings:n,moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:s}),{rate:x}=g,f=Si(x,e),b=e.oldMonthlyPayment-f;return r((()=>({...g,...e,minSum:m,maxSum:h,minMonths:u,maxMonths:p,moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:s,monthlyPayment:f,benefit:b})),[e,o])},Ei=g((({className:e,sourceBookDir:t,buttons:n,footnote:l,paramsViewSettings:a})=>{const[i,{field:r}]=wt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),s=Fi(i,t,a),o=Ni({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...r("isAnnuity")});return u(li,{className:e,inputChildren:p("div",{children:[Za({title:"Остаток долга в других банках, ₽ ",step:500,min:s.minSum,max:s.maxSum-s.maxSumExtra,...r("moneyValue"),value:s.moneyValue}),Za({title:"Ежемесячный платёж в других банках, ₽",step:500,min:s.minSumOld,max:s.maxSumOld,...r("oldMonthlyPayment"),value:s.oldMonthlyPayment}),yi({title:"Новый срок кредита, месяцев",min:s.minMonths,max:s.maxMonths,...r("monthsValue"),value:s.monthsValue}),ji({...s,...a},r),s.isExtraMoney?Za({title:"Дополнительная сумма, ₽ ",step:500,min:s.minSumExtra,max:s.maxSumExtra,...r("moneyExtra"),value:s.moneyExtra}):null,u("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:o})]}),rateChildren:Qa({rate:s.rate,fractionDigits:1}),resultChildren:p("div",{children:[u(Oa,{title:"Ежемесячный платёж",value:s.monthlyPayment,postfix:"₽"}),s.benefit>0?u(Oa,{title:"Выгода в месяц",value:s.benefit,postfix:"₽"}):null,u("div",{className:"hidden sm:block mb-lg",children:o}),We(n,{isVertical:!0}),Xa(l)]})})})),ji=(e,t)=>p("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?u(Mn,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?u(Mn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,u(Mn,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Oi={CreditCalculatorForm:Ti,DepositCalculatorForm:Vi,BusinessDepositCalculatorForm:xi,BonusCalculatorForm:ni,RefinancingCalculatorForm:Ei},Li=g((({className:e,calculatorTabs:t=[],...n})=>u(k,{className:e,defaultPadding:"p-0",...n,children:Ui(t)}))),$i=e=>{const t=e.calculatorBlock?.calcType;if(!t||!(t in Oi))return null;const n=Oi[t];return p("div",{className:"p-xl",children:[e?.calculatorBlock?.title?u(T,{className:"mb-lg",title:e?.calculatorBlock?.title}):null,u(n,{...e.calculatorBlock,isMobile:!0})]})},Ui=e=>{if(!e||!e.length)return null;return 1===e.length?$i(e[0]):e.map(((e,t)=>u(Ea,{isFoldButtonOnTop:!0,unfoldedByDefault:0===t,renderFoldableSection:({isUnfolded:t})=>u(ja,{isUnfolded:t,children:$i(e)}),renderFoldButton:Hi(e)},t.toString())))},Hi=e=>({isUnfolded:t,onToggle:n})=>{const l=e.nav?.align||"text-left";return p("button",{onClick:n,className:"w-full p-xl bg-primary-main flex items-center border-b border-white",children:[u("div",{className:"w-11 h-11 bg-white rounded-md flex justify-center items-center",children:u(K,{name:e.nav?.icon?.icon,iconVersion:"color",width:"24",height:"24"})}),p("div",{className:"flex-1 flex flex-col pl-s",children:[u(Ve,{align:l,color:"text-white",children:e.nav?.title}),u(Ve,{align:l,size:"text-s",color:"text-white",font:"font-light",children:e.nav?.description})]}),u(K,{name:t?"ArrowUpIcon":"ArrowDownIcon",iconVersion:"white",width:"24",height:"24"})]})},Wi=g((e=>{const{onChange:t,min:n,max:l,defaultValue:a="0",fractionDigits:r=0,...s}=e,o=pl(e,{normalize:(e=a)=>n&&l?String(gl(Number(Ki(e)),n,l)):Ki(e),format:Qe(r)}),c=i((e=>t&&t(Ki(e))),[t]);return u(Vt,{onChange:c,...s,...o})})),Ki=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Yi=g((e=>u(Wi,{...e,fractionDigits:2,children:u("div",{className:"absolute right-4 bottom-4",children:u(Ve,{size:"text-xl",font:"font-light",children:"₽"})})}))),Gi={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Xi={amount:1500},qi=g((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",placeholder:i="1500",button:r,formType:s="private",...o})=>{const[{amount:c},{field:d}]=wt(Xi),[m,h]=l(!1);return a((()=>{h(c<=0)}),[c]),p(k,{className:N("flex flex-col items-center",e),defaultPadding:"p-6xl",...o,children:[t?u(T,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,p("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Gi[s],children:[u(Yi,{valid:!m,placeholder:i,label:n,...d("amount",{parse:Number,format:String})}),u("input",{type:"hidden",name:"amount",value:c}),r?.text?u(wn,{className:"w-full mt-lg",type:"submit",disabled:m,children:r.text}):null]})]})})),Ji=(e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=l(t),o=i((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=i((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]},Qi=g((({className:e,disabled:t,...n})=>u(ge,{rounded:!0,className:N("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,...n,children:u(te,{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"})}))),Zi=g((e=>u(Qi,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),er=g((e=>u(Qi,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),tr="absolute top-[calc(50%-24px)] z-40",nr="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",lr=g((({scroll:e,activeIndex:t,itemCount:n,arrowsPadded:l,hasEdgeBlocks:a,onScrollLeft:r,onScrollRight:s})=>{const{canScrollLeft:o,canScrollRight:c,scrollLeft:d,scrollRight:m}=e,h=a?t>0:o,g=a?t<n-1:c,x=i((()=>{a?(o&&t!==n-1&&d(),r()):d()}),[d,r,a,o,t,n]),f=i((()=>{a?(c&&0!==t&&m(),s()):m()}),[m,s,a,o,t,n]);return p("div",{className:"hidden @lg:block",children:[ar(e),h?u(Zi,{className:N(tr,l?"left-1 @lg:left-8":"left-0"),onClick:x}):null,g?u(er,{className:N(tr,l?"right-1 @lg:right-8":"right-0"),onClick:f}):null]})})),ar=e=>p("div",{children:[e.canScrollLeft?u("div",{className:N(nr,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?u("div",{className:N(nr,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),ir=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",rr=({className:e,text:t="ХИТ"}={})=>p("div",{className:N("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[u(K,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),u(I,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),sr="relative h-full",or={small:"sm:min-w-64",normal:"sm:min-w-96",big:"sm:min-w-[515px]"},cr=({noCardBorder:e,activeIndex:t,cardSize:n="normal",...l})=>{const{blocks:a}=l.block||{},i=a?.some(hr);return D({...l,renderProps:(l,a,r)=>p("div",{className:dr(l,{someCardsHighlighted:i}),children:[A(l,a,{className:mr(l,{someCardsHighlighted:i,showBorder:!e,cardSize:n}),blockIndex:r,isActive:r===t}),hr(l)?rr({className:"absolute top-0 -right-4 z-40"}):null]},String(r))})},dr=(e,{someCardsHighlighted:t})=>N(sr,t&&(hr(e)?"pt-3xl":"pt-3xl sm:pt-16")),mr=(e,{someCardsHighlighted:t,showBorder:n,cardSize:l="normal"})=>N(sr,"min-w-80",or[l],t&&(hr(e)?"pt-3xl sm:pt-16":"pt-3xl"),ir(n),n&&"h-full"),hr=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,ur=g((({className:e,itemCount:t,visibleItemCount:n=0,noCardBorder:l,isAlignCenter:a,arrowsPadded:i=!0,isGap:r=!0,cardSize:s="normal",...o})=>{const{blocks:c=[]}=o.block||{},d=t||c?.length,[m,{inc:h,dec:g}]=Ji({itemCount:d,visibleItemCount:n},Math.floor(n/2)),[x,f]=Aa({itemCount:d}),[b]=f.visibleIndicesRange,y=c&&"CarouselBankHistoryCard"===c[0]?.type;return p(k,{className:e,defaultPadding:"p-6xl",...o,children:[p("div",{className:N(a?"flex justify-center":"","relative max-w-full"),children:[u(ya,{containerRef:x,visibleItemCount:n,snapAlign:"snap-start",gap:r?16:void 0,onVisibleIndicesChange:f.handleVisibleIndicesChange,children:cr({noCardBorder:l,activeIndex:m,cardSize:s,...o})}),u(lr,{scroll:f,arrowsPadded:i,onScrollLeft:g,onScrollRight:h,hasEdgeBlocks:y,activeIndex:m,itemCount:d})]}),u(Sa,{className:"@5xl:hidden",containerRef:x,activeIndex:b,dotCount:d,listType:"horizontal-list"})]})}));ur.childrenTypes=["CarouselCard","CarouselBankHistoryCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],ur.childSchema=()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}});const pr=g((({title:e,description:t,className:n})=>u(k,{className:n,defaultPadding:"p-6xl",children:u(P,{headlineVersion:"XS",title:e,description:t,align:"text-left",className:"text-primary-text",isEmbedded:!0})}))),gr="z-10 border border-solid w-full h-full",xr=N(gr,"absolute hidden @xl:block border-transparent"),fr=g((({className:e,title:t,description:n,button:l,...a})=>u(k,{className:N("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:p("div",{className:"relative h-full",children:[u("div",{className:N(xr,"top-9 right-12 bg-green-dark")}),u("div",{className:N(xr,"top-6 right-8 bg-green")}),u("div",{className:N(xr,"top-3 right-4 bg-green-light")}),p("div",{className:N(gr,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[u(P,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),We([l],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),br={black:"bg-black",white:"bg-white"},yr=g((({className:e="",title:t,description:n,image:l,price:a,button:i,colors:r=[],align:s="text-left",padding:o,...c})=>u(k,{className:N("flex flex-col justify-left",e),defaultPadding:"p-2xl",...c,children:p(ve,{className:"h-full",padding:o,title:u(P,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:l?.src?u(te,{className:"flex justify-center align-center mb-xl",image:l}):null,buttons:We([i],{buttonClassName:"w-full self-end"}),children:[r?.length?p("div",{className:"flex text-secondary-text mb-m",children:[u("div",{className:"mr-xs",children:u(Ve,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(vr)]}):null,a?p(Ve,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),vr=(e,t)=>u("div",{role:"figure",className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${br[e]}`},String(t)),Nr=g((({textNode:e,iconNode:t,tag:n,onClick:l,justifyContent:a="between",className:i,...r})=>p(n,{tag:n,className:N("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",i),onClick:l,...r,children:[e?u("div",{children:e}):null,t?u("div",{children:t}):null]}))),wr=g((({className:e="",label:t,icon:n,dataTheme:l="",disabled:a=!1,onClick:i})=>u(Nr,{tag:"button",onClick:i,disabled:a,"data-theme":l,justifyContent:"center",className:N("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:u(Ve,{size:"text-h4",children:t}),iconNode:n?u(te,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),kr=({isUnfolded:e,onToggle:t})=>u(wr,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Sr=g((({className:e="",icon:t,...n})=>{const l=de(),{text:a,href:i,target:r,onClick:s}=l(n);return a?u("div",{className:N("w-full pb-lg",e),children:p("a",{className:"bg-white flex justify-between rounded-md w-full p-lg whitespace-nowrap",role:"link",href:i,target:r,onClick:s,children:[p("div",{className:"flex items-center space-x-lg",children:[t?u(te,{imageClassName:"text-green-dark",image:t,width:"20",height:"20"}):null,u(Ve,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})]}),u(K,{className:"text-green",name:"ArrowRightIcon",width:"20",height:"20"})]})}):null})),Cr=g((({className:e,additionalDescription:t,description:n,links:l=[],title:a,...i})=>p(k,{className:e,...i,children:[p("div",{children:[u(P,{isEmbedded:!0,title:a,description:n,as:"h1",align:"text-left"}),u(P,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),l?.length?Tr(l):null]}))),Tr=(e,t=3)=>{const n=(e||[]).map(((e,t)=>u(Sr,{...e},String(t)))),[l,a]=t>0?[n.slice(0,t),n.slice(t)]:[n,[]];return u("div",{className:"mt-4xl",children:a.length>0?u(Ea,{renderFoldableSection:({isUnfolded:e})=>p("div",{children:[u("div",{className:"mb-1",children:l}),u(ja,{isUnfolded:e,children:a})]}),renderFoldButton:Ir}):u("div",{children:l})})},Ir=({isUnfolded:e,onToggle:t})=>e?null:u(wr,{className:"border-t-main-divider/50",icon:"PlusIcon",label:"Показать еще",onClick:t}),Br=g((({className:e="",href:t,target:n,isRemote:l=!1,children:a})=>{const i=de({isRemote:l})({href:t,target:n});return u(t?"a":"div",{className:N("block",e),...t?i:{},children:a})})),Pr=[{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"}}],Mr=e=>Pr.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{},Rr=g((({className:e="",media:t,showButtonText:n,stretched:a,version:i="white",children:r})=>{const[s,o]=l(),c=t?.map((e=>{const{href:t,icon:l,text:a}=e,{iconMapped:r}=Mr(t),c=He(l)?l:r,d=n?{text:a}:{text:""};return!s&&a&&o(!0),{...e,...d,icon:{...c,iconVersion:"color"},version:e?.version??i}})),d=N("border border-solid hover:border-transparent group-data-primary:border-main-divider border-main-divider group-data-gray:border-green group/media",n&&s?"":"basis-auto",a?"flex-1 justify-center":"");return p("div",{className:N("flex flex-col gap-xs",e),children:[u("div",{className:"flex gap-xs",children:We(c,{className:N(a||s?"basis-full":""),buttonClassName:d})}),r?u(Ve,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Ar=g((({className:e,padding:t,description:n,additionalDescription:l,href:a,icon:i,items:r=[],isDotted:s,socialMedia:o=[],target:c,title:d,align:m="text-left",benefits:h,imageOptions:{directionRight:g=!0,isImageAlwaysOnRight:x=false,isImageSecondary:f=!1}={},...b})=>u(k,{className:N("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...b,children:u(Br,{href:a,target:c,className:"h-full",children:p(ve,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:u(P,{title:d,description:n,headlineVersion:"XS",isEmbedded:!0,align:m}),...it(He(i)?u(te,{image:i}):null,g),buttons:o.length?u(Rr,{media:o,showButtonText:!0,version:b?.version}):null,isImageAlwaysOnRight:x,isImageSecondary:f,imageAlign:"center",children:[u(Ue,{benefits:h}),u(Je,{items:r,isDotted:s,listItemSize:"S"}),Vr(l,m)]})})}))),Vr=(e,t)=>e?u(I,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,zr=(e,t)=>{const{title:n,description:l,buttons:a}=e;return p("div",{className:"py-lg border-b border-main-divider",children:[n?u("div",{className:"opacity-80",children:u(Ve,{size:"text-m",color:"text-secondary-text",children:n})}):null,l?u("div",{className:"mt-2xs",children:u(Ve,{size:"text-xl",color:"text-primary-text",children:l})}):null,a?.length?u("div",{className:"text-primary-main",children:We(a)}):null]},String(t))},Dr=g((({className:e="",title:t,align:n="text-center",icon:l,button:a,visibleCellsCount:i=1,cardCells:r=[],...s})=>{const o=r.map(zr),[c,d]=i>0?[o.slice(0,i),o.slice(i)]:[o,[]];return p(k,{className:N("flex flex-col",e),defaultPadding:"p-2xl",...s,children:[He(l)?u("div",{className:"self-center",children:u(te,{image:l})}):null,t?u(T,{className:N("pt-xs",n),headingType:"h5",title:t}):null,a?.text?u(ge,{className:"w-full mt-m mb-lg",...a}):null,d.length?u(Ea,{renderFoldableSection:({isUnfolded:e})=>p("div",{children:[c,u(ja,{isUnfolded:e,children:d})]}),renderFoldButton:r.length>1?_r:null}):u("div",{children:c})]})})),_r=({isUnfolded:e,onToggle:t})=>p("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:t,children:[u("div",{children:e?"Скрыть":"Подробнее о тарифе"}),u(K,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Fr=(e=!1)=>e?"text-white":"",Er=(e=!1)=>"text-s mb-m "+(e?"text-white":"text-secondary-text/80"),jr=g((({icon:e,image:t,title:n,subtitle:l,isFillGradient:a})=>p("div",{className:"space-y-4",role:"columnheader",children:[e?u(te,{className:"h-16 w-16 min-w-16 min-h-16",image:e,width:"64",height:"64"}):null,t?.src&&u("div",{children:u(te,{image:t})}),n?u(T,{headingType:"h4",className:Fr(a),title:n}):null,l?u("div",{className:Er(a),children:l}):null]}))),Or=g((({cell:e,rowHeader:t,isFillGradient:n=!1})=>u("div",{className:"box-border flex flex-col",role:"cell",children:u("div",{className:N("h-full","border-main-divider border-b"),children:e?e.map(Ur(n,t)):null})}))),Lr=(e=!1)=>""+(e?"text-white/80":"text-secondary-text"),$r=(e=!1)=>""+(e?"text-white":""),Ur=(e,t)=>({label:n,description:l},a)=>p("div",{className:"flex justify-between text-s py-s",children:[u(I,{size:"text-s",color:Lr(e),children:t}),p("div",{className:"basis-1/2",children:[n?u("div",{className:"text-right",children:u(I,{size:"text-s",align:"text-right",color:$r(e),children:n})}):null,l?u("div",{className:"text-right",children:u(I,{size:"text-s",color:Lr(e),children:l})}):null]})]},String(a)),Hr=g((({header:e,columnData:t,visibleRowLength:n=0,isFillGradient:l,showRow:a,onToggleColumn:i})=>{const r=t?.slice(0,a?t.length:n),s=l?"secondary":"primary";return p("div",{className:N("border border-gray rounded-md p-m mb-m",l?"bg-gradient-to-r from-main-gradient-start to-main-gradient-end":""),role:"row",children:[u(jr,{...e,isFillGradient:l}),r?.length?r.map((({rowHeader:e,cell:t},n)=>u(Or,{cell:t,rowHeader:e,isFillGradient:l},String(n)))):null,a&&e?.link?u(ge,{href:e.link.href,target:e.link?.target,version:s,className:"text-s font-medium mt-m py-s",children:e.link.text}):null,Wr({onToggleColumn:i,isFillGradient:l,showRow:a})]})})),Wr=({onToggleColumn:e,isFillGradient:t,showRow:n})=>u("div",{className:"mt-lg",role:"cell",children:u("a",{role:"link",onClick:e,className:"cursor-pointer "+(t?"text-white/80":"text-primary-main"),children:u(Ve,{size:"text-s",font:"font-medium",children:n?"Скрыть":"Показать описание"})})}),Kr=g((e=>{const{className:t,title:n}=e;return p("section",{className:`bg-white font-sans p-6xl overflow-hidden text-primary-text relative space-y-lg ${t||""}`,children:[n?u(T,{headingType:"h3",className:"font-medium text-center",title:n}):null,u("div",{role:"table",children:u(Yr,{...e})})]})})),Yr=g((({columns:e=[],rowHeaders:t,isColoredFirstColumn:n,visibleRowLength:a,orientation:r,...s})=>{const[o,c]=l(Array.from({length:e.length}).fill(!a)),d=i((e=>{const t=(t,n)=>n===e?!t:t;c((e=>e.map(t)))}),[]),m=i((()=>c((e=>Array.from({length:e.length}).fill(!1)))),[]),h=e?.map((({data:e,header:l},i)=>{return u(Hr,{visibleRowLength:a,showRow:o[i],header:l,columnData:(r=e,r?.map(((e,n)=>({cell:e,rowHeader:t?.[n]?.title})))),isFillGradient:0===i&&n,onToggleColumn:()=>d(i),...s},String(i));var r}));return"horizontal"===r?u(Va,{onVisibleIndicesChange:m,children:h}):h})),Gr=e=>e%2!=0,Xr=g((({title:e,description:t})=>p("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[u(te,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),u(P,{title:e,description:t,headlineVersion:"S",isEmbedded:!0,align:da})]}))),qr=["ArrowDownIcon","ArrowUpIcon"],Jr="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box",Qr=g((({label:e="",blocksToRender:t=[],topItemsCount:n=0,block:l,notFound:a,...i})=>{const[r,s]=n>0?[t.slice(0,n),t.slice(n)]:[t,[]];return p("div",{children:[u("div",{className:N(t.length?"hidden":"block"),children:a?u(Xr,{...a}):null}),p("div",{className:N("space-y-2xs",t.length?"":"hidden"),children:[p("div",{className:N(Jr),children:[z(r,{...i.options,parent:l}),Gr(r.length)?u(vt,{className:"col-span-6"}):null]}),u(Ea,{renderFoldableSection:({isUnfolded:e})=>p(ja,{className:N(Jr),isUnfolded:e,children:[z(s,{...i.options,parent:l}),Gr(s.length)?u(vt,{className:"col-span-6"}):null]}),renderFoldButton:({isUnfolded:t,onToggle:l})=>u(wr,{className:N(n<1?"hidden":""),disabled:!s?.length,label:e,icon:qr[Number(t)],dataTheme:i.options?.page?.colorPalette,onClick:l})})]})]})})),Zr=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,es=(e,t)=>Object.entries(e).map((([n,l])=>"number"==typeof l?Array.isArray(t[n])?((e,t)=>n=>Zr(t[e])||Zr(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Zr(t[e])||Zr(n[e])||ts(t[e])<=ts(n[e]))(n,e):"object"==typeof l&&"min"in l&&"max"in l?((e,t)=>n=>Zr(t[e])||Zr(n[e])||ts(t[e]?.min)>=ts(n[e]?.min)&&ts(t[e]?.min)<=ts(n[e]?.max))(n,e):Array.isArray(l)?((e,t)=>n=>Zr(t[e])||Zr(n[e])||t[e]?.some((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Zr(t[e])||Zr(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),ts=e=>Number(e||0),ns=(e,t)=>(n=Nt)=>e&&e.filter((e=>es(t,n(e.content||{})))),ls=g((({value:e,onChange:t,items:n=[],multiple:l})=>n.map((n=>u(fn,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(l?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:l?"checkbox":"radio"},n.value))))),as=({field:e,reset:t,filtrationSchema:n,resetButton:l,children:a})=>p("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[p("div",{className:"flex flex-col @4xl:flex-row gap-5xl",children:[a,Object.entries(n).map(is(e))]}),l?u("div",{children:u(wn,{className:"w-full @4xl:w-72 @4xl:ml-s",onClick:t,children:l?.text})}):null]}),is=e=>([t,n])=>{const l=n?.type;return"array"===l?rs(t,e)(n):null},rs=(e,t)=>n=>{const l=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return p("div",{children:[n?.title?u("div",{className:"mb-m",children:u(Ve,{size:"text-m",font:"font-light",color:"text-secondary-text",children:n.title})}):null,u(ls,{items:l,multiple:!n?.single,...t(e)})]},e)},ss=(e,t)=>{const n=e[t?.sourceBook];return n?n?.rateRows.map((e=>e.minMonths)).filter((e=>void 0!==e)):[]},os=(...e)=>{const t=e.map((e=>pt(e)));return Promise.all(t)};function cs(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const ds=e=>Boolean(e&&e.content&&"string"==typeof e.content.sourceBook);function ms(e){const{dirs:t=[],source:n=[]}=r((()=>{const t=(e=>e?.filter(ds).map((({content:{sourceBook:e}})=>e)))(e);return{dirs:t?.map((e=>`/wcms-resources/${e}.json`)),source:t}}),[e]),{data:l=[]}=ht(t,os);return{source:Object.fromEntries(cs(n,l).filter((([,e])=>Boolean(e)))),months:(a=l.flatMap((e=>e?.rateRows||[])).filter((e=>"number"==typeof e.minMonths&&e.minMonths===e.maxMonths)).map((e=>e.minMonths)),[...new Set(a)]).sort(((e,t)=>e-t))||[]};var a}const hs=1e9,us={sum:{min:1e4,max:hs},period:3},ps=g((({className:e,filtrationSchema:t={},resetButton:n,sumInput:l,periodInput:a,...i})=>{const{source:r,months:s}=ms(i.block?.blocks),[o,{field:c,reset:d}]=wt(us),m=ns(i.block?.blocks,o)((e=>({...e,period:ss(r,e||{})||[]}))),h=p("div",{children:[u(Yi,{label:l?.title,min:500,max:hs,...c("sum",{parse:e=>({min:Number(e),max:hs}),format:({min:e})=>String(e)})}),u(vl,{title:a?.title,items:["От 3 мес","До 5 лет"],list:s,...c("period")})]});return p(k,{className:N("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[as({field:c,reset:d,filtrationSchema:t,resetButton:n,children:h}),u(Qr,{blocksToRender:m,...i})]})})),gs={type:"string",title:"Адрес справочника"};ps.childrenTypes=["ProductTile"],ps.childSchema=e=>({...e?.filtrationSchema||{},sourceBook:gs});const xs=e=>"Image"===e?.contentType&&e?.image?u(te,{image:e.image}):"Code"===e?.contentType&&e.code?u("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,fs=g((({className:e="",title:t,description:n,error:l,button:a,...i})=>p(k,{className:N("flex flex-col justify-center items-center",e),defaultPadding:N("p-6xl"),version:"transparent",...i,children:[u("div",{className:"flex justify-center",children:xs(l)}),u(P,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?u(ge,{version:a?.version,text:a?.text,...a}):null]}))),bs="location";function ys(e="Москва"){const[t,n]=((e,t,n)=>{const[r,s]=l(n||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,i((n=>e.fire(t,n)),[e,t])]})(y,"location",Ns()??{name:e}),r=i((e=>{ws(e),n(e)}),[]),{data:s}=ht(vs()?null:"/api/v1/region",gt);return a((()=>{s&&!vs()&&n(s)}),[s]),[t??{name:e},r]}const vs=()=>Boolean(globalThis.localStorage?.getItem(bs)),Ns=()=>{try{const e=globalThis.localStorage?.getItem(bs);return e&&JSON.parse(e)}catch(e){return null}},ws=e=>{try{globalThis.localStorage?.setItem(bs,JSON.stringify(e))}catch(e){}};var ks;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD"}(ks||(ks={}));const Ss=new Intl.NumberFormat("ru",{style:"currency",currency:ks.RUB}),Cs=e=>e?Ss.format(e):"",Ts="text-left text-m font-light text-secondary-text",Is=`${Ts} pl-5xl`,Bs={USD:"DollarIcon",EUR:"EuroIcon"},Ps=g((({className:e,exchangeCurrencyItems:t})=>p("table",{className:`h-fit w-fit ${e}`,children:[u("thead",{children:p("tr",{children:[u("th",{className:Ts,children:u(Ve,{size:"text-m",children:"Валюта"})}),u("th",{className:Is,children:u(Ve,{size:"text-m",children:"Купить"})}),u("th",{className:Is,children:u(Ve,{size:"text-m",children:"Продать"})})]})}),u("tbody",{children:t.map(Ms)})]}))),Ms=e=>{const t=e?.currency?.currency;return p("tr",{className:"pb-2xs text-h6",children:[u("td",{className:"pt-m",children:p("div",{className:"flex items-center gap-xs",children:[t?u(te,{image:{icon:Bs[t]},width:"24",height:"24"}):null,u(Ve,{size:"text-h6",children:t})]})}),u("td",{className:"pt-m pl-5xl",children:u(Ve,{size:"text-h6",children:Cs(e?.saleExchangeRate)})}),u("td",{className:"pt-m pl-5xl",children:u(Ve,{size:"text-h6",children:Cs(e?.buyExchangeRate)})})]},t)},Rs={icon:"GpsIcon"},As=g((({className:e="",address:t})=>p("div",{className:`flex gap-s ${e}`,children:[u(ha,{...Rs,iconBgVersion:"primary"}),p("div",{className:"space-y-2xs",children:[t?u(I,{size:"text-l",color:"text-primary-main",children:t}):null,u(I,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Vs=(e,t,n)=>{const l=Number(zs(e))*Math.pow(t,n?-1:1);return Number.isInteger(l)?l:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(l)},zs=e=>e.replace(/[^\d.,]/g,"").replace(",","."),Ds=e=>{return(t=[[e=>e.value!==ks.RUB&&e.oppositeValue!==ks.RUB,()=>e.handleConvert(e.value,ks.RUB)],[e=>e.value===ks.RUB&&e.oppositeValue===ks.RUB,()=>e.handleConvert(e.value,ks.USD)],[()=>!0,()=>e.handleConvert(e.value)]],e=>{const[,n]=t.find((([t])=>t(e)))||[];return n})(e)?.();var t};function _s(e){const{placeholder:t,rates:n,selected:l,value:a,setValue:i,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),o={key:l,text:l};return p("div",{className:"relative flex",children:[u(Vt,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:i}),s.length?u(dn,{isBorder:!1,onChange:e=>r(e.key),options:s,value:o}):null]})}const Fs=g((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=l({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||ks.RUB,selectBuy:n?.[0]?.currency?.currency||ks.USD}),o=i((e=>s((t=>({...t,...e})))),[]);return p("div",{className:`grid gap-m pt-2xl ${e}`,children:[_s({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:Es(r,o,n),value:r.inputSell,setValue:e=>Os(o,n)(e,r.selectSell,r.selectBuy)}),_s({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:js(r,o,t),value:r.inputBuy,setValue:e=>Ls(o,t)(e,r.selectBuy,r.selectSell)}),a?.text?u(ge,{text:a.text,version:a?.version,...a}):null]})})),Es=(e,t,n)=>l=>{t({selectSell:l}),Ds({value:l,oppositeValue:e.selectBuy,handleConvert:(l=e.selectSell,a=e.selectBuy)=>{Os(t,n)(e.inputSell,l,a)}})},js=(e,t,n)=>l=>{t({selectBuy:l}),Ds({value:l,oppositeValue:e.selectSell,handleConvert:(l=e.selectBuy,a=e.selectSell)=>Ls(t,n)(e.inputBuy,l,a)})},Os=(e,t)=>(n,l,a)=>{e({inputSell:zs(n),selectBuy:a});const i=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===l))?.saleExchangeRate;i&&e({inputBuy:String(Vs(n,i,l===ks.RUB)||"")})},Ls=(e,t)=>(n,l,a)=>{e({inputBuy:zs(n),selectSell:a});const i=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===l))?.buyExchangeRate;i&&e({inputSell:String(Vs(n,i,l===ks.RUB)||"")})};const $s=g((({className:e="",title:t="Курсы обмена валют",button:n,...l})=>{const[a]=ys(),i=function(e){const t=e?.code||"000",{data:n}=ht(`/api/v1/exchangerates?regionCode=${t}`,gt);return n||{}}(a),r=Us(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:ks.RUB}});const o=r.filter((e=>e.saleExchangeRate));return o.push({currency:{currency:ks.RUB}}),u(k,{className:N("box-border min-h-80",e),...l,children:u(ve,{className:"h-full",title:u(T,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:p("div",{className:"flex gap-6xl flex-wrap",children:[p("div",{children:[r?u(Ps,{className:"mb-xl",exchangeCurrencyItems:r}):null,u(As,{address:i?.address})]}),r.length&&s.length&&o.length?u(Fs,{className:"grow",currencyRatesBuy:s,currencyRatesSell:o,button:n}):null]})})})})),Us=e=>e?.filter((e=>1===e?.currency?.id||2===e?.currency?.id))||[],Hs=e=>bt(d.SITEMAP||"sitemap",{fallback:e}),Ws=(e,t)=>u(ha,{...e,iconBgVersion:t,className:"shrink-0"}),Ks=g((({label:e,labelIconBgVersion:t,icon:n,onToggle:l,labelIcon:a})=>u(Nr,{tag:"button",className:N("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:l,textNode:p("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[Ws(a,t),e?u(Ve,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?u(K,{name:n,iconVersion:"black",width:"24",height:"24"}):null}))),Ys=g((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:l="Развернуть",labelIcon:a,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,...o})=>u(k,{className:N("w-full","",e),defaultPadding:"p-0",tag:"div",version:"transparent",...o,children:u(Ea,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>u(ja,{className:N("gap-lg","flex flex-wrap group-last:last:pb-0"),isUnfolded:e,children:D({...o,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Gs({foldButtonVersion:r,label:l,labelIcon:a,labelIconBgVersion:i,isUnfolded:e,onToggle:t})})})));Ys.childrenTypes={exclude:["RollupItem"]};const Gs=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:l,isUnfolded:a,onToggle:i})=>{const r=t||(a?"Скрыть":"Развернуть"),s=((e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon")(a);return"accordion"===e?u(Ks,{label:r,labelIcon:n,labelIconBgVersion:l,icon:s,onToggle:i}):u(wr,{label:r,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},Xs=g((({className:e="",items:t})=>p("div",{className:e,children:[t?.length?t.map(qs):null,u(ge,{version:"primary",className:"w-full",href:"https://old.rshb.ru/feedback/question/",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"})]}))),qs=(e,t)=>p("div",{className:"mb-m space-y-m",children:[u("div",{children:u(Ve,{size:"text-l",font:"font-medium",children:e?.title})}),u("div",{className:"space-y-m",children:e.items?.map(Js)})]},String(t)),Js=(e,t)=>p("div",{className:"space-y-2xs",children:[u("div",{children:Qs(e.type,e.text)}),u(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Qs=(e,t="")=>{switch(e){case"tel":return u("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Zs(t)}`,children:u(Ve,{size:"text-h6",children:t})});case"email":return u("a",{className:"no-underline",href:`mailto:${t}`,children:u(I,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return u("span",{children:t})}},Zs=e=>e.replaceAll(/\D/g,""),eo=["split_version","New","Old"],to=g((({className:e="",index:t,text:n,...l})=>{const a=de(),{href:i,target:r,onClick:s}=a(l);return u("a",{className:N("",e),href:i,target:r,onClick:s,children:n||`Документ ${t}`})})),no=g((({title:e,links:t,className:n=""})=>p("div",{className:N("flex flex-col gap-4",n),children:[u(Ve,{size:"text-l",font:"font-normal",children:e}),t?.length?u("div",{className:"flex flex-col gap-lg",children:t.map(((e,t)=>u(to,{className:"text-l font-light",index:t,...e},String(t))))}):null]}))),lo=g((({className:e="",items:t,basePath:n})=>t?.length?u("ul",{className:N("flex flex-col",e),children:t.map(ao(n))}):null)),ao=e=>(t,n)=>{const{text:l,...a}=t,i=de({isRemote:!(!d.BASE_PATH||!e)&&!d.BASE_PATH.startsWith(e),basePath:e}),{href:r,target:s,onClick:o}=i(a);return u("li",{className:"list-none my-xs",children:u("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:s||"_self",onClick:o,children:l||null})},`list_item_${String(n)}`)},io=g((({className:e="",index:t,...n})=>{const l=de({isRemote:!0}),{href:a,target:i,text:r,onClick:s}=l(n);return u("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:i,onClick:s,children:r||`Документ ${t}`})})),ro=g((({className:e="",links:t})=>p("div",{className:N("@container",e),children:[u("div",{className:"pt-lg",children:u(Ve,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?u("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)=>u(io,{index:t,...e},String(t))))}):null]}))),so=g((({className:e,...t})=>{const n=t.options?.page?.fallback,{topItems:l}=Hs(n),{relatedEnterprises:a,contacts:r,socialMedia:s,mobileApps:c,horizontalNavigationTitle:m,documents:h}=bt(d.FOOTER||"footer",{fallback:n}),g=i((()=>{const[e,t,n]=eo;((e,t)=>{const n=globalThis.document?.cookie.split(";")??[],[,l]=n.map((e=>e.split("="))).find((([t])=>t.trim()===e))||[];t(l)&&(globalThis.document.cookie=`${e}=${t(l)}`)})(e,(e=>e?.replace(t,n)))}),[]);return p(k,{tag:"footer",className:e,defaultPadding:"p-4xl pb-24",...t,children:[u("div",{className:"mb-lg pb-xs border-b border-main-divider",children:l?.map(((e,t)=>u(Ys,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,children:u(lo,{items:e.items,basePath:o(e.href)})},String(t))))}),u(Xs,{className:"overflow-hidden",items:r}),p("div",{className:"mt-xl",children:[u(Rr,{className:"mb-xl",media:s,stretched:!0,children:"Соцсети"}),p("div",{className:"mb-xl",children:[u("div",{className:"flex flex-col gap-4 mb-xs",children:c?.map(oo)}),u(Ve,{size:"text-s",font:"font-light",color:"text-secondary-text",children:"Мобильное приложение"})]})]}),u("div",{className:"py-lg border-t border-main-divider",children:u(to,{text:"Вернуться на прежнюю версию сайта",className:"text-l font-light max-w-[292px]",href:"https://old.rshb.ru",onClick:g})}),u(no,{className:"py-lg border-y border-main-divider",title:m,links:a}),u(ro,{links:h})]})})),oo=({href:e="/",text:t},n)=>{const{label:l}=Mr(e);return u(ge,{className:"w-full",text:t||l,version:"secondary",href:e,target:"_blank"},String(n))},co={width:"34",height:"34"},mo={"bg-white":"color",transparent:"white"},ho={"bg-white":"text-primary-main",transparent:"text-white"},uo=(e,t,n)=>u(te,t?.src?{image:t,className:ho[e],width:n?.width,height:n?.height}:{image:{icon:t?.icon||"LogoIcon",iconVersion:mo[e]},className:ho[e],width:n?.width,height:n?.height}),po={"bg-white":"text-primary-text",transparent:"text-white"},go=g((({className:e,href:t="/",logo:n,children:l,targetBlank:a,bgColor:i="bg-white",showTitle:r=!0})=>p("a",{className:N("inline-flex items-center font-sans no-underline",e),href:t,target:a?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",children:[uo(i,n?.image,co),r?l??u("div",{className:"ml-s",children:u(Ve,{font:"font-medium",color:po[i],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),xo={default:"px-5 bg-main-divider rounded hover:text-primary-main",transparent:"text-white hover:text-primary-hover"},fo=g((({bgColor:e,logo:t,internetBankUrl:n,version:l})=>{const a=v(),r=d.BASE_PATH?.startsWith(a.pathname),s=i((e=>{e.preventDefault(),a.back()}),[]);return p("div",{className:"flex items-center justify-between w-full",children:[r?u("div",{children:u(go,{className:"my-2xs",bgColor:e,logo:t})}):bo(s),n?u("div",{children:u(ge,{href:n,ariaLabel:"Войти",target:"_blank",className:N("p-s text-s whitespace-nowrap text-primary-main hover:text-primary-hover",xo["transparent"===l?"transparent":"default"]),children:"Войти"})}):null]})})),bo=e=>u("div",{children:p("button",{className:"flex items-center text-l my-2xs","aria-label":"Вернуться назад",onClick:e,children:[u(te,{className:"w-6 h-6",image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24"}),"Вернуться назад"]})}),yo={"bg-white":"primary",transparent:"transparent"},vo=g((({bgColor:e="bg-white",version:t=yo[e],...n})=>{const{logo:l}=Hs(n.options?.page?.fallback),{internetBankUrl:a}=bt(d.PORTAL_DATA||"portal-data",{fallback:n.options?.page?.fallback,pathDir:j(d.BASE_PATH,"portal-resources")});return u(k,{tag:"header",defaultPadding:"",version:t,...n,children:u("div",{className:"container px-lg py-2xs box-border",children:u(fo,{bgColor:e,logo:l,internetBankUrl:a,version:t,...n})})})})),No={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},wo=g((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:l=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...o})=>{const c=v();return u(k,{className:N("relative flex flex-col",No[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${q(c)(s?.src)})`}}:{},padding:t,version:a,isTheme:i,...o,children:D({...o,extraProps:{className:N("w-full",ir(r)),padding:l?"":"p-0"}})})}));wo.childrenTypes=[];const ko=g((e=>u(wo,{...e})));ko.childrenTypes=[];const So=g((e=>{const{className:t,image:n,...l}=e;return u(k,{className:t,defaultPadding:"p-0",...l,children:u(te,{image:n})})})),Co=["байт","Кб","Мб","Гб","Тб","Пб"],To=g((({icon:e,text:t,href:n,target:l,fileFormat:a,fileSize:i})=>{const r=i&&a?",":"",s=i??"",o=a?String(a):"";return p("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",role:"link",href:n,target:l,children:[e,t?p(Ve,{size:"text-l",font:"font-light",children:[t," ",Io(s,o),u(Ve,{color:"text-secondary-text",children:n&&`${s+r+o}`})]}):null]})})),Io=(e,t)=>e||t?u("span",{children:", "}):"",Bo={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Po=g((({className:e="",title:t,description:n,align:l="text-center",documents:a,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const o=v();return p(k,{className:N("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[u(P,{title:t,description:n,align:l,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?u("div",{className:N("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Bo[r]),role:"list",children:a.map(Mo(o,i))}):null]})})),Mo=(e,t)=>(n,l)=>{if(""===n?.docType)return null;const a="Attachment"===n?.docType?U(e)(n?.attachment?.src):n?.href,i="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${Co[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Ro(a):n?.fileFormat;return u("div",{role:"listitem",children:u(To,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:i,icon:t?u(te,{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(l))},Ro=e=>{if(!e)return"";const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},Ao=g((({className:e,padding:t,align:n="text-left",buttons:l=[],description:a,image:i,items:r,qr:s,additionalDescription:o="",title:c="Мобильное приложение",version:d="primary",...m})=>{const h="secondary"===d?"p-m min-w-32":"min-w-24",g=i?.src?u(te,{className:"hidden lg:block",image:i}):null;return u(k,{className:N("min-h-80",e),padding:"p-0",version:d,...m,children:p(ve,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:u(T,{headingType:"h3",title:c,className:N("whitespace-pre-wrap",n)}),rightImage:g,buttons:We(l,{className:"flex-wrap"}),children:[a?u(Ve,{size:"text-xl","font-weight":"font-light",children:a}):null,p("div",{className:N("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[u(Je,{items:r,listItemSize:"M"}),u(Ve,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:o}),s?.src?u("div",{className:N("flex justify-center bg-white rounded-md @xl:-order-1",h),children:u(te,{className:"w-fit",image:s})}):null,i?.src?u(te,{className:"lg:hidden",image:i}):null]})]})})})),Vo={primary:"bg-white/30",secondary:"bg-main-divider"},zo={primary:"text-white",secondary:"text-secondary-text"},Do=g((({count:e,version:t="secondary"})=>u("div",{className:N("w-6 h-6 rounded-full flex items-center justify-center",Vo[t]),children:u(Ve,{size:"text-xs",color:zo[t],children:e})}))),_o=(e=[],t={})=>e.filter((({content:e={}})=>es(t,e))).length,Fo=(e,t)=>e===t;const Eo=(jo=function(...e){return(t,n)=>e.some((e=>e(t,n)))}(Fo,((e=Fo)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,l)=>e(t,n[l])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,n])=>jo(n,t[e])))));var jo;const Oo=[],Lo={},$o={default:"px-xs",underlined:"px-m",rounded:"px-lg rounded-md"},Uo={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",rounded:"text-white"},Ho={default:"bg-white",underlined:"bg-white",rounded:"bg-transparent"},Wo={default:"sm:bg-primary-main",underlined:"bg-white",rounded:"bg-primary-main"},Ko=g((({tag:e="div",item:t={},isActive:n,type:l="default",onClick:a})=>{const i=e,{text:r,appendRight:s,...o}=t;return u(i,{className:N("h-12","block flex-1","cursor-pointer",$o[l],n?Wo[l]:Ho[l]),role:"tab","aria-selected":n,onClick:a,...o,children:p("div",{className:N("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Uo[l]:"text-secondary-text hover:text-primary-main"),children:[u(Ve,{size:"text-m",children:r}),s?u("div",{className:"ml-xs",children:s}):null]})})})),Yo=g((e=>u(e?.item?.href?Go:Xo,{...e}))),Go=g((e=>{const t=de(),n=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:l,...a}=t({...e.item,onClick:n});return u(Ko,{...e,tag:"a",item:a,onClick:l})})),Xo=g((({item:e={},onClick:t,...n})=>{const l=i((()=>{t&&t(e)}),[t,e]);return u(Ko,{item:e,onClick:l,...n})})),qo=(e,t,n)=>(l,a)=>u(Yo,{isActive:l===e,onClick:t,type:n,item:l},String(a)),Jo=g((({className:e,tabsType:t="default",items:n=[],value:l,onChange:a})=>u("div",{className:N("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tablist",children:n.map(qo(l,a,t))}))),Qo={categories:[],extraOptions:[],propertyType:[],stage:[]},Zo=g((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:l,...a})=>{const[s,{field:o,reset:c,update:d}]=wt(Qo),m=ns(a.block?.blocks,s)(),h=i(((e=Qo)=>d(e)),[]),g=(({hotFilters:e=Oo,filtrationState:t=Lo,blocks:n=Oo,onFiltrationStateChange:l})=>{const a=r((()=>Math.max(0,e.findIndex((e=>Eo(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,appendRight:u(Do,{version:t===e[a]?"primary":"secondary",count:_o(n,t.filter)})})))),[e,n,a]),o=i((t=>{l(e[s.indexOf(t)].filter)}),[e,s]);return{value:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:h});return p(k,{className:N("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[u(Jo,{...g}),as({field:o,reset:c,filtrationSchema:n,resetButton:l}),u(Qr,{blocksToRender:m,...a})]})}));function ec(e,t,n){t.geoObjects.removeAll();const l=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:l,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),i=n.map((t=>new e.Placemark(t,{},{iconLayout:"default#image",iconImageHref:"/icons/MapMarkerSingleIcon.svg",iconImageSize:[78,84],iconImageOffset:[-35,-50]})));a.add(i),t.geoObjects.add(a),t.setBounds(e.util.bounds.fromPoints(n)).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}Zo.childrenTypes=["ProductTile"],Zo.childSchema=e=>e?.filtrationSchema||{};const tc={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"},nc=(e,t,n)=>u("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(tc).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.geoObjects.add(t.geoObjects)}))},children:u(K,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),lc=e=>globalThis[e];const ac=()=>function(e,t){const[n,r]=l(),s=i((()=>r(lc(e))),[e]);return a((()=>{const n=document.getElementById(t);if(!n){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),r(void 0)}}if(!lc(e))return n.addEventListener("load",s),()=>{n.removeEventListener("load",s)};s()}),[e,t]),n}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${d.YANDEX_MAP_API_KEY||""}&lang=ru_RU`),ic={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=g((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return u("div",{onClick:()=>{const n=e.current.getZoom(),l="in"===t?n+1:n-1;e.current.setZoom(l,{checkZoomRange:!0})},className:`${Object.values(ic).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:u(K,{name:n,width:"20",height:"16"})})})),sc={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"},oc=[55.753995,37.614069],cc=g((({points:e,className:t="",zoom:n=5})=>{const i=s(null),r=ac(),[o,c]=l();if(a((()=>{i?.current?r&&(ec(r,i.current,e),e?.length||i.current.setCenter(oc)):r?.ready((()=>{i.current||(i.current=new r.Map("map",{center:e?dc(e):oc,zoom:n,controls:[],suppressMapOpenBlock:!0}),ec(r,i.current,e))}))}),[r,i,e,n]),!r)return null;const d=o?"z-[100000]":"z-10";return p("div",{id:"map",className:N(!o&&"relative","w-full",t),children:[u("div",{className:N(Object.values(sc),d,"right-2 top-4 bg-white"),onClick:()=>{const e=i.current.container;o?e.exitFullscreen():e.enterFullscreen(),c(e.isFullscreen())},children:u(K,{name:"FullScreenIcon",width:"16",height:"16"})}),p("div",{className:N("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",d),children:[u(rc,{yandexMaps:i}),u(rc,{yandexMaps:i,direction:"out"})]}),nc(i.current,r,N("right-2 top-80",d))]})})),dc=e=>[hc(mc(e,0)),hc(mc(e,1))],mc=(e,t)=>e.map((e=>e[t])),hc=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,uc={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных"},pc=(e,{field:t,reset:n})=>p("div",{className:"pb-2xl",children:[e?.length?u("div",{className:"flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",children:e.map((e=>u(Mn,{text:uc[e],...t(e)},e)))}):null,u(ge,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:n,text:"Очистить фильтр",appendRight:u(K,{name:"CloseIcon",width:"16",height:"16"})})]}),gc=()=>null,xc=()=>[],fc=g((({className:e,data:t=[],renderCard:n=gc,filterItems:l=xc,initFilterState:a={},descriptionData:i,title:s})=>{const[o,{field:c,reset:d}]=wt(a),[m,h,g]=r((()=>{const e=l(t,o),n=e.map((e=>[e.gpsLatitude,e.gpsLongitude].filter(Boolean))).filter((e=>e&&2===e.length));return[e,n,e.length]}),[t,o]);return p("div",{className:N("space-y-1",e),children:[p("div",{className:"bg-white",children:[p("div",{className:"pt-6xl px-6xl",children:[p("div",{className:"flex gap-xs pb-2xl",children:[u(T,{headingType:"h2",children:s}),g?u(Ve,{size:"text-h2",color:"text-secondary-text",children:`(${g})`}):null]}),i?bc(i):null,pc(Object.keys(a),{field:c,reset:d})]}),u("div",{className:"h-[600px]",children:u(b,{children:u(cc,{points:h,className:"h-full"})})})]}),m.map(n)]})})),bc=({__html:e,list:t})=>e||t?.length?p("div",{className:"p-xl mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?u(Re,{__html:e}):null,t?.length?u("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pt-xs",children:t.map(((e,t)=>p("div",{className:"flex gap-xs items-center",children:[e?.image?u(te,{image:e.image}):null,e?.text?u(Ve,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,yc={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"}},vc=g((({className:e,children:t,color:n="gray"})=>u("div",{className:N("p-s sm:border sm:border-gray rounded-md flex items-center",yc[n].border,e),children:u(Ve,{size:"text-m",color:yc[n].text,children:t})}))),Nc=g((({value:e,subText:t,children:n,...l})=>{const a=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[a.length,n,t].every((e=>!e))?null:wc({textItems:a,subText:t,children:n,...l})})),wc=({label:e,labelSize:t="text-m",textItems:n,subColor:l,subText:a,className:i,children:r})=>p("div",{className:N("flex gap-2xs flex-col h-full max-w-[300px]",i),children:[e?u(Ve,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||n.filter(Boolean).map(((e,t)=>u(Ve,{size:"text-l",children:e.trim()},String(t)))),a?u(Ve,{color:l,size:"text-m",children:a}):null]}),kc=g((({className:e,children:t})=>u("div",{className:N("sm:flex sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),Sc=["ArrowDownIcon","ArrowUpIcon"],Cc=["Подробнее","Скрыть"],Tc=({isUnfolded:e,onToggle:t})=>p("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,children:[u("div",{className:"pr-m",children:Cc[Number(e)]}),u(K,{className:"text-primary-text",name:Sc[Number(e)],width:"16",height:"16"})]}),Ic=({location:e,address:t,billAcceptorType:n,terminalType:l,billAcceptorEnable:a,atmCode:i="",atmAccess:r="",workTime:s},o)=>{const c=[{label:"Устройство",value:Pc(l)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];return p("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[p("div",{className:"sm:flex sm:justify-between",children:[p("div",{children:[u(Ve,{size:"text-h4",children:Pc(e)}),t?p("div",{className:"flex pb-xl pt-xs gap-2xs",children:[u(K,{name:"GeolocationIcon",width:"24",height:"24"}),u(Ve,{size:"text-l",children:t})]}):null]}),u(vc,{color:"green",children:Pc(s)})]}),u("div",{className:"hidden sm:block",children:u(kc,{className:"flex-wrap",children:c?.map(Bc)})}),u(Ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>u(ja,{isUnfolded:e,children:u(kc,{className:"flex-wrap",children:c?.map(Bc)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Tc({isUnfolded:e,onToggle:t})})]},String(o))},Bc=(e,t)=>u(Nc,{...e},String(t)),Pc=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Mc=[];const Rc=async e=>await pt(e,{method:"GET"})||Mc,Ac={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1},Vc={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable)},zc=g((({data:e,className:t})=>{const[n]=ys(),l=function(e){const{data:t=Mc}=ht(`/api/v1/atms?regionCode=${e}`,Rc);return t}(n?.code??"000");return u(fc,{className:t,filterItems:Dc,data:l,initFilterState:Ac,renderCard:Ic,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Dc=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),l=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!l.includes(e)));return e.filter((e=>{const t=a.every((t=>Vc[t](e))),n=!l.length||l.some((t=>Vc[t](e)));return t&&n}))},_c=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),l=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", "),a=[Fc({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":l}),Fc({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:l},!0)].filter(Boolean);return u(Nc,{label:"Режим работы",value:a,className:"max-w-none"})},Fc=({workTime:e="",lunchHour:t="",daysOff:n=""},l=!1)=>e?[`${l?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Ec=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],jc=e=>Ec.map((([t,n,l])=>({key:t,title:l,short:n,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=Lc(e);return p(kc,{className:"border-none",children:[u(Nc,{label:"Для юридических лиц",labelSize:"text-l",children:u("div",{className:"flex gap-1",children:t.map($c)})}),u(Nc,{label:"Режим работы",className:"max-w-none",children:u(Ve,{children:e})})]})},Lc=e=>{const t=Ec.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],l=n[n.length-1]?.toLowerCase();return l?.includes("выходной")?t.map((e=>({...e,status:!l?.includes(e.short.toLowerCase())}))):t},$c=({short:e,status:t},n)=>u("div",{className:N("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:u(Ve,{size:"text-xs",children:e})},String(n)),Uc=({currency:e,buyExchangeRate:t,saleExchangeRate:n},l)=>p("div",{className:"flex gap-lg h-full",children:[e?.currency?u(Nc,{label:"Валюта",value:e.currency}):null,t?u(Nc,{label:"Купить",value:String(t)}):null,n?u(Nc,{label:"Продать",value:String(n)}):null]},String(l)),Hc=(new Date).getDay(),Wc=e=>{const[t]=e?.slice(Hc-1)??[];if(!t)return null;const{lunchHour:n,status:l,workTime:a,hasLunch:i}=t;return l?p("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?u(vc,{color:"green",children:a}):null,n&&i?u(vc,{color:"yellow",children:`перерыв: ${n}`}):null]}):u(vc,{color:"red",children:"Выходной"})},Kc=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Yc=({title:e,status:t,workTime:n,lunchHour:l,hasLunch:a},i)=>u(Nc,{label:e,value:t&&n?n:"",subText:Kc({lunchHour:l,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(i)),Gc=({name:e,address:t,phone:n,fax:l,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:o,exchangeRate:c},d)=>{if(!o)return null;const m=jc(o);return p("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[p("div",{className:"sm:flex sm:justify-between",children:[p("div",{children:[u(Ve,{size:"text-h4",children:e}),t?p("div",{className:"flex pb-xl pt-xs gap-2xs",children:[u(K,{name:"GeolocationIcon",width:"24",height:"24"}),u(Ve,{size:"text-l",children:t})]}):null]}),Wc(m)]}),u("div",{className:"hidden sm:block",children:Xc({phone:n,fax:l,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:o,exchangeRate:c})}),u(Ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>u(ja,{isUnfolded:e,children:Xc({phone:n,fax:l,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:o,exchangeRate:c})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Tc({isUnfolded:e,onToggle:t})})]},String(d))},Xc=({phone:e,fax:t,phoneBusiness:n,phoneNatural:l,phoneCallCentre:a,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const o=jc(r),c=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return p("div",{children:[p(kc,{className:"flex-wrap",children:[u(Nc,{label:"Факс",value:t}),u(Nc,{label:"Телефон филиала",value:e}),u(Nc,{label:"Для обращений юридических лиц",value:n}),u(Nc,{label:"Обслуживание физических лиц",value:l}),u(Nc,{label:"Для консультаций по валютному контролю",value:i}),u(Nc,{label:"Контакт-центр",value:a})]}),r?.isMatchesPattern?u(kc,{children:u(Nc,{label:c,labelSize:"text-l",className:"w-full max-w-none",children:u("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:o?.map(Yc)})})}):p(kc,{children:[u(Nc,{label:c,labelSize:"text-l",children:u("div",{className:"flex gap-1",children:o?.map($c)})}),_c(o)]}),r?.businessScheduleVisibleTag?Oc(r?.businessScheduleDescription):null,s?.currencies?.length?u(kc,{className:"flex-wrap",children:s?.currencies?.map(Uc)}):null]})},qc=[];const Jc=async e=>await pt(e,{method:"GET"})||qc,Qc={workingSaturday:!1},Zc={workingSaturday:e=>Boolean(e.workSchedule?.workingSaturday)},ed=g((({className:e})=>{const[t]=ys(),n=function(e){const{data:t=qc}=ht(`/api/v1/branches?regionCode=${e}`,Jc);return t}(t?.code??"000");return u(fc,{className:e,filterItems:td,data:n,initFilterState:Qc,renderCard:Gc,title:`Офисы филиала ${t?.name}`})})),td=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Zc[t](e)))))},nd=g((({data:e,className:t,...n})=>{const l=e?.dataType??"offices";return u(k,{version:"transparent",className:N(t),defaultPadding:"p-0",...n,children:"offices"===l?u(ed,{}):u(zc,{data:e})})})),ld=g((({className:e,size:t})=>u("figure",{className:N("m-0 mt-xl min-w-[80%]",e),children:ad(t)}))),ad=(e=3)=>rd(100,e).map((e=>Math.floor(e))).map(id),id=(e,t)=>u("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-light"},String(t)),rd=(e,t)=>[e].concat(t>0?rd(e/1.618,t-1):[]),sd=g((({className:e,title:t,description:n="Блок в разработке...",...l})=>p(k,{className:N("box-border",e),...l,children:[u(P,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),u(ld,{})]}))),od=g((({className:e,padding:t,slides:n=[],...l})=>u(k,{className:N("overflow-hidden relative",e),padding:t,...l,children:u(Va,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>u("div",{className:"box-border h-full",children:u(at,{className:"px-5 h-full",headlineVersion:"L",...e,...l})},String(t))))})}))),cd=g((({address:e,email:t,telephone:n,button:l,className:a="",__html:i,icon:r,title:s,version:o="primary",...c})=>p(k,{className:N("box-border text-left space-y-s",a),version:o,...c,children:[p("div",{className:"w-full flex justify-between flex-row-reverse",children:[He(r)?u("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:u(te,{image:r})}):null,s?u(T,{headingType:"h3",as:"h3",title:s}):null]}),p("div",{className:"w-full space-y-m",children:[i?dd(i):null,md({label:"Адрес",data:e,iconName:"GeolocationIcon"}),md({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),md({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),l?.text?We([l]):null]})]}))),dd=e=>u("div",{className:"border-b border-main-divider pb-lg",children:u(Re,{__html:e})}),md=({label:e,data:t,iconName:n,dataColor:l=""})=>t?p("div",{className:"flex gap-s",children:[u(K,{iconVersion:"black",name:n,width:"24",height:"24"}),p("div",{className:"flex flex-col gap-2xs",children:[u(Ve,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),u(Ve,{size:"text-xl",color:l,children:t})]})]}):null,hd=g((e=>{const{__html:t,richVersion:n,...l}=e;return u(k,{defaultPadding:"p-0",...l,children:u(Re,{__html:t,richVersion:n})})})),ud=g((({className:e=""})=>{const[t,n]=l("option2"),a=i((e=>n(e)),[]);return p("div",{className:N("order-4",e),children:[u(Xl,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),u(Xl,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),pd=g((({data:e,fieldLabel:t,fieldValue:n,selected:l,placeholder:a="",setSelected:i,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),o=s.find((e=>e.key===l));return u(dn,{options:s,label:r,placeholder:a||l,onChange:e=>i(e.key),value:o})})),gd=g((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:l=[],selectedBranch:a,onSelectedBranch:i})=>p("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[u("div",{className:"flex-1 min-w-0",children:u(pd,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),u("div",{className:"flex-1 min-w-0",children:u(pd,{data:l,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),xd=["От 1 дня","До 365 дней"],fd=g((({days:e,setDays:t})=>p("div",{className:"order-1",children:[u(Ve,{size:"text-m",font:"font-light",children:"Срок аренды"}),u(vl,{min:1,max:365,value:e,items:xd,onChange:t})]}))),bd=g((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:l=[],selectedBoxSize:a,onSelectedBoxSize:i})=>p("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[u("div",{className:"flex-1 min-w-0",children:u(pd,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),u("div",{className:"flex-1 min-w-0",children:u(pd,{data:l,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),yd=g((({regions:e,selectedRegion:t,branches:n,selectedBranch:l,days:a,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:o,onChange:c,onClick:d})=>p("div",{className:"contents @xl:block flex-1 space-y-xl",children:[u(gd,{regions:e,selectedRegion:t,onSelectedRegion:e=>c({selectedRegion:e}),branches:n,selectedBranch:l,onSelectedBranch:vd(c)}),u(fd,{days:a,setDays:e=>c({days:e})}),u(bd,{caseVolumes:o,selectedCaseVolume:i,onSelectedCaseVolume:Nd(c),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>c({selectedBoxSize:e})}),u("div",{className:"order-4",children:u(Ve,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),p("div",{className:"contents @md:flex justify-between items-center gap-m",children:[u(ud,{}),u(ge,{text:"Офисы на карте",version:"primary",onClick:d,className:"order-6"})]})]}))),vd=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Nd=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},wd=g((({days:e,tariffs:t=[]})=>{const n=Sd(e,t),l="На рисунке изображена пачка листов\nформата А4";return p("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[p("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:[kd("Аренда за",e),kd("Цена",n+" ₽")]}),u("div",{className:"@xl:hidden order-3 mb-xs",children:u(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l})}),p("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:[u(te,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),u("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:u(I,{size:"text-s",font:"font-light",color:"text-white",children:l})})]})]})})),kd=(e,t)=>p("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[u(Ve,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),u("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),Sd=(e,t)=>{const n=Cd(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Cd=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},Td=(e,t)=>e.find((e=>e.branchCode===t)),Id=g((e=>{const{regions:t,data:n,branches:l,onChange:i,onClick:r}=e;a((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,i]);const s=Td(l,n.selectedBranch),o=Bd(s?.safeBoxCaseVolumes),c=Pd(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,d=Md(c,n.selectedBoxSize);return p("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[u(yd,{...n,regions:t,onClick:r,branches:l,caseVolumes:o,safeBoxCases:c,onChange:i}),u(wd,{days:n.days,tariffs:d})]})})),Bd=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Pd=(e,t)=>e?.find((e=>e.volume===t)),Md=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Rd=[];const Ad=async e=>await pt(e,{method:"GET"})||Rd,Vd=g((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=l(!1),o=i((()=>s((e=>!e))),[]),[c,d]=l({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),m=tn(),h=zd(c.selectedRegion,m),g=function(e){const{data:t}=ht(e?`/api/v1/safeboxes?regionCode=${e}`:null,Ad);return t||Rd}(h),x=i((e=>d((t=>({...t,...e})))),[d]),f=(b=Td(g,c.selectedBranch)||g,Array.isArray(b)?b.map((e=>e.gpsLatitude&&e.gpsLongitude?[e.gpsLatitude,e.gpsLongitude]:[])):b?.gpsLatitude&&b?.gpsLongitude?[[b.gpsLatitude,b.gpsLongitude]]:[]);var b;return p(k,{className:n,defaultPadding:"",...a,children:[p("div",{className:"p-4xl space-y-xl",children:[e?u(T,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,u(Id,{regions:m,branches:g,data:{...c,selectedRegion:h},onClick:o,onChange:x}),t?u(I,{size:"text-s",font:"font-light",children:t}):null]}),f.length&&r?u(cc,{points:f,className:"h-[640px]"}):null]})})),zd=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e;function Dd(e){throw new Error(e)}const _d={normal:{icon:"h-11 w-11",image:"h-14 w-14"},small:{icon:"h-12 w-12",image:"h-14 w-14"}},Fd={normal:"",small:"min-h-6xl"},Ed={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"},jd=g((({className:e="",title:t,description:n,steps:l,buttons:a,size:i="normal",stepVersion:r="gray",version:s="primary",...o})=>p(k,{className:N("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:s,...o,children:[u(P,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),l?.length?u("div",{className:"box-border",children:u("div",{className:"flex flex-col gap-6xl justify-between",children:l.map(Od(i,r))})}):null,We(a,{isVertical:!0})]}))),Od=(e,t)=>(n,l)=>{const{type:a}=n;if("default"!==a&&"rte"!==a)return null;switch(a){case"default":return Ld(e,t)(n,l);case"rte":return u(Re,{__html:n.__html});default:Dd(n)}},Ld=(e,t)=>(n,l)=>u("div",{className:"contents",children:p("div",{className:"flex flex-row items-center relative",children:[u("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:$d(e,t)(n,l)}),p("div",{className:N("flex flex-col justify-center h-fit",Fd[e]),children:[n.label?u(I,{size:"text-l",align:"text-left",children:n.label}):null,n.description?u("div",{className:N("text-s font-light text-left",Ed.description),children:n.description}):null]})]})},String(l)),$d=(e,t)=>(n,l)=>{const a="secondary"===t?"white":"color",i=Boolean(n?.icon?.src),r=_d[e][i?"image":"icon"],s=i?"transparent"===t:t;return u(k,{className:N(r,"z-10 mr-s flex justify-center content-center rounded-md"),defaultPadding:"",version:s,children:u("span",{className:"flex max-w-full max-h-full items-center justify-center",children:He(n?.icon)?u(te,{image:{...n.icon,iconVersion:n.icon?.iconVersion||a},imageClassName:"max-w-full max-h-full",width:Ud(e),height:Ud(e)}):u("span",{className:N("text-h4","transparent"===t?Ed.iconText:(o=t,"secondary"===o?"group-data-primary:text-white":"text-secondary-text")),children:l+1})})});var o},Ud=e=>"normal"===e?"38":"24",Hd="hidden sm:flex absolute z-40 top-0",Wd=g((({className:e,items:t=[],value:n,onChange:l,tabsType:a})=>{const[i,r]=Aa({itemCount:t?.length||0});return p("div",{className:N("relative overflow-x-auto no-scrollbar",e),role:"tablist",children:[u(ya,{containerRef:i,snapAlign:"snap-start",onVisibleIndicesChange:r.handleVisibleIndicesChange,children:t.map(qo(n,l,a))}),r.canScrollLeft?u(Zi,{className:N("left-6",Hd),onClick:r.scrollLeft}):null,r.canScrollRight?u(er,{className:N("right-6",Hd),onClick:r.scrollRight}):null]})})),Kd=({tabsMode:e,...t})=>{switch(e){case"wideScreen":return u(Jo,{...t});case"centered":return u("div",{className:"flex",children:u(Jo,{className:"m-auto p-xs rounded-md bg-main-gray",tabsType:"rounded",...t})});case"scrollable":return u("div",{className:"flex",children:u(Wd,{className:"m-auto",tabsType:"underlined",...t})});default:return null}},Yd="tab",Gd=g((({className:e="",isSticky:t,tabs:n=[],tabsMode:s,...o})=>{const c=v(),{isReady:d}=c,m=r((()=>n.map(qd)),[n]),[h,p]=l(0);a((()=>{if(!n||!n[0])return;const e=c.query.tab&&n.findIndex((e=>"group"===e.type&&e.ref===c.query.tab))||0,t=n[e]||n[0];p(e),Xd(t)}),[d]),a((()=>{const e=n[h];"group"===e?.type&&y.subject("tab",{type:e.type,label:e.ref,groupName:e.name})}),[n,h]);const g=i((e=>{const t=m.indexOf(e),l=n[t];p(t),Xd(l),"group"===l.type&&(e=>{const t=new URLSearchParams(c.query);e.name?t.set(Yd,e.name):t.delete(Yd),c.replace(`${c.pathname}?${t}`,"",{scroll:!1})})(e)}),[n,m]);return u(k,{className:N(t?"sticky top-1 z-20":"",e),defaultPadding:"p-0",...o,children:Kd({items:m,value:m[h],tabsMode:s,onChange:g})})})),Xd=e=>{"group"===e.type&&y.fire("tab",{type:e.type,label:e.ref,groupName:e.name}),"link"===e.type&&y.fire("tab",{type:e.type,label:e.href})},qd=e=>"group"===e?.type?{text:e.title,name:e.ref}:e,Jd={start:"text-start",center:"text-center",end:"text-end"},Qd=g((({tab:e,className:t,onClick:n,isActive:l})=>{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"}))(l);return p("button",{type:"button",onClick:n,"aria-label":e?.title,className:N("border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs",a.btn,t),children:[e?.icon?u(te,{className:N("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,p("div",{className:"border-0",children:[e?.title?u("div",{className:a.title,children:e.title}):null,e?.description?u("div",{className:a.desc,children:e.description}):null]})]})}));function Zd(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const em=g((({tab:e})=>{const t=de();return Zd((()=>{const{onClick:n}=t(e);n()}),[e],500),u(ld,{className:"col-span-12 p-xl",size:5})})),tm=g((({className:e="",tabs:t=[],block:n,tabAlign:i,...r})=>{const[s,o]=l(lm(t)),c=nm(t[s],s),d=t.length,[m,{inc:h,dec:g}]=Ji({itemCount:d},s),[x,f]=Aa({itemCount:d});return a((()=>{f.scrollTo(s,{behavior:"auto"})}),[]),p(k,{className:N(e),defaultPadding:"p-0",...r,children:[p("div",{className:"relative border-b-8 border-primary-main",children:[u(ya,{itemClassName:"flex",containerRef:x,snapAlign:"snap-end",gap:8,onVisibleIndicesChange:f.handleVisibleIndicesChange,children:t.map(am(s,o,i))}),u(lr,{scroll:f,arrowsPadded:!0,onScrollLeft:g,onScrollRight:h,activeIndex:m,itemCount:d})]}),u("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:t[s]?.href?u(em,{tab:t[s]}):z(n?.slots?.[c],{...r?.options,slotName:c})})]})}));tm.slots=({tabs:e})=>e?.filter((e=>!e.href)).map(nm)||[],tm.childrenTypes={exclude:["TabsLayout"]};const nm=(e,t)=>e?.title||`Слот №${t}`,lm=e=>e.reduce(((e,t,n)=>t.selected?n:e),0),am=(e,t,n="start")=>(l,a)=>u(Qd,{className:Jd[n],tab:l,isActive:e===a,onClick:()=>t(a)},String(a)),im={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},rm=g((({children:e,activeIndex:t,columnWidth:n,version:l="comparison"})=>u("div",{className:"flex flex-1 overflow-hidden",children:u("div",{className:im[l],style:{transform:`translateX(-${t*n}px)`},children:e})}))),sm=g((({className:e="",isOpen:t,onClick:n})=>u(ge,{className:e,appendRight:u(te,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),om={Buttons:({buttons:e})=>We(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?u(te,{image:e}):null,List:({isDotted:e,...t})=>u(Je,{className:"flex flex-col justify-between items-start text-h6",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>p("div",{className:"space-y-2xs",children:[e?u("div",{children:u(Ve,{size:"text-h6",children:e})}):null,t?u("div",{children:u(Ve,{size:"text-l",color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,dataUrl:n,pdfUrl:l,isOpen:a})=>e?u(sm,{isOpen:a,onClick:()=>{t({dataUrl:n,pdfUrl:l})}}):null},cm=g((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:i,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=l(!0);a((()=>{i===o&&s||m(!0)}),[s,o]);return dm({cell:e,cellProps:{rowIdx:n,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),dm=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...l}=e;if(!n||!(n in om))return null;return u(om[n],{...t,...l})},mm=g((({cells:e,rowIdx:t,cellIdx:n,setTableInner:l,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r})=>u("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>u(cm,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:l,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),hm=(e,t)=>140*Be(e.slice(0,t).map((e=>e?.cols?.length??1))),um=(e,t)=>e?.length>0?u("div",{className:N("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>u("div",{className:"w-20 mx-lg",children:u(Ve,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,pm=g((({rows:e})=>{return u(ya,{visibleItemCount:0,snapAlign:"snap-start",children:u("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[l,...a]=e,i=N("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return p("div",{className:"flex border-main-divider border-b border-solid h-full",children:[l?.data?u("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:u(Ve,{size:"text-xl",font:"font-light",children:l.data})}):null,u("div",{className:"flex flex-grow overflow-hidden",children:u("div",{className:i,style:{transform:`translateX(-${hm(a,t)}px)`},children:a?.map(((e,n)=>p("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?u(Ve,{size:"text-xl",children:e.data}):null,e?.cols?um(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),gm=g((({activeTabIndex:e,items:t})=>u("div",{children:t.map(((t,n)=>{const l=`activeTabIdx:${e}-tableIdx:${n}`;return p("div",{className:"w-full @container",children:[u("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:u(Ve,{size:"text-xl",align:"text-left",children:t.title})}),u("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:u("div",{className:"relative",children:u(pm,{rows:t.rowsData})})})]},l)}))}))),xm=(e=!1)=>""+(e?"text-white":"text-secondary-text"),fm=g((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:l})=>p("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?u("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>u("div",{className:N("rounded-md px-4 py-3 cursor-pointer",t===n?"bg-primary-main":""),onClick:()=>l(t),children:u(Ve,{size:"text-xl",font:"font-light",color:xm(t===n),children:e||t+1})},e)))}):null,t?u(ge,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:u(K,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]})));async function bm(e){const t=await fetch(e);return await t.json()}const ym=g((({dataUrl:e,pdfUrl:t,onClick:n})=>{const{tableData:a}=function(e){const{data:t}=ht(function(e){return`/wcms-resources/${e||"tariffs-inner-table-data"}.json`}(e),bm);return t||{}}(e),[r,s]=l(0),o=i((e=>s(e)),[]),c=a?.[r]?.items??[],d=a?.map((e=>e.currency??""));return p("div",a?{className:"bg-white z-10",children:[u(fm,{currencies:d,activeTabIndex:r,setActiveTabIndex:o,linkToPDF:t}),u(gm,{activeTabIndex:r,items:c}),u(sm,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[u(Ve,{size:"text-h6",children:"Данных нет"}),u(sm,{onClick:n,isOpen:!0})]})})),vm=g((({children:e,tableInner:t,onHideContentClick:n})=>p("div",{className:"self-start flex flex-col",role:"row",children:[u("div",{className:N("@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?u("div",{className:"origin-top animate-expansion",children:u(ym,{...t,onClick:n})}):null]}))),Nm=g((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,o]=l(void 0),c=i((e=>o(e)),[]),[d,m]=l(void 0),h=i((e=>m(e)),[]);return p(vm,{onHideContentClick:()=>o(void 0),tableInner:s,...r,children:[u("div",{className:N("text-s","w-80 flex-shrink-0"),children:p("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?u(te,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?u(Ve,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?u(rm,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>u(mm,{cells:e,rowIdx:a,cellIdx:t,setTableInner:c,tableInner:s,openTableInnerIdx:d,setOpenTableInnerIdx:h,...r},String(t))))}):null]})}));function wm({dec:e,inc:t,canDec:n,canInc:l,btnClass:a,className:i=""}){return n||l?p("div",{children:[n?u(Qi,{className:N("absolute z-40",a[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,l?u(Qi,{className:N("absolute z-40 rotate-180",a[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!l}):null]}):null}const km=g((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return p("div",{role:"table",children:[p("div",{className:"relative space-y-xs",children:[e,wm({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?u("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Sm=g((({className:e="",title:t,description:n,rowHeaders:l,tariffsColumns:a,hiddenRowsNum:i=0,...r})=>{const s=a?.map((({data:e})=>e))||[],o=l?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),c=s.length,[d,m]=Ji({itemCount:c,visibleItemCount:2}),h=(o||[]).map(((e,t)=>u(Nm,{row:e,activeIndex:d,rowIdx:t,...r},String(t)))),[g,x]=i>0?[h.slice(0,-i),h.slice(-i)]:[h,[]];return p(k,{className:N("overflow-hidden relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[u(P,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),u("div",{className:"space-y-m",children:i>0?u(Ea,{renderFoldableSection:({isUnfolded:e})=>p(km,{controls:m,children:[g,u(ja,{isUnfolded:e,children:x})]}),renderFoldButton:kr}):u(km,{controls:m,children:h})})]})})),Cm=g((({className:e="",title:t,description:n,iconVersion:l,__html:a,...i})=>p(k,{className:N("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...i,children:["small"===l?Tm():null,p("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?u(Ve,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Im(n):null,a?u(Re,{__html:a}):null]})]}))),Tm=()=>u("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"}),Im=e=>u(I,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Bm=g((({prefix:e,unit:t,suffix:n})=>p("div",{className:"w-full flex items-end",children:[e?u("div",{className:"gradient-color-text",children:u(Ve,{size:"text-h2",children:e})}):null,t?u("div",{className:"-mb-6 @xl:-mb-4",children:u("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?u("div",{className:"gradient-color-text",children:u(Ve,{size:"text-h2",children:n})}):null]}))),Pm=g((e=>{const{prefix:t,unit:n,suffix:l,...a}=e;return u(k,{defaultPadding:"p-0",...a,children:u(Bm,{prefix:t,unit:n,suffix:l})})})),Mm={AdTile:vt,ApplicationForm:oa,BenefitsBlock:ua,BonusBenefitsBlock:Da,ButtonsBlock:Fa,Calculator:Li,CardTransfer:qi,Carousel:ur,CarouselBankHistoryCard:pr,CarouselCard:fr,CarouselCatalogCard:yr,CarouselLinks:Cr,CarouselRecommendationCard:Ar,CarouselTariffsCard:Dr,ComparisonTable:Kr,DepositFiltration:ps,ErrorBlock:fs,ExchangeRateTile:$s,Footer:so,Header:vo,Headline:P,HorizontalLayout:ko,ImgBlock:So,LinkDocs:Po,MobileAppTile:Ao,MortgageFiltration:Zo,OfficesAtmsMap:nd,Placeholder:sd,ProductBlock:st,ProductGallery:od,RepresentativeOfficeInfo:cd,RichTextBlock:hd,RollupItem:Ys,SafeDepositRental:Vd,StepsBlock:jd,Tabs:Gd,TabsLayout:tm,TariffsTable:Sm,TextBlock:Cm,UnitBlock:Pm,VerticalLayout:wo},Rm=g((({className:e,onClose:t})=>u("button",{className:N("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",children:u(te,{image:{icon:"CloseIcon"},width:"24",height:"24"})}))),Am="cookie",Vm=g((({termLink:e,personalDataPolicyLink:t})=>{const[n,{setTrue:l,setFalse:a}]=nn();Zd((()=>{globalThis.localStorage?.getItem(Am)||l()}),[],3e3);const r=i((()=>{globalThis.localStorage?.setItem(Am,"true"),a()}),[]);return n?u("div",{className:"container fixed left-0 right-0 bottom-0 z-50",children:p("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[u("div",{className:"sm:flex-1",children:p(I,{size:"text-s",font:"font-light",color:"text-primary-text",children:["АО «Россельхозбанк» использует",u(Br,{isRemote:!0,className:zm(e?.href),...e,children:"cookie"}),"(файлы с данными о прошлых посещениях сайта) для персонализации сервисов и удобства пользователей. Вы можете запретить сохранение cookie в настройках своего браузера.",u(Br,{isRemote:!0,className:zm(t?.href),...t,children:"Обработка Ваших персональных данных"}),"производится в соответствии с требованиями Федерального закона от 27.07.2006 № 152-Ф3 «О персональных данных»."]})}),u("div",{className:"ml-s sm:ml-0 w-24 flex justify-end",children:u(Rm,{className:"bg-main-gray rounded-md",onClose:r})})]})}):null})),zm=e=>N("inline mx-2xs",e?"text-green-dark":"");const Dm=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=l(e),a=i((e=>n((t=>[...t,e]))),[]),r=i((()=>n((e=>e.slice(0,-1)))),[]),s=i((e=>n((t=>t.filter((t=>t!==e))))),[]),o=i((()=>n([])),[]);return[t,{setList:n,push:a,pop:r,remove:s,clear:o}]}(),c=i((()=>{e&&e(n),o()}),[n,e]),d=i((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return a((()=>y.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:Dd(e)}}))),[c,d]),n},_m=g((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),n=Dm({onCloseAll:e,onClose:t}),{close:l}=oe(),r=i((({key:e})=>{"Escape"===e&&l()}),[]);return an(globalThis.document,"keydown",r),a((()=>{n.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"))}),[n]),n.length?u("div",{className:"fixed inset-0 z-50",role:"dialog",children:n.map((({dialog:e,id:t},l)=>u("div",{className:N("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar",l===n.length-1?"":"hidden"),children:e},String(t||l))))}):null})),Fm=g((()=>{const[e,t]=l(null),n=i((()=>{t(null)}),[]);a((()=>y.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:Dd(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&n()}),[n]);return an(globalThis.document,"keydown",r),e?u("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})),Em=e=>({href:t})=>!!t&&E(jm(t,e)).startsWith(E(t)),jm=(e,t)=>_(e)?t.href:t.pathname;function Om(e=[]){const t=v(),n=e.findIndex((e=>Em(d.BASE_PATH?{pathname:d.BASE_PATH}:e))(t));return[n,e[n]]}const Lm=g((({isActive:e,onClick:t})=>p("button",{className:N(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),onClick:t,children:[u(K,{className:"w-6 h-6",name:"BurgerIcon",iconVersion:e?"color":"black"}),"Меню"]}))),$m=g((({isActive:e,item:t,onClick:n})=>{const l=de({isRemote:!0}),{href:a,onClick:i}=l({href:t?.href,onClick:n});return p("a",{className:N(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:i,children:[u(K,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]})})),Um=g((({className:e,head:t,children:n,onClose:l})=>{const{close:a}=oe(),r=i((()=>{a(),l&&l()}),[l]);return p("div",{className:N("relative min-h-full bg-white pt-0 p-5",e),children:[p("div",{className:"sticky py-xl top-0 bg-white z-10",children:[u(Rm,{className:"absolute top-0 right-0",onClose:r}),u("div",{className:"container",children:t})]}),u("div",{className:"container pb-6xl",children:n})]})})),Hm=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:l,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),l=Array.from({length:e.length}),a=Array.from({length:t.length});let i=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)l[r]||a[n]||e[r]!==t[n]||(i++,l[r]=!0,a[n]=!0)}return{m:i,s1Matches:l,s2Matches:a}}(e,t);if(0===n)return 0;const i=function(e,t,{s1Matches:n,s2Matches:l}){let a=0;for(let i=0,r=0;i<e.length;i++){if(!n[i])continue;let s=r;for(;s<t.length;s++)if(l[s]){r=s+1;break}e[i]!==t[s]&&a++}return a}(e,t,{s1Matches:l,s2Matches:a}),r=(n/e.length+n/t.length+(n-i/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const Wm=e=>e?.length?p("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[u("div",{className:"mb-m",children:u(Ve,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),u("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>u(Km,{...e},String(t))))})]}):null,Km=g((({icon:e,...t})=>{const n=de(),{text:l,target:a,href:i,onClick:r}=n(t);return p("div",{className:"flex gap-s items-center",children:[e?u(te,{pathPrefix:"/wcms-resources/",image:e}):null,l?u("a",{className:"hover:text-primary-hover",href:i,target:a,onClick:r,children:u(Ve,{size:"text-l",font:"font-light",color:"text-primary-text",children:l})}):null]})})),Ym=e=>t=>u("div",{className:"mb-xs sm:mb-2xs",children:u("button",{className:"cursor-pointer hover:text-primary-hover",onClick:()=>{e&&e(t)},children:u(Ve,{size:"text-l",font:"font-light",children:t.name||""})})},t.id),Gm=g((({className:e,searchTerm:t,onSearch:n})=>p("form",{className:`font-sans relative ${e}`,children:[u("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:u("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),u("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=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),Xm=g((()=>{const{defaultLocation:e,foreignOffices:t}=Hs(),[n,a]=ys(e),[r,s]=l(""),o=Jm(tn()).sort(((e,t)=>e.name.localeCompare(t.name))),c=((e,t)=>{const n=new Map;for(const l of e){const e=t(l),a=n.get(e)||[];n.set(e,[...a,l])}return n})(o,qm),{close:d}=oe(),m=i((e=>{a(e),d()}),[]);return p(Um,{className:"pb-20",head:p("div",{children:[u(Ve,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),n?p("div",{className:"mb-s",children:[u(Ve,{size:"text-l",font:"font-light",children:"Сейчас выбран: "}),u("button",{onClick:()=>a(n),children:u(Ve,{color:"text-primary-main",children:n.name})})]}):null,u(Gm,{onSearch:s,searchTerm:r})]}),children:[r&&r.length>=3?u("div",{children:o.filter((({name:e})=>e&&Hm(e.toLowerCase())(r.toLowerCase())>=.8)).map(Ym(m))}):u("div",{className:"columns-1 sm:columns-5",children:Array.from(c.entries()).map((h=m,([e,t])=>p("div",{className:"break-inside-avoid mb-2xl w-56",children:[u("div",{className:"mb-s",children:u(Ve,{size:"text-h6",children:e})}),t.map(Ym(h))]},e)))}),Wm(t)]});var h})),qm=e=>e.name?.charAt(0)||"",Jm=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Qm=g((({className:e,value:t,autoFocus:n,onChange:l,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{l&&l(e.target?.value||"")}),[l]);return p("div",{className:N("font-sans relative",e),role:"form",children:[u("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:u(te,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),u("input",{className:N("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:r,autoFocus:n,onChange:s,onFocus:a})]})})),Zm=(e,t)=>(n,l)=>{for(const[a,i]of l)n.set(a,e(n.get(a)||t,i));return n},eh=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),th=e=>t=>e.map((([e,n])=>[Hm(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>lh(t,e))).reduce(Zm(Math.max,0),new Map),nh=e=>t=>{return cs(t,t.map((({title:e})=>e)).map((e=>t=>{const n=eh(t||"");return n.length?Be(e.map((e=>Ia(n.map(Hm(e)))))):0})(e))).sort((e=>(t,n)=>-e(t,n))((n=([,e])=>e,(e,t)=>n(e)-n(t)))).map((([e])=>e));var n},lh=(e,t)=>new Map(e.map((e=>[e,t]))),ah=({basePathList:e,initialQuery:t=""})=>{const[n,i]=l(t||"");a((()=>{null!=t&&i(t)}),[t]);const{data:r}=ht(e?.length?e:null,ih),[s,o]=l(null);return Zd((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:l}=t||{};if(!(e&&n?.length&&l&&Object.keys(l).length))return[];const a=eh(e);if(!a.length)return[];const i=Object.entries(l),r=[...a.map(th(i)).reduce(Zm(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>n[e]));return nh(a)(r)})(n)))}),[r,n]),[s,{value:n,onChange:i}]},ih=async(...e)=>(await Promise.allSettled(e.map((e=>pt(j(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),rh=g((({className:e,topItems:t})=>{const n=de({isRemote:!0});return u("div",{className:N("flex items-start justify-between",e),children:t?.map(n).map(oh)})})),sh=["all","footer"],oh=(e,t)=>{const{text:n,items:l=[],href:a,target:i,onClick:r}=e,s=l.filter((e=>!e.displayArea||sh.includes(e.displayArea.toLowerCase())));return p("div",{className:"flex flex-col gap-s w-1/4",children:[u("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:i||"_self",onClick:r,children:n||`Раздел ${t}`}),s.map(((e,t)=>u(ch,{...e,basePath:o(a),index:t},String(t))))]},String(t))},ch=g((({text:e,index:t,basePath:n,...l})=>{const a=de({isRemote:!(!d.BASE_PATH||!n)&&!d.BASE_PATH.startsWith(n),basePath:n}),{href:i,target:r,onClick:s}=a(l);return u("a",{className:N("text-l font-light text-secondary-text hover:text-primary-main no-underline","overflow-x-hidden overflow-ellipsis whitespace-nowrap"),href:i,target:r||"_self",onClick:s,children:e||`Раздел ${t}`})})),dh=g((({initialQuery:e})=>{const{topItems:t}=Hs(),n=r((()=>t?.map((e=>e.href||"/"))),[t]),[l,i]=ah({basePathList:n,initialQuery:e}),s=r((()=>mh(t)(l)),[t,l]);return a((()=>function(e){for(const t of e.filter((({items:e})=>e?.length)))console.group(t.text),console.table(t.items,["text","href"]),console.groupEnd()}(s)),[s]),u(Um,{head:u(Qm,{autoFocus:!0,...i}),children:u(rh,{topItems:s})})})),mh=e=>t=>e?.length&&t?.length?cs(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:j("/",t)})))}))):[];const hh=g((({className:e})=>{const[t,n]=l(""),a=i((()=>n("")),[]),{open:r}=(()=>{const{open:e,close:t}=oe();return{open:(t={},n={})=>e(u(dh,{...t}),n),close:t}})(),s=i((e=>{n(e),uh(e)&&r({initialQuery:e},{onClose:a})}),[a]);return p("div",{className:N("relative",e),children:[u(Qm,{value:t,onChange:s}),u(Rm,{className:"absolute top-0 right-0 sm:hidden",onClose:a})]})})),uh=e=>e&&e.length>=3,ph=g((({item:e,basePath:t})=>{const n=de({isRemote:!(!d.BASE_PATH||!t)&&!d.BASE_PATH.startsWith(t),basePath:t}),{href:l,target:a,onClick:i}=n(e),r=v(),s=Em(r)({href:l});return p("a",{className:N(s?"text-primary-main":"text-primary-text","py-3 text-h5 font-light flex justify-between cursor-pointer"),href:l,target:a,onClick:i,children:[e.text,u(te,{image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24",className:"text-secondary-text rotate-180 opacity-30"})]})})),gh=g((({activeMenuSubItems:e,basePath:t})=>e?u("div",{className:"mb-5",children:e.map(((e,n)=>u(ph,{item:e,basePath:t},String(n))))}):null)),xh=({item:e,isActive:t,onClick:n})=>p("button",{type:"button",className:"relative",onClick:n,children:[u("span",{className:N("whitespace-nowrap",t?"text-primary-main":""),children:e.text}),t?u("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent"}):null]}),fh=g((e=>{const{topItems:t,officesLink:n,defaultLocation:s}=Hs(e.options?.page?.fallback),[o]=ys(s),c=(()=>{const{open:e,close:t}=oe();return{open:(t={})=>e(u(Xm,{}),t),close:t}})(),d=i((()=>c.open()),[]),[m,h]=Aa({itemCount:t?.length??0}),[g]=Om(t),[x,f]=l(g),b=r((()=>t?.[x]),[t,x]),y=b?.items||[];a((()=>{f(g)}),[g]),a((()=>{x>0&&h.scrollTo(x)}),[x,h]);const v=i((e=>f(e)),[]);return u(Um,{head:u("div",{className:"flex items-center",children:u(T,{as:"h4",title:"Меню"})}),children:p("div",{className:"flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md",children:[u("div",{className:"w-full mb-3",children:u(ya,{containerRef:m,visibleItemCount:0,gap:20,className:"pb-3",children:t?.map(((e,t)=>u(xh,{item:e,isActive:x===t,onClick:()=>v(t)},String(t))))})}),p("div",{className:"relative grow overflow-auto",children:[u(gh,{activeMenuSubItems:y,basePath:b?.href}),u(hh,{className:"grow mb-5"}),bh(n),p("div",{className:"flex items-center text-s cursor-pointer",onClick:d,children:[u(te,{image:{icon:"GeolocationIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),p("div",{className:"flex flex-col items-start",children:[u(Ve,{size:"text-h5",children:o.name}),u(Ve,{color:"text-secondary-text",size:"text-s",children:"Ваша локация"})]})]})]})]})})})),bh=e=>e?p("a",{className:"flex items-center mb-3",href:e,rel:"noopener noreferrer","aria-label":"Офисы и банкоматы",children:[u(te,{image:{icon:"MapOpenedIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),u("span",{children:"Офисы и банкоматы"})]}):null,yh="burgerMenuDialog",vh=[],Nh=g((({...e})=>{const[t,{toggle:n,close:l}]=(()=>{const{open:e,closeAll:t,close:n}=oe(),l=Dm(),a=((e,t)=>t.find((t=>t.id===e),e))(yh,l),r=i((()=>e(u(fh,{}),{id:yh})),[]),s=i((()=>{a?t():r()}),[a]);return[Boolean(a),{open:r,close:n,toggle:s}]})(),a=d.STICKY_MOBILE_MENU||"sticky-mobile-menu",{menuItems:r=vh}=bt(a,{fallback:e.options?.page?.fallback,pathDir:j(d.BASE_PATH,"portal-resources")}),[,s]=Om(r),o=Math.floor(r.length/2),c=r.slice(0,o),m=r.slice(o);return u("div",{className:"w-full mb-5","data-component":"sticky-bottom-menu-container",children:u("div",{className:"fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]",children:p("div",{className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[c.map(wh(s,l)),u(Lm,{isActive:t,onClick:n}),m.map(wh(s,l))]})})})})),wh=(e,t)=>(n,l)=>u($m,{isActive:n===e,item:n,onClick:t},n.href||String(l)),kh=h();const Sh=g((({className:e,onClick:t,ariaLabel:n})=>u("button",{type:"button",className:`border-0 w-9 bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":n,children:Ch()}))),Ch=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[Th("M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"),Th("M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z")]}),Th=e=>u("path",{stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",strokeMiterlimit:"10",d:e}),Ih=g((({className:e=""})=>{const t=function(e){const[t,n]=l(0);return a((()=>{(async()=>{const[t]=await kh.getLikeCount(e);n(t?.value||0)})()}),[e]),{likeCount:t,like:i((async()=>{n(await kh.like(e))}),[e]),dislike:i((async()=>{n(await kh.dislike(e))}),[e])}}(v().pathname);return p("div",{className:`border-main border-2 border-solid bg-white flex w-32 items-center justify-center gap-s p-xs font-sans ${e}`,children:[u(Sh,{onClick:ce(t.like),ariaLabel:"Поставить отметку «лайк»"}),u(Sh,{onClick:ce(t.dislike),className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),u("span",{className:"select-none",children:t.likeCount})]})})),Bh=g((({className:e,blocksRegistry:t,blockDecorator:n,data:l={}})=>{const{style:a,slots:i,likeControl:r,colorPalette:s="pc"}=l,o={key:"",page:l,blocksRegistry:t,blockDecorator:n,parent:l};return p("div",{"data-theme":s,children:[p("section",{className:N("@container relative",a,e),children:[i?.header?u("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:z(i?.header,{...o,slotName:"header"})}):null,p("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:l,options:o,extraProps:{className:"scroll-mt-12"}}),z(i?.footer,{...o,slotName:"footer"})]}),r?u("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:u(Ih,{className:"rounded-tl-3xl sticky bottom-0 pointer-events-auto"})}):null]}),u(Nh,{options:o}),u(_m,{}),u(Fm,{}),u(Vm,{termLink:{href:"/pd-policy#cookie",target:"_blank"},personalDataPolicyLink:{href:"/pd-policy",target:"_blank"}})]})}));Bh.childrenTypes=[],Bh.slots=()=>["header","footer"];e.Blocks=Mm,e.ContentPage=Bh,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))))))(),n=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await n.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.LikeAPI=h,e.handlerDecorator=ce,e.joinList=e=>t=>t.reduce(((t,n,l)=>t.length?t.concat({...e,key:`sep-${l}`},n):[n]),[]),e.packageVersion="0.14.151",e.projectSettings=d,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=O,e.useRouter=v,Object.defineProperty(e,"__esModule",{value:!0})}));